diff --git "a/assets/main.js" "b/assets/main.js" deleted file mode 100644--- "a/assets/main.js" +++ /dev/null @@ -1,4068 +0,0 @@ -(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 u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function t(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(a){if(a.ep)return;a.ep=!0;const u=t(a);fetch(a.href,u)}})();function iS(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var A_={exports:{}},Cp={};var Pb;function OA(){if(Pb)return Cp;Pb=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,a,u){var f=null;if(u!==void 0&&(f=""+u),a.key!==void 0&&(f=""+a.key),"key"in a){u={};for(var d in a)d!=="key"&&(u[d]=a[d])}else u=a;return a=u.ref,{$$typeof:o,type:i,key:f,ref:a!==void 0?a:null,props:u}}return Cp.Fragment=e,Cp.jsx=t,Cp.jsxs=t,Cp}var zb;function PA(){return zb||(zb=1,A_.exports=OA()),A_.exports}var Gt=PA(),w_={exports:{}},Yt={};var Bb;function zA(){if(Bb)return Yt;Bb=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),x=Symbol.iterator;function M(W){return W===null||typeof W!="object"?null:(W=x&&W[x]||W["@@iterator"],typeof W=="function"?W:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,w={};function A(W,ee,Ee){this.props=W,this.context=ee,this.refs=w,this.updater=Ee||T}A.prototype.isReactComponent={},A.prototype.setState=function(W,ee){if(typeof W!="object"&&typeof W!="function"&&W!=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,W,ee,"setState")},A.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function R(){}R.prototype=A.prototype;function L(W,ee,Ee){this.props=W,this.context=ee,this.refs=w,this.updater=Ee||T}var I=L.prototype=new R;I.constructor=L,D(I,A.prototype),I.isPureReactComponent=!0;var V=Array.isArray;function z(){}var H={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function P(W,ee,Ee){var Oe=Ee.ref;return{$$typeof:o,type:W,key:ee,ref:Oe!==void 0?Oe:null,props:Ee}}function Q(W,ee){return P(W.type,ee,W.props)}function X(W){return typeof W=="object"&&W!==null&&W.$$typeof===o}function te(W){var ee={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(Ee){return ee[Ee]})}var $=/\/+/g;function ue(W,ee){return typeof W=="object"&&W!==null&&W.key!=null?te(""+W.key):ee.toString(36)}function se(W){switch(W.status){case"fulfilled":return W.value;case"rejected":throw W.reason;default:switch(typeof W.status=="string"?W.then(z,z):(W.status="pending",W.then(function(ee){W.status==="pending"&&(W.status="fulfilled",W.value=ee)},function(ee){W.status==="pending"&&(W.status="rejected",W.reason=ee)})),W.status){case"fulfilled":return W.value;case"rejected":throw W.reason}}throw W}function q(W,ee,Ee,Oe,st){var ce=typeof W;(ce==="undefined"||ce==="boolean")&&(W=null);var Ce=!1;if(W===null)Ce=!0;else switch(ce){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(W.$$typeof){case o:case e:Ce=!0;break;case _:return Ce=W._init,q(Ce(W._payload),ee,Ee,Oe,st)}}if(Ce)return st=st(W),Ce=Oe===""?"."+ue(W,0):Oe,V(st)?(Ee="",Ce!=null&&(Ee=Ce.replace($,"$&/")+"/"),q(st,ee,Ee,"",function(yt){return yt})):st!=null&&(X(st)&&(st=Q(st,Ee+(st.key==null||W&&W.key===st.key?"":(""+st.key).replace($,"$&/")+"/")+Ce)),ee.push(st)),1;Ce=0;var Be=Oe===""?".":Oe+":";if(V(W))for(var et=0;et>>1,Ue=q[_e];if(0>>1;_ea(Ee,ye))Oea(st,Ee)?(q[_e]=st,q[Oe]=ye,_e=Oe):(q[_e]=Ee,q[ee]=ye,_e=ee);else if(Oea(st,ye))q[_e]=st,q[Oe]=ye,_e=Oe;else break e}}return Z}function a(q,Z){var ye=q.sortIndex-Z.sortIndex;return ye!==0?ye:q.id-Z.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;o.unstable_now=function(){return u.now()}}else{var f=Date,d=f.now();o.unstable_now=function(){return f.now()-d}}var m=[],g=[],_=1,S=null,x=3,M=!1,T=!1,D=!1,w=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function I(q){for(var Z=t(g);Z!==null;){if(Z.callback===null)i(g);else if(Z.startTime<=q)i(g),Z.sortIndex=Z.expirationTime,e(m,Z);else break;Z=t(g)}}function V(q){if(D=!1,I(q),!T)if(t(m)!==null)T=!0,z||(z=!0,te());else{var Z=t(g);Z!==null&&se(V,Z.startTime-q)}}var z=!1,H=-1,U=5,P=-1;function Q(){return w?!0:!(o.unstable_now()-Pq&&Q());){var _e=S.callback;if(typeof _e=="function"){S.callback=null,x=S.priorityLevel;var Ue=_e(S.expirationTime<=q);if(q=o.unstable_now(),typeof Ue=="function"){S.callback=Ue,I(q),Z=!0;break t}S===t(m)&&i(m),I(q)}else i(m);S=t(m)}if(S!==null)Z=!0;else{var W=t(g);W!==null&&se(V,W.startTime-q),Z=!1}}break e}finally{S=null,x=ye,M=!1}Z=void 0}}finally{Z?te():z=!1}}}var te;if(typeof L=="function")te=function(){L(X)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,ue=$.port2;$.port1.onmessage=X,te=function(){ue.postMessage(null)}}else te=function(){A(X,0)};function se(q,Z){H=A(function(){q(o.unstable_now())},Z)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(q){q.callback=null},o.unstable_forceFrameRate=function(q){0>q||125_e?(q.sortIndex=ye,e(g,q),t(m)===null&&q===t(g)&&(D?(R(H),H=-1):D=!0,se(V,ye-_e))):(q.sortIndex=Ue,e(m,q),T||M||(T=!0,z||(z=!0,te()))),q},o.unstable_shouldYield=Q,o.unstable_wrapCallback=function(q){var Z=x;return function(){var ye=x;x=Z;try{return q.apply(this,arguments)}finally{x=ye}}}})(D_)),D_}var kb;function k1(){return kb||(kb=1,R_.exports=BA()),R_.exports}var N_={exports:{}},Ds={};var Hb;function FA(){if(Hb)return Ds;Hb=1;var o=Sm();function e(m){var g="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(e){console.error(e)}}return o(),N_.exports=FA(),N_.exports}var Wb;function kA(){if(Wb)return Rp;Wb=1;var o=k1(),e=Sm(),t=VA();function i(n){var s="https://react.dev/errors/"+n;if(1Ue||(n.current=_e[Ue],_e[Ue]=null,Ue--)}function Ee(n,s){Ue++,_e[Ue]=n.current,n.current=s}var Oe=W(null),st=W(null),ce=W(null),Ce=W(null);function Be(n,s){switch(Ee(ce,s),Ee(st,n),Ee(Oe,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?ab(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=ab(s),n=rb(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ee(Oe),Ee(Oe,n)}function et(){ee(Oe),ee(st),ee(ce)}function yt(n){n.memoizedState!==null&&Ee(Ce,n);var s=Oe.current,c=rb(s,n.type);s!==c&&(Ee(st,n),Ee(Oe,c))}function wt(n){st.current===n&&(ee(Oe),ee(st)),Ce.current===n&&(ee(Ce),Ep._currentValue=ye)}var ln,Dt;function Re(n){if(ln===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);ln=s&&s[1]||"",Dt=-1)":-1y||J[h]!==pe[y]){var we=` -`+J[h].replace(" at new "," at ");return n.displayName&&we.includes("")&&(we=we.replace("",n.displayName)),we}while(1<=h&&0<=y);break}}}finally{Ve=!1,Error.prepareStackTrace=c}return(c=n?n.displayName||n.name:"")?Re(c):""}function Je(n,s){switch(n.tag){case 26:case 27:case 5:return Re(n.type);case 16:return Re("Lazy");case 13:return n.child!==s&&s!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Ne(n.type,!1);case 11:return Ne(n.type.render,!1);case 1:return Ne(n.type,!0);case 31:return Re("Activity");default:return""}}function j(n){try{var s="",c=null;do s+=Je(n,c),c=n,n=n.return;while(n);return s}catch(h){return` -Error generating stack: `+h.message+` -`+h.stack}}var xt=Object.prototype.hasOwnProperty,nt=o.unstable_scheduleCallback,Mt=o.unstable_cancelCallback,Xe=o.unstable_shouldYield,G=o.unstable_requestPaint,O=o.unstable_now,re=o.unstable_getCurrentPriorityLevel,be=o.unstable_ImmediatePriority,Le=o.unstable_UserBlockingPriority,Te=o.unstable_NormalPriority,rt=o.unstable_LowPriority,qe=o.unstable_IdlePriority,St=o.log,At=o.unstable_setDisableYieldValue,Fe=null,ke=null;function ft(n){if(typeof St=="function"&&At(n),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(Fe,n)}catch{}}var ot=Math.clz32?Math.clz32:ae,ct=Math.log,Zt=Math.LN2;function ae(n){return n>>>=0,n===0?32:31-(ct(n)/Zt|0)|0}var Ze=256,We=262144,ut=4194304;function He(n){var s=n&42;if(s!==0)return s;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 Ae(n,s,c){var h=n.pendingLanes;if(h===0)return 0;var y=0,b=n.suspendedLanes,N=n.pingedLanes;n=n.warmLanes;var F=h&134217727;return F!==0?(h=F&~b,h!==0?y=He(h):(N&=F,N!==0?y=He(N):c||(c=F&~n,c!==0&&(y=He(c))))):(F=h&~b,F!==0?y=He(F):N!==0?y=He(N):c||(c=h&~n,c!==0&&(y=He(c)))),y===0?0:s!==0&&s!==y&&(s&b)===0&&(b=y&-y,c=s&-s,b>=c||b===32&&(c&4194048)!==0)?s:y}function dt(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function zt(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 pn(){var n=ut;return ut<<=1,(ut&62914560)===0&&(ut=4194304),n}function vn(n){for(var s=[],c=0;31>c;c++)s.push(n);return s}function Ji(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function _s(n,s,c,h,y,b){var N=n.pendingLanes;n.pendingLanes=c,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=c,n.entangledLanes&=c,n.errorRecoveryDisabledLanes&=c,n.shellSuspendCounter=0;var F=n.entanglements,J=n.expirationTimes,pe=n.hiddenUpdates;for(c=N&~c;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Ii=/[\n"\\]/g;function It(n){return n.replace(Ii,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Oi(n,s,c,h,y,b,N,F){n.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?n.type=N:n.removeAttribute("type"),s!=null?N==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+Qt(s)):n.value!==""+Qt(s)&&(n.value=""+Qt(s)):N!=="submit"&&N!=="reset"||n.removeAttribute("value"),s!=null?wi(n,N,Qt(s)):c!=null?wi(n,N,Qt(c)):h!=null&&n.removeAttribute("value"),y==null&&b!=null&&(n.defaultChecked=!!b),y!=null&&(n.checked=y&&typeof y!="function"&&typeof y!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?n.name=""+Qt(F):n.removeAttribute("name")}function os(n,s,c,h,y,b,N,F){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(n.type=b),s!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||s!=null)){yn(n);return}c=c!=null?""+Qt(c):"",s=s!=null?""+Qt(s):c,F||s===n.value||(n.value=s),n.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,n.checked=F?n.checked:!!h,n.defaultChecked=!!h,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(n.name=N),yn(n)}function wi(n,s,c){s==="number"&&$e(n.ownerDocument)===n||n.defaultValue===""+c||(n.defaultValue=""+c)}function Ki(n,s,c,h){if(n=n.options,s){s={};for(var y=0;y"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),od=!1;if(Xa)try{var Nl={};Object.defineProperty(Nl,"passive",{get:function(){od=!0}}),window.addEventListener("test",Nl,Nl),window.removeEventListener("test",Nl,Nl)}catch{od=!1}var Bs=null,uf=null,Wo=null;function Hu(){if(Wo)return Wo;var n,s=uf,c=s.length,h,y="value"in Bs?Bs.value:Bs.textContent,b=y.length;for(n=0;n=Pl),qm=" ",Yu=!1;function vf(n,s){switch(n){case"keyup":return Xm.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pd(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Yo=!1;function Ym(n,s){switch(n){case"compositionend":return pd(s);case"keypress":return s.which!==32?null:(Yu=!0,qm);case"textInput":return n=s.data,n===qm&&Yu?null:n;default:return null}}function md(n,s){if(Yo)return n==="compositionend"||!qo&&vf(n,s)?(n=Hu(),Wo=uf=Bs=null,Yo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:c,offset:s-n};n=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Qu(c)}}function Bn(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?Bn(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function Km(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=$e(n.document);s instanceof n.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)n=s.contentWindow;else break;s=$e(n.document)}return s}function Md(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}var $m=Xa&&"documentMode"in document&&11>=document.documentMode,Ya=null,ja=null,Vl=null,_f=!1;function kl(n,s,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;_f||Ya==null||Ya!==$e(h)||(h=Ya,"selectionStart"in h&&Md(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Vl&&Bl(Vl,h)||(Vl=h,h=Kg(ja,"onSelect"),0>=N,y-=N,Kn=1<<32-ot(s)+y|c<sn?(xn=bt,bt=null):xn=bt.sibling;var Rn=ve(oe,bt,he[sn],De);if(Rn===null){bt===null&&(bt=xn);break}n&&bt&&Rn.alternate===null&&s(oe,bt),ne=b(Rn,ne,sn),Cn===null?Rt=Rn:Cn.sibling=Rn,Cn=Rn,bt=xn}if(sn===he.length)return c(oe,bt),hn&&Qa(oe,sn),Rt;if(bt===null){for(;snsn?(xn=bt,bt=null):xn=bt.sibling;var yu=ve(oe,bt,Rn.value,De);if(yu===null){bt===null&&(bt=xn);break}n&&bt&&yu.alternate===null&&s(oe,bt),ne=b(yu,ne,sn),Cn===null?Rt=yu:Cn.sibling=yu,Cn=yu,bt=xn}if(Rn.done)return c(oe,bt),hn&&Qa(oe,sn),Rt;if(bt===null){for(;!Rn.done;sn++,Rn=he.next())Rn=Ie(oe,Rn.value,De),Rn!==null&&(ne=b(Rn,ne,sn),Cn===null?Rt=Rn:Cn.sibling=Rn,Cn=Rn);return hn&&Qa(oe,sn),Rt}for(bt=h(bt);!Rn.done;sn++,Rn=he.next())Rn=Me(bt,oe,sn,Rn.value,De),Rn!==null&&(n&&Rn.alternate!==null&&bt.delete(Rn.key===null?sn:Rn.key),ne=b(Rn,ne,sn),Cn===null?Rt=Rn:Cn.sibling=Rn,Cn=Rn);return n&&bt.forEach(function(IA){return s(oe,IA)}),hn&&Qa(oe,sn),Rt}function Hn(oe,ne,he,De){if(typeof he=="object"&&he!==null&&he.type===D&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case M:e:{for(var Rt=he.key;ne!==null;){if(ne.key===Rt){if(Rt=he.type,Rt===D){if(ne.tag===7){c(oe,ne.sibling),De=y(ne,he.props.children),De.return=oe,oe=De;break e}}else if(ne.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===U&&Ko(Rt)===ne.type){c(oe,ne.sibling),De=y(ne,he.props),da(De,he),De.return=oe,oe=De;break e}c(oe,ne);break}else s(oe,ne);ne=ne.sibling}he.type===D?(De=ao(he.props.children,oe.mode,De,he.key),De.return=oe,oe=De):(De=Za(he.type,he.key,he.props,null,oe.mode,De),da(De,he),De.return=oe,oe=De)}return N(oe);case T:e:{for(Rt=he.key;ne!==null;){if(ne.key===Rt)if(ne.tag===4&&ne.stateNode.containerInfo===he.containerInfo&&ne.stateNode.implementation===he.implementation){c(oe,ne.sibling),De=y(ne,he.children||[]),De.return=oe,oe=De;break e}else{c(oe,ne);break}else s(oe,ne);ne=ne.sibling}De=Ef(he,oe.mode,De),De.return=oe,oe=De}return N(oe);case U:return he=Ko(he),Hn(oe,ne,he,De)}if(se(he))return vt(oe,ne,he,De);if(te(he)){if(Rt=te(he),typeof Rt!="function")throw Error(i(150));return he=Rt.call(he),Ot(oe,ne,he,De)}if(typeof he.then=="function")return Hn(oe,ne,rc(he),De);if(he.$$typeof===L)return Hn(oe,ne,Zl(oe,he),De);Ql(oe,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,ne!==null&&ne.tag===6?(c(oe,ne.sibling),De=y(ne,he),De.return=oe,oe=De):(c(oe,ne),De=Mf(he,oe.mode,De),De.return=oe,oe=De),N(oe)):c(oe,ne)}return function(oe,ne,he,De){try{nl=0;var Rt=Hn(oe,ne,he,De);return tl=null,Rt}catch(bt){if(bt===Jo||bt===$t)throw bt;var Cn=Jn(29,bt,null,oe.mode);return Cn.lanes=De,Cn.return=oe,Cn}}}var Ir=If(!0),Of=If(!1),fs=!1;function oc(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ud(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Or(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ho(n,s,c){var h=n.updateQueue;if(h===null)return null;if(h=h.shared,(Et&2)!==0){var y=h.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),h.pending=s,s=fa(n),io(n,null,c),s}return zi(n,h,s,c),fa(n)}function po(n,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var h=s.lanes;h&=n.pendingLanes,c|=h,s.lanes=c,Sr(n,c)}}function Ct(n,s){var c=n.updateQueue,h=n.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var y=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var N={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?y=b=N:b=b.next=N,c=c.next}while(c!==null);b===null?y=b=s:b=b.next=s}else y=b=s;c={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:h.shared,callbacks:h.callbacks},n.updateQueue=c;return}n=c.lastBaseUpdate,n===null?c.firstBaseUpdate=s:n.next=s,c.lastBaseUpdate=s}var Id=!1;function lc(){if(Id){var n=ha;if(n!==null)throw n}}function Jl(n,s,c,h){Id=!1;var y=n.updateQueue;fs=!1;var b=y.firstBaseUpdate,N=y.lastBaseUpdate,F=y.shared.pending;if(F!==null){y.shared.pending=null;var J=F,pe=J.next;J.next=null,N===null?b=pe:N.next=pe,N=J;var we=n.alternate;we!==null&&(we=we.updateQueue,F=we.lastBaseUpdate,F!==N&&(F===null?we.firstBaseUpdate=pe:F.next=pe,we.lastBaseUpdate=J))}if(b!==null){var Ie=y.baseState;N=0,we=pe=J=null,F=b;do{var ve=F.lane&-536870913,Me=ve!==F.lane;if(Me?(Jt&ve)===ve:(h&ve)===ve){ve!==0&&ve===Ur&&(Id=!0),we!==null&&(we=we.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var vt=n,Ot=F;ve=s;var Hn=c;switch(Ot.tag){case 1:if(vt=Ot.payload,typeof vt=="function"){Ie=vt.call(Hn,Ie,ve);break e}Ie=vt;break e;case 3:vt.flags=vt.flags&-65537|128;case 0:if(vt=Ot.payload,ve=typeof vt=="function"?vt.call(Hn,Ie,ve):vt,ve==null)break e;Ie=S({},Ie,ve);break e;case 2:fs=!0}}ve=F.callback,ve!==null&&(n.flags|=64,Me&&(n.flags|=8192),Me=y.callbacks,Me===null?y.callbacks=[ve]:Me.push(ve))}else Me={lane:ve,tag:F.tag,payload:F.payload,callback:F.callback,next:null},we===null?(pe=we=Me,J=Ie):we=we.next=Me,N|=ve;if(F=F.next,F===null){if(F=y.shared.pending,F===null)break;Me=F,F=Me.next,Me.next=null,y.lastBaseUpdate=Me,y.shared.pending=null}}while(!0);we===null&&(J=Ie),y.baseState=J,y.firstBaseUpdate=pe,y.lastBaseUpdate=we,b===null&&(y.shared.lanes=0),cr|=N,n.lanes=N,n.memoizedState=Ie}}function Kl(n,s){if(typeof n!="function")throw Error(i(191,n));n.call(s)}function lg(n,s){var c=n.callbacks;if(c!==null)for(n.callbacks=null,n=0;nb?b:8;var N=q.T,F={};q.T=F,ip(n,!1,s,c);try{var J=y(),pe=q.S;if(pe!==null&&pe(F,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var we=Nd(J,h);hc(n,s,we,Ys(n))}else hc(n,s,h,Ys(n))}catch(Ie){hc(n,s,{then:function(){},status:"rejected",reason:Ie},Ys())}finally{Z.p=b,N!==null&&F.types!==null&&(N.types=F.types),q.T=N}}function $y(){}function tp(n,s,c,h){if(n.tag!==5)throw Error(i(476));var y=Og(n).queue;Ig(n,y,s,ye,c===null?$y:function(){return Pg(n),c(h)})}function Og(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:ye},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:c},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function Pg(n){var s=Og(n);s.next===null&&(s=n.alternate.memoizedState),hc(n,s.next.queue,{},Ys())}function np(){return Pt(Ep)}function zg(){return pi().memoizedState}function Bg(){return pi().memoizedState}function e_(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var c=Ys();n=Or(c);var h=ho(s,n,c);h!==null&&(tn(h,s,c),po(h,s,c)),s={cache:Cd()},n.payload=s;return}s=s.return}}function t_(n,s,c){var h=Ys();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Wf(n)?Vg(s,c):(c=Sf(n,s,c,h),c!==null&&(tn(c,n,h),kg(c,s,h)))}function Fg(n,s,c){var h=Ys();hc(n,s,c,h)}function hc(n,s,c,h){var y={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Wf(n))Vg(s,y);else{var b=n.alternate;if(n.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var N=s.lastRenderedState,F=b(N,c);if(y.hasEagerState=!0,y.eagerState=F,us(F,N))return zi(n,s,y,0),Vt===null&&tc(),!1}catch{}if(c=Sf(n,s,y,h),c!==null)return tn(c,n,h),kg(c,s,h),!0}return!1}function ip(n,s,c,h){if(h={lane:2,revertLane:xe(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Wf(n)){if(s)throw Error(i(479))}else s=Sf(n,c,h,2),s!==null&&tn(s,n,2)}function Wf(n){var s=n.alternate;return n===Xt||s!==null&&s===Xt}function Vg(n,s){eu=pa=!0;var c=n.pending;c===null?s.next=s:(s.next=c.next,c.next=s),n.pending=s}function kg(n,s,c){if((c&4194048)!==0){var h=s.lanes;h&=n.pendingLanes,c|=h,s.lanes=c,Sr(n,c)}}var nu={readContext:Pt,use:mo,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useLayoutEffect:$n,useInsertionEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useSyncExternalStore:$n,useId:$n,useHostTransitionStatus:$n,useFormState:$n,useActionState:$n,useOptimistic:$n,useMemoCache:$n,useCacheRefresh:$n};nu.useEffectEvent=$n;var Hg={readContext:Pt,use:mo,useCallback:function(n,s){return Ci().memoizedState=[n,s===void 0?null:s],n},useContext:Pt,useEffect:Eg,useImperativeHandle:function(n,s,c){c=c!=null?c.concat([n]):null,Hf(4194308,4,Rg.bind(null,s,n),c)},useLayoutEffect:function(n,s){return Hf(4194308,4,n,s)},useInsertionEffect:function(n,s){Hf(4,2,n,s)},useMemo:function(n,s){var c=Ci();s=s===void 0?null:s;var h=n();if(il){ft(!0);try{n()}finally{ft(!1)}}return c.memoizedState=[h,s],h},useReducer:function(n,s,c){var h=Ci();if(c!==void 0){var y=c(s);if(il){ft(!0);try{c(s)}finally{ft(!1)}}}else y=s;return h.memoizedState=h.baseState=y,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:y},h.queue=n,n=n.dispatch=t_.bind(null,Xt,n),[h.memoizedState,n]},useRef:function(n){var s=Ci();return n={current:n},s.memoizedState=n},useState:function(n){n=Xd(n);var s=n.queue,c=Fg.bind(null,Xt,s);return s.dispatch=c,[n.memoizedState,c]},useDebugValue:$d,useDeferredValue:function(n,s){var c=Ci();return ep(c,n,s)},useTransition:function(){var n=Xd(!1);return n=Ig.bind(null,Xt,n.queue,!0,!1),Ci().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,c){var h=Xt,y=Ci();if(hn){if(c===void 0)throw Error(i(407));c=c()}else{if(c=s(),Vt===null)throw Error(i(349));(Jt&127)!==0||dg(h,s,c)}y.memoizedState=c;var b={value:c,getSnapshot:s};return y.queue=b,Eg(mg.bind(null,h,b,n),[n]),h.flags|=2048,go(9,{destroy:void 0},pg.bind(null,h,b,c,s),null),c},useId:function(){var n=Ci(),s=Vt.identifierPrefix;if(hn){var c=Ua,h=Kn;c=(h&~(1<<32-ot(h)-1)).toString(32)+c,s="_"+s+"R_"+c,c=zf++,0<\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof h.is=="string"?N.createElement("select",{is:h.is}):N.createElement("select"),h.multiple?b.multiple=!0:h.size&&(b.size=h.size);break;default:b=typeof h.is=="string"?N.createElement(y,{is:h.is}):N.createElement(y)}}b[Qn]=s,b[fi]=h;e:for(N=s.child;N!==null;){if(N.tag===5||N.tag===6)b.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===s)break e;for(;N.sibling===null;){if(N.return===null||N.return===s)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}s.stateNode=b;e:switch(vs(b,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&ar(s)}}return In(s),gc(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,c),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==h&&ar(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(i(166));if(n=ce.current,Yl(s)){if(n=s.stateNode,c=s.memoizedProps,h=null,y=ri,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}n[Qn]=s,n=!!(n.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||ib(n.nodeValue,c)),n||Ka(s,!0)}else n=$g(n).createTextNode(h),n[Qn]=s,s.stateNode=n}return In(s),null;case 31:if(c=s.memoizedState,n===null||n.memoizedState!==null){if(h=Yl(s),c!==null){if(n===null){if(!h)throw Error(i(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[Qn]=s}else lo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;In(s),n=!1}else c=wf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=c),n=!0;if(!n)return s.flags&256?(di(s),s):(di(s),null);if((s.flags&128)!==0)throw Error(i(558))}return In(s),null;case 13:if(h=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(y=Yl(s),h!==null&&h.dehydrated!==null){if(n===null){if(!y)throw Error(i(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Qn]=s}else lo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;In(s),y=!1}else y=wf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(di(s),s):(di(s),null)}return di(s),(s.flags&128)!==0?(s.lanes=c,s):(c=h!==null,n=n!==null&&n.memoizedState!==null,c&&(h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),b=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==y&&(h.flags|=2048)),c!==n&&c&&(s.child.flags|=8192),Br(s,s.updateQueue),In(s),null);case 4:return et(),n===null&&r_(s.stateNode.containerInfo),In(s),null;case 10:return tr(s.type),In(s),null;case 19:if(ee(dn),h=s.memoizedState,h===null)return In(s),null;if(y=(s.flags&128)!==0,b=h.rendering,b===null)if(y)rr(h,!1);else{if(ei!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(b=Hs(n),b!==null){for(s.flags|=128,rr(h,!1),n=b.updateQueue,s.updateQueue=n,Br(s,n),s.subtreeFlags=0,n=c,c=s.child;c!==null;)Hl(c,n),c=c.sibling;return Ee(dn,dn.current&1|2),hn&&Qa(s,h.treeForkCount),s.child}n=n.sibling}h.tail!==null&&O()>gi&&(s.flags|=128,y=!0,rr(h,!1),s.lanes=4194304)}else{if(!y)if(n=Hs(b),n!==null){if(s.flags|=128,y=!0,n=n.updateQueue,s.updateQueue=n,Br(s,n),rr(h,!0),h.tail===null&&h.tailMode==="hidden"&&!b.alternate&&!hn)return In(s),null}else 2*O()-h.renderingStartTime>gi&&c!==536870912&&(s.flags|=128,y=!0,rr(h,!1),s.lanes=4194304);h.isBackwards?(b.sibling=s.child,s.child=b):(n=h.last,n!==null?n.sibling=b:s.child=b,h.last=b)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=O(),n.sibling=null,c=dn.current,Ee(dn,y?c&1|2:c&1),hn&&Qa(s,h.treeForkCount),n):(In(s),null);case 22:case 23:return di(s),uc(),h=s.memoizedState!==null,n!==null?n.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(c&536870912)!==0&&(s.flags&128)===0&&(In(s),s.subtreeFlags&6&&(s.flags|=8192)):In(s),c=s.updateQueue,c!==null&&Br(s,c.retryQueue),c=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==c&&(s.flags|=2048),n!==null&&ee(fo),null;case 24:return c=null,n!==null&&(c=n.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),tr(xi),In(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function ga(n,s){switch(Tf(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return tr(xi),et(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return wt(s),null;case 31:if(s.memoizedState!==null){if(di(s),s.alternate===null)throw Error(i(340));lo()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(di(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(i(340));lo()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return ee(dn),null;case 4:return et(),null;case 10:return tr(s.type),null;case 22:case 23:return di(s),uc(),n!==null&&ee(fo),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return tr(xi),null;case 25:return null;default:return null}}function Gs(n,s){switch(Tf(s),s.tag){case 3:tr(xi),et();break;case 26:case 27:case 5:wt(s);break;case 4:et();break;case 31:s.memoizedState!==null&&di(s);break;case 13:di(s);break;case 19:ee(dn);break;case 10:tr(s.type);break;case 22:case 23:di(s),uc(),n!==null&&ee(fo);break;case 24:tr(xi)}}function va(n,s){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var y=h.next;c=y;do{if((c.tag&n)===n){h=void 0;var b=c.create,N=c.inst;h=b(),N.destroy=h}c=c.next}while(c!==y)}}catch(F){Mn(s,s.return,F)}}function Xi(n,s,c){try{var h=s.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var b=y.next;h=b;do{if((h.tag&n)===n){var N=h.inst,F=N.destroy;if(F!==void 0){N.destroy=void 0,y=s;var J=c,pe=F;try{pe()}catch(we){Mn(y,J,we)}}}h=h.next}while(h!==b)}}catch(we){Mn(s,s.return,we)}}function Ia(n){var s=n.updateQueue;if(s!==null){var c=n.stateNode;try{lg(s,c)}catch(h){Mn(n,n.return,h)}}}function Fi(n,s,c){c.props=vo(n.type,n.memoizedProps),c.state=n.memoizedState;try{c.componentWillUnmount()}catch(h){Mn(n,s,h)}}function Fr(n,s){try{var c=n.ref;if(c!==null){switch(n.tag){case 26:case 27:case 5:var h=n.stateNode;break;case 30:h=n.stateNode;break;default:h=n.stateNode}typeof c=="function"?n.refCleanup=c(h):c.current=h}}catch(y){Mn(n,s,y)}}function qi(n,s){var c=n.ref,h=n.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(y){Mn(n,s,y)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){Mn(n,s,y)}else c.current=null}function yc(n){var s=n.type,c=n.memoizedProps,h=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(y){Mn(n,n.return,y)}}function Di(n,s,c){try{var h=n.stateNode;sA(h,n.type,c,s),h[fi]=s}catch(y){Mn(n,n.return,y)}}function jn(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&du(n.type)||n.tag===4}function cn(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||jn(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&&du(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 or(n,s,c){var h=n.tag;if(h===5||h===6)n=n.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(n,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(n),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=wr));else if(h!==4&&(h===27&&du(n.type)&&(c=n.stateNode,s=null),n=n.child,n!==null))for(or(n,s,c),n=n.sibling;n!==null;)or(n,s,c),n=n.sibling}function ds(n,s,c){var h=n.tag;if(h===5||h===6)n=n.stateNode,s?c.insertBefore(n,s):c.appendChild(n);else if(h!==4&&(h===27&&du(n.type)&&(c=n.stateNode),n=n.child,n!==null))for(ds(n,s,c),n=n.sibling;n!==null;)ds(n,s,c),n=n.sibling}function nh(n){var s=n.stateNode,c=n.memoizedProps;try{for(var h=n.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);vs(s,h,c),s[Qn]=n,s[fi]=c}catch(b){Mn(n,n.return,b)}}var ya=!1,Vn=!1,Oa=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,Vi=null;function i_(n,s){if(n=n.containerInfo,u_=r0,n=Km(n),Md(n)){if("selectionStart"in n)var c={start:n.selectionStart,end:n.selectionEnd};else e:{c=(c=n.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var y=h.anchorOffset,b=h.focusNode;h=h.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var N=0,F=-1,J=-1,pe=0,we=0,Ie=n,ve=null;t:for(;;){for(var Me;Ie!==c||y!==0&&Ie.nodeType!==3||(F=N+y),Ie!==b||h!==0&&Ie.nodeType!==3||(J=N+h),Ie.nodeType===3&&(N+=Ie.nodeValue.length),(Me=Ie.firstChild)!==null;)ve=Ie,Ie=Me;for(;;){if(Ie===n)break t;if(ve===c&&++pe===y&&(F=N),ve===b&&++we===h&&(J=N),(Me=Ie.nextSibling)!==null)break;Ie=ve,ve=Ie.parentNode}Ie=Me}c=F===-1||J===-1?null:{start:F,end:J}}else c=null}c=c||{start:0,end:0}}else c=null;for(c_={focusedElem:n,selectionRange:c},r0=!1,Vi=s;Vi!==null;)if(s=Vi,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,Vi=n;else for(;Vi!==null;){switch(s=Vi,b=s.alternate,n=s.flags,s.tag){case 0:if((n&4)!==0&&(n=s.updateQueue,n=n!==null?n.events:null,n!==null))for(c=0;c title"))),vs(b,h,c),b[Qn]=n,ie(b),h=b;break e;case"link":var N=xb("link","href",y).get(h+(c.href||""));if(N){for(var F=0;FHn&&(N=Hn,Hn=Ot,Ot=N);var oe=Fl(F,Ot),ne=Fl(F,Hn);if(oe&&ne&&(Me.rangeCount!==1||Me.anchorNode!==oe.node||Me.anchorOffset!==oe.offset||Me.focusNode!==ne.node||Me.focusOffset!==ne.offset)){var he=Ie.createRange();he.setStart(oe.node,oe.offset),Me.removeAllRanges(),Ot>Hn?(Me.addRange(he),Me.extend(ne.node,ne.offset)):(he.setEnd(ne.node,ne.offset),Me.addRange(he))}}}}for(Ie=[],Me=F;Me=Me.parentNode;)Me.nodeType===1&&Ie.push({element:Me,left:Me.scrollLeft,top:Me.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;Fc?32:c,q.T=null,c=lu,lu=null;var b=qs,N=Ma;if(Nn=0,ru=qs=null,Ma=0,(Et&6)!==0)throw Error(i(331));var F=Et;if(Et|=4,ws(b.current),gp(b,b.current,N,c),Et=F,ht(0,!1),ke&&typeof ke.onPostCommitFiberRoot=="function")try{ke.onPostCommitFiberRoot(Fe,b)}catch{}return!0}finally{Z.p=y,q.T=h,hr(n,s)}}function _p(n,s,c){s=Fs(c,s),s=up(n.stateNode,s,2),n=ho(n,s,2),n!==null&&(Ji(n,2),Ge(n))}function Mn(n,s,c){if(n.tag===3)_p(n,n,c);else for(;s!==null;){if(s.tag===3){_p(s,n,c);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(vi===null||!vi.has(h))){n=Fs(c,n),c=cp(2),h=ho(s,c,2),h!==null&&(Xg(c,h,s,n),Ji(h,2),Ge(h));break}}s=s.return}}function Tc(n,s,c){var h=n.pingCache;if(h===null){h=n.pingCache=new qt;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(c)||(vp=!0,y.add(c),n=r.bind(null,n,s,c),s.then(n,n))}function r(n,s,c){var h=n.pingCache;h!==null&&h.delete(s),n.pingedLanes|=n.suspendedLanes&c,n.warmLanes&=~c,Vt===n&&(Jt&c)===c&&(ei===4||ei===3&&(Jt&62914560)===Jt&&300>O()-au?(Et&2)===0&&To(n,0):xc|=c,Wn===Jt&&(Wn=0)),Ge(n)}function l(n,s){s===0&&(s=pn()),n=cs(n,s),n!==null&&(Ji(n,s),Ge(n))}function p(n){var s=n.memoizedState,c=0;s!==null&&(c=s.retryLane),l(n,c)}function v(n,s){var c=0;switch(n.tag){case 31:case 13:var h=n.stateNode,y=n.memoizedState;y!==null&&(c=y.retryLane);break;case 19:h=n.stateNode;break;case 22:h=n.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(s),l(n,c)}function E(n,s){return nt(n,s)}var C=null,B=null,K=!1,Se=!1,Pe=!1,Qe=0;function Ge(n){n!==B&&n.next===null&&(B===null?C=B=n:B=B.next=n),Se=!0,K||(K=!0,le())}function ht(n,s){if(!Pe&&Se){Pe=!0;do for(var c=!1,h=C;h!==null;){if(n!==0){var y=h.pendingLanes;if(y===0)var b=0;else{var N=h.suspendedLanes,F=h.pingedLanes;b=(1<<31-ot(42|n)+1)-1,b&=y&~(N&~F),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(c=!0,me(h,b))}else b=Jt,b=Ae(h,h===Vt?b:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(b&3)===0||dt(h,b)||(c=!0,me(h,b));h=h.next}while(c);Pe=!1}}function Wt(){yi()}function yi(){Se=K=!1;var n=0;Qe!==0&&rA()&&(n=Qe);for(var s=O(),c=null,h=C;h!==null;){var y=h.next,b=hu(h,s);b===0?(h.next=null,c===null?C=y:c.next=y,y===null&&(B=c)):(c=h,(n!==0||(b&3)!==0)&&(Se=!0)),h=y}Nn!==0&&Nn!==5||ht(n),Qe!==0&&(Qe=0)}function hu(n,s){for(var c=n.suspendedLanes,h=n.pingedLanes,y=n.expirationTimes,b=n.pendingLanes&-62914561;0F)break;var we=J.transferSize,Ie=J.initiatorType;we&&sb(Ie)&&(J=J.responseEnd,N+=we*(J"u"?null:document;function gb(n,s,c){var h=lh;if(h&&typeof s=="string"&&s){var y=It(s);y='link[rel="'+n+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),mb.has(y)||(mb.add(y),n={rel:n,crossOrigin:c,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),vs(s,"link",n),ie(s),h.head.appendChild(s)))}}function mA(n){vl.D(n),gb("dns-prefetch",n,null)}function gA(n,s){vl.C(n,s),gb("preconnect",n,s)}function vA(n,s,c){vl.L(n,s,c);var h=lh;if(h&&n&&s){var y='link[rel="preload"][as="'+It(s)+'"]';s==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+It(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+It(c.imageSizes)+'"]')):y+='[href="'+It(n)+'"]';var b=y;switch(s){case"style":b=uh(n);break;case"script":b=ch(n)}pr.has(b)||(n=S({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:n,as:s},c),pr.set(b,n),h.querySelector(y)!==null||s==="style"&&h.querySelector(bp(b))||s==="script"&&h.querySelector(Mp(b))||(s=h.createElement("link"),vs(s,"link",n),ie(s),h.head.appendChild(s)))}}function yA(n,s){vl.m(n,s);var c=lh;if(c&&n){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+It(h)+'"][href="'+It(n)+'"]',b=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=ch(n)}if(!pr.has(b)&&(n=S({rel:"modulepreload",href:n},s),pr.set(b,n),c.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Mp(b)))return}h=c.createElement("link"),vs(h,"link",n),ie(h),c.head.appendChild(h)}}}function _A(n,s,c){vl.S(n,s,c);var h=lh;if(h&&n){var y=k(h).hoistableStyles,b=uh(n);s=s||"default";var N=y.get(b);if(!N){var F={loading:0,preload:null};if(N=h.querySelector(bp(b)))F.loading=5;else{n=S({rel:"stylesheet",href:n,"data-precedence":s},c),(c=pr.get(b))&&v_(n,c);var J=N=h.createElement("link");ie(J),vs(J,"link",n),J._p=new Promise(function(pe,we){J.onload=pe,J.onerror=we}),J.addEventListener("load",function(){F.loading|=1}),J.addEventListener("error",function(){F.loading|=2}),F.loading|=4,t0(N,s,h)}N={type:"stylesheet",instance:N,count:1,state:F},y.set(b,N)}}}function xA(n,s){vl.X(n,s);var c=lh;if(c&&n){var h=k(c).hoistableScripts,y=ch(n),b=h.get(y);b||(b=c.querySelector(Mp(y)),b||(n=S({src:n,async:!0},s),(s=pr.get(y))&&y_(n,s),b=c.createElement("script"),ie(b),vs(b,"link",n),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function SA(n,s){vl.M(n,s);var c=lh;if(c&&n){var h=k(c).hoistableScripts,y=ch(n),b=h.get(y);b||(b=c.querySelector(Mp(y)),b||(n=S({src:n,async:!0,type:"module"},s),(s=pr.get(y))&&y_(n,s),b=c.createElement("script"),ie(b),vs(b,"link",n),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function vb(n,s,c,h){var y=(y=ce.current)?e0(y):null;if(!y)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=uh(c.href),c=k(y).hoistableStyles,h=c.get(s),h||(h={type:"style",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){n=uh(c.href);var b=k(y).hoistableStyles,N=b.get(n);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(n,N),(b=y.querySelector(bp(n)))&&!b._p&&(N.instance=b,N.state.loading=5),pr.has(n)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},pr.set(n,c),b||bA(y,n,c,N.state))),s&&h===null)throw Error(i(528,""));return N}if(s&&h!==null)throw Error(i(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=ch(c),c=k(y).hoistableScripts,h=c.get(s),h||(h={type:"script",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function uh(n){return'href="'+It(n)+'"'}function bp(n){return'link[rel="stylesheet"]['+n+"]"}function yb(n){return S({},n,{"data-precedence":n.precedence,precedence:null})}function bA(n,s,c,h){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=n.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),vs(s,"link",c),ie(s),n.head.appendChild(s))}function ch(n){return'[src="'+It(n)+'"]'}function Mp(n){return"script[async]"+n}function _b(n,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var h=n.querySelector('style[data-href~="'+It(c.href)+'"]');if(h)return s.instance=h,ie(h),h;var y=S({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(n.ownerDocument||n).createElement("style"),ie(h),vs(h,"style",y),t0(h,c.precedence,n),s.instance=h;case"stylesheet":y=uh(c.href);var b=n.querySelector(bp(y));if(b)return s.state.loading|=4,s.instance=b,ie(b),b;h=yb(c),(y=pr.get(y))&&v_(h,y),b=(n.ownerDocument||n).createElement("link"),ie(b);var N=b;return N._p=new Promise(function(F,J){N.onload=F,N.onerror=J}),vs(b,"link",h),s.state.loading|=4,t0(b,c.precedence,n),s.instance=b;case"script":return b=ch(c.src),(y=n.querySelector(Mp(b)))?(s.instance=y,ie(y),y):(h=c,(y=pr.get(b))&&(h=S({},c),y_(h,y)),n=n.ownerDocument||n,y=n.createElement("script"),ie(y),vs(y,"link",h),n.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,t0(h,c.precedence,n));return s.instance}function t0(n,s,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,b=y,N=0;N title"):null)}function MA(n,s,c){if(c===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(n=s.disabled,typeof s.precedence=="string"&&n==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function bb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function EA(n,s,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var y=uh(h.href),b=s.querySelector(bp(y));if(b){s=b._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=i0.bind(n),s.then(n,n)),c.state.loading|=4,c.instance=b,ie(b);return}b=s.ownerDocument||s,h=yb(h),(y=pr.get(y))&&v_(h,y),b=b.createElement("link"),ie(b);var N=b;N._p=new Promise(function(F,J){N.onload=F,N.onerror=J}),vs(b,"link",h),c.instance=b}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(n.count++,c=i0.bind(n),s.addEventListener("load",c),s.addEventListener("error",c))}}var __=0;function TA(n,s){return n.stylesheets&&n.count===0&&a0(n,n.stylesheets),0__?50:800)+s);return n.unsuspend=c,function(){n.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function i0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)a0(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var s0=null;function a0(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,s0=new Map,s.forEach(AA,n),s0=null,i0.call(n))}function AA(n,s){if(!(s.state.loading&4)){var c=s0.get(n);if(c)var h=c.get(null);else{c=new Map,s0.set(n,c);for(var y=n.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(e){console.error(e)}}return o(),C_.exports=kA(),C_.exports}var GA=HA();const oy="183",WA={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},XA={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},H1=0,Lx=1,G1=2,qA=3,W1=0,Fh=1,qp=2,Hc=3,wl=0,ea=1,Uo=2,Po=0,Yc=1,Ux=2,Ix=3,Ox=4,X1=5,YA=6,wu=100,q1=101,Y1=102,j1=103,Z1=104,Q1=200,J1=201,K1=202,$1=203,fv=204,hv=205,eE=206,tE=207,nE=208,iE=209,sE=210,aE=211,rE=212,oE=213,lE=214,dv=0,pv=1,mv=2,Qc=3,gv=4,vv=5,yv=6,_v=7,bm=0,uE=1,cE=2,gr=0,sS=1,aS=2,rS=3,ly=4,oS=5,lS=6,uS=7,Px="attached",fE="detached",uy=300,zo=301,Lu=302,Yp=303,jp=304,Qh=306,sm=1e3,Ca=1001,am=1002,Ti=1003,cS=1004,jA=1004,Ph=1005,ZA=1005,si=1006,Zp=1007,QA=1007,Io=1008,JA=1008,Js=1009,fS=1010,hS=1011,kh=1012,cy=1013,vr=1014,$s=1015,Bo=1016,fy=1017,hy=1018,Hh=1020,dS=35902,pS=35899,mS=1021,gS=1022,Os=1023,Fo=1026,Ru=1027,dy=1028,Mm=1029,Jc=1030,py=1031,KA=1032,my=1033,Qp=33776,Jp=33777,Kp=33778,$p=33779,xv=35840,Sv=35841,bv=35842,Mv=35843,Ev=36196,Tv=37492,Av=37496,wv=37488,Cv=37489,Rv=37490,Dv=37491,Nv=37808,Lv=37809,Uv=37810,Iv=37811,Ov=37812,Pv=37813,zv=37814,Bv=37815,Fv=37816,Vv=37817,kv=37818,Hv=37819,Gv=37820,Wv=37821,Xv=36492,qv=36494,Yv=36495,jv=36283,Zv=36284,Qv=36285,Jv=36286,hE=2200,dE=2201,pE=2202,rm=2300,Kv=2301,ov=2302,zx=2303,Gc=2400,Wc=2401,om=2402,gy=2500,vS=2501,$A=0,ew=1,tw=2,mE=3200,nw=3201,iw=3202,sw=3203,Pu=0,gE=1,El="",Is="srgb",Uu="srgb-linear",lm="linear",On="srgb",aw="",rw="rg",ow="ga",lw=0,Vc=7680,uw=7681,cw=7682,fw=7683,hw=34055,dw=34056,pw=5386,mw=512,gw=513,vw=514,yw=515,_w=516,xw=517,Sw=518,Bx=519,vE=512,yE=513,_E=514,vy=515,xE=516,SE=517,yy=518,bE=519,um=35044,bw=35048,Mw=35040,Ew=35045,Tw=35049,Aw=35041,ww=35046,Cw=35050,Rw=35042,Dw="100",Fx="300 es",Va=2e3,Kc=2001,Nw={COMPUTE:"compute",RENDER:"render"},Lw={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},Uw={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},Iw={TEXTURE_COMPARE:"depthTextureCompare"};function Ow(o){for(let e=o.length-1;e>=0;--e)if(o[e]>=65535)return!0;return!1}const Pw={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function zh(o,e){return new Pw[o](e)}function ME(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function cm(o){return document.createElementNS("http://www.w3.org/1999/xhtml",o)}function EE(){const o=cm("canvas");return o.style.display="block",o}const qb={};let Iu=null;function zw(o){Iu=o}function Bw(){return Iu}function fm(...o){const e="THREE."+o.shift();Iu?Iu("log",e,...o):console.log(e,...o)}function TE(o){const e=o[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=o[1];t&&t.isStackTrace?o[0]+=" "+t.getLocation():o[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return o}function at(...o){o=TE(o);const e="THREE."+o.shift();if(Iu)Iu("warn",e,...o);else{const t=o[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...o)}}function Tt(...o){o=TE(o);const e="THREE."+o.shift();if(Iu)Iu("error",e,...o);else{const t=o[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...o)}}function hm(...o){const e=o.join(" ");e in qb||(qb[e]=!0,at(...o))}function Fw(o,e,t){return new Promise(function(i,a){function u(){switch(o.clientWaitSync(e,o.SYNC_FLUSH_COMMANDS_BIT,0)){case o.WAIT_FAILED:a();break;case o.TIMEOUT_EXPIRED:setTimeout(u,t);break;default:i()}}setTimeout(u,t)})}const Vw={[dv]:pv,[mv]:yv,[gv]:_v,[Qc]:vv,[pv]:dv,[yv]:mv,[_v]:gv,[vv]:Qc};class Vo{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 u=a.indexOf(t);u!==-1&&a.splice(u,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 u=0,f=a.length;u>8&255]+Ns[o>>16&255]+Ns[o>>24&255]+"-"+Ns[e&255]+Ns[e>>8&255]+"-"+Ns[e>>16&15|64]+Ns[e>>24&255]+"-"+Ns[t&63|128]+Ns[t>>8&255]+"-"+Ns[t>>16&255]+Ns[t>>24&255]+Ns[i&255]+Ns[i>>8&255]+Ns[i>>16&255]+Ns[i>>24&255]).toLowerCase()}function Ft(o,e,t){return Math.max(e,Math.min(t,o))}function yS(o,e){return(o%e+e)%e}function kw(o,e,t,i,a){return i+(o-e)*(a-i)/(t-e)}function Hw(o,e,t){return o!==e?(t-o)/(e-o):0}function em(o,e,t){return(1-t)*o+t*e}function Gw(o,e,t,i){return em(o,e,1-Math.exp(-t*i))}function Ww(o,e=1){return e-Math.abs(yS(o,e*2)-e)}function Xw(o,e,t){return o<=e?0:o>=t?1:(o=(o-e)/(t-e),o*o*(3-2*o))}function qw(o,e,t){return o<=e?0:o>=t?1:(o=(o-e)/(t-e),o*o*o*(o*(o*6-15)+10))}function Yw(o,e){return o+Math.floor(Math.random()*(e-o+1))}function jw(o,e){return o+Math.random()*(e-o)}function Zw(o){return o*(.5-Math.random())}function Qw(o){o!==void 0&&(Yb=o);let e=Yb+=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 Jw(o){return o*jc}function Kw(o){return o*Gh}function $w(o){return(o&o-1)===0&&o!==0}function eC(o){return Math.pow(2,Math.ceil(Math.log(o)/Math.LN2))}function tC(o){return Math.pow(2,Math.floor(Math.log(o)/Math.LN2))}function nC(o,e,t,i,a){const u=Math.cos,f=Math.sin,d=u(t/2),m=f(t/2),g=u((e+i)/2),_=f((e+i)/2),S=u((e-i)/2),x=f((e-i)/2),M=u((i-e)/2),T=f((i-e)/2);switch(a){case"XYX":o.set(d*_,m*S,m*x,d*g);break;case"YZY":o.set(m*x,d*_,m*S,d*g);break;case"ZXZ":o.set(m*S,m*x,d*_,d*g);break;case"XZX":o.set(d*_,m*T,m*M,d*g);break;case"YXY":o.set(m*M,d*_,m*T,d*g);break;case"ZYZ":o.set(m*T,m*M,d*_,d*g);break;default:at("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}function Ks(o,e){switch(e.constructor){case Float32Array:return o;case Uint32Array:return o/4294967295;case Uint16Array:return o/65535;case Uint8Array:return o/255;case Int32Array:return Math.max(o/2147483647,-1);case Int16Array:return Math.max(o/32767,-1);case Int8Array:return Math.max(o/127,-1);default:throw new Error("Invalid component type.")}}function nn(o,e){switch(e.constructor){case Float32Array:return o;case Uint32Array:return Math.round(o*4294967295);case Uint16Array:return Math.round(o*65535);case Uint8Array:return Math.round(o*255);case Int32Array:return Math.round(o*2147483647);case Int16Array:return Math.round(o*32767);case Int8Array:return Math.round(o*127);default:throw new Error("Invalid component type.")}}const iC={DEG2RAD:jc,RAD2DEG:Gh,generateUUID:ka,clamp:Ft,euclideanModulo:yS,mapLinear:kw,inverseLerp:Hw,lerp:em,damp:Gw,pingpong:Ww,smoothstep:Xw,smootherstep:qw,randInt:Yw,randFloat:jw,randFloatSpread:Zw,seededRandom:Qw,degToRad:Jw,radToDeg:Kw,isPowerOfTwo:$w,ceilPowerOfTwo:eC,floorPowerOfTwo:tC,setQuaternionFromProperEuler:nC,normalize:nn,denormalize:Ks};class ze{constructor(e=0,t=0){ze.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=Ft(this.x,e.x,t.x),this.y=Ft(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ft(this.x,e,t),this.y=Ft(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ft(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(Ft(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),u=this.x-e.x,f=this.y-e.y;return this.x=u*i-f*a+e.x,this.y=u*a+f*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ta{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,u,f,d){let m=i[a+0],g=i[a+1],_=i[a+2],S=i[a+3],x=u[f+0],M=u[f+1],T=u[f+2],D=u[f+3];if(S!==D||m!==x||g!==M||_!==T){let w=m*x+g*M+_*T+S*D;w<0&&(x=-x,M=-M,T=-T,D=-D,w=-w);let A=1-d;if(w<.9995){const R=Math.acos(w),L=Math.sin(R);A=Math.sin(A*R)/L,d=Math.sin(d*R)/L,m=m*A+x*d,g=g*A+M*d,_=_*A+T*d,S=S*A+D*d}else{m=m*A+x*d,g=g*A+M*d,_=_*A+T*d,S=S*A+D*d;const R=1/Math.sqrt(m*m+g*g+_*_+S*S);m*=R,g*=R,_*=R,S*=R}}e[t]=m,e[t+1]=g,e[t+2]=_,e[t+3]=S}static multiplyQuaternionsFlat(e,t,i,a,u,f){const d=i[a],m=i[a+1],g=i[a+2],_=i[a+3],S=u[f],x=u[f+1],M=u[f+2],T=u[f+3];return e[t]=d*T+_*S+m*M-g*x,e[t+1]=m*T+_*x+g*S-d*M,e[t+2]=g*T+_*M+d*x-m*S,e[t+3]=_*T-d*S-m*x-g*M,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,u=e._z,f=e._order,d=Math.cos,m=Math.sin,g=d(i/2),_=d(a/2),S=d(u/2),x=m(i/2),M=m(a/2),T=m(u/2);switch(f){case"XYZ":this._x=x*_*S+g*M*T,this._y=g*M*S-x*_*T,this._z=g*_*T+x*M*S,this._w=g*_*S-x*M*T;break;case"YXZ":this._x=x*_*S+g*M*T,this._y=g*M*S-x*_*T,this._z=g*_*T-x*M*S,this._w=g*_*S+x*M*T;break;case"ZXY":this._x=x*_*S-g*M*T,this._y=g*M*S+x*_*T,this._z=g*_*T+x*M*S,this._w=g*_*S-x*M*T;break;case"ZYX":this._x=x*_*S-g*M*T,this._y=g*M*S+x*_*T,this._z=g*_*T-x*M*S,this._w=g*_*S+x*M*T;break;case"YZX":this._x=x*_*S+g*M*T,this._y=g*M*S+x*_*T,this._z=g*_*T-x*M*S,this._w=g*_*S-x*M*T;break;case"XZY":this._x=x*_*S-g*M*T,this._y=g*M*S-x*_*T,this._z=g*_*T+x*M*S,this._w=g*_*S+x*M*T;break;default:at("Quaternion: .setFromEuler() encountered an unknown order: "+f)}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],u=t[8],f=t[1],d=t[5],m=t[9],g=t[2],_=t[6],S=t[10],x=i+d+S;if(x>0){const M=.5/Math.sqrt(x+1);this._w=.25/M,this._x=(_-m)*M,this._y=(u-g)*M,this._z=(f-a)*M}else if(i>d&&i>S){const M=2*Math.sqrt(1+i-d-S);this._w=(_-m)/M,this._x=.25*M,this._y=(a+f)/M,this._z=(u+g)/M}else if(d>S){const M=2*Math.sqrt(1+d-i-S);this._w=(u-g)/M,this._x=(a+f)/M,this._y=.25*M,this._z=(m+_)/M}else{const M=2*Math.sqrt(1+S-i-d);this._w=(f-a)/M,this._x=(u+g)/M,this._y=(m+_)/M,this._z=.25*M}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(Ft(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,u=e._z,f=e._w,d=t._x,m=t._y,g=t._z,_=t._w;return this._x=i*_+f*d+a*g-u*m,this._y=a*_+f*m+u*d-i*g,this._z=u*_+f*g+i*m-a*d,this._w=f*_-i*d-a*m-u*g,this._onChangeCallback(),this}slerp(e,t){let i=e._x,a=e._y,u=e._z,f=e._w,d=this.dot(e);d<0&&(i=-i,a=-a,u=-u,f=-f,d=-d);let m=1-t;if(d<.9995){const g=Math.acos(d),_=Math.sin(g);m=Math.sin(m*g)/_,t=Math.sin(t*g)/_,this._x=this._x*m+i*t,this._y=this._y*m+a*t,this._z=this._z*m+u*t,this._w=this._w*m+f*t,this._onChangeCallback()}else this._x=this._x*m+i*t,this._y=this._y*m+a*t,this._z=this._z*m+u*t,this._w=this._w*m+f*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),u=Math.sqrt(i);return this.set(a*Math.sin(e),a*Math.cos(e),u*Math.sin(t),u*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 Y{constructor(e=0,t=0,i=0){Y.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(jb.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(jb.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,a=this.z,u=e.elements;return this.x=u[0]*t+u[3]*i+u[6]*a,this.y=u[1]*t+u[4]*i+u[7]*a,this.z=u[2]*t+u[5]*i+u[8]*a,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,a=this.z,u=e.elements,f=1/(u[3]*t+u[7]*i+u[11]*a+u[15]);return this.x=(u[0]*t+u[4]*i+u[8]*a+u[12])*f,this.y=(u[1]*t+u[5]*i+u[9]*a+u[13])*f,this.z=(u[2]*t+u[6]*i+u[10]*a+u[14])*f,this}applyQuaternion(e){const t=this.x,i=this.y,a=this.z,u=e.x,f=e.y,d=e.z,m=e.w,g=2*(f*a-d*i),_=2*(d*t-u*a),S=2*(u*i-f*t);return this.x=t+m*g+f*S-d*_,this.y=i+m*_+d*g-u*S,this.z=a+m*S+u*_-f*g,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,u=e.elements;return this.x=u[0]*t+u[4]*i+u[8]*a,this.y=u[1]*t+u[5]*i+u[9]*a,this.z=u[2]*t+u[6]*i+u[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=Ft(this.x,e.x,t.x),this.y=Ft(this.y,e.y,t.y),this.z=Ft(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ft(this.x,e,t),this.y=Ft(this.y,e,t),this.z=Ft(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ft(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,u=e.z,f=t.x,d=t.y,m=t.z;return this.x=a*m-u*d,this.y=u*f-i*m,this.z=i*d-a*f,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 L_.copy(this).projectOnVector(e),this.sub(L_)}reflect(e){return this.sub(L_.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(Ft(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 L_=new Y,jb=new ta;class Kt{constructor(e,t,i,a,u,f,d,m,g){Kt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,a,u,f,d,m,g)}set(e,t,i,a,u,f,d,m,g){const _=this.elements;return _[0]=e,_[1]=a,_[2]=d,_[3]=t,_[4]=u,_[5]=m,_[6]=i,_[7]=f,_[8]=g,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,u=this.elements,f=i[0],d=i[3],m=i[6],g=i[1],_=i[4],S=i[7],x=i[2],M=i[5],T=i[8],D=a[0],w=a[3],A=a[6],R=a[1],L=a[4],I=a[7],V=a[2],z=a[5],H=a[8];return u[0]=f*D+d*R+m*V,u[3]=f*w+d*L+m*z,u[6]=f*A+d*I+m*H,u[1]=g*D+_*R+S*V,u[4]=g*w+_*L+S*z,u[7]=g*A+_*I+S*H,u[2]=x*D+M*R+T*V,u[5]=x*w+M*L+T*z,u[8]=x*A+M*I+T*H,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],u=e[3],f=e[4],d=e[5],m=e[6],g=e[7],_=e[8];return t*f*_-t*d*g-i*u*_+i*d*m+a*u*g-a*f*m}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],u=e[3],f=e[4],d=e[5],m=e[6],g=e[7],_=e[8],S=_*f-d*g,x=d*m-_*u,M=g*u-f*m,T=t*S+i*x+a*M;if(T===0)return this.set(0,0,0,0,0,0,0,0,0);const D=1/T;return e[0]=S*D,e[1]=(a*g-_*i)*D,e[2]=(d*i-a*f)*D,e[3]=x*D,e[4]=(_*t-a*m)*D,e[5]=(a*u-d*t)*D,e[6]=M*D,e[7]=(i*m-g*t)*D,e[8]=(f*t-i*u)*D,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,u,f,d){const m=Math.cos(u),g=Math.sin(u);return this.set(i*m,i*g,-i*(m*f+g*d)+f+e,-a*g,a*m,-a*(-g*f+m*d)+d+t,0,0,1),this}scale(e,t){return this.premultiply(U_.makeScale(e,t)),this}rotate(e){return this.premultiply(U_.makeRotation(-e)),this}translate(e,t){return this.premultiply(U_.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 U_=new Kt,Zb=new Kt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Qb=new Kt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function sC(){const o={enabled:!0,workingColorSpace:Uu,spaces:{},convert:function(a,u,f){return this.enabled===!1||u===f||!u||!f||(this.spaces[u].transfer===On&&(a.r=Al(a.r),a.g=Al(a.g),a.b=Al(a.b)),this.spaces[u].primaries!==this.spaces[f].primaries&&(a.applyMatrix3(this.spaces[u].toXYZ),a.applyMatrix3(this.spaces[f].fromXYZ)),this.spaces[f].transfer===On&&(a.r=Vh(a.r),a.g=Vh(a.g),a.b=Vh(a.b))),a},workingToColorSpace:function(a,u){return this.convert(a,this.workingColorSpace,u)},colorSpaceToWorking:function(a,u){return this.convert(a,u,this.workingColorSpace)},getPrimaries:function(a){return this.spaces[a].primaries},getTransfer:function(a){return a===El?lm:this.spaces[a].transfer},getToneMappingMode:function(a){return this.spaces[a].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(a,u=this.workingColorSpace){return a.fromArray(this.spaces[u].luminanceCoefficients)},define:function(a){Object.assign(this.spaces,a)},_getMatrix:function(a,u,f){return a.copy(this.spaces[u].toXYZ).multiply(this.spaces[f].fromXYZ)},_getDrawingBufferColorSpace:function(a){return this.spaces[a].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(a=this.workingColorSpace){return this.spaces[a].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(a,u){return hm("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),o.workingToColorSpace(a,u)},toWorkingColorSpace:function(a,u){return hm("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),o.colorSpaceToWorking(a,u)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return o.define({[Uu]:{primaries:e,whitePoint:i,transfer:lm,toXYZ:Zb,fromXYZ:Qb,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Is},outputColorSpaceConfig:{drawingBufferColorSpace:Is}},[Is]:{primaries:e,whitePoint:i,transfer:On,toXYZ:Zb,fromXYZ:Qb,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Is}}}),o}const Sn=sC();function Al(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function Vh(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}let hh;class AE{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{hh===void 0&&(hh=cm("canvas")),hh.width=e.width,hh.height=e.height;const a=hh.getContext("2d");e instanceof ImageData?a.putImageData(e,0,0):a.drawImage(e,0,0,e.width,e.height),i=hh}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=cm("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),u=a.data;for(let f=0;f1),this.pmremVersion=0}get width(){return this.source.getSize(O_).x}get height(){return this.source.getSize(O_).y}get depth(){return this.source.getSize(O_).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){at(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const a=this[t];if(a===void 0){at(`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!==uy)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case sm:e.x=e.x-Math.floor(e.x);break;case Ca:e.x=e.x<0?0:1;break;case am: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 sm:e.y=e.y-Math.floor(e.y);break;case Ca:e.y=e.y<0?0:1;break;case am: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++}}Ai.DEFAULT_IMAGE=null;Ai.DEFAULT_MAPPING=uy;Ai.DEFAULT_ANISOTROPY=1;class Xn{constructor(e=0,t=0,i=0,a=1){Xn.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,u=this.w,f=e.elements;return this.x=f[0]*t+f[4]*i+f[8]*a+f[12]*u,this.y=f[1]*t+f[5]*i+f[9]*a+f[13]*u,this.z=f[2]*t+f[6]*i+f[10]*a+f[14]*u,this.w=f[3]*t+f[7]*i+f[11]*a+f[15]*u,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,u;const m=e.elements,g=m[0],_=m[4],S=m[8],x=m[1],M=m[5],T=m[9],D=m[2],w=m[6],A=m[10];if(Math.abs(_-x)<.01&&Math.abs(S-D)<.01&&Math.abs(T-w)<.01){if(Math.abs(_+x)<.1&&Math.abs(S+D)<.1&&Math.abs(T+w)<.1&&Math.abs(g+M+A-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const L=(g+1)/2,I=(M+1)/2,V=(A+1)/2,z=(_+x)/4,H=(S+D)/4,U=(T+w)/4;return L>I&&L>V?L<.01?(i=0,a=.707106781,u=.707106781):(i=Math.sqrt(L),a=z/i,u=H/i):I>V?I<.01?(i=.707106781,a=0,u=.707106781):(a=Math.sqrt(I),i=z/a,u=U/a):V<.01?(i=.707106781,a=.707106781,u=0):(u=Math.sqrt(V),i=H/u,a=U/u),this.set(i,a,u,t),this}let R=Math.sqrt((w-T)*(w-T)+(S-D)*(S-D)+(x-_)*(x-_));return Math.abs(R)<.001&&(R=1),this.x=(w-T)/R,this.y=(S-D)/R,this.z=(x-_)/R,this.w=Math.acos((g+M+A-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=Ft(this.x,e.x,t.x),this.y=Ft(this.y,e.y,t.y),this.z=Ft(this.z,e.z,t.z),this.w=Ft(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ft(this.x,e,t),this.y=Ft(this.y,e,t),this.z=Ft(this.z,e,t),this.w=Ft(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ft(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 _S extends Vo{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:si,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 Xn(0,0,e,t),this.scissorTest=!1,this.viewport=new Xn(0,0,e,t),this.textures=[];const a={width:e,height:t,depth:i.depth},u=new Ai(a),f=i.count;for(let d=0;d1);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>>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.pivot!==null&&(a.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(a.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(a.morphTargetInfluences=this.morphTargetInfluences.slice()),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(d=>({...d,boundingBox:d.boundingBox?d.boundingBox.toJSON():void 0,boundingSphere:d.boundingSphere?d.boundingSphere.toJSON():void 0})),a.instanceInfo=this._instanceInfo.map(d=>({...d})),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 u(d,m){return d[m.uuid]===void 0&&(d[m.uuid]=m.toJSON(e)),m.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=u(e.geometries,this.geometry);const d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){const m=d.shapes;if(Array.isArray(m))for(let g=0,_=m.length;g<_;g++){const S=m[g];u(e.shapes,S)}else u(e.shapes,m)}}if(this.isSkinnedMesh&&(a.bindMode=this.bindMode,a.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(u(e.skeletons,this.skeleton),a.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const d=[];for(let m=0,g=this.material.length;m0){a.children=[];for(let d=0;d0){a.animations=[];for(let d=0;d0&&(i.geometries=d),m.length>0&&(i.materials=m),g.length>0&&(i.textures=g),_.length>0&&(i.images=_),S.length>0&&(i.shapes=S),x.length>0&&(i.skeletons=x),M.length>0&&(i.animations=M),T.length>0&&(i.nodes=T)}return i.object=a,i;function f(d){const m=[];for(const g in d){const _=d[g];delete _.metadata,m.push(_)}return m}}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),e.pivot!==null&&(this.pivot=e.pivot.clone()),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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;iM+T?(g.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!g.inputState.pinching&&x<=M-T&&(g.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else m!==null&&e.gripSpace&&(u=t.getPose(e.gripSpace,i),u!==null&&(m.matrix.fromArray(u.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,u.linearVelocity?(m.hasLinearVelocity=!0,m.linearVelocity.copy(u.linearVelocity)):m.hasLinearVelocity=!1,u.angularVelocity?(m.hasAngularVelocity=!0,m.angularVelocity.copy(u.angularVelocity)):m.hasAngularVelocity=!1));d!==null&&(a=t.getPose(e.targetRaySpace,i),a===null&&u!==null&&(a=u),a!==null&&(d.matrix.fromArray(a.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,a.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(a.linearVelocity)):d.hasLinearVelocity=!1,a.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(a.angularVelocity)):d.hasAngularVelocity=!1,this.dispatchEvent(mC)))}return d!==null&&(d.visible=a!==null),m!==null&&(m.visible=u!==null),g!==null&&(g.visible=f!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Bh;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const wE={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},xu={h:0,s:0,l:0},m0={h:0,s:0,l:0};function z_(o,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?o+(e-o)*6*t:t<1/2?e:t<2/3?o+(e-o)*6*(2/3-t):o}class pt{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=Is){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Sn.colorSpaceToWorking(this,t),this}setRGB(e,t,i,a=Sn.workingColorSpace){return this.r=e,this.g=t,this.b=i,Sn.colorSpaceToWorking(this,a),this}setHSL(e,t,i,a=Sn.workingColorSpace){if(e=yS(e,1),t=Ft(t,0,1),i=Ft(i,0,1),t===0)this.r=this.g=this.b=i;else{const u=i<=.5?i*(1+t):i+t-i*t,f=2*i-u;this.r=z_(f,u,e+1/3),this.g=z_(f,u,e),this.b=z_(f,u,e-1/3)}return Sn.colorSpaceToWorking(this,a),this}setStyle(e,t=Is){function i(u){u!==void 0&&parseFloat(u)<1&&at("Color: Alpha component of "+e+" will be ignored.")}let a;if(a=/^(\w+)\(([^\)]*)\)/.exec(e)){let u;const f=a[1],d=a[2];switch(f){case"rgb":case"rgba":if(u=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(u[4]),this.setRGB(Math.min(255,parseInt(u[1],10))/255,Math.min(255,parseInt(u[2],10))/255,Math.min(255,parseInt(u[3],10))/255,t);if(u=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(u[4]),this.setRGB(Math.min(100,parseInt(u[1],10))/100,Math.min(100,parseInt(u[2],10))/100,Math.min(100,parseInt(u[3],10))/100,t);break;case"hsl":case"hsla":if(u=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(u[4]),this.setHSL(parseFloat(u[1])/360,parseFloat(u[2])/100,parseFloat(u[3])/100,t);break;default:at("Color: Unknown color model "+e)}}else if(a=/^\#([A-Fa-f\d]+)$/.exec(e)){const u=a[1],f=u.length;if(f===3)return this.setRGB(parseInt(u.charAt(0),16)/15,parseInt(u.charAt(1),16)/15,parseInt(u.charAt(2),16)/15,t);if(f===6)return this.setHex(parseInt(u,16),t);at("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Is){const i=wE[e.toLowerCase()];return i!==void 0?this.setHex(i,t):at("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=Al(e.r),this.g=Al(e.g),this.b=Al(e.b),this}copyLinearToSRGB(e){return this.r=Vh(e.r),this.g=Vh(e.g),this.b=Vh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Is){return Sn.workingToColorSpace(Ls.copy(this),e),Math.round(Ft(Ls.r*255,0,255))*65536+Math.round(Ft(Ls.g*255,0,255))*256+Math.round(Ft(Ls.b*255,0,255))}getHexString(e=Is){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Sn.workingColorSpace){Sn.workingToColorSpace(Ls.copy(this),t);const i=Ls.r,a=Ls.g,u=Ls.b,f=Math.max(i,a,u),d=Math.min(i,a,u);let m,g;const _=(d+f)/2;if(d===f)m=0,g=0;else{const S=f-d;switch(g=_<=.5?S/(f+d):S/(2-f-d),f){case i:m=(a-u)/S+(a0&&(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}}const qr=new Y,_l=new Y,B_=new Y,xl=new Y,gh=new Y,vh=new Y,sM=new Y,F_=new Y,V_=new Y,k_=new Y,H_=new Xn,G_=new Xn,W_=new Xn;class wa{constructor(e=new Y,t=new Y,i=new Y){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,a){a.subVectors(i,t),qr.subVectors(e,t),a.cross(qr);const u=a.lengthSq();return u>0?a.multiplyScalar(1/Math.sqrt(u)):a.set(0,0,0)}static getBarycoord(e,t,i,a,u){qr.subVectors(a,t),_l.subVectors(i,t),B_.subVectors(e,t);const f=qr.dot(qr),d=qr.dot(_l),m=qr.dot(B_),g=_l.dot(_l),_=_l.dot(B_),S=f*g-d*d;if(S===0)return u.set(0,0,0),null;const x=1/S,M=(g*m-d*_)*x,T=(f*_-d*m)*x;return u.set(1-M-T,T,M)}static containsPoint(e,t,i,a){return this.getBarycoord(e,t,i,a,xl)===null?!1:xl.x>=0&&xl.y>=0&&xl.x+xl.y<=1}static getInterpolation(e,t,i,a,u,f,d,m){return this.getBarycoord(e,t,i,a,xl)===null?(m.x=0,m.y=0,"z"in m&&(m.z=0),"w"in m&&(m.w=0),null):(m.setScalar(0),m.addScaledVector(u,xl.x),m.addScaledVector(f,xl.y),m.addScaledVector(d,xl.z),m)}static getInterpolatedAttribute(e,t,i,a,u,f){return H_.setScalar(0),G_.setScalar(0),W_.setScalar(0),H_.fromBufferAttribute(e,t),G_.fromBufferAttribute(e,i),W_.fromBufferAttribute(e,a),f.setScalar(0),f.addScaledVector(H_,u.x),f.addScaledVector(G_,u.y),f.addScaledVector(W_,u.z),f}static isFrontFacing(e,t,i,a){return qr.subVectors(i,t),_l.subVectors(e,t),qr.cross(_l).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 qr.subVectors(this.c,this.b),_l.subVectors(this.a,this.b),qr.cross(_l).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wa.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return wa.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,a,u){return wa.getInterpolation(e,this.a,this.b,this.c,t,i,a,u)}containsPoint(e){return wa.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wa.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,a=this.b,u=this.c;let f,d;gh.subVectors(a,i),vh.subVectors(u,i),F_.subVectors(e,i);const m=gh.dot(F_),g=vh.dot(F_);if(m<=0&&g<=0)return t.copy(i);V_.subVectors(e,a);const _=gh.dot(V_),S=vh.dot(V_);if(_>=0&&S<=_)return t.copy(a);const x=m*S-_*g;if(x<=0&&m>=0&&_<=0)return f=m/(m-_),t.copy(i).addScaledVector(gh,f);k_.subVectors(e,u);const M=gh.dot(k_),T=vh.dot(k_);if(T>=0&&M<=T)return t.copy(u);const D=M*g-m*T;if(D<=0&&g>=0&&T<=0)return d=g/(g-T),t.copy(i).addScaledVector(vh,d);const w=_*T-M*S;if(w<=0&&S-_>=0&&M-T>=0)return sM.subVectors(u,a),d=(S-_)/(S-_+(M-T)),t.copy(a).addScaledVector(sM,d);const A=1/(w+D+x);return f=D*A,d=x*A,t.copy(i).addScaledVector(gh,f).addScaledVector(vh,d)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class Ps{constructor(e=new Y(1/0,1/0,1/0),t=new Y(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.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,Yr),Yr.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(Np),v0.subVectors(this.max,Np),yh.subVectors(e.a,Np),_h.subVectors(e.b,Np),xh.subVectors(e.c,Np),Su.subVectors(_h,yh),bu.subVectors(xh,_h),Ac.subVectors(yh,xh);let t=[0,-Su.z,Su.y,0,-bu.z,bu.y,0,-Ac.z,Ac.y,Su.z,0,-Su.x,bu.z,0,-bu.x,Ac.z,0,-Ac.x,-Su.y,Su.x,0,-bu.y,bu.x,0,-Ac.y,Ac.x,0];return!X_(t,yh,_h,xh,v0)||(t=[1,0,0,0,1,0,0,0,1],!X_(t,yh,_h,xh,v0))?!1:(y0.crossVectors(Su,bu),t=[y0.x,y0.y,y0.z],X_(t,yh,_h,xh,v0))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Yr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Yr).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:(Sl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Sl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Sl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Sl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Sl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Sl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Sl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Sl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Sl),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 Sl=[new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y],Yr=new Y,g0=new Ps,yh=new Y,_h=new Y,xh=new Y,Su=new Y,bu=new Y,Ac=new Y,Np=new Y,v0=new Y,y0=new Y,wc=new Y;function X_(o,e,t,i,a){for(let u=0,f=o.length-3;u<=f;u+=3){wc.fromArray(o,u);const d=a.x*Math.abs(wc.x)+a.y*Math.abs(wc.y)+a.z*Math.abs(wc.z),m=e.dot(wc),g=t.dot(wc),_=i.dot(wc);if(Math.max(-Math.max(m,g,_),Math.min(m,g,_))>d)return!1}return!0}const Tl=gC();function gC(){const o=new ArrayBuffer(4),e=new Float32Array(o),t=new Uint32Array(o),i=new Uint32Array(512),a=new Uint32Array(512);for(let m=0;m<256;++m){const g=m-127;g<-27?(i[m]=0,i[m|256]=32768,a[m]=24,a[m|256]=24):g<-14?(i[m]=1024>>-g-14,i[m|256]=1024>>-g-14|32768,a[m]=-g-1,a[m|256]=-g-1):g<=15?(i[m]=g+15<<10,i[m|256]=g+15<<10|32768,a[m]=13,a[m|256]=13):g<128?(i[m]=31744,i[m|256]=64512,a[m]=24,a[m|256]=24):(i[m]=31744,i[m|256]=64512,a[m]=13,a[m|256]=13)}const u=new Uint32Array(2048),f=new Uint32Array(64),d=new Uint32Array(64);for(let m=1;m<1024;++m){let g=m<<13,_=0;for(;(g&8388608)===0;)g<<=1,_-=8388608;g&=-8388609,_+=947912704,u[m]=g|_}for(let m=1024;m<2048;++m)u[m]=939524096+(m-1024<<13);for(let m=1;m<31;++m)f[m]=m<<23;f[31]=1199570944,f[32]=2147483648;for(let m=33;m<63;++m)f[m]=2147483648+(m-32<<23);f[63]=3347054592;for(let m=1;m<64;++m)m!==32&&(d[m]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:a,mantissaTable:u,exponentTable:f,offsetTable:d}}function Aa(o){Math.abs(o)>65504&&at("DataUtils.toHalfFloat(): Value out of range."),o=Ft(o,-65504,65504),Tl.floatView[0]=o;const e=Tl.uint32View[0],t=e>>23&511;return Tl.baseTable[t]+((e&8388607)>>Tl.shiftTable[t])}function Gp(o){const e=o>>10;return Tl.uint32View[0]=Tl.mantissaTable[Tl.offsetTable[e]+(o&1023)]+Tl.exponentTable[e],Tl.floatView[0]}class vC{static toHalfFloat(e){return Aa(e)}static fromHalfFloat(e){return Gp(e)}}const Hi=new Y,_0=new ze;let yC=0;class Gn{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:yC++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=um,this.updateRanges=[],this.gpuType=$s,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,u=this.itemSize;athis.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;Lp.subVectors(e,this.center);const t=Lp.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),a=(i-this.radius)*.5;this.center.addScaledVector(Lp,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):(q_.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Lp.copy(e.center).add(q_)),this.expandByPoint(Lp.copy(e.center).sub(q_))),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}}let AC=0;const mr=new kt,Y_=new wn,Sh=new Y,Fa=new Ps,Up=new Ps,ss=new Y;class jt extends Vo{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:AC++}),this.uuid=ka(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Ow(e)?bS:SS)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const u=new Kt().getNormalMatrix(e);i.applyNormalMatrix(u),i.needsUpdate=!0}const a=this.attributes.tangent;return a!==void 0&&(a.transformDirection(e),a.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return mr.makeRotationFromQuaternion(e),this.applyMatrix4(mr),this}rotateX(e){return mr.makeRotationX(e),this.applyMatrix4(mr),this}rotateY(e){return mr.makeRotationY(e),this.applyMatrix4(mr),this}rotateZ(e){return mr.makeRotationZ(e),this.applyMatrix4(mr),this}translate(e,t,i){return mr.makeTranslation(e,t,i),this.applyMatrix4(mr),this}scale(e,t,i){return mr.makeScale(e,t,i),this.applyMatrix4(mr),this}lookAt(e){return Y_.lookAt(e),Y_.updateMatrix(),this.applyMatrix4(Y_.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Sh).negate(),this.translate(Sh.x,Sh.y,Sh.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let a=0,u=e.length;at.count&&at("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 Ps);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Tt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Y(-1/0,-1/0,-1/0),new Y(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 m=this.parameters;for(const g in m)m[g]!==void 0&&(e[g]=m[g]);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 m in i){const g=i[m];e.data.attributes[m]=g.toJSON(e.data)}const a={};let u=!1;for(const m in this.morphAttributes){const g=this.morphAttributes[m],_=[];for(let S=0,x=g.length;S0&&(a[m]=_,u=!0)}u&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);const f=this.groups;f.length>0&&(e.data.groups=JSON.parse(JSON.stringify(f)));const d=this.boundingSphere;return d!==null&&(e.data.boundingSphere=d.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 g in a){const _=a[g];this.setAttribute(g,_.clone(t))}const u=e.morphAttributes;for(const g in u){const _=[],S=u[g];for(let x=0,M=S.length;x0!=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){at(`Material: parameter '${t}' has value of undefined.`);continue}const a=this[t];if(a===void 0){at(`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!==Yc&&(i.blending=this.blending),this.side!==wl&&(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!==fv&&(i.blendSrc=this.blendSrc),this.blendDst!==hv&&(i.blendDst=this.blendDst),this.blendEquation!==wu&&(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!==Qc&&(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!==Bx&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Vc&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Vc&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Vc&&(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.allowOverride===!1&&(i.allowOverride=!1),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(u){const f=[];for(const d in u){const m=u[d];delete m.metadata,f.push(m)}return f}if(t){const u=a(e.textures),f=a(e.images);u.length>0&&(i.textures=u),f.length>0&&(i.images=f)}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 u=0;u!==a;++u)i[u]=t[u].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.allowOverride=e.allowOverride,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 MS extends zs{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new pt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let bh;const Ip=new Y,Mh=new Y,Eh=new Y,Th=new ze,Op=new ze,CE=new kt,x0=new Y,Pp=new Y,S0=new Y,aM=new ze,j_=new ze,rM=new ze;class RE extends wn{constructor(e=new MS){if(super(),this.isSprite=!0,this.type="Sprite",bh===void 0){bh=new jt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new My(t,5);bh.setIndex([0,1,2,0,2,3]),bh.setAttribute("position",new $c(i,3,0,!1)),bh.setAttribute("uv",new $c(i,2,3,!1))}this.geometry=bh,this.material=e,this.center=new ze(.5,.5),this.count=1}raycast(e,t){e.camera===null&&Tt('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Mh.setFromMatrixScale(this.matrixWorld),CE.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Eh.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Mh.multiplyScalar(-Eh.z);const i=this.material.rotation;let a,u;i!==0&&(u=Math.cos(i),a=Math.sin(i));const f=this.center;b0(x0.set(-.5,-.5,0),Eh,f,Mh,a,u),b0(Pp.set(.5,-.5,0),Eh,f,Mh,a,u),b0(S0.set(.5,.5,0),Eh,f,Mh,a,u),aM.set(0,0),j_.set(1,0),rM.set(1,1);let d=e.ray.intersectTriangle(x0,Pp,S0,!1,Ip);if(d===null&&(b0(Pp.set(-.5,.5,0),Eh,f,Mh,a,u),j_.set(0,1),d=e.ray.intersectTriangle(x0,S0,Pp,!1,Ip),d===null))return;const m=e.ray.origin.distanceTo(Ip);me.far||t.push({distance:m,point:Ip.clone(),uv:wa.getInterpolation(Ip,x0,Pp,S0,aM,j_,rM,new ze),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 b0(o,e,t,i,a,u){Th.subVectors(o,t).addScalar(.5).multiply(i),a!==void 0?(Op.x=u*Th.x-a*Th.y,Op.y=a*Th.x+u*Th.y):Op.copy(Th),o.copy(e),o.x+=Op.x,o.y+=Op.y,o.applyMatrix4(CE)}const M0=new Y,oM=new Y;class DE extends wn{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){M0.setFromMatrixPosition(this.matrixWorld);const a=e.ray.origin.distanceTo(M0);this.getObjectForDistance(a).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){M0.setFromMatrixPosition(e.matrixWorld),oM.setFromMatrixPosition(this.matrixWorld);const i=M0.distanceTo(oM)/e.zoom;t[0].object.visible=!0;let a,u;for(a=1,u=t.length;a=f)t[a-1].object.visible=!1,t[a].object.visible=!0;else break}for(this._currentLevel=a-1;a0)if(S=f*m-d,x=f*d-m,T=u*_,S>=0)if(x>=-T)if(x<=T){const D=1/_;S*=D,x*=D,M=S*(S+f*x+2*d)+x*(f*S+x+2*m)+g}else x=u,S=Math.max(0,-(f*x+d)),M=-S*S+x*(x+2*m)+g;else x=-u,S=Math.max(0,-(f*x+d)),M=-S*S+x*(x+2*m)+g;else x<=-T?(S=Math.max(0,-(-f*u+d)),x=S>0?-u:Math.min(Math.max(-u,-m),u),M=-S*S+x*(x+2*m)+g):x<=T?(S=0,x=Math.min(Math.max(-u,-m),u),M=x*(x+2*m)+g):(S=Math.max(0,-(f*u+d)),x=S>0?u:Math.min(Math.max(-u,-m),u),M=-S*S+x*(x+2*m)+g);else x=f>0?-u:u,S=Math.max(0,-(f*x+d)),M=-S*S+x*(x+2*m)+g;return i&&i.copy(this.origin).addScaledVector(this.direction,S),a&&a.copy(Z_).addScaledVector(E0,x),M}intersectSphere(e,t){bl.subVectors(e.center,this.origin);const i=bl.dot(this.direction),a=bl.dot(bl)-i*i,u=e.radius*e.radius;if(a>u)return null;const f=Math.sqrt(u-a),d=i-f,m=i+f;return m<0?null:d<0?this.at(m,t):this.at(d,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,u,f,d,m;const g=1/this.direction.x,_=1/this.direction.y,S=1/this.direction.z,x=this.origin;return g>=0?(i=(e.min.x-x.x)*g,a=(e.max.x-x.x)*g):(i=(e.max.x-x.x)*g,a=(e.min.x-x.x)*g),_>=0?(u=(e.min.y-x.y)*_,f=(e.max.y-x.y)*_):(u=(e.max.y-x.y)*_,f=(e.min.y-x.y)*_),i>f||u>a||((u>i||isNaN(i))&&(i=u),(f=0?(d=(e.min.z-x.z)*S,m=(e.max.z-x.z)*S):(d=(e.max.z-x.z)*S,m=(e.min.z-x.z)*S),i>m||d>a)||((d>i||i!==i)&&(i=d),(m=0?i:a,t)}intersectsBox(e){return this.intersectBox(e,bl)!==null}intersectTriangle(e,t,i,a,u){Q_.subVectors(t,e),T0.subVectors(i,e),J_.crossVectors(Q_,T0);let f=this.direction.dot(J_),d;if(f>0){if(a)return null;d=1}else if(f<0)d=-1,f=-f;else return null;Mu.subVectors(this.origin,e);const m=d*this.direction.dot(T0.crossVectors(Mu,T0));if(m<0)return null;const g=d*this.direction.dot(Q_.cross(Mu));if(g<0||m+g>f)return null;const _=-d*Mu.dot(J_);return _<0?null:this.at(_/f,u)}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 zu extends zs{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new pt(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 Ga,this.combine=bm,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 lM=new kt,Cc=new Jh,A0=new ys,uM=new Y,w0=new Y,C0=new Y,R0=new Y,K_=new Y,D0=new Y,cM=new Y,N0=new Y;class Gi extends wn{constructor(e=new jt,t=new zu){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let u=0,f=a.length;u(e.far-e.near)**2))&&(lM.copy(u).invert(),Cc.copy(e.ray).applyMatrix4(lM),!(i.boundingBox!==null&&Cc.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Cc)))}_computeIntersections(e,t,i){let a;const u=this.geometry,f=this.material,d=u.index,m=u.attributes.position,g=u.attributes.uv,_=u.attributes.uv1,S=u.attributes.normal,x=u.groups,M=u.drawRange;if(d!==null)if(Array.isArray(f))for(let T=0,D=x.length;Tt.far?null:{distance:g,point:N0.clone(),object:o}}function L0(o,e,t,i,a,u,f,d,m,g){o.getVertexPosition(d,w0),o.getVertexPosition(m,C0),o.getVertexPosition(g,R0);const _=CC(o,e,t,i,w0,C0,R0,cM);if(_){const S=new Y;wa.getBarycoord(cM,w0,C0,R0,S),a&&(_.uv=wa.getInterpolatedAttribute(a,d,m,g,S,new ze)),u&&(_.uv1=wa.getInterpolatedAttribute(u,d,m,g,S,new ze)),f&&(_.normal=wa.getInterpolatedAttribute(f,d,m,g,S,new Y),_.normal.dot(i.direction)>0&&_.normal.multiplyScalar(-1));const x={a:d,b:m,c:g,normal:new Y,materialIndex:0};wa.getNormal(w0,C0,R0,x.normal),_.face=x,_.barycoord=S}return _}const fM=new Y,hM=new Xn,dM=new Xn,RC=new Y,pM=new kt,U0=new Y,$_=new ys,mM=new kt,ex=new Jh;class NE extends Gi{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Px,this.bindMatrix=new kt,this.bindMatrixInverse=new kt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Ps),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i1?null:t.copy(e.start).addScaledVector(i,u)}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||UC.getNormalMatrix(e),a=this.coplanarPoint(tx).applyMatrix4(e),u=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(u),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 Rc=new ys,IC=new ze(.5,.5),O0=new Y;class Kh{constructor(e=new Au,t=new Au,i=new Au,a=new Au,u=new Au,f=new Au){this.planes=[e,t,i,a,u,f]}set(e,t,i,a,u,f){const d=this.planes;return d[0].copy(e),d[1].copy(t),d[2].copy(i),d[3].copy(a),d[4].copy(u),d[5].copy(f),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=Va,i=!1){const a=this.planes,u=e.elements,f=u[0],d=u[1],m=u[2],g=u[3],_=u[4],S=u[5],x=u[6],M=u[7],T=u[8],D=u[9],w=u[10],A=u[11],R=u[12],L=u[13],I=u[14],V=u[15];if(a[0].setComponents(g-f,M-_,A-T,V-R).normalize(),a[1].setComponents(g+f,M+_,A+T,V+R).normalize(),a[2].setComponents(g+d,M+S,A+D,V+L).normalize(),a[3].setComponents(g-d,M-S,A-D,V-L).normalize(),i)a[4].setComponents(m,x,w,I).normalize(),a[5].setComponents(g-m,M-x,A-w,V-I).normalize();else if(a[4].setComponents(g-m,M-x,A-w,V-I).normalize(),t===Va)a[5].setComponents(g+m,M+x,A+w,V+I).normalize();else if(t===Kc)a[5].setComponents(m,x,w,I).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(),Rc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Rc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Rc)}intersectsSprite(e){Rc.center.set(0,0,0);const t=IC.distanceTo(e.center);return Rc.radius=.7071067811865476+t,Rc.applyMatrix4(e.matrixWorld),this.intersectsSphere(Rc)}intersectsSphere(e){const t=this.planes,i=e.center,a=-e.radius;for(let u=0;u<6;u++)if(t[u].distanceToPoint(i)0?e.max.x:e.min.x,O0.y=a.normal.y>0?e.max.y:e.min.y,O0.z=a.normal.z>0?e.max.z:e.min.z,a.distanceToPoint(O0)<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 Ro=new kt,Do=new Kh;class Ty{constructor(){this.coordinateSystem=Va}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i=u.length&&u.push({start:-1,count:-1,z:-1,index:-1});const d=u[this.index];f.push(d),this.index++,d.start=e,d.count=t,d.z=i,d.index=a}reset(){this.list.length=0,this.index=0}}const Ta=new kt,BC=new pt(1,1,1),_M=new Kh,FC=new Ty,P0=new Ps,Dc=new ys,Fp=new Y,xM=new Y,VC=new Y,ix=new zC,Us=new Gi,z0=[];function kC(o,e,t=0){const i=e.itemSize;if(o.isInterleavedBufferAttribute||o.array.constructor!==e.array.constructor){const a=o.count;for(let u=0;u65535?new Uint32Array(a):new Uint16Array(a);t.setIndex(new Gn(u,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),u=t.getAttribute(i);if(a.itemSize!==u.itemSize||a.normalized!==u.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 Ps);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(nx),a=this._availableInstanceIds.shift(),this._instanceInfo[a]=i):(a=this._instanceInfo.length,this._instanceInfo.push(i));const u=this._matricesTexture;Ta.identity().toArray(u.image.data,a*16),u.needsUpdate=!0;const f=this._colorsTexture;return f&&(BC.toArray(f.image.data,a*4),f.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},u=this._geometryInfo;a.vertexStart=this._nextVertexStart,a.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const f=e.getIndex();if(f!==null&&(a.indexStart=this._nextIndexStart,a.reservedIndexCount=i===-1?f.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 m;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(nx),m=this._availableGeometryIds.shift(),u[m]=a):(m=this._geometryCount,this._geometryCount++,u.push(a)),this.setGeometryAt(m,e),this._nextIndexStart=a.indexStart+a.reservedIndexCount,this._nextVertexStart=a.vertexStart+a.reservedVertexCount,m}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,u=i.getIndex(),f=t.getIndex(),d=this._geometryInfo[e];if(a&&f.count>d.reservedIndexCount||t.attributes.position.count>d.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const m=d.vertexStart,g=d.reservedVertexCount;d.vertexCount=t.getAttribute("position").count;for(const _ in i.attributes){const S=t.getAttribute(_),x=i.getAttribute(_);kC(S,x,m);const M=S.itemSize;for(let T=S.count,D=g;T=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let a=0,u=i.length;ad).sort((f,d)=>i[f].vertexStart-i[d].vertexStart),u=this.geometry;for(let f=0,d=i.length;f=this._geometryCount)return null;const i=this.geometry,a=this._geometryInfo[e];if(a.boundingBox===null){const u=new Ps,f=i.index,d=i.attributes.position;for(let m=a.start,g=a.start+a.count;m=this._geometryCount)return null;const i=this.geometry,a=this._geometryInfo[e];if(a.boundingSphere===null){const u=new ys;this.getBoundingBoxAt(e,P0),P0.getCenter(u.center);const f=i.index,d=i.attributes.position;let m=0;for(let g=a.start,_=a.start+a.count;g<_;g++){let S=g;f&&(S=f.getX(S)),Fp.fromBufferAttribute(d,S),m=Math.max(m,u.center.distanceToSquared(Fp))}u.radius=Math.sqrt(m),a.boundingSphere=u}return t.copy(a.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const i=this._matricesTexture,a=this._matricesTexture.image.data;return t.toArray(a,e*16),i.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const i=this._geometryInfo[e];return t.vertexStart=i.vertexStart,t.vertexCount=i.vertexCount,t.reservedVertexCount=i.reservedVertexCount,t.indexStart=i.indexStart,t.indexCount=i.indexCount,t.reservedIndexCount=i.reservedIndexCount,t.start=i.start,t.count=i.count,t}setInstanceCount(e){const t=this._availableInstanceIds,i=this._instanceInfo;for(t.sort(nx);t[t.length-1]===i.length-1;)i.pop(),t.pop();if(ed.active);if(Math.max(...i.map(d=>d.vertexStart+d.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(m=>m.indexStart+m.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const u=this.geometry;u.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new jt,this._initializeGeometry(u));const f=this.geometry;u.index&&Nc(u.index.array,f.index.array);for(const d in u.attributes)Nc(u.attributes[d].array,f.attributes[d].array)}raycast(e,t){const i=this._instanceInfo,a=this._geometryInfo,u=this.matrixWorld,f=this.geometry;Us.material=this.material,Us.geometry.index=f.index,Us.geometry.attributes=f.attributes,Us.geometry.boundingBox===null&&(Us.geometry.boundingBox=new Ps),Us.geometry.boundingSphere===null&&(Us.geometry.boundingSphere=new ys);for(let d=0,m=i.length;d({...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,u){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const f=a.getIndex();let d=f===null?1:f.array.BYTES_PER_ELEMENT,m=1;u.wireframe&&(m=2,d=a.attributes.position.count>65535?4:2);const g=this._instanceInfo,_=this._multiDrawStarts,S=this._multiDrawCounts,x=this._geometryInfo,M=this.perObjectFrustumCulled,T=this._indirectTexture,D=T.image.data,w=i.isArrayCamera?FC:_M;M&&!i.isArrayCamera&&(Ta.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),_M.setFromProjectionMatrix(Ta,i.coordinateSystem,i.reversedDepth));let A=0;if(this.sortObjects){Ta.copy(this.matrixWorld).invert(),Fp.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Ta),xM.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Ta);for(let I=0,V=g.length;I0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let u=0,f=a.length;ui)return;sx.applyMatrix4(o.matrixWorld);const g=e.ray.origin.distanceTo(sx);if(!(ge.far))return{distance:g,point:bM.clone().applyMatrix4(o.matrixWorld),index:f,face:null,faceIndex:null,barycoord:null,object:o}}const MM=new Y,EM=new Y;class ko extends Ou{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,u=t.count;a0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let u=0,f=a.length;ua.far)return;u.push({distance:g,distanceToRay:Math.sqrt(d),point:m,index:e,face:null,faceIndex:null,barycoord:null,object:f})}}class PE extends Ai{constructor(e,t,i,a,u=si,f=si,d,m,g){super(e,t,i,a,u,f,d,m,g),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const _=this;function S(){_.needsUpdate=!0,_._requestVideoFrameCallbackId=e.requestVideoFrameCallback(S)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(S))}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 HC extends PE{constructor(e,t,i,a,u,f,d,m){super({},e,t,i,a,u,f,d,m),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class GC extends Ai{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ti,this.minFilter=Ti,this.generateMipmaps=!1,this.needsUpdate=!0}}class Ay extends Ai{constructor(e,t,i,a,u,f,d,m,g,_,S,x){super(null,f,d,m,g,_,a,u,S,x),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class WC extends Ay{constructor(e,t,i,a,u,f){super(e,t,i,u,f),this.isCompressedArrayTexture=!0,this.image.depth=a,this.wrapR=Ca,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class XC extends Ay{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,zo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class Em extends Ai{constructor(e=[],t=zo,i,a,u,f,d,m,g,_){super(e,t,i,a,u,f,d,m,g,_),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class qC extends Ai{constructor(e,t,i,a,u,f,d,m,g){super(e,t,i,a,u,f,d,m,g),this.isCanvasTexture=!0,this.needsUpdate=!0}}class qh extends Ai{constructor(e,t,i=vr,a,u,f,d=Ti,m=Ti,g,_=Fo,S=1){if(_!==Fo&&_!==Ru)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const x={width:e,height:t,depth:S};super(x,a,u,f,d,m,_,i,g),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Du(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 zE extends qh{constructor(e,t=vr,i=zo,a,u,f=Ti,d=Ti,m,g=Fo){const _={width:e,height:e,depth:1},S=[_,_,_,_,_,_];super(e,e,t,i,a,u,f,d,m,g),this.image=S,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class AS extends Ai{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class nf extends jt{constructor(e=1,t=1,i=1,a=1,u=1,f=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:a,heightSegments:u,depthSegments:f};const d=this;a=Math.floor(a),u=Math.floor(u),f=Math.floor(f);const m=[],g=[],_=[],S=[];let x=0,M=0;T("z","y","x",-1,-1,i,t,e,f,u,0),T("z","y","x",1,-1,i,t,-e,f,u,1),T("x","z","y",1,1,e,i,t,a,f,2),T("x","z","y",1,-1,e,i,-t,a,f,3),T("x","y","z",1,-1,e,t,i,a,u,4),T("x","y","z",-1,-1,e,t,-i,a,u,5),this.setIndex(m),this.setAttribute("position",new gt(g,3)),this.setAttribute("normal",new gt(_,3)),this.setAttribute("uv",new gt(S,2));function T(D,w,A,R,L,I,V,z,H,U,P){const Q=I/H,X=V/U,te=I/2,$=V/2,ue=z/2,se=H+1,q=U+1;let Z=0,ye=0;const _e=new Y;for(let Ue=0;Ue0?1:-1,_.push(_e.x,_e.y,_e.z),S.push(ee/H),S.push(1-Ue/U),Z+=1}}for(let Ue=0;Ue0){const P=(R-1)*D;for(let Q=0;Q0&&L(!0),t>0&&L(!1)),this.setIndex(_),this.setAttribute("position",new gt(S,3)),this.setAttribute("normal",new gt(x,3)),this.setAttribute("uv",new gt(M,2));function R(){const I=new Y,V=new Y;let z=0;const H=(t-e)/i;for(let U=0;U<=u;U++){const P=[],Q=U/u,X=Q*(t-e)+e;for(let te=0;te<=a;te++){const $=te/a,ue=$*m+d,se=Math.sin(ue),q=Math.cos(ue);V.x=X*se,V.y=-Q*i+w,V.z=X*q,S.push(V.x,V.y,V.z),I.set(se,H,q).normalize(),x.push(I.x,I.y,I.z),M.push($,1-Q),P.push(T++)}D.push(P)}for(let U=0;U0||P!==0)&&(_.push(Q,X,$),z+=3),(t>0||P!==u-1)&&(_.push(X,te,$),z+=3)}g.addGroup(A,z,0),A+=z}function L(I){const V=T,z=new ze,H=new Y;let U=0;const P=I===!0?e:t,Q=I===!0?1:-1;for(let te=1;te<=a;te++)S.push(0,w*Q,0),x.push(0,Q,0),M.push(.5,.5),T++;const X=T;for(let te=0;te<=a;te++){const ue=te/a*m+d,se=Math.cos(ue),q=Math.sin(ue);H.x=P*q,H.y=w*Q,H.z=P*se,S.push(H.x,H.y,H.z),x.push(0,Q,0),z.x=se*.5+.5,z.y=q*.5*Q+.5,M.push(z.x,z.y),T++}for(let te=0;te.9&&H<.1&&(L<.2&&(f[R+0]+=1),I<.2&&(f[R+2]+=1),V<.2&&(f[R+4]+=1))}}function x(R){u.push(R.x,R.y,R.z)}function M(R,L){const I=R*3;L.x=e[I+0],L.y=e[I+1],L.z=e[I+2]}function T(){const R=new Y,L=new Y,I=new Y,V=new Y,z=new ze,H=new ze,U=new ze;for(let P=0,Q=0;P0)m=a-1;else{m=a;break}if(a=m,i[a]===f)return a/(u-1);const _=i[a],x=i[a+1]-_,M=(f-_)/x;return(a+M)/(u-1)}getTangent(e,t){let a=e-1e-4,u=e+1e-4;a<0&&(a=0),u>1&&(u=1);const f=this.getPoint(a),d=this.getPoint(u),m=t||(f.isVector2?new ze:new Y);return m.copy(d).sub(f).normalize(),m}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new Y,a=[],u=[],f=[],d=new Y,m=new kt;for(let M=0;M<=e;M++){const T=M/e;a[M]=this.getTangentAt(T,new Y)}u[0]=new Y,f[0]=new Y;let g=Number.MAX_VALUE;const _=Math.abs(a[0].x),S=Math.abs(a[0].y),x=Math.abs(a[0].z);_<=g&&(g=_,i.set(1,0,0)),S<=g&&(g=S,i.set(0,1,0)),x<=g&&i.set(0,0,1),d.crossVectors(a[0],i).normalize(),u[0].crossVectors(a[0],d),f[0].crossVectors(a[0],u[0]);for(let M=1;M<=e;M++){if(u[M]=u[M-1].clone(),f[M]=f[M-1].clone(),d.crossVectors(a[M-1],a[M]),d.length()>Number.EPSILON){d.normalize();const T=Math.acos(Ft(a[M-1].dot(a[M]),-1,1));u[M].applyMatrix4(m.makeRotationAxis(d,T))}f[M].crossVectors(a[M],u[M])}if(t===!0){let M=Math.acos(Ft(u[0].dot(u[e]),-1,1));M/=e,a[0].dot(d.crossVectors(u[0],u[e]))>0&&(M=-M);for(let T=1;T<=e;T++)u[T].applyMatrix4(m.makeRotationAxis(a[T],M*T)),f[T].crossVectors(a[T],u[T])}return{tangents:a,normals:u,binormals:f}}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 Dy extends Jr{constructor(e=0,t=0,i=1,a=1,u=0,f=Math.PI*2,d=!1,m=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=a,this.aStartAngle=u,this.aEndAngle=f,this.aClockwise=d,this.aRotation=m}getPoint(e,t=new ze){const i=t,a=Math.PI*2;let u=this.aEndAngle-this.aStartAngle;const f=Math.abs(u)a;)u-=a;u0?0:(Math.floor(Math.abs(d)/u)+1)*u:m===0&&d===u-1&&(d=u-2,m=1);let g,_;this.closed||d>0?g=a[(d-1)%u]:(X0.subVectors(a[0],a[1]).add(a[0]),g=X0);const S=a[d%u],x=a[(d+1)%u];if(this.closed||d+2a.length-2?a.length-1:f+1],S=a[f>a.length-3?a.length-1:f+2];return i.set(wM(d,m.x,g.x,_.x,S.x),wM(d,m.y,g.y,_.y,S.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const f=a[u]-i,d=this.curves[u],m=d.getLength(),g=m===0?0:1-f/m;return d.getPointAt(g,t)}u++}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 S=g.getPoint(0);S.equals(this.currentPoint)||this.lineTo(S.x,S.y)}this.curves.push(g);const _=g.getPoint(1);return this.currentPoint.copy(_),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 Zc extends ny{constructor(e){super(e),this.uuid=ka(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,a=this.holes.length;i80*t){d=o[0],m=o[1];let _=d,S=m;for(let x=t;x_&&(_=M),T>S&&(S=T)}g=Math.max(_-d,S-m),g=g!==0?32767/g:0}return dm(u,f,t,d,m,g,0),f}function WE(o,e,t,i,a){let u;if(a===g3(o,e,t,i)>0)for(let f=e;f=e;f-=i)u=CM(f/i|0,o[f],o[f+1],u);return u&&Yh(u,u.next)&&(mm(u),u=u.next),u}function ef(o,e){if(!o)return o;e||(e=o);let t=o,i;do if(i=!1,!t.steiner&&(Yh(t,t.next)||_i(t.prev,t,t.next)===0)){if(mm(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function dm(o,e,t,i,a,u,f){if(!o)return;!f&&u&&c3(o,i,a,u);let d=o;for(;o.prev!==o.next;){const m=o.prev,g=o.next;if(u?n3(o,i,a,u):t3(o)){e.push(m.i,o.i,g.i),mm(o),o=g.next,d=g.next;continue}if(o=g,o===d){f?f===1?(o=i3(ef(o),e),dm(o,e,t,i,a,u,2)):f===2&&s3(o,e,t,i,a,u):dm(ef(o),e,t,i,a,u,1);break}}}function t3(o){const e=o.prev,t=o,i=o.next;if(_i(e,t,i)>=0)return!1;const a=e.x,u=t.x,f=i.x,d=e.y,m=t.y,g=i.y,_=Math.min(a,u,f),S=Math.min(d,m,g),x=Math.max(a,u,f),M=Math.max(d,m,g);let T=i.next;for(;T!==e;){if(T.x>=_&&T.x<=x&&T.y>=S&&T.y<=M&&Wp(a,d,u,m,f,g,T.x,T.y)&&_i(T.prev,T,T.next)>=0)return!1;T=T.next}return!0}function n3(o,e,t,i){const a=o.prev,u=o,f=o.next;if(_i(a,u,f)>=0)return!1;const d=a.x,m=u.x,g=f.x,_=a.y,S=u.y,x=f.y,M=Math.min(d,m,g),T=Math.min(_,S,x),D=Math.max(d,m,g),w=Math.max(_,S,x),A=kx(M,T,e,t,i),R=kx(D,w,e,t,i);let L=o.prevZ,I=o.nextZ;for(;L&&L.z>=A&&I&&I.z<=R;){if(L.x>=M&&L.x<=D&&L.y>=T&&L.y<=w&&L!==a&&L!==f&&Wp(d,_,m,S,g,x,L.x,L.y)&&_i(L.prev,L,L.next)>=0||(L=L.prevZ,I.x>=M&&I.x<=D&&I.y>=T&&I.y<=w&&I!==a&&I!==f&&Wp(d,_,m,S,g,x,I.x,I.y)&&_i(I.prev,I,I.next)>=0))return!1;I=I.nextZ}for(;L&&L.z>=A;){if(L.x>=M&&L.x<=D&&L.y>=T&&L.y<=w&&L!==a&&L!==f&&Wp(d,_,m,S,g,x,L.x,L.y)&&_i(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;I&&I.z<=R;){if(I.x>=M&&I.x<=D&&I.y>=T&&I.y<=w&&I!==a&&I!==f&&Wp(d,_,m,S,g,x,I.x,I.y)&&_i(I.prev,I,I.next)>=0)return!1;I=I.nextZ}return!0}function i3(o,e){let t=o;do{const i=t.prev,a=t.next.next;!Yh(i,a)&&qE(i,t,t.next,a)&&pm(i,a)&&pm(a,i)&&(e.push(i.i,t.i,a.i),mm(t),mm(t.next),t=o=a),t=t.next}while(t!==o);return ef(t)}function s3(o,e,t,i,a,u){let f=o;do{let d=f.next.next;for(;d!==f.prev;){if(f.i!==d.i&&d3(f,d)){let m=YE(f,d);f=ef(f,f.next),m=ef(m,m.next),dm(f,e,t,i,a,u,0),dm(m,e,t,i,a,u,0);return}d=d.next}f=f.next}while(f!==o)}function a3(o,e,t,i){const a=[];for(let u=0,f=e.length;u=t.next.y&&t.next.y!==t.y){const S=t.x+(a-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(S<=i&&S>u&&(u=S,f=t.x=t.x&&t.x>=m&&i!==t.x&&XE(af.x||t.x===f.x&&u3(f,t)))&&(f=t,_=S)}t=t.next}while(t!==d);return f}function u3(o,e){return _i(o.prev,o,e.prev)<0&&_i(e.next,o,o.next)<0}function c3(o,e,t,i){let a=o;do a.z===0&&(a.z=kx(a.x,a.y,e,t,i)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==o);a.prevZ.nextZ=null,a.prevZ=null,f3(a)}function f3(o){let e,t=1;do{let i=o,a;o=null;let u=null;for(e=0;i;){e++;let f=i,d=0;for(let g=0;g0||m>0&&f;)d!==0&&(m===0||!f||i.z<=f.z)?(a=i,i=i.nextZ,d--):(a=f,f=f.nextZ,m--),u?u.nextZ=a:o=a,a.prevZ=u,u=a;i=f}u.nextZ=null,t*=2}while(e>1);return o}function kx(o,e,t,i,a){return o=(o-t)*a|0,e=(e-i)*a|0,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,o|e<<1}function h3(o){let e=o,t=o;do(e.x=(o-f)*(u-d)&&(o-f)*(i-d)>=(t-f)*(e-d)&&(t-f)*(u-d)>=(a-f)*(i-d)}function Wp(o,e,t,i,a,u,f,d){return!(o===f&&e===d)&&XE(o,e,t,i,a,u,f,d)}function d3(o,e){return o.next.i!==e.i&&o.prev.i!==e.i&&!p3(o,e)&&(pm(o,e)&&pm(e,o)&&m3(o,e)&&(_i(o.prev,o,e.prev)||_i(o,e.prev,e))||Yh(o,e)&&_i(o.prev,o,o.next)>0&&_i(e.prev,e,e.next)>0)}function _i(o,e,t){return(e.y-o.y)*(t.x-e.x)-(e.x-o.x)*(t.y-e.y)}function Yh(o,e){return o.x===e.x&&o.y===e.y}function qE(o,e,t,i){const a=Y0(_i(o,e,t)),u=Y0(_i(o,e,i)),f=Y0(_i(t,i,o)),d=Y0(_i(t,i,e));return!!(a!==u&&f!==d||a===0&&q0(o,t,e)||u===0&&q0(o,i,e)||f===0&&q0(t,o,i)||d===0&&q0(t,e,i))}function q0(o,e,t){return e.x<=Math.max(o.x,t.x)&&e.x>=Math.min(o.x,t.x)&&e.y<=Math.max(o.y,t.y)&&e.y>=Math.min(o.y,t.y)}function Y0(o){return o>0?1:o<0?-1:0}function p3(o,e){let t=o;do{if(t.i!==o.i&&t.next.i!==o.i&&t.i!==e.i&&t.next.i!==e.i&&qE(t,t.next,o,e))return!0;t=t.next}while(t!==o);return!1}function pm(o,e){return _i(o.prev,o,o.next)<0?_i(o,e,o.next)>=0&&_i(o,o.prev,e)>=0:_i(o,e,o.prev)<0||_i(o,o.next,e)<0}function m3(o,e){let t=o,i=!1;const a=(o.x+e.x)/2,u=(o.y+e.y)/2;do t.y>u!=t.next.y>u&&t.next.y!==t.y&&a<(t.next.x-t.x)*(u-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==o);return i}function YE(o,e){const t=Hx(o.i,o.x,o.y),i=Hx(e.i,e.x,e.y),a=o.next,u=e.prev;return o.next=e,e.prev=o,t.next=a,a.prev=t,i.next=t,t.prev=i,u.next=i,i.prev=u,i}function CM(o,e,t,i){const a=Hx(o,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 mm(o){o.next.prev=o.prev,o.prev.next=o.next,o.prevZ&&(o.prevZ.nextZ=o.nextZ),o.nextZ&&(o.nextZ.prevZ=o.prevZ)}function Hx(o,e,t){return{i:o,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function g3(o,e,t,i){let a=0;for(let u=e,f=t-i;u2&&o[e-1].equals(o[0])&&o.pop()}function DM(o,e){for(let t=0;tNumber.EPSILON){const be=Math.sqrt(O),Le=Math.sqrt(Xe*Xe+G*G),Te=Ve.x-Mt/be,rt=Ve.y+nt/be,qe=Ne.x-G/Le,St=Ne.y+Xe/Le,At=((qe-Te)*G-(St-rt)*Xe)/(nt*G-Mt*Xe);Je=Te+nt*At-Re.x,j=rt+Mt*At-Re.y;const Fe=Je*Je+j*j;if(Fe<=2)return new ze(Je,j);xt=Math.sqrt(Fe/2)}else{let be=!1;nt>Number.EPSILON?Xe>Number.EPSILON&&(be=!0):nt<-Number.EPSILON?Xe<-Number.EPSILON&&(be=!0):Math.sign(Mt)===Math.sign(G)&&(be=!0),be?(Je=-Mt,j=nt,xt=Math.sqrt(O)):(Je=nt,j=Mt,xt=Math.sqrt(O/2))}return new ze(Je/xt,j/xt)}const _e=[];for(let Re=0,Ve=se.length,Ne=Ve-1,Je=Re+1;Re=0;Re--){const Ve=Re/w,Ne=M*Math.cos(Ve*Math.PI/2),Je=T*Math.sin(Ve*Math.PI/2)+D;for(let j=0,xt=se.length;j=0;){const Je=Ne;let j=Ne-1;j<0&&(j=Re.length-1);for(let xt=0,nt=_+w*2;xt0)&&M.push(L,I,z),(A!==i-1||m0&&(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 US extends yr{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class IS extends zs{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new pt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Pu,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ga,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,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 KE extends IS{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ze(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Ft(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new pt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new pt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new pt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=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 $E extends zs{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new pt(16777215),this.specular=new pt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Pu,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ga,this.combine=bm,this.reflectivity=1,this.envMapIntensity=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.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class eT extends zs{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new pt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Pu,this.normalScale=new ze(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 tT extends zs{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Pu,this.normalScale=new ze(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 nT extends zs{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Pu,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ga,this.combine=bm,this.reflectivity=1,this.envMapIntensity=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.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class OS extends zs{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=mE,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 PS extends zs{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 iT extends zs{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new pt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Pu,this.normalScale=new ze(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 sT extends na{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 Xc(o,e){return!o||o.constructor===e?o:typeof e.BYTES_PER_ELEMENT=="number"?new e(o):Array.prototype.slice.call(o)}function aT(o){function e(a,u){return o[a]-o[u]}const t=o.length,i=new Array(t);for(let a=0;a!==t;++a)i[a]=a;return i.sort(e),i}function Gx(o,e,t){const i=o.length,a=new o.constructor(i);for(let u=0,f=0;f!==i;++u){const d=t[u]*e;for(let m=0;m!==e;++m)a[f++]=o[d+m]}return a}function zS(o,e,t,i){let a=1,u=o[0];for(;u!==void 0&&u[i]===void 0;)u=o[a++];if(u===void 0)return;let f=u[i];if(f!==void 0)if(Array.isArray(f))do f=u[i],f!==void 0&&(e.push(u.time),t.push(...f)),u=o[a++];while(u!==void 0);else if(f.toArray!==void 0)do f=u[i],f!==void 0&&(e.push(u.time),f.toArray(t,t.length)),u=o[a++];while(u!==void 0);else do f=u[i],f!==void 0&&(e.push(u.time),t.push(f)),u=o[a++];while(u!==void 0)}function E3(o,e,t,i,a=30){const u=o.clone();u.name=e;const f=[];for(let m=0;m=i)){S.push(g.times[M]);for(let D=0;D<_;++D)x.push(g.values[M*_+D])}}S.length!==0&&(g.times=Xc(S,g.times.constructor),g.values=Xc(x,g.values.constructor),f.push(g))}u.tracks=f;let d=1/0;for(let m=0;mu.tracks[m].times[0]&&(d=u.tracks[m].times[0]);for(let m=0;m=d.times[T]){const A=T*S+_,R=A+S-_;D=d.values.slice(A,R)}else{const A=d.createInterpolant(),R=_,L=S-_;A.evaluate(u),D=A.resultBuffer.slice(R,L)}m==="quaternion"&&new ta().fromArray(D).normalize().conjugate().toArray(D);const w=g.times.length;for(let A=0;A=u)){const d=t[1];e=u)break t}f=i,i=0;break n}break e}for(;i>>1;et;)--f;if(++f,u!==0||f!==a){u>=f&&(f=Math.max(f,1),u=f-1);const d=this.getValueSize();this.times=i.slice(u,f),this.values=this.values.slice(u*d,f*d)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Tt("KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,a=this.values,u=i.length;u===0&&(Tt("KeyframeTrack: Track is empty.",this),e=!1);let f=null;for(let d=0;d!==u;d++){const m=i[d];if(typeof m=="number"&&isNaN(m)){Tt("KeyframeTrack: Time is not a valid number.",this,d,m),e=!1;break}if(f!==null&&f>m){Tt("KeyframeTrack: Out of order keys.",this,d,m,f),e=!1;break}f=m}if(a!==void 0&&ME(a))for(let d=0,m=a.length;d!==m;++d){const g=a[d];if(isNaN(g)){Tt("KeyframeTrack: Value is not a valid number.",this,d,g),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),a=this.getInterpolation()===ov,u=e.length-1;let f=1;for(let d=1;d0){e[f]=e[u];for(let d=u*i,m=f*i,g=0;g!==i;++g)t[m+g]=t[d+g];++f}return f!==e.length?(this.times=e.slice(0,f),this.values=t.slice(0,f*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}}_r.prototype.ValueTypeName="";_r.prototype.TimeBufferType=Float32Array;_r.prototype.ValueBufferType=Float32Array;_r.prototype.DefaultInterpolation=Kv;class sf extends _r{constructor(e,t,i){super(e,t,i)}}sf.prototype.ValueTypeName="bool";sf.prototype.ValueBufferType=Array;sf.prototype.DefaultInterpolation=rm;sf.prototype.InterpolantFactoryMethodLinear=void 0;sf.prototype.InterpolantFactoryMethodSmooth=void 0;class FS extends _r{constructor(e,t,i,a){super(e,t,i,a)}}FS.prototype.ValueTypeName="color";class gm extends _r{constructor(e,t,i,a){super(e,t,i,a)}}gm.prototype.ValueTypeName="number";class uT extends ed{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e,t,i,a){const u=this.resultBuffer,f=this.sampleValues,d=this.valueSize,m=(i-t)/(a-t);let g=e*d;for(let _=g+d;g!==_;g+=4)ta.slerpFlat(u,0,f,g-d,f,g,m);return u}}class Rm extends _r{constructor(e,t,i,a){super(e,t,i,a)}InterpolantFactoryMethodLinear(e){return new uT(this.times,this.values,this.getValueSize(),e)}}Rm.prototype.ValueTypeName="quaternion";Rm.prototype.InterpolantFactoryMethodSmooth=void 0;class af extends _r{constructor(e,t,i){super(e,t,i)}}af.prototype.ValueTypeName="string";af.prototype.ValueBufferType=Array;af.prototype.DefaultInterpolation=rm;af.prototype.InterpolantFactoryMethodLinear=void 0;af.prototype.InterpolantFactoryMethodSmooth=void 0;class vm extends _r{constructor(e,t,i,a){super(e,t,i,a)}}vm.prototype.ValueTypeName="vector";class ym{constructor(e="",t=-1,i=[],a=gy){this.name=e,this.tracks=i,this.duration=t,this.blendMode=a,this.uuid=ka(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,a=1/(e.fps||1);for(let f=0,d=i.length;f!==d;++f)t.push(C3(i[f]).scale(a));const u=new this(e.name,e.duration,t,e.blendMode);return u.uuid=e.uuid,u.userData=JSON.parse(e.userData||"{}"),u}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 u=0,f=i.length;u!==f;++u)t.push(_r.toJSON(i[u]));return a}static CreateFromMorphTargetSequence(e,t,i,a){const u=t.length,f=[];for(let d=0;d1){const S=_[1];let x=a[S];x||(a[S]=x=[]),x.push(g)}}const f=[];for(const d in a)f.push(this.CreateFromMorphTargetSequence(d,a[d],t,i));return f}static parseAnimation(e,t){if(at("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Tt("AnimationClip: No animation in JSONLoader data."),null;const i=function(S,x,M,T,D){if(M.length!==0){const w=[],A=[];zS(M,w,A,T),w.length!==0&&D.push(new S(x,w,A))}},a=[],u=e.name||"default",f=e.fps||30,d=e.blendMode;let m=e.length||-1;const g=e.hierarchy||[];for(let S=0;S{t&&t(u),this.manager.itemEnd(e)},0),u;if(Ml[e]!==void 0){Ml[e].push({onLoad:t,onProgress:i,onError:a});return}Ml[e]=[],Ml[e].push({onLoad:t,onProgress:i,onError:a});const f=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}),d=this.mimeType,m=this.responseType;fetch(f).then(g=>{if(g.status===200||g.status===0){if(g.status===0&&at("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||g.body===void 0||g.body.getReader===void 0)return g;const _=Ml[e],S=g.body.getReader(),x=g.headers.get("X-File-Size")||g.headers.get("Content-Length"),M=x?parseInt(x):0,T=M!==0;let D=0;const w=new ReadableStream({start(A){R();function R(){S.read().then(({done:L,value:I})=>{if(L)A.close();else{D+=I.byteLength;const V=new ProgressEvent("progress",{lengthComputable:T,loaded:D,total:M});for(let z=0,H=_.length;z{A.error(L)})}}});return new Response(w)}else throw new R3(`fetch for "${g.url}" responded with ${g.status}: ${g.statusText}`,g)}).then(g=>{switch(m){case"arraybuffer":return g.arrayBuffer();case"blob":return g.blob();case"document":return g.text().then(_=>new DOMParser().parseFromString(_,d));case"json":return g.json();default:if(d==="")return g.text();{const S=/charset="?([^;"\s]*)"?/i.exec(d),x=S&&S[1]?S[1].toLowerCase():void 0,M=new TextDecoder(x);return g.arrayBuffer().then(T=>M.decode(T))}}}).then(g=>{Oo.add(`file:${e}`,g);const _=Ml[e];delete Ml[e];for(let S=0,x=_.length;S{const _=Ml[e];if(_===void 0)throw this.manager.itemError(e),g;delete Ml[e];for(let S=0,x=_.length;S{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 D3 extends Ra{constructor(e){super(e)}load(e,t,i,a){const u=this,f=new Cl(this.manager);f.setPath(this.path),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(e,function(d){try{t(u.parse(JSON.parse(d)))}catch(m){a?a(m):Tt(m),u.manager.itemError(e)}},i,a)}parse(e){const t=[];for(let i=0;i0:a.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const u in e.uniforms){const f=e.uniforms[u];switch(a.uniforms[u]={},f.type){case"t":a.uniforms[u].value=i(f.value);break;case"c":a.uniforms[u].value=new pt().setHex(f.value);break;case"v2":a.uniforms[u].value=new ze().fromArray(f.value);break;case"v3":a.uniforms[u].value=new Y().fromArray(f.value);break;case"v4":a.uniforms[u].value=new Xn().fromArray(f.value);break;case"m3":a.uniforms[u].value=new Kt().fromArray(f.value);break;case"m4":a.uniforms[u].value=new kt().fromArray(f.value);break;default:a.uniforms[u].value=f.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 u in e.extensions)a.extensions[u]=e.extensions[u];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 u=e.normalScale;Array.isArray(u)===!1&&(u=[u,u]),a.normalScale=new ze().fromArray(u)}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 ze().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 ky.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:ZE,SpriteMaterial:MS,RawShaderMaterial:US,ShaderMaterial:yr,PointsMaterial:TS,MeshPhysicalMaterial:KE,MeshStandardMaterial:IS,MeshPhongMaterial:$E,MeshToonMaterial:eT,MeshNormalMaterial:tT,MeshLambertMaterial:nT,MeshDepthMaterial:OS,MeshDistanceMaterial:PS,MeshBasicMaterial:zu,MeshMatcapMaterial:iT,LineDashedMaterial:sT,LineBasicMaterial:na,Material:zs};return new t[e]}}class Wx{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 _T extends jt{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 xT extends Ra{constructor(e){super(e)}load(e,t,i,a){const u=this,f=new Cl(u.manager);f.setPath(u.path),f.setRequestHeader(u.requestHeader),f.setWithCredentials(u.withCredentials),f.load(e,function(d){try{t(u.parse(JSON.parse(d)))}catch(m){a?a(m):Tt(m),u.manager.itemError(e)}},i,a)}parse(e){const t={},i={};function a(M,T){if(t[T]!==void 0)return t[T];const w=M.interleavedBuffers[T],A=u(M,w.buffer),R=zh(w.type,A),L=new My(R,w.stride);return L.uuid=w.uuid,t[T]=L,L}function u(M,T){if(i[T]!==void 0)return i[T];const w=M.arrayBuffers[T],A=new Uint32Array(w).buffer;return i[T]=A,A}const f=e.isInstancedBufferGeometry?new _T:new jt,d=e.data.index;if(d!==void 0){const M=zh(d.type,d.array);f.setIndex(new Gn(M,1))}const m=e.data.attributes;for(const M in m){const T=m[M];let D;if(T.isInterleavedBufferAttribute){const w=a(e.data,T.data);D=new $c(w,T.itemSize,T.offset,T.normalized)}else{const w=zh(T.type,T.array),A=T.isInstancedBufferAttribute?Xh:Gn;D=new A(w,T.itemSize,T.normalized)}T.name!==void 0&&(D.name=T.name),T.usage!==void 0&&D.setUsage(T.usage),f.setAttribute(M,D)}const g=e.data.morphAttributes;if(g)for(const M in g){const T=g[M],D=[];for(let w=0,A=T.length;w0){const m=new VS(t);u=new _m(m),u.setCrossOrigin(this.crossOrigin);for(let g=0,_=e.length;g<_;g++){const S=e[g],x=S.url;if(Array.isArray(x)){const M=[];for(let T=0,D=x.length;T0){a=new _m(this.manager),a.setCrossOrigin(this.crossOrigin);for(let f=0,d=e.length;f{let A=null,R=null;return w.boundingBox!==void 0&&(A=new Ps().fromJSON(w.boundingBox)),w.boundingSphere!==void 0&&(R=new ys().fromJSON(w.boundingSphere)),{...w,boundingBox:A,boundingSphere:R}}),f._instanceInfo=e.instanceInfo,f._availableInstanceIds=e._availableInstanceIds,f._availableGeometryIds=e._availableGeometryIds,f._nextIndexStart=e.nextIndexStart,f._nextVertexStart=e.nextVertexStart,f._geometryCount=e.geometryCount,f._maxInstanceCount=e.maxInstanceCount,f._maxVertexCount=e.maxVertexCount,f._maxIndexCount=e.maxIndexCount,f._geometryInitialized=e.geometryInitialized,f._matricesTexture=g(e.matricesTexture.uuid),f._indirectTexture=g(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(f._colorsTexture=g(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(f.boundingSphere=new ys().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(f.boundingBox=new Ps().fromJSON(e.boundingBox));break;case"LOD":f=new DE;break;case"Line":f=new Ou(d(e.geometry),m(e.material));break;case"LineLoop":f=new IE(d(e.geometry),m(e.material));break;case"LineSegments":f=new ko(d(e.geometry),m(e.material));break;case"PointCloud":case"Points":f=new OE(d(e.geometry),m(e.material));break;case"Sprite":f=new RE(m(e.material));break;case"Group":f=new Bh;break;case"Bone":f=new ES;break;default:f=new wn}if(f.uuid=e.uuid,e.name!==void 0&&(f.name=e.name),e.matrix!==void 0?(f.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(f.matrixAutoUpdate=e.matrixAutoUpdate),f.matrixAutoUpdate&&f.matrix.decompose(f.position,f.quaternion,f.scale)):(e.position!==void 0&&f.position.fromArray(e.position),e.rotation!==void 0&&f.rotation.fromArray(e.rotation),e.quaternion!==void 0&&f.quaternion.fromArray(e.quaternion),e.scale!==void 0&&f.scale.fromArray(e.scale)),e.up!==void 0&&f.up.fromArray(e.up),e.pivot!==void 0&&(f.pivot=new Y().fromArray(e.pivot)),e.morphTargetDictionary!==void 0&&(f.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),e.morphTargetInfluences!==void 0&&(f.morphTargetInfluences=e.morphTargetInfluences.slice()),e.castShadow!==void 0&&(f.castShadow=e.castShadow),e.receiveShadow!==void 0&&(f.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(f.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(f.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(f.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(f.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&f.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(f.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(f.visible=e.visible),e.frustumCulled!==void 0&&(f.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(f.renderOrder=e.renderOrder),e.static!==void 0&&(f.static=e.static),e.userData!==void 0&&(f.userData=e.userData),e.layers!==void 0&&(f.layers.mask=e.layers),e.children!==void 0){const x=e.children;for(let M=0;M"u"&&at("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&at("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 u=this,f=Oo.get(`image-bitmap:${e}`);if(f!==void 0){if(u.manager.itemStart(e),f.then){f.then(g=>{if(cx.has(f)===!0)a&&a(cx.get(f)),u.manager.itemError(e),u.manager.itemEnd(e);else return t&&t(g),u.manager.itemEnd(e),g});return}return setTimeout(function(){t&&t(f),u.manager.itemEnd(e)},0),f}const d={};d.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",d.headers=this.requestHeader,d.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const m=fetch(e,d).then(function(g){return g.blob()}).then(function(g){return createImageBitmap(g,Object.assign(u.options,{colorSpaceConversion:"none"}))}).then(function(g){return Oo.add(`image-bitmap:${e}`,g),t&&t(g),u.manager.itemEnd(e),g}).catch(function(g){a&&a(g),cx.set(m,g),Oo.remove(`image-bitmap:${e}`),u.manager.itemError(e),u.manager.itemEnd(e)});Oo.add(`image-bitmap:${e}`,m),u.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let Q0;class GS{static getContext(){return Q0===void 0&&(Q0=new(window.AudioContext||window.webkitAudioContext)),Q0}static setContext(e){Q0=e}}class V3 extends Ra{constructor(e){super(e)}load(e,t,i,a){const u=this,f=new Cl(this.manager);f.setResponseType("arraybuffer"),f.setPath(this.path),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(e,function(m){try{const g=m.slice(0);GS.getContext().decodeAudioData(g,function(S){t(S)}).catch(d)}catch(g){d(g)}},i,a);function d(m){a?a(m):Tt(m),u.manager.itemError(e)}}}const VM=new kt,kM=new kt,Lc=new kt;class k3{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new as,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new as,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,Lc.copy(e.projectionMatrix);const a=t.eyeSep/2,u=a*t.near/t.focus,f=t.near*Math.tan(jc*t.fov*.5)/t.zoom;let d,m;kM.elements[12]=-a,VM.elements[12]=a,d=-f*t.aspect+u,m=f*t.aspect+u,Lc.elements[0]=2*t.near/(m-d),Lc.elements[8]=(m+d)/(m-d),this.cameraL.projectionMatrix.copy(Lc),d=-f*t.aspect-u,m=f*t.aspect-u,Lc.elements[0]=2*t.near/(m-d),Lc.elements[8]=(m+d)/(m-d),this.cameraR.projectionMatrix.copy(Lc)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(kM),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(VM)}}const Ch=-90,Rh=1;class ST extends wn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const a=new as(Ch,Rh,e,t);a.layers=this.layers,this.add(a);const u=new as(Ch,Rh,e,t);u.layers=this.layers,this.add(u);const f=new as(Ch,Rh,e,t);f.layers=this.layers,this.add(f);const d=new as(Ch,Rh,e,t);d.layers=this.layers,this.add(d);const m=new as(Ch,Rh,e,t);m.layers=this.layers,this.add(m);const g=new as(Ch,Rh,e,t);g.layers=this.layers,this.add(g)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,a,u,f,d,m]=t;for(const g of t)this.remove(g);if(e===Va)i.up.set(0,1,0),i.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),u.up.set(0,0,-1),u.lookAt(0,1,0),f.up.set(0,0,1),f.lookAt(0,-1,0),d.up.set(0,1,0),d.lookAt(0,0,1),m.up.set(0,1,0),m.lookAt(0,0,-1);else if(e===Kc)i.up.set(0,-1,0),i.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),u.up.set(0,0,1),u.lookAt(0,1,0),f.up.set(0,0,-1),f.lookAt(0,-1,0),d.up.set(0,-1,0),d.lookAt(0,0,1),m.up.set(0,-1,0),m.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const g of t)this.add(g),g.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[u,f,d,m,g,_]=this.children,S=e.getRenderTarget(),x=e.getActiveCubeFace(),M=e.getActiveMipmapLevel(),T=e.xr.enabled;e.xr.enabled=!1;const D=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let w=!1;e.isWebGLRenderer===!0?w=e.state.buffers.depth.getReversed():w=e.reversedDepthBuffer,e.setRenderTarget(i,0,a),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,u),e.setRenderTarget(i,1,a),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,f),e.setRenderTarget(i,2,a),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,d),e.setRenderTarget(i,3,a),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,m),e.setRenderTarget(i,4,a),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,g),i.texture.generateMipmaps=D,e.setRenderTarget(i,5,a),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,_),e.setRenderTarget(S,x,M),e.xr.enabled=T,i.texture.needsPMREMUpdate=!0}}class bT extends as{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class MT{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=H3.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function H3(){this._document.hidden===!1&&this.reset()}const Uc=new Y,fx=new ta,G3=new Y,Ic=new Y,Oc=new Y;class W3 extends wn{constructor(){super(),this.type="AudioListener",this.context=GS.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new MT}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),this._timer.update();const t=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(Uc,fx,G3),Ic.set(0,0,-1).applyQuaternion(fx),Oc.set(0,1,0).applyQuaternion(fx),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Uc.x,i),t.positionY.linearRampToValueAtTime(Uc.y,i),t.positionZ.linearRampToValueAtTime(Uc.z,i),t.forwardX.linearRampToValueAtTime(Ic.x,i),t.forwardY.linearRampToValueAtTime(Ic.y,i),t.forwardZ.linearRampToValueAtTime(Ic.z,i),t.upX.linearRampToValueAtTime(Oc.x,i),t.upY.linearRampToValueAtTime(Oc.y,i),t.upZ.linearRampToValueAtTime(Oc.z,i)}else t.setPosition(Uc.x,Uc.y,Uc.z),t.setOrientation(Ic.x,Ic.y,Ic.z,Oc.x,Oc.y,Oc.z)}}class ET extends wn{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){at("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){at("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){at("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){at("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 m=t,g=t+t;m!==g;++m)if(i[m]!==i[m+t]){d.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 u=i,f=a;u!==f;++u)t[u]=t[a+u%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 f=0;f!==u;++f)e[t+f]=e[i+f]}_slerp(e,t,i,a){ta.slerpFlat(e,t,e,t,e,i,a)}_slerpAdditive(e,t,i,a,u){const f=this._workIndex*u;ta.multiplyQuaternionsFlat(e,f,e,t,e,i),ta.slerpFlat(e,t,e,t,e,f,a)}_lerp(e,t,i,a,u){const f=1-a;for(let d=0;d!==u;++d){const m=t+d;e[m]=e[m]*f+e[i+d]*a}}_lerpAdditive(e,t,i,a,u){for(let f=0;f!==u;++f){const d=t+f;e[d]=e[d]+e[i+f]*a}}}const WS="\\[\\]\\.:\\/",j3=new RegExp("["+WS+"]","g"),XS="[^"+WS+"]",Z3="[^"+WS.replace("\\.","")+"]",Q3=/((?:WC+[\/:])*)/.source.replace("WC",XS),J3=/(WCOD+)?/.source.replace("WCOD",Z3),K3=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",XS),$3=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",XS),eR=new RegExp("^"+Q3+J3+K3+$3+"$"),tR=["material","materials","bones","map"];class nR{constructor(e,t,i){const a=i||An.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_,u=i.length;a!==u;++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 An{constructor(e,t,i){this.path=t,this.parsedPath=i||An.parseTrackName(t),this.node=An.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 An.Composite(e,t,i):new An(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(j3,"")}static parseTrackName(e){const t=eR.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 u=i.nodeName.substring(a+1);tR.indexOf(u)!==-1&&(i.nodeName=i.nodeName.substring(0,a),i.objectName=u)}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(u){for(let f=0;f=u){const S=u++,x=e[S];t[x.uuid]=_,e[_]=x,t[g]=S,e[S]=m;for(let M=0,T=a;M!==T;++M){const D=i[M],w=D[S],A=D[_];D[_]=w,D[S]=A}}}this.nCachedObjects_=u}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,a=i.length;let u=this.nCachedObjects_,f=e.length;for(let d=0,m=arguments.length;d!==m;++d){const g=arguments[d],_=g.uuid,S=t[_];if(S!==void 0)if(delete t[_],S0&&(t[M.uuid]=S),e[S]=M,e.pop();for(let T=0,D=a;T!==D;++T){const w=i[T];w[S]=w[x],w.pop()}}}this.nCachedObjects_=u}subscribe_(e,t){const i=this._bindingsIndicesByPath;let a=i[e];const u=this._bindings;if(a!==void 0)return u[a];const f=this._paths,d=this._parsedPaths,m=this._objects,g=m.length,_=this.nCachedObjects_,S=new Array(g);a=u.length,i[e]=a,f.push(e),d.push(t),u.push(S);for(let x=_,M=m.length;x!==M;++x){const T=m[x];S[x]=new An(T,e,t)}return S}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const a=this._paths,u=this._parsedPaths,f=this._bindings,d=f.length-1,m=f[d],g=e[d];t[g]=i,f[i]=m,f.pop(),u[i]=u[d],u.pop(),a[i]=a[d],a.pop()}}}class AT{constructor(e,t,i=null,a=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=a;const u=t.tracks,f=u.length,d=new Array(f),m={endingStart:Gc,endingEnd:Gc};for(let g=0;g!==f;++g){const _=u[g].createInterpolant(null);d[g]=_,_.settings=m}this._interpolantSettings=m,this._interpolants=d,this._propertyBindings=new Array(f),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=dE,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,u=e._clip.duration,f=u/a,d=a/u;e.warp(1,f,t),this.warp(d,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,u=a.time,f=this.timeScale;let d=this._timeScaleInterpolant;d===null&&(d=a._lendControlInterpolant(),this._timeScaleInterpolant=d);const m=d.parameterPositions,g=d.sampleValues;return m[0]=u,m[1]=u+i,g[0]=e/f,g[1]=t/f,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 u=this._startTime;if(u!==null){const m=(e-u)*i;m<0||i===0?t=0:(this._startTime=null,t=i*m)}t*=this._updateTimeScale(e);const f=this._updateTime(t),d=this._updateWeight(e);if(d>0){const m=this._interpolants,g=this._propertyBindings;switch(this.blendMode){case vS:for(let _=0,S=m.length;_!==S;++_)m[_].evaluate(f),g[_].accumulateAdditive(d);break;case gy:default:for(let _=0,S=m.length;_!==S;++_)m[_].evaluate(f),g[_].accumulate(a,d)}}}_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,u=this._loopCount;const f=i===pE;if(e===0)return u===-1?a:f&&(u&1)===1?t-a:a;if(i===hE){u===-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(u===-1&&(e>=0?(u=0,this._setEndings(!0,this.repetitions===0,f)):this._setEndings(this.repetitions===0,!0,f)),a>=t||a<0){const d=Math.floor(a/t);a-=t*d,u+=Math.abs(d);const m=this.repetitions-u;if(m<=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(m===1){const g=e<0;this._setEndings(g,!g,f)}else this._setEndings(!1,!1,f);this._loopCount=u,this.time=a,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d})}}else this.time=a;if(f&&(u&1)===1)return t-a}return a}_setEndings(e,t,i){const a=this._interpolantSettings;i?(a.endingStart=Wc,a.endingEnd=Wc):(e?a.endingStart=this.zeroSlopeAtStart?Wc:Gc:a.endingStart=om,t?a.endingEnd=this.zeroSlopeAtEnd?Wc:Gc:a.endingEnd=om)}_scheduleFading(e,t,i){const a=this._mixer,u=a.time;let f=this._weightInterpolant;f===null&&(f=a._lendControlInterpolant(),this._weightInterpolant=f);const d=f.parameterPositions,m=f.sampleValues;return d[0]=u,m[0]=t,d[1]=u+e,m[1]=i,this}}const sR=new Float32Array(1);class aR extends Vo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(e,t){const i=e._localRoot||this._root,a=e._clip.tracks,u=a.length,f=e._propertyBindings,d=e._interpolants,m=i.uuid,g=this._bindingsByRootAndName;let _=g[m];_===void 0&&(_={},g[m]=_);for(let S=0;S!==u;++S){const x=a[S],M=x.name;let T=_[M];if(T!==void 0)++T.referenceCount,f[S]=T;else{if(T=f[S],T!==void 0){T._cacheIndex===null&&(++T.referenceCount,this._addInactiveBinding(T,m,M));continue}const D=t&&t._propertyBindings[S].binding.parsedPath;T=new TT(An.create(i,M,D),x.ValueTypeName,x.getValueSize()),++T.referenceCount,this._addInactiveBinding(T,m,M),f[S]=T}d[S].resultBuffer=T.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,a=e._clip.uuid,u=this._actionsByClip[a];this._bindAction(e,u&&u.knownActions[0]),this._addInactiveAction(e,a,i)}const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const u=t[i];u.useCount++===0&&(this._lendBinding(u),u.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 u=t[i];--u.useCount===0&&(u.restoreOriginalState(),this._takeBackBinding(u))}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,u=Math.sign(e),f=this._accuIndex^=1;for(let g=0;g!==i;++g)t[g]._update(a,e,u,f);const d=this._bindings,m=this._nActiveBindings;for(let g=0;g!==m;++g)d[g].apply(f);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,XM).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 qM=new Y,J0=new Y,Dh=new Y,Nh=new Y,hx=new Y,pR=new Y,mR=new Y;class gR{constructor(e=new Y,t=new Y){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){qM.subVectors(e,this.start),J0.subVectors(this.end,this.start);const i=J0.dot(J0);let u=J0.dot(qM)/i;return t&&(u=Ft(u,0,1)),u}closestPointToPoint(e,t,i){const a=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(a).add(this.start)}distanceSqToLine3(e,t=pR,i=mR){const a=10000000000000001e-32;let u,f;const d=this.start,m=e.start,g=this.end,_=e.end;Dh.subVectors(g,d),Nh.subVectors(_,m),hx.subVectors(d,m);const S=Dh.dot(Dh),x=Nh.dot(Nh),M=Nh.dot(hx);if(S<=a&&x<=a)return t.copy(d),i.copy(m),t.sub(i),t.dot(t);if(S<=a)u=0,f=M/x,f=Ft(f,0,1);else{const T=Dh.dot(hx);if(x<=a)f=0,u=Ft(-T/S,0,1);else{const D=Dh.dot(Nh),w=S*x-D*D;w!==0?u=Ft((D*M-T*x)/w,0,1):u=0,f=(D*u+M)/x,f<0?(f=0,u=Ft(-T/S,0,1)):f>1&&(f=1,u=Ft((D-T)/S,0,1))}}return t.copy(d).addScaledVector(Dh,u),i.copy(m).addScaledVector(Nh,f),t.distanceToSquared(i)}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 YM=new Y;class vR extends wn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new jt,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 f=0,d=1,m=32;f1)for(let S=0;S.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{KM.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(KM,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 DR extends ko{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 jt;a.setAttribute("position",new gt(t,3)),a.setAttribute("color",new gt(i,3));const u=new na({vertexColors:!0,toneMapped:!1});super(a,u),this.type="AxesHelper"}setColors(e,t,i){const a=new pt,u=this.geometry.attributes.color.array;return a.set(e),a.toArray(u,0),a.toArray(u,3),a.set(t),a.toArray(u,6),a.toArray(u,9),a.set(i),a.toArray(u,12),a.toArray(u,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class NR{constructor(){this.type="ShapePath",this.color=new pt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new ny,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,u,f){return this.currentPath.bezierCurveTo(e,t,i,a,u,f),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(A){const R=[];for(let L=0,I=A.length;LNumber.EPSILON){if(Q<0&&(H=R[z],P=-P,U=R[V],Q=-Q),A.yU.y)continue;if(A.y===H.y){if(A.x===H.x)return!0}else{const X=Q*(A.x-H.x)-P*(A.y-H.y);if(X===0)return!0;if(X<0)continue;I=!I}}else{if(A.y!==H.y)continue;if(U.x<=A.x&&A.x<=H.x||H.x<=A.x&&A.x<=U.x)return!0}}return I}const a=Zr.isClockWise,u=this.subPaths;if(u.length===0)return[];let f,d,m;const g=[];if(u.length===1)return d=u[0],m=new Zc,m.curves=d.curves,g.push(m),g;let _=!a(u[0].getPoints());_=e?!_:_;const S=[],x=[];let M=[],T=0,D;x[T]=void 0,M[T]=[];for(let A=0,R=u.length;A1){let A=!1,R=0;for(let L=0,I=x.length;L0&&A===!1&&(M=S)}let w;for(let A=0,R=x.length;Ae?(o.repeat.x=1,o.repeat.y=t/e,o.offset.x=0,o.offset.y=(1-o.repeat.y)/2):(o.repeat.x=e/t,o.repeat.y=1,o.offset.x=(1-o.repeat.x)/2,o.offset.y=0),o}function IR(o,e){const t=o.image&&o.image.width?o.image.width/o.image.height:1;return t>e?(o.repeat.x=e/t,o.repeat.y=1,o.offset.x=(1-o.repeat.x)/2,o.offset.y=0):(o.repeat.x=1,o.repeat.y=t/e,o.offset.x=0,o.offset.y=(1-o.repeat.y)/2),o}function OR(o){return o.repeat.x=1,o.repeat.y=1,o.offset.x=0,o.offset.y=0,o}function qx(o,e,t,i){const a=PR(i);switch(t){case mS:return o*e;case dy:return o*e/a.components*a.byteLength;case Mm:return o*e/a.components*a.byteLength;case Jc:return o*e*2/a.components*a.byteLength;case py:return o*e*2/a.components*a.byteLength;case gS:return o*e*3/a.components*a.byteLength;case Os:return o*e*4/a.components*a.byteLength;case my:return o*e*4/a.components*a.byteLength;case Qp:case Jp:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*8;case Kp:case $p:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case Sv:case Mv:return Math.max(o,16)*Math.max(e,8)/4;case xv:case bv:return Math.max(o,8)*Math.max(e,8)/2;case Ev:case Tv:case wv:case Cv:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*8;case Av:case Rv:case Dv:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case Nv:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case Lv:return Math.floor((o+4)/5)*Math.floor((e+3)/4)*16;case Uv:return Math.floor((o+4)/5)*Math.floor((e+4)/5)*16;case Iv:return Math.floor((o+5)/6)*Math.floor((e+4)/5)*16;case Ov:return Math.floor((o+5)/6)*Math.floor((e+5)/6)*16;case Pv:return Math.floor((o+7)/8)*Math.floor((e+4)/5)*16;case zv:return Math.floor((o+7)/8)*Math.floor((e+5)/6)*16;case Bv:return Math.floor((o+7)/8)*Math.floor((e+7)/8)*16;case Fv:return Math.floor((o+9)/10)*Math.floor((e+4)/5)*16;case Vv:return Math.floor((o+9)/10)*Math.floor((e+5)/6)*16;case kv:return Math.floor((o+9)/10)*Math.floor((e+7)/8)*16;case Hv:return Math.floor((o+9)/10)*Math.floor((e+9)/10)*16;case Gv:return Math.floor((o+11)/12)*Math.floor((e+9)/10)*16;case Wv:return Math.floor((o+11)/12)*Math.floor((e+11)/12)*16;case Xv:case qv:case Yv:return Math.ceil(o/4)*Math.ceil(e/4)*16;case jv:case Zv:return Math.ceil(o/4)*Math.ceil(e/4)*8;case Qv:case Jv:return Math.ceil(o/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function PR(o){switch(o){case Js:case fS:return{byteLength:1,components:1};case kh:case hS:case Bo:return{byteLength:2,components:1};case fy:case hy:return{byteLength:2,components:4};case vr:case cy:case $s:return{byteLength:4,components:1};case dS:case pS:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${o}.`)}class zR{static contain(e,t){return UR(e,t)}static cover(e,t){return IR(e,t)}static fill(e){return OR(e)}static getByteLength(e,t,i,a){return qx(e,t,i,a)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:oy}}));typeof window<"u"&&(window.__THREE__?at("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=oy);function DT(){let o=null,e=!1,t=null,i=null;function a(u,f){t(u,f),i=o.requestAnimationFrame(a)}return{start:function(){e!==!0&&t!==null&&(i=o.requestAnimationFrame(a),e=!0)},stop:function(){o.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(u){t=u},setContext:function(u){o=u}}}function BR(o){const e=new WeakMap;function t(d,m){const g=d.array,_=d.usage,S=g.byteLength,x=o.createBuffer();o.bindBuffer(m,x),o.bufferData(m,g,_),d.onUploadCallback();let M;if(g instanceof Float32Array)M=o.FLOAT;else if(typeof Float16Array<"u"&&g instanceof Float16Array)M=o.HALF_FLOAT;else if(g instanceof Uint16Array)d.isFloat16BufferAttribute?M=o.HALF_FLOAT:M=o.UNSIGNED_SHORT;else if(g instanceof Int16Array)M=o.SHORT;else if(g instanceof Uint32Array)M=o.UNSIGNED_INT;else if(g instanceof Int32Array)M=o.INT;else if(g instanceof Int8Array)M=o.BYTE;else if(g instanceof Uint8Array)M=o.UNSIGNED_BYTE;else if(g instanceof Uint8ClampedArray)M=o.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+g);return{buffer:x,type:M,bytesPerElement:g.BYTES_PER_ELEMENT,version:d.version,size:S}}function i(d,m,g){const _=m.array,S=m.updateRanges;if(o.bindBuffer(g,d),S.length===0)o.bufferSubData(g,0,_);else{S.sort((M,T)=>M.start-T.start);let x=0;for(let M=1;M 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,tD=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,nD=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,iD=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,sD=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#endif`,aD=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#endif`,rD=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - varying vec4 vColor; -#endif`,oD=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - vColor = vec4( 1.0 ); -#endif -#ifdef USE_COLOR_ALPHA - vColor *= color; -#elif defined( USE_COLOR ) - vColor.rgb *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.rgb *= instanceColor.rgb; -#endif -#ifdef USE_BATCHING_COLOR - vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) ); -#endif`,lD=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 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 ); -} -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`,uD=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,cD=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,fD=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,hD=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,dD=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE - emissiveColor = sRGBTransferEOTF( emissiveColor ); - #endif - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,pD=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,mD="gl_FragColor = linearToOutputTexel( gl_FragColor );",gD=`vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferEOTF( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -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 ); -}`,vD=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif - #endif -#endif`,yD=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform mat3 envMapRotation; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif -#endif`,_D=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,xD=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,SD=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,bD=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,MD=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,ED=`#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`,TD=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,AD=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - 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 -}`,wD=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,CD=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,RD=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,DD=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,ND=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,LD=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,UD=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,ID=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,OD=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,PD=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -material.metalness = metalnessFactor; -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; - material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = vec3( 0.04 ); - material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_DISPERSION - material.dispersion = dispersion; -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - 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`,zD=`uniform sampler2D dfgLUT; -struct PhysicalMaterial { - vec3 diffuseColor; - vec3 diffuseContribution; - vec3 specularColor; - vec3 specularColorBlended; - float roughness; - float metalness; - float specularF90; - float dispersion; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - vec3 iridescenceFresnelDielectric; - vec3 iridescenceFresnelMetallic; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return v; - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColorBlended; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float rInv = 1.0 / ( roughness + 0.1 ); - float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; - float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; - float DG = exp( a * dotNV + b ); - return saturate( DG ); -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; - vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; - vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; - vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; - float Ess_V = dfgV.x + dfgV.y; - float Ess_L = dfgL.x + dfgL.y; - float Ems_V = 1.0 - Ess_V; - float Ems_L = 1.0 - Ess_L; - vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; - vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); - float compensationFactor = Ems_V * Ems_L; - vec3 multiScatter = Fms * compensationFactor; - return singleScatter + multiScatter; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - #ifdef USE_CLEARCOAT - vec3 Ncc = geometryClearcoatNormal; - vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness ); - vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat ); - vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat ); - mat3 mInvClearcoat = mat3( - vec3( t1Clearcoat.x, 0, t1Clearcoat.y ), - vec3( 0, 1, 0 ), - vec3( t1Clearcoat.z, 0, t1Clearcoat.w ) - ); - vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y; - clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords ); - #endif - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - - float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); - - float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); - - irradiance *= sheenEnergyComp; - - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); - #ifdef USE_SHEEN - float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; - diffuse *= sheenEnergyComp; - #endif - reflectedLight.indirectDiffuse += diffuse; -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; - #endif - vec3 singleScatteringDielectric = vec3( 0.0 ); - vec3 multiScatteringDielectric = vec3( 0.0 ); - vec3 singleScatteringMetallic = vec3( 0.0 ); - vec3 multiScatteringMetallic = vec3( 0.0 ); - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); - computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); - #endif - vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); - vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); - vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; - vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - vec3 indirectSpecular = radiance * singleScattering; - indirectSpecular += multiScattering * cosineWeightedIrradiance; - vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; - #ifdef USE_SHEEN - float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; - indirectSpecular *= sheenEnergyComp; - indirectDiffuse *= sheenEnergyComp; - #endif - reflectedLight.indirectSpecular += indirectSpecular; - reflectedLight.indirectDiffuse += indirectDiffuse; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#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 ); -}`,BD=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); - material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,FD=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV ) - #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,VD=`#if defined( RE_IndirectDiffuse ) - #if defined( LAMBERT ) || defined( PHONG ) - irradiance += iblIrradiance; - #endif - 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`,kD=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,HD=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,GD=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER - varying float vFragDepth; - varying float vIsPerspective; -#endif`,WD=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,XD=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,qD=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,YD=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,jD=`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,ZD=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,QD=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,JD=`#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`,KD=`#if defined( USE_MORPHCOLORS ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,$D=`#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`,eN=`#ifdef USE_MORPHTARGETS - #ifndef USE_INSTANCING_MORPH - uniform float morphTargetBaseInfluence; - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - #endif - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } -#endif`,tN=`#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`,nN=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,iN=`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,sN=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,aN=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,rN=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,oN=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,lN=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,uN=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,cN=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,fN=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,hN=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,dN=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; -const float Inv255 = 1. / 255.; -const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); -const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); -const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); -const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); -vec4 packDepthToRGBA( const in float v ) { - if( v <= 0.0 ) - return vec4( 0., 0., 0., 0. ); - if( v >= 1.0 ) - return vec4( 1., 1., 1., 1. ); - float vuf; - float af = modf( v * PackFactors.a, vuf ); - float bf = modf( vuf * ShiftRight8, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); -} -vec3 packDepthToRGB( const in float v ) { - if( v <= 0.0 ) - return vec3( 0., 0., 0. ); - if( v >= 1.0 ) - return vec3( 1., 1., 1. ); - float vuf; - float bf = modf( v * PackFactors.b, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec3( vuf * Inv255, gf * PackUpscale, bf ); -} -vec2 packDepthToRG( const in float v ) { - if( v <= 0.0 ) - return vec2( 0., 0. ); - if( v >= 1.0 ) - return vec2( 1., 1. ); - float vuf; - float gf = modf( v * 256., vuf ); - return vec2( vuf * Inv255, gf ); -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors4 ); -} -float unpackRGBToDepth( const in vec3 v ) { - return dot( v, UnpackFactors3 ); -} -float unpackRGToDepth( const in vec2 v ) { - return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; -} -vec4 pack2HalfToRGBA( const in vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( const in vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - #ifdef USE_REVERSED_DEPTH_BUFFER - - return depth * ( far - near ) - far; - #else - return depth * ( near - far ) - near; - #endif -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - - #ifdef USE_REVERSED_DEPTH_BUFFER - return ( near * far ) / ( ( near - far ) * depth - near ); - #else - return ( near * far ) / ( ( far - near ) * depth - far ); - #endif -}`,pN=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,mN=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,gN=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,vN=`#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`,yN=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,_N=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,xN=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - #if defined( SHADOWMAP_TYPE_PCF ) - uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - #else - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #if defined( SHADOWMAP_TYPE_PCF ) - uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - #else - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #if defined( SHADOWMAP_TYPE_PCF ) - uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - #elif defined( SHADOWMAP_TYPE_BASIC ) - uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - #if defined( SHADOWMAP_TYPE_PCF ) - float interleavedGradientNoise( vec2 position ) { - return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); - } - vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { - const float goldenAngle = 2.399963229728653; - float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); - float theta = float( sampleIndex ) * goldenAngle + phi; - return vec2( cos( theta ), sin( theta ) ) * r; - } - #endif - #if defined( SHADOWMAP_TYPE_PCF ) - float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float radius = shadowRadius * texelSize.x; - float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; - shadow = ( - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) - ) * 0.2; - } - return mix( 1.0, shadow, shadowIntensity ); - } - #elif defined( SHADOWMAP_TYPE_VSM ) - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - #ifdef USE_REVERSED_DEPTH_BUFFER - shadowCoord.z -= shadowBias; - #else - shadowCoord.z += shadowBias; - #endif - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; - float mean = distribution.x; - float variance = distribution.y * distribution.y; - #ifdef USE_REVERSED_DEPTH_BUFFER - float hard_shadow = step( mean, shadowCoord.z ); - #else - float hard_shadow = step( shadowCoord.z, mean ); - #endif - - if ( hard_shadow == 1.0 ) { - shadow = 1.0; - } else { - variance = max( variance, 0.0000001 ); - float d = shadowCoord.z - mean; - float p_max = variance / ( variance + d * d ); - p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); - shadow = max( hard_shadow, p_max ); - } - } - return mix( 1.0, shadow, shadowIntensity ); - } - #else - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - #ifdef USE_REVERSED_DEPTH_BUFFER - shadowCoord.z -= shadowBias; - #else - shadowCoord.z += shadowBias; - #endif - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - float depth = texture2D( shadowMap, shadowCoord.xy ).r; - #ifdef USE_REVERSED_DEPTH_BUFFER - shadow = step( depth, shadowCoord.z ); - #else - shadow = step( shadowCoord.z, depth ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #if defined( SHADOWMAP_TYPE_PCF ) - float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - vec3 bd3D = normalize( lightToPosition ); - vec3 absVec = abs( lightToPosition ); - float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); - if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { - #ifdef USE_REVERSED_DEPTH_BUFFER - float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); - dp -= shadowBias; - #else - float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); - dp += shadowBias; - #endif - float texelSize = shadowRadius / shadowMapSize.x; - vec3 absDir = abs( bd3D ); - vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); - tangent = normalize( cross( bd3D, tangent ) ); - vec3 bitangent = cross( bd3D, tangent ); - float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; - vec2 sample0 = vogelDiskSample( 0, 5, phi ); - vec2 sample1 = vogelDiskSample( 1, 5, phi ); - vec2 sample2 = vogelDiskSample( 2, 5, phi ); - vec2 sample3 = vogelDiskSample( 3, 5, phi ); - vec2 sample4 = vogelDiskSample( 4, 5, phi ); - shadow = ( - texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) + - texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) + - texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) + - texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) + - texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) ) - ) * 0.2; - } - return mix( 1.0, shadow, shadowIntensity ); - } - #elif defined( SHADOWMAP_TYPE_BASIC ) - float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - vec3 absVec = abs( lightToPosition ); - float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); - if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { - float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); - dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - float depth = textureCube( shadowMap, bd3D ).r; - #ifdef USE_REVERSED_DEPTH_BUFFER - depth = 1.0 - depth; - #endif - shadow = step( dp, depth ); - } - return mix( 1.0, shadow, shadowIntensity ); - } - #endif - #endif -#endif`,SN=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,bN=`#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 -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,MN=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,EN=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,TN=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,AN=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,wN=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,CN=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,RN=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,DN=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,NN=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 CineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 NeutralToneMapping( vec3 color ) { - const float StartCompression = 0.8 - 0.04; - const float Desaturation = 0.15; - color *= toneMappingExposure; - float x = min( color.r, min( color.g, color.b ) ); - float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; - color -= offset; - float peak = max( color.r, max( color.g, color.b ) ); - if ( peak < StartCompression ) return color; - float d = 1. - StartCompression; - float newPeak = 1. - d * d / ( peak + d - StartCompression ); - color *= newPeak / peak; - float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); - return mix( color, vec3( newPeak ), g ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,LN=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,UN=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec4 transmittedLight; - vec3 transmittance; - #ifdef USE_DISPERSION - float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; - vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); - for ( int i = 0; i < 3; i ++ ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); - transmittedLight[ i ] = transmissionSample[ i ]; - transmittedLight.a += transmissionSample.a; - transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; - } - transmittedLight.a /= 3.0; - #else - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - #endif - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,IN=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,ON=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,PN=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,zN=`#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; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const BN=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,FN=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,VN=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,kN=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -uniform mat3 backgroundRotation; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,HN=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,GN=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,WN=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,XN=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - #ifdef USE_REVERSED_DEPTH_BUFFER - float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; - #else - float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; - #endif - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #elif DEPTH_PACKING == 3202 - gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); - #elif DEPTH_PACKING == 3203 - gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); - #endif -}`,qN=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,YN=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); -}`,jN=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,ZN=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,QN=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,JN=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,KN=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,$N=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,eL=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,tL=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,nL=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,iL=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,sL=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,aL=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,rL=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,oL=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,lL=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,uL=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_DISPERSION - uniform float dispersion; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - - outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; - - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,cL=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,fL=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,hL=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,dL=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,pL=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,mL=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include - #include -}`,gL=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,vL=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,an={alphahash_fragment:FR,alphahash_pars_fragment:VR,alphamap_fragment:kR,alphamap_pars_fragment:HR,alphatest_fragment:GR,alphatest_pars_fragment:WR,aomap_fragment:XR,aomap_pars_fragment:qR,batching_pars_vertex:YR,batching_vertex:jR,begin_vertex:ZR,beginnormal_vertex:QR,bsdfs:JR,iridescence_fragment:KR,bumpmap_pars_fragment:$R,clipping_planes_fragment:eD,clipping_planes_pars_fragment:tD,clipping_planes_pars_vertex:nD,clipping_planes_vertex:iD,color_fragment:sD,color_pars_fragment:aD,color_pars_vertex:rD,color_vertex:oD,common:lD,cube_uv_reflection_fragment:uD,defaultnormal_vertex:cD,displacementmap_pars_vertex:fD,displacementmap_vertex:hD,emissivemap_fragment:dD,emissivemap_pars_fragment:pD,colorspace_fragment:mD,colorspace_pars_fragment:gD,envmap_fragment:vD,envmap_common_pars_fragment:yD,envmap_pars_fragment:_D,envmap_pars_vertex:xD,envmap_physical_pars_fragment:ND,envmap_vertex:SD,fog_vertex:bD,fog_pars_vertex:MD,fog_fragment:ED,fog_pars_fragment:TD,gradientmap_pars_fragment:AD,lightmap_pars_fragment:wD,lights_lambert_fragment:CD,lights_lambert_pars_fragment:RD,lights_pars_begin:DD,lights_toon_fragment:LD,lights_toon_pars_fragment:UD,lights_phong_fragment:ID,lights_phong_pars_fragment:OD,lights_physical_fragment:PD,lights_physical_pars_fragment:zD,lights_fragment_begin:BD,lights_fragment_maps:FD,lights_fragment_end:VD,logdepthbuf_fragment:kD,logdepthbuf_pars_fragment:HD,logdepthbuf_pars_vertex:GD,logdepthbuf_vertex:WD,map_fragment:XD,map_pars_fragment:qD,map_particle_fragment:YD,map_particle_pars_fragment:jD,metalnessmap_fragment:ZD,metalnessmap_pars_fragment:QD,morphinstance_vertex:JD,morphcolor_vertex:KD,morphnormal_vertex:$D,morphtarget_pars_vertex:eN,morphtarget_vertex:tN,normal_fragment_begin:nN,normal_fragment_maps:iN,normal_pars_fragment:sN,normal_pars_vertex:aN,normal_vertex:rN,normalmap_pars_fragment:oN,clearcoat_normal_fragment_begin:lN,clearcoat_normal_fragment_maps:uN,clearcoat_pars_fragment:cN,iridescence_pars_fragment:fN,opaque_fragment:hN,packing:dN,premultiplied_alpha_fragment:pN,project_vertex:mN,dithering_fragment:gN,dithering_pars_fragment:vN,roughnessmap_fragment:yN,roughnessmap_pars_fragment:_N,shadowmap_pars_fragment:xN,shadowmap_pars_vertex:SN,shadowmap_vertex:bN,shadowmask_pars_fragment:MN,skinbase_vertex:EN,skinning_pars_vertex:TN,skinning_vertex:AN,skinnormal_vertex:wN,specularmap_fragment:CN,specularmap_pars_fragment:RN,tonemapping_fragment:DN,tonemapping_pars_fragment:NN,transmission_fragment:LN,transmission_pars_fragment:UN,uv_pars_fragment:IN,uv_pars_vertex:ON,uv_vertex:PN,worldpos_vertex:zN,background_vert:BN,background_frag:FN,backgroundCube_vert:VN,backgroundCube_frag:kN,cube_vert:HN,cube_frag:GN,depth_vert:WN,depth_frag:XN,distance_vert:qN,distance_frag:YN,equirect_vert:jN,equirect_frag:ZN,linedashed_vert:QN,linedashed_frag:JN,meshbasic_vert:KN,meshbasic_frag:$N,meshlambert_vert:eL,meshlambert_frag:tL,meshmatcap_vert:nL,meshmatcap_frag:iL,meshnormal_vert:sL,meshnormal_frag:aL,meshphong_vert:rL,meshphong_frag:oL,meshphysical_vert:lL,meshphysical_frag:uL,meshtoon_vert:cL,meshtoon_frag:fL,points_vert:hL,points_frag:dL,shadow_vert:pL,shadow_frag:mL,sprite_vert:gL,sprite_frag:vL},lt={common:{diffuse:{value:new pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Kt},alphaMap:{value:null},alphaMapTransform:{value:new Kt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Kt}},envmap:{envMap:{value:null},envMapRotation:{value:new Kt},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 Kt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Kt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Kt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Kt},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Kt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Kt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Kt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Kt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new pt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},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 pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Kt},alphaTest:{value:0},uvTransform:{value:new Kt}},sprite:{diffuse:{value:new pt(16777215)},opacity:{value:1},center:{value:new ze(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Kt},alphaMap:{value:null},alphaMapTransform:{value:new Kt},alphaTest:{value:0}}},jr={basic:{uniforms:Zs([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.fog]),vertexShader:an.meshbasic_vert,fragmentShader:an.meshbasic_frag},lambert:{uniforms:Zs([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,lt.lights,{emissive:{value:new pt(0)},envMapIntensity:{value:1}}]),vertexShader:an.meshlambert_vert,fragmentShader:an.meshlambert_frag},phong:{uniforms:Zs([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,lt.lights,{emissive:{value:new pt(0)},specular:{value:new pt(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:an.meshphong_vert,fragmentShader:an.meshphong_frag},standard:{uniforms:Zs([lt.common,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.roughnessmap,lt.metalnessmap,lt.fog,lt.lights,{emissive:{value:new pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:an.meshphysical_vert,fragmentShader:an.meshphysical_frag},toon:{uniforms:Zs([lt.common,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.gradientmap,lt.fog,lt.lights,{emissive:{value:new pt(0)}}]),vertexShader:an.meshtoon_vert,fragmentShader:an.meshtoon_frag},matcap:{uniforms:Zs([lt.common,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,{matcap:{value:null}}]),vertexShader:an.meshmatcap_vert,fragmentShader:an.meshmatcap_frag},points:{uniforms:Zs([lt.points,lt.fog]),vertexShader:an.points_vert,fragmentShader:an.points_frag},dashed:{uniforms:Zs([lt.common,lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:an.linedashed_vert,fragmentShader:an.linedashed_frag},depth:{uniforms:Zs([lt.common,lt.displacementmap]),vertexShader:an.depth_vert,fragmentShader:an.depth_frag},normal:{uniforms:Zs([lt.common,lt.bumpmap,lt.normalmap,lt.displacementmap,{opacity:{value:1}}]),vertexShader:an.meshnormal_vert,fragmentShader:an.meshnormal_frag},sprite:{uniforms:Zs([lt.sprite,lt.fog]),vertexShader:an.sprite_vert,fragmentShader:an.sprite_frag},background:{uniforms:{uvTransform:{value:new Kt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:an.background_vert,fragmentShader:an.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Kt}},vertexShader:an.backgroundCube_vert,fragmentShader:an.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:an.cube_vert,fragmentShader:an.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:an.equirect_vert,fragmentShader:an.equirect_frag},distance:{uniforms:Zs([lt.common,lt.displacementmap,{referencePosition:{value:new Y},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:an.distance_vert,fragmentShader:an.distance_frag},shadow:{uniforms:Zs([lt.lights,lt.fog,{color:{value:new pt(0)},opacity:{value:1}}]),vertexShader:an.shadow_vert,fragmentShader:an.shadow_frag}};jr.physical={uniforms:Zs([jr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Kt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Kt},clearcoatNormalScale:{value:new ze(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Kt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Kt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Kt},sheen:{value:0},sheenColor:{value:new pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Kt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Kt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Kt},transmissionSamplerSize:{value:new ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Kt},attenuationDistance:{value:0},attenuationColor:{value:new pt(0)},specularColor:{value:new pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Kt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Kt},anisotropyVector:{value:new ze},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Kt}}]),vertexShader:an.meshphysical_vert,fragmentShader:an.meshphysical_frag};const iv={r:0,b:0,g:0},Bc=new Ga,yL=new kt;function _L(o,e,t,i,a,u){const f=new pt(0);let d=a===!0?0:1,m,g,_=null,S=0,x=null;function M(R){let L=R.isScene===!0?R.background:null;if(L&&L.isTexture){const I=R.backgroundBlurriness>0;L=e.get(L,I)}return L}function T(R){let L=!1;const I=M(R);I===null?w(f,d):I&&I.isColor&&(w(I,1),L=!0);const V=o.xr.getEnvironmentBlendMode();V==="additive"?t.buffers.color.setClear(0,0,0,1,u):V==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,u),(o.autoClear||L)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil))}function D(R,L){const I=M(L);I&&(I.isCubeTexture||I.mapping===Qh)?(g===void 0&&(g=new Gi(new nf(1,1,1),new yr({name:"BackgroundCubeMaterial",uniforms:jh(jr.backgroundCube.uniforms),vertexShader:jr.backgroundCube.vertexShader,fragmentShader:jr.backgroundCube.fragmentShader,side:ea,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),g.geometry.deleteAttribute("normal"),g.geometry.deleteAttribute("uv"),g.onBeforeRender=function(V,z,H){this.matrixWorld.copyPosition(H.matrixWorld)},Object.defineProperty(g.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(g)),Bc.copy(L.backgroundRotation),Bc.x*=-1,Bc.y*=-1,Bc.z*=-1,I.isCubeTexture&&I.isRenderTargetTexture===!1&&(Bc.y*=-1,Bc.z*=-1),g.material.uniforms.envMap.value=I,g.material.uniforms.flipEnvMap.value=I.isCubeTexture&&I.isRenderTargetTexture===!1?-1:1,g.material.uniforms.backgroundBlurriness.value=L.backgroundBlurriness,g.material.uniforms.backgroundIntensity.value=L.backgroundIntensity,g.material.uniforms.backgroundRotation.value.setFromMatrix4(yL.makeRotationFromEuler(Bc)),g.material.toneMapped=Sn.getTransfer(I.colorSpace)!==On,(_!==I||S!==I.version||x!==o.toneMapping)&&(g.material.needsUpdate=!0,_=I,S=I.version,x=o.toneMapping),g.layers.enableAll(),R.unshift(g,g.geometry,g.material,0,0,null)):I&&I.isTexture&&(m===void 0&&(m=new Gi(new $h(2,2),new yr({name:"BackgroundMaterial",uniforms:jh(jr.background.uniforms),vertexShader:jr.background.vertexShader,fragmentShader:jr.background.fragmentShader,side:wl,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(m)),m.material.uniforms.t2D.value=I,m.material.uniforms.backgroundIntensity.value=L.backgroundIntensity,m.material.toneMapped=Sn.getTransfer(I.colorSpace)!==On,I.matrixAutoUpdate===!0&&I.updateMatrix(),m.material.uniforms.uvTransform.value.copy(I.matrix),(_!==I||S!==I.version||x!==o.toneMapping)&&(m.material.needsUpdate=!0,_=I,S=I.version,x=o.toneMapping),m.layers.enableAll(),R.unshift(m,m.geometry,m.material,0,0,null))}function w(R,L){R.getRGB(iv,QE(o)),t.buffers.color.setClear(iv.r,iv.g,iv.b,L,u)}function A(){g!==void 0&&(g.geometry.dispose(),g.material.dispose(),g=void 0),m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0)}return{getClearColor:function(){return f},setClearColor:function(R,L=1){f.set(R),d=L,w(f,d)},getClearAlpha:function(){return d},setClearAlpha:function(R){d=R,w(f,d)},render:T,addToRenderList:D,dispose:A}}function xL(o,e){const t=o.getParameter(o.MAX_VERTEX_ATTRIBS),i={},a=x(null);let u=a,f=!1;function d(X,te,$,ue,se){let q=!1;const Z=S(X,ue,$,te);u!==Z&&(u=Z,g(u.object)),q=M(X,ue,$,se),q&&T(X,ue,$,se),se!==null&&e.update(se,o.ELEMENT_ARRAY_BUFFER),(q||f)&&(f=!1,I(X,te,$,ue),se!==null&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,e.get(se).buffer))}function m(){return o.createVertexArray()}function g(X){return o.bindVertexArray(X)}function _(X){return o.deleteVertexArray(X)}function S(X,te,$,ue){const se=ue.wireframe===!0;let q=i[te.id];q===void 0&&(q={},i[te.id]=q);const Z=X.isInstancedMesh===!0?X.id:0;let ye=q[Z];ye===void 0&&(ye={},q[Z]=ye);let _e=ye[$.id];_e===void 0&&(_e={},ye[$.id]=_e);let Ue=_e[se];return Ue===void 0&&(Ue=x(m()),_e[se]=Ue),Ue}function x(X){const te=[],$=[],ue=[];for(let se=0;se=0){const W=se[_e];let ee=q[_e];if(ee===void 0&&(_e==="instanceMatrix"&&X.instanceMatrix&&(ee=X.instanceMatrix),_e==="instanceColor"&&X.instanceColor&&(ee=X.instanceColor)),W===void 0||W.attribute!==ee||ee&&W.data!==ee.data)return!0;Z++}return u.attributesNum!==Z||u.index!==ue}function T(X,te,$,ue){const se={},q=te.attributes;let Z=0;const ye=$.getAttributes();for(const _e in ye)if(ye[_e].location>=0){let W=q[_e];W===void 0&&(_e==="instanceMatrix"&&X.instanceMatrix&&(W=X.instanceMatrix),_e==="instanceColor"&&X.instanceColor&&(W=X.instanceColor));const ee={};ee.attribute=W,W&&W.data&&(ee.data=W.data),se[_e]=ee,Z++}u.attributes=se,u.attributesNum=Z,u.index=ue}function D(){const X=u.newAttributes;for(let te=0,$=X.length;te<$;te++)X[te]=0}function w(X){A(X,0)}function A(X,te){const $=u.newAttributes,ue=u.enabledAttributes,se=u.attributeDivisors;$[X]=1,ue[X]===0&&(o.enableVertexAttribArray(X),ue[X]=1),se[X]!==te&&(o.vertexAttribDivisor(X,te),se[X]=te)}function R(){const X=u.newAttributes,te=u.enabledAttributes;for(let $=0,ue=te.length;$=0){let Ue=se[ye];if(Ue===void 0&&(ye==="instanceMatrix"&&X.instanceMatrix&&(Ue=X.instanceMatrix),ye==="instanceColor"&&X.instanceColor&&(Ue=X.instanceColor)),Ue!==void 0){const W=Ue.normalized,ee=Ue.itemSize,Ee=e.get(Ue);if(Ee===void 0)continue;const Oe=Ee.buffer,st=Ee.type,ce=Ee.bytesPerElement,Ce=st===o.INT||st===o.UNSIGNED_INT||Ue.gpuType===cy;if(Ue.isInterleavedBufferAttribute){const Be=Ue.data,et=Be.stride,yt=Ue.offset;if(Be.isInstancedInterleavedBuffer){for(let wt=0;wt<_e.locationSize;wt++)A(_e.location+wt,Be.meshPerAttribute);X.isInstancedMesh!==!0&&ue._maxInstanceCount===void 0&&(ue._maxInstanceCount=Be.meshPerAttribute*Be.count)}else for(let wt=0;wt<_e.locationSize;wt++)w(_e.location+wt);o.bindBuffer(o.ARRAY_BUFFER,Oe);for(let wt=0;wt<_e.locationSize;wt++)L(_e.location+wt,ee/_e.locationSize,st,W,et*ce,(yt+ee/_e.locationSize*wt)*ce,Ce)}else{if(Ue.isInstancedBufferAttribute){for(let Be=0;Be<_e.locationSize;Be++)A(_e.location+Be,Ue.meshPerAttribute);X.isInstancedMesh!==!0&&ue._maxInstanceCount===void 0&&(ue._maxInstanceCount=Ue.meshPerAttribute*Ue.count)}else for(let Be=0;Be<_e.locationSize;Be++)w(_e.location+Be);o.bindBuffer(o.ARRAY_BUFFER,Oe);for(let Be=0;Be<_e.locationSize;Be++)L(_e.location+Be,ee/_e.locationSize,st,W,ee*ce,ee/_e.locationSize*Be*ce,Ce)}}else if(Z!==void 0){const W=Z[ye];if(W!==void 0)switch(W.length){case 2:o.vertexAttrib2fv(_e.location,W);break;case 3:o.vertexAttrib3fv(_e.location,W);break;case 4:o.vertexAttrib4fv(_e.location,W);break;default:o.vertexAttrib1fv(_e.location,W)}}}}R()}function V(){P();for(const X in i){const te=i[X];for(const $ in te){const ue=te[$];for(const se in ue){const q=ue[se];for(const Z in q)_(q[Z].object),delete q[Z];delete ue[se]}}delete i[X]}}function z(X){if(i[X.id]===void 0)return;const te=i[X.id];for(const $ in te){const ue=te[$];for(const se in ue){const q=ue[se];for(const Z in q)_(q[Z].object),delete q[Z];delete ue[se]}}delete i[X.id]}function H(X){for(const te in i){const $=i[te];for(const ue in $){const se=$[ue];if(se[X.id]===void 0)continue;const q=se[X.id];for(const Z in q)_(q[Z].object),delete q[Z];delete se[X.id]}}}function U(X){for(const te in i){const $=i[te],ue=X.isInstancedMesh===!0?X.id:0,se=$[ue];if(se!==void 0){for(const q in se){const Z=se[q];for(const ye in Z)_(Z[ye].object),delete Z[ye];delete se[q]}delete $[ue],Object.keys($).length===0&&delete i[te]}}}function P(){Q(),f=!0,u!==a&&(u=a,g(u.object))}function Q(){a.geometry=null,a.program=null,a.wireframe=!1}return{setup:d,reset:P,resetDefaultState:Q,dispose:V,releaseStatesOfGeometry:z,releaseStatesOfObject:U,releaseStatesOfProgram:H,initAttributes:D,enableAttribute:w,disableUnusedAttributes:R}}function SL(o,e,t){let i;function a(g){i=g}function u(g,_){o.drawArrays(i,g,_),t.update(_,i,1)}function f(g,_,S){S!==0&&(o.drawArraysInstanced(i,g,_,S),t.update(_,i,S))}function d(g,_,S){if(S===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,g,0,_,0,S);let M=0;for(let T=0;T0&&o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision>0)return"highp";H="mediump"}return H==="mediump"&&o.getShaderPrecisionFormat(o.VERTEX_SHADER,o.MEDIUM_FLOAT).precision>0&&o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let g=t.precision!==void 0?t.precision:"highp";const _=m(g);_!==g&&(at("WebGLRenderer:",g,"not supported, using",_,"instead."),g=_);const S=t.logarithmicDepthBuffer===!0,x=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),M=o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS),T=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS),D=o.getParameter(o.MAX_TEXTURE_SIZE),w=o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE),A=o.getParameter(o.MAX_VERTEX_ATTRIBS),R=o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS),L=o.getParameter(o.MAX_VARYING_VECTORS),I=o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS),V=o.getParameter(o.MAX_SAMPLES),z=o.getParameter(o.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:u,getMaxPrecision:m,textureFormatReadable:f,textureTypeReadable:d,precision:g,logarithmicDepthBuffer:S,reversedDepthBuffer:x,maxTextures:M,maxVertexTextures:T,maxTextureSize:D,maxCubemapSize:w,maxAttributes:A,maxVertexUniforms:R,maxVaryings:L,maxFragmentUniforms:I,maxSamples:V,samples:z}}function ML(o){const e=this;let t=null,i=0,a=!1,u=!1;const f=new Au,d=new Kt,m={value:null,needsUpdate:!1};this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(S,x){const M=S.length!==0||x||i!==0||a;return a=x,i=S.length,M},this.beginShadows=function(){u=!0,_(null)},this.endShadows=function(){u=!1},this.setGlobalState=function(S,x){t=_(S,x,0)},this.setState=function(S,x,M){const T=S.clippingPlanes,D=S.clipIntersection,w=S.clipShadows,A=o.get(S);if(!a||T===null||T.length===0||u&&!w)u?_(null):g();else{const R=u?0:i,L=R*4;let I=A.clippingState||null;m.value=I,I=_(T,x,L,M);for(let V=0;V!==L;++V)I[V]=t[V];A.clippingState=I,this.numIntersection=D?this.numPlanes:0,this.numPlanes+=R}};function g(){m.value!==t&&(m.value=t,m.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function _(S,x,M,T){const D=S!==null?S.length:0;let w=null;if(D!==0){if(w=m.value,T!==!0||w===null){const A=M+D*4,R=x.matrixWorldInverse;d.getNormalMatrix(R),(w===null||w.length0&&this._blur(m,0,0,t),this._applyPMREM(m),this._cleanup(m),m}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=i1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=n1(),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?V:0,V,V),S.setRenderTarget(a),A&&S.render(D,m),S.render(e,m)}S.toneMapping=M,S.autoClear=x,e.background=R}_textureToCubeUV(e,t){const i=this._renderer,a=e.mapping===zo||e.mapping===Lu;a?(this._cubemapMaterial===null&&(this._cubemapMaterial=i1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=n1());const u=a?this._cubemapMaterial:this._equirectMaterial,f=this._lodMeshes[0];f.material=u;const d=u.uniforms;d.envMap.value=e;const m=this._cubeSize;Lh(t,0,0,3*m,2*m),i.setRenderTarget(t),i.render(f,kp)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const a=this._lodMeshes.length;for(let u=1;uT-Nu?i-T+Nu:0),A=4*(this._cubeSize-D);m.envMap.value=e.texture,m.roughness.value=M,m.mipInt.value=T-t,Lh(u,w,A,3*D,2*D),a.setRenderTarget(u),a.render(d,kp),m.envMap.value=u.texture,m.roughness.value=0,m.mipInt.value=T-i,Lh(e,w,A,3*D,2*D),a.setRenderTarget(e),a.render(d,kp)}_blur(e,t,i,a,u){const f=this._pingPongRenderTarget;this._halfBlur(e,f,t,i,a,"latitudinal",u),this._halfBlur(f,e,i,i,a,"longitudinal",u)}_halfBlur(e,t,i,a,u,f,d){const m=this._renderer,g=this._blurMaterial;f!=="latitudinal"&&f!=="longitudinal"&&Tt("blur direction must be either latitudinal or longitudinal!");const _=3,S=this._lodMeshes[a];S.material=g;const x=g.uniforms,M=this._sizeLods[i]-1,T=isFinite(u)?Math.PI/(2*M):2*Math.PI/(2*kc-1),D=u/T,w=isFinite(u)?1+Math.floor(_*D):kc;w>kc&&at(`sigmaRadians, ${u}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${kc}`);const A=[];let R=0;for(let H=0;HL-Nu?a-L+Nu:0),z=4*(this._cubeSize-I);Lh(t,V,z,3*I,2*I),m.setRenderTarget(t),m.render(S,kp)}}function AL(o){const e=[],t=[],i=[];let a=o;const u=o-Nu+1+$M.length;for(let f=0;fo-Nu?m=$M[f-o+Nu-1]:f===0&&(m=0),t.push(m);const g=1/(d-2),_=-g,S=1+g,x=[_,_,S,_,S,S,_,_,S,S,_,S],M=6,T=6,D=3,w=2,A=1,R=new Float32Array(D*T*M),L=new Float32Array(w*T*M),I=new Float32Array(A*T*M);for(let z=0;z2?0:-1,P=[H,U,0,H+2/3,U,0,H+2/3,U+1,0,H,U,0,H+2/3,U+1,0,H,U+1,0];R.set(P,D*T*z),L.set(x,w*T*z);const Q=[z,z,z,z,z,z];I.set(Q,A*T*z)}const V=new jt;V.setAttribute("position",new Gn(R,D)),V.setAttribute("uv",new Gn(L,w)),V.setAttribute("faceIndex",new Gn(I,A)),i.push(new Gi(V,null)),a>Nu&&a--}return{lodMeshes:i,sizeLods:e,sigmas:t}}function t1(o,e,t){const i=new Ha(o,e,t);return i.texture.mapping=Qh,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Lh(o,e,t,i,a){o.viewport.set(e,t,i,a),o.scissor.set(e,t,i,a)}function wL(o,e,t){return new yr({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:EL,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${o}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Hy(),fragmentShader:` - - precision highp float; - precision highp int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform float roughness; - uniform float mipInt; - - #define ENVMAP_TYPE_CUBE_UV - #include - - #define PI 3.14159265359 - - // Van der Corput radical inverse - float radicalInverse_VdC(uint bits) { - bits = (bits << 16u) | (bits >> 16u); - bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); - bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); - bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); - bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); - return float(bits) * 2.3283064365386963e-10; // / 0x100000000 - } - - // Hammersley sequence - vec2 hammersley(uint i, uint N) { - return vec2(float(i) / float(N), radicalInverse_VdC(i)); - } - - // GGX VNDF importance sampling (Eric Heitz 2018) - // "Sampling the GGX Distribution of Visible Normals" - // https://jcgt.org/published/0007/04/01/ - vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { - float alpha = roughness * roughness; - - // Section 4.1: Orthonormal basis - vec3 T1 = vec3(1.0, 0.0, 0.0); - vec3 T2 = cross(V, T1); - - // Section 4.2: Parameterization of projected area - float r = sqrt(Xi.x); - float phi = 2.0 * PI * Xi.y; - float t1 = r * cos(phi); - float t2 = r * sin(phi); - float s = 0.5 * (1.0 + V.z); - t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; - - // Section 4.3: Reprojection onto hemisphere - vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; - - // Section 3.4: Transform back to ellipsoid configuration - return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); - } - - void main() { - vec3 N = normalize(vOutputDirection); - vec3 V = N; // Assume view direction equals normal for pre-filtering - - vec3 prefilteredColor = vec3(0.0); - float totalWeight = 0.0; - - // For very low roughness, just sample the environment directly - if (roughness < 0.001) { - gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); - return; - } - - // Tangent space basis for VNDF sampling - vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangent = normalize(cross(up, N)); - vec3 bitangent = cross(N, tangent); - - for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { - vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); - - // For PMREM, V = N, so in tangent space V is always (0, 0, 1) - vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); - - // Transform H back to world space - vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); - vec3 L = normalize(2.0 * dot(V, H) * H - V); - - float NdotL = max(dot(N, L), 0.0); - - if(NdotL > 0.0) { - // Sample environment at fixed mip level - // VNDF importance sampling handles the distribution filtering - vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); - - // Weight by NdotL for the split-sum approximation - // VNDF PDF naturally accounts for the visible microfacet distribution - prefilteredColor += sampleColor * NdotL; - totalWeight += NdotL; - } - } - - if (totalWeight > 0.0) { - prefilteredColor = prefilteredColor / totalWeight; - } - - gl_FragColor = vec4(prefilteredColor, 1.0); - } - `,blending:Po,depthTest:!1,depthWrite:!1})}function CL(o,e,t){const i=new Float32Array(kc),a=new Y(0,1,0);return new yr({name:"SphericalGaussianBlur",defines:{n:kc,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${o}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:Hy(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:Po,depthTest:!1,depthWrite:!1})}function n1(){return new yr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Hy(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:Po,depthTest:!1,depthWrite:!1})}function i1(){return new yr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Hy(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:Po,depthTest:!1,depthWrite:!1})}function Hy(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}class jS extends Ha{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 Em(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; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},a=new nf(5,5,5),u=new yr({name:"CubemapFromEquirect",uniforms:jh(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:ea,blending:Po});u.uniforms.tEquirect.value=t;const f=new Gi(a,u),d=t.minFilter;return t.minFilter===Io&&(t.minFilter=si),new ST(1,10,this).update(e,f),t.minFilter=d,f.geometry.dispose(),f.material.dispose(),this}clear(e,t=!0,i=!0,a=!0){const u=e.getRenderTarget();for(let f=0;f<6;f++)e.setRenderTarget(this,f),e.clear(t,i,a);e.setRenderTarget(u)}}function RL(o){let e=new WeakMap,t=new WeakMap,i=null;function a(x,M=!1){return x==null?null:M?f(x):u(x)}function u(x){if(x&&x.isTexture){const M=x.mapping;if(M===Yp||M===jp)if(e.has(x)){const T=e.get(x).texture;return d(T,x.mapping)}else{const T=x.image;if(T&&T.height>0){const D=new jS(T.height);return D.fromEquirectangularTexture(o,x),e.set(x,D),x.addEventListener("dispose",g),d(D.texture,x.mapping)}else return null}}return x}function f(x){if(x&&x.isTexture){const M=x.mapping,T=M===Yp||M===jp,D=M===zo||M===Lu;if(T||D){let w=t.get(x);const A=w!==void 0?w.texture.pmremVersion:0;if(x.isRenderTargetTexture&&x.pmremVersion!==A)return i===null&&(i=new Yx(o)),w=T?i.fromEquirectangular(x,w):i.fromCubemap(x,w),w.texture.pmremVersion=x.pmremVersion,t.set(x,w),w.texture;if(w!==void 0)return w.texture;{const R=x.image;return T&&R&&R.height>0||D&&R&&m(R)?(i===null&&(i=new Yx(o)),w=T?i.fromEquirectangular(x):i.fromCubemap(x),w.texture.pmremVersion=x.pmremVersion,t.set(x,w),x.addEventListener("dispose",_),w.texture):null}}}return x}function d(x,M){return M===Yp?x.mapping=zo:M===jp&&(x.mapping=Lu),x}function m(x){let M=0;const T=6;for(let D=0;D=65535?bS:SS)(x,1);w.version=D;const A=u.get(S);A&&e.remove(A),u.set(S,w)}function _(S){const x=u.get(S);if(x){const M=S.index;M!==null&&x.versione.maxTextureSize&&(z=Math.ceil(V/e.maxTextureSize),V=e.maxTextureSize);const H=new Float32Array(V*z*4*S),U=new _y(H,V,z,S);U.type=$s,U.needsUpdate=!0;const P=I*4;for(let X=0;X - #include - - void main() { - gl_FragColor = texture2D( tDiffuse, vUv ); - - #ifdef LINEAR_TONE_MAPPING - gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); - #elif defined( REINHARD_TONE_MAPPING ) - gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); - #elif defined( CINEON_TONE_MAPPING ) - gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); - #elif defined( ACES_FILMIC_TONE_MAPPING ) - gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); - #elif defined( AGX_TONE_MAPPING ) - gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); - #elif defined( NEUTRAL_TONE_MAPPING ) - gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); - #elif defined( CUSTOM_TONE_MAPPING ) - gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); - #endif - - #ifdef SRGB_TRANSFER - gl_FragColor = sRGBTransferOETF( gl_FragColor ); - #endif - }`,depthTest:!1,depthWrite:!1}),g=new Gi(d,m),_=new td(-1,1,1,-1,0,1);let S=null,x=null,M=!1,T,D=null,w=[],A=!1;this.setSize=function(R,L){u.setSize(R,L),f.setSize(R,L);for(let I=0;I0&&w[0].isRenderPass===!0;const L=u.width,I=u.height;for(let V=0;V0)return o;const a=e*t;let u=s1[a];if(u===void 0&&(u=new Float32Array(a),s1[a]=u),e!==0){i.toArray(u,0);for(let f=1,d=0;f!==e;++f)d+=t,o[f].toArray(u,d)}return u}function Zi(o,e){if(o.length!==e.length)return!1;for(let t=0,i=o.length;t0&&(this.seq=a.concat(u))}setValue(e,t,i,a){const u=this.map[t];u!==void 0&&u.setValue(e,i,a)}setOptional(e,t,i){const a=t[i];a!==void 0&&this.setValue(e,i,a)}static upload(e,t,i,a){for(let u=0,f=t.length;u!==f;++u){const d=t[u],m=i[d.id];m.needsUpdate!==!1&&d.setValue(e,m.value,a)}}static seqWithValue(e,t){const i=[];for(let a=0,u=e.length;a!==u;++a){const f=e[a];f.id in t&&i.push(f)}return i}}function c1(o,e,t){const i=o.createShader(e);return o.shaderSource(i,t),o.compileShader(i),i}const CU=37297;let RU=0;function DU(o,e){const t=o.split(` -`),i=[],a=Math.max(e-6,0),u=Math.min(e+6,t.length);for(let f=a;f":" "} ${d}: ${t[f]}`)}return i.join(` -`)}const f1=new Kt;function NU(o){Sn._getMatrix(f1,Sn.workingColorSpace,o);const e=`mat3( ${f1.elements.map(t=>t.toFixed(4))} )`;switch(Sn.getTransfer(o)){case lm:return[e,"LinearTransferOETF"];case On:return[e,"sRGBTransferOETF"];default:return at("WebGLProgram: Unsupported color space: ",o),[e,"LinearTransferOETF"]}}function h1(o,e,t){const i=o.getShaderParameter(e,o.COMPILE_STATUS),u=(o.getShaderInfoLog(e)||"").trim();if(i&&u==="")return"";const f=/ERROR: 0:(\d+)/.exec(u);if(f){const d=parseInt(f[1]);return t.toUpperCase()+` - -`+u+` - -`+DU(o.getShaderSource(e),d)}else return u}function LU(o,e){const t=NU(e);return[`vec4 ${o}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` -`)}const UU={[sS]:"Linear",[aS]:"Reinhard",[rS]:"Cineon",[ly]:"ACESFilmic",[lS]:"AgX",[uS]:"Neutral",[oS]:"Custom"};function IU(o,e){const t=UU[e];return t===void 0?(at("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+o+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+o+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const sv=new Y;function OU(){Sn.getLuminanceCoefficients(sv);const o=sv.x.toFixed(4),e=sv.y.toFixed(4),t=sv.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${o}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` -`)}function PU(o){return[o.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",o.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Xp).join(` -`)}function zU(o){const e=[];for(const t in o){const i=o[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function BU(o,e){const t={},i=o.getProgramParameter(e,o.ACTIVE_ATTRIBUTES);for(let a=0;a/gm;function Zx(o){return o.replace(FU,kU)}const VU=new Map;function kU(o,e){let t=an[e];if(t===void 0){const i=VU.get(e);if(i!==void 0)t=an[i],at('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Zx(t)}const HU=/#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 m1(o){return o.replace(HU,GU)}function GU(o,e,t,i){let a="";for(let u=parseInt(e);u0&&(w+=` -`),A=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,T].filter(Xp).join(` -`),A.length>0&&(A+=` -`)):(w=[g1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,T,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 "+_:"",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 "+m:"",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(Xp).join(` -`),A=[g1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,T,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 "+g:"",t.envMap?"#define "+_:"",t.envMap?"#define "+S:"",x?"#define CUBEUV_TEXEL_WIDTH "+x.texelWidth:"",x?"#define CUBEUV_TEXEL_HEIGHT "+x.texelHeight:"",x?"#define CUBEUV_MAX_MIP "+x.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?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#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 "+m:"",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!==gr?"#define TONE_MAPPING":"",t.toneMapping!==gr?an.tonemapping_pars_fragment:"",t.toneMapping!==gr?IU("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",an.colorspace_pars_fragment,LU("linearToOutputTexel",t.outputColorSpace),OU(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(Xp).join(` -`)),f=Zx(f),f=d1(f,t),f=p1(f,t),d=Zx(d),d=d1(d,t),d=p1(d,t),f=m1(f),d=m1(d),t.isRawShaderMaterial!==!0&&(R=`#version 300 es -`,w=[M,"#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+w,A=["#define varying in",t.glslVersion===Fx?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Fx?"":"#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(` -`)+` -`+A);const L=R+w+f,I=R+A+d,V=c1(a,a.VERTEX_SHADER,L),z=c1(a,a.FRAGMENT_SHADER,I);a.attachShader(D,V),a.attachShader(D,z),t.index0AttributeName!==void 0?a.bindAttribLocation(D,0,t.index0AttributeName):t.morphTargets===!0&&a.bindAttribLocation(D,0,"position"),a.linkProgram(D);function H(X){if(o.debug.checkShaderErrors){const te=a.getProgramInfoLog(D)||"",$=a.getShaderInfoLog(V)||"",ue=a.getShaderInfoLog(z)||"",se=te.trim(),q=$.trim(),Z=ue.trim();let ye=!0,_e=!0;if(a.getProgramParameter(D,a.LINK_STATUS)===!1)if(ye=!1,typeof o.debug.onShaderError=="function")o.debug.onShaderError(a,D,V,z);else{const Ue=h1(a,V,"vertex"),W=h1(a,z,"fragment");Tt("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(D,a.VALIDATE_STATUS)+` - -Material Name: `+X.name+` -Material Type: `+X.type+` - -Program Info Log: `+se+` -`+Ue+` -`+W)}else se!==""?at("WebGLProgram: Program Info Log:",se):(q===""||Z==="")&&(_e=!1);_e&&(X.diagnostics={runnable:ye,programLog:se,vertexShader:{log:q,prefix:w},fragmentShader:{log:Z,prefix:A}})}a.deleteShader(V),a.deleteShader(z),U=new uv(a,D),P=BU(a,D)}let U;this.getUniforms=function(){return U===void 0&&H(this),U};let P;this.getAttributes=function(){return P===void 0&&H(this),P};let Q=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return Q===!1&&(Q=a.getProgramParameter(D,CU)),Q},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(D),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=RU++,this.cacheKey=e,this.usedTimes=1,this.program=D,this.vertexShader=V,this.fragmentShader=z,this}let eI=0;class tI{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(t),u=this._getShaderStage(i),f=this._getShaderCacheForMaterial(e);return f.has(a)===!1&&(f.add(a),a.usedTimes++),f.has(u)===!1&&(f.add(u),u.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 nI(e),t.set(e,i)),i}}class nI{constructor(e){this.id=eI++,this.code=e,this.usedTimes=0}}function iI(o,e,t,i,a,u){const f=new Wh,d=new tI,m=new Set,g=[],_=new Map,S=i.logarithmicDepthBuffer;let x=i.precision;const M={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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(U){return m.add(U),U===0?"uv":`uv${U}`}function D(U,P,Q,X,te){const $=X.fog,ue=te.geometry,se=U.isMeshStandardMaterial||U.isMeshLambertMaterial||U.isMeshPhongMaterial?X.environment:null,q=U.isMeshStandardMaterial||U.isMeshLambertMaterial&&!U.envMap||U.isMeshPhongMaterial&&!U.envMap,Z=e.get(U.envMap||se,q),ye=Z&&Z.mapping===Qh?Z.image.height:null,_e=M[U.type];U.precision!==null&&(x=i.getMaxPrecision(U.precision),x!==U.precision&&at("WebGLProgram.getParameters:",U.precision,"not supported, using",x,"instead."));const Ue=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,W=Ue!==void 0?Ue.length:0;let ee=0;ue.morphAttributes.position!==void 0&&(ee=1),ue.morphAttributes.normal!==void 0&&(ee=2),ue.morphAttributes.color!==void 0&&(ee=3);let Ee,Oe,st,ce;if(_e){const vn=jr[_e];Ee=vn.vertexShader,Oe=vn.fragmentShader}else Ee=U.vertexShader,Oe=U.fragmentShader,d.update(U),st=d.getVertexShaderID(U),ce=d.getFragmentShaderID(U);const Ce=o.getRenderTarget(),Be=o.state.buffers.depth.getReversed(),et=te.isInstancedMesh===!0,yt=te.isBatchedMesh===!0,wt=!!U.map,ln=!!U.matcap,Dt=!!Z,Re=!!U.aoMap,Ve=!!U.lightMap,Ne=!!U.bumpMap,Je=!!U.normalMap,j=!!U.displacementMap,xt=!!U.emissiveMap,nt=!!U.metalnessMap,Mt=!!U.roughnessMap,Xe=U.anisotropy>0,G=U.clearcoat>0,O=U.dispersion>0,re=U.iridescence>0,be=U.sheen>0,Le=U.transmission>0,Te=Xe&&!!U.anisotropyMap,rt=G&&!!U.clearcoatMap,qe=G&&!!U.clearcoatNormalMap,St=G&&!!U.clearcoatRoughnessMap,At=re&&!!U.iridescenceMap,Fe=re&&!!U.iridescenceThicknessMap,ke=be&&!!U.sheenColorMap,ft=be&&!!U.sheenRoughnessMap,ot=!!U.specularMap,ct=!!U.specularColorMap,Zt=!!U.specularIntensityMap,ae=Le&&!!U.transmissionMap,Ze=Le&&!!U.thicknessMap,We=!!U.gradientMap,ut=!!U.alphaMap,He=U.alphaTest>0,Ae=!!U.alphaHash,dt=!!U.extensions;let zt=gr;U.toneMapped&&(Ce===null||Ce.isXRRenderTarget===!0)&&(zt=o.toneMapping);const pn={shaderID:_e,shaderType:U.type,shaderName:U.name,vertexShader:Ee,fragmentShader:Oe,defines:U.defines,customVertexShaderID:st,customFragmentShaderID:ce,isRawShaderMaterial:U.isRawShaderMaterial===!0,glslVersion:U.glslVersion,precision:x,batching:yt,batchingColor:yt&&te._colorsTexture!==null,instancing:et,instancingColor:et&&te.instanceColor!==null,instancingMorph:et&&te.morphTexture!==null,outputColorSpace:Ce===null?o.outputColorSpace:Ce.isXRRenderTarget===!0?Ce.texture.colorSpace:Uu,alphaToCoverage:!!U.alphaToCoverage,map:wt,matcap:ln,envMap:Dt,envMapMode:Dt&&Z.mapping,envMapCubeUVHeight:ye,aoMap:Re,lightMap:Ve,bumpMap:Ne,normalMap:Je,displacementMap:j,emissiveMap:xt,normalMapObjectSpace:Je&&U.normalMapType===gE,normalMapTangentSpace:Je&&U.normalMapType===Pu,metalnessMap:nt,roughnessMap:Mt,anisotropy:Xe,anisotropyMap:Te,clearcoat:G,clearcoatMap:rt,clearcoatNormalMap:qe,clearcoatRoughnessMap:St,dispersion:O,iridescence:re,iridescenceMap:At,iridescenceThicknessMap:Fe,sheen:be,sheenColorMap:ke,sheenRoughnessMap:ft,specularMap:ot,specularColorMap:ct,specularIntensityMap:Zt,transmission:Le,transmissionMap:ae,thicknessMap:Ze,gradientMap:We,opaque:U.transparent===!1&&U.blending===Yc&&U.alphaToCoverage===!1,alphaMap:ut,alphaTest:He,alphaHash:Ae,combine:U.combine,mapUv:wt&&T(U.map.channel),aoMapUv:Re&&T(U.aoMap.channel),lightMapUv:Ve&&T(U.lightMap.channel),bumpMapUv:Ne&&T(U.bumpMap.channel),normalMapUv:Je&&T(U.normalMap.channel),displacementMapUv:j&&T(U.displacementMap.channel),emissiveMapUv:xt&&T(U.emissiveMap.channel),metalnessMapUv:nt&&T(U.metalnessMap.channel),roughnessMapUv:Mt&&T(U.roughnessMap.channel),anisotropyMapUv:Te&&T(U.anisotropyMap.channel),clearcoatMapUv:rt&&T(U.clearcoatMap.channel),clearcoatNormalMapUv:qe&&T(U.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:St&&T(U.clearcoatRoughnessMap.channel),iridescenceMapUv:At&&T(U.iridescenceMap.channel),iridescenceThicknessMapUv:Fe&&T(U.iridescenceThicknessMap.channel),sheenColorMapUv:ke&&T(U.sheenColorMap.channel),sheenRoughnessMapUv:ft&&T(U.sheenRoughnessMap.channel),specularMapUv:ot&&T(U.specularMap.channel),specularColorMapUv:ct&&T(U.specularColorMap.channel),specularIntensityMapUv:Zt&&T(U.specularIntensityMap.channel),transmissionMapUv:ae&&T(U.transmissionMap.channel),thicknessMapUv:Ze&&T(U.thicknessMap.channel),alphaMapUv:ut&&T(U.alphaMap.channel),vertexTangents:!!ue.attributes.tangent&&(Je||Xe),vertexColors:U.vertexColors,vertexAlphas:U.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,pointsUvs:te.isPoints===!0&&!!ue.attributes.uv&&(wt||ut),fog:!!$,useFog:U.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:U.wireframe===!1&&(U.flatShading===!0||ue.attributes.normal===void 0&&Je===!1&&(U.isMeshLambertMaterial||U.isMeshPhongMaterial||U.isMeshStandardMaterial||U.isMeshPhysicalMaterial)),sizeAttenuation:U.sizeAttenuation===!0,logarithmicDepthBuffer:S,reversedDepthBuffer:Be,skinning:te.isSkinnedMesh===!0,morphTargets:ue.morphAttributes.position!==void 0,morphNormals:ue.morphAttributes.normal!==void 0,morphColors:ue.morphAttributes.color!==void 0,morphTargetsCount:W,morphTextureStride:ee,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:u.numPlanes,numClipIntersection:u.numIntersection,dithering:U.dithering,shadowMapEnabled:o.shadowMap.enabled&&Q.length>0,shadowMapType:o.shadowMap.type,toneMapping:zt,decodeVideoTexture:wt&&U.map.isVideoTexture===!0&&Sn.getTransfer(U.map.colorSpace)===On,decodeVideoTextureEmissive:xt&&U.emissiveMap.isVideoTexture===!0&&Sn.getTransfer(U.emissiveMap.colorSpace)===On,premultipliedAlpha:U.premultipliedAlpha,doubleSided:U.side===Uo,flipSided:U.side===ea,useDepthPacking:U.depthPacking>=0,depthPacking:U.depthPacking||0,index0AttributeName:U.index0AttributeName,extensionClipCullDistance:dt&&U.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(dt&&U.extensions.multiDraw===!0||yt)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:U.customProgramCacheKey()};return pn.vertexUv1s=m.has(1),pn.vertexUv2s=m.has(2),pn.vertexUv3s=m.has(3),m.clear(),pn}function w(U){const P=[];if(U.shaderID?P.push(U.shaderID):(P.push(U.customVertexShaderID),P.push(U.customFragmentShaderID)),U.defines!==void 0)for(const Q in U.defines)P.push(Q),P.push(U.defines[Q]);return U.isRawShaderMaterial===!1&&(A(P,U),R(P,U),P.push(o.outputColorSpace)),P.push(U.customProgramCacheKey),P.join()}function A(U,P){U.push(P.precision),U.push(P.outputColorSpace),U.push(P.envMapMode),U.push(P.envMapCubeUVHeight),U.push(P.mapUv),U.push(P.alphaMapUv),U.push(P.lightMapUv),U.push(P.aoMapUv),U.push(P.bumpMapUv),U.push(P.normalMapUv),U.push(P.displacementMapUv),U.push(P.emissiveMapUv),U.push(P.metalnessMapUv),U.push(P.roughnessMapUv),U.push(P.anisotropyMapUv),U.push(P.clearcoatMapUv),U.push(P.clearcoatNormalMapUv),U.push(P.clearcoatRoughnessMapUv),U.push(P.iridescenceMapUv),U.push(P.iridescenceThicknessMapUv),U.push(P.sheenColorMapUv),U.push(P.sheenRoughnessMapUv),U.push(P.specularMapUv),U.push(P.specularColorMapUv),U.push(P.specularIntensityMapUv),U.push(P.transmissionMapUv),U.push(P.thicknessMapUv),U.push(P.combine),U.push(P.fogExp2),U.push(P.sizeAttenuation),U.push(P.morphTargetsCount),U.push(P.morphAttributeCount),U.push(P.numDirLights),U.push(P.numPointLights),U.push(P.numSpotLights),U.push(P.numSpotLightMaps),U.push(P.numHemiLights),U.push(P.numRectAreaLights),U.push(P.numDirLightShadows),U.push(P.numPointLightShadows),U.push(P.numSpotLightShadows),U.push(P.numSpotLightShadowsWithMaps),U.push(P.numLightProbes),U.push(P.shadowMapType),U.push(P.toneMapping),U.push(P.numClippingPlanes),U.push(P.numClipIntersection),U.push(P.depthPacking)}function R(U,P){f.disableAll(),P.instancing&&f.enable(0),P.instancingColor&&f.enable(1),P.instancingMorph&&f.enable(2),P.matcap&&f.enable(3),P.envMap&&f.enable(4),P.normalMapObjectSpace&&f.enable(5),P.normalMapTangentSpace&&f.enable(6),P.clearcoat&&f.enable(7),P.iridescence&&f.enable(8),P.alphaTest&&f.enable(9),P.vertexColors&&f.enable(10),P.vertexAlphas&&f.enable(11),P.vertexUv1s&&f.enable(12),P.vertexUv2s&&f.enable(13),P.vertexUv3s&&f.enable(14),P.vertexTangents&&f.enable(15),P.anisotropy&&f.enable(16),P.alphaHash&&f.enable(17),P.batching&&f.enable(18),P.dispersion&&f.enable(19),P.batchingColor&&f.enable(20),P.gradientMap&&f.enable(21),U.push(f.mask),f.disableAll(),P.fog&&f.enable(0),P.useFog&&f.enable(1),P.flatShading&&f.enable(2),P.logarithmicDepthBuffer&&f.enable(3),P.reversedDepthBuffer&&f.enable(4),P.skinning&&f.enable(5),P.morphTargets&&f.enable(6),P.morphNormals&&f.enable(7),P.morphColors&&f.enable(8),P.premultipliedAlpha&&f.enable(9),P.shadowMapEnabled&&f.enable(10),P.doubleSided&&f.enable(11),P.flipSided&&f.enable(12),P.useDepthPacking&&f.enable(13),P.dithering&&f.enable(14),P.transmission&&f.enable(15),P.sheen&&f.enable(16),P.opaque&&f.enable(17),P.pointsUvs&&f.enable(18),P.decodeVideoTexture&&f.enable(19),P.decodeVideoTextureEmissive&&f.enable(20),P.alphaToCoverage&&f.enable(21),U.push(f.mask)}function L(U){const P=M[U.type];let Q;if(P){const X=jr[P];Q=JE.clone(X.uniforms)}else Q=U.uniforms;return Q}function I(U,P){let Q=_.get(P);return Q!==void 0?++Q.usedTimes:(Q=new $U(o,P,U,a),g.push(Q),_.set(P,Q)),Q}function V(U){if(--U.usedTimes===0){const P=g.indexOf(U);g[P]=g[g.length-1],g.pop(),_.delete(U.cacheKey),U.destroy()}}function z(U){d.remove(U)}function H(){d.dispose()}return{getParameters:D,getProgramCacheKey:w,getUniforms:L,acquireProgram:I,releaseProgram:V,releaseShaderCache:z,programs:g,dispose:H}}function sI(){let o=new WeakMap;function e(f){return o.has(f)}function t(f){let d=o.get(f);return d===void 0&&(d={},o.set(f,d)),d}function i(f){o.delete(f)}function a(f,d,m){o.get(f)[d]=m}function u(){o=new WeakMap}return{has:e,get:t,remove:i,update:a,dispose:u}}function aI(o,e){return o.groupOrder!==e.groupOrder?o.groupOrder-e.groupOrder:o.renderOrder!==e.renderOrder?o.renderOrder-e.renderOrder:o.material.id!==e.material.id?o.material.id-e.material.id:o.materialVariant!==e.materialVariant?o.materialVariant-e.materialVariant:o.z!==e.z?o.z-e.z:o.id-e.id}function v1(o,e){return o.groupOrder!==e.groupOrder?o.groupOrder-e.groupOrder:o.renderOrder!==e.renderOrder?o.renderOrder-e.renderOrder:o.z!==e.z?e.z-o.z:o.id-e.id}function y1(){const o=[];let e=0;const t=[],i=[],a=[];function u(){e=0,t.length=0,i.length=0,a.length=0}function f(x){let M=0;return x.isInstancedMesh&&(M+=2),x.isSkinnedMesh&&(M+=1),M}function d(x,M,T,D,w,A){let R=o[e];return R===void 0?(R={id:x.id,object:x,geometry:M,material:T,materialVariant:f(x),groupOrder:D,renderOrder:x.renderOrder,z:w,group:A},o[e]=R):(R.id=x.id,R.object=x,R.geometry=M,R.material=T,R.materialVariant=f(x),R.groupOrder=D,R.renderOrder=x.renderOrder,R.z=w,R.group=A),e++,R}function m(x,M,T,D,w,A){const R=d(x,M,T,D,w,A);T.transmission>0?i.push(R):T.transparent===!0?a.push(R):t.push(R)}function g(x,M,T,D,w,A){const R=d(x,M,T,D,w,A);T.transmission>0?i.unshift(R):T.transparent===!0?a.unshift(R):t.unshift(R)}function _(x,M){t.length>1&&t.sort(x||aI),i.length>1&&i.sort(M||v1),a.length>1&&a.sort(M||v1)}function S(){for(let x=e,M=o.length;x=u.length?(f=new y1,u.push(f)):f=u[a],f}function t(){o=new WeakMap}return{get:e,dispose:t}}function oI(){const o={};return{get:function(e){if(o[e.id]!==void 0)return o[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Y,color:new pt};break;case"SpotLight":t={position:new Y,direction:new Y,color:new pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Y,color:new pt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Y,skyColor:new pt,groundColor:new pt};break;case"RectAreaLight":t={color:new pt,position:new Y,halfWidth:new Y,halfHeight:new Y};break}return o[e.id]=t,t}}}function lI(){const o={};return{get:function(e){if(o[e.id]!==void 0)return o[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze,shadowCameraNear:1,shadowCameraFar:1e3};break}return o[e.id]=t,t}}}let uI=0;function cI(o,e){return(e.castShadow?2:0)-(o.castShadow?2:0)+(e.map?1:0)-(o.map?1:0)}function fI(o){const e=new oI,t=lI(),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 g=0;g<9;g++)i.probe.push(new Y);const a=new Y,u=new kt,f=new kt;function d(g){let _=0,S=0,x=0;for(let P=0;P<9;P++)i.probe[P].set(0,0,0);let M=0,T=0,D=0,w=0,A=0,R=0,L=0,I=0,V=0,z=0,H=0;g.sort(cI);for(let P=0,Q=g.length;P0&&(o.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=lt.LTC_FLOAT_1,i.rectAreaLTC2=lt.LTC_FLOAT_2):(i.rectAreaLTC1=lt.LTC_HALF_1,i.rectAreaLTC2=lt.LTC_HALF_2)),i.ambient[0]=_,i.ambient[1]=S,i.ambient[2]=x;const U=i.hash;(U.directionalLength!==M||U.pointLength!==T||U.spotLength!==D||U.rectAreaLength!==w||U.hemiLength!==A||U.numDirectionalShadows!==R||U.numPointShadows!==L||U.numSpotShadows!==I||U.numSpotMaps!==V||U.numLightProbes!==H)&&(i.directional.length=M,i.spot.length=D,i.rectArea.length=w,i.point.length=T,i.hemi.length=A,i.directionalShadow.length=R,i.directionalShadowMap.length=R,i.pointShadow.length=L,i.pointShadowMap.length=L,i.spotShadow.length=I,i.spotShadowMap.length=I,i.directionalShadowMatrix.length=R,i.pointShadowMatrix.length=L,i.spotLightMatrix.length=I+V-z,i.spotLightMap.length=V,i.numSpotLightShadowsWithMaps=z,i.numLightProbes=H,U.directionalLength=M,U.pointLength=T,U.spotLength=D,U.rectAreaLength=w,U.hemiLength=A,U.numDirectionalShadows=R,U.numPointShadows=L,U.numSpotShadows=I,U.numSpotMaps=V,U.numLightProbes=H,i.version=uI++)}function m(g,_){let S=0,x=0,M=0,T=0,D=0;const w=_.matrixWorldInverse;for(let A=0,R=g.length;A=f.length?(d=new _1(o),f.push(d)):d=f[u],d}function i(){e=new WeakMap}return{get:t,dispose:i}}const dI=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,pI=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); - gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); -}`,mI=[new Y(1,0,0),new Y(-1,0,0),new Y(0,1,0),new Y(0,-1,0),new Y(0,0,1),new Y(0,0,-1)],gI=[new Y(0,-1,0),new Y(0,-1,0),new Y(0,0,1),new Y(0,0,-1),new Y(0,-1,0),new Y(0,-1,0)],x1=new kt,Hp=new Y,xx=new Y;function vI(o,e,t){let i=new Kh;const a=new ze,u=new ze,f=new Xn,d=new OS,m=new PS,g={},_=t.maxTextureSize,S={[wl]:ea,[ea]:wl,[Uo]:Uo},x=new yr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:dI,fragmentShader:pI}),M=x.clone();M.defines.HORIZONTAL_PASS=1;const T=new jt;T.setAttribute("position",new Gn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const D=new Gi(T,x),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Fh;let A=this.type;this.render=function(z,H,U){if(w.enabled===!1||w.autoUpdate===!1&&w.needsUpdate===!1||z.length===0)return;this.type===qp&&(at("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Fh);const P=o.getRenderTarget(),Q=o.getActiveCubeFace(),X=o.getActiveMipmapLevel(),te=o.state;te.setBlending(Po),te.buffers.depth.getReversed()===!0?te.buffers.color.setClear(0,0,0,0):te.buffers.color.setClear(1,1,1,1),te.buffers.depth.setTest(!0),te.setScissorTest(!1);const $=A!==this.type;$&&H.traverse(function(ue){ue.material&&(Array.isArray(ue.material)?ue.material.forEach(se=>se.needsUpdate=!0):ue.material.needsUpdate=!0)});for(let ue=0,se=z.length;ue_||a.y>_)&&(a.x>_&&(u.x=Math.floor(_/ye.x),a.x=u.x*ye.x,Z.mapSize.x=u.x),a.y>_&&(u.y=Math.floor(_/ye.y),a.y=u.y*ye.y,Z.mapSize.y=u.y));const _e=o.state.buffers.depth.getReversed();if(Z.camera._reversedDepth=_e,Z.map===null||$===!0){if(Z.map!==null&&(Z.map.depthTexture!==null&&(Z.map.depthTexture.dispose(),Z.map.depthTexture=null),Z.map.dispose()),this.type===Hc){if(q.isPointLight){at("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}Z.map=new Ha(a.x,a.y,{format:Jc,type:Bo,minFilter:si,magFilter:si,generateMipmaps:!1}),Z.map.texture.name=q.name+".shadowMap",Z.map.depthTexture=new qh(a.x,a.y,$s),Z.map.depthTexture.name=q.name+".shadowMapDepth",Z.map.depthTexture.format=Fo,Z.map.depthTexture.compareFunction=null,Z.map.depthTexture.minFilter=Ti,Z.map.depthTexture.magFilter=Ti}else q.isPointLight?(Z.map=new jS(a.x),Z.map.depthTexture=new zE(a.x,vr)):(Z.map=new Ha(a.x,a.y),Z.map.depthTexture=new qh(a.x,a.y,vr)),Z.map.depthTexture.name=q.name+".shadowMap",Z.map.depthTexture.format=Fo,this.type===Fh?(Z.map.depthTexture.compareFunction=_e?yy:vy,Z.map.depthTexture.minFilter=si,Z.map.depthTexture.magFilter=si):(Z.map.depthTexture.compareFunction=null,Z.map.depthTexture.minFilter=Ti,Z.map.depthTexture.magFilter=Ti);Z.camera.updateProjectionMatrix()}const Ue=Z.map.isWebGLCubeRenderTarget?6:1;for(let W=0;W0||H.map&&H.alphaTest>0||H.alphaToCoverage===!0){const te=Q.uuid,$=H.uuid;let ue=g[te];ue===void 0&&(ue={},g[te]=ue);let se=ue[$];se===void 0&&(se=Q.clone(),ue[$]=se,H.addEventListener("dispose",V)),Q=se}if(Q.visible=H.visible,Q.wireframe=H.wireframe,P===Hc?Q.side=H.shadowSide!==null?H.shadowSide:H.side:Q.side=H.shadowSide!==null?H.shadowSide:S[H.side],Q.alphaMap=H.alphaMap,Q.alphaTest=H.alphaToCoverage===!0?.5:H.alphaTest,Q.map=H.map,Q.clipShadows=H.clipShadows,Q.clippingPlanes=H.clippingPlanes,Q.clipIntersection=H.clipIntersection,Q.displacementMap=H.displacementMap,Q.displacementScale=H.displacementScale,Q.displacementBias=H.displacementBias,Q.wireframeLinewidth=H.wireframeLinewidth,Q.linewidth=H.linewidth,U.isPointLight===!0&&Q.isMeshDistanceMaterial===!0){const te=o.properties.get(Q);te.light=U}return Q}function I(z,H,U,P,Q){if(z.visible===!1)return;if(z.layers.test(H.layers)&&(z.isMesh||z.isLine||z.isPoints)&&(z.castShadow||z.receiveShadow&&Q===Hc)&&(!z.frustumCulled||i.intersectsObject(z))){z.modelViewMatrix.multiplyMatrices(U.matrixWorldInverse,z.matrixWorld);const $=e.update(z),ue=z.material;if(Array.isArray(ue)){const se=$.groups;for(let q=0,Z=se.length;q=1):ye.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(ye)[1]),q=Z>=2);let _e=null,Ue={};const W=o.getParameter(o.SCISSOR_BOX),ee=o.getParameter(o.VIEWPORT),Ee=new Xn().fromArray(W),Oe=new Xn().fromArray(ee);function st(ae,Ze,We,ut){const He=new Uint8Array(4),Ae=o.createTexture();o.bindTexture(ae,Ae),o.texParameteri(ae,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(ae,o.TEXTURE_MAG_FILTER,o.NEAREST);for(let dt=0;dt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),g=new ze,_=new WeakMap;let S;const x=new WeakMap;let M=!1;try{M=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function T(G,O){return M?new OffscreenCanvas(G,O):cm("canvas")}function D(G,O,re){let be=1;const Le=Xe(G);if((Le.width>re||Le.height>re)&&(be=re/Math.max(Le.width,Le.height)),be<1)if(typeof HTMLImageElement<"u"&&G instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&G instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&G instanceof ImageBitmap||typeof VideoFrame<"u"&&G instanceof VideoFrame){const Te=Math.floor(be*Le.width),rt=Math.floor(be*Le.height);S===void 0&&(S=T(Te,rt));const qe=O?T(Te,rt):S;return qe.width=Te,qe.height=rt,qe.getContext("2d").drawImage(G,0,0,Te,rt),at("WebGLRenderer: Texture has been resized from ("+Le.width+"x"+Le.height+") to ("+Te+"x"+rt+")."),qe}else return"data"in G&&at("WebGLRenderer: Image in DataTexture is too big ("+Le.width+"x"+Le.height+")."),G;return G}function w(G){return G.generateMipmaps}function A(G){o.generateMipmap(G)}function R(G){return G.isWebGLCubeRenderTarget?o.TEXTURE_CUBE_MAP:G.isWebGL3DRenderTarget?o.TEXTURE_3D:G.isWebGLArrayRenderTarget||G.isCompressedArrayTexture?o.TEXTURE_2D_ARRAY:o.TEXTURE_2D}function L(G,O,re,be,Le=!1){if(G!==null){if(o[G]!==void 0)return o[G];at("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+G+"'")}let Te=O;if(O===o.RED&&(re===o.FLOAT&&(Te=o.R32F),re===o.HALF_FLOAT&&(Te=o.R16F),re===o.UNSIGNED_BYTE&&(Te=o.R8)),O===o.RED_INTEGER&&(re===o.UNSIGNED_BYTE&&(Te=o.R8UI),re===o.UNSIGNED_SHORT&&(Te=o.R16UI),re===o.UNSIGNED_INT&&(Te=o.R32UI),re===o.BYTE&&(Te=o.R8I),re===o.SHORT&&(Te=o.R16I),re===o.INT&&(Te=o.R32I)),O===o.RG&&(re===o.FLOAT&&(Te=o.RG32F),re===o.HALF_FLOAT&&(Te=o.RG16F),re===o.UNSIGNED_BYTE&&(Te=o.RG8)),O===o.RG_INTEGER&&(re===o.UNSIGNED_BYTE&&(Te=o.RG8UI),re===o.UNSIGNED_SHORT&&(Te=o.RG16UI),re===o.UNSIGNED_INT&&(Te=o.RG32UI),re===o.BYTE&&(Te=o.RG8I),re===o.SHORT&&(Te=o.RG16I),re===o.INT&&(Te=o.RG32I)),O===o.RGB_INTEGER&&(re===o.UNSIGNED_BYTE&&(Te=o.RGB8UI),re===o.UNSIGNED_SHORT&&(Te=o.RGB16UI),re===o.UNSIGNED_INT&&(Te=o.RGB32UI),re===o.BYTE&&(Te=o.RGB8I),re===o.SHORT&&(Te=o.RGB16I),re===o.INT&&(Te=o.RGB32I)),O===o.RGBA_INTEGER&&(re===o.UNSIGNED_BYTE&&(Te=o.RGBA8UI),re===o.UNSIGNED_SHORT&&(Te=o.RGBA16UI),re===o.UNSIGNED_INT&&(Te=o.RGBA32UI),re===o.BYTE&&(Te=o.RGBA8I),re===o.SHORT&&(Te=o.RGBA16I),re===o.INT&&(Te=o.RGBA32I)),O===o.RGB&&(re===o.UNSIGNED_INT_5_9_9_9_REV&&(Te=o.RGB9_E5),re===o.UNSIGNED_INT_10F_11F_11F_REV&&(Te=o.R11F_G11F_B10F)),O===o.RGBA){const rt=Le?lm:Sn.getTransfer(be);re===o.FLOAT&&(Te=o.RGBA32F),re===o.HALF_FLOAT&&(Te=o.RGBA16F),re===o.UNSIGNED_BYTE&&(Te=rt===On?o.SRGB8_ALPHA8:o.RGBA8),re===o.UNSIGNED_SHORT_4_4_4_4&&(Te=o.RGBA4),re===o.UNSIGNED_SHORT_5_5_5_1&&(Te=o.RGB5_A1)}return(Te===o.R16F||Te===o.R32F||Te===o.RG16F||Te===o.RG32F||Te===o.RGBA16F||Te===o.RGBA32F)&&e.get("EXT_color_buffer_float"),Te}function I(G,O){let re;return G?O===null||O===vr||O===Hh?re=o.DEPTH24_STENCIL8:O===$s?re=o.DEPTH32F_STENCIL8:O===kh&&(re=o.DEPTH24_STENCIL8,at("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):O===null||O===vr||O===Hh?re=o.DEPTH_COMPONENT24:O===$s?re=o.DEPTH_COMPONENT32F:O===kh&&(re=o.DEPTH_COMPONENT16),re}function V(G,O){return w(G)===!0||G.isFramebufferTexture&&G.minFilter!==Ti&&G.minFilter!==si?Math.log2(Math.max(O.width,O.height))+1:G.mipmaps!==void 0&&G.mipmaps.length>0?G.mipmaps.length:G.isCompressedTexture&&Array.isArray(G.image)?O.mipmaps.length:1}function z(G){const O=G.target;O.removeEventListener("dispose",z),U(O),O.isVideoTexture&&_.delete(O)}function H(G){const O=G.target;O.removeEventListener("dispose",H),Q(O)}function U(G){const O=i.get(G);if(O.__webglInit===void 0)return;const re=G.source,be=x.get(re);if(be){const Le=be[O.__cacheKey];Le.usedTimes--,Le.usedTimes===0&&P(G),Object.keys(be).length===0&&x.delete(re)}i.remove(G)}function P(G){const O=i.get(G);o.deleteTexture(O.__webglTexture);const re=G.source,be=x.get(re);delete be[O.__cacheKey],f.memory.textures--}function Q(G){const O=i.get(G);if(G.depthTexture&&(G.depthTexture.dispose(),i.remove(G.depthTexture)),G.isWebGLCubeRenderTarget)for(let be=0;be<6;be++){if(Array.isArray(O.__webglFramebuffer[be]))for(let Le=0;Le=a.maxTextures&&at("WebGLTextures: Trying to use "+G+" texture units while this GPU supports only "+a.maxTextures),X+=1,G}function ue(G){const O=[];return O.push(G.wrapS),O.push(G.wrapT),O.push(G.wrapR||0),O.push(G.magFilter),O.push(G.minFilter),O.push(G.anisotropy),O.push(G.internalFormat),O.push(G.format),O.push(G.type),O.push(G.generateMipmaps),O.push(G.premultiplyAlpha),O.push(G.flipY),O.push(G.unpackAlignment),O.push(G.colorSpace),O.join()}function se(G,O){const re=i.get(G);if(G.isVideoTexture&&nt(G),G.isRenderTargetTexture===!1&&G.isExternalTexture!==!0&&G.version>0&&re.__version!==G.version){const be=G.image;if(be===null)at("WebGLRenderer: Texture marked for update but no image data found.");else if(be.complete===!1)at("WebGLRenderer: Texture marked for update but image is incomplete");else{ce(re,G,O);return}}else G.isExternalTexture&&(re.__webglTexture=G.sourceTexture?G.sourceTexture:null);t.bindTexture(o.TEXTURE_2D,re.__webglTexture,o.TEXTURE0+O)}function q(G,O){const re=i.get(G);if(G.isRenderTargetTexture===!1&&G.version>0&&re.__version!==G.version){ce(re,G,O);return}else G.isExternalTexture&&(re.__webglTexture=G.sourceTexture?G.sourceTexture:null);t.bindTexture(o.TEXTURE_2D_ARRAY,re.__webglTexture,o.TEXTURE0+O)}function Z(G,O){const re=i.get(G);if(G.isRenderTargetTexture===!1&&G.version>0&&re.__version!==G.version){ce(re,G,O);return}t.bindTexture(o.TEXTURE_3D,re.__webglTexture,o.TEXTURE0+O)}function ye(G,O){const re=i.get(G);if(G.isCubeDepthTexture!==!0&&G.version>0&&re.__version!==G.version){Ce(re,G,O);return}t.bindTexture(o.TEXTURE_CUBE_MAP,re.__webglTexture,o.TEXTURE0+O)}const _e={[sm]:o.REPEAT,[Ca]:o.CLAMP_TO_EDGE,[am]:o.MIRRORED_REPEAT},Ue={[Ti]:o.NEAREST,[cS]:o.NEAREST_MIPMAP_NEAREST,[Ph]:o.NEAREST_MIPMAP_LINEAR,[si]:o.LINEAR,[Zp]:o.LINEAR_MIPMAP_NEAREST,[Io]:o.LINEAR_MIPMAP_LINEAR},W={[vE]:o.NEVER,[bE]:o.ALWAYS,[yE]:o.LESS,[vy]:o.LEQUAL,[_E]:o.EQUAL,[yy]:o.GEQUAL,[xE]:o.GREATER,[SE]:o.NOTEQUAL};function ee(G,O){if(O.type===$s&&e.has("OES_texture_float_linear")===!1&&(O.magFilter===si||O.magFilter===Zp||O.magFilter===Ph||O.magFilter===Io||O.minFilter===si||O.minFilter===Zp||O.minFilter===Ph||O.minFilter===Io)&&at("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o.texParameteri(G,o.TEXTURE_WRAP_S,_e[O.wrapS]),o.texParameteri(G,o.TEXTURE_WRAP_T,_e[O.wrapT]),(G===o.TEXTURE_3D||G===o.TEXTURE_2D_ARRAY)&&o.texParameteri(G,o.TEXTURE_WRAP_R,_e[O.wrapR]),o.texParameteri(G,o.TEXTURE_MAG_FILTER,Ue[O.magFilter]),o.texParameteri(G,o.TEXTURE_MIN_FILTER,Ue[O.minFilter]),O.compareFunction&&(o.texParameteri(G,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(G,o.TEXTURE_COMPARE_FUNC,W[O.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(O.magFilter===Ti||O.minFilter!==Ph&&O.minFilter!==Io||O.type===$s&&e.has("OES_texture_float_linear")===!1)return;if(O.anisotropy>1||i.get(O).__currentAnisotropy){const re=e.get("EXT_texture_filter_anisotropic");o.texParameterf(G,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,a.getMaxAnisotropy())),i.get(O).__currentAnisotropy=O.anisotropy}}}function Ee(G,O){let re=!1;G.__webglInit===void 0&&(G.__webglInit=!0,O.addEventListener("dispose",z));const be=O.source;let Le=x.get(be);Le===void 0&&(Le={},x.set(be,Le));const Te=ue(O);if(Te!==G.__cacheKey){Le[Te]===void 0&&(Le[Te]={texture:o.createTexture(),usedTimes:0},f.memory.textures++,re=!0),Le[Te].usedTimes++;const rt=Le[G.__cacheKey];rt!==void 0&&(Le[G.__cacheKey].usedTimes--,rt.usedTimes===0&&P(O)),G.__cacheKey=Te,G.__webglTexture=Le[Te].texture}return re}function Oe(G,O,re){return Math.floor(Math.floor(G/re)/O)}function st(G,O,re,be){const Te=G.updateRanges;if(Te.length===0)t.texSubImage2D(o.TEXTURE_2D,0,0,0,O.width,O.height,re,be,O.data);else{Te.sort((Fe,ke)=>Fe.start-ke.start);let rt=0;for(let Fe=1;Fe0){ae&&Ze&&t.texStorage2D(o.TEXTURE_2D,ut,ot,Zt[0].width,Zt[0].height);for(let He=0,Ae=Zt.length;He0){const dt=qx(ct.width,ct.height,O.format,O.type);for(const zt of O.layerUpdates){const pn=ct.data.subarray(zt*dt/ct.data.BYTES_PER_ELEMENT,(zt+1)*dt/ct.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY,He,0,0,zt,ct.width,ct.height,1,ke,pn)}O.clearLayerUpdates()}else t.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY,He,0,0,0,ct.width,ct.height,Fe.depth,ke,ct.data)}else t.compressedTexImage3D(o.TEXTURE_2D_ARRAY,He,ot,ct.width,ct.height,Fe.depth,0,ct.data,0,0);else at("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ae?We&&t.texSubImage3D(o.TEXTURE_2D_ARRAY,He,0,0,0,ct.width,ct.height,Fe.depth,ke,ft,ct.data):t.texImage3D(o.TEXTURE_2D_ARRAY,He,ot,ct.width,ct.height,Fe.depth,0,ke,ft,ct.data)}else{ae&&Ze&&t.texStorage2D(o.TEXTURE_2D,ut,ot,Zt[0].width,Zt[0].height);for(let He=0,Ae=Zt.length;He0){const He=qx(Fe.width,Fe.height,O.format,O.type);for(const Ae of O.layerUpdates){const dt=Fe.data.subarray(Ae*He/Fe.data.BYTES_PER_ELEMENT,(Ae+1)*He/Fe.data.BYTES_PER_ELEMENT);t.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,Ae,Fe.width,Fe.height,1,ke,ft,dt)}O.clearLayerUpdates()}else t.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,0,Fe.width,Fe.height,Fe.depth,ke,ft,Fe.data)}else t.texImage3D(o.TEXTURE_2D_ARRAY,0,ot,Fe.width,Fe.height,Fe.depth,0,ke,ft,Fe.data);else if(O.isData3DTexture)ae?(Ze&&t.texStorage3D(o.TEXTURE_3D,ut,ot,Fe.width,Fe.height,Fe.depth),We&&t.texSubImage3D(o.TEXTURE_3D,0,0,0,0,Fe.width,Fe.height,Fe.depth,ke,ft,Fe.data)):t.texImage3D(o.TEXTURE_3D,0,ot,Fe.width,Fe.height,Fe.depth,0,ke,ft,Fe.data);else if(O.isFramebufferTexture){if(Ze)if(ae)t.texStorage2D(o.TEXTURE_2D,ut,ot,Fe.width,Fe.height);else{let He=Fe.width,Ae=Fe.height;for(let dt=0;dt>=1,Ae>>=1}}else if(Zt.length>0){if(ae&&Ze){const He=Xe(Zt[0]);t.texStorage2D(o.TEXTURE_2D,ut,ot,He.width,He.height)}for(let He=0,Ae=Zt.length;He0&&ut++;const Ae=Xe(ke[0]);t.texStorage2D(o.TEXTURE_CUBE_MAP,ut,Zt,Ae.width,Ae.height)}for(let Ae=0;Ae<6;Ae++)if(Fe){ae?We&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0,0,0,ke[Ae].width,ke[Ae].height,ot,ct,ke[Ae].data):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0,Zt,ke[Ae].width,ke[Ae].height,0,ot,ct,ke[Ae].data);for(let dt=0;dt>Te),ft=Math.max(1,O.height>>Te);Le===o.TEXTURE_3D||Le===o.TEXTURE_2D_ARRAY?t.texImage3D(Le,Te,St,ke,ft,O.depth,0,rt,qe,null):t.texImage2D(Le,Te,St,ke,ft,0,rt,qe,null)}t.bindFramebuffer(o.FRAMEBUFFER,G),xt(O)?d.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,be,Le,Fe.__webglTexture,0,j(O)):(Le===o.TEXTURE_2D||Le>=o.TEXTURE_CUBE_MAP_POSITIVE_X&&Le<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&o.framebufferTexture2D(o.FRAMEBUFFER,be,Le,Fe.__webglTexture,Te),t.bindFramebuffer(o.FRAMEBUFFER,null)}function et(G,O,re){if(o.bindRenderbuffer(o.RENDERBUFFER,G),O.depthBuffer){const be=O.depthTexture,Le=be&&be.isDepthTexture?be.type:null,Te=I(O.stencilBuffer,Le),rt=O.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT;xt(O)?d.renderbufferStorageMultisampleEXT(o.RENDERBUFFER,j(O),Te,O.width,O.height):re?o.renderbufferStorageMultisample(o.RENDERBUFFER,j(O),Te,O.width,O.height):o.renderbufferStorage(o.RENDERBUFFER,Te,O.width,O.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,rt,o.RENDERBUFFER,G)}else{const be=O.textures;for(let Le=0;Le{delete O.__boundDepthTexture,delete O.__depthDisposeCallback,be.removeEventListener("dispose",Le)};be.addEventListener("dispose",Le),O.__depthDisposeCallback=Le}O.__boundDepthTexture=be}if(G.depthTexture&&!O.__autoAllocateDepthBuffer)if(re)for(let be=0;be<6;be++)yt(O.__webglFramebuffer[be],G,be);else{const be=G.texture.mipmaps;be&&be.length>0?yt(O.__webglFramebuffer[0],G,0):yt(O.__webglFramebuffer,G,0)}else if(re){O.__webglDepthbuffer=[];for(let be=0;be<6;be++)if(t.bindFramebuffer(o.FRAMEBUFFER,O.__webglFramebuffer[be]),O.__webglDepthbuffer[be]===void 0)O.__webglDepthbuffer[be]=o.createRenderbuffer(),et(O.__webglDepthbuffer[be],G,!1);else{const Le=G.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,Te=O.__webglDepthbuffer[be];o.bindRenderbuffer(o.RENDERBUFFER,Te),o.framebufferRenderbuffer(o.FRAMEBUFFER,Le,o.RENDERBUFFER,Te)}}else{const be=G.texture.mipmaps;if(be&&be.length>0?t.bindFramebuffer(o.FRAMEBUFFER,O.__webglFramebuffer[0]):t.bindFramebuffer(o.FRAMEBUFFER,O.__webglFramebuffer),O.__webglDepthbuffer===void 0)O.__webglDepthbuffer=o.createRenderbuffer(),et(O.__webglDepthbuffer,G,!1);else{const Le=G.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,Te=O.__webglDepthbuffer;o.bindRenderbuffer(o.RENDERBUFFER,Te),o.framebufferRenderbuffer(o.FRAMEBUFFER,Le,o.RENDERBUFFER,Te)}}t.bindFramebuffer(o.FRAMEBUFFER,null)}function ln(G,O,re){const be=i.get(G);O!==void 0&&Be(be.__webglFramebuffer,G,G.texture,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,0),re!==void 0&&wt(G)}function Dt(G){const O=G.texture,re=i.get(G),be=i.get(O);G.addEventListener("dispose",H);const Le=G.textures,Te=G.isWebGLCubeRenderTarget===!0,rt=Le.length>1;if(rt||(be.__webglTexture===void 0&&(be.__webglTexture=o.createTexture()),be.__version=O.version,f.memory.textures++),Te){re.__webglFramebuffer=[];for(let qe=0;qe<6;qe++)if(O.mipmaps&&O.mipmaps.length>0){re.__webglFramebuffer[qe]=[];for(let St=0;St0){re.__webglFramebuffer=[];for(let qe=0;qe0&&xt(G)===!1){re.__webglMultisampledFramebuffer=o.createFramebuffer(),re.__webglColorRenderbuffer=[],t.bindFramebuffer(o.FRAMEBUFFER,re.__webglMultisampledFramebuffer);for(let qe=0;qe0)for(let St=0;St0)for(let St=0;St0){if(xt(G)===!1){const O=G.textures,re=G.width,be=G.height;let Le=o.COLOR_BUFFER_BIT;const Te=G.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,rt=i.get(G),qe=O.length>1;if(qe)for(let At=0;At0?t.bindFramebuffer(o.DRAW_FRAMEBUFFER,rt.__webglFramebuffer[0]):t.bindFramebuffer(o.DRAW_FRAMEBUFFER,rt.__webglFramebuffer);for(let At=0;At0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function nt(G){const O=f.render.frame;_.get(G)!==O&&(_.set(G,O),G.update())}function Mt(G,O){const re=G.colorSpace,be=G.format,Le=G.type;return G.isCompressedTexture===!0||G.isVideoTexture===!0||re!==Uu&&re!==El&&(Sn.getTransfer(re)===On?(be!==Os||Le!==Js)&&at("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Tt("WebGLTextures: Unsupported texture color space:",re)),O}function Xe(G){return typeof HTMLImageElement<"u"&&G instanceof HTMLImageElement?(g.width=G.naturalWidth||G.width,g.height=G.naturalHeight||G.height):typeof VideoFrame<"u"&&G instanceof VideoFrame?(g.width=G.displayWidth,g.height=G.displayHeight):(g.width=G.width,g.height=G.height),g}this.allocateTextureUnit=$,this.resetTextureUnits=te,this.setTexture2D=se,this.setTexture2DArray=q,this.setTexture3D=Z,this.setTextureCube=ye,this.rebindTextures=ln,this.setupRenderTarget=Dt,this.updateRenderTargetMipmap=Re,this.updateMultisampleRenderTarget=Je,this.setupDepthRenderbuffer=wt,this.setupFrameBufferTexture=Be,this.useMultisampledRTT=xt,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function OT(o,e){function t(i,a=El){let u;const f=Sn.getTransfer(a);if(i===Js)return o.UNSIGNED_BYTE;if(i===fy)return o.UNSIGNED_SHORT_4_4_4_4;if(i===hy)return o.UNSIGNED_SHORT_5_5_5_1;if(i===dS)return o.UNSIGNED_INT_5_9_9_9_REV;if(i===pS)return o.UNSIGNED_INT_10F_11F_11F_REV;if(i===fS)return o.BYTE;if(i===hS)return o.SHORT;if(i===kh)return o.UNSIGNED_SHORT;if(i===cy)return o.INT;if(i===vr)return o.UNSIGNED_INT;if(i===$s)return o.FLOAT;if(i===Bo)return o.HALF_FLOAT;if(i===mS)return o.ALPHA;if(i===gS)return o.RGB;if(i===Os)return o.RGBA;if(i===Fo)return o.DEPTH_COMPONENT;if(i===Ru)return o.DEPTH_STENCIL;if(i===dy)return o.RED;if(i===Mm)return o.RED_INTEGER;if(i===Jc)return o.RG;if(i===py)return o.RG_INTEGER;if(i===my)return o.RGBA_INTEGER;if(i===Qp||i===Jp||i===Kp||i===$p)if(f===On)if(u=e.get("WEBGL_compressed_texture_s3tc_srgb"),u!==null){if(i===Qp)return u.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Jp)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Kp)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===$p)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(u=e.get("WEBGL_compressed_texture_s3tc"),u!==null){if(i===Qp)return u.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Jp)return u.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Kp)return u.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===$p)return u.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===xv||i===Sv||i===bv||i===Mv)if(u=e.get("WEBGL_compressed_texture_pvrtc"),u!==null){if(i===xv)return u.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Sv)return u.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===bv)return u.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Mv)return u.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Ev||i===Tv||i===Av||i===wv||i===Cv||i===Rv||i===Dv)if(u=e.get("WEBGL_compressed_texture_etc"),u!==null){if(i===Ev||i===Tv)return f===On?u.COMPRESSED_SRGB8_ETC2:u.COMPRESSED_RGB8_ETC2;if(i===Av)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:u.COMPRESSED_RGBA8_ETC2_EAC;if(i===wv)return u.COMPRESSED_R11_EAC;if(i===Cv)return u.COMPRESSED_SIGNED_R11_EAC;if(i===Rv)return u.COMPRESSED_RG11_EAC;if(i===Dv)return u.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===Nv||i===Lv||i===Uv||i===Iv||i===Ov||i===Pv||i===zv||i===Bv||i===Fv||i===Vv||i===kv||i===Hv||i===Gv||i===Wv)if(u=e.get("WEBGL_compressed_texture_astc"),u!==null){if(i===Nv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:u.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Lv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:u.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Uv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:u.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Iv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:u.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Ov)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:u.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Pv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:u.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===zv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:u.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Bv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:u.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Fv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:u.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Vv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:u.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===kv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:u.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Hv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:u.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Gv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:u.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Wv)return f===On?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:u.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Xv||i===qv||i===Yv)if(u=e.get("EXT_texture_compression_bptc"),u!==null){if(i===Xv)return f===On?u.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:u.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===qv)return u.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Yv)return u.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===jv||i===Zv||i===Qv||i===Jv)if(u=e.get("EXT_texture_compression_rgtc"),u!==null){if(i===jv)return u.COMPRESSED_RED_RGTC1_EXT;if(i===Zv)return u.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Qv)return u.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Jv)return u.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Hh?o.UNSIGNED_INT_24_8:o[i]!==void 0?o[i]:null}return{convert:t}}const xI=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,SI=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class bI{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const i=new AS(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 yr({vertexShader:xI,fragmentShader:SI,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Gi(new $h(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class MI extends Vo{constructor(e,t){super();const i=this;let a=null,u=1,f=null,d="local-floor",m=1,g=null,_=null,S=null,x=null,M=null,T=null;const D=typeof XRWebGLBinding<"u",w=new bI,A={},R=t.getContextAttributes();let L=null,I=null;const V=[],z=[],H=new ze;let U=null;const P=new as;P.viewport=new Xn;const Q=new as;Q.viewport=new Xn;const X=[P,Q],te=new bT;let $=null,ue=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ce){let Ce=V[ce];return Ce===void 0&&(Ce=new lv,V[ce]=Ce),Ce.getTargetRaySpace()},this.getControllerGrip=function(ce){let Ce=V[ce];return Ce===void 0&&(Ce=new lv,V[ce]=Ce),Ce.getGripSpace()},this.getHand=function(ce){let Ce=V[ce];return Ce===void 0&&(Ce=new lv,V[ce]=Ce),Ce.getHandSpace()};function se(ce){const Ce=z.indexOf(ce.inputSource);if(Ce===-1)return;const Be=V[Ce];Be!==void 0&&(Be.update(ce.inputSource,ce.frame,g||f),Be.dispatchEvent({type:ce.type,data:ce.inputSource}))}function q(){a.removeEventListener("select",se),a.removeEventListener("selectstart",se),a.removeEventListener("selectend",se),a.removeEventListener("squeeze",se),a.removeEventListener("squeezestart",se),a.removeEventListener("squeezeend",se),a.removeEventListener("end",q),a.removeEventListener("inputsourceschange",Z);for(let ce=0;ce=0&&(z[et]=null,V[et].disconnect(Be))}for(let Ce=0;Ce=z.length){z.push(Be),et=wt;break}else if(z[wt]===null){z[wt]=Be,et=wt;break}if(et===-1)break}const yt=V[et];yt&&yt.connect(Be)}}const ye=new Y,_e=new Y;function Ue(ce,Ce,Be){ye.setFromMatrixPosition(Ce.matrixWorld),_e.setFromMatrixPosition(Be.matrixWorld);const et=ye.distanceTo(_e),yt=Ce.projectionMatrix.elements,wt=Be.projectionMatrix.elements,ln=yt[14]/(yt[10]-1),Dt=yt[14]/(yt[10]+1),Re=(yt[9]+1)/yt[5],Ve=(yt[9]-1)/yt[5],Ne=(yt[8]-1)/yt[0],Je=(wt[8]+1)/wt[0],j=ln*Ne,xt=ln*Je,nt=et/(-Ne+Je),Mt=nt*-Ne;if(Ce.matrixWorld.decompose(ce.position,ce.quaternion,ce.scale),ce.translateX(Mt),ce.translateZ(nt),ce.matrixWorld.compose(ce.position,ce.quaternion,ce.scale),ce.matrixWorldInverse.copy(ce.matrixWorld).invert(),yt[10]===-1)ce.projectionMatrix.copy(Ce.projectionMatrix),ce.projectionMatrixInverse.copy(Ce.projectionMatrixInverse);else{const Xe=ln+nt,G=Dt+nt,O=j-Mt,re=xt+(et-Mt),be=Re*Dt/G*Xe,Le=Ve*Dt/G*Xe;ce.projectionMatrix.makePerspective(O,re,be,Le,Xe,G),ce.projectionMatrixInverse.copy(ce.projectionMatrix).invert()}}function W(ce,Ce){Ce===null?ce.matrixWorld.copy(ce.matrix):ce.matrixWorld.multiplyMatrices(Ce.matrixWorld,ce.matrix),ce.matrixWorldInverse.copy(ce.matrixWorld).invert()}this.updateCamera=function(ce){if(a===null)return;let Ce=ce.near,Be=ce.far;w.texture!==null&&(w.depthNear>0&&(Ce=w.depthNear),w.depthFar>0&&(Be=w.depthFar)),te.near=Q.near=P.near=Ce,te.far=Q.far=P.far=Be,($!==te.near||ue!==te.far)&&(a.updateRenderState({depthNear:te.near,depthFar:te.far}),$=te.near,ue=te.far),te.layers.mask=ce.layers.mask|6,P.layers.mask=te.layers.mask&-5,Q.layers.mask=te.layers.mask&-3;const et=ce.parent,yt=te.cameras;W(te,et);for(let wt=0;wt0&&(w.alphaTest.value=A.alphaTest);const R=e.get(A),L=R.envMap,I=R.envMapRotation;L&&(w.envMap.value=L,Fc.copy(I),Fc.x*=-1,Fc.y*=-1,Fc.z*=-1,L.isCubeTexture&&L.isRenderTargetTexture===!1&&(Fc.y*=-1,Fc.z*=-1),w.envMapRotation.value.setFromMatrix4(EI.makeRotationFromEuler(Fc)),w.flipEnvMap.value=L.isCubeTexture&&L.isRenderTargetTexture===!1?-1:1,w.reflectivity.value=A.reflectivity,w.ior.value=A.ior,w.refractionRatio.value=A.refractionRatio),A.lightMap&&(w.lightMap.value=A.lightMap,w.lightMapIntensity.value=A.lightMapIntensity,t(A.lightMap,w.lightMapTransform)),A.aoMap&&(w.aoMap.value=A.aoMap,w.aoMapIntensity.value=A.aoMapIntensity,t(A.aoMap,w.aoMapTransform))}function f(w,A){w.diffuse.value.copy(A.color),w.opacity.value=A.opacity,A.map&&(w.map.value=A.map,t(A.map,w.mapTransform))}function d(w,A){w.dashSize.value=A.dashSize,w.totalSize.value=A.dashSize+A.gapSize,w.scale.value=A.scale}function m(w,A,R,L){w.diffuse.value.copy(A.color),w.opacity.value=A.opacity,w.size.value=A.size*R,w.scale.value=L*.5,A.map&&(w.map.value=A.map,t(A.map,w.uvTransform)),A.alphaMap&&(w.alphaMap.value=A.alphaMap,t(A.alphaMap,w.alphaMapTransform)),A.alphaTest>0&&(w.alphaTest.value=A.alphaTest)}function g(w,A){w.diffuse.value.copy(A.color),w.opacity.value=A.opacity,w.rotation.value=A.rotation,A.map&&(w.map.value=A.map,t(A.map,w.mapTransform)),A.alphaMap&&(w.alphaMap.value=A.alphaMap,t(A.alphaMap,w.alphaMapTransform)),A.alphaTest>0&&(w.alphaTest.value=A.alphaTest)}function _(w,A){w.specular.value.copy(A.specular),w.shininess.value=Math.max(A.shininess,1e-4)}function S(w,A){A.gradientMap&&(w.gradientMap.value=A.gradientMap)}function x(w,A){w.metalness.value=A.metalness,A.metalnessMap&&(w.metalnessMap.value=A.metalnessMap,t(A.metalnessMap,w.metalnessMapTransform)),w.roughness.value=A.roughness,A.roughnessMap&&(w.roughnessMap.value=A.roughnessMap,t(A.roughnessMap,w.roughnessMapTransform)),A.envMap&&(w.envMapIntensity.value=A.envMapIntensity)}function M(w,A,R){w.ior.value=A.ior,A.sheen>0&&(w.sheenColor.value.copy(A.sheenColor).multiplyScalar(A.sheen),w.sheenRoughness.value=A.sheenRoughness,A.sheenColorMap&&(w.sheenColorMap.value=A.sheenColorMap,t(A.sheenColorMap,w.sheenColorMapTransform)),A.sheenRoughnessMap&&(w.sheenRoughnessMap.value=A.sheenRoughnessMap,t(A.sheenRoughnessMap,w.sheenRoughnessMapTransform))),A.clearcoat>0&&(w.clearcoat.value=A.clearcoat,w.clearcoatRoughness.value=A.clearcoatRoughness,A.clearcoatMap&&(w.clearcoatMap.value=A.clearcoatMap,t(A.clearcoatMap,w.clearcoatMapTransform)),A.clearcoatRoughnessMap&&(w.clearcoatRoughnessMap.value=A.clearcoatRoughnessMap,t(A.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)),A.clearcoatNormalMap&&(w.clearcoatNormalMap.value=A.clearcoatNormalMap,t(A.clearcoatNormalMap,w.clearcoatNormalMapTransform),w.clearcoatNormalScale.value.copy(A.clearcoatNormalScale),A.side===ea&&w.clearcoatNormalScale.value.negate())),A.dispersion>0&&(w.dispersion.value=A.dispersion),A.iridescence>0&&(w.iridescence.value=A.iridescence,w.iridescenceIOR.value=A.iridescenceIOR,w.iridescenceThicknessMinimum.value=A.iridescenceThicknessRange[0],w.iridescenceThicknessMaximum.value=A.iridescenceThicknessRange[1],A.iridescenceMap&&(w.iridescenceMap.value=A.iridescenceMap,t(A.iridescenceMap,w.iridescenceMapTransform)),A.iridescenceThicknessMap&&(w.iridescenceThicknessMap.value=A.iridescenceThicknessMap,t(A.iridescenceThicknessMap,w.iridescenceThicknessMapTransform))),A.transmission>0&&(w.transmission.value=A.transmission,w.transmissionSamplerMap.value=R.texture,w.transmissionSamplerSize.value.set(R.width,R.height),A.transmissionMap&&(w.transmissionMap.value=A.transmissionMap,t(A.transmissionMap,w.transmissionMapTransform)),w.thickness.value=A.thickness,A.thicknessMap&&(w.thicknessMap.value=A.thicknessMap,t(A.thicknessMap,w.thicknessMapTransform)),w.attenuationDistance.value=A.attenuationDistance,w.attenuationColor.value.copy(A.attenuationColor)),A.anisotropy>0&&(w.anisotropyVector.value.set(A.anisotropy*Math.cos(A.anisotropyRotation),A.anisotropy*Math.sin(A.anisotropyRotation)),A.anisotropyMap&&(w.anisotropyMap.value=A.anisotropyMap,t(A.anisotropyMap,w.anisotropyMapTransform))),w.specularIntensity.value=A.specularIntensity,w.specularColor.value.copy(A.specularColor),A.specularColorMap&&(w.specularColorMap.value=A.specularColorMap,t(A.specularColorMap,w.specularColorMapTransform)),A.specularIntensityMap&&(w.specularIntensityMap.value=A.specularIntensityMap,t(A.specularIntensityMap,w.specularIntensityMapTransform))}function T(w,A){A.matcap&&(w.matcap.value=A.matcap)}function D(w,A){const R=e.get(A).light;w.referencePosition.value.setFromMatrixPosition(R.matrixWorld),w.nearDistance.value=R.shadow.camera.near,w.farDistance.value=R.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:a}}function AI(o,e,t,i){let a={},u={},f=[];const d=o.getParameter(o.MAX_UNIFORM_BUFFER_BINDINGS);function m(R,L){const I=L.program;i.uniformBlockBinding(R,I)}function g(R,L){let I=a[R.id];I===void 0&&(T(R),I=_(R),a[R.id]=I,R.addEventListener("dispose",w));const V=L.program;i.updateUBOMapping(R,V);const z=e.render.frame;u[R.id]!==z&&(x(R),u[R.id]=z)}function _(R){const L=S();R.__bindingPointIndex=L;const I=o.createBuffer(),V=R.__size,z=R.usage;return o.bindBuffer(o.UNIFORM_BUFFER,I),o.bufferData(o.UNIFORM_BUFFER,V,z),o.bindBuffer(o.UNIFORM_BUFFER,null),o.bindBufferBase(o.UNIFORM_BUFFER,L,I),I}function S(){for(let R=0;R0&&(I+=V-z),R.__size=I,R.__cache={},this}function D(R){const L={boundary:0,storage:0};return typeof R=="number"||typeof R=="boolean"?(L.boundary=4,L.storage=4):R.isVector2?(L.boundary=8,L.storage=8):R.isVector3||R.isColor?(L.boundary=16,L.storage=12):R.isVector4?(L.boundary=16,L.storage=16):R.isMatrix3?(L.boundary=48,L.storage=48):R.isMatrix4?(L.boundary=64,L.storage=64):R.isTexture?at("WebGLRenderer: Texture samplers can not be part of an uniforms group."):at("WebGLRenderer: Unsupported uniform value type.",R),L}function w(R){const L=R.target;L.removeEventListener("dispose",w);const I=f.indexOf(L.__bindingPointIndex);f.splice(I,1),o.deleteBuffer(a[L.id]),delete a[L.id],delete u[L.id]}function A(){for(const R in a)o.deleteBuffer(a[R]);f=[],a={},u={}}return{bind:m,update:g,dispose:A}}const wI=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Lo=null;function CI(){return Lo===null&&(Lo=new Qr(wI,16,16,Jc,Bo),Lo.name="DFG_LUT",Lo.minFilter=si,Lo.magFilter=si,Lo.wrapS=Ca,Lo.wrapT=Ca,Lo.generateMipmaps=!1,Lo.needsUpdate=!0),Lo}class PT{constructor(e={}){const{canvas:t=EE(),context:i=null,depth:a=!0,stencil:u=!1,alpha:f=!1,antialias:d=!1,premultipliedAlpha:m=!0,preserveDrawingBuffer:g=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:S=!1,reversedDepthBuffer:x=!1,outputBufferType:M=Js}=e;this.isWebGLRenderer=!0;let T;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");T=i.getContextAttributes().alpha}else T=f;const D=M,w=new Set([my,py,Mm]),A=new Set([Js,vr,kh,Hh,fy,hy]),R=new Uint32Array(4),L=new Int32Array(4);let I=null,V=null;const z=[],H=[];let U=null;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=gr,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const P=this;let Q=!1;this._outputColorSpace=Is;let X=0,te=0,$=null,ue=-1,se=null;const q=new Xn,Z=new Xn;let ye=null;const _e=new pt(0);let Ue=0,W=t.width,ee=t.height,Ee=1,Oe=null,st=null;const ce=new Xn(0,0,W,ee),Ce=new Xn(0,0,W,ee);let Be=!1;const et=new Kh;let yt=!1,wt=!1;const ln=new kt,Dt=new Y,Re=new Xn,Ve={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ne=!1;function Je(){return $===null?Ee:1}let j=i;function xt(k,ie){return t.getContext(k,ie)}try{const k={alpha:!0,depth:a,stencil:u,antialias:d,premultipliedAlpha:m,preserveDrawingBuffer:g,powerPreference:_,failIfMajorPerformanceCaveat:S};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${oy}`),t.addEventListener("webglcontextlost",dt,!1),t.addEventListener("webglcontextrestored",zt,!1),t.addEventListener("webglcontextcreationerror",pn,!1),j===null){const ie="webgl2";if(j=xt(ie,k),j===null)throw xt(ie)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(k){throw Tt("WebGLRenderer: "+k.message),k}let nt,Mt,Xe,G,O,re,be,Le,Te,rt,qe,St,At,Fe,ke,ft,ot,ct,Zt,ae,Ze,We,ut;function He(){nt=new DL(j),nt.init(),Ze=new OT(j,nt),Mt=new bL(j,nt,e,Ze),Xe=new yI(j,nt),Mt.reversedDepthBuffer&&x&&Xe.buffers.depth.setReversed(!0),G=new UL(j),O=new sI,re=new _I(j,nt,Xe,O,Mt,Ze,G),be=new RL(P),Le=new BR(j),We=new xL(j,Le),Te=new NL(j,Le,G,We),rt=new OL(j,Te,Le,We,G),ct=new IL(j,Mt,re),ke=new ML(O),qe=new iI(P,be,nt,Mt,We,ke),St=new TI(P,O),At=new rI,Fe=new hI(nt),ot=new _L(P,be,Xe,rt,T,m),ft=new vI(P,rt,Mt),ut=new AI(j,G,Mt,Xe),Zt=new SL(j,nt,G),ae=new LL(j,nt,G),G.programs=qe.programs,P.capabilities=Mt,P.extensions=nt,P.properties=O,P.renderLists=At,P.shadowMap=ft,P.state=Xe,P.info=G}He(),D!==Js&&(U=new zL(D,t.width,t.height,a,u));const Ae=new MI(P,j);this.xr=Ae,this.getContext=function(){return j},this.getContextAttributes=function(){return j.getContextAttributes()},this.forceContextLoss=function(){const k=nt.get("WEBGL_lose_context");k&&k.loseContext()},this.forceContextRestore=function(){const k=nt.get("WEBGL_lose_context");k&&k.restoreContext()},this.getPixelRatio=function(){return Ee},this.setPixelRatio=function(k){k!==void 0&&(Ee=k,this.setSize(W,ee,!1))},this.getSize=function(k){return k.set(W,ee)},this.setSize=function(k,ie,ge=!0){if(Ae.isPresenting){at("WebGLRenderer: Can't change size while VR device is presenting.");return}W=k,ee=ie,t.width=Math.floor(k*Ee),t.height=Math.floor(ie*Ee),ge===!0&&(t.style.width=k+"px",t.style.height=ie+"px"),U!==null&&U.setSize(t.width,t.height),this.setViewport(0,0,k,ie)},this.getDrawingBufferSize=function(k){return k.set(W*Ee,ee*Ee).floor()},this.setDrawingBufferSize=function(k,ie,ge){W=k,ee=ie,Ee=ge,t.width=Math.floor(k*ge),t.height=Math.floor(ie*ge),this.setViewport(0,0,k,ie)},this.setEffects=function(k){if(D===Js){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(k){for(let ie=0;ie{function je(){if(de.forEach(function(tt){O.get(tt).currentProgram.isReady()&&de.delete(tt)}),de.size===0){fe(k);return}setTimeout(je,10)}nt.get("KHR_parallel_shader_compile")!==null?je():setTimeout(je,10)})};let Sr=null;function Vu(k){Sr&&Sr(k)}function br(){ia.stop()}function Mr(){ia.start()}const ia=new DT;ia.setAnimationLoop(Vu),typeof self<"u"&&ia.setContext(self),this.setAnimationLoop=function(k){Sr=k,Ae.setAnimationLoop(k),k===null?ia.stop():ia.start()},Ae.addEventListener("sessionstart",br),Ae.addEventListener("sessionend",Mr),this.render=function(k,ie){if(ie!==void 0&&ie.isCamera!==!0){Tt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(Q===!0)return;const ge=Ae.enabled===!0&&Ae.isPresenting===!0,de=U!==null&&($===null||ge)&&U.begin(P,$);if(k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),ie.parent===null&&ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),Ae.enabled===!0&&Ae.isPresenting===!0&&(U===null||U.isCompositing()===!1)&&(Ae.cameraAutoUpdate===!0&&Ae.updateCamera(ie),ie=Ae.getCamera()),k.isScene===!0&&k.onBeforeRender(P,k,ie,$),V=Fe.get(k,H.length),V.init(ie),H.push(V),ln.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),et.setFromProjectionMatrix(ln,Va,ie.reversedDepth),wt=this.localClippingEnabled,yt=ke.init(this.clippingPlanes,wt),I=At.get(k,z.length),I.init(),z.push(I),Ae.enabled===!0&&Ae.isPresenting===!0){const tt=P.xr.getDepthSensingMesh();tt!==null&&sa(tt,ie,-1/0,P.sortObjects)}sa(k,ie,0,P.sortObjects),I.finish(),P.sortObjects===!0&&I.sort(Oe,st),Ne=Ae.enabled===!1||Ae.isPresenting===!1||Ae.hasDepthSensing()===!1,Ne&&ot.addToRenderList(I,k),this.info.render.frame++,yt===!0&&ke.beginShadows();const fe=V.state.shadowsArray;if(ft.render(fe,k,ie),yt===!0&&ke.endShadows(),this.info.autoReset===!0&&this.info.reset(),(de&&U.hasRenderPass())===!1){const tt=I.opaque,it=I.transmissive;if(V.setupLights(),ie.isArrayCamera){const Ke=ie.cameras;if(it.length>0)for(let _t=0,Ut=Ke.length;_t0&&Qn(tt,it,k,ie),Ne&&ot.render(k),aa(I,k,ie)}$!==null&&te===0&&(re.updateMultisampleRenderTarget($),re.updateRenderTargetMipmap($)),de&&U.end(P),k.isScene===!0&&k.onAfterRender(P,k,ie),We.resetDefaultState(),ue=-1,se=null,H.pop(),H.length>0?(V=H[H.length-1],yt===!0&&ke.setGlobalState(P.clippingPlanes,V.state.camera)):V=null,z.pop(),z.length>0?I=z[z.length-1]:I=null};function sa(k,ie,ge,de){if(k.visible===!1)return;if(k.layers.test(ie.layers)){if(k.isGroup)ge=k.renderOrder;else if(k.isLOD)k.autoUpdate===!0&&k.update(ie);else if(k.isLight)V.pushLight(k),k.castShadow&&V.pushShadow(k);else if(k.isSprite){if(!k.frustumCulled||et.intersectsSprite(k)){de&&Re.setFromMatrixPosition(k.matrixWorld).applyMatrix4(ln);const tt=rt.update(k),it=k.material;it.visible&&I.push(k,tt,it,ge,Re.z,null)}}else if((k.isMesh||k.isLine||k.isPoints)&&(!k.frustumCulled||et.intersectsObject(k))){const tt=rt.update(k),it=k.material;if(de&&(k.boundingSphere!==void 0?(k.boundingSphere===null&&k.computeBoundingSphere(),Re.copy(k.boundingSphere.center)):(tt.boundingSphere===null&&tt.computeBoundingSphere(),Re.copy(tt.boundingSphere.center)),Re.applyMatrix4(k.matrixWorld).applyMatrix4(ln)),Array.isArray(it)){const Ke=tt.groups;for(let _t=0,Ut=Ke.length;_t0&&fi(fe,ie,ge),je.length>0&&fi(je,ie,ge),tt.length>0&&fi(tt,ie,ge),Xe.buffers.depth.setTest(!0),Xe.buffers.depth.setMask(!0),Xe.buffers.color.setMask(!0),Xe.setPolygonOffset(!1)}function Qn(k,ie,ge,de){if((ge.isScene===!0?ge.overrideMaterial:null)!==null)return;if(V.state.transmissionRenderTarget[de.id]===void 0){const mt=nt.has("EXT_color_buffer_half_float")||nt.has("EXT_color_buffer_float");V.state.transmissionRenderTarget[de.id]=new Ha(1,1,{generateMipmaps:!0,type:mt?Bo:Js,minFilter:Io,samples:Mt.samples,stencilBuffer:u,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Sn.workingColorSpace})}const je=V.state.transmissionRenderTarget[de.id],tt=de.viewport||q;je.setSize(tt.z*P.transmissionResolutionScale,tt.w*P.transmissionResolutionScale);const it=P.getRenderTarget(),Ke=P.getActiveCubeFace(),_t=P.getActiveMipmapLevel();P.setRenderTarget(je),P.getClearColor(_e),Ue=P.getClearAlpha(),Ue<1&&P.setClearColor(16777215,.5),P.clear(),Ne&&ot.render(ge);const Ut=P.toneMapping;P.toneMapping=gr;const Ht=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),V.setupLightsView(de),yt===!0&&ke.setGlobalState(P.clippingPlanes,de),fi(k,ge,de),re.updateMultisampleRenderTarget(je),re.updateRenderTargetMipmap(je),nt.has("WEBGL_multisampled_render_to_texture")===!1){let mt=!1;for(let Qt=0,Pn=ie.length;Qt0),mt=!!ge.morphAttributes.position,Qt=!!ge.morphAttributes.normal,Pn=!!ge.morphAttributes.color;let zn=gr;de.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(zn=P.toneMapping);const yn=ge.morphAttributes.position||ge.morphAttributes.normal||ge.morphAttributes.color,bn=yn!==void 0?yn.length:0,$e=O.get(de),Ii=V.state.lights;if(yt===!0&&(wt===!0||k!==se)){const hi=k===se&&de.id===ue;ke.setState(de,k,hi)}let It=!1;de.version===$e.__version?($e.needsLights&&$e.lightsStateVersion!==Ii.state.version||$e.outputColorSpace!==it||fe.isBatchedMesh&&$e.batching===!1||!fe.isBatchedMesh&&$e.batching===!0||fe.isBatchedMesh&&$e.batchingColor===!0&&fe.colorTexture===null||fe.isBatchedMesh&&$e.batchingColor===!1&&fe.colorTexture!==null||fe.isInstancedMesh&&$e.instancing===!1||!fe.isInstancedMesh&&$e.instancing===!0||fe.isSkinnedMesh&&$e.skinning===!1||!fe.isSkinnedMesh&&$e.skinning===!0||fe.isInstancedMesh&&$e.instancingColor===!0&&fe.instanceColor===null||fe.isInstancedMesh&&$e.instancingColor===!1&&fe.instanceColor!==null||fe.isInstancedMesh&&$e.instancingMorph===!0&&fe.morphTexture===null||fe.isInstancedMesh&&$e.instancingMorph===!1&&fe.morphTexture!==null||$e.envMap!==_t||de.fog===!0&&$e.fog!==je||$e.numClippingPlanes!==void 0&&($e.numClippingPlanes!==ke.numPlanes||$e.numIntersection!==ke.numIntersection)||$e.vertexAlphas!==Ut||$e.vertexTangents!==Ht||$e.morphTargets!==mt||$e.morphNormals!==Qt||$e.morphColors!==Pn||$e.toneMapping!==zn||$e.morphTargetsCount!==bn)&&(It=!0):(It=!0,$e.__version=de.version);let Oi=$e.currentProgram;It===!0&&(Oi=rs(de,ie,fe));let os=!1,wi=!1,Ki=!1;const En=Oi.getUniforms(),ai=$e.uniforms;if(Xe.useProgram(Oi.program)&&(os=!0,wi=!0,Ki=!0),de.id!==ue&&(ue=de.id,wi=!0),os||se!==k){Xe.buffers.depth.getReversed()&&k.reversedDepth!==!0&&(k._reversedDepth=!0,k.updateProjectionMatrix()),En.setValue(j,"projectionMatrix",k.projectionMatrix),En.setValue(j,"viewMatrix",k.matrixWorldInverse);const ra=En.map.cameraPosition;ra!==void 0&&ra.setValue(j,Dt.setFromMatrixPosition(k.matrixWorld)),Mt.logarithmicDepthBuffer&&En.setValue(j,"logDepthBufFC",2/(Math.log(k.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&En.setValue(j,"isOrthographic",k.isOrthographicCamera===!0),se!==k&&(se=k,wi=!0,Ki=!0)}if($e.needsLights&&(Ii.state.directionalShadowMap.length>0&&En.setValue(j,"directionalShadowMap",Ii.state.directionalShadowMap,re),Ii.state.spotShadowMap.length>0&&En.setValue(j,"spotShadowMap",Ii.state.spotShadowMap,re),Ii.state.pointShadowMap.length>0&&En.setValue(j,"pointShadowMap",Ii.state.pointShadowMap,re)),fe.isSkinnedMesh){En.setOptional(j,fe,"bindMatrix"),En.setOptional(j,fe,"bindMatrixInverse");const hi=fe.skeleton;hi&&(hi.boneTexture===null&&hi.computeBoneTexture(),En.setValue(j,"boneTexture",hi.boneTexture,re))}fe.isBatchedMesh&&(En.setOptional(j,fe,"batchingTexture"),En.setValue(j,"batchingTexture",fe._matricesTexture,re),En.setOptional(j,fe,"batchingIdTexture"),En.setValue(j,"batchingIdTexture",fe._indirectTexture,re),En.setOptional(j,fe,"batchingColorTexture"),fe._colorsTexture!==null&&En.setValue(j,"batchingColorTexture",fe._colorsTexture,re));const $i=ge.morphAttributes;if(($i.position!==void 0||$i.normal!==void 0||$i.color!==void 0)&&ct.update(fe,ge,Oi),(wi||$e.receiveShadow!==fe.receiveShadow)&&($e.receiveShadow=fe.receiveShadow,En.setValue(j,"receiveShadow",fe.receiveShadow)),(de.isMeshStandardMaterial||de.isMeshLambertMaterial||de.isMeshPhongMaterial)&&de.envMap===null&&ie.environment!==null&&(ai.envMapIntensity.value=ie.environmentIntensity),ai.dfgLUT!==void 0&&(ai.dfgLUT.value=CI()),wi&&(En.setValue(j,"toneMappingExposure",P.toneMappingExposure),$e.needsLights&&La(ai,Ki),je&&de.fog===!0&&St.refreshFogUniforms(ai,je),St.refreshMaterialUniforms(ai,de,Ee,ee,V.state.transmissionRenderTarget[k.id]),uv.upload(j,Na($e),ai,re)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(uv.upload(j,Na($e),ai,re),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&En.setValue(j,"center",fe.center),En.setValue(j,"modelViewMatrix",fe.modelViewMatrix),En.setValue(j,"normalMatrix",fe.normalMatrix),En.setValue(j,"modelMatrix",fe.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const hi=de.uniformsGroups;for(let ra=0,Wa=hi.length;ra0&&re.useMultisampledRTT(k)===!1?de=O.get(k).__webglMultisampledFramebuffer:Array.isArray(_t)?de=_t[ge]:de=_t,q.copy(k.viewport),Z.copy(k.scissor),ye=k.scissorTest}else q.copy(ce).multiplyScalar(Ee).floor(),Z.copy(Ce).multiplyScalar(Ee).floor(),ye=Be;if(ge!==0&&(de=Tr),Xe.bindFramebuffer(j.FRAMEBUFFER,de)&&Xe.drawBuffers(k,de),Xe.viewport(q),Xe.scissor(Z),Xe.setScissorTest(ye),fe){const it=O.get(k.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+ie,it.__webglTexture,ge)}else if(je){const it=ie;for(let Ke=0;Ke1&&j.readBuffer(j.COLOR_ATTACHMENT0+it),!Mt.textureFormatReadable(Ut)){Tt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Mt.textureTypeReadable(Ht)){Tt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie>=0&&ie<=k.width-de&&ge>=0&&ge<=k.height-fe&&j.readPixels(ie,ge,de,fe,Ze.convert(Ut),Ze.convert(Ht),je)}finally{const _t=$!==null?O.get($).__webglFramebuffer:null;Xe.bindFramebuffer(j.FRAMEBUFFER,_t)}}},this.readRenderTargetPixelsAsync=async function(k,ie,ge,de,fe,je,tt,it=0){if(!(k&&k.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ke=O.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&tt!==void 0&&(Ke=Ke[tt]),Ke)if(ie>=0&&ie<=k.width-de&&ge>=0&&ge<=k.height-fe){Xe.bindFramebuffer(j.FRAMEBUFFER,Ke);const _t=k.textures[it],Ut=_t.format,Ht=_t.type;if(k.textures.length>1&&j.readBuffer(j.COLOR_ATTACHMENT0+it),!Mt.textureFormatReadable(Ut))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Mt.textureTypeReadable(Ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const mt=j.createBuffer();j.bindBuffer(j.PIXEL_PACK_BUFFER,mt),j.bufferData(j.PIXEL_PACK_BUFFER,je.byteLength,j.STREAM_READ),j.readPixels(ie,ge,de,fe,Ze.convert(Ut),Ze.convert(Ht),0);const Qt=$!==null?O.get($).__webglFramebuffer:null;Xe.bindFramebuffer(j.FRAMEBUFFER,Qt);const Pn=j.fenceSync(j.SYNC_GPU_COMMANDS_COMPLETE,0);return j.flush(),await Fw(j,Pn,4),j.bindBuffer(j.PIXEL_PACK_BUFFER,mt),j.getBufferSubData(j.PIXEL_PACK_BUFFER,0,je),j.deleteBuffer(mt),j.deleteSync(Pn),je}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(k,ie=null,ge=0){const de=Math.pow(2,-ge),fe=Math.floor(k.image.width*de),je=Math.floor(k.image.height*de),tt=ie!==null?ie.x:0,it=ie!==null?ie.y:0;re.setTexture2D(k,0),j.copyTexSubImage2D(j.TEXTURE_2D,ge,0,0,tt,it,fe,je),Xe.unbindTexture()};const Ar=j.createFramebuffer(),$r=j.createFramebuffer();this.copyTextureToTexture=function(k,ie,ge=null,de=null,fe=0,je=0){let tt,it,Ke,_t,Ut,Ht,mt,Qt,Pn;const zn=k.isCompressedTexture?k.mipmaps[je]:k.image;if(ge!==null)tt=ge.max.x-ge.min.x,it=ge.max.y-ge.min.y,Ke=ge.isBox3?ge.max.z-ge.min.z:1,_t=ge.min.x,Ut=ge.min.y,Ht=ge.isBox3?ge.min.z:0;else{const ai=Math.pow(2,-fe);tt=Math.floor(zn.width*ai),it=Math.floor(zn.height*ai),k.isDataArrayTexture?Ke=zn.depth:k.isData3DTexture?Ke=Math.floor(zn.depth*ai):Ke=1,_t=0,Ut=0,Ht=0}de!==null?(mt=de.x,Qt=de.y,Pn=de.z):(mt=0,Qt=0,Pn=0);const yn=Ze.convert(ie.format),bn=Ze.convert(ie.type);let $e;ie.isData3DTexture?(re.setTexture3D(ie,0),$e=j.TEXTURE_3D):ie.isDataArrayTexture||ie.isCompressedArrayTexture?(re.setTexture2DArray(ie,0),$e=j.TEXTURE_2D_ARRAY):(re.setTexture2D(ie,0),$e=j.TEXTURE_2D),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,ie.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,ie.unpackAlignment);const Ii=j.getParameter(j.UNPACK_ROW_LENGTH),It=j.getParameter(j.UNPACK_IMAGE_HEIGHT),Oi=j.getParameter(j.UNPACK_SKIP_PIXELS),os=j.getParameter(j.UNPACK_SKIP_ROWS),wi=j.getParameter(j.UNPACK_SKIP_IMAGES);j.pixelStorei(j.UNPACK_ROW_LENGTH,zn.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,zn.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,_t),j.pixelStorei(j.UNPACK_SKIP_ROWS,Ut),j.pixelStorei(j.UNPACK_SKIP_IMAGES,Ht);const Ki=k.isDataArrayTexture||k.isData3DTexture,En=ie.isDataArrayTexture||ie.isData3DTexture;if(k.isDepthTexture){const ai=O.get(k),$i=O.get(ie),hi=O.get(ai.__renderTarget),ra=O.get($i.__renderTarget);Xe.bindFramebuffer(j.READ_FRAMEBUFFER,hi.__webglFramebuffer),Xe.bindFramebuffer(j.DRAW_FRAMEBUFFER,ra.__webglFramebuffer);for(let Wa=0;Wa"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:d;return Ex.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:_,Ex}var b1;function NI(){return b1||(b1=1,Mx.exports=DI()),Mx.exports}var M1;function LI(){if(M1)return bx;M1=1;var o=Sm(),e=NI();function t(g,_){return g===_&&(g!==0||1/g===1/_)||g!==g&&_!==_}var i=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,u=o.useRef,f=o.useEffect,d=o.useMemo,m=o.useDebugValue;return bx.useSyncExternalStoreWithSelector=function(g,_,S,x,M){var T=u(null);if(T.current===null){var D={hasValue:!1,value:null};T.current=D}else D=T.current;T=d(function(){function A(z){if(!R){if(R=!0,L=z,z=x(z),M!==void 0&&D.hasValue){var H=D.value;if(M(H,z))return I=H}return I=z}if(H=I,i(L,z))return H;var U=x(z);return M!==void 0&&M(H,U)?(L=z,H):(L=z,I=U)}var R=!1,L,I,V=S===void 0?null:S;return[function(){return A(_())},V===null?void 0:function(){return A(V())}]},[_,S,x,M]);var w=a(g,T[0],T[1]);return f(function(){D.hasValue=!0,D.value=w},[w]),m(w),w},bx}var E1;function UI(){return E1||(E1=1,Sx.exports=LI()),Sx.exports}var II=UI();const OI=iS(II),T1=o=>{let e;const t=new Set,i=(g,_)=>{const S=typeof g=="function"?g(e):g;if(!Object.is(S,e)){const x=e;e=_??(typeof S!="object"||S===null)?S:Object.assign({},e,S),t.forEach(M=>M(e,x))}},a=()=>e,d={setState:i,getState:a,getInitialState:()=>m,subscribe:g=>(t.add(g),()=>t.delete(g))},m=e=o(i,a,d);return d},PI=(o=>o?T1(o):T1),{useSyncExternalStoreWithSelector:zI}=OI,BI=o=>o;function FI(o,e=BI,t){const i=zI(o.subscribe,o.getState,o.getInitialState,e,t);return V1.useDebugValue(i),i}const A1=(o,e)=>{const t=PI(o),i=(a,u=e)=>FI(t,a,u);return Object.assign(i,t),i},VI=((o,e)=>o?A1(o,e):A1),kI=o=>typeof o=="object"&&typeof o.then=="function",qc=[];function zT(o,e,t=(i,a)=>i===a){if(o===e)return!0;if(!o||!e)return!1;const i=o.length;if(e.length!==i)return!1;for(let a=0;a0&&(u.timeout&&clearTimeout(u.timeout),u.timeout=setTimeout(u.remove,i.lifespan)),u.response;if(!t)throw u.promise}const a={keys:e,equal:i.equal,remove:()=>{const u=qc.indexOf(a);u!==-1&&qc.splice(u,1)},promise:(kI(o)?o:o(...e)).then(u=>{a.response=u,i.lifespan&&i.lifespan>0&&(a.timeout=setTimeout(a.remove,i.lifespan))}).catch(u=>a.error=u)};if(qc.push(a),!t)throw a.promise}const HI=(o,e,t)=>BT(o,e,!1,t),GI=(o,e,t)=>{BT(o,e,!0,t)},WI=o=>{if(o===void 0||o.length===0)qc.splice(0,qc.length);else{const e=qc.find(t=>zT(o,t.keys,t.equal));e&&e.remove()}};var Qx=k1();const XI=iS(Qx);function ZS(o,e,t){if(!o)return;if(t(o)===!0)return o;let i=e?o.return:o.child;for(;i;){const a=ZS(i,e,t);if(a)return a;i=e?null:i.sibling}}function FT(o){try{return Object.defineProperties(o,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return o}}const QS=FT(Bt.createContext(null));class VT extends Bt.Component{render(){return Bt.createElement(QS.Provider,{value:this._reactInternals},this.props.children)}}function kT(){const o=Bt.useContext(QS);if(o===null)throw new Error("its-fine: useFiber must be called within a !");const e=Bt.useId();return Bt.useMemo(()=>{for(const t of[o,o?.alternate]){if(!t)continue;const i=ZS(t,!1,a=>{let u=a.memoizedState;for(;u;){if(u.memoizedState===e)return!0;u=u.next}});if(i)return i}},[o,e])}const qI=Symbol.for("react.context"),YI=o=>o!==null&&typeof o=="object"&&"$$typeof"in o&&o.$$typeof===qI;function jI(){const o=kT(),[e]=Bt.useState(()=>new Map);e.clear();let t=o;for(;t;){const i=t.type;YI(i)&&i!==QS&&!e.has(i)&&e.set(i,Bt.use(FT(i))),t=t.return}return e}function ZI(){const o=jI();return Bt.useMemo(()=>Array.from(o.keys()).reduce((e,t)=>i=>Bt.createElement(e,null,Bt.createElement(t.Provider,{...i,value:o.get(t)})),e=>Bt.createElement(VT,{...e})),[o])}function HT(o){let e=o.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const GT=o=>o&&o.isOrthographicCamera,QI=o=>o&&o.hasOwnProperty("current"),JI=o=>o!=null&&(typeof o=="string"||typeof o=="number"||o.isColor),Wy=((o,e)=>typeof window<"u"&&(((o=window.document)==null?void 0:o.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?Bt.useLayoutEffect:Bt.useEffect;function KI(o){const e=Bt.useRef(o);return Wy(()=>{e.current=o},[o]),e}function $I(){const o=kT(),e=ZI();return Bt.useMemo(()=>({children:t})=>{const a=!!ZS(o,!0,u=>u.type===Bt.StrictMode)?Bt.StrictMode:Bt.Fragment;return Gt.jsx(a,{children:Gt.jsx(e,{children:t})})},[o,e])}function eO({set:o}){return Wy(()=>(o(new Promise(()=>null)),()=>o(!1)),[o]),null}const tO=(o=>(o=class extends Bt.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},o.getDerivedStateFromError=()=>({error:!0}),o))();function WT(o){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(o)?Math.min(Math.max(o[0],t),o[1]):o}function Uh(o){var e;return(e=o.__r3f)==null?void 0:e.root.getState()}const ci={obj:o=>o===Object(o)&&!ci.arr(o)&&typeof o!="function",fun:o=>typeof o=="function",str:o=>typeof o=="string",num:o=>typeof o=="number",boo:o=>typeof o=="boolean",und:o=>o===void 0,nul:o=>o===null,arr:o=>Array.isArray(o),equ(o,e,{arrays:t="shallow",objects:i="reference",strict:a=!0}={}){if(typeof o!=typeof e||!!o!=!!e)return!1;if(ci.str(o)||ci.num(o)||ci.boo(o))return o===e;const u=ci.obj(o);if(u&&i==="reference")return o===e;const f=ci.arr(o);if(f&&t==="reference")return o===e;if((f||u)&&o===e)return!0;let d;for(d in o)if(!(d in e))return!1;if(u&&t==="shallow"&&i==="shallow"){for(d in a?e:o)if(!ci.equ(o[d],e[d],{strict:a,objects:"reference"}))return!1}else for(d in a?e:o)if(o[d]!==e[d])return!1;if(ci.und(d)){if(f&&o.length===0&&e.length===0||u&&Object.keys(o).length===0&&Object.keys(e).length===0)return!0;if(o!==e)return!1}return!0}};function nO(o){const e={nodes:{},materials:{},meshes:{}};return o&&o.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 iO(o){o.type!=="Scene"&&(o.dispose==null||o.dispose());for(const e in o){const t=o[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const XT=["children","key","ref"];function sO(o){const e={};for(const t in o)XT.includes(t)||(e[t]=o[t]);return e}function iy(o,e,t,i){const a=o;let u=a?.__r3f;return u||(u={root:e,type:t,parent:null,children:[],props:sO(i),object:a,eventCount:0,handlers:{},isHidden:!1},a&&(a.__r3f=u)),u}function xm(o,e){if(!e.includes("-"))return{root:o,key:e,target:o[e]};if(e in o)return{root:o,key:e,target:o[e]};let t=o;const i=e.split("-");for(const a of i){if(typeof t!="object"||t===null){if(t!==void 0){const u=i.slice(i.indexOf(a)).join("-");return{root:t,key:u,target:void 0}}return{root:o,key:e,target:void 0}}e=a,o=t,t=t[e]}return{root:o,key:e,target:t}}const w1=/-\d+$/;function sy(o,e){if(ci.str(e.props.attach)){if(w1.test(e.props.attach)){const a=e.props.attach.replace(w1,""),{root:u,key:f}=xm(o.object,a);Array.isArray(u[f])||(u[f]=[])}const{root:t,key:i}=xm(o.object,e.props.attach);e.previousAttach=t[i],t[i]=e.object}else ci.fun(e.props.attach)&&(e.previousAttach=e.props.attach(o.object,e.object))}function ay(o,e){if(ci.str(e.props.attach)){const{root:t,key:i}=xm(o.object,e.props.attach),a=e.previousAttach;a===void 0?delete t[i]:t[i]=a}else e.previousAttach==null||e.previousAttach(o.object,e.object);delete e.previousAttach}const Jx=[...XT,"args","dispose","attach","object","onUpdate","dispose"],C1=new Map;function aO(o){let e=C1.get(o.constructor);try{e||(e=new o.constructor,C1.set(o.constructor,e))}catch{}return e}function rO(o,e){const t={};for(const i in e)if(!Jx.includes(i)&&!ci.equ(e[i],o.props[i])){t[i]=e[i];for(const a in e)a.startsWith(`${i}-`)&&(t[a]=e[a])}for(const i in o.props){if(Jx.includes(i)||e.hasOwnProperty(i))continue;const{root:a,key:u}=xm(o.object,i);if(a.constructor&&a.constructor.length===0){const f=aO(a);ci.und(f)||(t[u]=f[u])}else t[u]=0}return t}const oO=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],lO=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function Cu(o,e){var t;const i=o.__r3f,a=i&&HT(i).getState(),u=i?.eventCount;for(const d in e){let m=e[d];if(Jx.includes(d))continue;if(i&&lO.test(d)){typeof m=="function"?i.handlers[d]=m:delete i.handlers[d],i.eventCount=Object.keys(i.handlers).length;continue}if(m===void 0)continue;let{root:g,key:_,target:S}=xm(o,d);if(S===void 0&&(typeof g!="object"||g===null))throw Error(`R3F: Cannot set "${d}". Ensure it is an object before setting "${_}".`);if(S instanceof Wh&&m instanceof Wh)S.mask=m.mask;else if(S instanceof pt&&JI(m))S.set(m);else if(S!==null&&typeof S=="object"&&typeof S.set=="function"&&typeof S.copy=="function"&&m!=null&&m.constructor&&S.constructor===m.constructor)S.copy(m);else if(S!==null&&typeof S=="object"&&typeof S.set=="function"&&Array.isArray(m))typeof S.fromArray=="function"?S.fromArray(m):S.set(...m);else if(S!==null&&typeof S=="object"&&typeof S.set=="function"&&typeof m=="number")typeof S.setScalar=="function"?S.setScalar(m):S.set(m);else{var f;g[_]=m,a&&!a.linear&&oO.includes(_)&&(f=g[_])!=null&&f.isTexture&&g[_].format===Os&&g[_].type===Js&&(g[_].colorSpace=Is)}}if(i!=null&&i.parent&&a!=null&&a.internal&&(t=i.object)!=null&&t.isObject3D&&u!==i.eventCount){const d=i.object,m=a.internal.interaction.indexOf(d);m>-1&&a.internal.interaction.splice(m,1),i.eventCount&&d.raycast!==null&&a.internal.interaction.push(d)}return i&&i.props.attach===void 0&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&id(i),o}function id(o){var e;if(!o.parent)return;o.props.onUpdate==null||o.props.onUpdate(o.object);const t=(e=o.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function uO(o,e){o.manual||(GT(o)?(o.left=e.width/-2,o.right=e.width/2,o.top=e.height/2,o.bottom=e.height/-2):o.aspect=e.width/e.height,o.updateProjectionMatrix())}const Qs=o=>o?.isObject3D;function av(o){return(o.eventObject||o.object).uuid+"/"+o.index+o.instanceId}function qT(o,e,t,i){const a=t.get(e);a&&(t.delete(e),t.size===0&&(o.delete(i),a.target.releasePointerCapture(i)))}function cO(o,e){const{internal:t}=o.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)=>{qT(t.capturedMap,e,i,a)})}function fO(o){function e(m){const{internal:g}=o.getState(),_=m.offsetX-g.initialClick[0],S=m.offsetY-g.initialClick[1];return Math.round(Math.sqrt(_*_+S*S))}function t(m){return m.filter(g=>["Move","Over","Enter","Out","Leave"].some(_=>{var S;return(S=g.__r3f)==null?void 0:S.handlers["onPointer"+_]}))}function i(m,g){const _=o.getState(),S=new Set,x=[],M=g?g(_.internal.interaction):_.internal.interaction;for(let A=0;A{const L=Uh(A.object),I=Uh(R.object);return!L||!I?A.distance-R.distance:I.events.priority-L.events.priority||A.distance-R.distance}).filter(A=>{const R=av(A);return S.has(R)?!1:(S.add(R),!0)});_.events.filter&&(D=_.events.filter(D,_));for(const A of D){let R=A.object;for(;R;){var w;(w=R.__r3f)!=null&&w.eventCount&&x.push({...A,eventObject:R}),R=R.parent}}if("pointerId"in m&&_.internal.capturedMap.has(m.pointerId))for(let A of _.internal.capturedMap.get(m.pointerId).values())S.has(av(A.intersection))||x.push(A.intersection);return x}function a(m,g,_,S){if(m.length){const x={stopped:!1};for(const M of m){let T=Uh(M.object);if(T||M.object.traverseAncestors(D=>{const w=Uh(D);if(w)return T=w,!1}),T){const{raycaster:D,pointer:w,camera:A,internal:R}=T,L=new Y(w.x,w.y,0).unproject(A),I=P=>{var Q,X;return(Q=(X=R.capturedMap.get(P))==null?void 0:X.has(M.eventObject))!=null?Q:!1},V=P=>{const Q={intersection:M,target:g.target};R.capturedMap.has(P)?R.capturedMap.get(P).set(M.eventObject,Q):R.capturedMap.set(P,new Map([[M.eventObject,Q]])),g.target.setPointerCapture(P)},z=P=>{const Q=R.capturedMap.get(P);Q&&qT(R.capturedMap,M.eventObject,Q,P)};let H={};for(let P in g){let Q=g[P];typeof Q!="function"&&(H[P]=Q)}let U={...M,...H,pointer:w,intersections:m,stopped:x.stopped,delta:_,unprojectedPoint:L,ray:D.ray,camera:A,stopPropagation(){const P="pointerId"in g&&R.capturedMap.get(g.pointerId);if((!P||P.has(M.eventObject))&&(U.stopped=x.stopped=!0,R.hovered.size&&Array.from(R.hovered.values()).find(Q=>Q.eventObject===M.eventObject))){const Q=m.slice(0,m.indexOf(M));u([...Q,M])}},target:{hasPointerCapture:I,setPointerCapture:V,releasePointerCapture:z},currentTarget:{hasPointerCapture:I,setPointerCapture:V,releasePointerCapture:z},nativeEvent:g};if(S(U),x.stopped===!0)break}}}return m}function u(m){const{internal:g}=o.getState();for(const _ of g.hovered.values())if(!m.length||!m.find(S=>S.object===_.object&&S.index===_.index&&S.instanceId===_.instanceId)){const x=_.eventObject.__r3f;if(g.hovered.delete(av(_)),x!=null&&x.eventCount){const M=x.handlers,T={..._,intersections:m};M.onPointerOut==null||M.onPointerOut(T),M.onPointerLeave==null||M.onPointerLeave(T)}}}function f(m,g){for(let _=0;_u([]);case"onLostPointerCapture":return g=>{const{internal:_}=o.getState();"pointerId"in g&&_.capturedMap.has(g.pointerId)&&requestAnimationFrame(()=>{_.capturedMap.has(g.pointerId)&&(_.capturedMap.delete(g.pointerId),u([]))})}}return function(_){const{onPointerMissed:S,internal:x}=o.getState();x.lastEvent.current=_;const M=m==="onPointerMove",T=m==="onClick"||m==="onContextMenu"||m==="onDoubleClick",w=i(_,M?t:void 0),A=T?e(_):0;m==="onPointerDown"&&(x.initialClick=[_.offsetX,_.offsetY],x.initialHits=w.map(L=>L.eventObject)),T&&!w.length&&A<=2&&(f(_,x.interaction),S&&S(_)),M&&u(w);function R(L){const I=L.eventObject,V=I.__r3f;if(!(V!=null&&V.eventCount))return;const z=V.handlers;if(M){if(z.onPointerOver||z.onPointerEnter||z.onPointerOut||z.onPointerLeave){const H=av(L),U=x.hovered.get(H);U?U.stopped&&L.stopPropagation():(x.hovered.set(H,L),z.onPointerOver==null||z.onPointerOver(L),z.onPointerEnter==null||z.onPointerEnter(L))}z.onPointerMove==null||z.onPointerMove(L)}else{const H=z[m];H?(!T||x.initialHits.includes(I))&&(f(_,x.interaction.filter(U=>!x.initialHits.includes(U))),H(L)):T&&x.initialHits.includes(I)&&f(_,x.interaction.filter(U=>!x.initialHits.includes(U)))}}a(w,_,A,R)}}return{handlePointer:d}}const R1=o=>!!(o!=null&&o.render),hO=Bt.createContext(null),dO=(o,e)=>{const t=VI((d,m)=>{const g=new Y,_=new Y,S=new Y;function x(A=m().camera,R=_,L=m().size){const{width:I,height:V,top:z,left:H}=L,U=I/V;R.isVector3?S.copy(R):S.set(...R);const P=A.getWorldPosition(g).distanceTo(S);if(GT(A))return{width:I/A.zoom,height:V/A.zoom,top:z,left:H,factor:1,distance:P,aspect:U};{const Q=A.fov*Math.PI/180,X=2*Math.tan(Q/2)*P,te=X*(I/V);return{width:te,height:X,top:z,left:H,factor:I/te,distance:P,aspect:U}}}let M;const T=A=>d(R=>({performance:{...R.performance,current:A}})),D=new ze;return{set:d,get:m,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(A=1)=>o(m(),A),advance:(A,R)=>e(A,R,m()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new CT,pointer:D,mouse:D,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const A=m();M&&clearTimeout(M),A.performance.current!==A.performance.min&&T(A.performance.min),M=setTimeout(()=>T(m().performance.max),A.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:x},setEvents:A=>d(R=>({...R,events:{...R.events,...A}})),setSize:(A,R,L=0,I=0)=>{const V=m().camera,z={width:A,height:R,top:L,left:I};d(H=>({size:z,viewport:{...H.viewport,...x(V,_,z)}}))},setDpr:A=>d(R=>{const L=WT(A);return{viewport:{...R.viewport,dpr:L,initialDpr:R.viewport.initialDpr||L}}}),setFrameloop:(A="always")=>{const R=m().clock;R.stop(),R.elapsedTime=0,A!=="never"&&(R.start(),R.elapsedTime=0),d(()=>({frameloop:A}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:Bt.createRef(),active:!1,frames:0,priority:0,subscribe:(A,R,L)=>{const I=m().internal;return I.priority=I.priority+(R>0?1:0),I.subscribers.push({ref:A,priority:R,store:L}),I.subscribers=I.subscribers.sort((V,z)=>V.priority-z.priority),()=>{const V=m().internal;V!=null&&V.subscribers&&(V.priority=V.priority-(R>0?1:0),V.subscribers=V.subscribers.filter(z=>z.ref!==A))}}}}}),i=t.getState();let a=i.size,u=i.viewport.dpr,f=i.camera;return t.subscribe(()=>{const{camera:d,size:m,viewport:g,gl:_,set:S}=t.getState();if(m.width!==a.width||m.height!==a.height||g.dpr!==u){a=m,u=g.dpr,uO(d,m),g.dpr>0&&_.setPixelRatio(g.dpr);const x=typeof HTMLCanvasElement<"u"&&_.domElement instanceof HTMLCanvasElement;_.setSize(m.width,m.height,x)}d!==f&&(f=d,S(x=>({viewport:{...x.viewport,...x.viewport.getCurrentViewport(d)}})))}),t.subscribe(d=>o(d)),t},D1=new WeakMap,pO=o=>{var e;return typeof o=="function"&&(o==null||(e=o.prototype)==null?void 0:e.constructor)===o};function YT(o,e){return function(t,...i){let a;return pO(t)?(a=D1.get(t),a||(a=new t,D1.set(t,a))):a=t,o&&o(a),Promise.all(i.map(u=>new Promise((f,d)=>a.load(u,m=>{Qs(m?.scene)&&Object.assign(m,nO(m.scene)),f(m)},e,m=>d(new Error(`Could not load ${u}: ${m?.message}`))))))}}function JS(o,e,t,i){const a=Array.isArray(e)?e:[e],u=HI(YT(t,i),[o,...a],{equal:ci.equ});return Array.isArray(e)?u:u[0]}JS.preload=function(o,e,t){const i=Array.isArray(e)?e:[e];return GI(YT(t),[o,...i])};JS.clear=function(o,e){const t=Array.isArray(e)?e:[e];return WI([o,...t])};const mO=1,gO=8,vO=32,yO=2;var _O={version:"9.5.0"};function xO(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var N1={exports:{}},L1={exports:{}},U1;function SO(){return U1||(U1=1,(function(o){o.exports=function(e){function t(r,l,p,v){return new Cd(r,l,p,v)}function i(){}function a(r){var l="https://react.dev/errors/"+r;if(1ol||(r.current=jf[ol],jf[ol]=null,ol--)}function T(r,l){ol++,jf[ol]=r.current,r.current=l}function D(r){return r>>>=0,r===0?32:31-(Zf(r)/qg|0)|0}function w(r){var l=r&42;if(l!==0)return l;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function A(r,l,p){var v=r.pendingLanes;if(v===0)return 0;var E=0,C=r.suspendedLanes,B=r.pingedLanes;r=r.warmLanes;var K=v&134217727;return K!==0?(v=K&~C,v!==0?E=w(v):(B&=K,B!==0?E=w(B):p||(p=K&~r,p!==0&&(E=w(p))))):(K=v&~C,K!==0?E=w(K):B!==0?E=w(B):p||(p=v&~r,p!==0&&(E=w(p)))),E===0?0:l!==0&&l!==E&&(l&C)===0&&(C=E&-E,p=l&-l,C>=p||C===32&&(p&4194048)!==0)?l:E}function R(r,l){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&l)===0}function L(r,l){switch(r){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 I(){var r=iu;return iu<<=1,(iu&62914560)===0&&(iu=4194304),r}function V(r){for(var l=[],p=0;31>p;p++)l.push(r);return l}function z(r,l){r.pendingLanes|=l,l!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function H(r,l,p,v,E,C){var B=r.pendingLanes;r.pendingLanes=p,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=p,r.entangledLanes&=p,r.errorRecoveryDisabledLanes&=p,r.shellSuspendCounter=0;var K=r.entanglements,Se=r.expirationTimes,Pe=r.hiddenUpdates;for(p=B&~p;0)":-1E||Se[v]!==Pe[E]){var Qe=` -`+Se[v].replace(" at new "," at ");return r.displayName&&Qe.includes("")&&(Qe=Qe.replace("",r.displayName)),Qe}while(1<=v&&0<=E);break}}}finally{gc=!1,Error.prepareStackTrace=p}return(p=r?r.displayName||r.name:"")?se(p):""}function Z(r,l){switch(r.tag){case 26:case 27:case 5:return se(r.type);case 16:return se("Lazy");case 13:return r.child!==l&&l!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return q(r.type,!1);case 11:return q(r.type.render,!1);case 1:return q(r.type,!0);case 31:return se("Activity");default:return""}}function ye(r){try{var l="",p=null;do l+=Z(r,p),p=r,r=r.return;while(r);return l}catch(v){return` -Error generating stack: `+v.message+` -`+v.stack}}function _e(r,l){if(typeof r=="object"&&r!==null){var p=pp.get(r);return p!==void 0?p:(l={value:r,source:l,stack:ye(l)},pp.set(r,l),l)}return{value:r,source:l,stack:ye(l)}}function Ue(r,l){Br[rr++]=vc,Br[rr++]=In,In=r,vc=l}function W(r,l,p){ga[Gs++]=Xi,ga[Gs++]=Ia,ga[Gs++]=va,va=r;var v=Xi;r=Ia;var E=32-Ts(v)-1;v&=~(1<>=B,E-=B,Xi=1<<32-Ts(l)+E|p<_n?(ki=Lt,Lt=null):ki=Lt.sibling;var Tn=ht(me,Lt,xe[_n],Ye);if(Tn===null){Lt===null&&(Lt=ki);break}r&&Lt&&Tn.alternate===null&&l(me,Lt),le=C(Tn,le,_n),ii===null?Nt=Tn:ii.sibling=Tn,ii=Tn,Lt=ki}if(_n===xe.length)return p(me,Lt),cn&&Ue(me,_n),Nt;if(Lt===null){for(;_n_n?(ki=Lt,Lt=null):ki=Lt.sibling;var Ea=ht(me,Lt,Tn.value,Ye);if(Ea===null){Lt===null&&(Lt=ki);break}r&&Lt&&Ea.alternate===null&&l(me,Lt),le=C(Ea,le,_n),ii===null?Nt=Ea:ii.sibling=Ea,ii=Ea,Lt=ki}if(Tn.done)return p(me,Lt),cn&&Ue(me,_n),Nt;if(Lt===null){for(;!Tn.done;_n++,Tn=xe.next())Tn=Ge(me,Tn.value,Ye),Tn!==null&&(le=C(Tn,le,_n),ii===null?Nt=Tn:ii.sibling=Tn,ii=Tn);return cn&&Ue(me,_n),Nt}for(Lt=v(Lt);!Tn.done;_n++,Tn=xe.next())Tn=Wt(Lt,me,_n,Tn.value,Ye),Tn!==null&&(r&&Tn.alternate!==null&&Lt.delete(Tn.key===null?_n:Tn.key),le=C(Tn,le,_n),ii===null?Nt=Tn:ii.sibling=Tn,ii=Tn);return r&&Lt.forEach(function(s_){return l(me,s_)}),cn&&Ue(me,_n),Nt}function Co(me,le,xe,Ye){if(typeof xe=="object"&&xe!==null&&xe.type===el&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case ir:e:{for(var Nt=xe.key;le!==null;){if(le.key===Nt){if(Nt=xe.type,Nt===el){if(le.tag===7){p(me,le.sibling),Ye=E(le,xe.props.children),Ye.return=me,me=Ye;break e}}else if(le.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===fs&&pn(Nt)===le.type){p(me,le.sibling),Ye=E(le,xe.props),xr(Ye,xe),Ye.return=me,me=Ye;break e}p(me,le);break}else l(me,le);le=le.sibling}xe.type===el?(Ye=ha(xe.props.children,me.mode,Ye,xe.key),Ye.return=me,me=Ye):(Ye=Ur(xe.type,xe.key,xe.props,null,me.mode,Ye),xr(Ye,xe),Ye.return=me,me=Ye)}return B(me);case $o:e:{for(Nt=xe.key;le!==null;){if(le.key===Nt)if(le.tag===4&&le.stateNode.containerInfo===xe.containerInfo&&le.stateNode.implementation===xe.implementation){p(me,le.sibling),Ye=E(le,xe.children||[]),Ye.return=me,me=Ye;break e}else{p(me,le);break}else l(me,le);le=le.sibling}Ye=Nd(xe,me.mode,Ye),Ye.return=me,me=Ye}return B(me);case fs:return xe=pn(xe),Co(me,le,xe,Ye)}if(po(xe))return yi(me,le,xe,Ye);if(_(xe)){if(Nt=_(xe),typeof Nt!="function")throw Error(a(150));return xe=Nt.call(xe),hu(me,le,xe,Ye)}if(typeof xe.then=="function")return Co(me,le,_s(xe),Ye);if(xe.$$typeof===da)return Co(me,le,O(me,xe),Ye);Sr(me,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,le!==null&&le.tag===6?(p(me,le.sibling),Ye=E(le,xe),Ye.return=me,me=Ye):(p(me,le),Ye=Rd(xe,me.mode,Ye),Ye.return=me,me=Ye),B(me)):p(me,le)}return function(me,le,xe,Ye){try{cl=0;var Nt=Co(me,le,xe,Ye);return xo=null,Nt}catch(Lt){if(Lt===Li||Lt===Sa)throw Lt;var ii=t(29,Lt,null,me.mode);return ii.lanes=Ye,ii.return=me,ii}}}function br(){for(var r=ur,l=fl=ur=0;lC?C:8);var B=Ct.T,K={};Ct.T=K,hf(r,!1,l,p);try{var Se=E(),Pe=Ct.S;if(Pe!==null&&Pe(K,Se),Se!==null&&typeof Se=="object"&&typeof Se.then=="function"){var Qe=Ze(Se,v);qu(r,l,Qe,qn(r))}else qu(r,l,v,qn(r))}catch(Ge){qu(r,l,{then:function(){},status:"rejected",reason:Ge},qn())}finally{un(C),B!==null&&K.types!==null&&(B.types=K.types),Ct.T=B}}function Im(r){var l=r.memoizedState;if(l!==null)return l;l={memoizedState:sl,baseState:sl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:sl},next:null};var p={};return l.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:p},next:null},r.memoizedState=l,r=r.alternate,r!==null&&(r.memoizedState=l),l}function ud(){return G(al)}function ff(){return $e().memoizedState}function Om(){return $e().memoizedState}function qy(r){for(var l=r.return;l!==null;){switch(l.tag){case 24:case 3:var p=qn();r=rs(p);var v=Na(l,r,p);v!==null&&(Kn(v,l,p),Kr(v,l,p)),l={cache:be()},r.payload=l;return}l=l.return}}function Yy(r,l,p){var v=qn();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},df(r)?zm(l,p):(p=ia(r,l,p,v),p!==null&&(Kn(p,r,v),Bm(p,l,v)))}function Pm(r,l,p){var v=qn();qu(r,l,p,v)}function qu(r,l,p,v){var E={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(df(r))zm(l,E);else{var C=r.alternate;if(r.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var B=l.lastRenderedState,K=C(B,p);if(E.hasEagerState=!0,E.eagerState=K,mi(K,B))return Mr(r,l,E,0),tn===null&&br(),!1}catch{}if(p=ia(r,l,E,v),p!==null)return Kn(p,r,v),Bm(p,l,v),!0}return!1}function hf(r,l,p,v){if(v={lane:2,revertLane:ct(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},df(r)){if(l)throw Error(a(479))}else l=ia(r,p,v,2),l!==null&&Kn(l,r,2)}function df(r){var l=r.alternate;return r===qt||l!==null&&l===qt}function zm(r,l){Jt=en=!0;var p=r.pending;p===null?l.next=l:(l.next=p.next,p.next=l),r.pending=l}function Bm(r,l,p){if((p&4194048)!==0){var v=l.lanes;v&=r.pendingLanes,p|=v,l.lanes=p,P(r,p)}}function cd(r,l,p,v){l=r.memoizedState,p=p(v,l),p=p==null?l:Uf({},l,p),r.memoizedState=p,r.lanes===0&&(r.updateQueue.baseState=p)}function pf(r,l,p,v,E,C,B){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(v,C,B):l.prototype&&l.prototype.isPureReactComponent?!Ae(p,v)||!Ae(E,C):!0}function Fm(r,l,p,v){r=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(p,v),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(p,v),l.state!==r&&xc.enqueueReplaceState(l,l.state,null)}function Xo(r,l){var p=l;if("ref"in l){p={};for(var v in l)v!=="ref"&&(p[v]=l[v])}if(r=r.defaultProps){p===l&&(p=Uf({},p));for(var E in r)p[E]===void 0&&(p[E]=r[E])}return p}function mf(r,l){try{var p=r.onUncaughtError;p(l.value,{componentStack:l.stack})}catch(v){setTimeout(function(){throw v})}}function fd(r,l,p){try{var v=r.onCaughtError;v(p.value,{componentStack:p.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function hd(r,l,p){return p=rs(p),p.tag=3,p.payload={element:null},p.callback=function(){mf(r,l)},p}function Vm(r){return r=rs(r),r.tag=3,r}function km(r,l,p,v){var E=p.type.getDerivedStateFromError;if(typeof E=="function"){var C=v.value;r.payload=function(){return E(C)},r.callback=function(){fd(l,p,v)}}var B=p.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(r.callback=function(){fd(l,p,v),typeof E!="function"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var K=v.stack;this.componentDidCatch(v.value,{componentStack:K!==null?K:""})})}function jy(r,l,p,v,E){if(p.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(l=p.alternate,l!==null&&nt(l,p,E,!0),p=ws.current,p!==null){switch(p.tag){case 31:case 13:return Cs===null?ql():p.alternate===null&&ni===0&&(ni=3),p.flags&=-257,p.flags|=65536,p.lanes=E,v===lr?p.flags|=16384:(l=p.updateQueue,l===null?p.updateQueue=new Set([v]):l.add(v),Zl(r,v,E)),!1;case 22:return p.flags|=65536,v===lr?p.flags|=16384:(l=p.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([v])},p.updateQueue=l):(p=l.retryQueue,p===null?l.retryQueue=new Set([v]):p.add(v)),Zl(r,v,E)),!1}throw Error(a(435,p.tag))}return Zl(r,v,E),ql(),!1}if(cn)return l=ws.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=E,v!==nh&&(r=Error(a(422),{cause:v}),Ve(_e(r,p)))):(v!==nh&&(l=Error(a(423),{cause:v}),Ve(_e(l,p))),r=r.current.alternate,r.flags|=65536,E&=-E,r.lanes|=E,v=_e(v,p),E=hd(r.stateNode,v,E),Rl(r,E),ni!==4&&(ni=2)),!1;var C=Error(a(520),{cause:v});if(C=_e(C,p),bc===null?bc=[C]:bc.push(C),ni!==4&&(ni=2),l===null)return!0;v=_e(v,p),p=l;do{switch(p.tag){case 3:return p.flags|=65536,r=E&-E,p.lanes|=r,r=hd(p.stateNode,v,r),Rl(p,r),!1;case 1:if(l=p.type,C=p.stateNode,(p.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Gr===null||!Gr.has(C))))return p.flags|=65536,E&=-E,p.lanes|=E,E=Vm(E),km(E,r,p,v),Rl(p,E),!1}p=p.return}while(p!==null);return!1}function Wi(r,l,p,v){l.child=r===null?gp(l,null,p,v):Yi(l,r.child,p,v)}function Hm(r,l,p,v,E){p=p.render;var C=l.ref;if("ref"in v){var B={};for(var K in v)K!=="ref"&&(B[K]=v[K])}else B=v;return Xe(l),v=Ut(r,l,p,B,C,E),K=Pn(),r!==null&&!Wn?(zn(r,l,E),qa(r,l,E)):(cn&&K&&ee(l),l.flags|=1,Wi(r,l,v,E),l.child)}function Gm(r,l,p,v,E){if(r===null){var C=p.type;return typeof C=="function"&&!Qo(C)&&C.defaultProps===void 0&&p.compare===null?(l.tag=15,l.type=C,Wm(r,l,C,v,E)):(r=Ur(p.type,null,v,l,l.mode,E),r.ref=l.ref,r.return=l,l.child=r)}if(C=r.child,!ju(r,E)){var B=C.memoizedProps;if(p=p.compare,p=p!==null?p:Ae,p(B,v)&&r.ref===l.ref)return qa(r,l,E)}return l.flags|=1,r=ks(C,v),r.ref=l.ref,r.return=l,l.child=r}function Wm(r,l,p,v,E){if(r!==null){var C=r.memoizedProps;if(Ae(C,v)&&r.ref===l.ref)if(Wn=!1,l.pendingProps=v=C,ju(r,E))(r.flags&131072)!==0&&(Wn=!0);else return l.lanes=r.lanes,qa(r,l,E)}return vf(r,l,p,v,E)}function Xm(r,l,p,v){var E=v.children,C=r!==null?r.memoizedState:null;if(r===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((l.flags&128)!==0){if(C=C!==null?C.baseLanes|p:p,r!==null){for(v=l.child=r.child,E=0;v!==null;)E=E|v.lanes|v.childLanes,v=v.sibling;v=E&~C}else v=0,l.child=null;return Pl(r,l,C,p,v)}if((p&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},r!==null&&ut(l,C!==null?C.cachePool:null),C!==null?$r(l,C):k(),fe(l);else return v=l.lanes=536870912,Pl(r,l,C!==null?C.baseLanes|p:p,p,v)}else C!==null?(ut(l,C.cachePool),$r(l,C),je(),l.memoizedState=null):(r!==null&&ut(l,null),k(),je());return Wi(r,l,E,p),l.child}function qo(r,l){return r!==null&&r.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function Pl(r,l,p,v,E){var C=We();return C=C===null?null:{parent:di?Zn._currentValue:Zn._currentValue2,pool:C},l.memoizedState={baseLanes:p,cachePool:C},r!==null&&ut(l,null),k(),fe(l),r!==null&&nt(r,l,v,!0),l.childLanes=E,null}function gf(r,l){return l=no({mode:l.mode,children:l.children},r.mode),l.ref=r.ref,r.child=l,l.return=r,l}function dd(r,l,p){return Yi(l,r.child,null,p),r=gf(l,l.pendingProps),r.flags|=2,tt(l),l.memoizedState=null,r}function qm(r,l,p){var v=l.pendingProps,E=(l.flags&128)!==0;if(l.flags&=-129,r===null){if(cn){if(v.mode==="hidden")return r=gf(l,v),l.lanes=536870912,qo(null,r);if(de(l),(r=jn)?(r=ep(r,ds),r!==null&&(l.memoizedState={dehydrated:r,treeContext:va!==null?{id:Xi,overflow:Ia}:null,retryLane:536870912,hydrationErrors:null},p=Dd(r),p.return=l,l.child=p,Di=l,jn=null)):r=null,r===null)throw et(l);return l.lanes=536870912,null}return gf(l,v)}var C=r.memoizedState;if(C!==null){var B=C.dehydrated;if(de(l),E)if(l.flags&256)l.flags&=-257,l=dd(r,l,p);else if(l.memoizedState!==null)l.child=r.child,l.flags|=128,l=null;else throw Error(a(558));else if(Wn||nt(r,l,p,!1),E=(p&r.childLanes)!==0,Wn||E){if(v=tn,v!==null&&(B=Q(v,p),B!==0&&B!==C.retryLane))throw C.retryLane=B,sa(r,B),Kn(v,r,B),ms;ql(),l=dd(r,l,p)}else r=C.treeContext,Yn&&(jn=Rg(B),Di=l,cn=!0,or=null,ds=!1,r!==null&&Oe(l,r)),l=gf(l,v),l.flags|=4096;return l}return r=ks(r.child,{mode:v.mode,children:v.children}),r.ref=l.ref,l.child=r,r.return=l,r}function Yu(r,l){var p=l.ref;if(p===null)r!==null&&r.ref!==null&&(l.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(a(284));(r===null||r.ref!==p)&&(l.flags|=4194816)}}function vf(r,l,p,v,E){return Xe(l),p=Ut(r,l,p,v,void 0,E),v=Pn(),r!==null&&!Wn?(zn(r,l,E),qa(r,l,E)):(cn&&v&&ee(l),l.flags|=1,Wi(r,l,p,E),l.child)}function pd(r,l,p,v,E,C){return Xe(l),l.updateQueue=null,p=mt(l,v,p,E),Ht(r),v=Pn(),r!==null&&!Wn?(zn(r,l,C),qa(r,l,C)):(cn&&v&&ee(l),l.flags|=1,Wi(r,l,p,C),l.child)}function Yo(r,l,p,v,E){if(Xe(l),l.stateNode===null){var C=sr,B=p.contextType;typeof B=="object"&&B!==null&&(C=G(B)),C=new p(v,C),l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=xc,l.stateNode=C,C._reactInternals=l,C=l.stateNode,C.props=v,C.state=l.memoizedState,C.refs={},fi(l),B=p.contextType,C.context=typeof B=="object"&&B!==null?G(B):sr,C.state=l.memoizedState,B=p.getDerivedStateFromProps,typeof B=="function"&&(cd(l,p,B,v),C.state=l.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(B=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),B!==C.state&&xc.enqueueReplaceState(C,C.state,null),Er(l,v,C,E),La(),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308),v=!0}else if(r===null){C=l.stateNode;var K=l.memoizedProps,Se=Xo(p,K);C.props=Se;var Pe=C.context,Qe=p.contextType;B=sr,typeof Qe=="object"&&Qe!==null&&(B=G(Qe));var Ge=p.getDerivedStateFromProps;Qe=typeof Ge=="function"||typeof C.getSnapshotBeforeUpdate=="function",K=l.pendingProps!==K,Qe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(K||Pe!==B)&&Fm(l,C,v,B),Ws=!1;var ht=l.memoizedState;C.state=ht,Er(l,v,C,E),La(),Pe=l.memoizedState,K||ht!==Pe||Ws?(typeof Ge=="function"&&(cd(l,p,Ge,v),Pe=l.memoizedState),(Se=Ws||pf(l,p,Se,v,ht,Pe,B))?(Qe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(l.flags|=4194308)):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=v,l.memoizedState=Pe),C.props=v,C.state=Pe,C.context=B,v=Se):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),v=!1)}else{C=l.stateNode,Da(r,l),B=l.memoizedProps,Qe=Xo(p,B),C.props=Qe,Ge=l.pendingProps,ht=C.context,Pe=p.contextType,Se=sr,typeof Pe=="object"&&Pe!==null&&(Se=G(Pe)),K=p.getDerivedStateFromProps,(Pe=typeof K=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(B!==Ge||ht!==Se)&&Fm(l,C,v,Se),Ws=!1,ht=l.memoizedState,C.state=ht,Er(l,v,C,E),La();var Wt=l.memoizedState;B!==Ge||ht!==Wt||Ws||r!==null&&r.dependencies!==null&&Mt(r.dependencies)?(typeof K=="function"&&(cd(l,p,K,v),Wt=l.memoizedState),(Qe=Ws||pf(l,p,Qe,v,ht,Wt,Se)||r!==null&&r.dependencies!==null&&Mt(r.dependencies))?(Pe||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(v,Wt,Se),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(v,Wt,Se)),typeof C.componentDidUpdate=="function"&&(l.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof C.componentDidUpdate!="function"||B===r.memoizedProps&&ht===r.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||B===r.memoizedProps&&ht===r.memoizedState||(l.flags|=1024),l.memoizedProps=v,l.memoizedState=Wt),C.props=v,C.state=Wt,C.context=Se,v=Qe):(typeof C.componentDidUpdate!="function"||B===r.memoizedProps&&ht===r.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||B===r.memoizedProps&&ht===r.memoizedState||(l.flags|=1024),v=!1)}return C=v,Yu(r,l),v=(l.flags&128)!==0,C||v?(C=l.stateNode,p=v&&typeof p.getDerivedStateFromError!="function"?null:C.render(),l.flags|=1,r!==null&&v?(l.child=Yi(l,r.child,null,E),l.child=Yi(l,null,p,E)):Wi(r,l,p,E),l.memoizedState=C.state,r=l.child):r=qa(r,l,E),r}function Ym(r,l,p,v){return Dt(),l.flags|=256,Wi(r,l,p,v),l.child}function md(r){return{baseLanes:r,cachePool:He()}}function gd(r,l,p){return r=r!==null?r.childLanes&~p:0,l&&(r|=gs),r}function vd(r,l,p){var v=l.pendingProps,E=!1,C=(l.flags&128)!==0,B;if((B=C)||(B=r!==null&&r.memoizedState===null?!1:(oi.current&2)!==0),B&&(E=!0,l.flags&=-129),B=(l.flags&32)!==0,l.flags&=-33,r===null){if(cn){if(E?ge(l):je(),(r=jn)?(r=Ug(r,ds),r!==null&&(l.memoizedState={dehydrated:r,treeContext:va!==null?{id:Xi,overflow:Ia}:null,retryLane:536870912,hydrationErrors:null},p=Dd(r),p.return=l,l.child=p,Di=l,jn=null)):r=null,r===null)throw et(l);return kf(r)?l.lanes=32:l.lanes=536870912,null}var K=v.children;return v=v.fallback,E?(je(),E=l.mode,K=no({mode:"hidden",children:K},E),v=ha(v,E,p,null),K.return=l,v.return=l,K.sibling=v,l.child=K,v=l.child,v.memoizedState=md(p),v.childLanes=gd(r,B,p),l.memoizedState=dl,qo(null,v)):(ge(l),yf(l,K))}var Se=r.memoizedState;if(Se!==null&&(K=Se.dehydrated,K!==null)){if(C)l.flags&256?(ge(l),l.flags&=-257,l=jo(r,l,p)):l.memoizedState!==null?(je(),l.child=r.child,l.flags|=128,l=null):(je(),K=v.fallback,E=l.mode,v=no({mode:"visible",children:v.children},E),K=ha(K,E,p,null),K.flags|=2,v.return=l,K.return=l,v.sibling=K,l.child=v,Yi(l,r.child,null,p),v=l.child,v.memoizedState=md(p),v.childLanes=gd(r,B,p),l.memoizedState=dl,l=qo(null,v));else if(ge(l),kf(K))B=Hf(K).digest,v=Error(a(419)),v.stack="",v.digest=B,Ve({value:v,source:null,stack:null}),l=jo(r,l,p);else if(Wn||nt(r,l,p,!1),B=(p&r.childLanes)!==0,Wn||B){if(B=tn,B!==null&&(v=Q(B,p),v!==0&&v!==Se.retryLane))throw Se.retryLane=v,sa(r,v),Kn(B,r,v),ms;go(K)||ql(),l=jo(r,l,p)}else go(K)?(l.flags|=192,l.child=r.child,l=null):(r=Se.treeContext,Yn&&(jn=Dg(K),Di=l,cn=!0,or=null,ds=!1,r!==null&&Oe(l,r)),l=yf(l,v.children),l.flags|=4096);return l}return E?(je(),K=v.fallback,E=l.mode,Se=r.child,C=Se.sibling,v=ks(Se,{mode:"hidden",children:v.children}),v.subtreeFlags=Se.subtreeFlags&65011712,C!==null?K=ks(C,K):(K=ha(K,E,p,null),K.flags|=2),K.return=l,v.return=l,v.sibling=K,l.child=v,qo(null,v),v=l.child,K=r.child.memoizedState,K===null?K=md(p):(E=K.cachePool,E!==null?(Se=di?Zn._currentValue:Zn._currentValue2,E=E.parent!==Se?{parent:Se,pool:Se}:E):E=He(),K={baseLanes:K.baseLanes|p,cachePool:E}),v.memoizedState=K,v.childLanes=gd(r,B,p),l.memoizedState=dl,qo(r.child,v)):(ge(l),p=r.child,r=p.sibling,p=ks(p,{mode:"visible",children:v.children}),p.return=l,p.sibling=null,r!==null&&(B=l.deletions,B===null?(l.deletions=[r],l.flags|=16):B.push(r)),l.child=p,l.memoizedState=null,p)}function yf(r,l){return l=no({mode:"visible",children:l},r.mode),l.return=r,r.child=l}function no(r,l){return r=t(22,r,null,l),r.lanes=0,r}function jo(r,l,p){return Yi(l,r.child,null,p),r=yf(l,l.pendingProps.children),r.flags|=2,l.memoizedState=null,r}function jm(r,l,p){r.lanes|=l;var v=r.alternate;v!==null&&(v.lanes|=l),j(r.return,l,p)}function zl(r,l,p,v,E,C){var B=r.memoizedState;B===null?r.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:v,tail:p,tailMode:E,treeForkCount:C}:(B.isBackwards=l,B.rendering=null,B.renderingStartTime=0,B.last=v,B.tail=p,B.tailMode=E,B.treeForkCount=C)}function yd(r,l,p){var v=l.pendingProps,E=v.revealOrder,C=v.tail;v=v.children;var B=oi.current,K=(B&2)!==0;if(K?(B=B&1|2,l.flags|=128):B&=1,T(oi,B),Wi(r,l,v,p),v=cn?vc:0,!K&&r!==null&&(r.flags&128)!==0)e:for(r=l.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&jm(r,p,l);else if(r.tag===19)jm(r,p,l);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break e;for(;r.sibling===null;){if(r.return===null||r.return===l)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(E){case"forwards":for(p=l.child,E=null;p!==null;)r=p.alternate,r!==null&&it(r)===null&&(E=p),p=p.sibling;p=E,p===null?(E=l.child,l.child=null):(E=p.sibling,p.sibling=null),zl(l,!1,E,p,C,v);break;case"backwards":case"unstable_legacy-backwards":for(p=null,E=l.child,l.child=null;E!==null;){if(r=E.alternate,r!==null&&it(r)===null){l.child=E;break}r=E.sibling,E.sibling=p,p=E,E=r}zl(l,!0,p,null,C,v);break;case"together":zl(l,!1,null,null,void 0,v);break;default:l.memoizedState=null}return l.child}function qa(r,l,p){if(r!==null&&(l.dependencies=r.dependencies),Hr|=l.lanes,(p&l.childLanes)===0)if(r!==null){if(nt(r,l,p,!1),(p&l.childLanes)===0)return null}else return null;if(r!==null&&l.child!==r.child)throw Error(a(153));if(l.child!==null){for(r=l.child,p=ks(r,r.pendingProps),l.child=p,p.return=l;r.sibling!==null;)r=r.sibling,p=p.sibling=ks(r,r.pendingProps),p.return=l;p.sibling=null}return l.child}function ju(r,l){return(r.lanes&l)!==0?!0:(r=r.dependencies,!!(r!==null&&Mt(r)))}function _d(r,l,p){switch(l.tag){case 3:st(l,l.stateNode.containerInfo),Ne(l,Zn,r.memoizedState.cache),Dt();break;case 27:case 5:Ce(l);break;case 4:st(l,l.stateNode.containerInfo);break;case 10:Ne(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,de(l),null;break;case 13:var v=l.memoizedState;if(v!==null)return v.dehydrated!==null?(ge(l),l.flags|=128,null):(p&l.child.childLanes)!==0?vd(r,l,p):(ge(l),r=qa(r,l,p),r!==null?r.sibling:null);ge(l);break;case 19:var E=(r.flags&128)!==0;if(v=(p&l.childLanes)!==0,v||(nt(r,l,p,!1),v=(p&l.childLanes)!==0),E){if(v)return yd(r,l,p);l.flags|=128}if(E=l.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),T(oi,oi.current),v)break;return null;case 22:return l.lanes=0,Xm(r,l,p,l.pendingProps);case 24:Ne(l,Zn,r.memoizedState.cache)}return qa(r,l,p)}function xd(r,l,p){if(r!==null)if(r.memoizedProps!==l.pendingProps)Wn=!0;else{if(!ju(r,p)&&(l.flags&128)===0)return Wn=!1,_d(r,l,p);Wn=(r.flags&131072)!==0}else Wn=!1,cn&&(l.flags&1048576)!==0&&W(l,vc,l.index);switch(l.lanes=0,l.tag){case 16:e:{var v=l.pendingProps;if(r=pn(l.elementType),l.type=r,typeof r=="function")Qo(r)?(v=Xo(r,v),l.tag=1,l=Yo(null,l,r,v,p)):(l.tag=0,l=vf(null,l,r,v,p));else{if(r!=null){var E=r.$$typeof;if(E===Ql){l.tag=11,l=Hm(null,l,r,v,p);break e}else if(E===Of){l.tag=14,l=Gm(null,l,r,v,p);break e}}throw l=S(r)||r,Error(a(306,l,""))}}return l;case 0:return vf(r,l,l.type,l.pendingProps,p);case 1:return v=l.type,E=Xo(v,l.pendingProps),Yo(r,l,v,E,p);case 3:e:{if(st(l,l.stateNode.containerInfo),r===null)throw Error(a(387));var C=l.pendingProps;E=l.memoizedState,v=E.element,Da(r,l),Er(l,C,null,p);var B=l.memoizedState;if(C=B.cache,Ne(l,Zn,C),C!==E.cache&&xt(l,[Zn],p,!0),La(),C=B.element,Yn&&E.isDehydrated)if(E={element:C,isDehydrated:!1,cache:B.cache},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){l=Ym(r,l,C,p);break e}else if(C!==v){v=_e(Error(a(424)),l),Ve(v),l=Ym(r,l,C,p);break e}else for(Yn&&(jn=Cg(l.stateNode.containerInfo),Di=l,cn=!0,or=null,ds=!0),p=gp(l,null,C,p),l.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Dt(),C===v){l=qa(r,l,p);break e}Wi(r,l,C,p)}l=l.child}return l;case 26:if(ma)return Yu(r,l),r===null?(p=ap(l.type,null,l.pendingProps,null))?l.memoizedState=p:cn||(l.stateNode=qf(l.type,l.pendingProps,qi.current,l)):l.memoizedState=ap(l.type,r.memoizedProps,l.pendingProps,r.memoizedState),null;case 27:if(Ri)return Ce(l),r===null&&Ri&&cn&&(v=l.stateNode=Yf(l.type,l.pendingProps,qi.current,Fi.current,!1),Di=l,ds=!0,jn=$d(l.type,v,jn)),Wi(r,l,l.pendingProps.children,p),Yu(r,l),r===null&&(l.flags|=4194304),l.child;case 5:return r===null&&cn&&(Hg(l.type,l.pendingProps,Fi.current),(E=v=jn)&&(v=Ng(v,l.type,l.pendingProps,ds),v!==null?(l.stateNode=v,Di=l,jn=wg(v),ds=!1,E=!0):E=!1),E||et(l)),Ce(l),E=l.type,C=l.pendingProps,B=r!==null?r.memoizedProps:null,v=C.children,hs(E,C)?v=null:B!==null&&hs(E,B)&&(l.flags|=32),l.memoizedState!==null&&(E=Ut(r,l,Qt,null,null,p),di?al._currentValue=E:al._currentValue2=E),Yu(r,l),Wi(r,l,v,p),l.child;case 6:return r===null&&cn&&(sp(l.pendingProps,Fi.current),(r=p=jn)&&(p=Lg(p,l.pendingProps,ds),p!==null?(l.stateNode=p,Di=l,jn=null,r=!0):r=!1),r||et(l)),null;case 13:return vd(r,l,p);case 4:return st(l,l.stateNode.containerInfo),v=l.pendingProps,r===null?l.child=Yi(l,null,v,p):Wi(r,l,v,p),l.child;case 11:return Hm(r,l,l.type,l.pendingProps,p);case 7:return Wi(r,l,l.pendingProps,p),l.child;case 8:return Wi(r,l,l.pendingProps.children,p),l.child;case 12:return Wi(r,l,l.pendingProps.children,p),l.child;case 10:return v=l.pendingProps,Ne(l,l.type,v.value),Wi(r,l,v.children,p),l.child;case 9:return E=l.type._context,v=l.pendingProps.children,Xe(l),E=G(E),v=v(E),l.flags|=1,Wi(r,l,v,p),l.child;case 14:return Gm(r,l,l.type,l.pendingProps,p);case 15:return Wm(r,l,l.type,l.pendingProps,p);case 19:return yd(r,l,p);case 31:return qm(r,l,p);case 22:return Xm(r,l,p,l.pendingProps);case 24:return Xe(l),v=G(Zn),r===null?(E=We(),E===null&&(E=tn,C=be(),E.pooledCache=C,C.refCount++,C!==null&&(E.pooledCacheLanes|=p),E=C),l.memoizedState={parent:v,cache:E},fi(l),Ne(l,Zn,E)):((r.lanes&p)!==0&&(Da(r,l),Er(l,null,null,p),La()),E=r.memoizedState,C=l.memoizedState,E.parent!==v?(E={parent:v,cache:v},l.memoizedState=E,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=E),Ne(l,Zn,v)):(v=C.cache,Ne(l,Zn,v),v!==E.cache&&xt(l,[Zn],p,!0))),Wi(r,l,l.pendingProps.children,p),l.child;case 29:throw l.pendingProps}throw Error(a(156,l.tag))}function oa(r){r.flags|=4}function Zu(r){Hs&&(r.flags|=8)}function Zm(r,l){if(r!==null&&r.child===l.child)return!1;if((l.flags&16)!==0)return!0;for(r=l.child;r!==null;){if((r.flags&8218)!==0||(r.subtreeFlags&8218)!==0)return!0;r=r.sibling}return!1}function Sd(r,l,p,v){if(dn)for(p=l.child;p!==null;){if(p.tag===5||p.tag===6)uc(r,p.stateNode);else if(!(p.tag===4||Ri&&p.tag===27)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===l)break;for(;p.sibling===null;){if(p.return===null||p.return===l)return;p=p.return}p.sibling.return=p.return,p=p.sibling}else if(Hs)for(var E=l.child;E!==null;){if(E.tag===5){var C=E.stateNode;p&&v&&(C=Mg(C,E.type,E.memoizedProps)),uc(r,C)}else if(E.tag===6)C=E.stateNode,p&&v&&(C=Jd(C,E.memoizedProps)),uc(r,C);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)C=E.child,C!==null&&(C.return=E),Sd(r,E,!0,!0);else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===l)break;for(;E.sibling===null;){if(E.return===null||E.return===l)return;E=E.return}E.sibling.return=E.return,E=E.sibling}}function Qm(r,l,p,v){var E=!1;if(Hs)for(var C=l.child;C!==null;){if(C.tag===5){var B=C.stateNode;p&&v&&(B=Mg(B,C.type,C.memoizedProps)),Zd(r,B)}else if(C.tag===6)B=C.stateNode,p&&v&&(B=Jd(B,C.memoizedProps)),Zd(r,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)E=C.child,E!==null&&(E.return=C),Qm(r,C,!0,!0),E=!0;else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===l)break;for(;C.sibling===null;){if(C.return===null||C.return===l)return E;C=C.return}C.sibling.return=C.return,C=C.sibling}return E}function Jm(r,l){if(Hs&&Zm(r,l)){r=l.stateNode;var p=r.containerInfo,v=jd();Qm(v,l,!1,!1),r.pendingChildren=v,oa(l),bg(p,v)}}function bd(r,l,p,v){if(dn)r.memoizedProps!==v&&oa(l);else if(Hs){var E=r.stateNode,C=r.memoizedProps;if((r=Zm(r,l))||C!==v){var B=Fi.current;C=Sg(E,p,C,v,!r,null),C===E?l.stateNode=E:(Zu(l),Ms(C,p,v,B)&&oa(l),l.stateNode=C,r&&Sd(C,l,!1,!1))}else l.stateNode=E}}function us(r,l,p,v,E){if((r.mode&32)!==0&&(p===null?cc(l,v):tu(l,p,v))){if(r.flags|=16777216,(E&335544128)===E||zd(l,v))if($n(r.stateNode,l,v))r.flags|=8192;else if(hn())r.flags|=8192;else throw ps=lr,sh}else r.flags&=-16777217}function Bl(r,l){if(up(l)){if(r.flags|=16777216,!cp(l))if(hn())r.flags|=8192;else throw ps=lr,sh}else r.flags&=-16777217}function Qu(r,l){l!==null&&(r.flags|=4),r.flags&16384&&(l=r.tag!==22?I():536870912,r.lanes|=l,cu|=l)}function Fl(r,l){if(!cn)switch(r.tailMode){case"hidden":l=r.tail;for(var p=null;l!==null;)l.alternate!==null&&(p=l),l=l.sibling;p===null?r.tail=null:p.sibling=null;break;case"collapsed":p=r.tail;for(var v=null;p!==null;)p.alternate!==null&&(v=p),p=p.sibling;v===null?l||r.tail===null?r.tail=null:r.tail.sibling=null:v.sibling=null}}function Bn(r){var l=r.alternate!==null&&r.alternate.child===r.child,p=0,v=0;if(l)for(var E=r.child;E!==null;)p|=E.lanes|E.childLanes,v|=E.subtreeFlags&65011712,v|=E.flags&65011712,E.return=r,E=E.sibling;else for(E=r.child;E!==null;)p|=E.lanes|E.childLanes,v|=E.subtreeFlags,v|=E.flags,E.return=r,E=E.sibling;return r.subtreeFlags|=v,r.childLanes=p,l}function Km(r,l,p){var v=l.pendingProps;switch(Ee(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bn(l),null;case 1:return Bn(l),null;case 3:return p=l.stateNode,v=null,r!==null&&(v=r.memoizedState.cache),l.memoizedState.cache!==v&&(l.flags|=2048),Je(Zn),ce(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(r===null||r.child===null)&&(ln(l)?oa(l):r===null||r.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Re())),Jm(r,l),Bn(l),null;case 26:if(ma){var E=l.type,C=l.memoizedState;return r===null?(oa(l),C!==null?(Bn(l),Bl(l,C)):(Bn(l),us(l,E,null,v,p))):C?C!==r.memoizedState?(oa(l),Bn(l),Bl(l,C)):(Bn(l),l.flags&=-16777217):(C=r.memoizedProps,dn?C!==v&&oa(l):bd(r,l,E,v),Bn(l),us(l,E,C,v,p)),null}case 27:if(Ri){if(Be(l),p=qi.current,E=l.type,r!==null&&l.stateNode!=null)dn?r.memoizedProps!==v&&oa(l):bd(r,l,E,v);else{if(!v){if(l.stateNode===null)throw Error(a(166));return Bn(l),null}r=Fi.current,ln(l)?yt(l,r):(r=Yf(E,v,p,r,!0),l.stateNode=r,oa(l))}return Bn(l),null}case 5:if(Be(l),E=l.type,r!==null&&l.stateNode!=null)bd(r,l,E,v);else{if(!v){if(l.stateNode===null)throw Error(a(166));return Bn(l),null}if(C=Fi.current,ln(l))yt(l,C),Fg(l.stateNode,E,v,C)&&(l.flags|=64);else{var B=Od(E,v,qi.current,C,l);Zu(l),Sd(B,l,!1,!1),l.stateNode=B,Ms(B,E,v,C)&&oa(l)}}return Bn(l),us(l,l.type,r===null?null:r.memoizedProps,l.pendingProps,p),null;case 6:if(r&&l.stateNode!=null)p=r.memoizedProps,dn?p!==v&&oa(l):Hs&&(p!==v?(r=qi.current,p=Fi.current,Zu(l),l.stateNode=Pr(v,r,p,l)):l.stateNode=r.stateNode);else{if(typeof v!="string"&&l.stateNode===null)throw Error(a(166));if(r=qi.current,p=Fi.current,ln(l)){if(!Yn)throw Error(a(176));if(r=l.stateNode,p=l.memoizedProps,v=null,E=Di,E!==null)switch(E.tag){case 27:case 5:v=E.memoizedProps}$y(r,p,l,v)||et(l,!0)}else Zu(l),l.stateNode=Pr(v,r,p,l)}return Bn(l),null;case 31:if(p=l.memoizedState,r===null||r.memoizedState!==null){if(v=ln(l),p!==null){if(r===null){if(!v)throw Error(a(318));if(!Yn)throw Error(a(556));if(r=l.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));tp(r,l)}else Dt(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Bn(l),r=!1}else p=Re(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),r=!0;if(!r)return l.flags&256?(tt(l),l):(tt(l),null);if((l.flags&128)!==0)throw Error(a(558))}return Bn(l),null;case 13:if(v=l.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(E=ln(l),v!==null&&v.dehydrated!==null){if(r===null){if(!E)throw Error(a(318));if(!Yn)throw Error(a(344));if(E=l.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(a(317));Og(E,l)}else Dt(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Bn(l),E=!1}else E=Re(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=E),E=!0;if(!E)return l.flags&256?(tt(l),l):(tt(l),null)}return tt(l),(l.flags&128)!==0?(l.lanes=p,l):(p=v!==null,r=r!==null&&r.memoizedState!==null,p&&(v=l.child,E=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(E=v.alternate.memoizedState.cachePool.pool),C=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(C=v.memoizedState.cachePool.pool),C!==E&&(v.flags|=2048)),p!==r&&p&&(l.child.flags|=8192),Qu(l,l.updateQueue),Bn(l),null);case 4:return ce(),Jm(r,l),r===null&&Un(l.stateNode.containerInfo),Bn(l),null;case 10:return Je(l.type),Bn(l),null;case 19:if(M(oi),v=l.memoizedState,v===null)return Bn(l),null;if(E=(l.flags&128)!==0,C=v.rendering,C===null)if(E)Fl(v,!1);else{if(ni!==0||r!==null&&(r.flags&128)!==0)for(r=l.child;r!==null;){if(C=it(r),C!==null){for(l.flags|=128,Fl(v,!1),r=C.updateQueue,l.updateQueue=r,Qu(l,r),l.subtreeFlags=0,r=p,p=l.child;p!==null;)Df(p,r),p=p.sibling;return T(oi,oi.current&1|2),cn&&Ue(l,v.treeForkCount),l.child}r=r.sibling}v.tail!==null&&ts()>wo&&(l.flags|=128,E=!0,Fl(v,!1),l.lanes=4194304)}else{if(!E)if(r=it(C),r!==null){if(l.flags|=128,E=!0,r=r.updateQueue,l.updateQueue=r,Qu(l,r),Fl(v,!0),v.tail===null&&v.tailMode==="hidden"&&!C.alternate&&!cn)return Bn(l),null}else 2*ts()-v.renderingStartTime>wo&&p!==536870912&&(l.flags|=128,E=!0,Fl(v,!1),l.lanes=4194304);v.isBackwards?(C.sibling=l.child,l.child=C):(r=v.last,r!==null?r.sibling=C:l.child=C,v.last=C)}return v.tail!==null?(r=v.tail,v.rendering=r,v.tail=r.sibling,v.renderingStartTime=ts(),r.sibling=null,p=oi.current,T(oi,E?p&1|2:p&1),cn&&Ue(l,v.treeForkCount),r):(Bn(l),null);case 22:case 23:return tt(l),ie(),v=l.memoizedState!==null,r!==null?r.memoizedState!==null!==v&&(l.flags|=8192):v&&(l.flags|=8192),v?(p&536870912)!==0&&(l.flags&128)===0&&(Bn(l),l.subtreeFlags&6&&(l.flags|=8192)):Bn(l),p=l.updateQueue,p!==null&&Qu(l,p.retryQueue),p=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(p=r.memoizedState.cachePool.pool),v=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(v=l.memoizedState.cachePool.pool),v!==p&&(l.flags|=2048),r!==null&&M(_o),null;case 24:return p=null,r!==null&&(p=r.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Je(Zn),Bn(l),null;case 25:return null;case 30:return null}throw Error(a(156,l.tag))}function Md(r,l){switch(Ee(l),l.tag){case 1:return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 3:return Je(Zn),ce(),r=l.flags,(r&65536)!==0&&(r&128)===0?(l.flags=r&-65537|128,l):null;case 26:case 27:case 5:return Be(l),null;case 31:if(l.memoizedState!==null){if(tt(l),l.alternate===null)throw Error(a(340));Dt()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 13:if(tt(l),r=l.memoizedState,r!==null&&r.dehydrated!==null){if(l.alternate===null)throw Error(a(340));Dt()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 19:return M(oi),null;case 4:return ce(),null;case 10:return Je(l.type),null;case 22:case 23:return tt(l),ie(),r!==null&&M(_o),r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 24:return Je(Zn),null;case 25:return null;default:return null}}function $m(r,l){switch(Ee(l),l.tag){case 3:Je(Zn),ce();break;case 26:case 27:case 5:Be(l);break;case 4:ce();break;case 31:l.memoizedState!==null&&tt(l);break;case 13:tt(l);break;case 19:M(oi);break;case 10:Je(l.type);break;case 22:case 23:tt(l),ie(),r!==null&&M(_o);break;case 24:Je(Zn)}}function Ya(r,l){try{var p=l.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var E=v.next;p=E;do{if((p.tag&r)===r){v=void 0;var C=p.create,B=p.inst;v=C(),B.destroy=v}p=p.next}while(p!==E)}}catch(K){Pt(l,l.return,K)}}function ja(r,l,p){try{var v=l.updateQueue,E=v!==null?v.lastEffect:null;if(E!==null){var C=E.next;v=C;do{if((v.tag&r)===r){var B=v.inst,K=B.destroy;if(K!==void 0){B.destroy=void 0,E=l;var Se=p,Pe=K;try{Pe()}catch(Qe){Pt(E,Se,Qe)}}}v=v.next}while(v!==C)}}catch(Qe){Pt(l,l.return,Qe)}}function Vl(r){var l=r.updateQueue;if(l!==null){var p=r.stateNode;try{Ar(l,p)}catch(v){Pt(r,r.return,v)}}}function _f(r,l,p){p.props=Xo(r.type,r.memoizedProps),p.state=r.memoizedState;try{p.componentWillUnmount()}catch(v){Pt(r,l,v)}}function kl(r,l){try{var p=r.ref;if(p!==null){switch(r.tag){case 26:case 27:case 5:var v=Kl(r.stateNode);break;case 30:v=r.stateNode;break;default:v=r.stateNode}typeof p=="function"?r.refCleanup=p(v):p.current=v}}catch(E){Pt(r,l,E)}}function es(r,l){var p=r.ref,v=r.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(E){Pt(r,l,E)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(E){Pt(r,l,E)}else p.current=null}function Zo(r){var l=r.type,p=r.memoizedProps,v=r.stateNode;try{dg(v,l,p,r)}catch(E){Pt(r,r.return,E)}}function Ju(r,l,p){try{pg(r.stateNode,r.type,p,l,r)}catch(v){Pt(r,r.return,v)}}function Ed(r){return r.tag===5||r.tag===3||(ma?r.tag===26:!1)||(Ri?r.tag===27&&rl(r.type):!1)||r.tag===4}function Cr(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Ed(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(Ri&&r.tag===27&&rl(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function xf(r,l,p){var v=r.tag;if(v===5||v===6)r=r.stateNode,l?gg(p,r,l):Wd(p,r);else if(v!==4&&(Ri&&v===27&&rl(r.type)&&(p=r.stateNode,l=null),r=r.child,r!==null))for(xf(r,l,p),r=r.sibling;r!==null;)xf(r,l,p),r=r.sibling}function Ku(r,l,p){var v=r.tag;if(v===5||v===6)r=r.stateNode,l?mg(p,r,l):Gd(p,r);else if(v!==4&&(Ri&&v===27&&rl(r.type)&&(p=r.stateNode),r=r.child,r!==null))for(Ku(r,l,p),r=r.sibling;r!==null;)Ku(r,l,p),r=r.sibling}function Td(r,l,p){r=r.containerInfo;try{Qd(r,p)}catch(v){Pt(l,l.return,v)}}function eg(r){var l=r.stateNode,p=r.memoizedProps;try{Si(r.type,p,l,r)}catch(v){Pt(r,r.return,v)}}function Zy(r,l){for(Pf(r.containerInfo),gi=l;gi!==null;)if(r=gi,l=r.child,(r.subtreeFlags&1028)!==0&&l!==null)l.return=r,gi=l;else for(;gi!==null;){r=gi;var p=r.alternate;switch(l=r.flags,r.tag){case 0:if((l&4)!==0&&(l=r.updateQueue,l=l!==null?l.events:null,l!==null))for(var v=0;v";case ou:return":has("+(Wl(r)||"")+")";case lu:return'[role="'+r.value+'"]';case Mo:return'"'+r.value+'"';case Sc:return'[data-testname="'+r.value+'"]';default:throw Error(a(365))}}function Xl(r,l){var p=[];r=[r,0];for(var v=0;vp?32:p;p=Ct.T;var E=pa();try{un(v),Ct.T=null,v=oh,oh=null;var C=Wr,B=hr;if(Mi=0,gl=Wr=null,hr=0,(rn&6)!==0)throw Error(a(331));var K=rn;if(rn|=4,Ef(C.current),bf(C,C.current,B,v),rn=K,qe(0,!1),As&&typeof As.onPostCommitFiberRoot=="function")try{As.onPostCommitFiberRoot(ul,C)}catch{}return!0}finally{un(E),Ct.T=p,Rf(r,l)}}function co(r,l,p){l=_e(p,l),l=hd(r.stateNode,l,2),r=Na(r,l,2),r!==null&&(z(r,2),rt(r))}function Pt(r,l,p){if(r.tag===3)co(r,r,p);else for(;l!==null;){if(l.tag===3){co(l,r,p);break}else if(l.tag===1){var v=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Gr===null||!Gr.has(v))){r=_e(p,r),p=Vm(2),v=Na(l,p,2),v!==null&&(km(p,v,l,r),z(v,2),rt(v));break}}l=l.return}}function Zl(r,l,p){var v=r.pingCache;if(v===null){v=r.pingCache=new Ys;var E=new Set;v.set(l,E)}else E=v.get(l),E===void 0&&(E=new Set,v.set(l,E));E.has(p)||(To=!0,E.add(p),r=ag.bind(null,r,l,p),l.then(r,r))}function ag(r,l,p){var v=r.pingCache;v!==null&&v.delete(l),r.pingedLanes|=r.suspendedLanes&p,r.warmLanes&=~p,tn===r&&(fn&p)===p&&(ni===4||ni===3&&(fn&62914560)===fn&&300>ts()-Mc?(rn&2)===0&&ri(r,0):uu|=p,cu===fn&&(cu=0)),rt(r)}function rg(r,l){l===0&&(l=I()),r=sa(r,l),r!==null&&(z(r,l),rt(r))}function Qy(r){var l=r.memoizedState,p=0;l!==null&&(p=l.retryLane),rg(r,p)}function Jy(r,l){var p=0;switch(r.tag){case 31:case 13:var v=r.stateNode,E=r.memoizedState;E!==null&&(p=E.retryLane);break;case 19:v=r.stateNode;break;case 22:v=r.stateNode._retryCache;break;default:throw Error(a(314))}v!==null&&v.delete(l),rg(r,p)}function xi(r,l){return pc(r,l)}function Cd(r,l,p,v){this.tag=r,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=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qo(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ks(r,l){var p=r.alternate;return p===null?(p=t(r.tag,l,r.key,r.mode),p.elementType=r.elementType,p.type=r.type,p.stateNode=r.stateNode,p.alternate=r,r.alternate=p):(p.pendingProps=l,p.type=r.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=r.flags&65011712,p.childLanes=r.childLanes,p.lanes=r.lanes,p.child=r.child,p.memoizedProps=r.memoizedProps,p.memoizedState=r.memoizedState,p.updateQueue=r.updateQueue,l=r.dependencies,p.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},p.sibling=r.sibling,p.index=r.index,p.ref=r.ref,p.refCleanup=r.refCleanup,p}function Df(r,l){r.flags&=65011714;var p=r.alternate;return p===null?(r.childLanes=0,r.lanes=l,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=p.childLanes,r.lanes=p.lanes,r.child=p.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=p.memoizedProps,r.memoizedState=p.memoizedState,r.updateQueue=p.updateQueue,r.type=p.type,l=p.dependencies,r.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),r}function Ur(r,l,p,v,E,C){var B=0;if(v=r,typeof r=="function")Qo(r)&&(B=1);else if(typeof r=="string")B=ma&&Ri?Xf(r,p,Fi.current)?26:fp(r)?27:5:ma?Xf(r,p,Fi.current)?26:5:Ri&&fp(r)?27:5;else e:switch(r){case oc:return r=t(31,p,l,E),r.elementType=oc,r.lanes=C,r;case el:return ha(p.children,E,C,l);case tl:B=8,E|=24;break;case nl:return r=t(12,p,l,E|2),r.elementType=nl,r.lanes=C,r;case If:return r=t(13,p,l,E),r.elementType=If,r.lanes=C,r;case Ir:return r=t(19,p,l,E),r.elementType=Ir,r.lanes=C,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case da:B=10;break e;case rc:B=9;break e;case Ql:B=11;break e;case Of:B=14;break e;case fs:B=16,v=null;break e}B=29,p=Error(a(130,r===null?"null":typeof r,"")),v=null}return l=t(B,p,l,E),l.elementType=r,l.type=v,l.lanes=C,l}function ha(r,l,p,v){return r=t(7,r,v,l),r.lanes=p,r}function Rd(r,l,p){return r=t(6,r,null,l),r.lanes=p,r}function Dd(r){var l=t(18,null,null,0);return l.stateNode=r,l}function Nd(r,l,p){return l=t(4,r.children!==null?r.children:[],r.key,l),l.lanes=p,l.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},l}function og(r,l,p,v,E,C,B,K,Se){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Es,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=V(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=V(0),this.hiddenUpdates=V(null),this.identifierPrefix=v,this.onUncaughtError=E,this.onCaughtError=C,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Se,this.incompleteTransitions=new Map}function fo(r,l,p,v,E,C,B,K,Se,Pe,Qe,Ge){return r=new og(r,l,p,B,Se,Pe,Qe,Ge,K),l=1,C===!0&&(l|=24),C=t(3,null,null,l),r.current=C,C.stateNode=r,l=be(),l.refCount++,r.pooledCache=l,l.refCount++,C.memoizedState={element:v,isDehydrated:p,cache:l},fi(C),r}function Nf(r){return r?(r=sr,r):sr}function sc(r){var l=r._reactInternals;if(l===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=d(l),r=r!==null?m(r):null,r===null?null:Kl(r.stateNode)}function Ld(r,l,p,v,E,C){E=Nf(E),v.context===null?v.context=E:v.pendingContext=E,v=rs(l),v.payload={element:p},C=C===void 0?null:C,C!==null&&(v.callback=C),p=Na(r,v,l),p!==null&&(Kn(p,r,l),Kr(p,r,l))}function Jo(r,l){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var p=r.retryLane;r.retryLane=p!==0&&p=Pe&&C>=Ge&&E<=Qe&&B<=ht){r.splice(l,1);break}else if(v!==Pe||p.width!==Se.width||htB){if(!(C!==Ge||p.height!==Se.height||QeE)){Pe>v&&(Se.width+=Pe-v,Se.x=v),QeC&&(Se.height+=Ge-C,Se.y=C),htp&&(p=K)),K ")+` - -No matching component was found for: - `)+r.join(" > ")}return null},$t.getPublicRootInstance=function(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 27:case 5:return Kl(r.child.stateNode);default:return r.child.stateNode}},$t.injectIntoDevTools=function(){var r={bundleType:0,version:Id,rendererPackageName:lc,currentDispatcherRef:Ct,reconcilerVersion:"19.2.0"};if(Jl!==null&&(r.rendererConfig=Jl),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")r=!1;else{var l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(l.isDisabled||!l.supportsFiber)r=!0;else{try{ul=l.inject(r),As=l}catch{}r=!!l.checkDCE}}return r},$t.isAlreadyRendering=function(){return(rn&6)!==0},$t.observeVisibleRects=function(r,l,p,v){if(!Ci)throw Error(a(363));r=Ss(r,l);var E=Vf(r,p,v).disconnect;return{disconnect:function(){E()}}},$t.shouldError=function(){return null},$t.shouldSuspend=function(){return!1},$t.startHostTransition=function(r,l,p,v){if(r.tag!==5)throw Error(a(476));var E=Im(r).queue;Um(r,E,l,sl,p===null?i:function(){var C=Im(r);return C.next===null&&(C=r.alternate.memoizedState),qu(r,C.next.queue,{},qn()),p(v)})},$t.updateContainer=function(r,l,p,v){var E=l.current,C=qn();return Ld(E,C,r,l,p,v),C},$t.updateContainerSync=function(r,l,p,v){return Ld(l.current,2,r,l,p,v),2},$t},o.exports.default=o.exports,Object.defineProperty(o.exports,"__esModule",{value:!0})})(L1)),L1.exports}var I1;function bO(){return I1||(I1=1,N1.exports=SO()),N1.exports}var MO=bO();const EO=xO(MO);function TO(o){const e=EO(o);return e.injectIntoDevTools(),e}const jT=0,Zh={},AO=/^three(?=[A-Z])/,Xy=o=>`${o[0].toUpperCase()}${o.slice(1)}`;let wO=0;const CO=o=>typeof o=="function";function RO(o){if(CO(o)){const e=`${wO++}`;return Zh[e]=o,e}else Object.assign(Zh,o)}function ZT(o,e){const t=Xy(o),i=Zh[t];if(o!=="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(o==="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 DO(o,e,t){var i;return o=Xy(o)in Zh?o:o.replace(AO,""),ZT(o,e),o==="primitive"&&(i=e.object)!=null&&i.__r3f&&delete e.object.__r3f,iy(e.object,t,o,e)}function NO(o){if(!o.isHidden){var e;o.props.attach&&(e=o.parent)!=null&&e.object?ay(o.parent,o):Qs(o.object)&&(o.object.visible=!1),o.isHidden=!0,id(o)}}function QT(o){if(o.isHidden){var e;o.props.attach&&(e=o.parent)!=null&&e.object?sy(o.parent,o):Qs(o.object)&&o.props.visible!==!1&&(o.object.visible=!0),o.isHidden=!1,id(o)}}function KS(o,e,t){const i=e.root.getState();if(!(!o.parent&&o.object!==i.scene)){if(!e.object){var a,u;const f=Zh[Xy(e.type)];e.object=(a=e.props.object)!=null?a:new f(...(u=e.props.args)!=null?u:[]),e.object.__r3f=e}if(Cu(e.object,e.props),e.props.attach)sy(o,e);else if(Qs(e.object)&&Qs(o.object)){const f=o.object.children.indexOf(t?.object);if(t&&f!==-1){const d=o.object.children.indexOf(e.object);if(d!==-1){o.object.children.splice(d,1);const m=d{try{o.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():Qx.unstable_scheduleCallback(Qx.unstable_IdlePriority,e)}}function Kx(o,e,t){if(!e)return;e.parent=null;const i=o.children.indexOf(e);i!==-1&&o.children.splice(i,1),e.props.attach?ay(o,e):Qs(e.object)&&Qs(o.object)&&(o.object.remove(e.object),cO(HT(e),e.object));const a=e.props.dispose!==null&&t!==!1;for(let u=e.children.length-1;u>=0;u--){const f=e.children[u];Kx(e,f,a)}e.children.length=0,delete e.object.__r3f,a&&e.type!=="primitive"&&e.object.type!=="Scene"&&JT(e.object),t===void 0&&id(e)}function LO(o,e){for(const t of[o,o.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 cv=[];function UO(){for(const[t]of cv){const i=t.parent;if(i){t.props.attach?ay(i,t):Qs(t.object)&&Qs(i.object)&&i.object.remove(t.object);for(const a of t.children)a.props.attach?ay(t,a):Qs(a.object)&&Qs(t.object)&&t.object.remove(a.object)}t.isHidden&&QT(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&JT(t.object)}for(const[t,i,a]of cv){t.props=i;const u=t.parent;if(u){var o,e;const f=Zh[Xy(t.type)];t.object=(o=t.props.object)!=null?o:new f(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,LO(a,t.object),Cu(t.object,t.props),t.props.attach?sy(u,t):Qs(t.object)&&Qs(u.object)&&u.object.add(t.object);for(const d of t.children)d.props.attach?sy(t,d):Qs(d.object)&&Qs(t.object)&&t.object.add(d.object);id(t)}}cv.length=0}const Ax=()=>{},P1={};let rv=jT;const IO=0,OO=4,$x=TO({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:DO,removeChild:Kx,appendChild:Tx,appendInitialChild:Tx,insertBefore:O1,appendChildToContainer(o,e){const t=o.getState().scene.__r3f;!e||!t||Tx(t,e)},removeChildFromContainer(o,e){const t=o.getState().scene.__r3f;!e||!t||Kx(t,e)},insertInContainerBefore(o,e,t){const i=o.getState().scene.__r3f;!e||!t||!i||O1(i,e,t)},getRootHostContext:()=>P1,getChildHostContext:()=>P1,commitUpdate(o,e,t,i,a){var u,f,d;ZT(e,i);let m=!1;if((o.type==="primitive"&&t.object!==i.object||((u=i.args)==null?void 0:u.length)!==((f=t.args)==null?void 0:f.length)||(d=i.args)!=null&&d.some((_,S)=>{var x;return _!==((x=t.args)==null?void 0:x[S])}))&&(m=!0),m)cv.push([o,{...i},a]);else{const _=rO(o,i);Object.keys(_).length&&(Object.assign(o.props,_),Cu(o.object,_))}(a.sibling===null||(a.flags&OO)===IO)&&UO()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:o=>o?.object,prepareForCommit:()=>null,preparePortalMount:o=>iy(o.getState().scene,o,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:NO,unhideInstance:QT,createTextInstance:Ax,hideTextInstance:Ax,unhideTextInstance:Ax,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,suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:Bt.createContext(null),setCurrentUpdatePriority(o){rv=o},getCurrentUpdatePriority(){return rv},resolveUpdatePriority(){var o;if(rv!==jT)return rv;switch(typeof window<"u"&&((o=window.event)==null?void 0:o.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return yO;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return gO;default:return vO}},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:_O.version,applyViewTransitionName(o,e,t){},restoreViewTransitionName(o,e){},cancelViewTransitionName(o,e,t){},cancelRootViewTransitionName(o){},restoreRootViewTransitionName(o){},InstanceMeasurement:null,measureInstance:o=>null,wasInstanceInViewport:o=>!0,hasInstanceChanged:(o,e)=>!1,hasInstanceAffectedParent:(o,e)=>!1,suspendOnActiveViewTransition(o,e){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(o){},createViewTransitionInstance:o=>null,getCurrentGestureOffset(o){throw new Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance(o,e){return o},cloneMutableTextInstance(o){return o},cloneRootViewTransitionContainer(o){throw new Error("Not implemented.")},removeRootViewTransitionClone(o,e){throw new Error("Not implemented.")},createFragmentInstance:o=>null,updateFragmentInstanceFiber(o,e){},commitNewChildToFragmentInstance(o,e){},deleteChildFromFragmentInstance(o,e){},measureClonedInstance:o=>null,maySuspendCommitOnUpdate:(o,e,t)=>!1,maySuspendCommitInSyncRender:(o,e)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(o,e)=>null}),tf=new Map,Ih={objects:"shallow",strict:!1};function PO(o,e){if(!e&&typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement&&o.parentElement){const{width:t,height:i,top:a,left:u}=o.parentElement.getBoundingClientRect();return{width:t,height:i,top:a,left:u}}else if(!e&&typeof OffscreenCanvas<"u"&&o instanceof OffscreenCanvas)return{width:o.width,height:o.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function zO(o){const e=tf.get(o),t=e?.fiber,i=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const a=typeof reportError=="function"?reportError:console.error,u=i||dO(nS,B1),f=t||$x.createContainer(u,mO,null,!1,null,"",a,a,a,null);e||tf.set(o,{fiber:f,store:u});let d,m,g=!1,_=null;return{async configure(S={}){let x;_=new Promise(W=>x=W);let{gl:M,size:T,scene:D,events:w,onCreated:A,shadows:R=!1,linear:L=!1,flat:I=!1,legacy:V=!1,orthographic:z=!1,frameloop:H="always",dpr:U=[1,2],performance:P,raycaster:Q,camera:X,onPointerMissed:te}=S,$=u.getState(),ue=$.gl;if(!$.gl){const W={canvas:o,powerPreference:"high-performance",antialias:!0,alpha:!0},ee=typeof M=="function"?await M(W):M;R1(ee)?ue=ee:ue=new PT({...W,...M}),$.set({gl:ue})}let se=$.raycaster;se||$.set({raycaster:se=new wT});const{params:q,...Z}=Q||{};if(ci.equ(Z,se,Ih)||Cu(se,{...Z}),ci.equ(q,se.params,Ih)||Cu(se,{params:{...se.params,...q}}),!$.camera||$.camera===m&&!ci.equ(m,X,Ih)){m=X;const W=X?.isCamera,ee=W?X:z?new td(0,0,0,0,.1,1e3):new as(75,0,.1,1e3);W||(ee.position.z=5,X&&(Cu(ee,X),ee.manual||("aspect"in X||"left"in X||"right"in X||"bottom"in X||"top"in X)&&(ee.manual=!0,ee.updateProjectionMatrix())),!$.camera&&!(X!=null&&X.rotation)&&ee.lookAt(0,0,0)),$.set({camera:ee}),se.camera=ee}if(!$.scene){let W;D!=null&&D.isScene?(W=D,iy(W,u,"",{})):(W=new xS,iy(W,u,"",{}),D&&Cu(W,D)),$.set({scene:W})}w&&!$.events.handlers&&$.set({events:w(u)});const ye=PO(o,T);if(ci.equ(ye,$.size,Ih)||$.setSize(ye.width,ye.height,ye.top,ye.left),U&&$.viewport.dpr!==WT(U)&&$.setDpr(U),$.frameloop!==H&&$.setFrameloop(H),$.onPointerMissed||$.set({onPointerMissed:te}),P&&!ci.equ(P,$.performance,Ih)&&$.set(W=>({performance:{...W.performance,...P}})),!$.xr){var _e;const W=(Oe,st)=>{const ce=u.getState();ce.frameloop!=="never"&&B1(Oe,!0,ce,st)},ee=()=>{const Oe=u.getState();Oe.gl.xr.enabled=Oe.gl.xr.isPresenting,Oe.gl.xr.setAnimationLoop(Oe.gl.xr.isPresenting?W:null),Oe.gl.xr.isPresenting||nS(Oe)},Ee={connect(){const Oe=u.getState().gl;Oe.xr.addEventListener("sessionstart",ee),Oe.xr.addEventListener("sessionend",ee)},disconnect(){const Oe=u.getState().gl;Oe.xr.removeEventListener("sessionstart",ee),Oe.xr.removeEventListener("sessionend",ee)}};typeof((_e=ue.xr)==null?void 0:_e.addEventListener)=="function"&&Ee.connect(),$.set({xr:Ee})}if(ue.shadowMap){const W=ue.shadowMap.enabled,ee=ue.shadowMap.type;if(ue.shadowMap.enabled=!!R,ci.boo(R))ue.shadowMap.type=qp;else if(ci.str(R)){var Ue;const Ee={basic:W1,percentage:Fh,soft:qp,variance:Hc};ue.shadowMap.type=(Ue=Ee[R])!=null?Ue:qp}else ci.obj(R)&&Object.assign(ue.shadowMap,R);(W!==ue.shadowMap.enabled||ee!==ue.shadowMap.type)&&(ue.shadowMap.needsUpdate=!0)}return Sn.enabled=!V,g||(ue.outputColorSpace=L?Uu:Is,ue.toneMapping=I?gr:ly),$.legacy!==V&&$.set(()=>({legacy:V})),$.linear!==L&&$.set(()=>({linear:L})),$.flat!==I&&$.set(()=>({flat:I})),M&&!ci.fun(M)&&!R1(M)&&!ci.equ(M,ue,Ih)&&Cu(ue,M),d=A,g=!0,x(),this},render(S){return!g&&!_&&this.configure(),_.then(()=>{$x.updateContainer(Gt.jsx(BO,{store:u,children:S,onCreated:d,rootElement:o}),f,null,()=>{})}),u},unmount(){KT(o)}}}function BO({store:o,children:e,onCreated:t,rootElement:i}){return Wy(()=>{const a=o.getState();a.set(u=>({internal:{...u.internal,active:!0}})),t&&t(a),o.getState().events.connected||a.events.connect==null||a.events.connect(i)},[]),Gt.jsx(hO.Provider,{value:o,children:e})}function KT(o,e){const t=tf.get(o),i=t?.fiber;if(i){const a=t?.store.getState();a&&(a.internal.active=!1),$x.updateContainer(null,i,null,()=>{a&&setTimeout(()=>{try{var u,f,d,m;a.events.disconnect==null||a.events.disconnect(),(u=a.gl)==null||(f=u.renderLists)==null||f.dispose==null||f.dispose(),(d=a.gl)==null||d.forceContextLoss==null||d.forceContextLoss(),(m=a.gl)!=null&&m.xr&&a.xr.disconnect(),iO(a.scene),tf.delete(o)}catch{}},500)})}}const FO=new Set,VO=new Set,kO=new Set;function wx(o,e){if(o.size)for(const{callback:t}of o.values())t(e)}function im(o,e){switch(o){case"before":return wx(FO,e);case"after":return wx(VO,e);case"tail":return wx(kO,e)}}let Cx,Rx;function eS(o,e,t){let i=e.clock.getDelta();e.frameloop==="never"&&typeof o=="number"&&(i=o-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=o),Cx=e.internal.subscribers;for(let a=0;a0)&&!((e=Oh.gl.xr)!=null&&e.isPresenting)&&(Dx+=eS(o,Oh))}if(tS=!1,im("after",o),Dx===0)return im("tail",o),ry=!1,cancelAnimationFrame(z1)}function nS(o,e=1){var t;if(!o)return tf.forEach(i=>nS(i.store.getState(),e));(t=o.gl.xr)!=null&&t.isPresenting||!o.internal.active||o.frameloop==="never"||(e>1?o.internal.frames=Math.min(60,o.internal.frames+e):tS?o.internal.frames=2:o.internal.frames=1,ry||(ry=!0,requestAnimationFrame($T)))}function B1(o,e=!0,t,i){if(e&&im("before",o),t)eS(o,t,i);else for(const a of tf.values())eS(o,a.store.getState());e&&im("after",o)}const Nx={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 HO(o){const{handlePointer:e}=fO(o);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(Nx).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:a}=o.getState();(t=a.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(a.lastEvent.current)},connect:t=>{const{set:i,events:a}=o.getState();if(a.disconnect==null||a.disconnect(),i(u=>({events:{...u.events,connected:t}})),a.handlers)for(const u in a.handlers){const f=a.handlers[u],[d,m]=Nx[u];t.addEventListener(d,f,{passive:m})}},disconnect:()=>{const{set:t,events:i}=o.getState();if(i.connected){if(i.handlers)for(const a in i.handlers){const u=i.handlers[a],[f]=Nx[a];i.connected.removeEventListener(f,u)}t(a=>({events:{...a.events,connected:void 0}}))}}}}function F1(o,e){let t;return(...i)=>{window.clearTimeout(t),t=window.setTimeout(()=>o(...i),e)}}function GO({debounce:o,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[u,f]=Bt.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),d=Bt.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:u,orientationHandler:null}),m=o?typeof o=="number"?o:o.scroll:null,g=o?typeof o=="number"?o:o.resize:null,_=Bt.useRef(!1);Bt.useEffect(()=>(_.current=!0,()=>{_.current=!1}));const[S,x,M]=Bt.useMemo(()=>{const A=()=>{if(!d.current.element)return;const{left:R,top:L,width:I,height:V,bottom:z,right:H,x:U,y:P}=d.current.element.getBoundingClientRect(),Q={left:R,top:L,width:I,height:V,bottom:z,right:H,x:U,y:P};d.current.element instanceof HTMLElement&&i&&(Q.height=d.current.element.offsetHeight,Q.width=d.current.element.offsetWidth),Object.freeze(Q),_.current&&!YO(d.current.lastBounds,Q)&&f(d.current.lastBounds=Q)};return[A,g?F1(A,g):A,m?F1(A,m):A]},[f,i,m,g]);function T(){d.current.scrollContainers&&(d.current.scrollContainers.forEach(A=>A.removeEventListener("scroll",M,!0)),d.current.scrollContainers=null),d.current.resizeObserver&&(d.current.resizeObserver.disconnect(),d.current.resizeObserver=null),d.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",d.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",d.current.orientationHandler))}function D(){d.current.element&&(d.current.resizeObserver=new a(M),d.current.resizeObserver.observe(d.current.element),e&&d.current.scrollContainers&&d.current.scrollContainers.forEach(A=>A.addEventListener("scroll",M,{capture:!0,passive:!0})),d.current.orientationHandler=()=>{M()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",d.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",d.current.orientationHandler))}const w=A=>{!A||A===d.current.element||(T(),d.current.element=A,d.current.scrollContainers=eA(A),D())};return XO(M,!!e),WO(x),Bt.useEffect(()=>{T(),D()},[e,M,x]),Bt.useEffect(()=>T,[]),[w,u,S]}function WO(o){Bt.useEffect(()=>{const e=o;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[o])}function XO(o,e){Bt.useEffect(()=>{if(e){const t=o;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",t,!0)}}},[o,e])}function eA(o){const e=[];if(!o||o===document.body)return e;const{overflow:t,overflowX:i,overflowY:a}=window.getComputedStyle(o);return[t,i,a].some(u=>u==="auto"||u==="scroll")&&e.push(o),[...e,...eA(o.parentElement)]}const qO=["x","y","top","bottom","left","right","width","height"],YO=(o,e)=>qO.every(t=>o[t]===e[t]);function jO({ref:o,children:e,fallback:t,resize:i,style:a,gl:u,events:f=HO,eventSource:d,eventPrefix:m,shadows:g,linear:_,flat:S,legacy:x,orthographic:M,frameloop:T,dpr:D,performance:w,raycaster:A,camera:R,scene:L,onPointerMissed:I,onCreated:V,...z}){Bt.useMemo(()=>RO(RI),[]);const H=$I(),[U,P]=GO({scroll:!0,debounce:{scroll:50,resize:0},...i}),Q=Bt.useRef(null),X=Bt.useRef(null);Bt.useImperativeHandle(o,()=>Q.current);const te=KI(I),[$,ue]=Bt.useState(!1),[se,q]=Bt.useState(!1);if($)throw $;if(se)throw se;const Z=Bt.useRef(null);Wy(()=>{const _e=Q.current;if(P.width>0&&P.height>0&&_e){Z.current||(Z.current=zO(_e));async function Ue(){await Z.current.configure({gl:u,scene:L,events:f,shadows:g,linear:_,flat:S,legacy:x,orthographic:M,frameloop:T,dpr:D,performance:w,raycaster:A,camera:R,size:P,onPointerMissed:(...W)=>te.current==null?void 0:te.current(...W),onCreated:W=>{W.events.connect==null||W.events.connect(d?QI(d)?d.current:d:X.current),m&&W.setEvents({compute:(ee,Ee)=>{const Oe=ee[m+"X"],st=ee[m+"Y"];Ee.pointer.set(Oe/Ee.size.width*2-1,-(st/Ee.size.height)*2+1),Ee.raycaster.setFromCamera(Ee.pointer,Ee.camera)}}),V?.(W)}}),Z.current.render(Gt.jsx(H,{children:Gt.jsx(tO,{set:q,children:Gt.jsx(Bt.Suspense,{fallback:Gt.jsx(eO,{set:ue}),children:e??null})})}))}Ue()}}),Bt.useEffect(()=>{const _e=Q.current;if(_e)return()=>KT(_e)},[]);const ye=d?"none":"auto";return Gt.jsx("div",{ref:X,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:ye,...a},...z,children:Gt.jsx("div",{ref:U,style:{width:"100%",height:"100%"},children:Gt.jsx("canvas",{ref:Q,style:{display:"block"},children:t})})})}function ZO(o){return Gt.jsx(VT,{children:Gt.jsx(jO,{...o})})}function QO({rotation:o,scale:e}){const[t,i,a]=JS(fT,["https://pjkpjk.github.io/minecraft-textures/textures/block/grass_block_top.png","https://pjkpjk.github.io/minecraft-textures/textures/block/grass_block_side.png","https://pjkpjk.github.io/minecraft-textures/textures/block/dirt.png"]);return[t,i,a].forEach(u=>u.magFilter=Ti),Gt.jsxs("mesh",{rotation:o,scale:e,children:[Gt.jsx("boxGeometry",{args:[1,1,1]}),Gt.jsx("meshStandardMaterial",{attach:"material-0",map:i}),Gt.jsx("meshStandardMaterial",{attach:"material-1",map:i}),Gt.jsx("meshStandardMaterial",{attach:"material-2",map:t}),Gt.jsx("meshStandardMaterial",{attach:"material-3",map:a}),Gt.jsx("meshStandardMaterial",{attach:"material-4",map:i}),Gt.jsx("meshStandardMaterial",{attach:"material-5",map:i})]})}function JO(){const o=Bt.useRef(null),[e,t]=Bt.useState([.4,.4,0]),[i,a]=Bt.useState(1.2),[u,f]=Bt.useState(!1);return Bt.useEffect(()=>{if(!window.Hands||!window.Camera)return;const d=new window.Hands({locateFile:g=>`https://cdn.jsdelivr.net/npm/@mediapipe/hands/${g}`});d.setOptions({maxNumHands:2,modelComplexity:1,minDetectionConfidence:.5,minTrackingConfidence:.5}),d.onResults(g=>{g.multiHandLandmarks&&g.multiHandLandmarks.length>0?(f(!0),g.multiHandLandmarks.forEach((_,S)=>{if(g.multiHandedness[S].label==="Right")t([_[0].y*4,-_[0].x*4,0]);else{const M=Math.hypot(_[4].x-_[8].x,_[4].y-_[8].y);a(M*10)}})):f(!1)}),new window.Camera(o.current,{onFrame:async()=>{await d.send({image:o.current})},width:640,height:480}).start()},[]),Gt.jsxs("div",{style:{padding:"40px",fontFamily:'"Segoe UI", Roboto, Helvetica, Arial, sans-serif',maxWidth:"1000px",margin:"0 auto",color:"#1a1a1a"},children:[Gt.jsxs("div",{style:{position:"relative",width:"100%",height:"550px",borderRadius:"24px",overflow:"hidden",backgroundColor:"#000",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[Gt.jsx("video",{ref:o,style:{position:"absolute",width:"100%",height:"100%",objectFit:"cover",transform:"scaleX(-1)"}}),Gt.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",zIndex:2},children:Gt.jsxs(ZO,{camera:{position:[0,0,3]},alpha:!0,children:[Gt.jsx("ambientLight",{intensity:1.5}),Gt.jsx("pointLight",{position:[10,10,10]}),Gt.jsx(Bt.Suspense,{fallback:null,children:Gt.jsx(QO,{rotation:e,scale:i})})]})}),Gt.jsx("div",{style:{position:"absolute",top:"24px",left:"24px",zIndex:3,background:"rgba(20, 20, 20, 0.8)",color:"white",padding:"12px 24px",borderRadius:"12px",fontSize:"14px",fontWeight:"500",backdropFilter:"blur(10px)",border:"1px solid rgba(255,255,255,0.1)",transition:"all 0.3s ease"},children:u?"● Hand tracking active - Show your hands":"○ Looking for hands..."})]}),Gt.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr",marginTop:"60px",gap:"60px"},children:[Gt.jsx("div",{children:Gt.jsx("h2",{style:{fontSize:"28px",fontWeight:"800",lineHeight:"1.2",margin:0},children:"4. Floating Minecraft Grass Block"})}),Gt.jsxs("div",{children:[Gt.jsxs("p",{style:{color:"#666",fontSize:"16px",lineHeight:"1.6",margin:"0 0 24px 0"},children:[Gt.jsx("span",{style:{fontStyle:"italic"},children:"Interactive 3D Minecraft Cube Controller"}),Gt.jsx("br",{}),"Computer Vision & Web Development",Gt.jsx("br",{}),"MediaPipe, Three.js & React"]}),Gt.jsxs("p",{style:{fontSize:"18px",lineHeight:"1.7",color:"#444"},children:["Use your ",Gt.jsx("strong",{children:"left hand"})," to scale the size of the cube, and your ",Gt.jsx("strong",{children:"right hand"})," to rotate it. Do you know your left from your right? ",Gt.jsx("br",{}),Gt.jsx("br",{}),Gt.jsx("span",{style:{fontSize:"15px",fontWeight:"600",color:"#000"},children:"Note: This project requires webcam access and works best with good lighting."})]})]})]})]})}GA.createRoot(document.getElementById("root")).render(Gt.jsx(Bt.StrictMode,{children:Gt.jsx(JO,{})}));