From 6587e52e95ad5f8bb770d312cf0802e0360e1036 Mon Sep 17 00:00:00 2001 From: Abhinav-Chdhary Date: Fri, 19 Jan 2024 07:28:42 +0000 Subject: [PATCH] deploy: 2eb9486a03320279c653356abaa54ec450c5f9b1 --- assets/index-Gvk5cp7B.js | 3767 ------------------------------------- assets/index-HJ2XngBo.css | 1 + assets/index-SqCC5jTt.js | 3767 +++++++++++++++++++++++++++++++++++++ assets/index-s3jhMeAI.css | 1 - index.html | 4 +- 5 files changed, 3770 insertions(+), 3770 deletions(-) delete mode 100644 assets/index-Gvk5cp7B.js create mode 100644 assets/index-HJ2XngBo.css create mode 100644 assets/index-SqCC5jTt.js delete mode 100644 assets/index-s3jhMeAI.css diff --git a/assets/index-Gvk5cp7B.js b/assets/index-Gvk5cp7B.js deleted file mode 100644 index 0edaa07..0000000 --- a/assets/index-Gvk5cp7B.js +++ /dev/null @@ -1,3767 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function Tv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Y3={exports:{}},Sp={},q3={exports:{}},bt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jc=Symbol.for("react.element"),DA=Symbol.for("react.portal"),UA=Symbol.for("react.fragment"),zA=Symbol.for("react.strict_mode"),OA=Symbol.for("react.profiler"),FA=Symbol.for("react.provider"),kA=Symbol.for("react.context"),BA=Symbol.for("react.forward_ref"),HA=Symbol.for("react.suspense"),VA=Symbol.for("react.memo"),GA=Symbol.for("react.lazy"),Hx=Symbol.iterator;function WA(n){return n===null||typeof n!="object"?null:(n=Hx&&n[Hx]||n["@@iterator"],typeof n=="function"?n:null)}var Z3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K3=Object.assign,J3={};function Ql(n,e,t){this.props=n,this.context=e,this.refs=J3,this.updater=t||Z3}Ql.prototype.isReactComponent={};Ql.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};Ql.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Q3(){}Q3.prototype=Ql.prototype;function Av(n,e,t){this.props=n,this.context=e,this.refs=J3,this.updater=t||Z3}var Cv=Av.prototype=new Q3;Cv.constructor=Av;K3(Cv,Ql.prototype);Cv.isPureReactComponent=!0;var Vx=Array.isArray,$3=Object.prototype.hasOwnProperty,bv={current:null},eM={key:!0,ref:!0,__self:!0,__source:!0};function tM(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)$3.call(e,i)&&!eM.hasOwnProperty(i)&&(r[i]=e[i]);var l=arguments.length-2;if(l===1)r.children=t;else if(1>>1,J=N[q];if(0>>1;qr(ge,H))Aer(Ce,ge)?(N[q]=Ce,N[Ae]=H,q=Ae):(N[q]=ge,N[ae]=H,q=ae);else if(Aer(Ce,H))N[q]=Ce,N[Ae]=H,q=Ae;else break e}}return k}function r(N,k){var H=N.sortIndex-k.sortIndex;return H!==0?H:N.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();n.unstable_now=function(){return o.now()-l}}var c=[],f=[],h=1,d=null,m=3,v=!1,_=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(N){for(var k=t(f);k!==null;){if(k.callback===null)i(f);else if(k.startTime<=N)i(f),k.sortIndex=k.expirationTime,e(c,k);else break;k=t(f)}}function T(N){if(w=!1,M(N),!_)if(t(c)!==null)_=!0,te(P);else{var k=t(f);k!==null&&ce(T,k.startTime-N)}}function P(N,k){_=!1,w&&(w=!1,g(z),z=-1),v=!0;var H=m;try{for(M(k),d=t(c);d!==null&&(!(d.expirationTime>k)||N&&!B());){var q=d.callback;if(typeof q=="function"){d.callback=null,m=d.priorityLevel;var J=q(d.expirationTime<=k);k=n.unstable_now(),typeof J=="function"?d.callback=J:d===t(c)&&i(c),M(k)}else i(c);d=t(c)}if(d!==null)var K=!0;else{var ae=t(f);ae!==null&&ce(T,ae.startTime-k),K=!1}return K}finally{d=null,m=H,v=!1}}var C=!1,L=null,z=-1,b=5,R=-1;function B(){return!(n.unstable_now()-RN||125q?(N.sortIndex=H,e(f,N),t(c)===null&&N===t(f)&&(w?(g(z),z=-1):w=!0,ce(T,H-q))):(N.sortIndex=J,e(c,N),_||v||(_=!0,te(P))),N},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(N){var k=m;return function(){var H=m;m=k;try{return N.apply(this,arguments)}finally{m=H}}}})(sM);rM.exports=sM;var tC=rM.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var oM=be,Wi=tC;function Me(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kg=Object.prototype.hasOwnProperty,nC=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Wx={},Xx={};function iC(n){return kg.call(Xx,n)?!0:kg.call(Wx,n)?!1:nC.test(n)?Xx[n]=!0:(Wx[n]=!0,!1)}function rC(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function sC(n,e,t,i){if(e===null||typeof e>"u"||rC(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function vi(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Wn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Wn[n]=new vi(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Wn[e]=new vi(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Wn[n]=new vi(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Wn[n]=new vi(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Wn[n]=new vi(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Wn[n]=new vi(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Wn[n]=new vi(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Wn[n]=new vi(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Wn[n]=new vi(n,5,!1,n.toLowerCase(),null,!1,!1)});var Pv=/[\-:]([a-z])/g;function Lv(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(Pv,Lv);Wn[e]=new vi(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(Pv,Lv);Wn[e]=new vi(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(Pv,Lv);Wn[e]=new vi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Wn[n]=new vi(n,1,!1,n.toLowerCase(),null,!1,!1)});Wn.xlinkHref=new vi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Wn[n]=new vi(n,1,!1,n.toLowerCase(),null,!0,!0)});function Iv(n,e,t,i){var r=Wn.hasOwnProperty(e)?Wn[e]:null;(r!==null?r.type!==0:i||!(2l||r[o]!==s[l]){var c=` -`+r[o].replace(" at new "," at ");return n.displayName&&c.includes("")&&(c=c.replace("",n.displayName)),c}while(1<=o&&0<=l);break}}}finally{S0=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Yu(n):""}function oC(n){switch(n.tag){case 5:return Yu(n.type);case 16:return Yu("Lazy");case 13:return Yu("Suspense");case 19:return Yu("SuspenseList");case 0:case 2:case 15:return n=M0(n.type,!1),n;case 11:return n=M0(n.type.render,!1),n;case 1:return n=M0(n.type,!0),n;default:return""}}function Gg(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case ml:return"Fragment";case pl:return"Portal";case Bg:return"Profiler";case Nv:return"StrictMode";case Hg:return"Suspense";case Vg:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case uM:return(n.displayName||"Context")+".Consumer";case lM:return(n._context.displayName||"Context")+".Provider";case Dv:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Uv:return e=n.displayName||null,e!==null?e:Gg(n.type)||"Memo";case js:e=n._payload,n=n._init;try{return Gg(n(e))}catch{}}return null}function aC(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Gg(e);case 8:return e===Nv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function fo(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function fM(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function lC(n){var e=fM(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function hh(n){n._valueTracker||(n._valueTracker=lC(n))}function hM(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=fM(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function Hd(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Wg(n,e){var t=e.checked;return on({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function Yx(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=fo(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function dM(n,e){e=e.checked,e!=null&&Iv(n,"checked",e,!1)}function Xg(n,e){dM(n,e);var t=fo(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?jg(n,e.type,t):e.hasOwnProperty("defaultValue")&&jg(n,e.type,fo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function qx(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function jg(n,e,t){(e!=="number"||Hd(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var qu=Array.isArray;function Il(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=dh.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function pc(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Qu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},uC=["Webkit","ms","Moz","O"];Object.keys(Qu).forEach(function(n){uC.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Qu[e]=Qu[n]})});function vM(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Qu.hasOwnProperty(n)&&Qu[n]?(""+e).trim():e+"px"}function yM(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=vM(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var cC=on({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zg(n,e){if(e){if(cC[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Me(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Me(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Me(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Me(62))}}function Kg(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Jg=null;function zv(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Qg=null,Nl=null,Dl=null;function Jx(n){if(n=ef(n)){if(typeof Qg!="function")throw Error(Me(280));var e=n.stateNode;e&&(e=Ap(e),Qg(n.stateNode,n.type,e))}}function _M(n){Nl?Dl?Dl.push(n):Dl=[n]:Nl=n}function xM(){if(Nl){var n=Nl,e=Dl;if(Dl=Nl=null,Jx(n),e)for(n=0;n>>=0,n===0?32:31-(SC(n)/MC|0)|0}var ph=64,mh=4194304;function Zu(n){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: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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Xd(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var l=o&~r;l!==0?i=Zu(l):(s&=o,s!==0&&(i=Zu(s)))}else o=t&~r,o!==0?i=Zu(o):s!==0&&(i=Zu(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function Qc(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Tr(e),n[e]=t}function AC(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=ec),o2=" ",a2=!1;function BM(n,e){switch(n){case"keyup":return e5.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HM(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var gl=!1;function n5(n,e){switch(n){case"compositionend":return HM(e);case"keypress":return e.which!==32?null:(a2=!0,o2);case"textInput":return n=e.data,n===o2&&a2?null:n;default:return null}}function i5(n,e){if(gl)return n==="compositionend"||!Wv&&BM(n,e)?(n=FM(),Td=Hv=Js=null,gl=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=f2(t)}}function XM(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?XM(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function jM(){for(var n=window,e=Hd();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=Hd(n.document)}return e}function Xv(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function h5(n){var e=jM(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&XM(t.ownerDocument.documentElement,t)){if(i!==null&&Xv(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=h2(t,s);var o=h2(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,vl=null,r1=null,nc=null,s1=!1;function d2(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;s1||vl==null||vl!==Hd(i)||(i=vl,"selectionStart"in i&&Xv(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),nc&&xc(nc,i)||(nc=i,i=qd(r1,"onSelect"),0xl||(n.current=f1[xl],f1[xl]=null,xl--)}function Xt(n,e){xl++,f1[xl]=n.current,n.current=e}var ho={},oi=yo(ho),Ci=yo(!1),ca=ho;function Bl(n,e){var t=n.type.contextTypes;if(!t)return ho;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function bi(n){return n=n.childContextTypes,n!=null}function Kd(){qt(Ci),qt(oi)}function x2(n,e,t){if(oi.current!==ho)throw Error(Me(168));Xt(oi,e),Xt(Ci,t)}function tw(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Me(108,aC(n)||"Unknown",r));return on({},t,i)}function Jd(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ho,ca=oi.current,Xt(oi,n),Xt(Ci,Ci.current),!0}function S2(n,e,t){var i=n.stateNode;if(!i)throw Error(Me(169));t?(n=tw(n,e,ca),i.__reactInternalMemoizedMergedChildContext=n,qt(Ci),qt(oi),Xt(oi,n)):qt(Ci),Xt(Ci,t)}var fs=null,Cp=!1,z0=!1;function nw(n){fs===null?fs=[n]:fs.push(n)}function E5(n){Cp=!0,nw(n)}function _o(){if(!z0&&fs!==null){z0=!0;var n=0,e=kt;try{var t=fs;for(kt=1;n>=o,r-=o,ps=1<<32-Tr(e)+r|t<z?(b=L,L=null):b=L.sibling;var R=m(g,L,M[z],T);if(R===null){L===null&&(L=b);break}n&&L&&R.alternate===null&&e(g,L),S=s(R,S,z),C===null?P=R:C.sibling=R,C=R,L=b}if(z===M.length)return t(g,L),Qt&&Go(g,z),P;if(L===null){for(;zz?(b=L,L=null):b=L.sibling;var B=m(g,L,R.value,T);if(B===null){L===null&&(L=b);break}n&&L&&B.alternate===null&&e(g,L),S=s(B,S,z),C===null?P=B:C.sibling=B,C=B,L=b}if(R.done)return t(g,L),Qt&&Go(g,z),P;if(L===null){for(;!R.done;z++,R=M.next())R=d(g,R.value,T),R!==null&&(S=s(R,S,z),C===null?P=R:C.sibling=R,C=R);return Qt&&Go(g,z),P}for(L=i(g,L);!R.done;z++,R=M.next())R=v(L,g,z,R.value,T),R!==null&&(n&&R.alternate!==null&&L.delete(R.key===null?z:R.key),S=s(R,S,z),C===null?P=R:C.sibling=R,C=R);return n&&L.forEach(function(Z){return e(g,Z)}),Qt&&Go(g,z),P}function x(g,S,M,T){if(typeof M=="object"&&M!==null&&M.type===ml&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case fh:e:{for(var P=M.key,C=S;C!==null;){if(C.key===P){if(P=M.type,P===ml){if(C.tag===7){t(g,C.sibling),S=r(C,M.props.children),S.return=g,g=S;break e}}else if(C.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===js&&b2(P)===C.type){t(g,C.sibling),S=r(C,M.props),S.ref=Lu(g,C,M),S.return=g,g=S;break e}t(g,C);break}else e(g,C);C=C.sibling}M.type===ml?(S=ra(M.props.children,g.mode,T,M.key),S.return=g,g=S):(T=Nd(M.type,M.key,M.props,null,g.mode,T),T.ref=Lu(g,S,M),T.return=g,g=T)}return o(g);case pl:e:{for(C=M.key;S!==null;){if(S.key===C)if(S.tag===4&&S.stateNode.containerInfo===M.containerInfo&&S.stateNode.implementation===M.implementation){t(g,S.sibling),S=r(S,M.children||[]),S.return=g,g=S;break e}else{t(g,S);break}else e(g,S);S=S.sibling}S=W0(M,g.mode,T),S.return=g,g=S}return o(g);case js:return C=M._init,x(g,S,C(M._payload),T)}if(qu(M))return _(g,S,M,T);if(Au(M))return w(g,S,M,T);Mh(g,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,S!==null&&S.tag===6?(t(g,S.sibling),S=r(S,M),S.return=g,g=S):(t(g,S),S=G0(M,g.mode,T),S.return=g,g=S),o(g)):t(g,S)}return x}var Vl=cw(!0),fw=cw(!1),tf={},Wr=yo(tf),Ec=yo(tf),Tc=yo(tf);function Qo(n){if(n===tf)throw Error(Me(174));return n}function ey(n,e){switch(Xt(Tc,e),Xt(Ec,n),Xt(Wr,tf),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:qg(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=qg(e,n)}qt(Wr),Xt(Wr,e)}function Gl(){qt(Wr),qt(Ec),qt(Tc)}function hw(n){Qo(Tc.current);var e=Qo(Wr.current),t=qg(e,n.type);e!==t&&(Xt(Ec,n),Xt(Wr,t))}function ty(n){Ec.current===n&&(qt(Wr),qt(Ec))}var tn=yo(0);function ip(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var O0=[];function ny(){for(var n=0;nt?t:4,n(!0);var i=F0.transition;F0.transition={};try{n(!1),e()}finally{kt=t,F0.transition=i}}function bw(){return fr().memoizedState}function b5(n,e,t){var i=oo(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},Rw(n))Pw(e,t);else if(t=ow(n,e,t,i),t!==null){var r=di();Ar(t,n,i,r),Lw(t,e,i)}}function R5(n,e,t){var i=oo(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(Rw(n))Pw(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,t);if(r.hasEagerState=!0,r.eagerState=l,Cr(l,o)){var c=e.interleaved;c===null?(r.next=r,Qv(e)):(r.next=c.next,c.next=r),e.interleaved=r;return}}catch{}finally{}t=ow(n,e,r,i),t!==null&&(r=di(),Ar(t,n,i,r),Lw(t,e,i))}}function Rw(n){var e=n.alternate;return n===sn||e!==null&&e===sn}function Pw(n,e){ic=rp=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function Lw(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Fv(n,t)}}var sp={readContext:cr,useCallback:Kn,useContext:Kn,useEffect:Kn,useImperativeHandle:Kn,useInsertionEffect:Kn,useLayoutEffect:Kn,useMemo:Kn,useReducer:Kn,useRef:Kn,useState:Kn,useDebugValue:Kn,useDeferredValue:Kn,useTransition:Kn,useMutableSource:Kn,useSyncExternalStore:Kn,useId:Kn,unstable_isNewReconciler:!1},P5={readContext:cr,useCallback:function(n,e){return Br().memoizedState=[n,e===void 0?null:e],n},useContext:cr,useEffect:P2,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Rd(4194308,4,ww.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Rd(4194308,4,n,e)},useInsertionEffect:function(n,e){return Rd(4,2,n,e)},useMemo:function(n,e){var t=Br();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Br();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=b5.bind(null,sn,n),[i.memoizedState,n]},useRef:function(n){var e=Br();return n={current:n},e.memoizedState=n},useState:R2,useDebugValue:ay,useDeferredValue:function(n){return Br().memoizedState=n},useTransition:function(){var n=R2(!1),e=n[0];return n=C5.bind(null,n[1]),Br().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=sn,r=Br();if(Qt){if(t===void 0)throw Error(Me(407));t=t()}else{if(t=e(),On===null)throw Error(Me(349));ha&30||mw(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,P2(vw.bind(null,i,s,n),[n]),i.flags|=2048,bc(9,gw.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=Br(),e=On.identifierPrefix;if(Qt){var t=ms,i=ps;t=(i&~(1<<32-Tr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Ac++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Hr]=e,n[wc]=i,Bw(n,e,!1,!1),e.stateNode=n;e:{switch(o=Kg(t,i),t){case"dialog":Yt("cancel",n),Yt("close",n),r=i;break;case"iframe":case"object":case"embed":Yt("load",n),r=i;break;case"video":case"audio":for(r=0;rXl&&(e.flags|=128,i=!0,Iu(s,!1),e.lanes=4194304)}else{if(!i)if(n=ip(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Iu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Qt)return Jn(e),null}else 2*yn()-s.renderingStartTime>Xl&&t!==1073741824&&(e.flags|=128,i=!0,Iu(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=yn(),e.sibling=null,t=tn.current,Xt(tn,i?t&1|2:t&1),e):(Jn(e),null);case 22:case 23:return dy(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Fi&1073741824&&(Jn(e),e.subtreeFlags&6&&(e.flags|=8192)):Jn(e),null;case 24:return null;case 25:return null}throw Error(Me(156,e.tag))}function F5(n,e){switch(Yv(e),e.tag){case 1:return bi(e.type)&&Kd(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Gl(),qt(Ci),qt(oi),ny(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return ty(e),null;case 13:if(qt(tn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Me(340));Hl()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return qt(tn),null;case 4:return Gl(),null;case 10:return Jv(e.type._context),null;case 22:case 23:return dy(),null;case 24:return null;default:return null}}var Eh=!1,ni=!1,k5=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function El(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){cn(n,e,i)}else t.current=null}function w1(n,e,t){try{t()}catch(i){cn(n,e,i)}}var k2=!1;function B5(n,e){if(o1=jd,n=jM(),Xv(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,l=-1,c=-1,f=0,h=0,d=n,m=null;t:for(;;){for(var v;d!==t||r!==0&&d.nodeType!==3||(l=o+r),d!==s||i!==0&&d.nodeType!==3||(c=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(v=d.firstChild)!==null;)m=d,d=v;for(;;){if(d===n)break t;if(m===t&&++f===r&&(l=o),m===s&&++h===i&&(c=o),(v=d.nextSibling)!==null)break;d=m,m=d.parentNode}d=v}t=l===-1||c===-1?null:{start:l,end:c}}else t=null}t=t||{start:0,end:0}}else t=null;for(a1={focusedElem:n,selectionRange:t},jd=!1,Ve=e;Ve!==null;)if(e=Ve,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ve=n;else for(;Ve!==null;){e=Ve;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var w=_.memoizedProps,x=_.memoizedState,g=e.stateNode,S=g.getSnapshotBeforeUpdate(e.elementType===e.type?w:_r(e.type,w),x);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var M=e.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Me(163))}}catch(T){cn(e,e.return,T)}if(n=e.sibling,n!==null){n.return=e.return,Ve=n;break}Ve=e.return}return _=k2,k2=!1,_}function rc(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&w1(e,t,s)}r=r.next}while(r!==i)}}function Pp(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function E1(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function Gw(n){var e=n.alternate;e!==null&&(n.alternate=null,Gw(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Hr],delete e[wc],delete e[c1],delete e[M5],delete e[w5])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function Ww(n){return n.tag===5||n.tag===3||n.tag===4}function B2(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Ww(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.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 T1(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Zd));else if(i!==4&&(n=n.child,n!==null))for(T1(n,e,t),n=n.sibling;n!==null;)T1(n,e,t),n=n.sibling}function A1(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(A1(n,e,t),n=n.sibling;n!==null;)A1(n,e,t),n=n.sibling}var Vn=null,Sr=!1;function Fs(n,e,t){for(t=t.child;t!==null;)Xw(n,e,t),t=t.sibling}function Xw(n,e,t){if(Gr&&typeof Gr.onCommitFiberUnmount=="function")try{Gr.onCommitFiberUnmount(Mp,t)}catch{}switch(t.tag){case 5:ni||El(t,e);case 6:var i=Vn,r=Sr;Vn=null,Fs(n,e,t),Vn=i,Sr=r,Vn!==null&&(Sr?(n=Vn,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Vn.removeChild(t.stateNode));break;case 18:Vn!==null&&(Sr?(n=Vn,t=t.stateNode,n.nodeType===8?U0(n.parentNode,t):n.nodeType===1&&U0(n,t),yc(n)):U0(Vn,t.stateNode));break;case 4:i=Vn,r=Sr,Vn=t.stateNode.containerInfo,Sr=!0,Fs(n,e,t),Vn=i,Sr=r;break;case 0:case 11:case 14:case 15:if(!ni&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&w1(t,e,o),r=r.next}while(r!==i)}Fs(n,e,t);break;case 1:if(!ni&&(El(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(l){cn(t,e,l)}Fs(n,e,t);break;case 21:Fs(n,e,t);break;case 22:t.mode&1?(ni=(i=ni)||t.memoizedState!==null,Fs(n,e,t),ni=i):Fs(n,e,t);break;default:Fs(n,e,t)}}function H2(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new k5),e.forEach(function(i){var r=Z5.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function mr(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=yn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*V5(i/1960))-i,10n?16:n,Qs===null)var i=!1;else{if(n=Qs,Qs=null,lp=0,It&6)throw Error(Me(331));var r=It;for(It|=4,Ve=n.current;Ve!==null;){var s=Ve,o=s.child;if(Ve.flags&16){var l=s.deletions;if(l!==null){for(var c=0;cyn()-fy?ia(n,0):cy|=t),Ri(n,e)}function $w(n,e){e===0&&(n.mode&1?(e=mh,mh<<=1,!(mh&130023424)&&(mh=4194304)):e=1);var t=di();n=ws(n,e),n!==null&&(Qc(n,e,t),Ri(n,t))}function q5(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),$w(n,t)}function Z5(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Me(314))}i!==null&&i.delete(e),$w(n,t)}var eE;eE=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Ci.current)Ai=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Ai=!1,z5(n,e,t);Ai=!!(n.flags&131072)}else Ai=!1,Qt&&e.flags&1048576&&iw(e,$d,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Pd(n,e),n=e.pendingProps;var r=Bl(e,oi.current);zl(e,t),r=ry(null,e,i,n,r,t);var s=sy();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,bi(i)?(s=!0,Jd(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,$v(e),r.updater=bp,e.stateNode=r,r._reactInternals=e,g1(e,i,n,t),e=_1(null,e,i,!0,s,t)):(e.tag=0,Qt&&s&&jv(e),fi(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Pd(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=J5(i),n=_r(i,n),r){case 0:e=y1(null,e,i,n,t);break e;case 1:e=z2(null,e,i,n,t);break e;case 11:e=D2(null,e,i,n,t);break e;case 14:e=U2(null,e,i,_r(i.type,n),t);break e}throw Error(Me(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:_r(i,r),y1(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:_r(i,r),z2(n,e,i,r,t);case 3:e:{if(Ow(e),n===null)throw Error(Me(387));i=e.pendingProps,s=e.memoizedState,r=s.element,aw(n,e),np(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Wl(Error(Me(423)),e),e=O2(n,e,i,t,r);break e}else if(i!==r){r=Wl(Error(Me(424)),e),e=O2(n,e,i,t,r);break e}else for(Hi=io(e.stateNode.containerInfo.firstChild),Vi=e,Qt=!0,Mr=null,t=fw(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Hl(),i===r){e=Es(n,e,t);break e}fi(n,e,i,t)}e=e.child}return e;case 5:return hw(e),n===null&&d1(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,l1(i,r)?o=null:s!==null&&l1(i,s)&&(e.flags|=32),zw(n,e),fi(n,e,o,t),e.child;case 6:return n===null&&d1(e),null;case 13:return Fw(n,e,t);case 4:return ey(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Vl(e,null,i,t):fi(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:_r(i,r),D2(n,e,i,r,t);case 7:return fi(n,e,e.pendingProps,t),e.child;case 8:return fi(n,e,e.pendingProps.children,t),e.child;case 12:return fi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,Xt(ep,i._currentValue),i._currentValue=o,s!==null)if(Cr(s.value,o)){if(s.children===r.children&&!Ci.current){e=Es(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var c=l.firstContext;c!==null;){if(c.context===i){if(s.tag===1){c=_s(-1,t&-t),c.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?c.next=c:(c.next=h.next,h.next=c),f.pending=c}}s.lanes|=t,c=s.alternate,c!==null&&(c.lanes|=t),p1(s.return,t,e),l.lanes|=t;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Me(341));o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),p1(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}fi(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,zl(e,t),r=cr(r),i=i(r),e.flags|=1,fi(n,e,i,t),e.child;case 14:return i=e.type,r=_r(i,e.pendingProps),r=_r(i.type,r),U2(n,e,i,r,t);case 15:return Dw(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:_r(i,r),Pd(n,e),e.tag=1,bi(i)?(n=!0,Jd(e)):n=!1,zl(e,t),uw(e,i,r),g1(e,i,r,t),_1(null,e,i,!0,n,t);case 19:return kw(n,e,t);case 22:return Uw(n,e,t)}throw Error(Me(156,e.tag))};function tE(n,e){return CM(n,e)}function K5(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ar(n,e,t,i){return new K5(n,e,t,i)}function my(n){return n=n.prototype,!(!n||!n.isReactComponent)}function J5(n){if(typeof n=="function")return my(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Dv)return 11;if(n===Uv)return 14}return 2}function ao(n,e){var t=n.alternate;return t===null?(t=ar(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function Nd(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")my(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case ml:return ra(t.children,r,s,e);case Nv:o=8,r|=8;break;case Bg:return n=ar(12,t,e,r|2),n.elementType=Bg,n.lanes=s,n;case Hg:return n=ar(13,t,e,r),n.elementType=Hg,n.lanes=s,n;case Vg:return n=ar(19,t,e,r),n.elementType=Vg,n.lanes=s,n;case cM:return Ip(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case lM:o=10;break e;case uM:o=9;break e;case Dv:o=11;break e;case Uv:o=14;break e;case js:o=16,i=null;break e}throw Error(Me(130,n==null?n:typeof n,""))}return e=ar(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function ra(n,e,t,i){return n=ar(7,n,i,e),n.lanes=t,n}function Ip(n,e,t,i){return n=ar(22,n,i,e),n.elementType=cM,n.lanes=t,n.stateNode={isHidden:!1},n}function G0(n,e,t){return n=ar(6,n,null,e),n.lanes=t,n}function W0(n,e,t){return e=ar(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function Q5(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=E0(0),this.expirationTimes=E0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=E0(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function gy(n,e,t,i,r,s,o,l,c){return n=new Q5(n,e,t,l,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ar(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},$v(s),n}function $5(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sE)}catch(n){console.error(n)}}sE(),iM.exports=Xi;var rb=iM.exports,Z2=rb;Fg.createRoot=Z2.createRoot,Fg.hydrateRoot=Z2.hydrateRoot;var oE={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},K2=$s.createContext&&$s.createContext(oE),sb=["attr","size","title"];function ob(n,e){if(n==null)return{};var t=ab(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ab(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s=0)&&(t[r]=n[r]);return t}function fp(){return fp=Object.assign?Object.assign.bind():function(n){for(var e=1;e$s.createElement(e.tag,hp({key:t},e.attr),aE(e.child)))}function Ht(n){return e=>$s.createElement(fb,fp({attr:hp({},n.attr)},e),aE(n.child))}function fb(n){var e=t=>{var{attr:i,size:r,title:s}=n,o=ob(n,sb),l=r||t.size||"1em",c;return t.className&&(c=t.className),n.className&&(c=(c?c+" ":"")+n.className),$s.createElement("svg",fp({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,o,{className:c,style:hp(hp({color:n.color||t.color},t.style),n.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&$s.createElement("title",null,s),n.children)};return K2!==void 0?$s.createElement(K2.Consumer,null,t=>e(t)):e(oE)}function hb(n){return Ht({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8Zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM8.146 4.992c-1.212 0-1.927.92-1.927 2.502v1.06c0 1.571.703 2.462 1.927 2.462.979 0 1.641-.586 1.729-1.418h1.295v.093c-.1 1.448-1.354 2.467-3.03 2.467-2.091 0-3.269-1.336-3.269-3.603V7.482c0-2.261 1.201-3.638 3.27-3.638 1.681 0 2.935 1.054 3.029 2.572v.088H9.875c-.088-.879-.768-1.512-1.729-1.512Z"},child:[]}]})(n)}function db(n){return Ht({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"},child:[]}]})(n)}function pb(n){return Ht({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854V1.146zm4.943 12.248V6.169H2.542v7.225h2.401zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248-.822 0-1.359.54-1.359 1.248 0 .694.521 1.248 1.327 1.248h.016zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a5.54 5.54 0 0 1 .016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225h2.4z"},child:[]}]})(n)}function mb(n){return Ht({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M71.92 34.77C50.2 47.67 7.4 96.84 7 109.73v21.34c0 27.06 25.29 50.84 48.25 50.84 27.57 0 50.54-22.85 50.54-50 0 27.12 22.18 50 49.76 50s49-22.85 49-50c0 27.12 23.59 50 51.16 50h.5c27.57 0 51.16-22.85 51.16-50 0 27.12 21.47 50 49 50s49.76-22.85 49.76-50c0 27.12 23 50 50.54 50 23 0 48.25-23.78 48.25-50.84v-21.34c-.4-12.9-43.2-62.07-64.92-75C372.56 32.4 325.76 32 256 32S91.14 33.1 71.92 34.77zm132.32 134.39c-22 38.4-77.9 38.71-99.85.25-13.17 23.14-43.17 32.07-56 27.66-3.87 40.15-13.67 237.13 17.73 269.15 80 18.67 302.08 18.12 379.76 0 31.65-32.27 21.32-232 17.75-269.15-12.92 4.44-42.88-4.6-56-27.66-22 38.52-77.85 38.1-99.85-.24-7.1 12.49-23.05 28.94-51.76 28.94a57.54 57.54 0 0 1-51.75-28.94zm-41.58 53.77c16.47 0 31.09 0 49.22 19.78a436.91 436.91 0 0 1 88.18 0C318.22 223 332.85 223 349.31 223c52.33 0 65.22 77.53 83.87 144.45 17.26 62.15-5.52 63.67-33.95 63.73-42.15-1.57-65.49-32.18-65.49-62.79-39.25 6.43-101.93 8.79-155.55 0 0 30.61-23.34 61.22-65.49 62.79-28.42-.06-51.2-1.58-33.94-63.73 18.67-67 31.56-144.45 83.88-144.45zM256 270.79s-44.38 40.77-52.35 55.21l29-1.17v25.32c0 1.55 21.34.16 23.33.16 11.65.54 23.31 1 23.31-.16v-25.28l29 1.17c-8-14.48-52.35-55.24-52.35-55.24z"},child:[]}]})(n)}function gb(n){return Ht({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M277.74 312.9c9.8-6.7 23.4-12.5 23.4-12.5s-38.7 7-77.2 10.2c-47.1 3.9-97.7 4.7-123.1 1.3-60.1-8 33-30.1 33-30.1s-36.1-2.4-80.6 19c-52.5 25.4 130 37 224.5 12.1zm-85.4-32.1c-19-42.7-83.1-80.2 0-145.8C296 53.2 242.84 0 242.84 0c21.5 84.5-75.6 110.1-110.7 162.6-23.9 35.9 11.7 74.4 60.2 118.2zm114.6-176.2c.1 0-175.2 43.8-91.5 140.2 24.7 28.4-6.5 54-6.5 54s62.7-32.4 33.9-72.9c-26.9-37.8-47.5-56.6 64.1-121.3zm-6.1 270.5a12.19 12.19 0 0 1-2 2.6c128.3-33.7 81.1-118.9 19.8-97.3a17.33 17.33 0 0 0-8.2 6.3 70.45 70.45 0 0 1 11-3c31-6.5 75.5 41.5-20.6 91.4zM348 437.4s14.5 11.9-15.9 21.2c-57.9 17.5-240.8 22.8-291.6.7-18.3-7.9 16-19 26.8-21.3 11.2-2.4 17.7-2 17.7-2-20.3-14.3-131.3 28.1-56.4 40.2C232.84 509.4 401 461.3 348 437.4zM124.44 396c-78.7 22 47.9 67.4 148.1 24.5a185.89 185.89 0 0 1-28.2-13.8c-44.7 8.5-65.4 9.1-106 4.5-33.5-3.8-13.9-15.2-13.9-15.2zm179.8 97.2c-78.7 14.8-175.8 13.1-233.3 3.6 0-.1 11.8 9.7 72.4 13.6 92.2 5.9 233.8-3.3 237.1-46.9 0 0-6.4 16.5-76.2 29.7zM260.64 353c-59.2 11.4-93.5 11.1-136.8 6.6-33.5-3.5-11.6-19.7-11.6-19.7-86.8 28.8 48.2 61.4 169.5 25.9a60.37 60.37 0 0 1-21.1-12.8z"},child:[]}]})(n)}function vb(n){return Ht({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 508c-6.7 0-13.5-1.8-19.4-5.2l-61.7-36.5c-9.2-5.2-4.7-7-1.7-8 12.3-4.3 14.8-5.2 27.9-12.7 1.4-.8 3.2-.5 4.6.4l47.4 28.1c1.7 1 4.1 1 5.7 0l184.7-106.6c1.7-1 2.8-3 2.8-5V149.3c0-2.1-1.1-4-2.9-5.1L226.8 37.7c-1.7-1-4-1-5.7 0L36.6 144.3c-1.8 1-2.9 3-2.9 5.1v213.1c0 2 1.1 4 2.9 4.9l50.6 29.2c27.5 13.7 44.3-2.4 44.3-18.7V167.5c0-3 2.4-5.3 5.4-5.3h23.4c2.9 0 5.4 2.3 5.4 5.3V378c0 36.6-20 57.6-54.7 57.6-10.7 0-19.1 0-42.5-11.6l-48.4-27.9C8.1 389.2.7 376.3.7 362.4V149.3c0-13.8 7.4-26.8 19.4-33.7L204.6 9c11.7-6.6 27.2-6.6 38.8 0l184.7 106.7c12 6.9 19.4 19.8 19.4 33.7v213.1c0 13.8-7.4 26.7-19.4 33.7L243.4 502.8c-5.9 3.4-12.6 5.2-19.4 5.2zm149.1-210.1c0-39.9-27-50.5-83.7-58-57.4-7.6-63.2-11.5-63.2-24.9 0-11.1 4.9-25.9 47.4-25.9 37.9 0 51.9 8.2 57.7 33.8.5 2.4 2.7 4.2 5.2 4.2h24c1.5 0 2.9-.6 3.9-1.7s1.5-2.6 1.4-4.1c-3.7-44.1-33-64.6-92.2-64.6-52.7 0-84.1 22.2-84.1 59.5 0 40.4 31.3 51.6 81.8 56.6 60.5 5.9 65.2 14.8 65.2 26.7 0 20.6-16.6 29.4-55.5 29.4-48.9 0-59.6-12.3-63.2-36.6-.4-2.6-2.6-4.5-5.3-4.5h-23.9c-3 0-5.3 2.4-5.3 5.3 0 31.1 16.9 68.2 97.8 68.2 58.4-.1 92-23.2 92-63.4z"},child:[]}]})(n)}function yb(n){return Ht({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"},child:[]}]})(n)}function _b(n){return Ht({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.2 177.2c-5.4-1.8-10.8-3.5-16.2-5.1.9-3.7 1.7-7.4 2.5-11.1 12.3-59.6 4.2-107.5-23.1-123.3-26.3-15.1-69.2.6-112.6 38.4-4.3 3.7-8.5 7.6-12.5 11.5-2.7-2.6-5.5-5.2-8.3-7.7-45.5-40.4-91.1-57.4-118.4-41.5-26.2 15.2-34 60.3-23 116.7 1.1 5.6 2.3 11.1 3.7 16.7-6.4 1.8-12.7 3.8-18.6 5.9C38.3 196.2 0 225.4 0 255.6c0 31.2 40.8 62.5 96.3 81.5 4.5 1.5 9 3 13.6 4.3-1.5 6-2.8 11.9-4 18-10.5 55.5-2.3 99.5 23.9 114.6 27 15.6 72.4-.4 116.6-39.1 3.5-3.1 7-6.3 10.5-9.7 4.4 4.3 9 8.4 13.6 12.4 42.8 36.8 85.1 51.7 111.2 36.6 27-15.6 35.8-62.9 24.4-120.5-.9-4.4-1.9-8.9-3-13.5 3.2-.9 6.3-1.9 9.4-2.9 57.7-19.1 99.5-50 99.5-81.7 0-30.3-39.4-59.7-93.8-78.4zM282.9 92.3c37.2-32.4 71.9-45.1 87.7-36 16.9 9.7 23.4 48.9 12.8 100.4-.7 3.4-1.4 6.7-2.3 10-22.2-5-44.7-8.6-67.3-10.6-13-18.6-27.2-36.4-42.6-53.1 3.9-3.7 7.7-7.2 11.7-10.7zM167.2 307.5c5.1 8.7 10.3 17.4 15.8 25.9-15.6-1.7-31.1-4.2-46.4-7.5 4.4-14.4 9.9-29.3 16.3-44.5 4.6 8.8 9.3 17.5 14.3 26.1zm-30.3-120.3c14.4-3.2 29.7-5.8 45.6-7.8-5.3 8.3-10.5 16.8-15.4 25.4-4.9 8.5-9.7 17.2-14.2 26-6.3-14.9-11.6-29.5-16-43.6zm27.4 68.9c6.6-13.8 13.8-27.3 21.4-40.6s15.8-26.2 24.4-38.9c15-1.1 30.3-1.7 45.9-1.7s31 .6 45.9 1.7c8.5 12.6 16.6 25.5 24.3 38.7s14.9 26.7 21.7 40.4c-6.7 13.8-13.9 27.4-21.6 40.8-7.6 13.3-15.7 26.2-24.2 39-14.9 1.1-30.4 1.6-46.1 1.6s-30.9-.5-45.6-1.4c-8.7-12.7-16.9-25.7-24.6-39s-14.8-26.8-21.5-40.6zm180.6 51.2c5.1-8.8 9.9-17.7 14.6-26.7 6.4 14.5 12 29.2 16.9 44.3-15.5 3.5-31.2 6.2-47 8 5.4-8.4 10.5-17 15.5-25.6zm14.4-76.5c-4.7-8.8-9.5-17.6-14.5-26.2-4.9-8.5-10-16.9-15.3-25.2 16.1 2 31.5 4.7 45.9 8-4.6 14.8-10 29.2-16.1 43.4zM256.2 118.3c10.5 11.4 20.4 23.4 29.6 35.8-19.8-.9-39.7-.9-59.5 0 9.8-12.9 19.9-24.9 29.9-35.8zM140.2 57c16.8-9.8 54.1 4.2 93.4 39 2.5 2.2 5 4.6 7.6 7-15.5 16.7-29.8 34.5-42.9 53.1-22.6 2-45 5.5-67.2 10.4-1.3-5.1-2.4-10.3-3.5-15.5-9.4-48.4-3.2-84.9 12.6-94zm-24.5 263.6c-4.2-1.2-8.3-2.5-12.4-3.9-21.3-6.7-45.5-17.3-63-31.2-10.1-7-16.9-17.8-18.8-29.9 0-18.3 31.6-41.7 77.2-57.6 5.7-2 11.5-3.8 17.3-5.5 6.8 21.7 15 43 24.5 63.6-9.6 20.9-17.9 42.5-24.8 64.5zm116.6 98c-16.5 15.1-35.6 27.1-56.4 35.3-11.1 5.3-23.9 5.8-35.3 1.3-15.9-9.2-22.5-44.5-13.5-92 1.1-5.6 2.3-11.2 3.7-16.7 22.4 4.8 45 8.1 67.9 9.8 13.2 18.7 27.7 36.6 43.2 53.4-3.2 3.1-6.4 6.1-9.6 8.9zm24.5-24.3c-10.2-11-20.4-23.2-30.3-36.3 9.6.4 19.5.6 29.5.6 10.3 0 20.4-.2 30.4-.7-9.2 12.7-19.1 24.8-29.6 36.4zm130.7 30c-.9 12.2-6.9 23.6-16.5 31.3-15.9 9.2-49.8-2.8-86.4-34.2-4.2-3.6-8.4-7.5-12.7-11.5 15.3-16.9 29.4-34.8 42.2-53.6 22.9-1.9 45.7-5.4 68.2-10.5 1 4.1 1.9 8.2 2.7 12.2 4.9 21.6 5.7 44.1 2.5 66.3zm18.2-107.5c-2.8.9-5.6 1.8-8.5 2.6-7-21.8-15.6-43.1-25.5-63.8 9.6-20.4 17.7-41.4 24.5-62.9 5.2 1.5 10.2 3.1 15 4.7 46.6 16 79.3 39.8 79.3 58 0 19.6-34.9 44.9-84.8 61.4zm-149.7-15c25.3 0 45.8-20.5 45.8-45.8s-20.5-45.8-45.8-45.8c-25.3 0-45.8 20.5-45.8 45.8s20.5 45.8 45.8 45.8z"},child:[]}]})(n)}function xb(n){return Ht({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M24 18.588a1.529 1.529 0 01-1.895-.72l-3.45-4.771-.5-.667-4.003 5.444a1.466 1.466 0 01-1.802.708l5.158-6.92-4.798-6.251a1.595 1.595 0 011.9.666l3.576 4.83 3.596-4.81a1.435 1.435 0 011.788-.668L21.708 7.9l-2.522 3.283a.666.666 0 000 .994l4.804 6.412zM.002 11.576l.42-2.075c1.154-4.103 5.858-5.81 9.094-3.27 1.895 1.489 2.368 3.597 2.275 5.973H1.116C.943 16.447 4.005 19.009 7.92 17.7a4.078 4.078 0 002.582-2.876c.207-.666.548-.78 1.174-.588a5.417 5.417 0 01-2.589 3.957 6.272 6.272 0 01-7.306-.933 6.575 6.575 0 01-1.64-3.858c0-.235-.08-.455-.134-.666A88.33 88.33 0 010 11.577zm1.127-.286h9.654c-.06-3.076-2.001-5.258-4.59-5.278-2.882-.04-4.944 2.094-5.071 5.264z"},child:[]}]})(n)}function Sb(n){return Ht({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.483 0a1.374 1.374 0 0 0-.961.438L7.116 6.226l-3.854 4.126a5.266 5.266 0 0 0-1.209 2.104 5.35 5.35 0 0 0-.125.513 5.527 5.527 0 0 0 .062 2.362 5.83 5.83 0 0 0 .349 1.017 5.938 5.938 0 0 0 1.271 1.818l4.277 4.193.039.038c2.248 2.165 5.852 2.133 8.063-.074l2.396-2.392c.54-.54.54-1.414.003-1.955a1.378 1.378 0 0 0-1.951-.003l-2.396 2.392a3.021 3.021 0 0 1-4.205.038l-.02-.019-4.276-4.193c-.652-.64-.972-1.469-.948-2.263a2.68 2.68 0 0 1 .066-.523 2.545 2.545 0 0 1 .619-1.164L9.13 8.114c1.058-1.134 3.204-1.27 4.43-.278l3.501 2.831c.593.48 1.461.387 1.94-.207a1.384 1.384 0 0 0-.207-1.943l-3.5-2.831c-.8-.647-1.766-1.045-2.774-1.202l2.015-2.158A1.384 1.384 0 0 0 13.483 0zm-2.866 12.815a1.38 1.38 0 0 0-1.38 1.382 1.38 1.38 0 0 0 1.38 1.382H20.79a1.38 1.38 0 0 0 1.38-1.382 1.38 1.38 0 0 0-1.38-1.382z"},child:[]}]})(n)}function Mb(n){return Ht({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z"},child:[]}]})(n)}function wb(n){return Ht({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.405 5.501c-.115 0-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77 18.695h-.927a50.854 50.854 0 00-.27-4.41h-.008l-1.41 4.41H2.45l-1.4-4.41h-.01a72.892 72.892 0 00-.195 4.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335 4.064h.008l1.347-4.064h1.095c.242 2.015.384 3.86.428 5.53zm4.017-4.08c-.378 2.045-.876 3.533-1.492 4.46-.482.716-1.01 1.073-1.583 1.073-.153 0-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268 0 .483-.075.647-.222.197-.18.295-.382.295-.605 0-.155-.077-.47-.23-.944L6.23 14.615h.91l.727 2.36c.164.536.233.91.205 1.123.4-1.064.678-2.227.835-3.483zm12.325 4.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253 0-1.83-.718-2.746-2.155-2.746-.704 0-1.254.232-1.65.697-.43.508-.646 1.256-.646 2.245 0 .972.19 1.686.574 2.14.35.41.877.615 1.583.615.264 0 .506-.033.725-.098l1.325.772.36-.622zM15.5 17.588c-.225-.36-.337-.94-.337-1.736 0-1.393.424-2.09 1.27-2.09.443 0 .77.167.977.5.224.362.336.936.336 1.723 0 1.404-.424 2.108-1.27 2.108-.445 0-.77-.167-.978-.5zm-1.658-.425c0 .47-.172.856-.516 1.156-.344.3-.803.45-1.384.45-.543 0-1.064-.172-1.573-.515l.237-.476c.438.22.833.328 1.19.328.332 0 .593-.073.783-.22a.754.754 0 00.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177 0-.45.157-.81.47-1.085.315-.278.72-.415 1.22-.415.512 0 .98.136 1.4.41l-.213.476a2.726 2.726 0 00-1.064-.23c-.283 0-.502.068-.654.206a.685.685 0 00-.248.524c0 .328.234.61.666.85.393.215 1.187.67 1.187.67.433.305.648.63.648 1.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223 3.223 0 00-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867 8.867 0 00-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69 17.69 0 01-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422 1.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146 1.693.194 2.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445 3.445 0 01-.35-.4 8.76 8.76 0 01-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188 1.01-.027.007-.014 0-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478 2.478 0 01-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953 5.953 0 012.085 2.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z"},child:[]}]})(n)}function Eb(n){return Ht({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.409 6.608L7.981.255l3.572 6.353H4.409zM8.411 0l3.569 6.348L15.552 0H8.411zm4.036 17.392l3.572 6.354 3.575-6.354h-7.147zm-.608-10.284h-7.43l3.715 6.605 3.715-6.605zm.428-.25h7.428L15.982.255l-3.715 6.603zM15.589 24l-3.569-6.349L8.448 24h7.141zm-3.856-6.858H4.306l3.712 6.603 3.715-6.603zm.428-.25h7.433l-3.718-6.605-3.715 6.605z"},child:[]}]})(n)}function Tb(n){return Ht({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0a12 12 0 1012 12A12 12 0 0012 0zm0 23.52A11.52 11.52 0 1123.52 12 11.52 11.52 0 0112 23.52zm7.13-9.791c-.206.997-1.126 3.557-4.06 4.942l-1.179-1.325-1.988 2a7.338 7.338 0 01-5.804-2.978 2.859 2.859 0 00.65.123c.326.006.678-.114.678-.66v-5.394a.89.89 0 00-1.116-.89c-.92.212-1.656 2.509-1.656 2.509a7.304 7.304 0 012.528-5.597 7.408 7.408 0 013.73-1.721c-1.006.573-1.57 1.507-1.57 2.29 0 1.262.76 1.109.984.923v7.28a1.157 1.157 0 00.148.256 1.075 1.075 0 00.88.445c.76 0 1.747-.868 1.747-.868V9.172c0-.6-.452-1.324-.905-1.572 0 0 .838-.149 1.484.346a5.537 5.537 0 01.387-.425c1.508-1.48 2.929-1.902 4.112-2.112 0 0-2.151 1.69-2.151 3.96 0 1.687.043 5.801.043 5.801.799.771 1.986-.342 3.059-1.441Z"},child:[]}]})(n)}function Ab(){return we.jsx("header",{className:"bg-gradient-to-r from-blue-950 via-blue-600 to-white p-4 text-white",children:we.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-around",children:[we.jsx("span",{className:"text-4xl p-2 font-bold mb-2 md:mb-0",children:"My Portfolio"}),we.jsxs("div",{className:"flex justify-around",children:[we.jsx("a",{href:"https://github.com/Abhinav-Chdhary",target:"_blank",rel:"noopener noreferrer",children:we.jsx("button",{className:"bg-gray-950 hover:bg-gray-800 text-white p-2 rounded-md m-2",children:we.jsx(db,{size:32})})}),we.jsx("a",{href:"https://www.linkedin.com/in/abhinavchdhary/",target:"_blank",rel:"noopener noreferrer",children:we.jsx("button",{className:"bg-blue-600 hover:bg-blue-500 text-white p-2 rounded-md m-2",children:we.jsx(pb,{size:32})})}),we.jsx("a",{href:"https://abhinav-choudhary.itch.io/",target:"_blank",rel:"noopener noreferrer",children:we.jsx("button",{className:"bg-red-500 hover:bg-red-700 text-white p-2 rounded-md m-2",children:we.jsx(mb,{size:32})})}),we.jsx("a",{href:"https://leetcode.com/Megh_nad/",target:"_blank",rel:"noopener noreferrer",children:we.jsx("button",{className:"bg-yellow-500 hover:bg-black text-white p-2 rounded-md m-2",children:we.jsx(Sb,{size:32})})})]})]})})}/** - * @license - * Copyright 2010-2023 Three.js Authors - * SPDX-License-Identifier: MIT - */const Op="160",Xo={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},jo={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},lE=0,L1=1,uE=2,Cb=3,cE=0,Fp=1,ac=2,xr=3,Ts=0,pi=1,Vr=2,bb=2,xs=0,sa=1,I1=2,N1=3,D1=4,fE=5,Ks=100,hE=101,dE=102,U1=103,z1=104,pE=200,mE=201,gE=202,vE=203,dp=204,pp=205,yE=206,_E=207,xE=208,SE=209,ME=210,wE=211,EE=212,TE=213,AE=214,CE=0,bE=1,RE=2,Pc=3,PE=4,LE=5,IE=6,NE=7,nf=0,DE=1,UE=2,Xr=0,zE=1,OE=2,FE=3,xy=4,kE=5,BE=6,O1="attached",HE="detached",kp=300,As=301,po=302,Lc=303,Ic=304,tu=306,Nc=1e3,ii=1001,Dc=1002,vn=1003,mp=1004,Rb=1004,lc=1005,Pb=1005,nn=1006,Sy=1007,Lb=1007,mo=1008,Ib=1008,jr=1009,VE=1010,GE=1011,Bp=1012,My=1013,gs=1014,lr=1015,ma=1016,wy=1017,Ey=1018,lo=1020,WE=1021,hi=1023,XE=1024,jE=1025,uo=1026,ga=1027,YE=1028,Ty=1029,qE=1030,Ay=1031,Cy=1033,Dd=33776,Ud=33777,zd=33778,Od=33779,F1=35840,k1=35841,B1=35842,H1=35843,by=36196,V1=37492,G1=37496,W1=37808,X1=37809,j1=37810,Y1=37811,q1=37812,Z1=37813,K1=37814,J1=37815,Q1=37816,$1=37817,ev=37818,tv=37819,nv=37820,iv=37821,Fd=36492,rv=36494,sv=36495,ZE=36283,ov=36284,av=36285,lv=36286,KE=2200,JE=2201,QE=2202,Uc=2300,zc=2301,kd=2302,$o=2400,ea=2401,Oc=2402,Hp=2500,Ry=2501,Nb=0,Db=1,Ub=2,Py=3e3,co=3001,$E=3200,eT=3201,xo=0,tT=1,Bi="",Tn="srgb",qr="srgb-linear",Vp="display-p3",rf="display-p3-linear",Fc="linear",Wt="srgb",kc="rec709",Bc="p3",zb=0,Yo=7680,Ob=7681,Fb=7682,kb=7683,Bb=34055,Hb=34056,Vb=5386,Gb=512,Wb=513,Xb=514,jb=515,Yb=516,qb=517,Zb=518,uv=519,nT=512,iT=513,rT=514,Ly=515,sT=516,oT=517,aT=518,lT=519,Hc=35044,Kb=35048,Jb=35040,Qb=35045,$b=35049,eR=35041,tR=35046,nR=35050,iR=35042,rR="100",cv="300 es",gp=1035,Er=2e3,jl=2001;class Kr{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+Qn[n>>16&255]+Qn[n>>24&255]+"-"+Qn[e&255]+Qn[e>>8&255]+"-"+Qn[e>>16&15|64]+Qn[e>>24&255]+"-"+Qn[t&63|128]+Qn[t>>8&255]+"-"+Qn[t>>16&255]+Qn[t>>24&255]+Qn[i&255]+Qn[i>>8&255]+Qn[i>>16&255]+Qn[i>>24&255]).toLowerCase()}function fn(n,e,t){return Math.max(e,Math.min(t,n))}function Iy(n,e){return(n%e+e)%e}function sR(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function oR(n,e,t){return n!==e?(t-n)/(e-n):0}function uc(n,e,t){return(1-t)*n+t*e}function aR(n,e,t,i){return uc(n,e,1-Math.exp(-t*i))}function lR(n,e=1){return e-Math.abs(Iy(n,e*2)-e)}function uR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function cR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function fR(n,e){return n+Math.floor(Math.random()*(e-n+1))}function hR(n,e){return n+Math.random()*(e-n)}function dR(n){return n*(.5-Math.random())}function pR(n){n!==void 0&&(Q2=n);let e=Q2+=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 mR(n){return n*oa}function gR(n){return n*Yl}function fv(n){return(n&n-1)===0&&n!==0}function vR(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function vp(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function yR(n,e,t,i,r){const s=Math.cos,o=Math.sin,l=s(t/2),c=o(t/2),f=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),m=o((e-i)/2),v=s((i-e)/2),_=o((i-e)/2);switch(r){case"XYX":n.set(l*h,c*d,c*m,l*f);break;case"YZY":n.set(c*m,l*h,c*d,l*f);break;case"ZXZ":n.set(c*d,c*m,l*h,l*f);break;case"XZX":n.set(l*h,c*_,c*v,l*f);break;case"YXY":n.set(c*v,l*h,c*_,l*f);break;case"ZYZ":n.set(c*_,c*v,l*h,l*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ti(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function xt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const _R={DEG2RAD:oa,RAD2DEG:Yl,generateUUID:Gi,clamp:fn,euclideanModulo:Iy,mapLinear:sR,inverseLerp:oR,lerp:uc,damp:aR,pingpong:lR,smoothstep:uR,smootherstep:cR,randInt:fR,randFloat:hR,randFloatSpread:dR,seededRandom:pR,degToRad:mR,radToDeg:gR,isPowerOfTwo:fv,ceilPowerOfTwo:vR,floorPowerOfTwo:vp,setQuaternionFromProperEuler:yR,normalize:xt,denormalize:Ti};class he{constructor(e=0,t=0){he.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,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=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(fn(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),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class wt{constructor(e,t,i,r,s,o,l,c,f){wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,l,c,f)}set(e,t,i,r,s,o,l,c,f){const h=this.elements;return h[0]=e,h[1]=r,h[2]=l,h[3]=t,h[4]=s,h[5]=c,h[6]=i,h[7]=o,h[8]=f,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,r=t.elements,s=this.elements,o=i[0],l=i[3],c=i[6],f=i[1],h=i[4],d=i[7],m=i[2],v=i[5],_=i[8],w=r[0],x=r[3],g=r[6],S=r[1],M=r[4],T=r[7],P=r[2],C=r[5],L=r[8];return s[0]=o*w+l*S+c*P,s[3]=o*x+l*M+c*C,s[6]=o*g+l*T+c*L,s[1]=f*w+h*S+d*P,s[4]=f*x+h*M+d*C,s[7]=f*g+h*T+d*L,s[2]=m*w+v*S+_*P,s[5]=m*x+v*M+_*C,s[8]=m*g+v*T+_*L,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],r=e[2],s=e[3],o=e[4],l=e[5],c=e[6],f=e[7],h=e[8];return t*o*h-t*l*f-i*s*h+i*l*c+r*s*f-r*o*c}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],l=e[5],c=e[6],f=e[7],h=e[8],d=h*o-l*f,m=l*c-h*s,v=f*s-o*c,_=t*d+i*m+r*v;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/_;return e[0]=d*w,e[1]=(r*f-h*i)*w,e[2]=(l*i-r*o)*w,e[3]=m*w,e[4]=(h*t-r*c)*w,e[5]=(r*s-l*t)*w,e[6]=v*w,e[7]=(i*c-f*t)*w,e[8]=(o*t-i*s)*w,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,r,s,o,l){const c=Math.cos(s),f=Math.sin(s);return this.set(i*c,i*f,-i*(c*o+f*l)+o+e,-r*f,r*c,-r*(-f*o+c*l)+l+t,0,0,1),this}scale(e,t){return this.premultiply(X0.makeScale(e,t)),this}rotate(e){return this.premultiply(X0.makeRotation(-e)),this}translate(e,t){return this.premultiply(X0.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 r=0;r<9;r++)if(t[r]!==i[r])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 X0=new wt;function uT(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const xR={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Al(n,e){return new xR[n](e)}function Vc(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function cT(){const n=Vc("canvas");return n.style.display="block",n}const $2={};function cc(n){n in $2||($2[n]=!0,console.warn(n))}const eS=new wt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),tS=new wt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ch={[qr]:{transfer:Fc,primaries:kc,toReference:n=>n,fromReference:n=>n},[Tn]:{transfer:Wt,primaries:kc,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[rf]:{transfer:Fc,primaries:Bc,toReference:n=>n.applyMatrix3(tS),fromReference:n=>n.applyMatrix3(eS)},[Vp]:{transfer:Wt,primaries:Bc,toReference:n=>n.convertSRGBToLinear().applyMatrix3(tS),fromReference:n=>n.applyMatrix3(eS).convertLinearToSRGB()}},SR=new Set([qr,rf]),Ot={enabled:!0,_workingColorSpace:qr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!SR.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Ch[e].toReference,r=Ch[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Ch[n].primaries},getTransfer:function(n){return n===Bi?Fc:Ch[n].transfer}};function Fl(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function j0(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ga;class Ny{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Ga===void 0&&(Ga=Vc("canvas")),Ga.width=e.width,Ga.height=e.height;const i=Ga.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Ga}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Vc("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==kp)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Nc:e.x=e.x-Math.floor(e.x);break;case ii:e.x=e.x<0?0:1;break;case Dc: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 Nc:e.y=e.y-Math.floor(e.y);break;case ii:e.y=e.y<0?0:1;break;case Dc: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)}get encoding(){return cc("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Tn?co:Py}set encoding(e){cc("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===co?Tn:Bi}}dn.DEFAULT_IMAGE=null;dn.DEFAULT_MAPPING=kp;dn.DEFAULT_ANISOTROPY=1;class Ft{constructor(e=0,t=0,i=0,r=1){Ft.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}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,r){return this.x=e,this.y=t,this.z=i,this.w=r,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,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,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,r,s;const c=e.elements,f=c[0],h=c[4],d=c[8],m=c[1],v=c[5],_=c[9],w=c[2],x=c[6],g=c[10];if(Math.abs(h-m)<.01&&Math.abs(d-w)<.01&&Math.abs(_-x)<.01){if(Math.abs(h+m)<.1&&Math.abs(d+w)<.1&&Math.abs(_+x)<.1&&Math.abs(f+v+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(f+1)/2,T=(v+1)/2,P=(g+1)/2,C=(h+m)/4,L=(d+w)/4,z=(_+x)/4;return M>T&&M>P?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=C/i,s=L/i):T>P?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=C/r,s=z/r):P<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(P),i=L/s,r=z/s),this.set(i,r,s,t),this}let S=Math.sqrt((x-_)*(x-_)+(d-w)*(d-w)+(m-h)*(m-h));return Math.abs(S)<.001&&(S=1),this.x=(x-_)/S,this.y=(d-w)/S,this.z=(m-h)/S,this.w=Math.acos((f+v+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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 fT extends Kr{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ft(0,0,e,t),this.scissorTest=!1,this.viewport=new Ft(0,0,e,t);const r={width:e,height:t,depth:1};i.encoding!==void 0&&(cc("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===co?Tn:Bi),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:nn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new dn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){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.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new ta(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class hr extends fT{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class Gp extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=vn,this.minFilter=vn,this.wrapR=ii,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ER extends hr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new Gp(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class Dy extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=vn,this.minFilter=vn,this.wrapR=ii,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class TR extends hr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new Dy(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class AR extends hr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o=0?1:-1,M=1-g*g;if(M>Number.EPSILON){const P=Math.sqrt(M),C=Math.atan2(P,g*S);x=Math.sin(x*C)/P,l=Math.sin(l*C)/P}const T=l*S;if(c=c*x+m*T,f=f*x+v*T,h=h*x+_*T,d=d*x+w*T,x===1-l){const P=1/Math.sqrt(c*c+f*f+h*h+d*d);c*=P,f*=P,h*=P,d*=P}}e[t]=c,e[t+1]=f,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const l=i[r],c=i[r+1],f=i[r+2],h=i[r+3],d=s[o],m=s[o+1],v=s[o+2],_=s[o+3];return e[t]=l*_+h*d+c*v-f*m,e[t+1]=c*_+h*m+f*d-l*v,e[t+2]=f*_+h*v+l*m-c*d,e[t+3]=h*_-l*d-c*m-f*v,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,r){return this._x=e,this._y=t,this._z=i,this._w=r,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,r=e._y,s=e._z,o=e._order,l=Math.cos,c=Math.sin,f=l(i/2),h=l(r/2),d=l(s/2),m=c(i/2),v=c(r/2),_=c(s/2);switch(o){case"XYZ":this._x=m*h*d+f*v*_,this._y=f*v*d-m*h*_,this._z=f*h*_+m*v*d,this._w=f*h*d-m*v*_;break;case"YXZ":this._x=m*h*d+f*v*_,this._y=f*v*d-m*h*_,this._z=f*h*_-m*v*d,this._w=f*h*d+m*v*_;break;case"ZXY":this._x=m*h*d-f*v*_,this._y=f*v*d+m*h*_,this._z=f*h*_+m*v*d,this._w=f*h*d-m*v*_;break;case"ZYX":this._x=m*h*d-f*v*_,this._y=f*v*d+m*h*_,this._z=f*h*_-m*v*d,this._w=f*h*d+m*v*_;break;case"YZX":this._x=m*h*d+f*v*_,this._y=f*v*d+m*h*_,this._z=f*h*_-m*v*d,this._w=f*h*d-m*v*_;break;case"XZY":this._x=m*h*d-f*v*_,this._y=f*v*d-m*h*_,this._z=f*h*_+m*v*d,this._w=f*h*d+m*v*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],l=t[5],c=t[9],f=t[2],h=t[6],d=t[10],m=i+l+d;if(m>0){const v=.5/Math.sqrt(m+1);this._w=.25/v,this._x=(h-c)*v,this._y=(s-f)*v,this._z=(o-r)*v}else if(i>l&&i>d){const v=2*Math.sqrt(1+i-l-d);this._w=(h-c)/v,this._x=.25*v,this._y=(r+o)/v,this._z=(s+f)/v}else if(l>d){const v=2*Math.sqrt(1+l-i-d);this._w=(s-f)/v,this._x=(r+o)/v,this._y=.25*v,this._z=(c+h)/v}else{const v=2*Math.sqrt(1+d-i-l);this._w=(o-r)/v,this._x=(s+f)/v,this._y=(c+h)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.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(fn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),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,r=e._y,s=e._z,o=e._w,l=t._x,c=t._y,f=t._z,h=t._w;return this._x=i*h+o*l+r*f-s*c,this._y=r*h+o*c+s*l-i*f,this._z=s*h+o*f+i*c-r*l,this._w=o*h-i*l-r*c-s*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let l=o*e._w+i*e._x+r*e._y+s*e._z;if(l<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),l>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const c=1-l*l;if(c<=Number.EPSILON){const v=1-t;return this._w=v*o+t*this._w,this._x=v*i+t*this._x,this._y=v*r+t*this._y,this._z=v*s+t*this._z,this.normalize(),this}const f=Math.sqrt(c),h=Math.atan2(f,l),d=Math.sin((1-t)*h)/f,m=Math.sin(t*h)/f;return this._w=o*d+this._w*m,this._x=i*d+this._x*m,this._y=r*d+this._y*m,this._z=s*d+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(r),i*Math.sin(s),i*Math.cos(s),t*Math.sin(r))}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 O{constructor(e=0,t=0,i=0){O.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(nS.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nS.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,l=e.z,c=e.w,f=2*(o*r-l*i),h=2*(l*t-s*r),d=2*(s*i-o*t);return this.x=t+c*f+o*d-l*h,this.y=i+c*h+l*f-s*d,this.z=r+c*d+s*h-o*f,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,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,r=e.y,s=e.z,o=t.x,l=t.y,c=t.z;return this.x=r*c-s*l,this.y=s*o-i*c,this.z=i*l-r*o,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 q0.copy(this).projectOnVector(e),this.sub(q0)}reflect(e){return this.sub(q0.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(fn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}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 r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*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(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,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()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const q0=new O,nS=new ri;class mi{constructor(e=new O(1/0,1/0,1/0),t=new O(-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;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,gr),gr.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(Du),Rh.subVectors(this.max,Du),Wa.subVectors(e.a,Du),Xa.subVectors(e.b,Du),ja.subVectors(e.c,Du),ks.subVectors(Xa,Wa),Bs.subVectors(ja,Xa),No.subVectors(Wa,ja);let t=[0,-ks.z,ks.y,0,-Bs.z,Bs.y,0,-No.z,No.y,ks.z,0,-ks.x,Bs.z,0,-Bs.x,No.z,0,-No.x,-ks.y,ks.x,0,-Bs.y,Bs.x,0,-No.y,No.x,0];return!Z0(t,Wa,Xa,ja,Rh)||(t=[1,0,0,0,1,0,0,0,1],!Z0(t,Wa,Xa,ja,Rh))?!1:(Ph.crossVectors(ks,Bs),t=[Ph.x,Ph.y,Ph.z],Z0(t,Wa,Xa,ja,Rh))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,gr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(gr).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:(rs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),rs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),rs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),rs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),rs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),rs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),rs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),rs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(rs),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 rs=[new O,new O,new O,new O,new O,new O,new O,new O],gr=new O,bh=new mi,Wa=new O,Xa=new O,ja=new O,ks=new O,Bs=new O,No=new O,Du=new O,Rh=new O,Ph=new O,Do=new O;function Z0(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Do.fromArray(n,s);const l=r.x*Math.abs(Do.x)+r.y*Math.abs(Do.y)+r.z*Math.abs(Do.z),c=e.dot(Do),f=t.dot(Do),h=i.dot(Do);if(Math.max(-Math.max(c,f,h),Math.min(c,f,h))>l)return!1}return!0}const CR=new mi,Uu=new O,K0=new O;class si{constructor(e=new O,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):CR.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.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;Uu.subVectors(e,this.center);const t=Uu.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Uu,r/i),this.radius+=r}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):(K0.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Uu.copy(e.center).add(K0)),this.expandByPoint(Uu.copy(e.center).sub(K0))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ss=new O,J0=new O,Lh=new O,Hs=new O,Q0=new O,Ih=new O,$0=new O;class Sa{constructor(e=new O,t=new O(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ss)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ss.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ss.copy(this.origin).addScaledVector(this.direction,t),ss.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){J0.copy(e).add(t).multiplyScalar(.5),Lh.copy(t).sub(e).normalize(),Hs.copy(this.origin).sub(J0);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Lh),l=Hs.dot(this.direction),c=-Hs.dot(Lh),f=Hs.lengthSq(),h=Math.abs(1-o*o);let d,m,v,_;if(h>0)if(d=o*c-l,m=o*l-c,_=s*h,d>=0)if(m>=-_)if(m<=_){const w=1/h;d*=w,m*=w,v=d*(d+o*m+2*l)+m*(o*d+m+2*c)+f}else m=s,d=Math.max(0,-(o*m+l)),v=-d*d+m*(m+2*c)+f;else m=-s,d=Math.max(0,-(o*m+l)),v=-d*d+m*(m+2*c)+f;else m<=-_?(d=Math.max(0,-(-o*s+l)),m=d>0?-s:Math.min(Math.max(-s,-c),s),v=-d*d+m*(m+2*c)+f):m<=_?(d=0,m=Math.min(Math.max(-s,-c),s),v=m*(m+2*c)+f):(d=Math.max(0,-(o*s+l)),m=d>0?s:Math.min(Math.max(-s,-c),s),v=-d*d+m*(m+2*c)+f);else m=o>0?-s:s,d=Math.max(0,-(o*m+l)),v=-d*d+m*(m+2*c)+f;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(J0).addScaledVector(Lh,m),v}intersectSphere(e,t){ss.subVectors(e.center,this.origin);const i=ss.dot(this.direction),r=ss.dot(ss)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),l=i-o,c=i+o;return c<0?null:l<0?this.at(c,t):this.at(l,t)}intersectsSphere(e){return 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,r,s,o,l,c;const f=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,m=this.origin;return f>=0?(i=(e.min.x-m.x)*f,r=(e.max.x-m.x)*f):(i=(e.max.x-m.x)*f,r=(e.min.x-m.x)*f),h>=0?(s=(e.min.y-m.y)*h,o=(e.max.y-m.y)*h):(s=(e.max.y-m.y)*h,o=(e.min.y-m.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(l=(e.min.z-m.z)*d,c=(e.max.z-m.z)*d):(l=(e.max.z-m.z)*d,c=(e.min.z-m.z)*d),i>c||l>r)||((l>i||i!==i)&&(i=l),(c=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,ss)!==null}intersectTriangle(e,t,i,r,s){Q0.subVectors(t,e),Ih.subVectors(i,e),$0.crossVectors(Q0,Ih);let o=this.direction.dot($0),l;if(o>0){if(r)return null;l=1}else if(o<0)l=-1,o=-o;else return null;Hs.subVectors(this.origin,e);const c=l*this.direction.dot(Ih.crossVectors(Hs,Ih));if(c<0)return null;const f=l*this.direction.dot(Q0.cross(Hs));if(f<0||c+f>o)return null;const h=-l*Hs.dot($0);return h<0?null:this.at(h/o,s)}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 ft{constructor(e,t,i,r,s,o,l,c,f,h,d,m,v,_,w,x){ft.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,l,c,f,h,d,m,v,_,w,x)}set(e,t,i,r,s,o,l,c,f,h,d,m,v,_,w,x){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=s,g[5]=o,g[9]=l,g[13]=c,g[2]=f,g[6]=h,g[10]=d,g[14]=m,g[3]=v,g[7]=_,g[11]=w,g[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new ft().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/Ya.setFromMatrixColumn(e,0).length(),s=1/Ya.setFromMatrixColumn(e,1).length(),o=1/Ya.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),f=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const m=o*h,v=o*d,_=l*h,w=l*d;t[0]=c*h,t[4]=-c*d,t[8]=f,t[1]=v+_*f,t[5]=m-w*f,t[9]=-l*c,t[2]=w-m*f,t[6]=_+v*f,t[10]=o*c}else if(e.order==="YXZ"){const m=c*h,v=c*d,_=f*h,w=f*d;t[0]=m+w*l,t[4]=_*l-v,t[8]=o*f,t[1]=o*d,t[5]=o*h,t[9]=-l,t[2]=v*l-_,t[6]=w+m*l,t[10]=o*c}else if(e.order==="ZXY"){const m=c*h,v=c*d,_=f*h,w=f*d;t[0]=m-w*l,t[4]=-o*d,t[8]=_+v*l,t[1]=v+_*l,t[5]=o*h,t[9]=w-m*l,t[2]=-o*f,t[6]=l,t[10]=o*c}else if(e.order==="ZYX"){const m=o*h,v=o*d,_=l*h,w=l*d;t[0]=c*h,t[4]=_*f-v,t[8]=m*f+w,t[1]=c*d,t[5]=w*f+m,t[9]=v*f-_,t[2]=-f,t[6]=l*c,t[10]=o*c}else if(e.order==="YZX"){const m=o*c,v=o*f,_=l*c,w=l*f;t[0]=c*h,t[4]=w-m*d,t[8]=_*d+v,t[1]=d,t[5]=o*h,t[9]=-l*h,t[2]=-f*h,t[6]=v*d+_,t[10]=m-w*d}else if(e.order==="XZY"){const m=o*c,v=o*f,_=l*c,w=l*f;t[0]=c*h,t[4]=-d,t[8]=f*h,t[1]=m*d+w,t[5]=o*h,t[9]=v*d-_,t[2]=_*d-v,t[6]=l*h,t[10]=w*d+m}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(bR,e,RR)}lookAt(e,t,i){const r=this.elements;return zi.subVectors(e,t),zi.lengthSq()===0&&(zi.z=1),zi.normalize(),Vs.crossVectors(i,zi),Vs.lengthSq()===0&&(Math.abs(i.z)===1?zi.x+=1e-4:zi.z+=1e-4,zi.normalize(),Vs.crossVectors(i,zi)),Vs.normalize(),Nh.crossVectors(zi,Vs),r[0]=Vs.x,r[4]=Nh.x,r[8]=zi.x,r[1]=Vs.y,r[5]=Nh.y,r[9]=zi.y,r[2]=Vs.z,r[6]=Nh.z,r[10]=zi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],l=i[4],c=i[8],f=i[12],h=i[1],d=i[5],m=i[9],v=i[13],_=i[2],w=i[6],x=i[10],g=i[14],S=i[3],M=i[7],T=i[11],P=i[15],C=r[0],L=r[4],z=r[8],b=r[12],R=r[1],B=r[5],Z=r[9],le=r[13],G=r[2],Q=r[6],te=r[10],ce=r[14],N=r[3],k=r[7],H=r[11],q=r[15];return s[0]=o*C+l*R+c*G+f*N,s[4]=o*L+l*B+c*Q+f*k,s[8]=o*z+l*Z+c*te+f*H,s[12]=o*b+l*le+c*ce+f*q,s[1]=h*C+d*R+m*G+v*N,s[5]=h*L+d*B+m*Q+v*k,s[9]=h*z+d*Z+m*te+v*H,s[13]=h*b+d*le+m*ce+v*q,s[2]=_*C+w*R+x*G+g*N,s[6]=_*L+w*B+x*Q+g*k,s[10]=_*z+w*Z+x*te+g*H,s[14]=_*b+w*le+x*ce+g*q,s[3]=S*C+M*R+T*G+P*N,s[7]=S*L+M*B+T*Q+P*k,s[11]=S*z+M*Z+T*te+P*H,s[15]=S*b+M*le+T*ce+P*q,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],l=e[5],c=e[9],f=e[13],h=e[2],d=e[6],m=e[10],v=e[14],_=e[3],w=e[7],x=e[11],g=e[15];return _*(+s*c*d-r*f*d-s*l*m+i*f*m+r*l*v-i*c*v)+w*(+t*c*v-t*f*m+s*o*m-r*o*v+r*f*h-s*c*h)+x*(+t*f*d-t*l*v-s*o*d+i*o*v+s*l*h-i*f*h)+g*(-r*l*h-t*c*d+t*l*m+r*o*d-i*o*m+i*c*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],l=e[5],c=e[6],f=e[7],h=e[8],d=e[9],m=e[10],v=e[11],_=e[12],w=e[13],x=e[14],g=e[15],S=d*x*f-w*m*f+w*c*v-l*x*v-d*c*g+l*m*g,M=_*m*f-h*x*f-_*c*v+o*x*v+h*c*g-o*m*g,T=h*w*f-_*d*f+_*l*v-o*w*v-h*l*g+o*d*g,P=_*d*c-h*w*c-_*l*m+o*w*m+h*l*x-o*d*x,C=t*S+i*M+r*T+s*P;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/C;return e[0]=S*L,e[1]=(w*m*s-d*x*s-w*r*v+i*x*v+d*r*g-i*m*g)*L,e[2]=(l*x*s-w*c*s+w*r*f-i*x*f-l*r*g+i*c*g)*L,e[3]=(d*c*s-l*m*s-d*r*f+i*m*f+l*r*v-i*c*v)*L,e[4]=M*L,e[5]=(h*x*s-_*m*s+_*r*v-t*x*v-h*r*g+t*m*g)*L,e[6]=(_*c*s-o*x*s-_*r*f+t*x*f+o*r*g-t*c*g)*L,e[7]=(o*m*s-h*c*s+h*r*f-t*m*f-o*r*v+t*c*v)*L,e[8]=T*L,e[9]=(_*d*s-h*w*s-_*i*v+t*w*v+h*i*g-t*d*g)*L,e[10]=(o*w*s-_*l*s+_*i*f-t*w*f-o*i*g+t*l*g)*L,e[11]=(h*l*s-o*d*s-h*i*f+t*d*f+o*i*v-t*l*v)*L,e[12]=P*L,e[13]=(h*w*r-_*d*r+_*i*m-t*w*m-h*i*x+t*d*x)*L,e[14]=(_*l*r-o*w*r-_*i*c+t*w*c+o*i*x-t*l*x)*L,e[15]=(o*d*r-h*l*r+h*i*c-t*d*c-o*i*m+t*l*m)*L,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,l=e.y,c=e.z,f=s*o,h=s*l;return this.set(f*o+i,f*l-r*c,f*c+r*l,0,f*l+r*c,h*l+i,h*c-r*o,0,f*c-r*l,h*c+r*o,s*c*c+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,l=t._z,c=t._w,f=s+s,h=o+o,d=l+l,m=s*f,v=s*h,_=s*d,w=o*h,x=o*d,g=l*d,S=c*f,M=c*h,T=c*d,P=i.x,C=i.y,L=i.z;return r[0]=(1-(w+g))*P,r[1]=(v+T)*P,r[2]=(_-M)*P,r[3]=0,r[4]=(v-T)*C,r[5]=(1-(m+g))*C,r[6]=(x+S)*C,r[7]=0,r[8]=(_+M)*L,r[9]=(x-S)*L,r[10]=(1-(m+w))*L,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=Ya.set(r[0],r[1],r[2]).length();const o=Ya.set(r[4],r[5],r[6]).length(),l=Ya.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],vr.copy(this);const f=1/s,h=1/o,d=1/l;return vr.elements[0]*=f,vr.elements[1]*=f,vr.elements[2]*=f,vr.elements[4]*=h,vr.elements[5]*=h,vr.elements[6]*=h,vr.elements[8]*=d,vr.elements[9]*=d,vr.elements[10]*=d,t.setFromRotationMatrix(vr),i.x=s,i.y=o,i.z=l,this}makePerspective(e,t,i,r,s,o,l=Er){const c=this.elements,f=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),m=(i+r)/(i-r);let v,_;if(l===Er)v=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(l===jl)v=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return c[0]=f,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=h,c[9]=m,c[13]=0,c[2]=0,c[6]=0,c[10]=v,c[14]=_,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,o,l=Er){const c=this.elements,f=1/(t-e),h=1/(i-r),d=1/(o-s),m=(t+e)*f,v=(i+r)*h;let _,w;if(l===Er)_=(o+s)*d,w=-2*d;else if(l===jl)_=s*d,w=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return c[0]=2*f,c[4]=0,c[8]=0,c[12]=-m,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-v,c[2]=0,c[6]=0,c[10]=w,c[14]=-_,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Ya=new O,vr=new ft,bR=new O(0,0,0),RR=new O(1,1,1),Vs=new O,Nh=new O,zi=new O,iS=new ft,rS=new ri;class sf{constructor(e=0,t=0,i=0,r=sf.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],l=r[8],c=r[1],f=r[5],h=r[9],d=r[2],m=r[6],v=r[10];switch(t){case"XYZ":this._y=Math.asin(fn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,f),this._z=0);break;case"YXZ":this._x=Math.asin(-fn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(l,v),this._z=Math.atan2(c,f)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(fn(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-d,v),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-fn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(m,v),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(fn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,f),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(l,v));break;case"XZY":this._z=Math.asin(-fn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,f),this._y=Math.atan2(l,s)):(this._x=Math.atan2(-h,v),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return iS.makeRotationFromQuaternion(e),this.setFromRotationMatrix(iS,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return rS.setFromEuler(this),this.setFromQuaternion(rS,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}sf.DEFAULT_ORDER="XYZ";class aa{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(l,c){return l[c.uuid]===void 0&&(l[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){const c=l.shapes;if(Array.isArray(c))for(let f=0,h=c.length;f0){r.children=[];for(let l=0;l0){r.animations=[];for(let l=0;l0&&(i.geometries=l),c.length>0&&(i.materials=c),f.length>0&&(i.textures=f),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),m.length>0&&(i.skeletons=m),v.length>0&&(i.animations=v),_.length>0&&(i.nodes=_)}return i.object=r,i;function o(l){const c=[];for(const f in l){const h=l[f];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){yr.subVectors(r,t),as.subVectors(i,t),eg.subVectors(e,t);const o=yr.dot(yr),l=yr.dot(as),c=yr.dot(eg),f=as.dot(as),h=as.dot(eg),d=o*f-l*l;if(d===0)return s.set(0,0,0),null;const m=1/d,v=(f*c-l*h)*m,_=(o*h-l*c)*m;return s.set(1-v-_,_,v)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,ls)===null?!1:ls.x>=0&&ls.y>=0&&ls.x+ls.y<=1}static getUV(e,t,i,r,s,o,l,c){return Uh===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Uh=!0),this.getInterpolation(e,t,i,r,s,o,l,c)}static getInterpolation(e,t,i,r,s,o,l,c){return this.getBarycoord(e,t,i,r,ls)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(s,ls.x),c.addScaledVector(o,ls.y),c.addScaledVector(l,ls.z),c)}static isFrontFacing(e,t,i,r){return yr.subVectors(i,t),as.subVectors(e,t),yr.cross(as).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),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 yr.subVectors(this.c,this.b),as.subVectors(this.a,this.b),yr.cross(as).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ei.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ei.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return Uh===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Uh=!0),Ei.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}getInterpolation(e,t,i,r,s){return Ei.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Ei.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ei.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,l;Za.subVectors(r,i),Ka.subVectors(s,i),tg.subVectors(e,i);const c=Za.dot(tg),f=Ka.dot(tg);if(c<=0&&f<=0)return t.copy(i);ng.subVectors(e,r);const h=Za.dot(ng),d=Ka.dot(ng);if(h>=0&&d<=h)return t.copy(r);const m=c*d-h*f;if(m<=0&&c>=0&&h<=0)return o=c/(c-h),t.copy(i).addScaledVector(Za,o);ig.subVectors(e,s);const v=Za.dot(ig),_=Ka.dot(ig);if(_>=0&&v<=_)return t.copy(s);const w=v*f-c*_;if(w<=0&&f>=0&&_<=0)return l=f/(f-_),t.copy(i).addScaledVector(Ka,l);const x=h*_-v*d;if(x<=0&&d-h>=0&&v-_>=0)return uS.subVectors(s,r),l=(d-h)/(d-h+(v-_)),t.copy(r).addScaledVector(uS,l);const g=1/(x+w+m);return o=w*g,l=m*g,t.copy(i).addScaledVector(Za,o).addScaledVector(Ka,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const hT={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},Gs={h:0,s:0,l:0},zh={h:0,s:0,l:0};function rg(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Be{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 r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Tn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ot.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Ot.workingColorSpace){return this.r=e,this.g=t,this.b=i,Ot.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Ot.workingColorSpace){if(e=Iy(e,1),t=fn(t,0,1),i=fn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=rg(o,s,e+1/3),this.g=rg(o,s,e),this.b=rg(o,s,e-1/3)}return Ot.toWorkingColorSpace(this,r),this}setStyle(e,t=Tn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],l=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Tn){const i=hT[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Fl(e.r),this.g=Fl(e.g),this.b=Fl(e.b),this}copyLinearToSRGB(e){return this.r=j0(e.r),this.g=j0(e.g),this.b=j0(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tn){return Ot.fromWorkingColorSpace($n.copy(this),e),Math.round(fn($n.r*255,0,255))*65536+Math.round(fn($n.g*255,0,255))*256+Math.round(fn($n.b*255,0,255))}getHexString(e=Tn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ot.workingColorSpace){Ot.fromWorkingColorSpace($n.copy(this),t);const i=$n.r,r=$n.g,s=$n.b,o=Math.max(i,r,s),l=Math.min(i,r,s);let c,f;const h=(l+o)/2;if(l===o)c=0,f=0;else{const d=o-l;switch(f=h<=.5?d/(o+l):d/(2-o-l),o){case i:c=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}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){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,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&&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.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.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!==sa&&(i.blending=this.blending),this.side!==Ts&&(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!==dp&&(i.blendSrc=this.blendSrc),this.blendDst!==pp&&(i.blendDst=this.blendDst),this.blendEquation!==Ks&&(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!==Pc&&(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!==uv&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Yo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Yo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Yo&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const l in s){const c=s[l];delete c.metadata,o.push(c)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}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 r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class So extends Xn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=nf,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.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 ds=zR();function zR(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let c=0;c<256;++c){const f=c-127;f<-27?(i[c]=0,i[c|256]=32768,r[c]=24,r[c|256]=24):f<-14?(i[c]=1024>>-f-14,i[c|256]=1024>>-f-14|32768,r[c]=-f-1,r[c|256]=-f-1):f<=15?(i[c]=f+15<<10,i[c|256]=f+15<<10|32768,r[c]=13,r[c|256]=13):f<128?(i[c]=31744,i[c|256]=64512,r[c]=24,r[c|256]=24):(i[c]=31744,i[c|256]=64512,r[c]=13,r[c|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let c=1;c<1024;++c){let f=c<<13,h=0;for(;!(f&8388608);)f<<=1,h-=8388608;f&=-8388609,h+=947912704,s[c]=f|h}for(let c=1024;c<2048;++c)s[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(l[c]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:l}}function Mi(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=fn(n,-65504,65504),ds.floatView[0]=n;const e=ds.uint32View[0],t=e>>23&511;return ds.baseTable[t]+((e&8388607)>>ds.shiftTable[t])}function Ju(n){const e=n>>10;return ds.uint32View[0]=ds.mantissaTable[ds.offsetTable[e]+(n&1023)]+ds.exponentTable[e],ds.floatView[0]}const OR={toHalfFloat:Mi,fromHalfFloat:Ju},Sn=new O,Oh=new he;class Bt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Hc,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=lr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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 r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const f in c)c[f]!==void 0&&(e[f]=c[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const c in i){const f=i[c];e.data.attributes[c]=f.toJSON(e.data)}const r={};let s=!1;for(const c in this.morphAttributes){const f=this.morphAttributes[c],h=[];for(let d=0,m=f.length;d0&&(r[c]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const l=this.boundingSphere;return l!==null&&(e.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),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(t));const r=e.attributes;for(const f in r){const h=r[f];this.setAttribute(f,h.clone(t))}const s=e.morphAttributes;for(const f in s){const h=[],d=s[f];for(let m=0,v=d.length;m0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(cS.copy(s).invert(),Uo.copy(e.ray).applyMatrix4(cS),!(i.boundingBox!==null&&Uo.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Uo)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,l=s.index,c=s.attributes.position,f=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,m=s.groups,v=s.drawRange;if(l!==null)if(Array.isArray(o))for(let _=0,w=m.length;_t.far?null:{distance:f,point:Wh.clone(),object:n}}function Xh(n,e,t,i,r,s,o,l,c,f){n.getVertexPosition(l,Qa),n.getVertexPosition(c,$a),n.getVertexPosition(f,el);const h=jR(n,e,t,i,Qa,$a,el,Gh);if(h){r&&(Bh.fromBufferAttribute(r,l),Hh.fromBufferAttribute(r,c),Vh.fromBufferAttribute(r,f),h.uv=Ei.getInterpolation(Gh,Qa,$a,el,Bh,Hh,Vh,new he)),s&&(Bh.fromBufferAttribute(s,l),Hh.fromBufferAttribute(s,c),Vh.fromBufferAttribute(s,f),h.uv1=Ei.getInterpolation(Gh,Qa,$a,el,Bh,Hh,Vh,new he),h.uv2=h.uv1),o&&(hS.fromBufferAttribute(o,l),dS.fromBufferAttribute(o,c),pS.fromBufferAttribute(o,f),h.normal=Ei.getInterpolation(Gh,Qa,$a,el,hS,dS,pS,new O),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const d={a:l,b:c,c:f,normal:new O,materialIndex:0};Ei.getNormal(Qa,$a,el,d.normal),h.face=d}return h}class Ma extends St{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const l=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const c=[],f=[],h=[],d=[];let m=0,v=0;_("z","y","x",-1,-1,i,t,e,o,s,0),_("z","y","x",1,-1,i,t,-e,o,s,1),_("x","z","y",1,1,e,i,t,r,o,2),_("x","z","y",1,-1,e,i,-t,r,o,3),_("x","y","z",1,-1,e,t,i,r,s,4),_("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(c),this.setAttribute("position",new qe(f,3)),this.setAttribute("normal",new qe(h,3)),this.setAttribute("uv",new qe(d,2));function _(w,x,g,S,M,T,P,C,L,z,b){const R=T/L,B=P/z,Z=T/2,le=P/2,G=C/2,Q=L+1,te=z+1;let ce=0,N=0;const k=new O;for(let H=0;H0?1:-1,h.push(k.x,k.y,k.z),d.push(J/L),d.push(1-H/z),ce+=1}}for(let H=0;H0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class of extends zt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ft,this.projectionMatrix=new ft,this.projectionMatrixInverse=new ft,this.coordinateSystem=Er}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let hn=class extends of{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Yl*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(oa*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Yl*2*Math.atan(Math.tan(oa*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(oa*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,f=o.fullHeight;s+=o.offsetX*r/c,t-=o.offsetY*i/f,r*=o.width/c,i*=o.height/f}const l=this.filmOffset;l!==0&&(s+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const tl=-90,nl=1;class mT extends zt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new hn(tl,nl,e,t);r.layers=this.layers,this.add(r);const s=new hn(tl,nl,e,t);s.layers=this.layers,this.add(s);const o=new hn(tl,nl,e,t);o.layers=this.layers,this.add(o);const l=new hn(tl,nl,e,t);l.layers=this.layers,this.add(l);const c=new hn(tl,nl,e,t);c.layers=this.layers,this.add(c);const f=new hn(tl,nl,e,t);f.layers=this.layers,this.add(f)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,l,c]=t;for(const f of t)this.remove(f);if(e===Er)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===jl)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const f of t)this.add(f),f.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,l,c,f,h]=this.children,d=e.getRenderTarget(),m=e.getActiveCubeFace(),v=e.getActiveMipmapLevel(),_=e.xr.enabled;e.xr.enabled=!1;const w=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,l),e.setRenderTarget(i,3,r),e.render(t,c),e.setRenderTarget(i,4,r),e.render(t,f),i.texture.generateMipmaps=w,e.setRenderTarget(i,5,r),e.render(t,h),e.setRenderTarget(d,m,v),e.xr.enabled=_,i.texture.needsPMREMUpdate=!0}}class af extends dn{constructor(e,t,i,r,s,o,l,c,f,h){e=e!==void 0?e:[],t=t!==void 0?t:As,super(e,t,i,r,s,o,l,c,f,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class gT extends hr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];t.encoding!==void 0&&(cc("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===co?Tn:Bi),this.texture=new af(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:nn}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 ); - - } - `},r=new Ma(5,5,5),s=new Zr({name:"CubemapFromEquirect",uniforms:ql(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:pi,blending:xs});s.uniforms.tEquirect.value=t;const o=new Cn(r,s),l=t.minFilter;return t.minFilter===mo&&(t.minFilter=nn),new mT(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const ag=new O,KR=new O,JR=new wt;class hs{constructor(e=new O(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=ag.subVectors(i,t).cross(KR.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(ag),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}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||JR.getNormalMatrix(e),r=this.coplanarPoint(ag).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),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 zo=new si,jh=new O;class lf{constructor(e=new hs,t=new hs,i=new hs,r=new hs,s=new hs,o=new hs){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const l=this.planes;return l[0].copy(e),l[1].copy(t),l[2].copy(i),l[3].copy(r),l[4].copy(s),l[5].copy(o),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=Er){const i=this.planes,r=e.elements,s=r[0],o=r[1],l=r[2],c=r[3],f=r[4],h=r[5],d=r[6],m=r[7],v=r[8],_=r[9],w=r[10],x=r[11],g=r[12],S=r[13],M=r[14],T=r[15];if(i[0].setComponents(c-s,m-f,x-v,T-g).normalize(),i[1].setComponents(c+s,m+f,x+v,T+g).normalize(),i[2].setComponents(c+o,m+h,x+_,T+S).normalize(),i[3].setComponents(c-o,m-h,x-_,T-S).normalize(),i[4].setComponents(c-l,m-d,x-w,T-M).normalize(),t===Er)i[5].setComponents(c+l,m+d,x+w,T+M).normalize();else if(t===jl)i[5].setComponents(l,d,w,M).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(),zo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),zo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(zo)}intersectsSprite(e){return zo.center.set(0,0,0),zo.radius=.7071067811865476,zo.applyMatrix4(e.matrixWorld),this.intersectsSphere(zo)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,jh.y=r.normal.y>0?e.max.y:e.min.y,jh.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(jh)<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)}}function vT(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function QR(n,e){const t=e.isWebGL2,i=new WeakMap;function r(f,h){const d=f.array,m=f.usage,v=d.byteLength,_=n.createBuffer();n.bindBuffer(h,_),n.bufferData(h,d,m),f.onUploadCallback();let w;if(d instanceof Float32Array)w=n.FLOAT;else if(d instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)w=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else w=n.UNSIGNED_SHORT;else if(d instanceof Int16Array)w=n.SHORT;else if(d instanceof Uint32Array)w=n.UNSIGNED_INT;else if(d instanceof Int32Array)w=n.INT;else if(d instanceof Int8Array)w=n.BYTE;else if(d instanceof Uint8Array)w=n.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)w=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:_,type:w,bytesPerElement:d.BYTES_PER_ELEMENT,version:f.version,size:v}}function s(f,h,d){const m=h.array,v=h._updateRange,_=h.updateRanges;if(n.bindBuffer(d,f),v.count===-1&&_.length===0&&n.bufferSubData(d,0,m),_.length!==0){for(let w=0,x=_.length;w 0 - vec4 plane; - #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`,mP=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,gP=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,vP=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,yP=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,_P=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,xP=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,SP=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,MP=`#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 ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float luminance( const in vec3 rgb ) { - const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); - return dot( weights, rgb ); -} -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`,wP=`#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`,EP=`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`,TP=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,AP=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,CP=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,bP=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,RP="gl_FragColor = linearToOutputTexel( gl_FragColor );",PP=` -const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( - vec3( 0.8224621, 0.177538, 0.0 ), - vec3( 0.0331941, 0.9668058, 0.0 ), - vec3( 0.0170827, 0.0723974, 0.9105199 ) -); -const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( - vec3( 1.2249401, - 0.2249404, 0.0 ), - vec3( - 0.0420569, 1.0420571, 0.0 ), - vec3( - 0.0196376, - 0.0786361, 1.0982735 ) -); -vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { - return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); -} -vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { - return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); -} -vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 LinearTosRGB( in vec4 value ) { - return sRGBTransferOETF( value ); -}`,LP=`#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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #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`,IP=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,NP=`#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`,DP=`#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`,UP=`#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`,zP=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,OP=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,FP=`#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`,kP=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,BP=`#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 -}`,HP=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,VP=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,GP=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,WP=`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`,XP=`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 ) { - #if defined ( LEGACY_LIGHTS ) - if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; - #else - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; - #endif -} -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`,jP=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, 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, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, 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`,YP=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,qP=`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`,ZP=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,KP=`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`,JP=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -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 = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), 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_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.07, 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`,QP=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - #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; - #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 saturate(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.specularColor; - 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 * transposeMat3( 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 a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - 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 - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #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; -} -#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.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#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 ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -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 ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -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 ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#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 ); -}`,$P=` -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.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - 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 ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, 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.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.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`,eL=`#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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #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`,tL=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,nL=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,iL=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,rL=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,sL=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,oL=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); - - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,aL=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,lL=`#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`,uL=`#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`,cL=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,fL=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,hL=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) - 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`,dL=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } - #else - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; - #endif -#endif`,pL=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - 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 ); - } - #else - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif - #endif -#endif`,mL=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } - #else - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif - #endif -#endif`,gL=`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;`,vL=`#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`,yL=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,_L=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,xL=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,SL=`#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`,ML=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,wL=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,EL=`#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`,TL=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,AL=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,CL=`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 vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec2 packDepthToRG( in highp float v ) { - return packDepthToRGBA( v ).yx; -} -float unpackRGToDepth( const in highp vec2 v ) { - return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); -} -vec4 pack2HalfToRGBA( 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( 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 ) { - return depth * ( near - far ) - near; -} -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 ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,bL=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RL=`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;`,PL=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,LL=`#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`,IL=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,NL=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,DL=`#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 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, 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 ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UL=`#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 shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - 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 shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,zL=`#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`,OL=`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.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.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - 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.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,FL=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,kL=`#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`,BL=`#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`,HL=`#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`,VL=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,GL=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,WL=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,XL=`#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 OptimizedCineonToneMapping( 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 = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color *= toneMappingExposure; - 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; - return color; -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,jL=`#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.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, 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`,YL=`#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 ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - 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; - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - 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`,qL=`#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`,ZL=`#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`,KL=`#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`,JL=`#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 QL=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,$L=`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 -}`,e6=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,t6=`#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; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,n6=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,i6=`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 -}`,r6=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,s6=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,o6=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,a6=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,l6=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,u6=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,c6=`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 -}`,f6=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,h6=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #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 -}`,d6=`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() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #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 -}`,p6=`#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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,m6=`#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 -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - 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 -}`,g6=`#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 - vViewPosition = - mvPosition.xyz; -}`,v6=`#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() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #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 -}`,y6=`#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 -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,_6=`#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 -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,x6=`#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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,S6=`#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 -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - 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 -}`,M6=`#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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,w6=`#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_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 -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - 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 - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + 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 -}`,E6=`#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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,T6=`#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 -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - 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 -}`,A6=`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 - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,C6=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,b6=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,R6=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,P6=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #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 -}`,L6=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,_t={alphahash_fragment:$R,alphahash_pars_fragment:eP,alphamap_fragment:tP,alphamap_pars_fragment:nP,alphatest_fragment:iP,alphatest_pars_fragment:rP,aomap_fragment:sP,aomap_pars_fragment:oP,batching_pars_vertex:aP,batching_vertex:lP,begin_vertex:uP,beginnormal_vertex:cP,bsdfs:fP,iridescence_fragment:hP,bumpmap_pars_fragment:dP,clipping_planes_fragment:pP,clipping_planes_pars_fragment:mP,clipping_planes_pars_vertex:gP,clipping_planes_vertex:vP,color_fragment:yP,color_pars_fragment:_P,color_pars_vertex:xP,color_vertex:SP,common:MP,cube_uv_reflection_fragment:wP,defaultnormal_vertex:EP,displacementmap_pars_vertex:TP,displacementmap_vertex:AP,emissivemap_fragment:CP,emissivemap_pars_fragment:bP,colorspace_fragment:RP,colorspace_pars_fragment:PP,envmap_fragment:LP,envmap_common_pars_fragment:IP,envmap_pars_fragment:NP,envmap_pars_vertex:DP,envmap_physical_pars_fragment:jP,envmap_vertex:UP,fog_vertex:zP,fog_pars_vertex:OP,fog_fragment:FP,fog_pars_fragment:kP,gradientmap_pars_fragment:BP,lightmap_fragment:HP,lightmap_pars_fragment:VP,lights_lambert_fragment:GP,lights_lambert_pars_fragment:WP,lights_pars_begin:XP,lights_toon_fragment:YP,lights_toon_pars_fragment:qP,lights_phong_fragment:ZP,lights_phong_pars_fragment:KP,lights_physical_fragment:JP,lights_physical_pars_fragment:QP,lights_fragment_begin:$P,lights_fragment_maps:eL,lights_fragment_end:tL,logdepthbuf_fragment:nL,logdepthbuf_pars_fragment:iL,logdepthbuf_pars_vertex:rL,logdepthbuf_vertex:sL,map_fragment:oL,map_pars_fragment:aL,map_particle_fragment:lL,map_particle_pars_fragment:uL,metalnessmap_fragment:cL,metalnessmap_pars_fragment:fL,morphcolor_vertex:hL,morphnormal_vertex:dL,morphtarget_pars_vertex:pL,morphtarget_vertex:mL,normal_fragment_begin:gL,normal_fragment_maps:vL,normal_pars_fragment:yL,normal_pars_vertex:_L,normal_vertex:xL,normalmap_pars_fragment:SL,clearcoat_normal_fragment_begin:ML,clearcoat_normal_fragment_maps:wL,clearcoat_pars_fragment:EL,iridescence_pars_fragment:TL,opaque_fragment:AL,packing:CL,premultiplied_alpha_fragment:bL,project_vertex:RL,dithering_fragment:PL,dithering_pars_fragment:LL,roughnessmap_fragment:IL,roughnessmap_pars_fragment:NL,shadowmap_pars_fragment:DL,shadowmap_pars_vertex:UL,shadowmap_vertex:zL,shadowmask_pars_fragment:OL,skinbase_vertex:FL,skinning_pars_vertex:kL,skinning_vertex:BL,skinnormal_vertex:HL,specularmap_fragment:VL,specularmap_pars_fragment:GL,tonemapping_fragment:WL,tonemapping_pars_fragment:XL,transmission_fragment:jL,transmission_pars_fragment:YL,uv_pars_fragment:qL,uv_pars_vertex:ZL,uv_vertex:KL,worldpos_vertex:JL,background_vert:QL,background_frag:$L,backgroundCube_vert:e6,backgroundCube_frag:t6,cube_vert:n6,cube_frag:i6,depth_vert:r6,depth_frag:s6,distanceRGBA_vert:o6,distanceRGBA_frag:a6,equirect_vert:l6,equirect_frag:u6,linedashed_vert:c6,linedashed_frag:f6,meshbasic_vert:h6,meshbasic_frag:d6,meshlambert_vert:p6,meshlambert_frag:m6,meshmatcap_vert:g6,meshmatcap_frag:v6,meshnormal_vert:y6,meshnormal_frag:_6,meshphong_vert:x6,meshphong_frag:S6,meshphysical_vert:M6,meshphysical_frag:w6,meshtoon_vert:E6,meshtoon_frag:T6,points_vert:A6,points_frag:C6,shadow_vert:b6,shadow_frag:R6,sprite_vert:P6,sprite_frag:L6},Pe={common:{diffuse:{value:new Be(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new wt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new wt},normalScale:{value:new he(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Be(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Be(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0},uvTransform:{value:new wt}},sprite:{diffuse:{value:new Be(16777215)},opacity:{value:1},center:{value:new he(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}}},wr={basic:{uniforms:ci([Pe.common,Pe.specularmap,Pe.envmap,Pe.aomap,Pe.lightmap,Pe.fog]),vertexShader:_t.meshbasic_vert,fragmentShader:_t.meshbasic_frag},lambert:{uniforms:ci([Pe.common,Pe.specularmap,Pe.envmap,Pe.aomap,Pe.lightmap,Pe.emissivemap,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.fog,Pe.lights,{emissive:{value:new Be(0)}}]),vertexShader:_t.meshlambert_vert,fragmentShader:_t.meshlambert_frag},phong:{uniforms:ci([Pe.common,Pe.specularmap,Pe.envmap,Pe.aomap,Pe.lightmap,Pe.emissivemap,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.fog,Pe.lights,{emissive:{value:new Be(0)},specular:{value:new Be(1118481)},shininess:{value:30}}]),vertexShader:_t.meshphong_vert,fragmentShader:_t.meshphong_frag},standard:{uniforms:ci([Pe.common,Pe.envmap,Pe.aomap,Pe.lightmap,Pe.emissivemap,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.roughnessmap,Pe.metalnessmap,Pe.fog,Pe.lights,{emissive:{value:new Be(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_t.meshphysical_vert,fragmentShader:_t.meshphysical_frag},toon:{uniforms:ci([Pe.common,Pe.aomap,Pe.lightmap,Pe.emissivemap,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.gradientmap,Pe.fog,Pe.lights,{emissive:{value:new Be(0)}}]),vertexShader:_t.meshtoon_vert,fragmentShader:_t.meshtoon_frag},matcap:{uniforms:ci([Pe.common,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.fog,{matcap:{value:null}}]),vertexShader:_t.meshmatcap_vert,fragmentShader:_t.meshmatcap_frag},points:{uniforms:ci([Pe.points,Pe.fog]),vertexShader:_t.points_vert,fragmentShader:_t.points_frag},dashed:{uniforms:ci([Pe.common,Pe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_t.linedashed_vert,fragmentShader:_t.linedashed_frag},depth:{uniforms:ci([Pe.common,Pe.displacementmap]),vertexShader:_t.depth_vert,fragmentShader:_t.depth_frag},normal:{uniforms:ci([Pe.common,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,{opacity:{value:1}}]),vertexShader:_t.meshnormal_vert,fragmentShader:_t.meshnormal_frag},sprite:{uniforms:ci([Pe.sprite,Pe.fog]),vertexShader:_t.sprite_vert,fragmentShader:_t.sprite_frag},background:{uniforms:{uvTransform:{value:new wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_t.background_vert,fragmentShader:_t.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:_t.backgroundCube_vert,fragmentShader:_t.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_t.cube_vert,fragmentShader:_t.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_t.equirect_vert,fragmentShader:_t.equirect_frag},distanceRGBA:{uniforms:ci([Pe.common,Pe.displacementmap,{referencePosition:{value:new O},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_t.distanceRGBA_vert,fragmentShader:_t.distanceRGBA_frag},shadow:{uniforms:ci([Pe.lights,Pe.fog,{color:{value:new Be(0)},opacity:{value:1}}]),vertexShader:_t.shadow_vert,fragmentShader:_t.shadow_frag}};wr.physical={uniforms:ci([wr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new wt},clearcoatNormalScale:{value:new he(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new wt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new wt},sheen:{value:0},sheenColor:{value:new Be(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new wt},transmissionSamplerSize:{value:new he},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new wt},attenuationDistance:{value:0},attenuationColor:{value:new Be(0)},specularColor:{value:new Be(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new wt},anisotropyVector:{value:new he},anisotropyMap:{value:null},anisotropyMapTransform:{value:new wt}}]),vertexShader:_t.meshphysical_vert,fragmentShader:_t.meshphysical_frag};const Yh={r:0,b:0,g:0};function I6(n,e,t,i,r,s,o){const l=new Be(0);let c=s===!0?0:1,f,h,d=null,m=0,v=null;function _(x,g){let S=!1,M=g.isScene===!0?g.background:null;M&&M.isTexture&&(M=(g.backgroundBlurriness>0?t:e).get(M)),M===null?w(l,c):M&&M.isColor&&(w(M,1),S=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),M&&(M.isCubeTexture||M.mapping===tu)?(h===void 0&&(h=new Cn(new Ma(1,1,1),new Zr({name:"BackgroundCubeMaterial",uniforms:ql(wr.backgroundCube.uniforms),vertexShader:wr.backgroundCube.vertexShader,fragmentShader:wr.backgroundCube.fragmentShader,side:pi,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(P,C,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),h.material.uniforms.envMap.value=M,h.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,h.material.toneMapped=Ot.getTransfer(M.colorSpace)!==Wt,(d!==M||m!==M.version||v!==n.toneMapping)&&(h.material.needsUpdate=!0,d=M,m=M.version,v=n.toneMapping),h.layers.enableAll(),x.unshift(h,h.geometry,h.material,0,0,null)):M&&M.isTexture&&(f===void 0&&(f=new Cn(new uf(2,2),new Zr({name:"BackgroundMaterial",uniforms:ql(wr.background.uniforms),vertexShader:wr.background.vertexShader,fragmentShader:wr.background.fragmentShader,side:Ts,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),Object.defineProperty(f.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(f)),f.material.uniforms.t2D.value=M,f.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,f.material.toneMapped=Ot.getTransfer(M.colorSpace)!==Wt,M.matrixAutoUpdate===!0&&M.updateMatrix(),f.material.uniforms.uvTransform.value.copy(M.matrix),(d!==M||m!==M.version||v!==n.toneMapping)&&(f.material.needsUpdate=!0,d=M,m=M.version,v=n.toneMapping),f.layers.enableAll(),x.unshift(f,f.geometry,f.material,0,0,null))}function w(x,g){x.getRGB(Yh,dT(n)),i.buffers.color.setClear(Yh.r,Yh.g,Yh.b,g,o)}return{getClearColor:function(){return l},setClearColor:function(x,g=1){l.set(x),c=g,w(l,c)},getClearAlpha:function(){return c},setClearAlpha:function(x){c=x,w(l,c)},render:_}}function N6(n,e,t,i){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,l={},c=x(null);let f=c,h=!1;function d(G,Q,te,ce,N){let k=!1;if(o){const H=w(ce,te,Q);f!==H&&(f=H,v(f.object)),k=g(G,ce,te,N),k&&S(G,ce,te,N)}else{const H=Q.wireframe===!0;(f.geometry!==ce.id||f.program!==te.id||f.wireframe!==H)&&(f.geometry=ce.id,f.program=te.id,f.wireframe=H,k=!0)}N!==null&&t.update(N,n.ELEMENT_ARRAY_BUFFER),(k||h)&&(h=!1,z(G,Q,te,ce),N!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(N).buffer))}function m(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function v(G){return i.isWebGL2?n.bindVertexArray(G):s.bindVertexArrayOES(G)}function _(G){return i.isWebGL2?n.deleteVertexArray(G):s.deleteVertexArrayOES(G)}function w(G,Q,te){const ce=te.wireframe===!0;let N=l[G.id];N===void 0&&(N={},l[G.id]=N);let k=N[Q.id];k===void 0&&(k={},N[Q.id]=k);let H=k[ce];return H===void 0&&(H=x(m()),k[ce]=H),H}function x(G){const Q=[],te=[],ce=[];for(let N=0;N=0){const ae=N[J];let ge=k[J];if(ge===void 0&&(J==="instanceMatrix"&&G.instanceMatrix&&(ge=G.instanceMatrix),J==="instanceColor"&&G.instanceColor&&(ge=G.instanceColor)),ae===void 0||ae.attribute!==ge||ge&&ae.data!==ge.data)return!0;H++}return f.attributesNum!==H||f.index!==ce}function S(G,Q,te,ce){const N={},k=Q.attributes;let H=0;const q=te.getAttributes();for(const J in q)if(q[J].location>=0){let ae=k[J];ae===void 0&&(J==="instanceMatrix"&&G.instanceMatrix&&(ae=G.instanceMatrix),J==="instanceColor"&&G.instanceColor&&(ae=G.instanceColor));const ge={};ge.attribute=ae,ae&&ae.data&&(ge.data=ae.data),N[J]=ge,H++}f.attributes=N,f.attributesNum=H,f.index=ce}function M(){const G=f.newAttributes;for(let Q=0,te=G.length;Q=0){let K=N[q];if(K===void 0&&(q==="instanceMatrix"&&G.instanceMatrix&&(K=G.instanceMatrix),q==="instanceColor"&&G.instanceColor&&(K=G.instanceColor)),K!==void 0){const ae=K.normalized,ge=K.itemSize,Ae=t.get(K);if(Ae===void 0)continue;const Ce=Ae.buffer,rt=Ae.type,lt=Ae.bytesPerElement,Xe=i.isWebGL2===!0&&(rt===n.INT||rt===n.UNSIGNED_INT||K.gpuType===My);if(K.isInterleavedBufferAttribute){const Ke=K.data,V=Ke.stride,Se=K.offset;if(Ke.isInstancedInterleavedBuffer){for(let de=0;de0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";L="mediump"}return L==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let l=t.precision!==void 0?t.precision:"highp";const c=s(l);c!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",c,"instead."),l=c);const f=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),w=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),M=m>0,T=o||e.has("OES_texture_float"),P=M&&T,C=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:f,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:m,maxTextureSize:v,maxCubemapSize:_,maxAttributes:w,maxVertexUniforms:x,maxVaryings:g,maxFragmentUniforms:S,vertexTextures:M,floatFragmentTextures:T,floatVertexTextures:P,maxSamples:C}}function z6(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new hs,l=new wt,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,m){const v=d.length!==0||m||i!==0||r;return r=m,i=d.length,v},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,m){t=h(d,m,0)},this.setState=function(d,m,v){const _=d.clippingPlanes,w=d.clipIntersection,x=d.clipShadows,g=n.get(d);if(!r||_===null||_.length===0||s&&!x)s?h(null):f();else{const S=s?0:i,M=S*4;let T=g.clippingState||null;c.value=T,T=h(_,m,M,v);for(let P=0;P!==M;++P)T[P]=t[P];g.clippingState=T,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=S}};function f(){c.value!==t&&(c.value=t,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,m,v,_){const w=d!==null?d.length:0;let x=null;if(w!==0){if(x=c.value,_!==!0||x===null){const g=v+w*4,S=m.matrixWorldInverse;l.getNormalMatrix(S),(x===null||x.length0){const f=new gT(c.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const l=o.target;l.removeEventListener("dispose",r);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class vs extends of{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,l=r+t,c=r-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=f*this.view.offsetX,o=s+f*this.view.width,l-=h*this.view.offsetY,c=l-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Cl=4,mS=[.125,.215,.35,.446,.526,.582],Zo=20,lg=new vs,gS=new Be;let ug=null,cg=0,fg=0;const qo=(1+Math.sqrt(5))/2,il=1/qo,vS=[new O(1,1,1),new O(-1,1,1),new O(1,1,-1),new O(-1,1,-1),new O(0,qo,il),new O(0,qo,-il),new O(il,0,qo),new O(-il,0,qo),new O(qo,il,0),new O(-qo,il,0)];class hv{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){ug=this._renderer.getRenderTarget(),cg=this._renderer.getActiveCubeFace(),fg=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=xS(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_S(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.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._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?M:0,M,M),h.setRenderTarget(r),w&&h.render(_,l),h.render(e,l)}_.geometry.dispose(),_.material.dispose(),h.toneMapping=m,h.autoClear=d,e.background=x}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===As||e.mapping===po;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=xS()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_S());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Cn(this._lodPlanes[0],s),l=s.uniforms;l.envMap.value=e;const c=this._cubeSize;qh(t,0,0,3*c,2*c),i.setRenderTarget(t),i.render(o,lg)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;rZo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Zo}`);const g=[];let S=0;for(let L=0;LM-Cl?r-M+Cl:0),C=4*(this._cubeSize-T);qh(t,P,C,3*T,2*T),c.setRenderTarget(t),c.render(d,lg)}}function F6(n){const e=[],t=[],i=[];let r=n;const s=n-Cl+1+mS.length;for(let o=0;on-Cl?c=mS[o-n+Cl-1]:o===0&&(c=0),i.push(c);const f=1/(l-2),h=-f,d=1+f,m=[h,h,d,h,d,d,h,h,d,d,h,d],v=6,_=6,w=3,x=2,g=1,S=new Float32Array(w*_*v),M=new Float32Array(x*_*v),T=new Float32Array(g*_*v);for(let C=0;C2?0:-1,b=[L,z,0,L+2/3,z,0,L+2/3,z+1,0,L,z,0,L+2/3,z+1,0,L,z+1,0];S.set(b,w*_*C),M.set(m,x*_*C);const R=[C,C,C,C,C,C];T.set(R,g*_*C)}const P=new St;P.setAttribute("position",new Bt(S,w)),P.setAttribute("uv",new Bt(M,x)),P.setAttribute("faceIndex",new Bt(T,g)),e.push(P),r>Cl&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function yS(n,e,t){const i=new hr(n,e,t);return i.texture.mapping=tu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function qh(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function k6(n,e,t){const i=new Float32Array(Zo),r=new O(0,1,0);return new Zr({name:"SphericalGaussianBlur",defines:{n:Zo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Oy(),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:xs,depthTest:!1,depthWrite:!1})}function _S(){return new Zr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Oy(),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:xs,depthTest:!1,depthWrite:!1})}function xS(){return new Zr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Oy(),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:xs,depthTest:!1,depthWrite:!1})}function Oy(){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 ); - - } - `}function B6(n){let e=new WeakMap,t=null;function i(l){if(l&&l.isTexture){const c=l.mapping,f=c===Lc||c===Ic,h=c===As||c===po;if(f||h)if(l.isRenderTargetTexture&&l.needsPMREMUpdate===!0){l.needsPMREMUpdate=!1;let d=e.get(l);return t===null&&(t=new hv(n)),d=f?t.fromEquirectangular(l,d):t.fromCubemap(l,d),e.set(l,d),d.texture}else{if(e.has(l))return e.get(l).texture;{const d=l.image;if(f&&d&&d.height>0||h&&d&&r(d)){t===null&&(t=new hv(n));const m=f?t.fromEquirectangular(l):t.fromCubemap(l);return e.set(l,m),l.addEventListener("dispose",s),m.texture}else return null}}}return l}function r(l){let c=0;const f=6;for(let h=0;he.maxTextureSize&&(B=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const Z=new Float32Array(R*B*4*w),le=new Gp(Z,R,B,w);le.type=lr,le.needsUpdate=!0;const G=b*4;for(let te=0;te0)return n;const r=e*t;let s=SS[r];if(s===void 0&&(s=new Float32Array(r),SS[r]=s),e!==0){i.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(s,l)}return s}function bn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${l}: ${t[o]}`)}return i.join(` -`)}function VI(n){const e=Ot.getPrimaries(Ot.workingColorSpace),t=Ot.getPrimaries(n);let i;switch(e===t?i="":e===Bc&&t===kc?i="LinearDisplayP3ToLinearSRGB":e===kc&&t===Bc&&(i="LinearSRGBToLinearDisplayP3"),n){case qr:case rf:return[i,"LinearTransferOETF"];case Tn:case Vp:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function bS(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` - -`+r+` - -`+HI(n.getShaderSource(e),o)}else return r}function GI(n,e){const t=VI(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function WI(n,e){let t;switch(e){case zE:t="Linear";break;case OE:t="Reinhard";break;case FE:t="OptimizedCineon";break;case xy:t="ACESFilmic";break;case BE:t="AgX";break;case kE:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function XI(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(bl).join(` -`)}function jI(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":""].filter(bl).join(` -`)}function YI(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function qI(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function dv(n){return n.replace(ZI,JI)}const KI=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function JI(n,e){let t=_t[e];if(t===void 0){const i=KI.get(e);if(i!==void 0)t=_t[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return dv(t)}const QI=/#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 LS(n){return n.replace(QI,$I)}function $I(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(g+=` -`),S=[v,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w].filter(bl).join(` -`),S.length>0&&(S+=` -`)):(g=[IS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",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 "+h:"",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&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(bl).join(` -`),S=[v,IS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.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?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Xr?"#define TONE_MAPPING":"",t.toneMapping!==Xr?_t.tonemapping_pars_fragment:"",t.toneMapping!==Xr?WI("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",_t.colorspace_pars_fragment,GI("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(bl).join(` -`)),o=dv(o),o=RS(o,t),o=PS(o,t),l=dv(l),l=RS(l,t),l=PS(l,t),o=LS(o),l=LS(l),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(M=`#version 300 es -`,g=[_,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+g,S=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===cv?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===cv?"":"#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(` -`)+` -`+S);const T=M+g+o,P=M+S+l,C=CS(r,r.VERTEX_SHADER,T),L=CS(r,r.FRAGMENT_SHADER,P);r.attachShader(x,C),r.attachShader(x,L),t.index0AttributeName!==void 0?r.bindAttribLocation(x,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(x,0,"position"),r.linkProgram(x);function z(Z){if(n.debug.checkShaderErrors){const le=r.getProgramInfoLog(x).trim(),G=r.getShaderInfoLog(C).trim(),Q=r.getShaderInfoLog(L).trim();let te=!0,ce=!0;if(r.getProgramParameter(x,r.LINK_STATUS)===!1)if(te=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,x,C,L);else{const N=bS(r,C,"vertex"),k=bS(r,L,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(x,r.VALIDATE_STATUS)+` - -Program Info Log: `+le+` -`+N+` -`+k)}else le!==""?console.warn("THREE.WebGLProgram: Program Info Log:",le):(G===""||Q==="")&&(ce=!1);ce&&(Z.diagnostics={runnable:te,programLog:le,vertexShader:{log:G,prefix:g},fragmentShader:{log:Q,prefix:S}})}r.deleteShader(C),r.deleteShader(L),b=new Bd(r,x),R=qI(r,x)}let b;this.getUniforms=function(){return b===void 0&&z(this),b};let R;this.getAttributes=function(){return R===void 0&&z(this),R};let B=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return B===!1&&(B=r.getProgramParameter(x,kI)),B},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(x),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=BI++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=C,this.fragmentShader=L,this}let o8=0;class a8{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.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 l8(e),t.set(e,i)),i}}class l8{constructor(e){this.id=o8++,this.code=e,this.usedTimes=0}}function u8(n,e,t,i,r,s,o){const l=new aa,c=new a8,f=[],h=r.isWebGL2,d=r.logarithmicDepthBuffer,m=r.vertexTextures;let v=r.precision;const _={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function w(b){return b===0?"uv":`uv${b}`}function x(b,R,B,Z,le){const G=Z.fog,Q=le.geometry,te=b.isMeshStandardMaterial?Z.environment:null,ce=(b.isMeshStandardMaterial?t:e).get(b.envMap||te),N=ce&&ce.mapping===tu?ce.image.height:null,k=_[b.type];b.precision!==null&&(v=r.getMaxPrecision(b.precision),v!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",v,"instead."));const H=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,q=H!==void 0?H.length:0;let J=0;Q.morphAttributes.position!==void 0&&(J=1),Q.morphAttributes.normal!==void 0&&(J=2),Q.morphAttributes.color!==void 0&&(J=3);let K,ae,ge,Ae;if(k){const Zt=wr[k];K=Zt.vertexShader,ae=Zt.fragmentShader}else K=b.vertexShader,ae=b.fragmentShader,c.update(b),ge=c.getVertexShaderID(b),Ae=c.getFragmentShaderID(b);const Ce=n.getRenderTarget(),rt=le.isInstancedMesh===!0,lt=le.isBatchedMesh===!0,Xe=!!b.map,Ke=!!b.matcap,V=!!ce,Se=!!b.aoMap,de=!!b.lightMap,Ee=!!b.bumpMap,fe=!!b.normalMap,Ze=!!b.displacementMap,Ne=!!b.emissiveMap,D=!!b.metalnessMap,I=!!b.roughnessMap,ee=b.anisotropy>0,ye=b.clearcoat>0,ve=b.iridescence>0,me=b.sheen>0,je=b.transmission>0,Le=ee&&!!b.anisotropyMap,Fe=ye&&!!b.clearcoatMap,tt=ye&&!!b.clearcoatNormalMap,dt=ye&&!!b.clearcoatRoughnessMap,_e=ve&&!!b.iridescenceMap,Ct=ve&&!!b.iridescenceThicknessMap,yt=me&&!!b.sheenColorMap,ut=me&&!!b.sheenRoughnessMap,et=!!b.specularMap,He=!!b.specularColorMap,X=!!b.specularIntensityMap,pe=je&&!!b.transmissionMap,Oe=je&&!!b.thicknessMap,Ue=!!b.gradientMap,xe=!!b.alphaMap,W=b.alphaTest>0,Re=!!b.alphaHash,Ie=!!b.extensions,nt=!!Q.attributes.uv1,Ye=!!Q.attributes.uv2,At=!!Q.attributes.uv3;let Rt=Xr;return b.toneMapped&&(Ce===null||Ce.isXRRenderTarget===!0)&&(Rt=n.toneMapping),{isWebGL2:h,shaderID:k,shaderType:b.type,shaderName:b.name,vertexShader:K,fragmentShader:ae,defines:b.defines,customVertexShaderID:ge,customFragmentShaderID:Ae,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:v,batching:lt,instancing:rt,instancingColor:rt&&le.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:Ce===null?n.outputColorSpace:Ce.isXRRenderTarget===!0?Ce.texture.colorSpace:qr,map:Xe,matcap:Ke,envMap:V,envMapMode:V&&ce.mapping,envMapCubeUVHeight:N,aoMap:Se,lightMap:de,bumpMap:Ee,normalMap:fe,displacementMap:m&&Ze,emissiveMap:Ne,normalMapObjectSpace:fe&&b.normalMapType===tT,normalMapTangentSpace:fe&&b.normalMapType===xo,metalnessMap:D,roughnessMap:I,anisotropy:ee,anisotropyMap:Le,clearcoat:ye,clearcoatMap:Fe,clearcoatNormalMap:tt,clearcoatRoughnessMap:dt,iridescence:ve,iridescenceMap:_e,iridescenceThicknessMap:Ct,sheen:me,sheenColorMap:yt,sheenRoughnessMap:ut,specularMap:et,specularColorMap:He,specularIntensityMap:X,transmission:je,transmissionMap:pe,thicknessMap:Oe,gradientMap:Ue,opaque:b.transparent===!1&&b.blending===sa,alphaMap:xe,alphaTest:W,alphaHash:Re,combine:b.combine,mapUv:Xe&&w(b.map.channel),aoMapUv:Se&&w(b.aoMap.channel),lightMapUv:de&&w(b.lightMap.channel),bumpMapUv:Ee&&w(b.bumpMap.channel),normalMapUv:fe&&w(b.normalMap.channel),displacementMapUv:Ze&&w(b.displacementMap.channel),emissiveMapUv:Ne&&w(b.emissiveMap.channel),metalnessMapUv:D&&w(b.metalnessMap.channel),roughnessMapUv:I&&w(b.roughnessMap.channel),anisotropyMapUv:Le&&w(b.anisotropyMap.channel),clearcoatMapUv:Fe&&w(b.clearcoatMap.channel),clearcoatNormalMapUv:tt&&w(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:dt&&w(b.clearcoatRoughnessMap.channel),iridescenceMapUv:_e&&w(b.iridescenceMap.channel),iridescenceThicknessMapUv:Ct&&w(b.iridescenceThicknessMap.channel),sheenColorMapUv:yt&&w(b.sheenColorMap.channel),sheenRoughnessMapUv:ut&&w(b.sheenRoughnessMap.channel),specularMapUv:et&&w(b.specularMap.channel),specularColorMapUv:He&&w(b.specularColorMap.channel),specularIntensityMapUv:X&&w(b.specularIntensityMap.channel),transmissionMapUv:pe&&w(b.transmissionMap.channel),thicknessMapUv:Oe&&w(b.thicknessMap.channel),alphaMapUv:xe&&w(b.alphaMap.channel),vertexTangents:!!Q.attributes.tangent&&(fe||ee),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!Q.attributes.color&&Q.attributes.color.itemSize===4,vertexUv1s:nt,vertexUv2s:Ye,vertexUv3s:At,pointsUvs:le.isPoints===!0&&!!Q.attributes.uv&&(Xe||xe),fog:!!G,useFog:b.fog===!0,fogExp2:G&&G.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:le.isSkinnedMesh===!0,morphTargets:Q.morphAttributes.position!==void 0,morphNormals:Q.morphAttributes.normal!==void 0,morphColors:Q.morphAttributes.color!==void 0,morphTargetsCount:q,morphTextureStride:J,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&B.length>0,shadowMapType:n.shadowMap.type,toneMapping:Rt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Xe&&b.map.isVideoTexture===!0&&Ot.getTransfer(b.map.colorSpace)===Wt,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Vr,flipSided:b.side===pi,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Ie&&b.extensions.derivatives===!0,extensionFragDepth:Ie&&b.extensions.fragDepth===!0,extensionDrawBuffers:Ie&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ie&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Ie&&b.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()}}function g(b){const R=[];if(b.shaderID?R.push(b.shaderID):(R.push(b.customVertexShaderID),R.push(b.customFragmentShaderID)),b.defines!==void 0)for(const B in b.defines)R.push(B),R.push(b.defines[B]);return b.isRawShaderMaterial===!1&&(S(R,b),M(R,b),R.push(n.outputColorSpace)),R.push(b.customProgramCacheKey),R.join()}function S(b,R){b.push(R.precision),b.push(R.outputColorSpace),b.push(R.envMapMode),b.push(R.envMapCubeUVHeight),b.push(R.mapUv),b.push(R.alphaMapUv),b.push(R.lightMapUv),b.push(R.aoMapUv),b.push(R.bumpMapUv),b.push(R.normalMapUv),b.push(R.displacementMapUv),b.push(R.emissiveMapUv),b.push(R.metalnessMapUv),b.push(R.roughnessMapUv),b.push(R.anisotropyMapUv),b.push(R.clearcoatMapUv),b.push(R.clearcoatNormalMapUv),b.push(R.clearcoatRoughnessMapUv),b.push(R.iridescenceMapUv),b.push(R.iridescenceThicknessMapUv),b.push(R.sheenColorMapUv),b.push(R.sheenRoughnessMapUv),b.push(R.specularMapUv),b.push(R.specularColorMapUv),b.push(R.specularIntensityMapUv),b.push(R.transmissionMapUv),b.push(R.thicknessMapUv),b.push(R.combine),b.push(R.fogExp2),b.push(R.sizeAttenuation),b.push(R.morphTargetsCount),b.push(R.morphAttributeCount),b.push(R.numDirLights),b.push(R.numPointLights),b.push(R.numSpotLights),b.push(R.numSpotLightMaps),b.push(R.numHemiLights),b.push(R.numRectAreaLights),b.push(R.numDirLightShadows),b.push(R.numPointLightShadows),b.push(R.numSpotLightShadows),b.push(R.numSpotLightShadowsWithMaps),b.push(R.numLightProbes),b.push(R.shadowMapType),b.push(R.toneMapping),b.push(R.numClippingPlanes),b.push(R.numClipIntersection),b.push(R.depthPacking)}function M(b,R){l.disableAll(),R.isWebGL2&&l.enable(0),R.supportsVertexTextures&&l.enable(1),R.instancing&&l.enable(2),R.instancingColor&&l.enable(3),R.matcap&&l.enable(4),R.envMap&&l.enable(5),R.normalMapObjectSpace&&l.enable(6),R.normalMapTangentSpace&&l.enable(7),R.clearcoat&&l.enable(8),R.iridescence&&l.enable(9),R.alphaTest&&l.enable(10),R.vertexColors&&l.enable(11),R.vertexAlphas&&l.enable(12),R.vertexUv1s&&l.enable(13),R.vertexUv2s&&l.enable(14),R.vertexUv3s&&l.enable(15),R.vertexTangents&&l.enable(16),R.anisotropy&&l.enable(17),R.alphaHash&&l.enable(18),R.batching&&l.enable(19),b.push(l.mask),l.disableAll(),R.fog&&l.enable(0),R.useFog&&l.enable(1),R.flatShading&&l.enable(2),R.logarithmicDepthBuffer&&l.enable(3),R.skinning&&l.enable(4),R.morphTargets&&l.enable(5),R.morphNormals&&l.enable(6),R.morphColors&&l.enable(7),R.premultipliedAlpha&&l.enable(8),R.shadowMapEnabled&&l.enable(9),R.useLegacyLights&&l.enable(10),R.doubleSided&&l.enable(11),R.flipSided&&l.enable(12),R.useDepthPacking&&l.enable(13),R.dithering&&l.enable(14),R.transmission&&l.enable(15),R.sheen&&l.enable(16),R.opaque&&l.enable(17),R.pointsUvs&&l.enable(18),R.decodeVideoTexture&&l.enable(19),b.push(l.mask)}function T(b){const R=_[b.type];let B;if(R){const Z=wr[R];B=pT.clone(Z.uniforms)}else B=b.uniforms;return B}function P(b,R){let B;for(let Z=0,le=f.length;Z0?i.push(g):v.transparent===!0?r.push(g):t.push(g)}function c(d,m,v,_,w,x){const g=o(d,m,v,_,w,x);v.transmission>0?i.unshift(g):v.transparent===!0?r.unshift(g):t.unshift(g)}function f(d,m){t.length>1&&t.sort(d||f8),i.length>1&&i.sort(m||NS),r.length>1&&r.sort(m||NS)}function h(){for(let d=e,m=n.length;d=s.length?(o=new DS,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function d8(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new O,color:new Be};break;case"SpotLight":t={position:new O,direction:new O,color:new Be,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new O,color:new Be,distance:0,decay:0};break;case"HemisphereLight":t={direction:new O,skyColor:new Be,groundColor:new Be};break;case"RectAreaLight":t={color:new Be,position:new O,halfWidth:new O,halfHeight:new O};break}return n[e.id]=t,t}}}function p8(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new he};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new he};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new he,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let m8=0;function g8(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function v8(n,e){const t=new d8,i=p8(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)r.probe.push(new O);const s=new O,o=new ft,l=new ft;function c(h,d){let m=0,v=0,_=0;for(let Z=0;Z<9;Z++)r.probe[Z].set(0,0,0);let w=0,x=0,g=0,S=0,M=0,T=0,P=0,C=0,L=0,z=0,b=0;h.sort(g8);const R=d===!0?Math.PI:1;for(let Z=0,le=h.length;Z0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Pe.LTC_FLOAT_1,r.rectAreaLTC2=Pe.LTC_FLOAT_2):(r.rectAreaLTC1=Pe.LTC_HALF_1,r.rectAreaLTC2=Pe.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Pe.LTC_FLOAT_1,r.rectAreaLTC2=Pe.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Pe.LTC_HALF_1,r.rectAreaLTC2=Pe.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=m,r.ambient[1]=v,r.ambient[2]=_;const B=r.hash;(B.directionalLength!==w||B.pointLength!==x||B.spotLength!==g||B.rectAreaLength!==S||B.hemiLength!==M||B.numDirectionalShadows!==T||B.numPointShadows!==P||B.numSpotShadows!==C||B.numSpotMaps!==L||B.numLightProbes!==b)&&(r.directional.length=w,r.spot.length=g,r.rectArea.length=S,r.point.length=x,r.hemi.length=M,r.directionalShadow.length=T,r.directionalShadowMap.length=T,r.pointShadow.length=P,r.pointShadowMap.length=P,r.spotShadow.length=C,r.spotShadowMap.length=C,r.directionalShadowMatrix.length=T,r.pointShadowMatrix.length=P,r.spotLightMatrix.length=C+L-z,r.spotLightMap.length=L,r.numSpotLightShadowsWithMaps=z,r.numLightProbes=b,B.directionalLength=w,B.pointLength=x,B.spotLength=g,B.rectAreaLength=S,B.hemiLength=M,B.numDirectionalShadows=T,B.numPointShadows=P,B.numSpotShadows=C,B.numSpotMaps=L,B.numLightProbes=b,r.version=m8++)}function f(h,d){let m=0,v=0,_=0,w=0,x=0;const g=d.matrixWorldInverse;for(let S=0,M=h.length;S=l.length?(c=new US(n,e),l.push(c)):c=l[o],c}function r(){t=new WeakMap}return{get:i,dispose:r}}class Fy extends Xn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=$E,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 ky extends Xn{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}}const _8=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,x8=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -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 = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function S8(n,e,t){let i=new lf;const r=new he,s=new he,o=new Ft,l=new Fy({depthPacking:eT}),c=new ky,f={},h=t.maxTextureSize,d={[Ts]:pi,[pi]:Ts,[Vr]:Vr},m=new Zr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new he},radius:{value:4}},vertexShader:_8,fragmentShader:x8}),v=m.clone();v.defines.HORIZONTAL_PASS=1;const _=new St;_.setAttribute("position",new Bt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new Cn(_,m),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Fp;let g=this.type;this.render=function(C,L,z){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||C.length===0)return;const b=n.getRenderTarget(),R=n.getActiveCubeFace(),B=n.getActiveMipmapLevel(),Z=n.state;Z.setBlending(xs),Z.buffers.color.setClear(1,1,1,1),Z.buffers.depth.setTest(!0),Z.setScissorTest(!1);const le=g!==xr&&this.type===xr,G=g===xr&&this.type!==xr;for(let Q=0,te=C.length;Qh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/k.x),r.x=s.x*k.x,N.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/k.y),r.y=s.y*k.y,N.mapSize.y=s.y)),N.map===null||le===!0||G===!0){const q=this.type!==xr?{minFilter:vn,magFilter:vn}:{};N.map!==null&&N.map.dispose(),N.map=new hr(r.x,r.y,q),N.map.texture.name=ce.name+".shadowMap",N.camera.updateProjectionMatrix()}n.setRenderTarget(N.map),n.clear();const H=N.getViewportCount();for(let q=0;q0||L.map&&L.alphaTest>0){const Z=R.uuid,le=L.uuid;let G=f[Z];G===void 0&&(G={},f[Z]=G);let Q=G[le];Q===void 0&&(Q=R.clone(),G[le]=Q,L.addEventListener("dispose",P)),R=Q}if(R.visible=L.visible,R.wireframe=L.wireframe,b===xr?R.side=L.shadowSide!==null?L.shadowSide:L.side:R.side=L.shadowSide!==null?L.shadowSide:d[L.side],R.alphaMap=L.alphaMap,R.alphaTest=L.alphaTest,R.map=L.map,R.clipShadows=L.clipShadows,R.clippingPlanes=L.clippingPlanes,R.clipIntersection=L.clipIntersection,R.displacementMap=L.displacementMap,R.displacementScale=L.displacementScale,R.displacementBias=L.displacementBias,R.wireframeLinewidth=L.wireframeLinewidth,R.linewidth=L.linewidth,z.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const Z=n.properties.get(R);Z.light=z}return R}function T(C,L,z,b,R){if(C.visible===!1)return;if(C.layers.test(L.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&R===xr)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(z.matrixWorldInverse,C.matrixWorld);const le=e.update(C),G=C.material;if(Array.isArray(G)){const Q=le.groups;for(let te=0,ce=Q.length;te=1):H.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),N=k>=2);let q=null,J={};const K=n.getParameter(n.SCISSOR_BOX),ae=n.getParameter(n.VIEWPORT),ge=new Ft().fromArray(K),Ae=new Ft().fromArray(ae);function Ce(W,Re,Ie,nt){const Ye=new Uint8Array(4),At=n.createTexture();n.bindTexture(W,At),n.texParameteri(W,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(W,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Rt=0;Rt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new WeakMap;let d;const m=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(D,I){return v?new OffscreenCanvas(D,I):Vc("canvas")}function w(D,I,ee,ye){let ve=1;if((D.width>ye||D.height>ye)&&(ve=ye/Math.max(D.width,D.height)),ve<1||I===!0)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap){const me=I?vp:Math.floor,je=me(ve*D.width),Le=me(ve*D.height);d===void 0&&(d=_(je,Le));const Fe=ee?_(je,Le):d;return Fe.width=je,Fe.height=Le,Fe.getContext("2d").drawImage(D,0,0,je,Le),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+D.width+"x"+D.height+") to ("+je+"x"+Le+")."),Fe}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+D.width+"x"+D.height+")."),D;return D}function x(D){return fv(D.width)&&fv(D.height)}function g(D){return l?!1:D.wrapS!==ii||D.wrapT!==ii||D.minFilter!==vn&&D.minFilter!==nn}function S(D,I){return D.generateMipmaps&&I&&D.minFilter!==vn&&D.minFilter!==nn}function M(D){n.generateMipmap(D)}function T(D,I,ee,ye,ve=!1){if(l===!1)return I;if(D!==null){if(n[D]!==void 0)return n[D];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+D+"'")}let me=I;if(I===n.RED&&(ee===n.FLOAT&&(me=n.R32F),ee===n.HALF_FLOAT&&(me=n.R16F),ee===n.UNSIGNED_BYTE&&(me=n.R8)),I===n.RED_INTEGER&&(ee===n.UNSIGNED_BYTE&&(me=n.R8UI),ee===n.UNSIGNED_SHORT&&(me=n.R16UI),ee===n.UNSIGNED_INT&&(me=n.R32UI),ee===n.BYTE&&(me=n.R8I),ee===n.SHORT&&(me=n.R16I),ee===n.INT&&(me=n.R32I)),I===n.RG&&(ee===n.FLOAT&&(me=n.RG32F),ee===n.HALF_FLOAT&&(me=n.RG16F),ee===n.UNSIGNED_BYTE&&(me=n.RG8)),I===n.RGBA){const je=ve?Fc:Ot.getTransfer(ye);ee===n.FLOAT&&(me=n.RGBA32F),ee===n.HALF_FLOAT&&(me=n.RGBA16F),ee===n.UNSIGNED_BYTE&&(me=je===Wt?n.SRGB8_ALPHA8:n.RGBA8),ee===n.UNSIGNED_SHORT_4_4_4_4&&(me=n.RGBA4),ee===n.UNSIGNED_SHORT_5_5_5_1&&(me=n.RGB5_A1)}return(me===n.R16F||me===n.R32F||me===n.RG16F||me===n.RG32F||me===n.RGBA16F||me===n.RGBA32F)&&e.get("EXT_color_buffer_float"),me}function P(D,I,ee){return S(D,ee)===!0||D.isFramebufferTexture&&D.minFilter!==vn&&D.minFilter!==nn?Math.log2(Math.max(I.width,I.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?I.mipmaps.length:1}function C(D){return D===vn||D===mp||D===lc?n.NEAREST:n.LINEAR}function L(D){const I=D.target;I.removeEventListener("dispose",L),b(I),I.isVideoTexture&&h.delete(I)}function z(D){const I=D.target;I.removeEventListener("dispose",z),B(I)}function b(D){const I=i.get(D);if(I.__webglInit===void 0)return;const ee=D.source,ye=m.get(ee);if(ye){const ve=ye[I.__cacheKey];ve.usedTimes--,ve.usedTimes===0&&R(D),Object.keys(ye).length===0&&m.delete(ee)}i.remove(D)}function R(D){const I=i.get(D);n.deleteTexture(I.__webglTexture);const ee=D.source,ye=m.get(ee);delete ye[I.__cacheKey],o.memory.textures--}function B(D){const I=D.texture,ee=i.get(D),ye=i.get(I);if(ye.__webglTexture!==void 0&&(n.deleteTexture(ye.__webglTexture),o.memory.textures--),D.depthTexture&&D.depthTexture.dispose(),D.isWebGLCubeRenderTarget)for(let ve=0;ve<6;ve++){if(Array.isArray(ee.__webglFramebuffer[ve]))for(let me=0;me=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+r.maxTextures),Z+=1,D}function Q(D){const I=[];return I.push(D.wrapS),I.push(D.wrapT),I.push(D.wrapR||0),I.push(D.magFilter),I.push(D.minFilter),I.push(D.anisotropy),I.push(D.internalFormat),I.push(D.format),I.push(D.type),I.push(D.generateMipmaps),I.push(D.premultiplyAlpha),I.push(D.flipY),I.push(D.unpackAlignment),I.push(D.colorSpace),I.join()}function te(D,I){const ee=i.get(D);if(D.isVideoTexture&&Ze(D),D.isRenderTargetTexture===!1&&D.version>0&&ee.__version!==D.version){const ye=D.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ge(ee,D,I);return}}t.bindTexture(n.TEXTURE_2D,ee.__webglTexture,n.TEXTURE0+I)}function ce(D,I){const ee=i.get(D);if(D.version>0&&ee.__version!==D.version){ge(ee,D,I);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ee.__webglTexture,n.TEXTURE0+I)}function N(D,I){const ee=i.get(D);if(D.version>0&&ee.__version!==D.version){ge(ee,D,I);return}t.bindTexture(n.TEXTURE_3D,ee.__webglTexture,n.TEXTURE0+I)}function k(D,I){const ee=i.get(D);if(D.version>0&&ee.__version!==D.version){Ae(ee,D,I);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ee.__webglTexture,n.TEXTURE0+I)}const H={[Nc]:n.REPEAT,[ii]:n.CLAMP_TO_EDGE,[Dc]:n.MIRRORED_REPEAT},q={[vn]:n.NEAREST,[mp]:n.NEAREST_MIPMAP_NEAREST,[lc]:n.NEAREST_MIPMAP_LINEAR,[nn]:n.LINEAR,[Sy]:n.LINEAR_MIPMAP_NEAREST,[mo]:n.LINEAR_MIPMAP_LINEAR},J={[nT]:n.NEVER,[lT]:n.ALWAYS,[iT]:n.LESS,[Ly]:n.LEQUAL,[rT]:n.EQUAL,[aT]:n.GEQUAL,[sT]:n.GREATER,[oT]:n.NOTEQUAL};function K(D,I,ee){if(ee?(n.texParameteri(D,n.TEXTURE_WRAP_S,H[I.wrapS]),n.texParameteri(D,n.TEXTURE_WRAP_T,H[I.wrapT]),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,H[I.wrapR]),n.texParameteri(D,n.TEXTURE_MAG_FILTER,q[I.magFilter]),n.texParameteri(D,n.TEXTURE_MIN_FILTER,q[I.minFilter])):(n.texParameteri(D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(I.wrapS!==ii||I.wrapT!==ii)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(D,n.TEXTURE_MAG_FILTER,C(I.magFilter)),n.texParameteri(D,n.TEXTURE_MIN_FILTER,C(I.minFilter)),I.minFilter!==vn&&I.minFilter!==nn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),I.compareFunction&&(n.texParameteri(D,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(D,n.TEXTURE_COMPARE_FUNC,J[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ye=e.get("EXT_texture_filter_anisotropic");if(I.magFilter===vn||I.minFilter!==lc&&I.minFilter!==mo||I.type===lr&&e.has("OES_texture_float_linear")===!1||l===!1&&I.type===ma&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||i.get(I).__currentAnisotropy)&&(n.texParameterf(D,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,r.getMaxAnisotropy())),i.get(I).__currentAnisotropy=I.anisotropy)}}function ae(D,I){let ee=!1;D.__webglInit===void 0&&(D.__webglInit=!0,I.addEventListener("dispose",L));const ye=I.source;let ve=m.get(ye);ve===void 0&&(ve={},m.set(ye,ve));const me=Q(I);if(me!==D.__cacheKey){ve[me]===void 0&&(ve[me]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ee=!0),ve[me].usedTimes++;const je=ve[D.__cacheKey];je!==void 0&&(ve[D.__cacheKey].usedTimes--,je.usedTimes===0&&R(I)),D.__cacheKey=me,D.__webglTexture=ve[me].texture}return ee}function ge(D,I,ee){let ye=n.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(ye=n.TEXTURE_2D_ARRAY),I.isData3DTexture&&(ye=n.TEXTURE_3D);const ve=ae(D,I),me=I.source;t.bindTexture(ye,D.__webglTexture,n.TEXTURE0+ee);const je=i.get(me);if(me.version!==je.__version||ve===!0){t.activeTexture(n.TEXTURE0+ee);const Le=Ot.getPrimaries(Ot.workingColorSpace),Fe=I.colorSpace===Bi?null:Ot.getPrimaries(I.colorSpace),tt=I.colorSpace===Bi||Le===Fe?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,I.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,I.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,tt);const dt=g(I)&&x(I.image)===!1;let _e=w(I.image,dt,!1,r.maxTextureSize);_e=Ne(I,_e);const Ct=x(_e)||l,yt=s.convert(I.format,I.colorSpace);let ut=s.convert(I.type),et=T(I.internalFormat,yt,ut,I.colorSpace,I.isVideoTexture);K(ye,I,Ct);let He;const X=I.mipmaps,pe=l&&I.isVideoTexture!==!0&&et!==by,Oe=je.__version===void 0||ve===!0,Ue=P(I,_e,Ct);if(I.isDepthTexture)et=n.DEPTH_COMPONENT,l?I.type===lr?et=n.DEPTH_COMPONENT32F:I.type===gs?et=n.DEPTH_COMPONENT24:I.type===lo?et=n.DEPTH24_STENCIL8:et=n.DEPTH_COMPONENT16:I.type===lr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===uo&&et===n.DEPTH_COMPONENT&&I.type!==Bp&&I.type!==gs&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=gs,ut=s.convert(I.type)),I.format===ga&&et===n.DEPTH_COMPONENT&&(et=n.DEPTH_STENCIL,I.type!==lo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=lo,ut=s.convert(I.type))),Oe&&(pe?t.texStorage2D(n.TEXTURE_2D,1,et,_e.width,_e.height):t.texImage2D(n.TEXTURE_2D,0,et,_e.width,_e.height,0,yt,ut,null));else if(I.isDataTexture)if(X.length>0&&Ct){pe&&Oe&&t.texStorage2D(n.TEXTURE_2D,Ue,et,X[0].width,X[0].height);for(let xe=0,W=X.length;xe>=1,W>>=1}}else if(X.length>0&&Ct){pe&&Oe&&t.texStorage2D(n.TEXTURE_2D,Ue,et,X[0].width,X[0].height);for(let xe=0,W=X.length;xe0&&Oe++,t.texStorage2D(n.TEXTURE_CUBE_MAP,Oe,He,_e[0].width,_e[0].height));for(let xe=0;xe<6;xe++)if(dt){X?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+xe,0,0,0,_e[xe].width,_e[xe].height,ut,et,_e[xe].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+xe,0,He,_e[xe].width,_e[xe].height,0,ut,et,_e[xe].data);for(let W=0;W>me),_e=Math.max(1,I.height>>me);ve===n.TEXTURE_3D||ve===n.TEXTURE_2D_ARRAY?t.texImage3D(ve,me,Fe,dt,_e,I.depth,0,je,Le,null):t.texImage2D(ve,me,Fe,dt,_e,0,je,Le,null)}t.bindFramebuffer(n.FRAMEBUFFER,D),fe(I)?c.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ye,ve,i.get(ee).__webglTexture,0,Ee(I)):(ve===n.TEXTURE_2D||ve>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ve<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ye,ve,i.get(ee).__webglTexture,me),t.bindFramebuffer(n.FRAMEBUFFER,null)}function rt(D,I,ee){if(n.bindRenderbuffer(n.RENDERBUFFER,D),I.depthBuffer&&!I.stencilBuffer){let ye=l===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(ee||fe(I)){const ve=I.depthTexture;ve&&ve.isDepthTexture&&(ve.type===lr?ye=n.DEPTH_COMPONENT32F:ve.type===gs&&(ye=n.DEPTH_COMPONENT24));const me=Ee(I);fe(I)?c.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,me,ye,I.width,I.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,me,ye,I.width,I.height)}else n.renderbufferStorage(n.RENDERBUFFER,ye,I.width,I.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,D)}else if(I.depthBuffer&&I.stencilBuffer){const ye=Ee(I);ee&&fe(I)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,ye,n.DEPTH24_STENCIL8,I.width,I.height):fe(I)?c.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ye,n.DEPTH24_STENCIL8,I.width,I.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,I.width,I.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,D)}else{const ye=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let ve=0;ve0){ee.__webglFramebuffer[Le]=[];for(let Fe=0;Fe0){ee.__webglFramebuffer=[];for(let Le=0;Le0&&fe(D)===!1){const Le=me?I:[I];ee.__webglMultisampledFramebuffer=n.createFramebuffer(),ee.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ee.__webglMultisampledFramebuffer);for(let Fe=0;Fe0)for(let Fe=0;Fe0)for(let Fe=0;Fe0&&fe(D)===!1){const I=D.isWebGLMultipleRenderTargets?D.texture:[D.texture],ee=D.width,ye=D.height;let ve=n.COLOR_BUFFER_BIT;const me=[],je=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Le=i.get(D),Fe=D.isWebGLMultipleRenderTargets===!0;if(Fe)for(let tt=0;tt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function Ze(D){const I=o.render.frame;h.get(D)!==I&&(h.set(D,I),D.update())}function Ne(D,I){const ee=D.colorSpace,ye=D.format,ve=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||D.format===gp||ee!==qr&&ee!==Bi&&(Ot.getTransfer(ee)===Wt?l===!1?e.has("EXT_sRGB")===!0&&ye===hi?(D.format=gp,D.minFilter=nn,D.generateMipmaps=!1):I=Ny.sRGBToLinear(I):(ye!==hi||ve!==jr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ee)),I}this.allocateTextureUnit=G,this.resetTextureUnits=le,this.setTexture2D=te,this.setTexture2DArray=ce,this.setTexture3D=N,this.setTextureCube=k,this.rebindTextures=Ke,this.setupRenderTarget=V,this.updateRenderTargetMipmap=Se,this.updateMultisampleRenderTarget=de,this.setupDepthRenderbuffer=Xe,this.setupFrameBufferTexture=Ce,this.useMultisampledRTT=fe}function wT(n,e,t){const i=t.isWebGL2;function r(s,o=Bi){let l;const c=Ot.getTransfer(o);if(s===jr)return n.UNSIGNED_BYTE;if(s===wy)return n.UNSIGNED_SHORT_4_4_4_4;if(s===Ey)return n.UNSIGNED_SHORT_5_5_5_1;if(s===VE)return n.BYTE;if(s===GE)return n.SHORT;if(s===Bp)return n.UNSIGNED_SHORT;if(s===My)return n.INT;if(s===gs)return n.UNSIGNED_INT;if(s===lr)return n.FLOAT;if(s===ma)return i?n.HALF_FLOAT:(l=e.get("OES_texture_half_float"),l!==null?l.HALF_FLOAT_OES:null);if(s===WE)return n.ALPHA;if(s===hi)return n.RGBA;if(s===XE)return n.LUMINANCE;if(s===jE)return n.LUMINANCE_ALPHA;if(s===uo)return n.DEPTH_COMPONENT;if(s===ga)return n.DEPTH_STENCIL;if(s===gp)return l=e.get("EXT_sRGB"),l!==null?l.SRGB_ALPHA_EXT:null;if(s===YE)return n.RED;if(s===Ty)return n.RED_INTEGER;if(s===qE)return n.RG;if(s===Ay)return n.RG_INTEGER;if(s===Cy)return n.RGBA_INTEGER;if(s===Dd||s===Ud||s===zd||s===Od)if(c===Wt)if(l=e.get("WEBGL_compressed_texture_s3tc_srgb"),l!==null){if(s===Dd)return l.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Ud)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===zd)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Od)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(l=e.get("WEBGL_compressed_texture_s3tc"),l!==null){if(s===Dd)return l.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Ud)return l.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===zd)return l.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Od)return l.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===F1||s===k1||s===B1||s===H1)if(l=e.get("WEBGL_compressed_texture_pvrtc"),l!==null){if(s===F1)return l.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===k1)return l.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===B1)return l.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===H1)return l.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===by)return l=e.get("WEBGL_compressed_texture_etc1"),l!==null?l.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===V1||s===G1)if(l=e.get("WEBGL_compressed_texture_etc"),l!==null){if(s===V1)return c===Wt?l.COMPRESSED_SRGB8_ETC2:l.COMPRESSED_RGB8_ETC2;if(s===G1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:l.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===W1||s===X1||s===j1||s===Y1||s===q1||s===Z1||s===K1||s===J1||s===Q1||s===$1||s===ev||s===tv||s===nv||s===iv)if(l=e.get("WEBGL_compressed_texture_astc"),l!==null){if(s===W1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:l.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===X1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:l.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===j1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:l.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Y1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:l.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===q1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:l.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Z1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:l.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===K1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:l.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===J1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:l.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Q1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:l.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===$1)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:l.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===ev)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:l.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===tv)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:l.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===nv)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:l.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===iv)return c===Wt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:l.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Fd||s===rv||s===sv)if(l=e.get("EXT_texture_compression_bptc"),l!==null){if(s===Fd)return c===Wt?l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:l.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===rv)return l.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===sv)return l.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===ZE||s===ov||s===av||s===lv)if(l=e.get("EXT_texture_compression_rgtc"),l!==null){if(s===Fd)return l.COMPRESSED_RED_RGTC1_EXT;if(s===ov)return l.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===av)return l.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===lv)return l.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===lo?i?n.UNSIGNED_INT_24_8:(l=e.get("WEBGL_depth_texture"),l!==null?l.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class ET extends hn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Rl extends zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const E8={type:"move"};class dg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Rl,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Rl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new O,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new O),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Rl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new O,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new O),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const l=this._targetRay,c=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const w of e.hand.values()){const x=t.getJointPose(w,i),g=this._getHandJoint(f,w);x!==null&&(g.matrix.fromArray(x.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=x.radius),g.visible=x!==null}const h=f.joints["index-finger-tip"],d=f.joints["thumb-tip"],m=h.position.distanceTo(d.position),v=.02,_=.005;f.inputState.pinching&&m>v+_?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&m<=v-_&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));l!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(E8)))}return l!==null&&(l.visible=r!==null),c!==null&&(c.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Rl;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class T8 extends Kr{constructor(e,t){super();const i=this;let r=null,s=1,o=null,l="local-floor",c=1,f=null,h=null,d=null,m=null,v=null,_=null;const w=t.getContextAttributes();let x=null,g=null;const S=[],M=[],T=new he;let P=null;const C=new hn;C.layers.enable(1),C.viewport=new Ft;const L=new hn;L.layers.enable(2),L.viewport=new Ft;const z=[C,L],b=new ET;b.layers.enable(1),b.layers.enable(2);let R=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let ae=S[K];return ae===void 0&&(ae=new dg,S[K]=ae),ae.getTargetRaySpace()},this.getControllerGrip=function(K){let ae=S[K];return ae===void 0&&(ae=new dg,S[K]=ae),ae.getGripSpace()},this.getHand=function(K){let ae=S[K];return ae===void 0&&(ae=new dg,S[K]=ae),ae.getHandSpace()};function Z(K){const ae=M.indexOf(K.inputSource);if(ae===-1)return;const ge=S[ae];ge!==void 0&&(ge.update(K.inputSource,K.frame,f||o),ge.dispatchEvent({type:K.type,data:K.inputSource}))}function le(){r.removeEventListener("select",Z),r.removeEventListener("selectstart",Z),r.removeEventListener("selectend",Z),r.removeEventListener("squeeze",Z),r.removeEventListener("squeezestart",Z),r.removeEventListener("squeezeend",Z),r.removeEventListener("end",le),r.removeEventListener("inputsourceschange",G);for(let K=0;K=0&&(M[Ae]=null,S[Ae].disconnect(ge))}for(let ae=0;ae=M.length){M.push(ge),Ae=rt;break}else if(M[rt]===null){M[rt]=ge,Ae=rt;break}if(Ae===-1)break}const Ce=S[Ae];Ce&&Ce.connect(ge)}}const Q=new O,te=new O;function ce(K,ae,ge){Q.setFromMatrixPosition(ae.matrixWorld),te.setFromMatrixPosition(ge.matrixWorld);const Ae=Q.distanceTo(te),Ce=ae.projectionMatrix.elements,rt=ge.projectionMatrix.elements,lt=Ce[14]/(Ce[10]-1),Xe=Ce[14]/(Ce[10]+1),Ke=(Ce[9]+1)/Ce[5],V=(Ce[9]-1)/Ce[5],Se=(Ce[8]-1)/Ce[0],de=(rt[8]+1)/rt[0],Ee=lt*Se,fe=lt*de,Ze=Ae/(-Se+de),Ne=Ze*-Se;ae.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(Ne),K.translateZ(Ze),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert();const D=lt+Ze,I=Xe+Ze,ee=Ee-Ne,ye=fe+(Ae-Ne),ve=Ke*Xe/I*D,me=V*Xe/I*D;K.projectionMatrix.makePerspective(ee,ye,ve,me,D,I),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}function N(K,ae){ae===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(ae.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(r===null)return;b.near=L.near=C.near=K.near,b.far=L.far=C.far=K.far,(R!==b.near||B!==b.far)&&(r.updateRenderState({depthNear:b.near,depthFar:b.far}),R=b.near,B=b.far);const ae=K.parent,ge=b.cameras;N(b,ae);for(let Ae=0;Ae0&&(x.alphaTest.value=g.alphaTest);const S=e.get(g).envMap;if(S&&(x.envMap.value=S,x.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=g.reflectivity,x.ior.value=g.ior,x.refractionRatio.value=g.refractionRatio),g.lightMap){x.lightMap.value=g.lightMap;const M=n._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=g.lightMapIntensity*M,t(g.lightMap,x.lightMapTransform)}g.aoMap&&(x.aoMap.value=g.aoMap,x.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,x.aoMapTransform))}function o(x,g){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,g.map&&(x.map.value=g.map,t(g.map,x.mapTransform))}function l(x,g){x.dashSize.value=g.dashSize,x.totalSize.value=g.dashSize+g.gapSize,x.scale.value=g.scale}function c(x,g,S,M){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.size.value=g.size*S,x.scale.value=M*.5,g.map&&(x.map.value=g.map,t(g.map,x.uvTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest)}function f(x,g){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.rotation.value=g.rotation,g.map&&(x.map.value=g.map,t(g.map,x.mapTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest)}function h(x,g){x.specular.value.copy(g.specular),x.shininess.value=Math.max(g.shininess,1e-4)}function d(x,g){g.gradientMap&&(x.gradientMap.value=g.gradientMap)}function m(x,g){x.metalness.value=g.metalness,g.metalnessMap&&(x.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,x.metalnessMapTransform)),x.roughness.value=g.roughness,g.roughnessMap&&(x.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,x.roughnessMapTransform)),e.get(g).envMap&&(x.envMapIntensity.value=g.envMapIntensity)}function v(x,g,S){x.ior.value=g.ior,g.sheen>0&&(x.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),x.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(x.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,x.sheenColorMapTransform)),g.sheenRoughnessMap&&(x.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,x.sheenRoughnessMapTransform))),g.clearcoat>0&&(x.clearcoat.value=g.clearcoat,x.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(x.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,x.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(x.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===pi&&x.clearcoatNormalScale.value.negate())),g.iridescence>0&&(x.iridescence.value=g.iridescence,x.iridescenceIOR.value=g.iridescenceIOR,x.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(x.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,x.iridescenceMapTransform)),g.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),g.transmission>0&&(x.transmission.value=g.transmission,x.transmissionSamplerMap.value=S.texture,x.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(x.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,x.transmissionMapTransform)),x.thickness.value=g.thickness,g.thicknessMap&&(x.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=g.attenuationDistance,x.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(x.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(x.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=g.specularIntensity,x.specularColor.value.copy(g.specularColor),g.specularColorMap&&(x.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,x.specularColorMapTransform)),g.specularIntensityMap&&(x.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,x.specularIntensityMapTransform))}function _(x,g){g.matcap&&(x.matcap.value=g.matcap)}function w(x,g){const S=e.get(g).light;x.referencePosition.value.setFromMatrixPosition(S.matrixWorld),x.nearDistance.value=S.shadow.camera.near,x.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function C8(n,e,t,i){let r={},s={},o=[];const l=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(S,M){const T=M.program;i.uniformBlockBinding(S,T)}function f(S,M){let T=r[S.id];T===void 0&&(_(S),T=h(S),r[S.id]=T,S.addEventListener("dispose",x));const P=M.program;i.updateUBOMapping(S,P);const C=e.render.frame;s[S.id]!==C&&(m(S),s[S.id]=C)}function h(S){const M=d();S.__bindingPointIndex=M;const T=n.createBuffer(),P=S.__size,C=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,P,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,M,T),T}function d(){for(let S=0;S0&&(T+=P-C),S.__size=T,S.__cache={},this}function w(S){const M={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(M.boundary=4,M.storage=4):S.isVector2?(M.boundary=8,M.storage=8):S.isVector3||S.isColor?(M.boundary=16,M.storage=12):S.isVector4?(M.boundary=16,M.storage=16):S.isMatrix3?(M.boundary=48,M.storage=48):S.isMatrix4?(M.boundary=64,M.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),M}function x(S){const M=S.target;M.removeEventListener("dispose",x);const T=o.indexOf(M.__bindingPointIndex);o.splice(T,1),n.deleteBuffer(r[M.id]),delete r[M.id],delete s[M.id]}function g(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:c,update:f,dispose:g}}class By{constructor(e={}){const{canvas:t=cT(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:l=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:f=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let m;i!==null?m=i.getContextAttributes().alpha:m=o;const v=new Uint32Array(4),_=new Int32Array(4);let w=null,x=null;const g=[],S=[];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._outputColorSpace=Tn,this._useLegacyLights=!1,this.toneMapping=Xr,this.toneMappingExposure=1;const M=this;let T=!1,P=0,C=0,L=null,z=-1,b=null;const R=new Ft,B=new Ft;let Z=null;const le=new Be(0);let G=0,Q=t.width,te=t.height,ce=1,N=null,k=null;const H=new Ft(0,0,Q,te),q=new Ft(0,0,Q,te);let J=!1;const K=new lf;let ae=!1,ge=!1,Ae=null;const Ce=new ft,rt=new he,lt=new O,Xe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ke(){return L===null?ce:1}let V=i;function Se(U,$){for(let re=0;re{function ke(){if(se.forEach(function(Qe){Ne.get(Qe).currentProgram.isReady()&&se.delete(Qe)}),se.size===0){ie(U);return}setTimeout(ke,10)}de.get("KHR_parallel_shader_compile")!==null?ke():setTimeout(ke,10)})};let Rt=null;function Vt(U){Rt&&Rt(U)}function Zt(){Fn.stop()}function Pt(){Fn.start()}const Fn=new vT;Fn.setAnimationLoop(Vt),typeof self<"u"&&Fn.setContext(self),this.setAnimationLoop=function(U){Rt=U,Ue.setAnimationLoop(U),U===null?Fn.stop():Fn.start()},Ue.addEventListener("sessionstart",Zt),Ue.addEventListener("sessionend",Pt),this.render=function(U,$){if($!==void 0&&$.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),$.parent===null&&$.matrixWorldAutoUpdate===!0&&$.updateMatrixWorld(),Ue.enabled===!0&&Ue.isPresenting===!0&&(Ue.cameraAutoUpdate===!0&&Ue.updateCamera($),$=Ue.getCamera()),U.isScene===!0&&U.onBeforeRender(M,U,$,L),x=tt.get(U,S.length),x.init(),S.push(x),Ce.multiplyMatrices($.projectionMatrix,$.matrixWorldInverse),K.setFromProjectionMatrix(Ce),ge=this.localClippingEnabled,ae=dt.init(this.clippingPlanes,ge),w=Fe.get(U,g.length),w.init(),g.push(w),Yi(U,$,0,M.sortObjects),w.finish(),M.sortObjects===!0&&w.sort(N,k),this.info.render.frame++,ae===!0&&dt.beginShadows();const re=x.state.shadowsArray;if(_e.render(re,U,$),ae===!0&&dt.endShadows(),this.info.autoReset===!0&&this.info.reset(),Ct.render(w,U),x.setupLights(M._useLegacyLights),$.isArrayCamera){const se=$.cameras;for(let ie=0,ke=se.length;ie0?x=S[S.length-1]:x=null,g.pop(),g.length>0?w=g[g.length-1]:w=null};function Yi(U,$,re,se){if(U.visible===!1)return;if(U.layers.test($.layers)){if(U.isGroup)re=U.renderOrder;else if(U.isLOD)U.autoUpdate===!0&&U.update($);else if(U.isLight)x.pushLight(U),U.castShadow&&x.pushShadow(U);else if(U.isSprite){if(!U.frustumCulled||K.intersectsSprite(U)){se&<.setFromMatrixPosition(U.matrixWorld).applyMatrix4(Ce);const Qe=me.update(U),st=U.material;st.visible&&w.push(U,Qe,st,re,lt.z,null)}}else if((U.isMesh||U.isLine||U.isPoints)&&(!U.frustumCulled||K.intersectsObject(U))){const Qe=me.update(U),st=U.material;if(se&&(U.boundingSphere!==void 0?(U.boundingSphere===null&&U.computeBoundingSphere(),lt.copy(U.boundingSphere.center)):(Qe.boundingSphere===null&&Qe.computeBoundingSphere(),lt.copy(Qe.boundingSphere.center)),lt.applyMatrix4(U.matrixWorld).applyMatrix4(Ce)),Array.isArray(st)){const ot=Qe.groups;for(let pt=0,ht=ot.length;pt0&&ou(ie,ke,$,re),se&&fe.viewport(R.copy(se)),ie.length>0&&Aa(ie,$,re),ke.length>0&&Aa(ke,$,re),Qe.length>0&&Aa(Qe,$,re),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function ou(U,$,re,se){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;const ke=Ee.isWebGL2;Ae===null&&(Ae=new hr(1,1,{generateMipmaps:!0,type:de.has("EXT_color_buffer_half_float")?ma:jr,minFilter:mo,samples:ke?4:0})),M.getDrawingBufferSize(rt),ke?Ae.setSize(rt.x,rt.y):Ae.setSize(vp(rt.x),vp(rt.y));const Qe=M.getRenderTarget();M.setRenderTarget(Ae),M.getClearColor(le),G=M.getClearAlpha(),G<1&&M.setClearColor(16777215,.5),M.clear();const st=M.toneMapping;M.toneMapping=Xr,Aa(U,re,se),D.updateMultisampleRenderTarget(Ae),D.updateRenderTargetMipmap(Ae);let ot=!1;for(let pt=0,ht=$.length;pt0),mt=!!re.morphAttributes.position,$t=!!re.morphAttributes.normal,kn=!!re.morphAttributes.color;let jt=Xr;se.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(jt=M.toneMapping);const Pn=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,at=Pn!==void 0?Pn.length:0,Ge=Ne.get(se),qi=x.state.lights;if(ae===!0&&(ge===!0||U!==b)){const Bn=U===b&&se.id===z;dt.setState(se,U,Bn)}let Et=!1;se.version===Ge.__version?(Ge.needsLights&&Ge.lightsStateVersion!==qi.state.version||Ge.outputColorSpace!==st||ie.isBatchedMesh&&Ge.batching===!1||!ie.isBatchedMesh&&Ge.batching===!0||ie.isInstancedMesh&&Ge.instancing===!1||!ie.isInstancedMesh&&Ge.instancing===!0||ie.isSkinnedMesh&&Ge.skinning===!1||!ie.isSkinnedMesh&&Ge.skinning===!0||ie.isInstancedMesh&&Ge.instancingColor===!0&&ie.instanceColor===null||ie.isInstancedMesh&&Ge.instancingColor===!1&&ie.instanceColor!==null||Ge.envMap!==ot||se.fog===!0&&Ge.fog!==ke||Ge.numClippingPlanes!==void 0&&(Ge.numClippingPlanes!==dt.numPlanes||Ge.numIntersection!==dt.numIntersection)||Ge.vertexAlphas!==pt||Ge.vertexTangents!==ht||Ge.morphTargets!==mt||Ge.morphNormals!==$t||Ge.morphColors!==kn||Ge.toneMapping!==jt||Ee.isWebGL2===!0&&Ge.morphTargetsCount!==at)&&(Et=!0):(Et=!0,Ge.__version=se.version);let an=Ge.currentProgram;Et===!0&&(an=Ca(se,$,ie));let Pr=!1,Zi=!1,Ln=!1;const pn=an.getUniforms(),Lr=Ge.uniforms;if(fe.useProgram(an.program)&&(Pr=!0,Zi=!0,Ln=!0),se.id!==z&&(z=se.id,Zi=!0),Pr||b!==U){pn.setValue(V,"projectionMatrix",U.projectionMatrix),pn.setValue(V,"viewMatrix",U.matrixWorldInverse);const Bn=pn.map.cameraPosition;Bn!==void 0&&Bn.setValue(V,lt.setFromMatrixPosition(U.matrixWorld)),Ee.logarithmicDepthBuffer&&pn.setValue(V,"logDepthBufFC",2/(Math.log(U.far+1)/Math.LN2)),(se.isMeshPhongMaterial||se.isMeshToonMaterial||se.isMeshLambertMaterial||se.isMeshBasicMaterial||se.isMeshStandardMaterial||se.isShaderMaterial)&&pn.setValue(V,"isOrthographic",U.isOrthographicCamera===!0),b!==U&&(b=U,Zi=!0,Ln=!0)}if(ie.isSkinnedMesh){pn.setOptional(V,ie,"bindMatrix"),pn.setOptional(V,ie,"bindMatrixInverse");const Bn=ie.skeleton;Bn&&(Ee.floatVertexTextures?(Bn.boneTexture===null&&Bn.computeBoneTexture(),pn.setValue(V,"boneTexture",Bn.boneTexture,D)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ie.isBatchedMesh&&(pn.setOptional(V,ie,"batchingTexture"),pn.setValue(V,"batchingTexture",ie._matricesTexture,D));const ba=re.morphAttributes;if((ba.position!==void 0||ba.normal!==void 0||ba.color!==void 0&&Ee.isWebGL2===!0)&&yt.update(ie,re,an),(Zi||Ge.receiveShadow!==ie.receiveShadow)&&(Ge.receiveShadow=ie.receiveShadow,pn.setValue(V,"receiveShadow",ie.receiveShadow)),se.isMeshGouraudMaterial&&se.envMap!==null&&(Lr.envMap.value=ot,Lr.flipEnvMap.value=ot.isCubeTexture&&ot.isRenderTargetTexture===!1?-1:1),Zi&&(pn.setValue(V,"toneMappingExposure",M.toneMappingExposure),Ge.needsLights&&dm(Lr,Ln),ke&&se.fog===!0&&Le.refreshFogUniforms(Lr,ke),Le.refreshMaterialUniforms(Lr,se,ce,te,Ae),Bd.upload(V,mf(Ge),Lr,D)),se.isShaderMaterial&&se.uniformsNeedUpdate===!0&&(Bd.upload(V,mf(Ge),Lr,D),se.uniformsNeedUpdate=!1),se.isSpriteMaterial&&pn.setValue(V,"center",ie.center),pn.setValue(V,"modelViewMatrix",ie.modelViewMatrix),pn.setValue(V,"normalMatrix",ie.normalMatrix),pn.setValue(V,"modelMatrix",ie.matrixWorld),se.isShaderMaterial||se.isRawShaderMaterial){const Bn=se.uniformsGroups;for(let Ra=0,Li=Bn.length;Ra0&&D.useMultisampledRTT(U)===!1?ie=Ne.get(U).__webglMultisampledFramebuffer:Array.isArray(ht)?ie=ht[re]:ie=ht,R.copy(U.viewport),B.copy(U.scissor),Z=U.scissorTest}else R.copy(H).multiplyScalar(ce).floor(),B.copy(q).multiplyScalar(ce).floor(),Z=J;if(fe.bindFramebuffer(V.FRAMEBUFFER,ie)&&Ee.drawBuffers&&se&&fe.drawBuffers(U,ie),fe.viewport(R),fe.scissor(B),fe.setScissorTest(Z),ke){const ot=Ne.get(U.texture);V.framebufferTexture2D(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot.__webglTexture,re)}else if(Qe){const ot=Ne.get(U.texture),pt=$||0;V.framebufferTextureLayer(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,ot.__webglTexture,re||0,pt)}z=-1},this.readRenderTargetPixels=function(U,$,re,se,ie,ke,Qe){if(!(U&&U.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let st=Ne.get(U).__webglFramebuffer;if(U.isWebGLCubeRenderTarget&&Qe!==void 0&&(st=st[Qe]),st){fe.bindFramebuffer(V.FRAMEBUFFER,st);try{const ot=U.texture,pt=ot.format,ht=ot.type;if(pt!==hi&&He.convert(pt)!==V.getParameter(V.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const mt=ht===ma&&(de.has("EXT_color_buffer_half_float")||Ee.isWebGL2&&de.has("EXT_color_buffer_float"));if(ht!==jr&&He.convert(ht)!==V.getParameter(V.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ht===lr&&(Ee.isWebGL2||de.has("OES_texture_float")||de.has("WEBGL_color_buffer_float")))&&!mt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}$>=0&&$<=U.width-se&&re>=0&&re<=U.height-ie&&V.readPixels($,re,se,ie,He.convert(pt),He.convert(ht),ke)}finally{const ot=L!==null?Ne.get(L).__webglFramebuffer:null;fe.bindFramebuffer(V.FRAMEBUFFER,ot)}}},this.copyFramebufferToTexture=function(U,$,re=0){const se=Math.pow(2,-re),ie=Math.floor($.image.width*se),ke=Math.floor($.image.height*se);D.setTexture2D($,0),V.copyTexSubImage2D(V.TEXTURE_2D,re,0,0,U.x,U.y,ie,ke),fe.unbindTexture()},this.copyTextureToTexture=function(U,$,re,se=0){const ie=$.image.width,ke=$.image.height,Qe=He.convert(re.format),st=He.convert(re.type);D.setTexture2D(re,0),V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,re.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,re.unpackAlignment),$.isDataTexture?V.texSubImage2D(V.TEXTURE_2D,se,U.x,U.y,ie,ke,Qe,st,$.image.data):$.isCompressedTexture?V.compressedTexSubImage2D(V.TEXTURE_2D,se,U.x,U.y,$.mipmaps[0].width,$.mipmaps[0].height,Qe,$.mipmaps[0].data):V.texSubImage2D(V.TEXTURE_2D,se,U.x,U.y,Qe,st,$.image),se===0&&re.generateMipmaps&&V.generateMipmap(V.TEXTURE_2D),fe.unbindTexture()},this.copyTextureToTexture3D=function(U,$,re,se,ie=0){if(M.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ke=U.max.x-U.min.x+1,Qe=U.max.y-U.min.y+1,st=U.max.z-U.min.z+1,ot=He.convert(se.format),pt=He.convert(se.type);let ht;if(se.isData3DTexture)D.setTexture3D(se,0),ht=V.TEXTURE_3D;else if(se.isDataArrayTexture||se.isCompressedArrayTexture)D.setTexture2DArray(se,0),ht=V.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,se.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,se.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,se.unpackAlignment);const mt=V.getParameter(V.UNPACK_ROW_LENGTH),$t=V.getParameter(V.UNPACK_IMAGE_HEIGHT),kn=V.getParameter(V.UNPACK_SKIP_PIXELS),jt=V.getParameter(V.UNPACK_SKIP_ROWS),Pn=V.getParameter(V.UNPACK_SKIP_IMAGES),at=re.isCompressedTexture?re.mipmaps[ie]:re.image;V.pixelStorei(V.UNPACK_ROW_LENGTH,at.width),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,at.height),V.pixelStorei(V.UNPACK_SKIP_PIXELS,U.min.x),V.pixelStorei(V.UNPACK_SKIP_ROWS,U.min.y),V.pixelStorei(V.UNPACK_SKIP_IMAGES,U.min.z),re.isDataTexture||re.isData3DTexture?V.texSubImage3D(ht,ie,$.x,$.y,$.z,ke,Qe,st,ot,pt,at.data):re.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(ht,ie,$.x,$.y,$.z,ke,Qe,st,ot,at.data)):V.texSubImage3D(ht,ie,$.x,$.y,$.z,ke,Qe,st,ot,pt,at),V.pixelStorei(V.UNPACK_ROW_LENGTH,mt),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,$t),V.pixelStorei(V.UNPACK_SKIP_PIXELS,kn),V.pixelStorei(V.UNPACK_SKIP_ROWS,jt),V.pixelStorei(V.UNPACK_SKIP_IMAGES,Pn),ie===0&&se.generateMipmaps&&V.generateMipmap(ht),fe.unbindTexture()},this.initTexture=function(U){U.isCubeTexture?D.setTextureCube(U,0):U.isData3DTexture?D.setTexture3D(U,0):U.isDataArrayTexture||U.isCompressedArrayTexture?D.setTexture2DArray(U,0):D.setTexture2D(U,0),fe.unbindTexture()},this.resetState=function(){P=0,C=0,L=null,fe.reset(),X.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Er}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Vp?"display-p3":"srgb",t.unpackColorSpace=Ot.workingColorSpace===rf?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Tn?co:Py}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===co?Tn:qr}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class TT extends By{}TT.prototype.isWebGL1Renderer=!0;class jp{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Be(e),this.density=t}clone(){return new jp(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Yp{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Be(e),this.near=t,this.far=i}clone(){return new Yp(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class yp extends zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class qp{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Hc,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Gi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:c,point:Fu.clone(),uv:Ei.getInterpolation(Fu,Zh,Bu,Kh,zS,pg,OS,new he),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 Jh(n,e,t,i,r,s){al.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(ku.x=s*al.x-r*al.y,ku.y=r*al.x+s*al.y):ku.copy(al),n.copy(e),n.x+=ku.x,n.y+=ku.y,n.applyMatrix4(AT)}const Qh=new O,FS=new O;class bT extends zt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Qh.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Qh);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Qh.setFromMatrixPosition(e.matrixWorld),FS.setFromMatrixPosition(this.matrixWorld);const i=Qh.distanceTo(FS)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=i.length&&i.push({start:-1,count:-1,z:-1});const s=i[this.index];r.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const ul="batchId",Ws=new ft,YS=new ft,D8=new ft,qS=new ft,vg=new lf,td=new mi,Oo=new si,Gu=new O,yg=new N8,ei=new Cn,nd=[];function U8(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new Bt(l,1))}const o=r>65536?new Uint32Array(i):new Uint16Array(i);t.setAttribute(ul,new Bt(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(ul))throw new Error(`BatchedMesh: Geometry cannot use attribute "${ul}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(i===ul)continue;if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new mi);const e=this._geometryCount,t=this.boundingBox,i=this._active;t.makeEmpty();for(let r=0;r=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,l=this._drawRanges,c=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const f=e.getIndex(),h=f!==null;if(h&&(i===-1?r.indexCount=f.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const d=this._visibility,m=this._active,v=this._matricesTexture,_=this._matricesTexture.image.data;d.push(!0),m.push(!0);const w=this._geometryCount;this._geometryCount++,D8.toArray(_,w*16),v.needsUpdate=!0,o.push(r),l.push({start:h?r.indexStart:r.vertexStart,count:-1}),c.push({boxInitialized:!1,box:new mi,sphereInitialized:!1,sphere:new si});const x=this.geometry.getAttribute(ul);for(let g=0;g=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),l=this._reservedRanges[e];if(r&&o.count>l.indexCount||t.attributes.position.count>l.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const c=l.vertexStart,f=l.vertexCount;for(const v in i.attributes){if(v===ul)continue;const _=t.getAttribute(v),w=i.getAttribute(v);U8(_,w,c);const x=_.itemSize;for(let g=_.count,S=f;g=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return this;const r=this._bounds[e],s=r.box,o=this.geometry;if(r.boxInitialized===!1){s.makeEmpty();const l=o.index,c=o.attributes.position,f=this._drawRanges[e];for(let h=f.start,d=f.start+f.count;h=o||i[e]===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._active,r=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||i[e]===!1?null:t.fromArray(r,e*16)}setVisibleAt(e,t){const i=this._visibility,r=this._active,s=this._geometryCount;return e>=s||r[e]===!1||i[e]===t?this:(i[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,i=this._active,r=this._geometryCount;return e>=r||i[e]===!1?!1:t[e]}raycast(e,t){const i=this._visibility,r=this._active,s=this._drawRanges,o=this._geometryCount,l=this.matrixWorld,c=this.geometry;ei.material=this.material,ei.geometry.index=c.index,ei.geometry.attributes=c.attributes,ei.geometry.boundingBox===null&&(ei.geometry.boundingBox=new mi),ei.geometry.boundingSphere===null&&(ei.geometry.boundingSphere=new si);for(let f=0;f({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),l=o===null?1:o.array.BYTES_PER_ELEMENT,c=this._visibility,f=this._multiDrawStarts,h=this._multiDrawCounts,d=this._drawRanges,m=this.perObjectFrustumCulled;m&&(qS.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),vg.setFromProjectionMatrix(qS,e.isWebGPURenderer?jl:Er));let v=0;if(this.sortObjects){YS.copy(this.matrixWorld).invert(),Gu.setFromMatrixPosition(i.matrixWorld).applyMatrix4(YS);for(let x=0,g=c.length;xc)continue;m.applyMatrix4(this.matrixWorld);const z=e.ray.origin.distanceTo(m);ze.far||t.push({distance:z,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),S=Math.min(x.count,o.start+o.count);for(let M=g,T=S-1;Mc)continue;m.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(m);Ce.far||t.push({distance:C,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:f,distanceToRay:Math.sqrt(l),point:c,index:e,face:null,object:o})}}class z8 extends dn{constructor(e,t,i,r,s,o,l,c,f){super(e,t,i,r,s,o,l,c,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:nn,this.magFilter=s!==void 0?s:nn,this.generateMipmaps=!1;const h=this;function d(){h.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class O8 extends dn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=vn,this.minFilter=vn,this.generateMipmaps=!1,this.needsUpdate=!0}}class Kp extends dn{constructor(e,t,i,r,s,o,l,c,f,h,d,m){super(null,o,l,c,f,h,r,s,d,m),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class F8 extends Kp{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=ii}}class k8 extends Kp{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,As),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class B8 extends dn{constructor(e,t,i,r,s,o,l,c,f){super(e,t,i,r,s,o,l,c,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class br{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let l=0,c=s-1,f;for(;l<=c;)if(r=Math.floor(l+(c-l)/2),f=i[r]-o,f<0)l=r+1;else if(f>0)c=r-1;else{c=r;break}if(r=c,i[r]===o)return r/(s-1);const h=i[r],m=i[r+1]-h,v=(o-h)/m;return(r+v)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),c=t||(o.isVector2?new he:new O);return c.copy(l).sub(o).normalize(),c}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new O,r=[],s=[],o=[],l=new O,c=new ft;for(let v=0;v<=e;v++){const _=v/e;r[v]=this.getTangentAt(_,new O)}s[0]=new O,o[0]=new O;let f=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),m=Math.abs(r[0].z);h<=f&&(f=h,i.set(1,0,0)),d<=f&&(f=d,i.set(0,1,0)),m<=f&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let v=1;v<=e;v++){if(s[v]=s[v-1].clone(),o[v]=o[v-1].clone(),l.crossVectors(r[v-1],r[v]),l.length()>Number.EPSILON){l.normalize();const _=Math.acos(fn(r[v-1].dot(r[v]),-1,1));s[v].applyMatrix4(c.makeRotationAxis(l,_))}o[v].crossVectors(r[v],s[v])}if(t===!0){let v=Math.acos(fn(s[0].dot(s[e]),-1,1));v/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(v=-v);for(let _=1;_<=e;_++)s[_].applyMatrix4(c.makeRotationAxis(r[_],v*_)),o[_].crossVectors(r[_],s[_])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Jp extends br{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=c}getPoint(e,t){const i=t||new he,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(l)/s)+1)*s:c===0&&l===s-1&&(l=s-2,c=1);let f,h;this.closed||l>0?f=r[(l-1)%s]:(od.subVectors(r[0],r[1]).add(r[0]),f=od);const d=r[l%s],m=r[(l+1)%s];if(this.closed||l+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(n3(l,c.x,f.x,h.x,d.x),n3(l,c.y,f.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,l=this.curves[s],c=l.getLength(),f=c===0?0:1-o/c;return l.getPointAt(f,t)}s++}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,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const d=f.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(f);const h=f.getPoint(1);return this.currentPoint.copy(h),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 cf extends St{constructor(e=[new he(0,-.5),new he(.5,0),new he(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=fn(r,0,Math.PI*2);const s=[],o=[],l=[],c=[],f=[],h=1/t,d=new O,m=new he,v=new O,_=new O,w=new O;let x=0,g=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:x=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,v.x=g*1,v.y=-x,v.z=g*0,w.copy(v),v.normalize(),c.push(v.x,v.y,v.z);break;case e.length-1:c.push(w.x,w.y,w.z);break;default:x=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,v.x=g*1,v.y=-x,v.z=g*0,_.copy(v),v.x+=w.x,v.y+=w.y,v.z+=w.z,v.normalize(),c.push(v.x,v.y,v.z),w.copy(_)}for(let S=0;S<=t;S++){const M=i+S*h*r,T=Math.sin(M),P=Math.cos(M);for(let C=0;C<=e.length-1;C++){d.x=e[C].x*T,d.y=e[C].y,d.z=e[C].x*P,o.push(d.x,d.y,d.z),m.x=S/t,m.y=C/(e.length-1),l.push(m.x,m.y);const L=c[3*C+0]*T,z=c[3*C+1],b=c[3*C+0]*P;f.push(L,z,b)}}for(let S=0;S0&&M(!0),t>0&&M(!1)),this.setIndex(h),this.setAttribute("position",new qe(d,3)),this.setAttribute("normal",new qe(m,3)),this.setAttribute("uv",new qe(v,2));function S(){const T=new O,P=new O;let C=0;const L=(t-e)/i;for(let z=0;z<=s;z++){const b=[],R=z/s,B=R*(t-e)+e;for(let Z=0;Z<=r;Z++){const le=Z/r,G=le*c+l,Q=Math.sin(G),te=Math.cos(G);P.x=B*Q,P.y=-R*i+x,P.z=B*te,d.push(P.x,P.y,P.z),T.set(Q,L,te).normalize(),m.push(T.x,T.y,T.z),v.push(le,1-R),b.push(_++)}w.push(b)}for(let z=0;z.9&&L<.1&&(M<.2&&(o[S+0]+=1),T<.2&&(o[S+2]+=1),P<.2&&(o[S+4]+=1))}}function m(S){s.push(S.x,S.y,S.z)}function v(S,M){const T=S*3;M.x=e[T+0],M.y=e[T+1],M.z=e[T+2]}function _(){const S=new O,M=new O,T=new O,P=new O,C=new he,L=new he,z=new he;for(let b=0,R=0;b80*t){l=f=n[0],c=h=n[1];for(let _=t;_f&&(f=d),m>h&&(h=m);v=Math.max(f-l,h-c),v=v!==0?32767/v:0}return Wc(s,o,t,l,c,v,0),o}};function BT(n,e,t,i,r){let s,o;if(r===cN(n,e,t,i)>0)for(s=e;s=e;s-=i)o=i3(s,n[s],n[s+1],o);return o&&nm(o,o.next)&&(jc(o),o=o.next),o}function ya(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(nm(t,t.next)||rn(t.prev,t,t.next)===0)){if(jc(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Wc(n,e,t,i,r,s,o){if(!n)return;!o&&s&&rN(n,i,r,s);let l=n,c,f;for(;n.prev!==n.next;){if(c=n.prev,f=n.next,s?K8(n,i,r,s):Z8(n)){e.push(c.i/t|0),e.push(n.i/t|0),e.push(f.i/t|0),jc(n),n=f.next,l=f.next;continue}if(n=f,n===l){o?o===1?(n=J8(ya(n),e,t),Wc(n,e,t,i,r,s,2)):o===2&&Q8(n,e,t,i,r,s):Wc(ya(n),e,t,i,r,s,1);break}}}function Z8(n){const e=n.prev,t=n,i=n.next;if(rn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,l=e.y,c=t.y,f=i.y,h=rs?r>o?r:o:s>o?s:o,v=l>c?l>f?l:f:c>f?c:f;let _=i.next;for(;_!==e;){if(_.x>=h&&_.x<=m&&_.y>=d&&_.y<=v&&Pl(r,l,s,c,o,f,_.x,_.y)&&rn(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function K8(n,e,t,i){const r=n.prev,s=n,o=n.next;if(rn(r,s,o)>=0)return!1;const l=r.x,c=s.x,f=o.x,h=r.y,d=s.y,m=o.y,v=lc?l>f?l:f:c>f?c:f,x=h>d?h>m?h:m:d>m?d:m,g=mv(v,_,e,t,i),S=mv(w,x,e,t,i);let M=n.prevZ,T=n.nextZ;for(;M&&M.z>=g&&T&&T.z<=S;){if(M.x>=v&&M.x<=w&&M.y>=_&&M.y<=x&&M!==r&&M!==o&&Pl(l,h,c,d,f,m,M.x,M.y)&&rn(M.prev,M,M.next)>=0||(M=M.prevZ,T.x>=v&&T.x<=w&&T.y>=_&&T.y<=x&&T!==r&&T!==o&&Pl(l,h,c,d,f,m,T.x,T.y)&&rn(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;M&&M.z>=g;){if(M.x>=v&&M.x<=w&&M.y>=_&&M.y<=x&&M!==r&&M!==o&&Pl(l,h,c,d,f,m,M.x,M.y)&&rn(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;T&&T.z<=S;){if(T.x>=v&&T.x<=w&&T.y>=_&&T.y<=x&&T!==r&&T!==o&&Pl(l,h,c,d,f,m,T.x,T.y)&&rn(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function J8(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!nm(r,s)&&HT(r,i,i.next,s)&&Xc(r,s)&&Xc(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),jc(i),jc(i.next),i=n=s),i=i.next}while(i!==n);return ya(i)}function Q8(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&aN(o,l)){let c=VT(o,l);o=ya(o,o.next),c=ya(c,c.next),Wc(o,e,t,i,r,s,0),Wc(c,e,t,i,r,s,0);return}l=l.next}o=o.next}while(o!==n)}function $8(n,e,t,i){const r=[];let s,o,l,c,f;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const m=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(m<=s&&m>i&&(i=m,r=t.x=t.x&&t.x>=c&&s!==t.x&&Pl(or.x||t.x===r.x&&iN(r,t)))&&(r=t,h=d)),t=t.next;while(t!==l);return r}function iN(n,e){return rn(n.prev,n,e.prev)<0&&rn(e.next,n,n.next)<0}function rN(n,e,t,i){let r=n;do r.z===0&&(r.z=mv(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,sN(r)}function sN(n){let e,t,i,r,s,o,l,c,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e0||c>0&&i;)l!==0&&(c===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,c--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,f*=2}while(o>1);return n}function mv(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function oN(n){let e=n,t=n;do(e.x=(n-o)*(s-l)&&(n-o)*(i-l)>=(t-o)*(e-l)&&(t-o)*(s-l)>=(r-o)*(i-l)}function aN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!lN(n,e)&&(Xc(n,e)&&Xc(e,n)&&uN(n,e)&&(rn(n.prev,n,e.prev)||rn(n,e.prev,e))||nm(n,e)&&rn(n.prev,n,n.next)>0&&rn(e.prev,e,e.next)>0)}function rn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function nm(n,e){return n.x===e.x&&n.y===e.y}function HT(n,e,t,i){const r=fd(rn(n,e,t)),s=fd(rn(n,e,i)),o=fd(rn(t,i,n)),l=fd(rn(t,i,e));return!!(r!==s&&o!==l||r===0&&cd(n,t,e)||s===0&&cd(n,i,e)||o===0&&cd(t,n,i)||l===0&&cd(t,e,i))}function cd(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function fd(n){return n>0?1:n<0?-1:0}function lN(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&HT(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Xc(n,e){return rn(n.prev,n,n.next)<0?rn(n,e,n.next)>=0&&rn(n,n.prev,e)>=0:rn(n,e,n.prev)<0||rn(n,n.next,e)<0}function uN(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function VT(n,e){const t=new gv(n.i,n.x,n.y),i=new gv(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function i3(n,e,t,i){const r=new gv(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function jc(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function gv(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function cN(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function s3(n,e){for(let t=0;tNumber.EPSILON){const me=Math.sqrt(ye),je=Math.sqrt(I*I+ee*ee),Le=Se.x-D/me,Fe=Se.y+Ne/me,tt=de.x-ee/je,dt=de.y+I/je,_e=((tt-Le)*ee-(dt-Fe)*I)/(Ne*ee-D*I);Ee=Le+Ne*_e-V.x,fe=Fe+D*_e-V.y;const Ct=Ee*Ee+fe*fe;if(Ct<=2)return new he(Ee,fe);Ze=Math.sqrt(Ct/2)}else{let me=!1;Ne>Number.EPSILON?I>Number.EPSILON&&(me=!0):Ne<-Number.EPSILON?I<-Number.EPSILON&&(me=!0):Math.sign(D)===Math.sign(ee)&&(me=!0),me?(Ee=-D,fe=Ne,Ze=Math.sqrt(ye)):(Ee=Ne,fe=D,Ze=Math.sqrt(ye/2))}return new he(Ee/Ze,fe/Ze)}const k=[];for(let V=0,Se=G.length,de=Se-1,Ee=V+1;V=0;V--){const Se=V/x,de=v*Math.cos(Se*Math.PI/2),Ee=_*Math.sin(Se*Math.PI/2)+w;for(let fe=0,Ze=G.length;fe=0;){const Ee=de;let fe=de-1;fe<0&&(fe=V.length-1);for(let Ze=0,Ne=h+x*2;Ze0)&&v.push(M,T,C),(g!==i-1||c0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get 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.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 YT extends Xn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Be(16777215),this.specular=new Be(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xo,this.normalScale=new he(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=nf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class qT extends Xn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Be(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xo,this.normalScale=new he(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 ZT extends Xn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xo,this.normalScale=new he(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 KT extends Xn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xo,this.normalScale=new he(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=nf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class JT extends Xn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Be(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xo,this.normalScale=new he(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.flatShading=e.flatShading,this.fog=e.fog,this}}class QT extends yi{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 na(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function $T(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function e4(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function vv(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let c=0;c!==e;++c)r[o++]=n[l+c]}return r}function Jy(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function pN(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let c=0;c=i)){d.push(f.times[v]);for(let w=0;ws.tracks[c].times[0]&&(l=s.tracks[c].times[0]);for(let c=0;c=l.times[_]){const g=_*d+h,S=g+d-h;w=l.values.slice(g,S)}else{const g=l.createInterpolant(),S=h,M=d-h;g.evaluate(s),w=g.resultBuffer.slice(S,M)}c==="quaternion"&&new ri().fromArray(w).normalize().conjugate().toArray(w);const x=f.times.length;for(let g=0;g=s)){const l=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*l,o*l)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const c=i[l];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,c,o),e=!1;break}o=c}if(r!==void 0&&$T(r))for(let l=0,c=r.length;l!==c;++l){const f=r[l];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,f),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===kd,s=e.length-1;let o=1;for(let l=1;l0){e[o]=e[s];for(let l=s*i,c=o*i,f=0;f!==i;++f)t[c+f]=t[l+f];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Rr.prototype.TimeBufferType=Float32Array;Rr.prototype.ValueBufferType=Float32Array;Rr.prototype.DefaultInterpolation=zc;class wa extends Rr{}wa.prototype.ValueTypeName="bool";wa.prototype.ValueBufferType=Array;wa.prototype.DefaultInterpolation=Uc;wa.prototype.InterpolantFactoryMethodLinear=void 0;wa.prototype.InterpolantFactoryMethodSmooth=void 0;class $y extends Rr{}$y.prototype.ValueTypeName="color";class Yc extends Rr{}Yc.prototype.ValueTypeName="number";class i4 extends df{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,c=(i-t)/(r-t);let f=e*l;for(let h=f+l;f!==h;f+=4)ri.slerpFlat(s,0,o,f-l,o,f,c);return s}}class ru extends Rr{InterpolantFactoryMethodLinear(e){return new i4(this.times,this.values,this.getValueSize(),e)}}ru.prototype.ValueTypeName="quaternion";ru.prototype.DefaultInterpolation=zc;ru.prototype.InterpolantFactoryMethodSmooth=void 0;class Ea extends Rr{}Ea.prototype.ValueTypeName="string";Ea.prototype.ValueBufferType=Array;Ea.prototype.DefaultInterpolation=Uc;Ea.prototype.InterpolantFactoryMethodLinear=void 0;Ea.prototype.InterpolantFactoryMethodSmooth=void 0;class qc extends Rr{}qc.prototype.ValueTypeName="vector";class Zc{constructor(e,t=-1,i,r=Hp){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Gi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(yN(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Rr.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l1){const d=h[1];let m=r[d];m||(r[d]=m=[]),m.push(f)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,m,v,_,w){if(v.length!==0){const x=[],g=[];Jy(v,x,g,_),x.length!==0&&w.push(new d(m,x,g))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let c=e.length||-1;const f=e.hierarchy||[];for(let d=0;d{t&&t(s),this.manager.itemEnd(e)},0),s;if(us[e]!==void 0){us[e].push({onLoad:t,onProgress:i,onError:r});return}us[e]=[],us[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),l=this.mimeType,c=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const h=us[e],d=f.body.getReader(),m=f.headers.get("Content-Length")||f.headers.get("X-File-Size"),v=m?parseInt(m):0,_=v!==0;let w=0;const x=new ReadableStream({start(g){S();function S(){d.read().then(({done:M,value:T})=>{if(M)g.close();else{w+=T.byteLength;const P=new ProgressEvent("progress",{lengthComputable:_,loaded:w,total:v});for(let C=0,L=h.length;C{switch(c){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(h=>new DOMParser().parseFromString(h,l));case"json":return f.json();default:if(l===void 0)return f.text();{const d=/charset="?([^;"\s]*)"?/i.exec(l),m=d&&d[1]?d[1].toLowerCase():void 0,v=new TextDecoder(m);return f.arrayBuffer().then(_=>v.decode(_))}}}).then(f=>{ys.add(e,f);const h=us[e];delete us[e];for(let d=0,m=h.length;d{const h=us[e];if(h===void 0)throw this.manager.itemError(e),f;delete us[e];for(let d=0,m=h.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class xN extends Pi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Cs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(c){r?r(c):console.error(c),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Be().setHex(o.value);break;case"v2":r.uniforms[s].value=new he().fromArray(o.value);break;case"v3":r.uniforms[s].value=new O().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Ft().fromArray(o.value);break;case"m3":r.uniforms[s].value=new wt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new ft().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new he().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new he().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:WT,SpriteMaterial:Hy,RawShaderMaterial:XT,ShaderMaterial:Zr,PointsMaterial:Gy,MeshPhysicalMaterial:jT,MeshStandardMaterial:Ky,MeshPhongMaterial:YT,MeshToonMaterial:qT,MeshNormalMaterial:ZT,MeshLambertMaterial:KT,MeshDepthMaterial:Fy,MeshDistanceMaterial:ky,MeshBasicMaterial:So,MeshMatcapMaterial:JT,LineDashedMaterial:QT,LineBasicMaterial:yi,Material:Xn};return new t[e]}}class _v{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const c=new e_(t);s=new Kc(c),s.setCrossOrigin(this.crossOrigin);for(let f=0,h=e.length;f0){r=new Kc(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o{const x=new mi;x.min.fromArray(w.boxMin),x.max.fromArray(w.boxMax);const g=new si;return g.radius=w.sphereRadius,g.center.fromArray(w.sphereCenter),{boxInitialized:w.boxInitialized,box:x,sphereInitialized:w.sphereInitialized,sphere:g}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=f(e.matricesTexture.uuid);break;case"LOD":o=new bT;break;case"Line":o=new go(l(e.geometry),c(e.material));break;case"LineLoop":o=new IT(l(e.geometry),c(e.material));break;case"LineSegments":o=new Jr(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":o=new NT(l(e.geometry),c(e.material));break;case"Sprite":o=new CT(c(e.material));break;case"Group":o=new Rl;break;case"Bone":o=new Vy;break;default:o=new zt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const m=e.children;for(let v=0;v"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=ys.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(f=>{t&&t(f),s.manager.itemEnd(e)}).catch(f=>{r&&r(f)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader;const c=fetch(e,l).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(f){return ys.add(e,f),t&&t(f),s.manager.itemEnd(e),f}).catch(function(f){r&&r(f),ys.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});ys.add(e,c),s.manager.itemStart(e)}}let hd;class n_{static getContext(){return hd===void 0&&(hd=new(window.AudioContext||window.webkitAudioContext)),hd}static setContext(e){hd=e}}class PN extends Pi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Cs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(c){try{const f=c.slice(0);n_.getContext().decodeAudioData(f,function(d){t(d)}).catch(l)}catch(f){l(f)}},i,r);function l(c){r?r(c):console.error(c),s.manager.itemError(e)}}}const d3=new ft,p3=new ft,Fo=new ft;class LN{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new hn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new hn,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,Fo.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(oa*t.fov*.5)/t.zoom;let l,c;p3.elements[12]=-r,d3.elements[12]=r,l=-o*t.aspect+s,c=o*t.aspect+s,Fo.elements[0]=2*t.near/(c-l),Fo.elements[8]=(c+l)/(c-l),this.cameraL.projectionMatrix.copy(Fo),l=-o*t.aspect-s,c=o*t.aspect-s,Fo.elements[0]=2*t.near/(c-l),Fo.elements[8]=(c+l)/(c-l),this.cameraR.projectionMatrix.copy(Fo)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(p3),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(d3)}}class i_{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=m3(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=m3();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function m3(){return(typeof performance>"u"?Date:performance).now()}const ko=new O,g3=new ri,IN=new O,Bo=new O;class NN extends zt{constructor(){super(),this.type="AudioListener",this.context=n_.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new i_}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ko,g3,IN),Bo.set(0,0,-1).applyQuaternion(g3),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ko.x,r),t.positionY.linearRampToValueAtTime(ko.y,r),t.positionZ.linearRampToValueAtTime(ko.z,r),t.forwardX.linearRampToValueAtTime(Bo.x,r),t.forwardY.linearRampToValueAtTime(Bo.y,r),t.forwardZ.linearRampToValueAtTime(Bo.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(ko.x,ko.y,ko.z),t.setOrientation(Bo.x,Bo.y,Bo.z,i.x,i.y,i.z)}}class m4 extends zt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;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){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),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,r,this._addIndex*t,1,t);for(let c=t,f=t+t;c!==f;++c)if(i[c]!==i[c+t]){l.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%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 o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){ri.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;ri.multiplyQuaternionsFlat(e,o,e,t,e,i),ri.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let l=0;l!==s;++l){const c=t+l;e[c]=e[c]*o+e[i+l]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]+e[i+o]*r}}}const r_="\\[\\]\\.:\\/",ON=new RegExp("["+r_+"]","g"),s_="[^"+r_+"]",FN="[^"+r_.replace("\\.","")+"]",kN=/((?:WC+[\/:])*)/.source.replace("WC",s_),BN=/(WCOD+)?/.source.replace("WCOD",FN),HN=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",s_),VN=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",s_),GN=new RegExp("^"+kN+BN+HN+VN+"$"),WN=["material","materials","bones","map"];class XN{constructor(e,t,i){const r=i||Lt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].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 Lt{constructor(e,t,i){this.path=t,this.parsedPath=i||Lt.parseTrackName(t),this.node=Lt.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 Lt.Composite(e,t,i):new Lt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(ON,"")}static parseTrackName(e){const t=GN.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]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);WN.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}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(s){for(let o=0;o=s){const d=s++,m=e[d];t[m.uuid]=h,e[h]=m,t[f]=d,e[d]=c;for(let v=0,_=r;v!==_;++v){const w=i[v],x=w[d],g=w[h];w[h]=x,w[d]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let l=0,c=arguments.length;l!==c;++l){const f=arguments[l],h=f.uuid,d=t[h];if(d!==void 0)if(delete t[h],d0&&(t[v.uuid]=d),e[d]=v,e.pop();for(let _=0,w=r;_!==w;++_){const x=i[_];x[d]=x[m],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,l=this._parsedPaths,c=this._objects,f=c.length,h=this.nCachedObjects_,d=new Array(f);r=s.length,i[e]=r,o.push(e),l.push(t),s.push(d);for(let m=h,v=c.length;m!==v;++m){const _=c[m];d[m]=new Lt(_,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,l=o.length-1,c=o[l],f=e[l];t[f]=i,o[i]=c,o.pop(),s[i]=s[l],s.pop(),r[i]=r[l],r.pop()}}}class v4{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,l=new Array(o),c={endingStart:$o,endingEnd:$o};for(let f=0;f!==o;++f){const h=s[f].createInterpolant(null);l[f]=h,h.settings=c}this._interpolantSettings=c,this._interpolants=l,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=JE,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){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,l=r/s;e.warp(1,o,t),this.warp(l,1,t)}return this}crossFadeTo(e,t,i){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 r=this._mixer,s=r.time,o=this.timeScale;let l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);const c=l.parameterPositions,f=l.sampleValues;return c[0]=s,c[1]=s+i,f[0]=e/o,f[1]=t/o,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,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const c=(e-s)*i;c<0||i===0?t=0:(this._startTime=null,t=i*c)}t*=this._updateTimeScale(e);const o=this._updateTime(t),l=this._updateWeight(e);if(l>0){const c=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case Ry:for(let h=0,d=c.length;h!==d;++h)c[h].evaluate(o),f[h].accumulateAdditive(l);break;case Hp:default:for(let h=0,d=c.length;h!==d;++h)c[h].evaluate(o),f[h].accumulate(r,l)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===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 r=i.evaluate(e)[0];t*=r,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 r=this.time+e,s=this._loopCount;const o=i===QE;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===KE){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const l=Math.floor(r/t);r-=t*l,s+=Math.abs(l);const c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=ea,r.endingEnd=ea):(e?r.endingStart=this.zeroSlopeAtStart?ea:$o:r.endingStart=Oc,t?r.endingEnd=this.zeroSlopeAtEnd?ea:$o:r.endingEnd=Oc)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=s,c[0]=t,l[1]=s+e,c[1]=i,this}}const YN=new Float32Array(1);class qN extends Kr{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,l=e._interpolants,c=i.uuid,f=this._bindingsByRootAndName;let h=f[c];h===void 0&&(h={},f[c]=h);for(let d=0;d!==s;++d){const m=r[d],v=m.name;let _=h[v];if(_!==void 0)++_.referenceCount,o[d]=_;else{if(_=o[d],_!==void 0){_._cacheIndex===null&&(++_.referenceCount,this._addInactiveBinding(_,c,v));continue}const w=t&&t._propertyBindings[d].binding.parsedPath;_=new g4(Lt.create(i,v,w),m.ValueTypeName,m.getValueSize()),++_.referenceCount,this._addInactiveBinding(_,c,v),o[d]=_}l[d].resultBuffer=_.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}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,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==i;++f)t[f]._update(r,e,s,o);const l=this._bindings,c=this._nActiveBindings;for(let f=0;f!==c;++f)l[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.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.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,_3).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 x3=new O,dd=new O;class tD{constructor(e=new O,t=new O){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){x3.subVectors(e,this.start),dd.subVectors(this.end,this.start);const i=dd.dot(dd);let s=dd.dot(x3)/i;return t&&(s=fn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const S3=new O;class nD extends zt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new St,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,l=1,c=32;o1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{A3.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(A3,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 mD extends Jr{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],r=new St;r.setAttribute("position",new qe(t,3)),r.setAttribute("color",new qe(i,3));const s=new yi({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Be,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class gD{constructor(){this.type="ShapePath",this.color=new Be,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Gc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const S=[];for(let M=0,T=g.length;MNumber.EPSILON){if(R<0&&(L=S[C],b=-b,z=S[P],R=-R),g.yz.y)continue;if(g.y===L.y){if(g.x===L.x)return!0}else{const B=R*(g.x-L.x)-b*(g.y-L.y);if(B===0)return!0;if(B<0)continue;T=!T}}else{if(g.y!==L.y)continue;if(z.x<=g.x&&g.x<=L.x||L.x<=g.x&&g.x<=z.x)return!0}}return T}const r=Yr.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,l,c;const f=[];if(s.length===1)return l=s[0],c=new ua,c.curves=l.curves,f.push(c),f;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],m=[];let v=[],_=0,w;m[_]=void 0,v[_]=[];for(let g=0,S=s.length;g1){let g=!1,S=0;for(let M=0,T=m.length;M0&&g===!1&&(v=d)}let x;for(let g=0,S=m.length;g{const d=typeof f=="function"?f(e):f;if(d!==e){const m=e;e=h?d:Object.assign({},e,d),t.forEach(v=>v(e,m))}},r=()=>e,s=(f,h=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let m=h(e);function v(){const _=h(e);if(!d(m,_)){const w=m;f(m=_,w)}}return t.add(v),()=>t.delete(v)},c={setState:i,getState:r,subscribe:(f,h,d)=>h||d?s(f,h,d):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(i,r,c),c}const _D=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),C3=_D?be.useEffect:be.useLayoutEffect;function xD(n){const e=typeof n=="function"?yD(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=be.useReducer(x=>x+1,0),o=e.getState(),l=be.useRef(o),c=be.useRef(i),f=be.useRef(r),h=be.useRef(!1),d=be.useRef();d.current===void 0&&(d.current=i(o));let m,v=!1;(l.current!==o||c.current!==i||f.current!==r||h.current)&&(m=i(o),v=!r(d.current,m)),C3(()=>{v&&(d.current=m),l.current=o,c.current=i,f.current=r,h.current=!1});const _=be.useRef(o);C3(()=>{const x=()=>{try{const S=e.getState(),M=c.current(S);f.current(d.current,M)||(l.current=S,d.current=M,s())}catch{h.current=!0,s()}},g=e.subscribe(x);return e.getState()!==_.current&&x(),g},[]);const w=v?m:d.current;return be.useDebugValue(w),w};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}var S4={exports:{}},bg={exports:{}},Rg={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var b3;function SD(){return b3||(b3=1,function(n){function e(N,k){var H=N.length;N.push(k);e:for(;0>>1,J=N[q];if(0>>1;qr(ge,H))Aer(Ce,ge)?(N[q]=Ce,N[Ae]=H,q=Ae):(N[q]=ge,N[ae]=H,q=ae);else if(Aer(Ce,H))N[q]=Ce,N[Ae]=H,q=Ae;else break e}}return k}function r(N,k){var H=N.sortIndex-k.sortIndex;return H!==0?H:N.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();n.unstable_now=function(){return o.now()-l}}var c=[],f=[],h=1,d=null,m=3,v=!1,_=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(N){for(var k=t(f);k!==null;){if(k.callback===null)i(f);else if(k.startTime<=N)i(f),k.sortIndex=k.expirationTime,e(c,k);else break;k=t(f)}}function T(N){if(w=!1,M(N),!_)if(t(c)!==null)_=!0,te(P);else{var k=t(f);k!==null&&ce(T,k.startTime-N)}}function P(N,k){_=!1,w&&(w=!1,g(z),z=-1),v=!0;var H=m;try{for(M(k),d=t(c);d!==null&&(!(d.expirationTime>k)||N&&!B());){var q=d.callback;if(typeof q=="function"){d.callback=null,m=d.priorityLevel;var J=q(d.expirationTime<=k);k=n.unstable_now(),typeof J=="function"?d.callback=J:d===t(c)&&i(c),M(k)}else i(c);d=t(c)}if(d!==null)var K=!0;else{var ae=t(f);ae!==null&&ce(T,ae.startTime-k),K=!1}return K}finally{d=null,m=H,v=!1}}var C=!1,L=null,z=-1,b=5,R=-1;function B(){return!(n.unstable_now()-RN||125q?(N.sortIndex=H,e(f,N),t(c)===null&&N===t(f)&&(w?(g(z),z=-1):w=!0,ce(T,H-q))):(N.sortIndex=J,e(c,N),_||v||(_=!0,te(P))),N},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(N){var k=m;return function(){var H=m;m=k;try{return N.apply(this,arguments)}finally{m=H}}}}(Rg)),Rg}var R3;function MD(){return R3||(R3=1,bg.exports=SD()),bg.exports}/** - * @license React - * react-reconciler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var wD=function(e){var t={},i=be,r=MD(),s=Object.assign;function o(a){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;pj||E[F]!==A[j]){var ue=` -`+E[F].replace(" at new "," at ");return a.displayName&&ue.includes("")&&(ue=ue.replace("",a.displayName)),ue}while(1<=F&&0<=j);break}}}finally{ht=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?pt(a):""}var $t=Object.prototype.hasOwnProperty,kn=[],jt=-1;function Pn(a){return{current:a}}function at(a){0>jt||(a.current=kn[jt],kn[jt]=null,jt--)}function Ge(a,u){jt++,kn[jt]=a.current,a.current=u}var qi={},Et=Pn(qi),an=Pn(!1),Pr=qi;function Zi(a,u){var p=a.type.contextTypes;if(!p)return qi;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===u)return y.__reactInternalMemoizedMaskedChildContext;var E={},A;for(A in p)E[A]=u[A];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=u,a.__reactInternalMemoizedMaskedChildContext=E),E}function Ln(a){return a=a.childContextTypes,a!=null}function pn(){at(an),at(Et)}function Lr(a,u,p){if(Et.current!==qi)throw Error(o(168));Ge(Et,u),Ge(an,p)}function ba(a,u,p){var y=a.stateNode;if(u=u.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var E in y)if(!(E in u))throw Error(o(108,z(a)||"Unknown",E));return s({},p,y)}function Bn(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||qi,Pr=Et.current,Ge(Et,a),Ge(an,an.current),!0}function Ra(a,u,p){var y=a.stateNode;if(!y)throw Error(o(169));p?(a=ba(a,u,Pr),y.__reactInternalMemoizedMergedChildContext=a,at(an),at(Et),Ge(Et,a)):at(an),Ge(an,p)}var Li=Math.clz32?Math.clz32:X4,vf=Math.log,W4=Math.LN2;function X4(a){return a>>>=0,a===0?32:31-(vf(a)/W4|0)|0}var yf=64,_f=4194304;function au(a){switch(a&-a){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: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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function xf(a,u){var p=a.pendingLanes;if(p===0)return 0;var y=0,E=a.suspendedLanes,A=a.pingedLanes,F=p&268435455;if(F!==0){var j=F&~E;j!==0?y=au(j):(A&=F,A!==0&&(y=au(A)))}else F=p&~E,F!==0?y=au(F):A!==0&&(y=au(A));if(y===0)return 0;if(u!==0&&u!==y&&!(u&E)&&(E=y&-y,A=u&-u,E>=A||E===16&&(A&4194240)!==0))return u;if(y&4&&(y|=p&16),u=a.entangledLanes,u!==0)for(a=a.entanglements,u&=y;0p;p++)u.push(a);return u}function lu(a,u,p){a.pendingLanes|=u,u!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,u=31-Li(u),a[u]=p}function q4(a,u){var p=a.pendingLanes&~u;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=u,a.mutableReadLanes&=u,a.entangledLanes&=u,u=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0>=F,E-=F,es=1<<32-Li(u)+E|p<Dt?(Dn=vt,vt=null):Dn=vt.sibling;var Ut=it(ne,vt,oe[Dt],ze);if(Ut===null){vt===null&&(vt=Dn);break}a&&vt&&Ut.alternate===null&&u(ne,vt),Y=A(Ut,Y,Dt),Mt===null?Je=Ut:Mt.sibling=Ut,Mt=Ut,vt=Dn}if(Dt===oe.length)return p(ne,vt),Kt&&To(ne,Dt),Je;if(vt===null){for(;DtDt?(Dn=vt,vt=null):Dn=vt.sibling;var Os=it(ne,vt,Ut.value,ze);if(Os===null){vt===null&&(vt=Dn);break}a&&vt&&Os.alternate===null&&u(ne,vt),Y=A(Os,Y,Dt),Mt===null?Je=Os:Mt.sibling=Os,Mt=Os,vt=Dn}if(Ut.done)return p(ne,vt),Kt&&To(ne,Dt),Je;if(vt===null){for(;!Ut.done;Dt++,Ut=oe.next())Ut=gt(ne,Ut.value,ze),Ut!==null&&(Y=A(Ut,Y,Dt),Mt===null?Je=Ut:Mt.sibling=Ut,Mt=Ut);return Kt&&To(ne,Dt),Je}for(vt=y(ne,vt);!Ut.done;Dt++,Ut=oe.next())Ut=Gt(vt,ne,Dt,Ut.value,ze),Ut!==null&&(a&&Ut.alternate!==null&&vt.delete(Ut.key===null?Dt:Ut.key),Y=A(Ut,Y,Dt),Mt===null?Je=Ut:Mt.sibling=Ut,Mt=Ut);return a&&vt.forEach(function(NA){return u(ne,NA)}),Kt&&To(ne,Dt),Je}function ir(ne,Y,oe,ze){if(typeof oe=="object"&&oe!==null&&oe.type===h&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case c:e:{for(var Je=oe.key,Mt=Y;Mt!==null;){if(Mt.key===Je){if(Je=oe.type,Je===h){if(Mt.tag===7){p(ne,Mt.sibling),Y=E(Mt,oe.props.children),Y.return=ne,ne=Y;break e}}else if(Mt.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===M&&T_(Je)===Mt.type){p(ne,Mt.sibling),Y=E(Mt,oe.props),Y.ref=fu(ne,Mt,oe),Y.return=ne,ne=Y;break e}p(ne,Mt);break}else u(ne,Mt);Mt=Mt.sibling}oe.type===h?(Y=Io(oe.props.children,ne.mode,ze,oe.key),Y.return=ne,ne=Y):(ze=lh(oe.type,oe.key,oe.props,null,ne.mode,ze),ze.ref=fu(ne,Y,oe),ze.return=ne,ne=ze)}return F(ne);case f:e:{for(Mt=oe.key;Y!==null;){if(Y.key===Mt)if(Y.tag===4&&Y.stateNode.containerInfo===oe.containerInfo&&Y.stateNode.implementation===oe.implementation){p(ne,Y.sibling),Y=E(Y,oe.children||[]),Y.return=ne,ne=Y;break e}else{p(ne,Y);break}else u(ne,Y);Y=Y.sibling}Y=v0(oe,ne.mode,ze),Y.return=ne,ne=Y}return F(ne);case M:return Mt=oe._init,ir(ne,Y,Mt(oe._payload),ze)}if(Q(oe))return $e(ne,Y,oe,ze);if(C(oe))return Zn(ne,Y,oe,ze);Lf(ne,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,Y!==null&&Y.tag===6?(p(ne,Y.sibling),Y=E(Y,oe),Y.return=ne,ne=Y):(p(ne,Y),Y=g0(oe,ne.mode,ze),Y.return=ne,ne=Y),F(ne)):p(ne,Y)}return ir}var Ua=A_(!0),C_=A_(!1),hu={},$i=Pn(hu),du=Pn(hu),za=Pn(hu);function zr(a){if(a===hu)throw Error(o(174));return a}function Dm(a,u){Ge(za,u),Ge(du,a),Ge($i,hu),a=ce(u),at($i),Ge($i,a)}function Oa(){at($i),at(du),at(za)}function b_(a){var u=zr(za.current),p=zr($i.current);u=N(p,a.type,u),p!==u&&(Ge(du,a),Ge($i,u))}function Um(a){du.current===a&&(at($i),at(du))}var en=Pn(0);function If(a){for(var u=a;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||su(p)||ou(p)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var zm=[];function Om(){for(var a=0;ap?p:4,a(!0);var y=er.transition;er.transition={};try{a(!1),u()}finally{Nt=p,er.transition=y}}function V_(){return Or().memoizedState}function oA(a,u,p){var y=Ds(a);p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},G_(a)?W_(u,p):(X_(a,u,p),p=li(),a=tr(a,y,p),a!==null&&j_(a,u,y))}function aA(a,u,p){var y=Ds(a),E={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(G_(a))W_(u,E);else{X_(a,u,E);var A=a.alternate;if(a.lanes===0&&(A===null||A.lanes===0)&&(A=u.lastRenderedReducer,A!==null))try{var F=u.lastRenderedState,j=A(F,p);if(E.hasEagerState=!0,E.eagerState=j,Nr(j,F))return}catch{}finally{}p=li(),a=tr(a,y,p),a!==null&&j_(a,u,y)}}function G_(a){var u=a.alternate;return a===ln||u!==null&&u===ln}function W_(a,u){pu=Df=!0;var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}function X_(a,u,p){_n!==null&&a.mode&1&&!(Tt&2)?(a=u.interleaved,a===null?(p.next=p,Ur===null?Ur=[u]:Ur.push(u)):(p.next=a.next,a.next=p),u.interleaved=p):(a=u.pending,a===null?p.next=p:(p.next=a.next,a.next=p),u.pending=p)}function j_(a,u,p){if(p&4194240){var y=u.lanes;y&=a.pendingLanes,p|=y,u.lanes=p,vm(a,p)}}var kf={readContext:Ki,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useInsertionEffect:Yn,useLayoutEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useMutableSource:Yn,useSyncExternalStore:Yn,useId:Yn,unstable_isNewReconciler:!1},lA={readContext:Ki,useCallback:function(a,u){return ns().memoizedState=[a,u===void 0?null:u],a},useContext:Ki,useEffect:Vm,useImperativeHandle:function(a,u,p){return p=p!=null?p.concat([a]):null,Of(4194308,4,F_.bind(null,u,a),p)},useLayoutEffect:function(a,u){return Of(4194308,4,a,u)},useInsertionEffect:function(a,u){return Of(4,2,a,u)},useMemo:function(a,u){var p=ns();return u=u===void 0?null:u,a=a(),p.memoizedState=[a,u],a},useReducer:function(a,u,p){var y=ns();return u=p!==void 0?p(u):u,y.memoizedState=y.baseState=u,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:u},y.queue=a,a=a.dispatch=oA.bind(null,ln,a),[y.memoizedState,a]},useRef:function(a){var u=ns();return a={current:a},u.memoizedState=a},useState:Hm,useDebugValue:Gm,useDeferredValue:function(a){var u=Hm(a),p=u[0],y=u[1];return Vm(function(){var E=er.transition;er.transition={};try{y(a)}finally{er.transition=E}},[a]),p},useTransition:function(){var a=Hm(!1),u=a[0];return a=sA.bind(null,a[1]),ns().memoizedState=a,[u,a]},useMutableSource:function(){},useSyncExternalStore:function(a,u,p){var y=ln,E=ns();if(Kt){if(p===void 0)throw Error(o(407));p=p()}else{if(p=u(),_n===null)throw Error(o(349));Fa&30||L_(y,u,p)}E.memoizedState=p;var A={value:p,getSnapshot:u};return E.queue=A,Vm(N_.bind(null,y,A,a),[a]),y.flags|=2048,gu(9,I_.bind(null,y,A,p,u),void 0,null),p},useId:function(){var a=ns(),u=_n.identifierPrefix;if(Kt){var p=ts,y=es;p=(y&~(1<<32-Li(y)-1)).toString(32)+p,u=":"+u+"R"+p,p=mu++,0l0&&(u.flags|=128,y=!0,xu(E,!1),u.lanes=4194304)}else{if(!y)if(a=If(A),a!==null){if(u.flags|=128,y=!0,a=a.updateQueue,a!==null&&(u.updateQueue=a,u.flags|=4),xu(E,!0),E.tail===null&&E.tailMode==="hidden"&&!A.alternate&&!Kt)return qn(u),null}else 2*In()-E.renderingStartTime>l0&&p!==1073741824&&(u.flags|=128,y=!0,xu(E,!1),u.lanes=4194304);E.isBackwards?(A.sibling=u.child,u.child=A):(a=E.last,a!==null?a.sibling=A:u.child=A,E.last=A)}return E.tail!==null?(u=E.tail,E.rendering=u,E.tail=u.sibling,E.renderingStartTime=In(),u.sibling=null,a=en.current,Ge(en,y?a&1|2:a&1),u):(qn(u),null);case 22:case 23:return d0(),y=u.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(u.flags|=8192),y&&u.mode&1?Ui&1073741824&&(qn(u),Ke&&u.subtreeFlags&6&&(u.flags|=8192)):qn(u),null;case 24:return null;case 25:return null}throw Error(o(156,u.tag))}var dA=l.ReactCurrentOwner,Di=!1;function ai(a,u,p,y){u.child=a===null?C_(u,null,p,y):Ua(u,a.child,p,y)}function ex(a,u,p,y,E){p=p.render;var A=u.ref;return La(u,E),y=km(a,u,p,y,A,E),p=Bm(),a!==null&&!Di?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~E,is(a,u,E)):(Kt&&p&&Rm(u),u.flags|=1,ai(a,u,y,E),u.child)}function tx(a,u,p,y,E){if(a===null){var A=p.type;return typeof A=="function"&&!m0(A)&&A.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(u.tag=15,u.type=A,nx(a,u,A,y,E)):(a=lh(p.type,null,y,u,u.mode,E),a.ref=u.ref,a.return=u,u.child=a)}if(A=a.child,!(a.lanes&E)){var F=A.memoizedProps;if(p=p.compare,p=p!==null?p:wf,p(F,y)&&a.ref===u.ref)return is(a,u,E)}return u.flags|=1,a=zs(A,y),a.ref=u.ref,a.return=u,u.child=a}function nx(a,u,p,y,E){if(a!==null&&wf(a.memoizedProps,y)&&a.ref===u.ref)if(Di=!1,(a.lanes&E)!==0)a.flags&131072&&(Di=!0);else return u.lanes=a.lanes,is(a,u,E);return jm(a,u,p,y,E)}function ix(a,u,p){var y=u.pendingProps,E=y.children,A=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(u.mode&1))u.memoizedState={baseLanes:0,cachePool:null},Ge(ka,Ui),Ui|=p;else if(p&1073741824)u.memoizedState={baseLanes:0,cachePool:null},y=A!==null?A.baseLanes:p,Ge(ka,Ui),Ui|=y;else return a=A!==null?A.baseLanes|p:p,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:a,cachePool:null},u.updateQueue=null,Ge(ka,Ui),Ui|=a,null;else A!==null?(y=A.baseLanes|p,u.memoizedState=null):y=p,Ge(ka,Ui),Ui|=y;return ai(a,u,E,p),u.child}function rx(a,u){var p=u.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(u.flags|=512,u.flags|=2097152)}function jm(a,u,p,y,E){var A=Ln(p)?Pr:Et.current;return A=Zi(u,A),La(u,E),p=km(a,u,p,y,A,E),y=Bm(),a!==null&&!Di?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~E,is(a,u,E)):(Kt&&y&&Rm(u),u.flags|=1,ai(a,u,p,E),u.child)}function sx(a,u,p,y,E){if(Ln(p)){var A=!0;Bn(u)}else A=!1;if(La(u,E),u.stateNode===null)a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2),__(u,p,y),bm(u,p,y,E),y=!0;else if(a===null){var F=u.stateNode,j=u.memoizedProps;F.props=j;var ue=F.context,Te=p.contextType;typeof Te=="object"&&Te!==null?Te=Ki(Te):(Te=Ln(p)?Pr:Et.current,Te=Zi(u,Te));var We=p.getDerivedStateFromProps,gt=typeof We=="function"||typeof F.getSnapshotBeforeUpdate=="function";gt||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(j!==y||ue!==Te)&&x_(u,F,y,Te),Ps=!1;var it=u.memoizedState;F.state=it,Cf(u,y,F,E),ue=u.memoizedState,j!==y||it!==ue||an.current||Ps?(typeof We=="function"&&(Cm(u,p,We,y),ue=u.memoizedState),(j=Ps||y_(u,p,j,y,it,ue,Te))?(gt||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(u.flags|=4194308)):(typeof F.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=y,u.memoizedState=ue),F.props=y,F.state=ue,F.context=Te,y=j):(typeof F.componentDidMount=="function"&&(u.flags|=4194308),y=!1)}else{F=u.stateNode,p_(a,u),j=u.memoizedProps,Te=u.type===u.elementType?j:dr(u.type,j),F.props=Te,gt=u.pendingProps,it=F.context,ue=p.contextType,typeof ue=="object"&&ue!==null?ue=Ki(ue):(ue=Ln(p)?Pr:Et.current,ue=Zi(u,ue));var Gt=p.getDerivedStateFromProps;(We=typeof Gt=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(j!==gt||it!==ue)&&x_(u,F,y,ue),Ps=!1,it=u.memoizedState,F.state=it,Cf(u,y,F,E);var $e=u.memoizedState;j!==gt||it!==$e||an.current||Ps?(typeof Gt=="function"&&(Cm(u,p,Gt,y),$e=u.memoizedState),(Te=Ps||y_(u,p,Te,y,it,$e,ue)||!1)?(We||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(y,$e,ue),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(y,$e,ue)),typeof F.componentDidUpdate=="function"&&(u.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof F.componentDidUpdate!="function"||j===a.memoizedProps&&it===a.memoizedState||(u.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&it===a.memoizedState||(u.flags|=1024),u.memoizedProps=y,u.memoizedState=$e),F.props=y,F.state=$e,F.context=ue,y=Te):(typeof F.componentDidUpdate!="function"||j===a.memoizedProps&&it===a.memoizedState||(u.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&it===a.memoizedState||(u.flags|=1024),y=!1)}return Ym(a,u,p,y,A,E)}function Ym(a,u,p,y,E,A){rx(a,u);var F=(u.flags&128)!==0;if(!y&&!F)return E&&Ra(u,p,!1),is(a,u,A);y=u.stateNode,dA.current=u;var j=F&&typeof p.getDerivedStateFromError!="function"?null:y.render();return u.flags|=1,a!==null&&F?(u.child=Ua(u,a.child,null,A),u.child=Ua(u,null,j,A)):ai(a,u,j,A),u.memoizedState=y.state,E&&Ra(u,p,!0),u.child}function ox(a){var u=a.stateNode;u.pendingContext?Lr(a,u.pendingContext,u.pendingContext!==u.context):u.context&&Lr(a,u.context,!1),Dm(a,u.containerInfo)}function ax(a,u,p,y,E){return Da(),Nm(E),u.flags|=256,ai(a,u,p,y),u.child}var Vf={dehydrated:null,treeContext:null,retryLane:0};function Gf(a){return{baseLanes:a,cachePool:null}}function lx(a,u,p){var y=u.pendingProps,E=en.current,A=!1,F=(u.flags&128)!==0,j;if((j=F)||(j=a!==null&&a.memoizedState===null?!1:(E&2)!==0),j?(A=!0,u.flags&=-129):(a===null||a.memoizedState!==null)&&(E|=1),Ge(en,E&1),a===null)return Im(u),a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(u.mode&1?ou(a)?u.lanes=8:u.lanes=1073741824:u.lanes=1,null):(E=y.children,a=y.fallback,A?(y=u.mode,A=u.child,E={mode:"hidden",children:E},!(y&1)&&A!==null?(A.childLanes=0,A.pendingProps=E):A=uh(E,y,0,null),a=Io(a,y,p,null),A.return=u,a.return=u,A.sibling=a,u.child=A,u.child.memoizedState=Gf(p),u.memoizedState=Vf,a):qm(u,E));if(E=a.memoizedState,E!==null){if(j=E.dehydrated,j!==null){if(F)return u.flags&256?(u.flags&=-257,Wf(a,u,p,Error(o(422)))):u.memoizedState!==null?(u.child=a.child,u.flags|=128,null):(A=y.fallback,E=u.mode,y=uh({mode:"visible",children:y.children},E,0,null),A=Io(A,E,p,null),A.flags|=2,y.return=u,A.return=u,y.sibling=A,u.child=y,u.mode&1&&Ua(u,a.child,null,p),u.child.memoizedState=Gf(p),u.memoizedState=Vf,A);if(!(u.mode&1))u=Wf(a,u,p,null);else if(ou(j))u=Wf(a,u,p,Error(o(419)));else if(y=(p&a.childLanes)!==0,Di||y){if(y=_n,y!==null){switch(p&-p){case 4:A=2;break;case 16:A=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:A=32;break;case 536870912:A=268435456;break;default:A=0}y=A&(y.suspendedLanes|p)?0:A,y!==0&&y!==E.retryLane&&(E.retryLane=y,tr(a,y,-1))}p0(),u=Wf(a,u,p,Error(o(421)))}else su(j)?(u.flags|=128,u.child=a.child,u=AA.bind(null,a),Aa(j,u),u=null):(p=E.treeContext,Se&&(Ni=gf(j),Ii=u,Kt=!0,pr=null,uu=!1,p!==null&&(Ji[Qi++]=es,Ji[Qi++]=ts,Ji[Qi++]=Eo,es=p.id,ts=p.overflow,Eo=u)),u=qm(u,u.pendingProps.children),u.flags|=4096);return u}return A?(y=cx(a,u,y.children,y.fallback,p),A=u.child,E=a.child.memoizedState,A.memoizedState=E===null?Gf(p):{baseLanes:E.baseLanes|p,cachePool:null},A.childLanes=a.childLanes&~p,u.memoizedState=Vf,y):(p=ux(a,u,y.children,p),u.memoizedState=null,p)}return A?(y=cx(a,u,y.children,y.fallback,p),A=u.child,E=a.child.memoizedState,A.memoizedState=E===null?Gf(p):{baseLanes:E.baseLanes|p,cachePool:null},A.childLanes=a.childLanes&~p,u.memoizedState=Vf,y):(p=ux(a,u,y.children,p),u.memoizedState=null,p)}function qm(a,u){return u=uh({mode:"visible",children:u},a.mode,0,null),u.return=a,a.child=u}function ux(a,u,p,y){var E=a.child;return a=E.sibling,p=zs(E,{mode:"visible",children:p}),!(u.mode&1)&&(p.lanes=y),p.return=u,p.sibling=null,a!==null&&(y=u.deletions,y===null?(u.deletions=[a],u.flags|=16):y.push(a)),u.child=p}function cx(a,u,p,y,E){var A=u.mode;a=a.child;var F=a.sibling,j={mode:"hidden",children:p};return!(A&1)&&u.child!==a?(p=u.child,p.childLanes=0,p.pendingProps=j,u.deletions=null):(p=zs(a,j),p.subtreeFlags=a.subtreeFlags&14680064),F!==null?y=zs(F,y):(y=Io(y,A,E,null),y.flags|=2),y.return=u,p.return=u,p.sibling=y,u.child=p,y}function Wf(a,u,p,y){return y!==null&&Nm(y),Ua(u,a.child,null,p),a=qm(u,u.pendingProps.children),a.flags|=2,u.memoizedState=null,a}function fx(a,u,p){a.lanes|=u;var y=a.alternate;y!==null&&(y.lanes|=u),Tm(a.return,u,p)}function Zm(a,u,p,y,E){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:E}:(A.isBackwards=u,A.rendering=null,A.renderingStartTime=0,A.last=y,A.tail=p,A.tailMode=E)}function hx(a,u,p){var y=u.pendingProps,E=y.revealOrder,A=y.tail;if(ai(a,u,y.children,p),y=en.current,y&2)y=y&1|2,u.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&fx(a,p,u);else if(a.tag===19)fx(a,p,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Ge(en,y),!(u.mode&1))u.memoizedState=null;else switch(E){case"forwards":for(p=u.child,E=null;p!==null;)a=p.alternate,a!==null&&If(a)===null&&(E=p),p=p.sibling;p=E,p===null?(E=u.child,u.child=null):(E=p.sibling,p.sibling=null),Zm(u,!1,E,p,A);break;case"backwards":for(p=null,E=u.child,u.child=null;E!==null;){if(a=E.alternate,a!==null&&If(a)===null){u.child=E;break}a=E.sibling,E.sibling=p,p=E,E=a}Zm(u,!0,p,null,A);break;case"together":Zm(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function is(a,u,p){if(a!==null&&(u.dependencies=a.dependencies),Ba|=u.lanes,!(p&u.childLanes))return null;if(a!==null&&u.child!==a.child)throw Error(o(153));if(u.child!==null){for(a=u.child,p=zs(a,a.pendingProps),u.child=p,p.return=u;a.sibling!==null;)a=a.sibling,p=p.sibling=zs(a,a.pendingProps),p.return=u;p.sibling=null}return u.child}function pA(a,u,p){switch(u.tag){case 3:ox(u),Da();break;case 5:b_(u);break;case 1:Ln(u.type)&&Bn(u);break;case 4:Dm(u,u.stateNode.containerInfo);break;case 10:d_(u,u.type._context,u.memoizedProps.value);break;case 13:var y=u.memoizedState;if(y!==null)return y.dehydrated!==null?(Ge(en,en.current&1),u.flags|=128,null):p&u.child.childLanes?lx(a,u,p):(Ge(en,en.current&1),a=is(a,u,p),a!==null?a.sibling:null);Ge(en,en.current&1);break;case 19:if(y=(p&u.childLanes)!==0,a.flags&128){if(y)return hx(a,u,p);u.flags|=128}var E=u.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Ge(en,en.current),y)break;return null;case 22:case 23:return u.lanes=0,ix(a,u,p)}return is(a,u,p)}function mA(a,u){switch(Pm(u),u.tag){case 1:return Ln(u.type)&&pn(),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return Oa(),at(an),at(Et),Om(),a=u.flags,a&65536&&!(a&128)?(u.flags=a&-65537|128,u):null;case 5:return Um(u),null;case 13:if(at(en),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(o(340));Da()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return at(en),null;case 4:return Oa(),null;case 10:return Em(u.type._context),null;case 22:case 23:return d0(),null;case 24:return null;default:return null}}var Xf=!1,Co=!1,gA=typeof WeakSet=="function"?WeakSet:Set,De=null;function jf(a,u){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){Si(a,u,y)}else p.current=null}function Km(a,u,p){try{p()}catch(y){Si(a,u,y)}}var dx=!1;function vA(a,u){for(k(a.containerInfo),De=u;De!==null;)if(a=De,u=a.child,(a.subtreeFlags&1028)!==0&&u!==null)u.return=a,De=u;else for(;De!==null;){a=De;try{var p=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var y=p.memoizedProps,E=p.memoizedState,A=a.stateNode,F=A.getSnapshotBeforeUpdate(a.elementType===a.type?y:dr(a.type,y),E);A.__reactInternalSnapshotBeforeUpdate=F}break;case 3:Ke&&Re(a.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(j){Si(a,a.return,j)}if(u=a.sibling,u!==null){u.return=a.return,De=u;break}De=a.return}return p=dx,dx=!1,p}function bo(a,u,p){var y=u.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var E=y=y.next;do{if((E.tag&a)===a){var A=E.destroy;E.destroy=void 0,A!==void 0&&Km(u,p,A)}E=E.next}while(E!==y)}}function Su(a,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&a)===a){var y=p.create;p.destroy=y()}p=p.next}while(p!==u)}}function Jm(a){var u=a.ref;if(u!==null){var p=a.stateNode;switch(a.tag){case 5:a=te(p);break;default:a=p}typeof u=="function"?u(a):u.current=a}}function px(a,u,p){if(Ir&&typeof Ir.onCommitFiberUnmount=="function")try{Ir.onCommitFiberUnmount(Sf,u)}catch{}switch(u.tag){case 0:case 11:case 14:case 15:if(a=u.updateQueue,a!==null&&(a=a.lastEffect,a!==null)){var y=a=a.next;do{var E=y,A=E.destroy;E=E.tag,A!==void 0&&(E&2||E&4)&&Km(u,p,A),y=y.next}while(y!==a)}break;case 1:if(jf(u,p),a=u.stateNode,typeof a.componentWillUnmount=="function")try{a.props=u.memoizedProps,a.state=u.memoizedState,a.componentWillUnmount()}catch(F){Si(u,p,F)}break;case 5:jf(u,p);break;case 4:Ke?xx(a,u,p):V&&V&&(u=u.stateNode.containerInfo,p=nt(u),Rt(u,p))}}function mx(a,u,p){for(var y=u;;)if(px(a,y,p),y.child===null||Ke&&y.tag===4){if(y===u)break;for(;y.sibling===null;){if(y.return===null||y.return===u)return;y=y.return}y.sibling.return=y.return,y=y.sibling}else y.child.return=y,y=y.child}function gx(a){var u=a.alternate;u!==null&&(a.alternate=null,gx(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode,u!==null&&Ze(u)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function vx(a){return a.tag===5||a.tag===3||a.tag===4}function yx(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||vx(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function _x(a){if(Ke){e:{for(var u=a.return;u!==null;){if(vx(u))break e;u=u.return}throw Error(o(160))}var p=u;switch(p.tag){case 5:u=p.stateNode,p.flags&32&&(pe(u),p.flags&=-33),p=yx(a),$m(a,p,u);break;case 3:case 4:u=p.stateNode.containerInfo,p=yx(a),Qm(a,p,u);break;default:throw Error(o(161))}}}function Qm(a,u,p){var y=a.tag;if(y===5||y===6)a=a.stateNode,u?et(p,a,u):dt(p,a);else if(y!==4&&(a=a.child,a!==null))for(Qm(a,u,p),a=a.sibling;a!==null;)Qm(a,u,p),a=a.sibling}function $m(a,u,p){var y=a.tag;if(y===5||y===6)a=a.stateNode,u?ut(p,a,u):tt(p,a);else if(y!==4&&(a=a.child,a!==null))for($m(a,u,p),a=a.sibling;a!==null;)$m(a,u,p),a=a.sibling}function xx(a,u,p){for(var y=u,E=!1,A,F;;){if(!E){E=y.return;e:for(;;){if(E===null)throw Error(o(160));switch(A=E.stateNode,E.tag){case 5:F=!1;break e;case 3:A=A.containerInfo,F=!0;break e;case 4:A=A.containerInfo,F=!0;break e}E=E.return}E=!0}if(y.tag===5||y.tag===6)mx(a,y,p),F?X(A,y.stateNode):He(A,y.stateNode);else if(y.tag===18)F?ie(A,y.stateNode):se(A,y.stateNode);else if(y.tag===4){if(y.child!==null){A=y.stateNode.containerInfo,F=!0,y.child.return=y,y=y.child;continue}}else if(px(a,y,p),y.child!==null){y.child.return=y,y=y.child;continue}if(y===u)break;for(;y.sibling===null;){if(y.return===null||y.return===u)return;y=y.return,y.tag===4&&(E=!1)}y.sibling.return=y.return,y=y.sibling}}function e0(a,u){if(Ke){switch(u.tag){case 0:case 11:case 14:case 15:bo(3,u,u.return),Su(3,u),bo(5,u,u.return);return;case 1:return;case 5:var p=u.stateNode;if(p!=null){var y=u.memoizedProps;a=a!==null?a.memoizedProps:y;var E=u.type,A=u.updateQueue;u.updateQueue=null,A!==null&&yt(p,A,E,a,y,u)}return;case 6:if(u.stateNode===null)throw Error(o(162));p=u.memoizedProps,_e(u.stateNode,a!==null?a.memoizedProps:p,p);return;case 3:Se&&a!==null&&a.memoizedState.isDehydrated&&$(u.stateNode.containerInfo);return;case 12:return;case 13:Yf(u);return;case 19:Yf(u);return;case 17:return}throw Error(o(163))}switch(u.tag){case 0:case 11:case 14:case 15:bo(3,u,u.return),Su(3,u),bo(5,u,u.return);return;case 12:return;case 13:Yf(u);return;case 19:Yf(u);return;case 3:Se&&a!==null&&a.memoizedState.isDehydrated&&$(u.stateNode.containerInfo);break;case 22:case 23:return}e:if(V){switch(u.tag){case 1:case 5:case 6:break e;case 3:case 4:u=u.stateNode,Rt(u.containerInfo,u.pendingChildren);break e}throw Error(o(163))}}function Yf(a){var u=a.updateQueue;if(u!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new gA),u.forEach(function(y){var E=CA.bind(null,a,y);p.has(y)||(p.add(y),y.then(E,E))})}}function yA(a,u){for(De=u;De!==null;){u=De;var p=u.deletions;if(p!==null)for(var y=0;y";case Zf:return":has("+(i0(a)||"")+")";case Kf:return'[role="'+a.value+'"]';case Qf:return'"'+a.value+'"';case Jf:return'[data-testname="'+a.value+'"]';default:throw Error(o(365))}}function Tx(a,u){var p=[];a=[a,0];for(var y=0;yE&&(E=F),y&=~A}if(y=E,y=In()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*xA(y/1960))-y,10a?16:a,Ns===null)var y=!1;else{if(a=Ns,Ns=null,ih=0,Tt&6)throw Error(o(331));var E=Tt;for(Tt|=4,De=a.current;De!==null;){var A=De,F=A.child;if(De.flags&16){var j=A.deletions;if(j!==null){for(var ue=0;ueIn()-a0?Ro(a,0):o0|=p),xi(a,u)}function Dx(a,u){u===0&&(a.mode&1?(u=_f,_f<<=1,!(_f&130023424)&&(_f=4194304)):u=1);var p=li();a=oh(a,u),a!==null&&(lu(a,u,p),xi(a,p))}function AA(a){var u=a.memoizedState,p=0;u!==null&&(p=u.retryLane),Dx(a,p)}function CA(a,u){var p=0;switch(a.tag){case 13:var y=a.stateNode,E=a.memoizedState;E!==null&&(p=E.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(o(314))}y!==null&&y.delete(u),Dx(a,p)}var Ux;Ux=function(a,u,p){if(a!==null)if(a.memoizedProps!==u.pendingProps||an.current)Di=!0;else{if(!(a.lanes&p)&&!(u.flags&128))return Di=!1,pA(a,u,p);Di=!!(a.flags&131072)}else Di=!1,Kt&&u.flags&1048576&&S_(u,Pf,u.index);switch(u.lanes=0,u.tag){case 2:var y=u.type;a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2),a=u.pendingProps;var E=Zi(u,Et.current);La(u,p),E=km(null,u,y,a,E,p);var A=Bm();return u.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Ln(y)?(A=!0,Bn(u)):A=!1,u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Am(u),E.updater=bf,u.stateNode=E,E._reactInternals=u,bm(u,y,a,p),u=Ym(null,u,y,!0,A,p)):(u.tag=0,Kt&&A&&Rm(u),ai(null,u,E,p),u=u.child),u;case 16:y=u.elementType;e:{switch(a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2),a=u.pendingProps,E=y._init,y=E(y._payload),u.type=y,E=u.tag=RA(y),a=dr(y,a),E){case 0:u=jm(null,u,y,a,p);break e;case 1:u=sx(null,u,y,a,p);break e;case 11:u=ex(null,u,y,a,p);break e;case 14:u=tx(null,u,y,dr(y.type,a),p);break e}throw Error(o(306,y,""))}return u;case 0:return y=u.type,E=u.pendingProps,E=u.elementType===y?E:dr(y,E),jm(a,u,y,E,p);case 1:return y=u.type,E=u.pendingProps,E=u.elementType===y?E:dr(y,E),sx(a,u,y,E,p);case 3:e:{if(ox(u),a===null)throw Error(o(387));y=u.pendingProps,A=u.memoizedState,E=A.element,p_(a,u),Cf(u,y,null,p);var F=u.memoizedState;if(y=F.element,Se&&A.isDehydrated)if(A={element:y,isDehydrated:!1,cache:F.cache,transitions:F.transitions},u.updateQueue.baseState=A,u.memoizedState=A,u.flags&256){E=Error(o(423)),u=ax(a,u,y,p,E);break e}else if(y!==E){E=Error(o(424)),u=ax(a,u,y,p,E);break e}else for(Se&&(Ni=mf(u.stateNode.containerInfo),Ii=u,Kt=!0,pr=null,uu=!1),p=C_(u,null,y,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Da(),y===E){u=is(a,u,p);break e}ai(a,u,y,p)}u=u.child}return u;case 5:return b_(u),a===null&&Im(u),y=u.type,E=u.pendingProps,A=a!==null?a.memoizedProps:null,F=E.children,ge(y,E)?F=null:A!==null&&ge(y,A)&&(u.flags|=32),rx(a,u),ai(a,u,F,p),u.child;case 6:return a===null&&Im(u),null;case 13:return lx(a,u,p);case 4:return Dm(u,u.stateNode.containerInfo),y=u.pendingProps,a===null?u.child=Ua(u,null,y,p):ai(a,u,y,p),u.child;case 11:return y=u.type,E=u.pendingProps,E=u.elementType===y?E:dr(y,E),ex(a,u,y,E,p);case 7:return ai(a,u,u.pendingProps,p),u.child;case 8:return ai(a,u,u.pendingProps.children,p),u.child;case 12:return ai(a,u,u.pendingProps.children,p),u.child;case 10:e:{if(y=u.type._context,E=u.pendingProps,A=u.memoizedProps,F=E.value,d_(u,y,F),A!==null)if(Nr(A.value,F)){if(A.children===E.children&&!an.current){u=is(a,u,p);break e}}else for(A=u.child,A!==null&&(A.return=u);A!==null;){var j=A.dependencies;if(j!==null){F=A.child;for(var ue=j.firstContext;ue!==null;){if(ue.context===y){if(A.tag===1){ue=$r(-1,p&-p),ue.tag=2;var Te=A.updateQueue;if(Te!==null){Te=Te.shared;var We=Te.pending;We===null?ue.next=ue:(ue.next=We.next,We.next=ue),Te.pending=ue}}A.lanes|=p,ue=A.alternate,ue!==null&&(ue.lanes|=p),Tm(A.return,p,u),j.lanes|=p;break}ue=ue.next}}else if(A.tag===10)F=A.type===u.type?null:A.child;else if(A.tag===18){if(F=A.return,F===null)throw Error(o(341));F.lanes|=p,j=F.alternate,j!==null&&(j.lanes|=p),Tm(F,p,u),F=A.sibling}else F=A.child;if(F!==null)F.return=A;else for(F=A;F!==null;){if(F===u){F=null;break}if(A=F.sibling,A!==null){A.return=F.return,F=A;break}F=F.return}A=F}ai(a,u,E.children,p),u=u.child}return u;case 9:return E=u.type,y=u.pendingProps.children,La(u,p),E=Ki(E),y=y(E),u.flags|=1,ai(a,u,y,p),u.child;case 14:return y=u.type,E=dr(y,u.pendingProps),E=dr(y.type,E),tx(a,u,y,E,p);case 15:return nx(a,u,u.type,u.pendingProps,p);case 17:return y=u.type,E=u.pendingProps,E=u.elementType===y?E:dr(y,E),a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2),u.tag=1,Ln(y)?(a=!0,Bn(u)):a=!1,La(u,p),__(u,y,E),bm(u,y,E,p),Ym(null,u,y,!0,a,p);case 19:return hx(a,u,p);case 22:return ix(a,u,p)}throw Error(o(156,u.tag))};function zx(a,u){return ym(a,u)}function bA(a,u,p,y){this.tag=a,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(a,u,p,y){return new bA(a,u,p,y)}function m0(a){return a=a.prototype,!(!a||!a.isReactComponent)}function RA(a){if(typeof a=="function")return m0(a)?1:0;if(a!=null){if(a=a.$$typeof,a===w)return 11;if(a===S)return 14}return 2}function zs(a,u){var p=a.alternate;return p===null?(p=nr(a.tag,u,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=u,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,u=a.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function lh(a,u,p,y,E,A){var F=2;if(y=a,typeof a=="function")m0(a)&&(F=1);else if(typeof a=="string")F=5;else e:switch(a){case h:return Io(p.children,E,A,u);case d:F=8,E|=8;break;case m:return a=nr(12,p,u,E|2),a.elementType=m,a.lanes=A,a;case x:return a=nr(13,p,u,E),a.elementType=x,a.lanes=A,a;case g:return a=nr(19,p,u,E),a.elementType=g,a.lanes=A,a;case T:return uh(p,E,A,u);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case v:F=10;break e;case _:F=9;break e;case w:F=11;break e;case S:F=14;break e;case M:F=16,y=null;break e}throw Error(o(130,a==null?a:typeof a,""))}return u=nr(F,p,u,E),u.elementType=a,u.type=y,u.lanes=A,u}function Io(a,u,p,y){return a=nr(7,a,y,u),a.lanes=p,a}function uh(a,u,p,y){return a=nr(22,a,y,u),a.elementType=T,a.lanes=p,a.stateNode={},a}function g0(a,u,p){return a=nr(6,a,null,u),a.lanes=p,a}function v0(a,u,p){return u=nr(4,a.children!==null?a.children:[],a.key,u),u.lanes=p,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}function PA(a,u,p,y,E){this.tag=u,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=lt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gm(0),this.expirationTimes=gm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gm(0),this.identifierPrefix=y,this.onRecoverableError=E,Se&&(this.mutableSourceEagerHydrationData=null)}function Ox(a,u,p,y,E,A,F,j,ue){return a=new PA(a,u,p,j,ue),u===1?(u=1,A===!0&&(u|=8)):u=0,A=nr(3,null,null,u),a.current=A,A.stateNode=a,A.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null},Am(A),a}function Fx(a){if(!a)return qi;a=a._reactInternals;e:{if(b(a)!==a||a.tag!==1)throw Error(o(170));var u=a;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Ln(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(o(171))}if(a.tag===1){var p=a.type;if(Ln(p))return ba(a,p,u)}return u}function kx(a){var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(o(188)):(a=Object.keys(a).join(","),Error(o(268,a)));return a=Z(u),a===null?null:a.stateNode}function Bx(a,u){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p=Te&&A>=gt&&E<=We&&F<=it){a.splice(u,1);break}else if(y!==Te||p.width!==ue.width||itF){if(!(A!==gt||p.height!==ue.height||WeE)){Te>y&&(ue.width+=Te-y,ue.x=y),WeA&&(ue.height+=gt-A,ue.y=A),itp&&(p=F)),F ")+` - -No matching component was found for: - `)+a.join(" > ")}return null},t.getPublicRootInstance=function(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return te(a.child.stateNode);default:return a.child.stateNode}},t.injectIntoDevTools=function(a){if(a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:LA,findFiberByHostInstance:a.findFiberByHostInstance||IA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")a=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)a=!0;else{try{Sf=u.inject(a),Ir=u}catch{}a=!!u.checkDCE}}return a},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(a,u,p,y){if(!I)throw Error(o(363));a=r0(a,u);var E=Fe(a,p,y).disconnect;return{disconnect:function(){E()}}},t.registerMutableSourceForHydration=function(a,u){var p=u._getVersion;p=p(u._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[u,p]:a.mutableSourceEagerHydrationData.push(u,p)},t.runWithPriority=function(a,u){var p=Nt;try{return Nt=a,u()}finally{Nt=p}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(a,u,p,y){var E=u.current,A=li(),F=Ds(E);return p=Fx(p),u.context===null?u.context=p:u.pendingContext=p,u=$r(A,F),u.payload={element:a},y=y===void 0?null:y,y!==null&&(u.callback=y),Ls(E,u),a=tr(E,F,A),a!==null&&Af(a,E,F),F},t};S4.exports=wD;var ED=S4.exports;const TD=Tv(ED);var M4={exports:{}},w4={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(n){function e(N,k){var H=N.length;N.push(k);e:for(;0>>1,J=N[q];if(0>>1;qr(ge,H))Aer(Ce,ge)?(N[q]=Ce,N[Ae]=H,q=Ae):(N[q]=ge,N[ae]=H,q=ae);else if(Aer(Ce,H))N[q]=Ce,N[Ae]=H,q=Ae;else break e}}return k}function r(N,k){var H=N.sortIndex-k.sortIndex;return H!==0?H:N.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();n.unstable_now=function(){return o.now()-l}}var c=[],f=[],h=1,d=null,m=3,v=!1,_=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(N){for(var k=t(f);k!==null;){if(k.callback===null)i(f);else if(k.startTime<=N)i(f),k.sortIndex=k.expirationTime,e(c,k);else break;k=t(f)}}function T(N){if(w=!1,M(N),!_)if(t(c)!==null)_=!0,te(P);else{var k=t(f);k!==null&&ce(T,k.startTime-N)}}function P(N,k){_=!1,w&&(w=!1,g(z),z=-1),v=!0;var H=m;try{for(M(k),d=t(c);d!==null&&(!(d.expirationTime>k)||N&&!B());){var q=d.callback;if(typeof q=="function"){d.callback=null,m=d.priorityLevel;var J=q(d.expirationTime<=k);k=n.unstable_now(),typeof J=="function"?d.callback=J:d===t(c)&&i(c),M(k)}else i(c);d=t(c)}if(d!==null)var K=!0;else{var ae=t(f);ae!==null&&ce(T,ae.startTime-k),K=!1}return K}finally{d=null,m=H,v=!1}}var C=!1,L=null,z=-1,b=5,R=-1;function B(){return!(n.unstable_now()-RN||125q?(N.sortIndex=H,e(f,N),t(c)===null&&N===t(f)&&(w?(g(z),z=-1):w=!0,ce(T,H-q))):(N.sortIndex=J,e(c,N),_||v||(_=!0,te(P))),N},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(N){var k=m;return function(){var H=m;m=k;try{return N.apply(this,arguments)}finally{m=H}}}})(w4);M4.exports=w4;var P3=M4.exports;const a_={},AD=n=>void Object.assign(a_,n);function CD(n,e){function t(h,{args:d=[],attach:m,...v},_){let w=`${h[0].toUpperCase()}${h.slice(1)}`,x;if(h==="primitive"){if(v.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=v.object;x=hl(g,{type:h,root:_,attach:m,primitive:!0})}else{const g=a_[w];if(!g)throw new Error(`R3F: ${w} 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(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");x=hl(new g(...d),{type:h,root:_,attach:m,memoizedProps:{args:d}})}return x.__r3f.attach===void 0&&(x instanceof St?x.__r3f.attach="geometry":x instanceof Xn&&(x.__r3f.attach="material")),w!=="inject"&&Ig(x,v),x}function i(h,d){let m=!1;if(d){var v,_;(v=d.__r3f)!=null&&v.attach?Lg(h,d,d.__r3f.attach):d.isObject3D&&h.isObject3D&&(h.add(d),m=!0),m||(_=h.__r3f)==null||_.objects.push(d),d.__r3f||hl(d,{}),d.__r3f.parent=h,wv(d),dl(d)}}function r(h,d,m){let v=!1;if(d){var _,w;if((_=d.__r3f)!=null&&_.attach)Lg(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"});const x=h.children.filter(S=>S!==d),g=x.indexOf(m);h.children=[...x.slice(0,g),d,...x.slice(g)],v=!0}v||(w=h.__r3f)==null||w.objects.push(d),d.__r3f||hl(d,{}),d.__r3f.parent=h,wv(d),dl(d)}}function s(h,d,m=!1){h&&[...h].forEach(v=>o(d,v,m))}function o(h,d,m){if(d){var v,_,w;if(d.__r3f&&(d.__r3f.parent=null),(v=h.__r3f)!=null&&v.objects&&(h.__r3f.objects=h.__r3f.objects.filter(T=>T!==d)),(_=d.__r3f)!=null&&_.attach)U3(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var x;h.remove(d),(x=d.__r3f)!=null&&x.root&&UD(d.__r3f.root,d)}const S=(w=d.__r3f)==null?void 0:w.primitive,M=!S&&(m===void 0?d.dispose!==null:m);if(!S){var g;s((g=d.__r3f)==null?void 0:g.objects,d,M),s(d.children,d,M)}if(delete d.__r3f,M&&d.dispose&&d.type!=="Scene"){const T=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?P3.unstable_scheduleCallback(P3.unstable_IdlePriority,T):T()}dl(h)}}function l(h,d,m,v){var _;const w=(_=h.__r3f)==null?void 0:_.parent;if(!w)return;const x=t(d,m,h.__r3f.root);if(h.children){for(const g of h.children)g.__r3f&&i(x,g);h.children=h.children.filter(g=>!g.__r3f)}h.__r3f.objects.forEach(g=>i(x,g)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||o(w,h),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),i(w,x),x.raycast&&x.__r3f.eventCount&&x.__r3f.root.getState().internal.interaction.push(x),[v,v.alternate].forEach(g=>{g!==null&&(g.stateNode=x,g.ref&&(typeof g.ref=="function"?g.ref(x):g.ref.current=x))})}const c=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:TD({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,d)=>{if(!d)return;const m=h.getState().scene;m.__r3f&&(m.__r3f.root=h,i(m,d))},removeChildFromContainer:(h,d)=>{d&&o(h.getState().scene,d)},insertInContainerBefore:(h,d,m)=>{if(!d||!m)return;const v=h.getState().scene;v.__r3f&&r(v,d,m)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var d;return!!((d=h==null?void 0:h.__r3f)!=null?d:{}).handlers},prepareUpdate(h,d,m,v){var _;if(((_=h==null?void 0:h.__r3f)!=null?_:{}).primitive&&v.object&&v.object!==h)return[!0];{const{args:x=[],children:g,...S}=v,{args:M=[],children:T,...P}=m;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((L,z)=>L!==M[z]))return[!0];const C=P4(h,S,P,!0);return C.changes.length?[!1,C]:null}},commitUpdate(h,[d,m],v,_,w,x){d?l(h,v,w,x):Ig(h,m)},commitMount(h,d,m,v){var _;const w=(_=h.__r3f)!=null?_:{};h.raycast&&w.handlers&&w.eventCount&&h.__r3f.root.getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>hl(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:m,parent:v}=(d=h.__r3f)!=null?d:{};m&&v&&U3(v,h,m),h.isObject3D&&(h.visible=!1),dl(h)},unhideInstance(h,d){var m;const{attach:v,parent:_}=(m=h.__r3f)!=null?m:{};v&&_&&Lg(_,h,v),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),dl(h)},createTextInstance:c,hideTextInstance:c,unhideTextInstance:c,getCurrentEventPriority:()=>e?e():Ll.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Jt.fun(performance.now)?performance.now:Jt.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Jt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Jt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Ig}}var L3,I3;const Pg=n=>"colorSpace"in n||"outputColorSpace"in n,E4=()=>{var n;return(n=a_.ColorManagement)!=null?n:null},T4=n=>n&&n.isOrthographicCamera,bD=n=>n&&n.hasOwnProperty("current"),pf=typeof window<"u"&&((L3=window.document)!=null&&L3.createElement||((I3=window.navigator)==null?void 0:I3.product)==="ReactNative")?be.useLayoutEffect:be.useEffect;function A4(n){const e=be.useRef(n);return pf(()=>void(e.current=n),[n]),e}function RD({set:n}){return pf(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class C4 extends be.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}C4.getDerivedStateFromError=()=>({error:!0});const b4="__default",N3=new Map,PD=n=>n&&!!n.memoized&&!!n.changes;function R4(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Xu=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},Jt={obj:n=>n===Object(n)&&!Jt.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(Jt.str(n)||Jt.num(n))return n===e;const s=Jt.obj(n);if(s&&i==="reference")return n===e;const o=Jt.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let l;for(l in n)if(!(l in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(l in r?e:n)if(!Jt.equ(n[l],e[l],{strict:r,objects:"reference"}))return!1}else for(l in r?e:n)if(n[l]!==e[l])return!1;if(Jt.und(l)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function LD(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function hl(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function Mv(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const D3=/-\d+$/;function Lg(n,e,t){if(Jt.str(t)){if(D3.test(t)){const s=t.replace(D3,""),{target:o,key:l}=Mv(n,s);Array.isArray(o[l])||(o[l]=[])}const{target:i,key:r}=Mv(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function U3(n,e,t){var i,r;if(Jt.str(t)){const{target:s,key:o}=Mv(n,t),l=e.__r3f.previousAttach;l===void 0?delete s[o]:s[o]=l}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function P4(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:l,...c}={},f=!1){var h;const d=(h=n==null?void 0:n.__r3f)!=null?h:{},m=Object.entries(r),v=[];if(f){const w=Object.keys(c);for(let x=0;x{var g;if((g=n.__r3f)!=null&&g.primitive&&w==="object"||Jt.equ(x,c[w]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(w))return v.push([w,x,!0,[]]);let S=[];w.includes("-")&&(S=w.split("-")),v.push([w,x,!1,S]);for(const M in r){const T=r[M];M.startsWith(`${w}-`)&&v.push([M,T,!1,M.split("-")])}});const _={...r};return d.memoizedProps&&d.memoizedProps.args&&(_.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(_.attach=d.memoizedProps.attach),{memoized:_,changes:v}}const ID=typeof process<"u"&&!1;function Ig(n,e){var t,i,r;const s=(t=n.__r3f)!=null?t:{},o=s.root,l=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:c,changes:f}=PD(e)?e:P4(n,e),h=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=c);for(let m=0;mM[T],n),!(S&&S.set))){const[M,...T]=x.reverse();g=T.reverse().reduce((P,C)=>P[C],n),v=M}if(_===b4+"remove")if(g.constructor){let M=N3.get(g.constructor);M||(M=new g.constructor,N3.set(g.constructor,M)),_=M[v]}else _=0;if(w)_?s.handlers[v]=_:delete s.handlers[v],s.eventCount=Object.keys(s.handlers).length;else if(S&&S.set&&(S.copy||S instanceof aa)){if(Array.isArray(_))S.fromArray?S.fromArray(_):S.set(..._);else if(S.copy&&_&&_.constructor&&(ID?S.constructor.name===_.constructor.name:S.constructor===_.constructor))S.copy(_);else if(_!==void 0){const M=S instanceof Be;!M&&S.setScalar?S.setScalar(_):S instanceof aa&&_ instanceof aa?S.mask=_.mask:S.set(_),!E4()&&!l.linear&&M&&S.convertSRGBToLinear()}}else if(g[v]=_,g[v]instanceof dn&&g[v].format===hi&&g[v].type===jr){const M=g[v];Pg(M)&&Pg(l.gl)?M.colorSpace=l.gl.outputColorSpace:M.encoding=l.gl.outputEncoding}dl(n)}if(s.parent&&l.internal&&n.raycast&&h!==s.eventCount){const m=l.internal.interaction.indexOf(n);m>-1&&l.internal.interaction.splice(m,1),s.eventCount&&l.internal.interaction.push(n)}return!(f.length===1&&f[0][0]==="onUpdate")&&f.length&&(r=n.__r3f)!=null&&r.parent&&wv(n),n}function dl(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function wv(n){n.onUpdate==null||n.onUpdate(n)}function ND(n,e){n.manual||(T4(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function _d(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function DD(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Ll.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ll.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ll.ContinuousEventPriority;default:return Ll.DefaultEventPriority}}function L4(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function UD(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{L4(t.capturedMap,e,i,r)})}function zD(n){function e(c){const{internal:f}=n.getState(),h=c.offsetX-f.initialClick[0],d=c.offsetY-f.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(c){return c.filter(f=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=f.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(c,f){const h=n.getState(),d=new Set,m=[],v=f?f(h.internal.interaction):h.internal.interaction;for(let g=0;g{const M=Xu(g.object),T=Xu(S.object);return!M||!T?g.distance-S.distance:T.events.priority-M.events.priority||g.distance-S.distance}).filter(g=>{const S=_d(g);return d.has(S)?!1:(d.add(S),!0)});h.events.filter&&(w=h.events.filter(w,h));for(const g of w){let S=g.object;for(;S;){var x;(x=S.__r3f)!=null&&x.eventCount&&m.push({...g,eventObject:S}),S=S.parent}}if("pointerId"in c&&h.internal.capturedMap.has(c.pointerId))for(let g of h.internal.capturedMap.get(c.pointerId).values())d.has(_d(g.intersection))||m.push(g.intersection);return m}function r(c,f,h,d){const m=n.getState();if(c.length){const v={stopped:!1};for(const _ of c){const w=Xu(_.object)||m,{raycaster:x,pointer:g,camera:S,internal:M}=w,T=new O(g.x,g.y,0).unproject(S),P=R=>{var B,Z;return(B=(Z=M.capturedMap.get(R))==null?void 0:Z.has(_.eventObject))!=null?B:!1},C=R=>{const B={intersection:_,target:f.target};M.capturedMap.has(R)?M.capturedMap.get(R).set(_.eventObject,B):M.capturedMap.set(R,new Map([[_.eventObject,B]])),f.target.setPointerCapture(R)},L=R=>{const B=M.capturedMap.get(R);B&&L4(M.capturedMap,_.eventObject,B,R)};let z={};for(let R in f){let B=f[R];typeof B!="function"&&(z[R]=B)}let b={..._,...z,pointer:g,intersections:c,stopped:v.stopped,delta:h,unprojectedPoint:T,ray:x.ray,camera:S,stopPropagation(){const R="pointerId"in f&&M.capturedMap.get(f.pointerId);if((!R||R.has(_.eventObject))&&(b.stopped=v.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(B=>B.eventObject===_.eventObject))){const B=c.slice(0,c.indexOf(_));s([...B,_])}},target:{hasPointerCapture:P,setPointerCapture:C,releasePointerCapture:L},currentTarget:{hasPointerCapture:P,setPointerCapture:C,releasePointerCapture:L},nativeEvent:f};if(d(b),v.stopped===!0)break}}return c}function s(c){const{internal:f}=n.getState();for(const h of f.hovered.values())if(!c.length||!c.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const m=h.eventObject.__r3f,v=m==null?void 0:m.handlers;if(f.hovered.delete(_d(h)),m!=null&&m.eventCount){const _={...h,intersections:c};v.onPointerOut==null||v.onPointerOut(_),v.onPointerLeave==null||v.onPointerLeave(_)}}}function o(c,f){for(let h=0;hs([]);case"onLostPointerCapture":return f=>{const{internal:h}=n.getState();"pointerId"in f&&h.capturedMap.has(f.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(f.pointerId)&&(h.capturedMap.delete(f.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:m}=n.getState();m.lastEvent.current=h;const v=c==="onPointerMove",_=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",x=i(h,v?t:void 0),g=_?e(h):0;c==="onPointerDown"&&(m.initialClick=[h.offsetX,h.offsetY],m.initialHits=x.map(M=>M.eventObject)),_&&!x.length&&g<=2&&(o(h,m.interaction),d&&d(h)),v&&s(x);function S(M){const T=M.eventObject,P=T.__r3f,C=P==null?void 0:P.handlers;if(P!=null&&P.eventCount)if(v){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){const L=_d(M),z=m.hovered.get(L);z?z.stopped&&M.stopPropagation():(m.hovered.set(L,M),C.onPointerOver==null||C.onPointerOver(M),C.onPointerEnter==null||C.onPointerEnter(M))}C.onPointerMove==null||C.onPointerMove(M)}else{const L=C[c];L?(!_||m.initialHits.includes(T))&&(o(h,m.interaction.filter(z=>!m.initialHits.includes(z))),L(M)):_&&m.initialHits.includes(T)&&o(h,m.interaction.filter(z=>!m.initialHits.includes(z)))}}r(x,h,g,S)}}return{handlePointer:l}}const I4=n=>!!(n!=null&&n.render),N4=be.createContext(null),OD=(n,e)=>{const t=xD((l,c)=>{const f=new O,h=new O,d=new O;function m(g=c().camera,S=h,M=c().size){const{width:T,height:P,top:C,left:L}=M,z=T/P;S instanceof O?d.copy(S):d.set(...S);const b=g.getWorldPosition(f).distanceTo(d);if(T4(g))return{width:T/g.zoom,height:P/g.zoom,top:C,left:L,factor:1,distance:b,aspect:z};{const R=g.fov*Math.PI/180,B=2*Math.tan(R/2)*b,Z=B*(T/P);return{width:Z,height:B,top:C,left:L,factor:T/Z,distance:b,aspect:z}}}let v;const _=g=>l(S=>({performance:{...S.performance,current:g}})),w=new he;return{set:l,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(c(),g),advance:(g,S)=>e(g,S,c()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new i_,pointer:w,mouse:w,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=c();v&&clearTimeout(v),g.performance.current!==g.performance.min&&_(g.performance.min),v=setTimeout(()=>_(c().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:m},setEvents:g=>l(S=>({...S,events:{...S.events,...g}})),setSize:(g,S,M,T,P)=>{const C=c().camera,L={width:g,height:S,top:T||0,left:P||0,updateStyle:M};l(z=>({size:L,viewport:{...z.viewport,...m(C,h,L)}}))},setDpr:g=>l(S=>{const M=R4(g);return{viewport:{...S.viewport,dpr:M,initialDpr:S.viewport.initialDpr||M}}}),setFrameloop:(g="always")=>{const S=c().clock;S.stop(),S.elapsedTime=0,g!=="never"&&(S.start(),S.elapsedTime=0),l(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:be.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,S,M)=>{const T=c().internal;return T.priority=T.priority+(S>0?1:0),T.subscribers.push({ref:g,priority:S,store:M}),T.subscribers=T.subscribers.sort((P,C)=>P.priority-C.priority),()=>{const P=c().internal;P!=null&&P.subscribers&&(P.priority=P.priority-(S>0?1:0),P.subscribers=P.subscribers.filter(C=>C.ref!==g))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:l,size:c,viewport:f,gl:h,set:d}=t.getState();if(c.width!==r.width||c.height!==r.height||f.dpr!==s){var m;r=c,s=f.dpr,ND(l,c),h.setPixelRatio(f.dpr);const v=(m=c.updateStyle)!=null?m:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(c.width,c.height,v)}l!==o&&(o=l,d(v=>({viewport:{...v.viewport,...v.viewport.getCurrentViewport(l)}})))}),t.subscribe(l=>n(l)),t};let xd,FD=new Set,kD=new Set,BD=new Set;function Ng(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function ju(n,e){switch(n){case"before":return Ng(FD,e);case"after":return Ng(kD,e);case"tail":return Ng(BD,e)}}let Dg,Ug;function zg(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Dg=e.internal.subscribers,xd=0;xd0)&&!((f=r.gl.xr)!=null&&f.isPresenting)&&(t+=zg(c,r))}if(ju("after",c),t===0)return ju("tail",c),e=!1,cancelAnimationFrame(i)}function o(c,f=1){var h;if(!c)return n.forEach(d=>o(d.store.getState()),f);(h=c.gl.xr)!=null&&h.isPresenting||!c.internal.active||c.frameloop==="never"||(c.internal.frames=Math.min(60,c.internal.frames+f),e||(e=!0,requestAnimationFrame(s)))}function l(c,f=!0,h,d){if(f&&ju("before",c),h)zg(c,h,d);else for(const m of n.values())zg(c,m.store.getState());f&&ju("after",c)}return{loop:s,invalidate:o,advance:l}}function D4(){const n=be.useContext(N4);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function ki(n=t=>t,e){return D4()(n,e)}function l_(n,e=0){const t=D4(),i=t.getState().internal.subscribe,r=A4(n);return pf(()=>i(r,e,t),[e,i,t]),null}const Kl=new Map,{invalidate:z3,advance:O3}=HD(Kl),{reconciler:xp,applyProps:cl}=CD(Kl,DD),fl={objects:"shallow",strict:!1},VD=(n,e)=>{const t=typeof n=="function"?n(e):n;return I4(t)?t:new By({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function GD(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:l=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:l}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function WD(n){const e=Kl.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||OD(z3,O3),o=t||xp.createContainer(s,Ll.ConcurrentRoot,null,!1,null,"",r,null);e||Kl.set(n,{fiber:o,store:s});let l,c=!1,f;return{configure(h={}){let{gl:d,size:m,scene:v,events:_,onCreated:w,shadows:x=!1,linear:g=!1,flat:S=!1,legacy:M=!1,orthographic:T=!1,frameloop:P="always",dpr:C=[1,2],performance:L,raycaster:z,camera:b,onPointerMissed:R}=h,B=s.getState(),Z=B.gl;B.gl||B.set({gl:Z=VD(d,n)});let le=B.raycaster;le||B.set({raycaster:le=new y4});const{params:G,...Q}=z||{};if(Jt.equ(Q,le,fl)||cl(le,{...Q}),Jt.equ(G,le.params,fl)||cl(le,{params:{...le.params,...G}}),!B.camera||B.camera===f&&!Jt.equ(f,b,fl)){f=b;const J=b instanceof of,K=J?b:T?new vs(0,0,0,0,.1,1e3):new hn(75,0,.1,1e3);J||(K.position.z=5,b&&cl(K,b),!B.camera&&!(b!=null&&b.rotation)&&K.lookAt(0,0,0)),B.set({camera:K}),le.camera=K}if(!B.scene){let J;v instanceof yp?J=v:(J=new yp,v&&cl(J,v)),B.set({scene:hl(J)})}if(!B.xr){var te;const J=(ge,Ae)=>{const Ce=s.getState();Ce.frameloop!=="never"&&O3(ge,!0,Ce,Ae)},K=()=>{const ge=s.getState();ge.gl.xr.enabled=ge.gl.xr.isPresenting,ge.gl.xr.setAnimationLoop(ge.gl.xr.isPresenting?J:null),ge.gl.xr.isPresenting||z3(ge)},ae={connect(){const ge=s.getState().gl;ge.xr.addEventListener("sessionstart",K),ge.xr.addEventListener("sessionend",K)},disconnect(){const ge=s.getState().gl;ge.xr.removeEventListener("sessionstart",K),ge.xr.removeEventListener("sessionend",K)}};typeof((te=Z.xr)==null?void 0:te.addEventListener)=="function"&&ae.connect(),B.set({xr:ae})}if(Z.shadowMap){const J=Z.shadowMap.enabled,K=Z.shadowMap.type;if(Z.shadowMap.enabled=!!x,Jt.boo(x))Z.shadowMap.type=ac;else if(Jt.str(x)){var ce;const ae={basic:cE,percentage:Fp,soft:ac,variance:xr};Z.shadowMap.type=(ce=ae[x])!=null?ce:ac}else Jt.obj(x)&&Object.assign(Z.shadowMap,x);(J!==Z.shadowMap.enabled||K!==Z.shadowMap.type)&&(Z.shadowMap.needsUpdate=!0)}const N=E4();N&&("enabled"in N?N.enabled=!M:"legacyMode"in N&&(N.legacyMode=M)),cl(Z,{outputEncoding:g?3e3:3001,toneMapping:S?Xr:xy}),B.legacy!==M&&B.set(()=>({legacy:M})),B.linear!==g&&B.set(()=>({linear:g})),B.flat!==S&&B.set(()=>({flat:S})),d&&!Jt.fun(d)&&!I4(d)&&!Jt.equ(d,Z,fl)&&cl(Z,d),_&&!B.events.handlers&&B.set({events:_(s)});const q=GD(n,m);return Jt.equ(q,B.size,fl)||B.setSize(q.width,q.height,q.updateStyle,q.top,q.left),C&&B.viewport.dpr!==R4(C)&&B.setDpr(C),B.frameloop!==P&&B.setFrameloop(P),B.onPointerMissed||B.set({onPointerMissed:R}),L&&!Jt.equ(L,B.performance,fl)&&B.set(J=>({performance:{...J.performance,...L}})),l=w,c=!0,this},render(h){return c||this.configure(),xp.updateContainer(be.createElement(XD,{store:s,children:h,onCreated:l,rootElement:n}),o,null,()=>{}),s},unmount(){U4(n)}}}function XD({store:n,children:e,onCreated:t,rootElement:i}){return pf(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),be.createElement(N4.Provider,{value:n},e)}function U4(n,e){const t=Kl.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),xp.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,l,c;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(l=r.gl)==null||l.forceContextLoss==null||l.forceContextLoss(),(c=r.gl)!=null&&c.xr&&r.xr.disconnect(),LD(r),Kl.delete(n),e&&e(n)}catch{}},500)})}}xp.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:be.version});function Jl(){return Jl=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(c,e-h):(i=null,t||(l=n.apply(s,r),s=r=null))}var f=function(){s=this,r=arguments,o=Date.now();var h=t&&!i;return i||(i=setTimeout(c,e)),h&&(l=n.apply(s,r),s=r=null),l};return f.clear=function(){i&&(clearTimeout(i),i=null)},f.flush=function(){i&&(l=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},f}Ev.debounce=Ev;var jD=Ev;const F3=Tv(jD);function YD(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)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[o,l]=be.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=be.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,h=e?typeof e=="number"?e:e.resize:null,d=be.useRef(!1);be.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[m,v,_]=be.useMemo(()=>{const S=()=>{if(!c.current.element)return;const{left:M,top:T,width:P,height:C,bottom:L,right:z,x:b,y:R}=c.current.element.getBoundingClientRect(),B={left:M,top:T,width:P,height:C,bottom:L,right:z,x:b,y:R};c.current.element instanceof HTMLElement&&r&&(B.height=c.current.element.offsetHeight,B.width=c.current.element.offsetWidth),Object.freeze(B),d.current&&!JD(c.current.lastBounds,B)&&l(c.current.lastBounds=B)};return[S,h?F3(S,h):S,f?F3(S,f):S]},[l,r,f,h]);function w(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",_,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function x(){c.current.element&&(c.current.resizeObserver=new s(_),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(S=>S.addEventListener("scroll",_,{capture:!0,passive:!0})))}const g=S=>{!S||S===c.current.element||(w(),c.current.element=S,c.current.scrollContainers=z4(S),x())};return ZD(_,!!t),qD(v),be.useEffect(()=>{w(),x()},[t,_,v]),be.useEffect(()=>w,[]),[g,o,m]}function qD(n){be.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function ZD(n,e){be.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function z4(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...z4(n.parentElement)]}const KD=["x","y","top","bottom","left","right","width","height"],JD=(n,e)=>KD.every(t=>n[t]===e[t]);var QD=Object.defineProperty,$D=Object.defineProperties,e7=Object.getOwnPropertyDescriptors,k3=Object.getOwnPropertySymbols,t7=Object.prototype.hasOwnProperty,n7=Object.prototype.propertyIsEnumerable,B3=(n,e,t)=>e in n?QD(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,H3=(n,e)=>{for(var t in e||(e={}))t7.call(e,t)&&B3(n,t,e[t]);if(k3)for(var t of k3(e))n7.call(e,t)&&B3(n,t,e[t]);return n},i7=(n,e)=>$D(n,e7(e));function O4(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=O4(i,e,t);if(r)return r;i=e?null:i.sibling}}function F4(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const u_=F4(be.createContext(null));class k4 extends be.Component{render(){return be.createElement(u_.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:V3,ReactCurrentDispatcher:G3}=be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r7(){const n=be.useContext(u_);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=be.useId();return be.useMemo(()=>{for(const i of[V3==null?void 0:V3.current,n,n==null?void 0:n.alternate]){if(!i)continue;const r=O4(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function s7(){var n,e;const t=r7(),[i]=be.useState(()=>new Map);i.clear();let r=t;for(;r;){const s=(n=r.type)==null?void 0:n._context;s&&s!==u_&&!i.has(s)&&i.set(s,(e=G3==null?void 0:G3.current)==null?void 0:e.readContext(F4(s))),r=r.return}return i}function o7(){const n=s7();return be.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>be.createElement(e,null,be.createElement(t.Provider,i7(H3({},i),{value:n.get(t)}))),e=>be.createElement(k4,H3({},e))),[n])}const Og={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 a7(n){const{handlePointer:e}=zD(n);return{priority:1,enabled:!0,compute(t,i,r){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(Og).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,l])=>{const[c,f]=Og[o];t.addEventListener(c,l,{passive:f})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[l]=Og[s];i.connected.removeEventListener(l,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const l7=be.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=a7,eventSource:l,eventPrefix:c,shadows:f,linear:h,flat:d,legacy:m,orthographic:v,frameloop:_,dpr:w,performance:x,raycaster:g,camera:S,scene:M,onPointerMissed:T,onCreated:P,...C},L){be.useMemo(()=>AD(vD),[]);const z=o7(),[b,R]=YD({scroll:!0,debounce:{scroll:50,resize:0},...i}),B=be.useRef(null),Z=be.useRef(null);be.useImperativeHandle(L,()=>B.current);const le=A4(T),[G,Q]=be.useState(!1),[te,ce]=be.useState(!1);if(G)throw G;if(te)throw te;const N=be.useRef(null);pf(()=>{const H=B.current;R.width>0&&R.height>0&&H&&(N.current||(N.current=WD(H)),N.current.configure({gl:s,events:o,shadows:f,linear:h,flat:d,legacy:m,orthographic:v,frameloop:_,dpr:w,performance:x,raycaster:g,camera:S,scene:M,size:R,onPointerMissed:(...q)=>le.current==null?void 0:le.current(...q),onCreated:q=>{q.events.connect==null||q.events.connect(l?bD(l)?l.current:l:Z.current),c&&q.setEvents({compute:(J,K)=>{const ae=J[c+"X"],ge=J[c+"Y"];K.pointer.set(ae/K.size.width*2-1,-(ge/K.size.height)*2+1),K.raycaster.setFromCamera(K.pointer,K.camera)}}),P==null||P(q)}}),N.current.render(be.createElement(z,null,be.createElement(C4,{set:ce},be.createElement(be.Suspense,{fallback:be.createElement(RD,{set:Q})},e)))))}),be.useEffect(()=>{const H=B.current;if(H)return()=>U4(H)},[]);const k=l?"none":"auto";return be.createElement("div",Jl({ref:Z,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:k,...r}},C),be.createElement("div",{ref:b,style:{width:"100%",height:"100%"}},be.createElement("canvas",{ref:B,style:{display:"block"}},t)))}),u7=be.forwardRef(function(e,t){return be.createElement(k4,null,be.createElement(l7,Jl({},e,{ref:t})))}),c7="/my-portfolio/assets/moon-EUT5YxWH.jpg",f7="/my-portfolio/assets/normal-J2JQSlYj.jpg";function h7(){const n=new yv().load(c7);new yv().load(f7);const e=be.useRef();return l_(()=>{e.current.rotation.y+=.002}),we.jsxs("mesh",{ref:e,children:[we.jsx("sphereGeometry",{args:[3,64,64]}),we.jsx("meshStandardMaterial",{map:n})]})}function d7(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var p7=Object.defineProperty,m7=(n,e,t)=>e in n?p7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ct=(n,e,t)=>(m7(n,typeof e!="symbol"?e+"":e,t),t);const Sd=new Sa,W3=new hs,g7=Math.cos(70*(Math.PI/180)),X3=(n,e)=>(n%e+e)%e;let v7=class extends Kr{constructor(e,t){super(),ct(this,"object"),ct(this,"domElement"),ct(this,"enabled",!0),ct(this,"target",new O),ct(this,"minDistance",0),ct(this,"maxDistance",1/0),ct(this,"minZoom",0),ct(this,"maxZoom",1/0),ct(this,"minPolarAngle",0),ct(this,"maxPolarAngle",Math.PI),ct(this,"minAzimuthAngle",-1/0),ct(this,"maxAzimuthAngle",1/0),ct(this,"enableDamping",!1),ct(this,"dampingFactor",.05),ct(this,"enableZoom",!0),ct(this,"zoomSpeed",1),ct(this,"enableRotate",!0),ct(this,"rotateSpeed",1),ct(this,"enablePan",!0),ct(this,"panSpeed",1),ct(this,"screenSpacePanning",!0),ct(this,"keyPanSpeed",7),ct(this,"zoomToCursor",!1),ct(this,"autoRotate",!1),ct(this,"autoRotateSpeed",2),ct(this,"reverseOrbit",!1),ct(this,"reverseHorizontalOrbit",!1),ct(this,"reverseVerticalOrbit",!1),ct(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ct(this,"mouseButtons",{LEFT:Xo.ROTATE,MIDDLE:Xo.DOLLY,RIGHT:Xo.PAN}),ct(this,"touches",{ONE:jo.ROTATE,TWO:jo.DOLLY_PAN}),ct(this,"target0"),ct(this,"position0"),ct(this,"zoom0"),ct(this,"_domElementKeyEvents",null),ct(this,"getPolarAngle"),ct(this,"getAzimuthalAngle"),ct(this,"setPolarAngle"),ct(this,"setAzimuthalAngle"),ct(this,"getDistance"),ct(this,"listenToKeyEvents"),ct(this,"stopListenToKeyEvents"),ct(this,"saveState"),ct(this,"reset"),ct(this,"update"),ct(this,"connect"),ct(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=X=>{let pe=X3(X,2*Math.PI),Oe=h.phi;Oe<0&&(Oe+=2*Math.PI),pe<0&&(pe+=2*Math.PI);let Ue=Math.abs(pe-Oe);2*Math.PI-Ue{let pe=X3(X,2*Math.PI),Oe=h.theta;Oe<0&&(Oe+=2*Math.PI),pe<0&&(pe+=2*Math.PI);let Ue=Math.abs(pe-Oe);2*Math.PI-Uei.object.position.distanceTo(i.target),this.listenToKeyEvents=X=>{X.addEventListener("keydown",tt),this._domElementKeyEvents=X},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",tt),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),c=l.NONE},this.update=(()=>{const X=new O,pe=new O(0,1,0),Oe=new ri().setFromUnitVectors(e.up,pe),Ue=Oe.clone().invert(),xe=new O,W=new ri,Re=2*Math.PI;return function(){const nt=i.object.position;Oe.setFromUnitVectors(e.up,pe),Ue.copy(Oe).invert(),X.copy(nt).sub(i.target),X.applyQuaternion(Oe),h.setFromVector3(X),i.autoRotate&&c===l.NONE&&G(Z()),i.enableDamping?(h.theta+=d.theta*i.dampingFactor,h.phi+=d.phi*i.dampingFactor):(h.theta+=d.theta,h.phi+=d.phi);let Ye=i.minAzimuthAngle,At=i.maxAzimuthAngle;isFinite(Ye)&&isFinite(At)&&(Ye<-Math.PI?Ye+=Re:Ye>Math.PI&&(Ye-=Re),At<-Math.PI?At+=Re:At>Math.PI&&(At-=Re),Ye<=At?h.theta=Math.max(Ye,Math.min(At,h.theta)):h.theta=h.theta>(Ye+At)/2?Math.max(Ye,h.theta):Math.min(At,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(v,i.dampingFactor):i.target.add(v),i.zoomToCursor&&b||i.object.isOrthographicCamera?h.radius=J(h.radius):h.radius=J(h.radius*m),X.setFromSpherical(h),X.applyQuaternion(Ue),nt.copy(i.target).add(X),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,v.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),v.set(0,0,0));let Rt=!1;if(i.zoomToCursor&&b){let Vt=null;if(i.object instanceof hn&&i.object.isPerspectiveCamera){const Zt=X.length();Vt=J(Zt*m);const Pt=Zt-Vt;i.object.position.addScaledVector(L,Pt),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const Zt=new O(z.x,z.y,0);Zt.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/m)),i.object.updateProjectionMatrix(),Rt=!0;const Pt=new O(z.x,z.y,0);Pt.unproject(i.object),i.object.position.sub(Pt).add(Zt),i.object.updateMatrixWorld(),Vt=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Vt!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Vt).add(i.object.position):(Sd.origin.copy(i.object.position),Sd.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Sd.direction))f||8*(1-W.dot(i.object.quaternion))>f?(i.dispatchEvent(r),xe.copy(i.object.position),W.copy(i.object.quaternion),Rt=!1,!0):!1}})(),this.connect=X=>{X===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=X,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Ct),i.domElement.addEventListener("pointerdown",ee),i.domElement.addEventListener("pointercancel",me),i.domElement.addEventListener("wheel",Fe)},this.dispose=()=>{var X,pe,Oe,Ue,xe,W;(X=i.domElement)==null||X.removeEventListener("contextmenu",Ct),(pe=i.domElement)==null||pe.removeEventListener("pointerdown",ee),(Oe=i.domElement)==null||Oe.removeEventListener("pointercancel",me),(Ue=i.domElement)==null||Ue.removeEventListener("wheel",Fe),(xe=i.domElement)==null||xe.ownerDocument.removeEventListener("pointermove",ye),(W=i.domElement)==null||W.ownerDocument.removeEventListener("pointerup",ve),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",tt)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},l={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=l.NONE;const f=1e-6,h=new Sv,d=new Sv;let m=1;const v=new O,_=new he,w=new he,x=new he,g=new he,S=new he,M=new he,T=new he,P=new he,C=new he,L=new O,z=new he;let b=!1;const R=[],B={};function Z(){return 2*Math.PI/60/60*i.autoRotateSpeed}function le(){return Math.pow(.95,i.zoomSpeed)}function G(X){i.reverseOrbit||i.reverseHorizontalOrbit?d.theta+=X:d.theta-=X}function Q(X){i.reverseOrbit||i.reverseVerticalOrbit?d.phi+=X:d.phi-=X}const te=(()=>{const X=new O;return function(Oe,Ue){X.setFromMatrixColumn(Ue,0),X.multiplyScalar(-Oe),v.add(X)}})(),ce=(()=>{const X=new O;return function(Oe,Ue){i.screenSpacePanning===!0?X.setFromMatrixColumn(Ue,1):(X.setFromMatrixColumn(Ue,0),X.crossVectors(i.object.up,X)),X.multiplyScalar(Oe),v.add(X)}})(),N=(()=>{const X=new O;return function(Oe,Ue){const xe=i.domElement;if(xe&&i.object instanceof hn&&i.object.isPerspectiveCamera){const W=i.object.position;X.copy(W).sub(i.target);let Re=X.length();Re*=Math.tan(i.object.fov/2*Math.PI/180),te(2*Oe*Re/xe.clientHeight,i.object.matrix),ce(2*Ue*Re/xe.clientHeight,i.object.matrix)}else xe&&i.object instanceof vs&&i.object.isOrthographicCamera?(te(Oe*(i.object.right-i.object.left)/i.object.zoom/xe.clientWidth,i.object.matrix),ce(Ue*(i.object.top-i.object.bottom)/i.object.zoom/xe.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function k(X){i.object instanceof hn&&i.object.isPerspectiveCamera||i.object instanceof vs&&i.object.isOrthographicCamera?m/=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function H(X){i.object instanceof hn&&i.object.isPerspectiveCamera||i.object instanceof vs&&i.object.isOrthographicCamera?m*=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function q(X){if(!i.zoomToCursor||!i.domElement)return;b=!0;const pe=i.domElement.getBoundingClientRect(),Oe=X.clientX-pe.left,Ue=X.clientY-pe.top,xe=pe.width,W=pe.height;z.x=Oe/xe*2-1,z.y=-(Ue/W)*2+1,L.set(z.x,z.y,1).unproject(i.object).sub(i.object.position).normalize()}function J(X){return Math.max(i.minDistance,Math.min(i.maxDistance,X))}function K(X){_.set(X.clientX,X.clientY)}function ae(X){q(X),T.set(X.clientX,X.clientY)}function ge(X){g.set(X.clientX,X.clientY)}function Ae(X){w.set(X.clientX,X.clientY),x.subVectors(w,_).multiplyScalar(i.rotateSpeed);const pe=i.domElement;pe&&(G(2*Math.PI*x.x/pe.clientHeight),Q(2*Math.PI*x.y/pe.clientHeight)),_.copy(w),i.update()}function Ce(X){P.set(X.clientX,X.clientY),C.subVectors(P,T),C.y>0?k(le()):C.y<0&&H(le()),T.copy(P),i.update()}function rt(X){S.set(X.clientX,X.clientY),M.subVectors(S,g).multiplyScalar(i.panSpeed),N(M.x,M.y),g.copy(S),i.update()}function lt(X){q(X),X.deltaY<0?H(le()):X.deltaY>0&&k(le()),i.update()}function Xe(X){let pe=!1;switch(X.code){case i.keys.UP:N(0,i.keyPanSpeed),pe=!0;break;case i.keys.BOTTOM:N(0,-i.keyPanSpeed),pe=!0;break;case i.keys.LEFT:N(i.keyPanSpeed,0),pe=!0;break;case i.keys.RIGHT:N(-i.keyPanSpeed,0),pe=!0;break}pe&&(X.preventDefault(),i.update())}function Ke(){if(R.length==1)_.set(R[0].pageX,R[0].pageY);else{const X=.5*(R[0].pageX+R[1].pageX),pe=.5*(R[0].pageY+R[1].pageY);_.set(X,pe)}}function V(){if(R.length==1)g.set(R[0].pageX,R[0].pageY);else{const X=.5*(R[0].pageX+R[1].pageX),pe=.5*(R[0].pageY+R[1].pageY);g.set(X,pe)}}function Se(){const X=R[0].pageX-R[1].pageX,pe=R[0].pageY-R[1].pageY,Oe=Math.sqrt(X*X+pe*pe);T.set(0,Oe)}function de(){i.enableZoom&&Se(),i.enablePan&&V()}function Ee(){i.enableZoom&&Se(),i.enableRotate&&Ke()}function fe(X){if(R.length==1)w.set(X.pageX,X.pageY);else{const Oe=He(X),Ue=.5*(X.pageX+Oe.x),xe=.5*(X.pageY+Oe.y);w.set(Ue,xe)}x.subVectors(w,_).multiplyScalar(i.rotateSpeed);const pe=i.domElement;pe&&(G(2*Math.PI*x.x/pe.clientHeight),Q(2*Math.PI*x.y/pe.clientHeight)),_.copy(w)}function Ze(X){if(R.length==1)S.set(X.pageX,X.pageY);else{const pe=He(X),Oe=.5*(X.pageX+pe.x),Ue=.5*(X.pageY+pe.y);S.set(Oe,Ue)}M.subVectors(S,g).multiplyScalar(i.panSpeed),N(M.x,M.y),g.copy(S)}function Ne(X){const pe=He(X),Oe=X.pageX-pe.x,Ue=X.pageY-pe.y,xe=Math.sqrt(Oe*Oe+Ue*Ue);P.set(0,xe),C.set(0,Math.pow(P.y/T.y,i.zoomSpeed)),k(C.y),T.copy(P)}function D(X){i.enableZoom&&Ne(X),i.enablePan&&Ze(X)}function I(X){i.enableZoom&&Ne(X),i.enableRotate&&fe(X)}function ee(X){var pe,Oe;i.enabled!==!1&&(R.length===0&&((pe=i.domElement)==null||pe.ownerDocument.addEventListener("pointermove",ye),(Oe=i.domElement)==null||Oe.ownerDocument.addEventListener("pointerup",ve)),yt(X),X.pointerType==="touch"?dt(X):je(X))}function ye(X){i.enabled!==!1&&(X.pointerType==="touch"?_e(X):Le(X))}function ve(X){var pe,Oe,Ue;ut(X),R.length===0&&((pe=i.domElement)==null||pe.releasePointerCapture(X.pointerId),(Oe=i.domElement)==null||Oe.ownerDocument.removeEventListener("pointermove",ye),(Ue=i.domElement)==null||Ue.ownerDocument.removeEventListener("pointerup",ve)),i.dispatchEvent(o),c=l.NONE}function me(X){ut(X)}function je(X){let pe;switch(X.button){case 0:pe=i.mouseButtons.LEFT;break;case 1:pe=i.mouseButtons.MIDDLE;break;case 2:pe=i.mouseButtons.RIGHT;break;default:pe=-1}switch(pe){case Xo.DOLLY:if(i.enableZoom===!1)return;ae(X),c=l.DOLLY;break;case Xo.ROTATE:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enablePan===!1)return;ge(X),c=l.PAN}else{if(i.enableRotate===!1)return;K(X),c=l.ROTATE}break;case Xo.PAN:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enableRotate===!1)return;K(X),c=l.ROTATE}else{if(i.enablePan===!1)return;ge(X),c=l.PAN}break;default:c=l.NONE}c!==l.NONE&&i.dispatchEvent(s)}function Le(X){if(i.enabled!==!1)switch(c){case l.ROTATE:if(i.enableRotate===!1)return;Ae(X);break;case l.DOLLY:if(i.enableZoom===!1)return;Ce(X);break;case l.PAN:if(i.enablePan===!1)return;rt(X);break}}function Fe(X){i.enabled===!1||i.enableZoom===!1||c!==l.NONE&&c!==l.ROTATE||(X.preventDefault(),i.dispatchEvent(s),lt(X),i.dispatchEvent(o))}function tt(X){i.enabled===!1||i.enablePan===!1||Xe(X)}function dt(X){switch(et(X),R.length){case 1:switch(i.touches.ONE){case jo.ROTATE:if(i.enableRotate===!1)return;Ke(),c=l.TOUCH_ROTATE;break;case jo.PAN:if(i.enablePan===!1)return;V(),c=l.TOUCH_PAN;break;default:c=l.NONE}break;case 2:switch(i.touches.TWO){case jo.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;de(),c=l.TOUCH_DOLLY_PAN;break;case jo.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Ee(),c=l.TOUCH_DOLLY_ROTATE;break;default:c=l.NONE}break;default:c=l.NONE}c!==l.NONE&&i.dispatchEvent(s)}function _e(X){switch(et(X),c){case l.TOUCH_ROTATE:if(i.enableRotate===!1)return;fe(X),i.update();break;case l.TOUCH_PAN:if(i.enablePan===!1)return;Ze(X),i.update();break;case l.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;D(X),i.update();break;case l.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;I(X),i.update();break;default:c=l.NONE}}function Ct(X){i.enabled!==!1&&X.preventDefault()}function yt(X){R.push(X)}function ut(X){delete B[X.pointerId];for(let pe=0;pem.size),r=ki(m=>m.viewport),s=typeof n=="number"?n:i.width*r.dpr,o=typeof e=="number"?e:i.height*r.dpr,l=(typeof n=="number"?t:n)||{},{samples:c=0,depth:f,...h}=l,d=be.useMemo(()=>{const m=new hr(s,o,{minFilter:nn,magFilter:nn,type:ma,...h});return f&&(m.depthTexture=new Wp(s,o,lr)),m.samples=c,m},[]);return be.useLayoutEffect(()=>{d.setSize(s,o),c&&(d.samples=c)},[c,d,s,o]),be.useEffect(()=>()=>d.dispose(),[]),d}const _7=n=>typeof n=="function",x7=be.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:i,children:r,...s},o)=>{const l=ki(({set:x})=>x),c=ki(({camera:x})=>x),f=ki(({size:x})=>x),h=be.useRef(null),d=be.useRef(null),m=y7(e);be.useLayoutEffect(()=>{s.manual||(h.current.aspect=f.width/f.height)},[f,s]),be.useLayoutEffect(()=>{h.current.updateProjectionMatrix()});let v=0,_=null;const w=_7(r);return l_(x=>{w&&(t===1/0||v{if(i){const x=c;return l(()=>({camera:h.current})),()=>l(()=>({camera:x}))}},[h,i,l]),be.createElement(be.Fragment,null,be.createElement("perspectiveCamera",Jl({ref:d7([h,o])},s),!w&&r),be.createElement("group",{ref:d},w&&r(m.texture)))}),S7=be.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:l,onEnd:c,...f},h)=>{const d=ki(C=>C.invalidate),m=ki(C=>C.camera),v=ki(C=>C.gl),_=ki(C=>C.events),w=ki(C=>C.setEvents),x=ki(C=>C.set),g=ki(C=>C.get),S=ki(C=>C.performance),M=e||m,T=i||_.connected||v.domElement,P=be.useMemo(()=>new v7(M),[M]);return l_(()=>{P.enabled&&P.update()},-1),be.useEffect(()=>(s&&P.connect(s===!0?T:s),P.connect(T),()=>void P.dispose()),[s,T,t,P,d]),be.useEffect(()=>{const C=b=>{d(),t&&S.regress(),o&&o(b)},L=b=>{l&&l(b)},z=b=>{c&&c(b)};return P.addEventListener("change",C),P.addEventListener("start",L),P.addEventListener("end",z),()=>{P.removeEventListener("start",L),P.removeEventListener("end",z),P.removeEventListener("change",C)}},[o,l,c,P,d,w]),be.useEffect(()=>{if(n){const C=g().controls;return x({controls:P}),()=>x({controls:C})}},[n,P]),be.createElement("primitive",Jl({ref:h,object:P,enableDamping:r},f))}),ti=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let j3=1234567;const B4=Math.PI/180,H4=180/Math.PI;function M7(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(ti[n&255]+ti[n>>8&255]+ti[n>>16&255]+ti[n>>24&255]+"-"+ti[e&255]+ti[e>>8&255]+"-"+ti[e>>16&15|64]+ti[e>>24&255]+"-"+ti[t&63|128]+ti[t>>8&255]+"-"+ti[t>>16&255]+ti[t>>24&255]+ti[i&255]+ti[i>>8&255]+ti[i>>16&255]+ti[i>>24&255]).toLowerCase()}function w7(n,e,t){return Math.max(e,Math.min(t,n))}function V4(n,e){return(n%e+e)%e}function E7(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function T7(n,e,t){return n!==e?(t-n)/(e-n):0}function G4(n,e,t){return(1-t)*n+t*e}function A7(n,e,t,i){return G4(n,e,1-Math.exp(-t*i))}function C7(n,e=1){return e-Math.abs(V4(n,e*2)-e)}function b7(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function R7(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function P7(n,e){return n+Math.floor(Math.random()*(e-n+1))}function L7(n,e){return n+Math.random()*(e-n)}function I7(n){return n*(.5-Math.random())}function N7(n){n!==void 0&&(j3=n);let e=j3+=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 D7(n){return n*B4}function U7(n){return n*H4}function z7(n){return(n&n-1)===0&&n!==0}function O7(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function F7(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function k7(n,e,t,i,r){const s=Math.cos,o=Math.sin,l=s(t/2),c=o(t/2),f=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),m=o((e-i)/2),v=s((i-e)/2),_=o((i-e)/2);switch(r){case"XYX":n.set(l*h,c*d,c*m,l*f);break;case"YZY":n.set(c*m,l*h,c*d,l*f);break;case"ZXZ":n.set(c*d,c*m,l*h,l*f);break;case"XZX":n.set(l*h,c*_,c*v,l*f);break;case"YXY":n.set(c*v,l*h,c*_,l*f);break;case"ZYZ":n.set(c*_,c*v,l*h,l*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function B7(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function H7(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const V7={DEG2RAD:B4,RAD2DEG:H4,generateUUID:M7,clamp:w7,euclideanModulo:V4,mapLinear:E7,inverseLerp:T7,lerp:G4,damp:A7,pingpong:C7,smoothstep:b7,smootherstep:R7,randInt:P7,randFloat:L7,randFloatSpread:I7,seededRandom:N7,degToRad:D7,radToDeg:U7,isPowerOfTwo:z7,ceilPowerOfTwo:O7,floorPowerOfTwo:F7,setQuaternionFromProperEuler:k7,normalize:H7,denormalize:B7};function G7(){const n=Array(3).fill().map(()=>V7.randFloatSpread(200));return we.jsxs("mesh",{position:n,children:[we.jsx("sphereGeometry",{args:[.25,24,24]}),we.jsx("meshBasicMaterial",{color:"#ffffff"})]})}function W7(){return we.jsxs(u7,{children:[we.jsx(x7,{makeDefault:!0,fov:50,position:[0,0,10]}),we.jsx("color",{args:[0,0,0],attach:"background"}),we.jsx("ambientLight",{intensity:.5}),we.jsx("pointLight",{position:[-5,1.5,5],angle:.5,intensity:200}),we.jsx(h7,{}),we.jsx(S7,{enableZoom:!1,enableDamping:!0,autoRotate:!0,autoRotateSpeed:.4}),Array(200).fill().map((n,e)=>we.jsx(G7,{},e))]})}const X7="/my-portfolio/assets/SitePhoto-ttmvt0EA.jpg";function j7(){return we.jsx("div",{className:"bg-blue-950",children:we.jsxs("div",{className:"p-8 flex flex-col md:flex-row justify-around container mx-auto",children:[we.jsxs("div",{className:"flex-1 justify-center",children:[we.jsx("h2",{className:"text-3xl font-bold mb-4 text-white",children:"About Me"}),we.jsx("p",{className:"text-gray-200 mx-auto",children:"Hi there! I'm Abhinav Choudhary, a passionate developer who loves creating awesome web applications. I have experience with front-end technologies like React and enjoy exploring new technologies to enhance my skillss."}),we.jsx("p",{className:"text-gray-200 mt-2",children:"In my free time, I enjoy solving coding challenges, making games, and staying up-to-date with the latest trends in the tech world."})]}),we.jsx("div",{className:"flex-1 flex justify-center items-center",children:we.jsx("img",{src:X7,alt:"Avatar",className:"rounded-full object-cover w-full md:w-64 h-auto my-2 md:mb-0",style:{boxShadow:"0 4px 8px rgba(255, 255, 255, 0.7)"}})})]})})}function Y7(n){return Ht({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M243.583 91.6027L323.695 138.384C326.575 140.026 326.68 144.583 323.695 146.225L228.503 201.854C225.623 203.55 222.22 203.444 219.549 201.854L124.357 146.225C121.425 144.636 121.373 139.973 124.357 138.384L204.417 91.6027V0L0 119.417V358.252L78.3843 312.477V218.914C78.3319 215.576 82.2066 213.192 85.0865 214.993L180.279 270.622C183.159 272.318 184.782 275.338 184.782 278.464V389.669C184.834 393.007 180.959 395.391 178.079 393.589L97.9673 346.808L19.583 392.583L224 512L428.417 392.583L350.033 346.808L269.921 393.589C267.093 395.338 263.114 393.06 263.218 389.669V278.464C263.218 275.126 265.051 272.159 267.721 270.622L362.914 214.993C365.741 213.245 369.72 215.47 369.616 218.914V312.477L448 358.252V119.417L243.583 0V91.6027Z"},child:[]}]})(n)}function q7(n){return Ht({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 32v448h448V32zm240 348c0 43.61-25.76 64.87-63.05 64.87-33.68 0-53.23-17.44-63.15-38.49l34.28-20.75c6.61 11.73 11.63 21.65 26.06 21.65 12 0 21.86-5.41 21.86-26.46V240h44zm99.35 63.87c-39.09 0-64.35-17.64-76.68-42L329 382c9 14.74 20.75 24.56 41.5 24.56 17.44 0 27.57-7.72 27.57-19.75 0-14.43-10.43-19.54-29.68-28l-10.52-4.52c-30.38-12.92-50.52-29.16-50.52-63.45 0-31.57 24.05-54.63 61.64-54.63 26.77 0 46 8.32 59.85 32.68L396 290c-7.22-12.93-15-18-27.06-18-12.33 0-20.15 7.82-20.15 18 0 12.63 7.82 17.74 25.86 25.56l10.52 4.51c35.79 15.34 55.94 31 55.94 66.16.01 37.9-29.76 57.64-69.76 57.64z"},child:[]}]})(n)}function Z7(n){return Ht({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.281 11.156a.84.84 0 0 1 .375.297c.084.125.143.276.18.453.02.104.044.2.07.29a1.772 1.772 0 0 0 .219.476c.047.073.11.153.188.242.067.073.127.167.18.281a.793.793 0 0 1 .077.328.49.49 0 0 1-.093.305.944.944 0 0 1-.235.219c-.12.083-.245.156-.375.219-.13.062-.26.127-.39.195a3.624 3.624 0 0 0-.555.328c-.156.115-.313.26-.469.438a2.815 2.815 0 0 1-.625.523 1.471 1.471 0 0 1-.383.172c-.13.036-.26.06-.39.07-.302 0-.552-.052-.75-.156-.198-.104-.37-.294-.516-.57-.042-.079-.083-.128-.125-.149a.774.774 0 0 0-.203-.055L8.67 15c-.26-.02-.525-.031-.796-.031a4.28 4.28 0 0 0-.672.054c-.229.037-.456.081-.68.133-.046.01-.093.05-.14.117a1.7 1.7 0 0 1-.196.227 1.106 1.106 0 0 1-.335.219 1.475 1.475 0 0 1-.555.101c-.172 0-.357-.018-.555-.054a1.82 1.82 0 0 1-.531-.18 3.578 3.578 0 0 0-.953-.328c-.313-.057-.643-.11-.992-.156a3.392 3.392 0 0 1-.344-.063.774.774 0 0 1-.29-.133.705.705 0 0 1-.194-.219.78.78 0 0 1-.079-.351c0-.162.021-.318.063-.469.042-.15.065-.31.07-.476 0-.115-.008-.227-.023-.336a3.53 3.53 0 0 1-.032-.352c0-.265.063-.46.188-.586.125-.125.307-.224.547-.297a.99.99 0 0 0 .297-.148 2.27 2.27 0 0 0 .234-.203 1.86 1.86 0 0 0 .203-.242c.063-.089.133-.178.211-.266a.114.114 0 0 0 .024-.07c0-.063-.003-.123-.008-.18l-.016-.188c0-.354.055-.71.164-1.07.11-.36.253-.71.43-1.055a9.08 9.08 0 0 1 .594-.992c.218-.317.435-.612.648-.883a4.35 4.35 0 0 0 .68-1.203c.15-.416.229-.87.234-1.36 0-.207-.01-.413-.031-.616a6.122 6.122 0 0 1-.031-.625c0-.417.047-.792.14-1.125.094-.334.24-.62.438-.86s.456-.419.773-.539C7.474.075 7.854.01 8.296 0c.527 0 .946.104 1.259.313.312.208.552.481.718.82.167.338.274.716.32 1.133.048.416.074.838.079 1.265v.133c0 .214.002.404.008.57a2.527 2.527 0 0 0 .226.977c.073.161.182.336.328.523.25.329.506.66.766.993.26.333.497.677.71 1.03.214.355.389.725.524 1.11.136.386.206.802.211 1.25a3.3 3.3 0 0 1-.164 1.04zm-6.554-8.14c.072 0 .132.018.18.054a.357.357 0 0 1 .109.149.85.85 0 0 1 .054.187c.01.063.016.128.016.196a.282.282 0 0 1-.024.125.27.27 0 0 1-.07.086l-.094.078a.796.796 0 0 0-.093.093.428.428 0 0 1-.149.141 2.129 2.129 0 0 0-.18.117 1.31 1.31 0 0 0-.156.133.264.264 0 0 0-.07.195c0 .047.023.086.07.117a.704.704 0 0 1 .266.305c.052.12.11.237.172.352.062.114.143.21.242.289.099.078.253.117.46.117h.048c.208-.01.406-.065.594-.164.187-.099.375-.203.562-.313a.633.633 0 0 1 .102-.046.37.37 0 0 0 .101-.055l.57-.445a.926.926 0 0 0 .024-.102 2.75 2.75 0 0 0 .016-.11.236.236 0 0 0-.04-.14.4.4 0 0 0-.093-.094.34.34 0 0 0-.133-.054.909.909 0 0 1-.14-.04 1.083 1.083 0 0 1-.352-.14 1.457 1.457 0 0 0-.344-.156c-.02-.006-.036-.021-.047-.047a.983.983 0 0 1-.031-.094.23.23 0 0 1-.008-.102.126.126 0 0 0-.008-.078c0-.062.005-.127.016-.195a.551.551 0 0 1 .07-.195.417.417 0 0 1 .125-.14.411.411 0 0 1 .203-.056c.162 0 .279.06.352.18.073.12.112.25.117.39a.397.397 0 0 1-.039.18.379.379 0 0 0-.04.172c0 .042.014.07.04.086a.26.26 0 0 0 .102.031c.12 0 .197-.028.234-.085a.533.533 0 0 0 .062-.258c0-.12-.01-.253-.03-.399a1.32 1.32 0 0 0-.126-.406.969.969 0 0 0-.242-.313.574.574 0 0 0-.383-.124c-.27 0-.466.067-.586.203-.12.135-.182.338-.187.609 0 .078.005.156.015.234.01.079.016.157.016.235 0 .026-.003.039-.008.039a.218.218 0 0 1-.047-.016 4.263 4.263 0 0 1-.093-.039.774.774 0 0 0-.118-.039.514.514 0 0 0-.203-.008 1.007 1.007 0 0 1-.125.008c-.073 0-.11-.013-.11-.039 0-.078-.004-.177-.015-.297-.01-.12-.036-.24-.078-.36a.995.995 0 0 0-.156-.296c-.063-.078-.156-.12-.281-.125a.323.323 0 0 0-.227.086.905.905 0 0 0-.164.203.64.64 0 0 0-.086.266 5.4 5.4 0 0 1-.031.25 1.459 1.459 0 0 0 .07.406c.026.083.055.156.086.219.031.062.068.093.11.093.025 0 .06-.018.101-.054.042-.037.063-.07.063-.102 0-.016-.008-.026-.024-.031a.147.147 0 0 0-.047-.008c-.036 0-.068-.018-.094-.055a.468.468 0 0 1-.062-.125 5.144 5.144 0 0 1-.047-.148.564.564 0 0 1 .055-.398c.047-.084.133-.128.258-.133zM5.023 15.18c.125 0 .248-.01.368-.032a.97.97 0 0 0 .336-.125.614.614 0 0 0 .234-.242.943.943 0 0 0 .094-.375.816.816 0 0 0-.047-.273.963.963 0 0 0-.133-.25 2.763 2.763 0 0 0-.203-.281 2.763 2.763 0 0 1-.203-.282 62.93 62.93 0 0 1-.29-.43c-.093-.14-.187-.288-.28-.445a8.124 8.124 0 0 1-.235-.406 2.646 2.646 0 0 0-.266-.398 1.203 1.203 0 0 0-.218-.211.469.469 0 0 0-.29-.094.436.436 0 0 0-.296.11 2.26 2.26 0 0 0-.258.265 3.241 3.241 0 0 1-.297.305c-.11.099-.25.177-.422.234a.744.744 0 0 0-.312.172c-.073.073-.11.185-.11.336 0 .104.008.208.024.312.015.104.026.209.031.313 0 .14-.02.273-.063.398a1.157 1.157 0 0 0-.062.367c0 .141.05.24.148.297.1.058.211.097.336.117.157.027.305.047.446.063.14.016.278.04.414.07.135.032.27.065.406.102.135.036.279.094.43.172.03.015.078.034.14.054l.211.07c.078.027.151.048.219.063a.741.741 0 0 0 .148.024zm2.86-.938c.146 0 .302-.015.469-.047a3.54 3.54 0 0 0 .976-.336 2.59 2.59 0 0 0 .406-.257.222.222 0 0 0 .032-.047.305.305 0 0 0 .023-.063v-.008c.031-.114.057-.24.078-.375a8.63 8.63 0 0 0 .055-.414 8.98 8.98 0 0 1 .055-.414c.02-.135.039-.268.054-.398.021-.14.047-.276.078-.406.032-.13.073-.253.125-.368a1.03 1.03 0 0 1 .211-.304 1.54 1.54 0 0 1 .344-.25v-.016l-.008-.023a.29.29 0 0 1 .047-.149 1.4 1.4 0 0 1 .117-.164.582.582 0 0 1 .149-.133.946.946 0 0 1 .164-.078 9.837 9.837 0 0 0-.102-.375 4.938 4.938 0 0 1-.094-.375 7.126 7.126 0 0 0-.093-.476 2.954 2.954 0 0 0-.11-.36 1.317 1.317 0 0 0-.18-.32c-.077-.104-.174-.23-.288-.375a1.189 1.189 0 0 1-.118-.156.555.555 0 0 1-.046-.196 2.206 2.206 0 0 0-.047-.203 9.48 9.48 0 0 0-.242-.75 2.91 2.91 0 0 0-.172-.383 3.87 3.87 0 0 0-.172-.289c-.052-.078-.107-.117-.164-.117-.125 0-.274.05-.446.149-.171.099-.354.208-.546.328-.193.12-.38.232-.563.336-.182.104-.346.153-.492.148a.7.7 0 0 1-.43-.148 2.236 2.236 0 0 1-.36-.344c-.109-.13-.2-.242-.273-.336-.073-.094-.127-.146-.164-.156-.041 0-.065.031-.07.093a2.56 2.56 0 0 0-.008.211v.133c0 .032-.005.052-.016.063-.057.12-.12.237-.187.351-.068.115-.135.232-.203.352a1.611 1.611 0 0 0-.219.758c0 .078.005.156.016.234.01.078.036.154.078.227l-.016.03a1.31 1.31 0 0 1-.133.157 1.072 1.072 0 0 0-.132.164 2.796 2.796 0 0 0-.407.93c-.078.333-.12.672-.125 1.015 0 .089.006.178.016.266.01.089.016.177.016.266a.526.526 0 0 1-.008.086.525.525 0 0 0-.008.086.75.75 0 0 1 .313.109c.12.068.25.154.39.258.14.104.274.224.399.36.125.135.244.267.359.398.115.13.198.26.25.39.052.13.086.237.101.32a.444.444 0 0 1-.125.329.955.955 0 0 1-.312.203c.089.156.198.289.328.398.13.11.271.198.422.266.151.068.315.117.492.148.177.032.35.047.516.047zm3.133 1.11c.109 0 .216-.016.32-.047a1.65 1.65 0 0 0 .445-.203c.136-.089.26-.198.375-.329a3.07 3.07 0 0 1 .977-.75l.258-.117a2.18 2.18 0 0 0 .257-.133.962.962 0 0 0 .165-.132.256.256 0 0 0 .078-.188.295.295 0 0 0-.024-.117.58.58 0 0 0-.07-.117 5.136 5.136 0 0 1-.203-.305 1.978 1.978 0 0 1-.149-.297l-.125-.312a2.558 2.558 0 0 1-.11-.352.28.28 0 0 0-.054-.101.53.53 0 0 0-.46-.235.533.533 0 0 0-.266.07l-.266.149a7.335 7.335 0 0 1-.281.148.656.656 0 0 1-.297.07.411.411 0 0 1-.258-.077.636.636 0 0 1-.172-.211 2.218 2.218 0 0 1-.117-.258l-.094-.258a1.26 1.26 0 0 1-.14.188.666.666 0 0 0-.125.203c-.068.156-.11.33-.125.523-.026.302-.06.596-.102.883a4.7 4.7 0 0 1-.21.86 1.914 1.914 0 0 0-.063.273 2.88 2.88 0 0 0-.032.289c0 .255.079.466.235.633.156.166.367.25.633.25z"},child:[]}]})(n)}function K7(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M10 9a3 3 0 0 0 -3 -3h-.5a3.5 3.5 0 0 0 -3.5 3.5v5a3.5 3.5 0 0 0 3.5 3.5h.5a3 3 0 0 0 3 -3"},child:[]},{tag:"path",attr:{d:"M16 7l-1 10"},child:[]},{tag:"path",attr:{d:"M20 7l-1 10"},child:[]},{tag:"path",attr:{d:"M14 10h7.5"},child:[]},{tag:"path",attr:{d:"M21 14h-7.5"},child:[]}]})(n)}function J7(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M18 12h4"},child:[]},{tag:"path",attr:{d:"M20 10v4"},child:[]},{tag:"path",attr:{d:"M11 12h4"},child:[]},{tag:"path",attr:{d:"M13 10v4"},child:[]},{tag:"path",attr:{d:"M9 9a3 3 0 0 0 -3 -3h-.5a3.5 3.5 0 0 0 -3.5 3.5v5a3.5 3.5 0 0 0 3.5 3.5h.5a3 3 0 0 0 3 -3"},child:[]}]})(n)}function Q7(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.344 8.71c-.707 0-1.279.572-1.279 1.278v4.53a1.278 1.278 0 1 0 2.558 0v-4.53c0-.706-.572-1.278-1.279-1.278zm-12.688 0c-.707 0-1.279.572-1.279 1.278v4.53a1.278 1.278 0 1 0 2.558 0v-4.53A1.277 1.277 0 0 0 5.656 8.71zm8.889-3.809.768-1.388a.343.343 0 0 0-.133-.47.344.344 0 0 0-.471.135l-.789 1.42c-.588-.235-1.236-.368-1.92-.368s-1.332.132-1.92.367l-.789-1.418a.344.344 0 0 0-.471-.135.345.345 0 0 0-.133.47l.768 1.388C8.072 5.69 7.148 7.099 7.148 8.71c0 .011 0 .021.002.034-.002.006-.002.013-.002.019v.001h9.703V8.71c.001-1.611-.923-3.019-2.306-3.809zM9.76 6.869a.346.346 0 1 1 .005-.693.346.346 0 0 1-.005.693zm4.48 0a.347.347 0 0 1 0-.692.346.346 0 0 1 0 .692zM7.148 16.12c0 .646.525 1.171 1.174 1.171h.586v2.401a1.279 1.279 0 0 0 2.558 0v-2.401h1.066v2.401c0 .707.572 1.278 1.277 1.278.709 0 1.281-.571 1.281-1.278v-2.401h.586c.648 0 1.174-.524 1.174-1.171V9.028H7.148v7.092z"},child:[]}]})(n)}function $7(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.78 18.29c0 .12.15 0 0 0zm-3.35-2.7c.39.17-.31-.6 0 0zm-5.03.28c.15.26 0-.12 0 0zm5.6.39c-.27-.42-.2.06 0 .32.48.47.18-.26 0-.32z"},child:[]},{tag:"path",attr:{d:"M20.24 19.06c-.53.63-1-.07-1.63.13-1.1 0 .09-.5.06-1-.58-.45-1.24.61-1.62.9a10.75 10.75 0 0 1-2.67-.83 8 8 0 0 1-2.6-1.94 8.36 8.36 0 0 1-1.87-2.84 21.36 21.36 0 0 1-.84-5.74c.07-1.3 1.44.14 2-.33-.21-.67-1.29-.88-1.89-1.16-.58 0-.79-.55-1.4-.59 0-.73-1.13-.33-1.56-.84.42-1.08-1.37 0-1.23-.91.58-1.2-1.78-1-.8.06.95.54-.93.93-.38 1.29a.59.59 0 0 1-.53.86c-.74.07-.67 1.09.06.55.81-.25.14.11-.25.18a1.3 1.3 0 0 0-.95 1.9 35.32 35.32 0 0 1 1 3.42A16.25 16.25 0 0 0 5.84 17 9.78 9.78 0 0 0 8 19a9.89 9.89 0 0 0 2.43 1.22 18 18 0 0 0 4.73.73 16.53 16.53 0 0 0 2.9-.24c.87.09 1.49-.65 2.26-.26.48-.42 1.16-.23 1.63-.54.32-1.22-1.22-.27-1.71-.85zm-1.74-.74c-.22 0 .05-.34 0 0zm-7.63-11c-.1 0-.08-.12-.16-.15-.8-.37.39-.23.16.19zm6.76 11.39c-.35-.08.28-.25 0 0zm-2.81.11c-.23 0 .18-.14 0 0zm-1.88-1.18c-.13 0 0-.13 0 0zm-.22-.17c-.36 0-.09-.23 0 0zm-.42-.36c-.33.08 0-.34 0 0zm-6-11.66c-.53-.28.11.33-.34.32-.24 0-.69-.52-.54-.78.3.16.83.21.92.5zm-.92-.81h-.11c-.03-.27.87-.06.15.04zm-1.02-.79c-.42-.19 0-.93.44-.58.51.73-.95-.08-.44.58zm.49.69c-.27.11.16-.21 0 0zm.48.92c.6.46-.34 0-.72.29-.61.06.66-.34.72-.29zm.17.6c.35 0 1.88-.69 1.37-.07.47.55.1.37-.21 0 .28.19.06 1-.37.45s-.5-.18-.17.21C5.8 6 4.88 6.28 4.21 6.5c-.43-.04 1.13-.37 1.29-.44zM3.58 7.51c-.16.4.24.53.62.6.62-.17-.41-.28.06-.44.26 0-.82-.26.08-.38S6.09 6.77 7 6.58a8.71 8.71 0 0 1 2.35-.19c.3.35-.23.94-.77 1a8.61 8.61 0 0 1-2 .39c-.8-.1-1.37.61-2.19.7.22-.4-.18-.14-.59-.16.21.82-1.47-.21-.48-.41-.74-.26-.75.52-.67 1-.65-.91.07-1.29.93-1.4zm1.88 1.08c-.22-.05.17-.2 0 0zm-.72.88s-.34-.08-.2-.17c1 .13-.9-.33.13-.22.66-.02.44.36.07.39zm.33.17c-.12.12 0-.24 0 0zm-.71 0c-.44-.09.21-.22 0 0zm-.06 1.43c-.07.1-.1-.08 0 0zM4 10.9c-.55-.19 0-.21 0 0zm-.12 1.28c-.26-.09-.25-.5-.37-.72-.38-1.03.41.4.33.72zm.23-1.49c-.69-.08-.05-.49 0 0zm0-.34h-.09c-.76-.35.45-.17-.02 0zM4 9.56c-.61-.31.58-.36 0 0zm.21.26c-.34.06.05-.32 0 0zm-1.3.07c-.12.08 0-.23 0 0zM3 9.75c-.16 0 0-.27 0 0zm.08-1c-.4-.1.33-.25 0 0zm.26 2c-.44-.1-.12-.65 0 0zm.3 1.25c.42.51.26.79.69 1.41-.56-.35-.67-1.2-1-1.75-.41-.9.23-.01.31.34zm4.09 6.38c-.34-.07-.57-.43-.81-.66a4.88 4.88 0 0 1-1.57-1.94 12.26 12.26 0 0 1-1.46-2.38c-.41-.92.25.07.35.42.21.68.88 1.07.94 1.52.74.42.36 1.12 1 1.31.27-.14.3.84.89.64-.33.15.13.33.3.61.35-.05 1.17.82.36.52zM4.62 12c-.31-.07.33-.11 0 0zm.2.47c-.55-.14.52-.2 0 0zm1.39.47c.4-.17.16.78.55.9.76 1-.53 0-1-.07.06 0-.38-.12-.19-.16-.14-.15-.45-.66.26-.32.6.24.65.06.38-.39zm1.31 1.76c0 .15-.72.13-.06.42-.38 0-.5 0 0 .3-.22.17.43.31.21.57.66.52-.12.13-.4-.08s-.85-.35-.75-.5c.81.42.21 0-.15-.3.65.16-.51-.48.1-.31.19.05-.27-.38.33-.07-.54-.52.47-.12.72-.07zm.48-.17c-.61-.14 0-.34 0 0zm-.17 2c-.61-.26.39 0 0 0zm-.45-.17c-.71-.23.52 0 0 0zm-.09.11c-.22 0 0-.17 0 0zm-1.08-1.55c-.72-.3-.2-.33 0 0zm-.54-.35c-.58-.33-.08-.33 0 0zm0 .65c-.57-.44-.07-.25 0 0zm-.15-1.34c-.35 0 .13-.2 0 0zM8 17.38c-.51-.15 0-.14 0 0zM7.63 17h-.16c-.68-.54.31-.38.75-.14.97.14-.22.39-.59.14zm2.7 1.65c-.68-.16.16-.27 0 0zm-.17-.52c-.05 0-.1-.11 0 0zm-.86-1.34c-.59-.14.21-.19.36 0 1.02.21-.06.26-.36 0zM9.51 18H9.4l-.13-.06c-.56-.59 1.19.28.24.06zm-.28.69c-.15.06 0-.14 0 0zm.29-1.19-.16-.05c-.66-.45.84.09.16 0zm.16 1.72c-.4-.16.26-.25 0 0zm.1-.74c-.58-.14.36-.13 0 0zm.13-.61c-.44-.06.05-.21 0 0zm-.72-.88c.46.06.47.27 0 .14-.09 0-.24 0-.28-.17-.76-.5.03-.25.28-.02zm-.06 2c-.2.12 0-.22 0 0zm-.31-.51c-.53 0 .4-.26 0 0zm-.12.35c-.26-.1.17-.08 0 0zm.3-.89c-.52-.14.25-.18 0 0zm-.16-.57c-.28 0-.06-.16 0 0zm-.54-.95c-.57-.46 1.18.38 0 0zm-.06.19c0 .06-.11-.09 0 0zm3.65 3.78a9.4 9.4 0 0 1-2.56-.85l-.33-.2c-.57-.31-.5-.38.06-.07.19.16 1.59.73.93.35-.29-.07-1.9-.95-.84-.57a20.92 20.92 0 0 0 2.74 1.21 7.14 7.14 0 0 0 2.43.15c.65.33 1.33-.08 2 .21a13.05 13.05 0 0 1-4.45-.23zm-1.25-.7c-.51-.09.16-.23 0 0zm.73-1c-.58-.11.6-.23 0 0zm.84 1.31c1 .37-.6.12-.93-.09-.92-.38.72.09.93.09zm-1.06-1.1c-.81-.12.9 0 0 0zm1.52.85c-.29.23 0-.3 0 0zm.29.05c-.15.06 0-.17 0 0zm.27-.38c-.16.2 0-.23 0 0zm.31 0c-.45.17.47-.39 0 0zm.14 0c.49-.42.51-.22.5.13-.43.48-.17-.2-.44.06s-.19-.1-.06-.17zm.83.45c-.5 0 .51-.54 0 0zm0 .18c-.2.05 0-.13 0 0zm-.16-.35c-.39-.26.94-.61 0 0zm.57.09h-.08c-.03-.23.54-.27.08.02zm.15.19c-.3-.08.47-.4 0 0zm.36-.1c-.51.18.48-.4 0 0zm.22.11-.12.08c-.23-.14.71-.48.12-.07zm-.43-.53c-.54-.18-1.4-.76-2-.37-.8.51.41-.56-.24-.08-.66.79-.45-.5-1.09-.11 0-.12-.57-.16-.17-.37-.36 0-.13-.05 0-.34-.16 0-1 0-1.36-.29-.4-.52.07-.3.48-.23-.67.12.24.5.68.29-.2-.09-.43-.52-1-.9a18.83 18.83 0 0 0-2.13-1c-.84-.5.18-.18.47.08.84.37.51-.51 0-.74-.54 0-.67-.59-1.1-.56.67.11 1.14-.17.39-.85s.3.63-.11.44c-.19-.25-.05-.6-.65-.73 0 .23-.08.58-.21.1-.17 0-.36.21-.5-.28.13-.57-.56-.7-.67-1.06.6.38.87.08.45-.33s-.33-.11-.49 0c-.59.6-.06-1-.32-.56-.26 0-.11.29-.1.65-.86-.21.2.45.45.81-.39-.4-.32.31-.65 0-.11-.3-.12-.77-.67-.85.62-.22-.36-.65-.28-.67.35-.32.4-.76.82-.07-.53 0 0 .88.12.6 0-.47.22-1-.59-1.19-.24.32-.65-.63-.18-.43-.06-.63.74-.26.69-.53.42-.18-.5-.77 0-1 .38.24 1.36-.36.7-.44.42 0 .75.18.79-.24.33.07 1.24.36.42-.09a3.45 3.45 0 0 1 1.13-.25c.79-.61.63 1 .45 1.45.3-.21.24.94.14 1.37.16-.22.23.36 0 .77 0-.07.4-.13.12.35-.22-.47-.31 1-.17.32.37-.61.28 0 .39.24.08.55.32 1.06.4 1.56.35.35-.15.11-.15.59.11-.14.58.19.57.68 0-.78.09-.18.47 0a5.48 5.48 0 0 0 1 1.42c.37.43 0 .13.14.39a3.19 3.19 0 0 0 2.09 1.28 1.46 1.46 0 0 0 1.57.7c-.6.37 1.68.47.91.67-.23.16-.62-.2-1.01-.18zM8.7 15.89c-.24 0 0-.2 0 0zm.38.22c-.18 0-.12-.24 0 0zm-2.61-3.65c-.24-.07.1-.09 0 0zm-.59 0c-.26 0 0-.34 0 0zm-.3-.08c-.1.05 0-.11 0 0zm11 8.25c-.39-.07.32-.22 0 0zm.73-1.05h-.3c.06-.45 1.33-.1 1.85-.09-.16.34-1.13.04-1.55.13zm2 0c-.27 0 .12-.32 0 0zm1-.09c-.25.13 0-.3 0 0zm.48.11c-.52-.12.24-.12.4-.14.94.02 0 .16-.47.16z"},child:[]},{tag:"path",attr:{d:"M6.51 7.11c1-.2-.38-.33-.69 0 .18.13.41-.21.69 0zm-.82.13c0 .19.18-.22 0 0zm2.62-.48c.67-.11.11-.41-.09.1.07.14.11-.05.09-.1zm-.62.1c.93.36-.05-1 0 0zm-2.92.93a.51.51 0 0 1 .33.1c.75.52-.1-.84-.33-.1z"},child:[]},{tag:"path",attr:{d:"M4.81 7.43c.16.13.29-.21 0 0zm.37.01.14.12c.68.06-.11-.46-.14-.12zM10.69 16c.09.3 0-.39 0 0zm-4.78-5c.1.18.18-.18 0 0zm.09.61c.19.34 0-.51 0 0zm.21-.49c.33.21-.28-.52 0 0zm-.41-.82c.07.15.24.16.37.2 1.32.61-.95-1-.37-.2zm.54 1.43c.31.53.18-.37 0 0zm.48-.16c.37.92-.23-.12-.3-.43a2.11 2.11 0 0 0 .28 1c.34.51.19-.28.55.23-.2-.45.1-.2.06-.4s-1-1.17-.59-.4zm.36 1.78c.09.31.18 0 0 0zM5.85 9c.06.14.11 0 0 0zm.67.42c.32.41.17-.36 0 0zm-.89 1.14.14.15c.99.29-1.05-.95-.14-.15zm.7-.37c1 .41-.09-.27-.44-.2.11.13.32.07.44.2zm-.18-.44c.18.18.82.51.31.06.32-.06 0-.16-.24-.32-.44-.67.07.06-.07.26z"},child:[]},{tag:"path",attr:{d:"M5.51 10.64c-.53-.44.16.21-.06.2-.55-.4-.32-.11 0 .2.33.5.6-.3.06-.4zm2.14.64c.12.11-.06-.68 0 0zm1.02-3.5c0 .12.07-.1 0 0zM9 12.47c0 .21 0-.18 0 0zm-.29-1.22c.08.46.1-.78 0 0zm.14.22v.1c.21-.51.04-.79 0-.1zm-.1-2.7c-.14.7-.27.41-.08-.11-.05-.67-.45.41-.27.72.29.47.6-1.16.35-.61zm1.01 5.98c.13.35.11-.42 0 0zm-1.35-4.28c0 .2 0-.14 0 0zm.64 1.7c0 .26.11-.38 0 0zM9.5 14l.07.11c.14-.49-.36-.79-.07-.11zm-1.56-.52c.27.22-.13-.23 0 0zm1.23-.85c.08.29 0-.42 0 0zM8.14 9.81c.15.33-.05-.27 0 0z"},child:[]},{tag:"path",attr:{d:"M8.3 10.23c.24.34-.26-.64 0 0zm-.06 1.15c-.13-1-.42.45 0 .69.13.34.25.2.3-.19-.32 0 .08-.62-.3-.5z"},child:[]}]})(n)}function eU(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m21.62 11.108-8.731-8.729a1.292 1.292 0 0 0-1.823 0L9.257 4.19l2.299 2.3a1.532 1.532 0 0 1 1.939 1.95l2.214 2.217a1.53 1.53 0 0 1 1.583 2.531c-.599.6-1.566.6-2.166 0a1.536 1.536 0 0 1-.337-1.662l-2.074-2.063V14.9c.146.071.286.169.407.29a1.537 1.537 0 0 1 0 2.166 1.536 1.536 0 0 1-2.174 0 1.528 1.528 0 0 1 0-2.164c.152-.15.322-.264.504-.339v-5.49a1.529 1.529 0 0 1-.83-2.008l-2.26-2.271-5.987 5.982c-.5.504-.5 1.32 0 1.824l8.731 8.729a1.286 1.286 0 0 0 1.821 0l8.69-8.689a1.284 1.284 0 0 0 .003-1.822"},child:[]}]})(n)}function tU(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M12.026 2c-5.509 0-9.974 4.465-9.974 9.974 0 4.406 2.857 8.145 6.821 9.465.499.09.679-.217.679-.481 0-.237-.008-.865-.011-1.696-2.775.602-3.361-1.338-3.361-1.338-.452-1.152-1.107-1.459-1.107-1.459-.905-.619.069-.605.069-.605 1.002.07 1.527 1.028 1.527 1.028.89 1.524 2.336 1.084 2.902.829.091-.645.351-1.085.635-1.334-2.214-.251-4.542-1.107-4.542-4.93 0-1.087.389-1.979 1.024-2.675-.101-.253-.446-1.268.099-2.64 0 0 .837-.269 2.742 1.021a9.582 9.582 0 0 1 2.496-.336 9.554 9.554 0 0 1 2.496.336c1.906-1.291 2.742-1.021 2.742-1.021.545 1.372.203 2.387.099 2.64.64.696 1.024 1.587 1.024 2.675 0 3.833-2.33 4.675-4.552 4.922.355.308.675.916.675 1.846 0 1.334-.012 2.41-.012 2.737 0 .267.178.577.687.479C19.146 20.115 22 16.379 22 11.974 22 6.465 17.535 2 12.026 2z"},child:[]}]})(n)}function nU(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.136 3.012h15.729l-1.431 16.15-6.451 1.826-6.414-1.826-1.433-16.15zm5.266 7.302-.173-2.035 7.533.002.173-1.963-9.87-.002.522 5.998h6.835l-.243 2.566-2.179.602-2.214-.605-.141-1.58H7.691l.247 3.123L12 17.506l4.028-1.08.558-6.111H9.402v-.001z"},child:[]}]})(n)}function iU(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.55 21H3v-8.55h8.55V21zM21 21h-8.55v-8.55H21V21zm-9.45-9.45H3V3h8.55v8.55zm9.45 0h-8.55V3H21v8.55z"},child:[]}]})(n)}function rU(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M15.661 15.549a1.315 1.315 0 0 0 1.185-1.386 1.363 1.363 0 0 0-1.35-1.302h-.048a1.352 1.352 0 0 0-1.303 1.397c.024.379.179.687.391.911-.827 1.609-2.07 2.794-3.954 3.788-1.266.663-2.604.912-3.905.734-1.089-.153-1.94-.64-2.463-1.421-.78-1.185-.852-2.462-.201-3.74a5.597 5.597 0 0 1 1.658-1.931 7.88 7.88 0 0 1-.331-1.218c-3.506 2.51-3.148 5.942-2.084 7.564.794 1.184 2.415 1.941 4.19 1.941.474 0 .972-.035 1.457-.154 3.077-.592 5.409-2.438 6.747-5.16l.011-.023z"},child:[]},{tag:"path",attr:{d:"M19.887 12.589c-1.834-2.154-4.533-3.337-7.611-3.337h-.403c-.2-.438-.661-.711-1.183-.711h-.036c-.744 0-1.325.64-1.301 1.385.023.71.627 1.302 1.35 1.302h.059a1.332 1.332 0 0 0 1.183-.828h.439c1.824 0 3.551.532 5.126 1.574 1.206.792 2.072 1.834 2.557 3.077.425 1.019.402 2.013-.035 2.843-.675 1.302-1.812 1.988-3.314 1.988-.947 0-1.871-.296-2.345-.509-.283.235-.758.626-1.102.863 1.042.473 2.096.746 3.113.746 2.309 0 4.023-1.302 4.676-2.557.709-1.422.651-3.813-1.161-5.859l-.012.023z"},child:[]},{tag:"path",attr:{d:"M7.647 15.975c.023.71.626 1.302 1.35 1.302h.048a1.334 1.334 0 0 0 1.302-1.397c0-.71-.616-1.301-1.338-1.301h-.048c-.048 0-.118 0-.178.022-.982-1.657-1.397-3.434-1.242-5.349.094-1.445.567-2.7 1.42-3.742.71-.888 2.048-1.326 2.96-1.35 2.556-.048 3.622 3.138 3.704 4.404l1.184.354C16.536 5.036 14.122 3 11.813 3 9.647 3 7.647 4.574 6.842 6.884c-1.102 3.077-.379 6.036.971 8.404-.118.154-.189.426-.166.687z"},child:[]}]})(n)}function sU(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.5 9.51a4.22 4.22 0 0 1-1.91-1.34A5.77 5.77 0 0 0 12 6a4.72 4.72 0 0 0-5 4 3.23 3.23 0 0 1 3.5-1.49 4.32 4.32 0 0 1 1.91 1.35A5.77 5.77 0 0 0 17 12a4.72 4.72 0 0 0 5-4 3.2 3.2 0 0 1-3.5 1.51zm-13 4.98a4.22 4.22 0 0 1 1.91 1.34A5.77 5.77 0 0 0 12 18a4.72 4.72 0 0 0 5-4 3.23 3.23 0 0 1-3.5 1.49 4.32 4.32 0 0 1-1.91-1.35A5.8 5.8 0 0 0 7 12a4.72 4.72 0 0 0-5 4 3.2 3.2 0 0 1 3.5-1.51z"},child:[]}]})(n)}function oU(n){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m21.29 4.1-4.12-2a1.36 1.36 0 0 0-.48-.1h-.08a1.18 1.18 0 0 0-.72.24l-.14.12-7.88 7.19L4.44 7a.83.83 0 0 0-.54-.17.88.88 0 0 0-.53.17l-1.1 1a.8.8 0 0 0-.27.61.84.84 0 0 0 .27.62l3 2.71-3 2.72a.84.84 0 0 0 0 1.23l1.1 1a.89.89 0 0 0 .6.22.93.93 0 0 0 .47-.17l3.43-2.61 7.88 7.19a1.2 1.2 0 0 0 .76.36h.17a1 1 0 0 0 .49-.12l4.12-2a1.25 1.25 0 0 0 .71-1.1V5.23a1.26 1.26 0 0 0-.71-1.13zM17 16.47l-6-4.53 6-4.53z"},child:[]}]})(n)}function aU(){const n=[we.jsx(_b,{color:"#46d3f2",size:64}),we.jsx($7,{size:64}),we.jsx(vb,{color:"green",size:64}),we.jsx(xb,{size:64}),we.jsx(Mb,{color:"green",size:64}),we.jsx(wb,{color:"#f78f07",size:64}),we.jsx(Y7,{size:64}),we.jsx(Tb,{size:64}),we.jsx(yb,{color:"#2027b0",size:64}),we.jsx(q7,{color:"#f5dd07",size:64}),we.jsx(gb,{color:"#6d7ecf",size:64}),we.jsx(J7,{color:"#002aff",size:64}),we.jsx(nU,{color:"#fc0303",size:64}),we.jsx(K7,{color:"#a004d4",size:64}),we.jsx(Eb,{size:64}),we.jsx(sU,{color:"#03f4fc",size:64}),we.jsx(hb,{color:"#01056b",size:64}),we.jsx(Q7,{color:"#09ff00",size:64}),we.jsx(tU,{size:64}),we.jsx(eU,{color:"#fa1919",size:64}),we.jsx(Z7,{size:64}),we.jsx(iU,{color:"blue",size:64}),we.jsx(rU,{color:"#46d3f2",size:64}),we.jsx(oU,{color:"#0390fc",size:64})];return we.jsx("div",{className:"grid grid-cols-4 md:grid-cols-6 2xl:grid-cols-8 gap-4",children:n.map((e,t)=>we.jsx("div",{className:"p-2",children:e},t))})}function lU(){return we.jsxs("div",{className:"bg-white container flex flex-col items-center justify-center mx-auto my-3",children:[we.jsx("h2",{className:"text-3xl font-bold text-black",children:"Skills"}),we.jsx("p",{className:"text-gray-950 mx-auto",children:"You name it! I've done it!"}),we.jsx("div",{className:"flex justify-center",children:we.jsx(aU,{})})]})}const uU="/my-portfolio/assets/GEU-CyzQLqoM.jpg",cU="/my-portfolio/assets/Clairco-QdSIebFl.jpg",fU=()=>we.jsx("div",{className:"bg-blue-950 p-8 text-white ",children:we.jsxs("div",{className:"container mx-auto max-w-4xl",children:[we.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Experience"}),we.jsxs("div",{className:"mb-8 flex flex-col-reverse md:flex-row",children:[we.jsx("img",{src:uU,alt:"GEU image",className:"rounded-full object-cover w-full md:w-48 h-auto my-2 md:mb-0 mx-auto md:mx-2",style:{boxShadow:"0 4px 8px rgba(255, 255, 255, 0.7)"}}),we.jsxs("div",{children:[we.jsx("h2",{className:"text-2xl font-bold",children:"Graphic Era University"}),we.jsx("h3",{className:"font-semibold text-gray-400 text-sm md:text-lg",children:"CS Student | 2021-2025 | SCGPA: 8.47"}),we.jsx("p",{className:"text-white",children:"Dedicated Computer Science student with expertise in data structures, algorithms, cybersecurity, blockchain, game development and web development. Certified in Cloud computing, Frontend development, and AI. Passionate about continuous learning and active participation in computer science discussions."})]})]}),we.jsxs("div",{className:"mb-8 flex flex-col-reverse md:flex-row",children:[we.jsx("img",{src:cU,alt:"Clairco Image",className:"rounded-full object-cover w-full md:w-48 h-auto my-2 md:mb-0 mx-auto md:mx-2",style:{boxShadow:"0 4px 8px rgba(255, 255, 255, 0.7)"}}),we.jsxs("div",{children:[we.jsx("h2",{className:"text-2xl font-bold",children:"Clairco"}),we.jsx("h3",{className:"text-sm md:text-lg font-semibold text-gray-400",children:"Software Development Intern | Jun'23 - Aug'23"}),we.jsx("p",{className:"text-white",children:"Clairco (Aliferous Technologies Pvt Ltd) is a Bangalore based startup. As a Software Developer intern, I contributed to interactive applications using React, MongoDB, Express.js, and Node.js, gaining hands-on experience across the software development lifecycle."})]})]})]})});function hU(){return we.jsxs("div",{children:[we.jsx(Ab,{}),we.jsx(W7,{}),we.jsx(j7,{}),we.jsx(lU,{}),we.jsx(fU,{})]})}Fg.createRoot(document.getElementById("root")).render(we.jsx($s.StrictMode,{children:we.jsx(hU,{})})); diff --git a/assets/index-HJ2XngBo.css b/assets/index-HJ2XngBo.css new file mode 100644 index 0000000..5f12faa --- /dev/null +++ b/assets/index-HJ2XngBo.css @@ -0,0 +1 @@ +:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: #e74c3c;--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient( to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55 );--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width : 480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}}.Toastify__toast{--y: 0;position:relative;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px #0000001a;display:flex;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;flex:1 1 auto;padding:6px;display:flex;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;flex:1}.Toastify__toast-icon{margin-inline-end:10px;width:20px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width : 480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.m-2{margin:.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-2{margin-top:.5rem}.block{display:block}.flex{display:flex}.grid{display:grid}.h-auto{height:auto}.w-48{width:12rem}.w-full{width:100%}.max-w-4xl{max-width:56rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.gap-4{gap:1rem}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-blue-950{--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity))}.bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-950{--tw-gradient-from: #172554 var(--tw-gradient-from-position);--tw-gradient-to: rgb(23 37 84 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-blue-600{--tw-gradient-to: rgb(37 99 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #2563eb var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-semibold{font-weight:600}.leading-tight{line-height:1.25}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-white\/70{--tw-shadow-color: rgb(255 255 255 / .7);--tw-shadow: var(--tw-shadow-colored)}.hover\:bg-black:hover{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.hover\:bg-blue-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-white:hover{--tw-shadow-color: #fff;--tw-shadow: var(--tw-shadow-colored)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}@media (min-width: 768px){.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:mb-0{margin-bottom:0}.md\:mr-3{margin-right:.75rem}.md\:w-48{width:12rem}.md\:w-64{width:16rem}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}}@media (min-width: 1536px){.\32xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}} diff --git a/assets/index-SqCC5jTt.js b/assets/index-SqCC5jTt.js new file mode 100644 index 0000000..fa32224 --- /dev/null +++ b/assets/index-SqCC5jTt.js @@ -0,0 +1,3767 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function Gv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pM={exports:{}},Dp={},mM={exports:{}},bt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var af=Symbol.for("react.element"),lC=Symbol.for("react.portal"),cC=Symbol.for("react.fragment"),uC=Symbol.for("react.strict_mode"),fC=Symbol.for("react.profiler"),hC=Symbol.for("react.provider"),dC=Symbol.for("react.context"),pC=Symbol.for("react.forward_ref"),mC=Symbol.for("react.suspense"),gC=Symbol.for("react.memo"),vC=Symbol.for("react.lazy"),s2=Symbol.iterator;function yC(n){return n===null||typeof n!="object"?null:(n=s2&&n[s2]||n["@@iterator"],typeof n=="function"?n:null)}var gM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vM=Object.assign,yM={};function ic(n,e,t){this.props=n,this.context=e,this.refs=yM,this.updater=t||gM}ic.prototype.isReactComponent={};ic.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};ic.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function _M(){}_M.prototype=ic.prototype;function Wv(n,e,t){this.props=n,this.context=e,this.refs=yM,this.updater=t||gM}var Xv=Wv.prototype=new _M;Xv.constructor=Wv;vM(Xv,ic.prototype);Xv.isPureReactComponent=!0;var o2=Array.isArray,xM=Object.prototype.hasOwnProperty,jv={current:null},SM={key:!0,ref:!0,__self:!0,__source:!0};function MM(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)xM.call(e,i)&&!SM.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,J=N[Y];if(0>>1;Yr(pe,H))Eer(Te,pe)?(N[Y]=Te,N[Ee]=H,Y=Ee):(N[Y]=pe,N[ie]=H,Y=ie);else if(Eer(Te,H))N[Y]=Te,N[Ee]=H,Y=Ee;else break e}}return B}function r(N,B){var H=N.sortIndex-B.sortIndex;return H!==0?H:N.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var u=[],f=[],h=1,d=null,p=3,v=!1,y=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(N){for(var B=t(f);B!==null;){if(B.callback===null)i(f);else if(B.startTime<=N)i(f),B.sortIndex=B.expirationTime,e(u,B);else break;B=t(f)}}function T(N){if(w=!1,M(N),!y)if(t(u)!==null)y=!0,te(P);else{var B=t(f);B!==null&&ae(T,B.startTime-N)}}function P(N,B){y=!1,w&&(w=!1,g(D),D=-1),v=!0;var H=p;try{for(M(B),d=t(u);d!==null&&(!(d.expirationTime>B)||N&&!k());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,p=d.priorityLevel;var J=Y(d.expirationTime<=B);B=n.unstable_now(),typeof J=="function"?d.callback=J:d===t(u)&&i(u),M(B)}else i(u);d=t(u)}if(d!==null)var Z=!0;else{var ie=t(f);ie!==null&&ae(T,ie.startTime-B),Z=!1}return Z}finally{d=null,p=H,v=!1}}var C=!1,L=null,D=-1,b=5,R=-1;function k(){return!(n.unstable_now()-RN||125Y?(N.sortIndex=H,e(f,N),t(u)===null&&N===t(f)&&(w?(g(D),D=-1):w=!0,ae(T,H-Y))):(N.sortIndex=J,e(u,N),y||v||(y=!0,te(P))),N},n.unstable_shouldYield=k,n.unstable_wrapCallback=function(N){var B=p;return function(){var H=p;p=B;try{return N.apply(this,arguments)}finally{p=H}}}})(AM);TM.exports=AM;var RC=TM.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var CM=ve,qi=RC;function Ae(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),t1=Object.prototype.hasOwnProperty,PC=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,l2={},c2={};function LC(n){return t1.call(c2,n)?!0:t1.call(l2,n)?!1:PC.test(n)?c2[n]=!0:(l2[n]=!0,!1)}function IC(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function NC(n,e,t,i){if(e===null||typeof e>"u"||IC(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function xi(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var jn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){jn[n]=new xi(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];jn[e]=new xi(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){jn[n]=new xi(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){jn[n]=new xi(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){jn[n]=new xi(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){jn[n]=new xi(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){jn[n]=new xi(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){jn[n]=new xi(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){jn[n]=new xi(n,5,!1,n.toLowerCase(),null,!1,!1)});var qv=/[\-:]([a-z])/g;function Zv(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(qv,Zv);jn[e]=new xi(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(qv,Zv);jn[e]=new xi(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(qv,Zv);jn[e]=new xi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){jn[n]=new xi(n,1,!1,n.toLowerCase(),null,!1,!1)});jn.xlinkHref=new xi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){jn[n]=new xi(n,1,!1,n.toLowerCase(),null,!0,!0)});function Kv(n,e,t,i){var r=jn.hasOwnProperty(e)?jn[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var u=` +`+r[o].replace(" at new "," at ");return n.displayName&&u.includes("")&&(u=u.replace("",n.displayName)),u}while(1<=o&&0<=a);break}}}finally{z0=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Qc(n):""}function DC(n){switch(n.tag){case 5:return Qc(n.type);case 16:return Qc("Lazy");case 13:return Qc("Suspense");case 19:return Qc("SuspenseList");case 0:case 2:case 15:return n=O0(n.type,!1),n;case 11:return n=O0(n.type.render,!1),n;case 1:return n=O0(n.type,!0),n;default:return""}}function s1(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case xl:return"Fragment";case _l:return"Portal";case n1:return"Profiler";case Jv:return"StrictMode";case i1:return"Suspense";case r1:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case PM:return(n.displayName||"Context")+".Consumer";case RM:return(n._context.displayName||"Context")+".Provider";case Qv:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case $v:return e=n.displayName||null,e!==null?e:s1(n.type)||"Memo";case Ks:e=n._payload,n=n._init;try{return s1(n(e))}catch{}}return null}function UC(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return s1(e);case 8:return e===Jv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function go(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function IM(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function zC(n){var e=IM(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Sh(n){n._valueTracker||(n._valueTracker=zC(n))}function NM(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=IM(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function $d(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function o1(n,e){var t=e.checked;return ln({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function f2(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=go(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function DM(n,e){e=e.checked,e!=null&&Kv(n,"checked",e,!1)}function a1(n,e){DM(n,e);var t=go(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?l1(n,e.type,t):e.hasOwnProperty("defaultValue")&&l1(n,e.type,go(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function h2(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function l1(n,e,t){(e!=="number"||$d(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var $c=Array.isArray;function Ol(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=Mh.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function xu(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var iu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},OC=["Webkit","ms","Moz","O"];Object.keys(iu).forEach(function(n){OC.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),iu[e]=iu[n]})});function FM(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||iu.hasOwnProperty(n)&&iu[n]?(""+e).trim():e+"px"}function kM(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=FM(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var FC=ln({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function f1(n,e){if(e){if(FC[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ae(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ae(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ae(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ae(62))}}function h1(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var d1=null;function ey(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var p1=null,Fl=null,kl=null;function m2(n){if(n=uf(n)){if(typeof p1!="function")throw Error(Ae(280));var e=n.stateNode;e&&(e=kp(e),p1(n.stateNode,n.type,e))}}function BM(n){Fl?kl?kl.push(n):kl=[n]:Fl=n}function HM(){if(Fl){var n=Fl,e=kl;if(kl=Fl=null,m2(n),e)for(n=0;n>>=0,n===0?32:31-(ZC(n)/KC|0)|0}var wh=64,Eh=4194304;function eu(n){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: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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function ip(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=eu(a):(s&=o,s!==0&&(i=eu(s)))}else o=t&~r,o!==0?i=eu(o):s!==0&&(i=eu(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function lf(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Rr(e),n[e]=t}function e5(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=su),E2=" ",T2=!1;function aw(n,e){switch(n){case"keyup":return b5.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lw(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Sl=!1;function P5(n,e){switch(n){case"compositionend":return lw(e);case"keypress":return e.which!==32?null:(T2=!0,E2);case"textInput":return n=e.data,n===E2&&T2?null:n;default:return null}}function L5(n,e){if(Sl)return n==="compositionend"||!ly&&aw(n,e)?(n=sw(),zd=sy=to=null,Sl=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=R2(t)}}function hw(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?hw(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function dw(){for(var n=window,e=$d();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=$d(n.document)}return e}function cy(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function B5(n){var e=dw(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&hw(t.ownerDocument.documentElement,t)){if(i!==null&&cy(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=P2(t,s);var o=P2(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Ml=null,x1=null,au=null,S1=!1;function L2(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;S1||Ml==null||Ml!==$d(i)||(i=Ml,"selectionStart"in i&&cy(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),au&&Au(au,i)||(au=i,i=op(x1,"onSelect"),0Tl||(n.current=C1[Tl],C1[Tl]=null,Tl--)}function Yt(n,e){Tl++,C1[Tl]=n.current,n.current=e}var vo={},li=Mo(vo),Pi=Mo(!1),ma=vo;function Xl(n,e){var t=n.type.contextTypes;if(!t)return vo;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Li(n){return n=n.childContextTypes,n!=null}function lp(){Kt(Pi),Kt(li)}function F2(n,e,t){if(li.current!==vo)throw Error(Ae(168));Yt(li,e),Yt(Pi,t)}function Mw(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Ae(108,UC(n)||"Unknown",r));return ln({},t,i)}function cp(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||vo,ma=li.current,Yt(li,n),Yt(Pi,Pi.current),!0}function k2(n,e,t){var i=n.stateNode;if(!i)throw Error(Ae(169));t?(n=Mw(n,e,ma),i.__reactInternalMemoizedMergedChildContext=n,Kt(Pi),Kt(li),Yt(li,n)):Kt(Pi),Yt(Pi,t)}var ms=null,Bp=!1,J0=!1;function ww(n){ms===null?ms=[n]:ms.push(n)}function Q5(n){Bp=!0,ww(n)}function wo(){if(!J0&&ms!==null){J0=!0;var n=0,e=Bt;try{var t=ms;for(Bt=1;n>=o,r-=o,ys=1<<32-Rr(e)+r|t<D?(b=L,L=null):b=L.sibling;var R=p(g,L,M[D],T);if(R===null){L===null&&(L=b);break}n&&L&&R.alternate===null&&e(g,L),x=s(R,x,D),C===null?P=R:C.sibling=R,C=R,L=b}if(D===M.length)return t(g,L),en&&Yo(g,D),P;if(L===null){for(;DD?(b=L,L=null):b=L.sibling;var k=p(g,L,R.value,T);if(k===null){L===null&&(L=b);break}n&&L&&k.alternate===null&&e(g,L),x=s(k,x,D),C===null?P=k:C.sibling=k,C=k,L=b}if(R.done)return t(g,L),en&&Yo(g,D),P;if(L===null){for(;!R.done;D++,R=M.next())R=d(g,R.value,T),R!==null&&(x=s(R,x,D),C===null?P=R:C.sibling=R,C=R);return en&&Yo(g,D),P}for(L=i(g,L);!R.done;D++,R=M.next())R=v(L,g,D,R.value,T),R!==null&&(n&&R.alternate!==null&&L.delete(R.key===null?D:R.key),x=s(R,x,D),C===null?P=R:C.sibling=R,C=R);return n&&L.forEach(function(q){return e(g,q)}),en&&Yo(g,D),P}function S(g,x,M,T){if(typeof M=="object"&&M!==null&&M.type===xl&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case xh:e:{for(var P=M.key,C=x;C!==null;){if(C.key===P){if(P=M.type,P===xl){if(C.tag===7){t(g,C.sibling),x=r(C,M.props.children),x.return=g,g=x;break e}}else if(C.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ks&&j2(P)===C.type){t(g,C.sibling),x=r(C,M.props),x.ref=zc(g,C,M),x.return=g,g=x;break e}t(g,C);break}else e(g,C);C=C.sibling}M.type===xl?(x=la(M.props.children,g.mode,T,M.key),x.return=g,g=x):(T=Wd(M.type,M.key,M.props,null,g.mode,T),T.ref=zc(g,x,M),T.return=g,g=T)}return o(g);case _l:e:{for(C=M.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===M.containerInfo&&x.stateNode.implementation===M.implementation){t(g,x.sibling),x=r(x,M.children||[]),x.return=g,g=x;break e}else{t(g,x);break}else e(g,x);x=x.sibling}x=sg(M,g.mode,T),x.return=g,g=x}return o(g);case Ks:return C=M._init,S(g,x,C(M._payload),T)}if($c(M))return y(g,x,M,T);if(Lc(M))return w(g,x,M,T);Lh(g,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,x!==null&&x.tag===6?(t(g,x.sibling),x=r(x,M),x.return=g,g=x):(t(g,x),x=rg(M,g.mode,T),x.return=g,g=x),o(g)):t(g,x)}return S}var Yl=Lw(!0),Iw=Lw(!1),ff={},qr=Mo(ff),Pu=Mo(ff),Lu=Mo(ff);function na(n){if(n===ff)throw Error(Ae(174));return n}function yy(n,e){switch(Yt(Lu,e),Yt(Pu,n),Yt(qr,ff),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:u1(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=u1(e,n)}Kt(qr),Yt(qr,e)}function ql(){Kt(qr),Kt(Pu),Kt(Lu)}function Nw(n){na(Lu.current);var e=na(qr.current),t=u1(e,n.type);e!==t&&(Yt(Pu,n),Yt(qr,t))}function _y(n){Pu.current===n&&(Kt(qr),Kt(Pu))}var rn=Mo(0);function mp(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Q0=[];function xy(){for(var n=0;nt?t:4,n(!0);var i=$0.transition;$0.transition={};try{n(!1),e()}finally{Bt=t,$0.transition=i}}function Zw(){return mr().memoizedState}function nb(n,e,t){var i=uo(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},Kw(n))Jw(e,t);else if(t=Cw(n,e,t,i),t!==null){var r=gi();Pr(t,n,i,r),Qw(t,e,i)}}function ib(n,e,t){var i=uo(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(Kw(n))Jw(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,Lr(a,o)){var u=e.interleaved;u===null?(r.next=r,gy(e)):(r.next=u.next,u.next=r),e.interleaved=r;return}}catch{}finally{}t=Cw(n,e,r,i),t!==null&&(r=gi(),Pr(t,n,i,r),Qw(t,e,i))}}function Kw(n){var e=n.alternate;return n===an||e!==null&&e===an}function Jw(n,e){lu=gp=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function Qw(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,ny(n,t)}}var vp={readContext:pr,useCallback:Qn,useContext:Qn,useEffect:Qn,useImperativeHandle:Qn,useInsertionEffect:Qn,useLayoutEffect:Qn,useMemo:Qn,useReducer:Qn,useRef:Qn,useState:Qn,useDebugValue:Qn,useDeferredValue:Qn,useTransition:Qn,useMutableSource:Qn,useSyncExternalStore:Qn,useId:Qn,unstable_isNewReconciler:!1},rb={readContext:pr,useCallback:function(n,e){return Wr().memoizedState=[n,e===void 0?null:e],n},useContext:pr,useEffect:q2,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Bd(4194308,4,Ww.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Bd(4194308,4,n,e)},useInsertionEffect:function(n,e){return Bd(4,2,n,e)},useMemo:function(n,e){var t=Wr();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Wr();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=nb.bind(null,an,n),[i.memoizedState,n]},useRef:function(n){var e=Wr();return n={current:n},e.memoizedState=n},useState:Y2,useDebugValue:Ty,useDeferredValue:function(n){return Wr().memoizedState=n},useTransition:function(){var n=Y2(!1),e=n[0];return n=tb.bind(null,n[1]),Wr().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=an,r=Wr();if(en){if(t===void 0)throw Error(Ae(407));t=t()}else{if(t=e(),kn===null)throw Error(Ae(349));va&30||zw(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,q2(Fw.bind(null,i,s,n),[n]),i.flags|=2048,Du(9,Ow.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=Wr(),e=kn.identifierPrefix;if(en){var t=_s,i=ys;t=(i&~(1<<32-Rr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Iu++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Xr]=e,n[Ru]=i,aE(n,e,!1,!1),e.stateNode=n;e:{switch(o=h1(t,i),t){case"dialog":Zt("cancel",n),Zt("close",n),r=i;break;case"iframe":case"object":case"embed":Zt("load",n),r=i;break;case"video":case"audio":for(r=0;rKl&&(e.flags|=128,i=!0,Oc(s,!1),e.lanes=4194304)}else{if(!i)if(n=mp(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Oc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!en)return $n(e),null}else 2*xn()-s.renderingStartTime>Kl&&t!==1073741824&&(e.flags|=128,i=!0,Oc(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=xn(),e.sibling=null,t=rn.current,Yt(rn,i?t&1|2:t&1),e):($n(e),null);case 22:case 23:return Ly(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Hi&1073741824&&($n(e),e.subtreeFlags&6&&(e.flags|=8192)):$n(e),null;case 24:return null;case 25:return null}throw Error(Ae(156,e.tag))}function hb(n,e){switch(fy(e),e.tag){case 1:return Li(e.type)&&lp(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return ql(),Kt(Pi),Kt(li),xy(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return _y(e),null;case 13:if(Kt(rn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ae(340));jl()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Kt(rn),null;case 4:return ql(),null;case 10:return my(e.type._context),null;case 22:case 23:return Ly(),null;case 24:return null;default:return null}}var Nh=!1,ri=!1,db=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function Rl(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){hn(n,e,i)}else t.current=null}function k1(n,e,t){try{t()}catch(i){hn(n,e,i)}}var iS=!1;function pb(n,e){if(M1=rp,n=dw(),cy(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,u=-1,f=0,h=0,d=n,p=null;t:for(;;){for(var v;d!==t||r!==0&&d.nodeType!==3||(a=o+r),d!==s||i!==0&&d.nodeType!==3||(u=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(v=d.firstChild)!==null;)p=d,d=v;for(;;){if(d===n)break t;if(p===t&&++f===r&&(a=o),p===s&&++h===i&&(u=o),(v=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=v}t=a===-1||u===-1?null:{start:a,end:u}}else t=null}t=t||{start:0,end:0}}else t=null;for(w1={focusedElem:n,selectionRange:t},rp=!1,Ve=e;Ve!==null;)if(e=Ve,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ve=n;else for(;Ve!==null;){e=Ve;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,S=y.memoizedState,g=e.stateNode,x=g.getSnapshotBeforeUpdate(e.elementType===e.type?w:wr(e.type,w),S);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var M=e.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ae(163))}}catch(T){hn(e,e.return,T)}if(n=e.sibling,n!==null){n.return=e.return,Ve=n;break}Ve=e.return}return y=iS,iS=!1,y}function cu(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&k1(e,t,s)}r=r.next}while(r!==i)}}function Gp(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function B1(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function uE(n){var e=n.alternate;e!==null&&(n.alternate=null,uE(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Xr],delete e[Ru],delete e[A1],delete e[K5],delete e[J5])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function fE(n){return n.tag===5||n.tag===3||n.tag===4}function rS(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||fE(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.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 H1(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=ap));else if(i!==4&&(n=n.child,n!==null))for(H1(n,e,t),n=n.sibling;n!==null;)H1(n,e,t),n=n.sibling}function V1(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(V1(n,e,t),n=n.sibling;n!==null;)V1(n,e,t),n=n.sibling}var Wn=null,Tr=!1;function Vs(n,e,t){for(t=t.child;t!==null;)hE(n,e,t),t=t.sibling}function hE(n,e,t){if(Yr&&typeof Yr.onCommitFiberUnmount=="function")try{Yr.onCommitFiberUnmount(Up,t)}catch{}switch(t.tag){case 5:ri||Rl(t,e);case 6:var i=Wn,r=Tr;Wn=null,Vs(n,e,t),Wn=i,Tr=r,Wn!==null&&(Tr?(n=Wn,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Wn.removeChild(t.stateNode));break;case 18:Wn!==null&&(Tr?(n=Wn,t=t.stateNode,n.nodeType===8?K0(n.parentNode,t):n.nodeType===1&&K0(n,t),Eu(n)):K0(Wn,t.stateNode));break;case 4:i=Wn,r=Tr,Wn=t.stateNode.containerInfo,Tr=!0,Vs(n,e,t),Wn=i,Tr=r;break;case 0:case 11:case 14:case 15:if(!ri&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&k1(t,e,o),r=r.next}while(r!==i)}Vs(n,e,t);break;case 1:if(!ri&&(Rl(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){hn(t,e,a)}Vs(n,e,t);break;case 21:Vs(n,e,t);break;case 22:t.mode&1?(ri=(i=ri)||t.memoizedState!==null,Vs(n,e,t),ri=i):Vs(n,e,t);break;default:Vs(n,e,t)}}function sS(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new db),e.forEach(function(i){var r=wb.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function _r(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=xn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*gb(i/1960))-i,10n?16:n,no===null)var i=!1;else{if(n=no,no=null,xp=0,Nt&6)throw Error(Ae(331));var r=Nt;for(Nt|=4,Ve=n.current;Ve!==null;){var s=Ve,o=s.child;if(Ve.flags&16){var a=s.deletions;if(a!==null){for(var u=0;uxn()-Ry?aa(n,0):by|=t),Ii(n,e)}function xE(n,e){e===0&&(n.mode&1?(e=Eh,Eh<<=1,!(Eh&130023424)&&(Eh=4194304)):e=1);var t=gi();n=Cs(n,e),n!==null&&(lf(n,e,t),Ii(n,t))}function Mb(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),xE(n,t)}function wb(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Ae(314))}i!==null&&i.delete(e),xE(n,t)}var SE;SE=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Pi.current)Ri=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Ri=!1,ub(n,e,t);Ri=!!(n.flags&131072)}else Ri=!1,en&&e.flags&1048576&&Ew(e,fp,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Hd(n,e),n=e.pendingProps;var r=Xl(e,li.current);Hl(e,t),r=My(null,e,i,n,r,t);var s=wy();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Li(i)?(s=!0,cp(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,vy(e),r.updater=Hp,e.stateNode=r,r._reactInternals=e,I1(e,i,n,t),e=U1(null,e,i,!0,s,t)):(e.tag=0,en&&s&&uy(e),di(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Hd(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=Tb(i),n=wr(i,n),r){case 0:e=D1(null,e,i,n,t);break e;case 1:e=eS(null,e,i,n,t);break e;case 11:e=Q2(null,e,i,n,t);break e;case 14:e=$2(null,e,i,wr(i.type,n),t);break e}throw Error(Ae(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:wr(i,r),D1(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:wr(i,r),eS(n,e,i,r,t);case 3:e:{if(rE(e),n===null)throw Error(Ae(387));i=e.pendingProps,s=e.memoizedState,r=s.element,bw(n,e),pp(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Zl(Error(Ae(423)),e),e=tS(n,e,i,t,r);break e}else if(i!==r){r=Zl(Error(Ae(424)),e),e=tS(n,e,i,t,r);break e}else for(Wi=ao(e.stateNode.containerInfo.firstChild),ji=e,en=!0,Ar=null,t=Iw(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(jl(),i===r){e=bs(n,e,t);break e}di(n,e,i,t)}e=e.child}return e;case 5:return Nw(e),n===null&&R1(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,E1(i,r)?o=null:s!==null&&E1(i,s)&&(e.flags|=32),iE(n,e),di(n,e,o,t),e.child;case 6:return n===null&&R1(e),null;case 13:return sE(n,e,t);case 4:return yy(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Yl(e,null,i,t):di(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:wr(i,r),Q2(n,e,i,r,t);case 7:return di(n,e,e.pendingProps,t),e.child;case 8:return di(n,e,e.pendingProps.children,t),e.child;case 12:return di(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,Yt(hp,i._currentValue),i._currentValue=o,s!==null)if(Lr(s.value,o)){if(s.children===r.children&&!Pi.current){e=bs(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===i){if(s.tag===1){u=ws(-1,t&-t),u.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?u.next=u:(u.next=h.next,h.next=u),f.pending=u}}s.lanes|=t,u=s.alternate,u!==null&&(u.lanes|=t),P1(s.return,t,e),a.lanes|=t;break}u=u.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ae(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),P1(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}di(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Hl(e,t),r=pr(r),i=i(r),e.flags|=1,di(n,e,i,t),e.child;case 14:return i=e.type,r=wr(i,e.pendingProps),r=wr(i.type,r),$2(n,e,i,r,t);case 15:return tE(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:wr(i,r),Hd(n,e),e.tag=1,Li(i)?(n=!0,cp(e)):n=!1,Hl(e,t),Pw(e,i,r),I1(e,i,r,t),U1(null,e,i,!0,n,t);case 19:return oE(n,e,t);case 22:return nE(n,e,t)}throw Error(Ae(156,e.tag))};function ME(n,e){return qM(n,e)}function Eb(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fr(n,e,t,i){return new Eb(n,e,t,i)}function Ny(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Tb(n){if(typeof n=="function")return Ny(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Qv)return 11;if(n===$v)return 14}return 2}function fo(n,e){var t=n.alternate;return t===null?(t=fr(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function Wd(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")Ny(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case xl:return la(t.children,r,s,e);case Jv:o=8,r|=8;break;case n1:return n=fr(12,t,e,r|2),n.elementType=n1,n.lanes=s,n;case i1:return n=fr(13,t,e,r),n.elementType=i1,n.lanes=s,n;case r1:return n=fr(19,t,e,r),n.elementType=r1,n.lanes=s,n;case LM:return Xp(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case RM:o=10;break e;case PM:o=9;break e;case Qv:o=11;break e;case $v:o=14;break e;case Ks:o=16,i=null;break e}throw Error(Ae(130,n==null?n:typeof n,""))}return e=fr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function la(n,e,t,i){return n=fr(7,n,i,e),n.lanes=t,n}function Xp(n,e,t,i){return n=fr(22,n,i,e),n.elementType=LM,n.lanes=t,n.stateNode={isHidden:!1},n}function rg(n,e,t){return n=fr(6,n,null,e),n.lanes=t,n}function sg(n,e,t){return e=fr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function Ab(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k0(0),this.expirationTimes=k0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k0(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Dy(n,e,t,i,r,s,o,a,u){return n=new Ab(n,e,t,a,u),e===1?(e=1,s===!0&&(e|=8)):e=0,s=fr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},vy(s),n}function Cb(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AE)}catch(n){console.error(n)}}AE(),EM.exports=Zi;var Ib=EM.exports,dS=Ib;e1.createRoot=dS.createRoot,e1.hydrateRoot=dS.hydrateRoot;var CE={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pS=Pt.createContext&&Pt.createContext(CE),Nb=["attr","size","title"];function Db(n,e){if(n==null)return{};var t=Ub(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Ub(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s=0)&&(t[r]=n[r]);return t}function wp(){return wp=Object.assign?Object.assign.bind():function(n){for(var e=1;ePt.createElement(e.tag,Ep({key:t},e.attr),bE(e.child)))}function Vt(n){return e=>Pt.createElement(kb,wp({attr:Ep({},n.attr)},e),bE(n.child))}function kb(n){var e=t=>{var{attr:i,size:r,title:s}=n,o=Db(n,Nb),a=r||t.size||"1em",u;return t.className&&(u=t.className),n.className&&(u=(u?u+" ":"")+n.className),Pt.createElement("svg",wp({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,o,{className:u,style:Ep(Ep({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&Pt.createElement("title",null,s),n.children)};return pS!==void 0?Pt.createElement(pS.Consumer,null,t=>e(t)):e(CE)}function Bb(n){return Vt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8Zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM8.146 4.992c-1.212 0-1.927.92-1.927 2.502v1.06c0 1.571.703 2.462 1.927 2.462.979 0 1.641-.586 1.729-1.418h1.295v.093c-.1 1.448-1.354 2.467-3.03 2.467-2.091 0-3.269-1.336-3.269-3.603V7.482c0-2.261 1.201-3.638 3.27-3.638 1.681 0 2.935 1.054 3.029 2.572v.088H9.875c-.088-.879-.768-1.512-1.729-1.512Z"},child:[]}]})(n)}function Hb(n){return Vt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"},child:[]}]})(n)}function Vb(n){return Vt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854V1.146zm4.943 12.248V6.169H2.542v7.225h2.401zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248-.822 0-1.359.54-1.359 1.248 0 .694.521 1.248 1.327 1.248h.016zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a5.54 5.54 0 0 1 .016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225h2.4z"},child:[]}]})(n)}function Gb(n){return Vt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M71.92 34.77C50.2 47.67 7.4 96.84 7 109.73v21.34c0 27.06 25.29 50.84 48.25 50.84 27.57 0 50.54-22.85 50.54-50 0 27.12 22.18 50 49.76 50s49-22.85 49-50c0 27.12 23.59 50 51.16 50h.5c27.57 0 51.16-22.85 51.16-50 0 27.12 21.47 50 49 50s49.76-22.85 49.76-50c0 27.12 23 50 50.54 50 23 0 48.25-23.78 48.25-50.84v-21.34c-.4-12.9-43.2-62.07-64.92-75C372.56 32.4 325.76 32 256 32S91.14 33.1 71.92 34.77zm132.32 134.39c-22 38.4-77.9 38.71-99.85.25-13.17 23.14-43.17 32.07-56 27.66-3.87 40.15-13.67 237.13 17.73 269.15 80 18.67 302.08 18.12 379.76 0 31.65-32.27 21.32-232 17.75-269.15-12.92 4.44-42.88-4.6-56-27.66-22 38.52-77.85 38.1-99.85-.24-7.1 12.49-23.05 28.94-51.76 28.94a57.54 57.54 0 0 1-51.75-28.94zm-41.58 53.77c16.47 0 31.09 0 49.22 19.78a436.91 436.91 0 0 1 88.18 0C318.22 223 332.85 223 349.31 223c52.33 0 65.22 77.53 83.87 144.45 17.26 62.15-5.52 63.67-33.95 63.73-42.15-1.57-65.49-32.18-65.49-62.79-39.25 6.43-101.93 8.79-155.55 0 0 30.61-23.34 61.22-65.49 62.79-28.42-.06-51.2-1.58-33.94-63.73 18.67-67 31.56-144.45 83.88-144.45zM256 270.79s-44.38 40.77-52.35 55.21l29-1.17v25.32c0 1.55 21.34.16 23.33.16 11.65.54 23.31 1 23.31-.16v-25.28l29 1.17c-8-14.48-52.35-55.24-52.35-55.24z"},child:[]}]})(n)}function Wb(n){return Vt({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M277.74 312.9c9.8-6.7 23.4-12.5 23.4-12.5s-38.7 7-77.2 10.2c-47.1 3.9-97.7 4.7-123.1 1.3-60.1-8 33-30.1 33-30.1s-36.1-2.4-80.6 19c-52.5 25.4 130 37 224.5 12.1zm-85.4-32.1c-19-42.7-83.1-80.2 0-145.8C296 53.2 242.84 0 242.84 0c21.5 84.5-75.6 110.1-110.7 162.6-23.9 35.9 11.7 74.4 60.2 118.2zm114.6-176.2c.1 0-175.2 43.8-91.5 140.2 24.7 28.4-6.5 54-6.5 54s62.7-32.4 33.9-72.9c-26.9-37.8-47.5-56.6 64.1-121.3zm-6.1 270.5a12.19 12.19 0 0 1-2 2.6c128.3-33.7 81.1-118.9 19.8-97.3a17.33 17.33 0 0 0-8.2 6.3 70.45 70.45 0 0 1 11-3c31-6.5 75.5 41.5-20.6 91.4zM348 437.4s14.5 11.9-15.9 21.2c-57.9 17.5-240.8 22.8-291.6.7-18.3-7.9 16-19 26.8-21.3 11.2-2.4 17.7-2 17.7-2-20.3-14.3-131.3 28.1-56.4 40.2C232.84 509.4 401 461.3 348 437.4zM124.44 396c-78.7 22 47.9 67.4 148.1 24.5a185.89 185.89 0 0 1-28.2-13.8c-44.7 8.5-65.4 9.1-106 4.5-33.5-3.8-13.9-15.2-13.9-15.2zm179.8 97.2c-78.7 14.8-175.8 13.1-233.3 3.6 0-.1 11.8 9.7 72.4 13.6 92.2 5.9 233.8-3.3 237.1-46.9 0 0-6.4 16.5-76.2 29.7zM260.64 353c-59.2 11.4-93.5 11.1-136.8 6.6-33.5-3.5-11.6-19.7-11.6-19.7-86.8 28.8 48.2 61.4 169.5 25.9a60.37 60.37 0 0 1-21.1-12.8z"},child:[]}]})(n)}function Xb(n){return Vt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 508c-6.7 0-13.5-1.8-19.4-5.2l-61.7-36.5c-9.2-5.2-4.7-7-1.7-8 12.3-4.3 14.8-5.2 27.9-12.7 1.4-.8 3.2-.5 4.6.4l47.4 28.1c1.7 1 4.1 1 5.7 0l184.7-106.6c1.7-1 2.8-3 2.8-5V149.3c0-2.1-1.1-4-2.9-5.1L226.8 37.7c-1.7-1-4-1-5.7 0L36.6 144.3c-1.8 1-2.9 3-2.9 5.1v213.1c0 2 1.1 4 2.9 4.9l50.6 29.2c27.5 13.7 44.3-2.4 44.3-18.7V167.5c0-3 2.4-5.3 5.4-5.3h23.4c2.9 0 5.4 2.3 5.4 5.3V378c0 36.6-20 57.6-54.7 57.6-10.7 0-19.1 0-42.5-11.6l-48.4-27.9C8.1 389.2.7 376.3.7 362.4V149.3c0-13.8 7.4-26.8 19.4-33.7L204.6 9c11.7-6.6 27.2-6.6 38.8 0l184.7 106.7c12 6.9 19.4 19.8 19.4 33.7v213.1c0 13.8-7.4 26.7-19.4 33.7L243.4 502.8c-5.9 3.4-12.6 5.2-19.4 5.2zm149.1-210.1c0-39.9-27-50.5-83.7-58-57.4-7.6-63.2-11.5-63.2-24.9 0-11.1 4.9-25.9 47.4-25.9 37.9 0 51.9 8.2 57.7 33.8.5 2.4 2.7 4.2 5.2 4.2h24c1.5 0 2.9-.6 3.9-1.7s1.5-2.6 1.4-4.1c-3.7-44.1-33-64.6-92.2-64.6-52.7 0-84.1 22.2-84.1 59.5 0 40.4 31.3 51.6 81.8 56.6 60.5 5.9 65.2 14.8 65.2 26.7 0 20.6-16.6 29.4-55.5 29.4-48.9 0-59.6-12.3-63.2-36.6-.4-2.6-2.6-4.5-5.3-4.5h-23.9c-3 0-5.3 2.4-5.3 5.3 0 31.1 16.9 68.2 97.8 68.2 58.4-.1 92-23.2 92-63.4z"},child:[]}]})(n)}function jb(n){return Vt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"},child:[]}]})(n)}function Yb(n){return Vt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.2 177.2c-5.4-1.8-10.8-3.5-16.2-5.1.9-3.7 1.7-7.4 2.5-11.1 12.3-59.6 4.2-107.5-23.1-123.3-26.3-15.1-69.2.6-112.6 38.4-4.3 3.7-8.5 7.6-12.5 11.5-2.7-2.6-5.5-5.2-8.3-7.7-45.5-40.4-91.1-57.4-118.4-41.5-26.2 15.2-34 60.3-23 116.7 1.1 5.6 2.3 11.1 3.7 16.7-6.4 1.8-12.7 3.8-18.6 5.9C38.3 196.2 0 225.4 0 255.6c0 31.2 40.8 62.5 96.3 81.5 4.5 1.5 9 3 13.6 4.3-1.5 6-2.8 11.9-4 18-10.5 55.5-2.3 99.5 23.9 114.6 27 15.6 72.4-.4 116.6-39.1 3.5-3.1 7-6.3 10.5-9.7 4.4 4.3 9 8.4 13.6 12.4 42.8 36.8 85.1 51.7 111.2 36.6 27-15.6 35.8-62.9 24.4-120.5-.9-4.4-1.9-8.9-3-13.5 3.2-.9 6.3-1.9 9.4-2.9 57.7-19.1 99.5-50 99.5-81.7 0-30.3-39.4-59.7-93.8-78.4zM282.9 92.3c37.2-32.4 71.9-45.1 87.7-36 16.9 9.7 23.4 48.9 12.8 100.4-.7 3.4-1.4 6.7-2.3 10-22.2-5-44.7-8.6-67.3-10.6-13-18.6-27.2-36.4-42.6-53.1 3.9-3.7 7.7-7.2 11.7-10.7zM167.2 307.5c5.1 8.7 10.3 17.4 15.8 25.9-15.6-1.7-31.1-4.2-46.4-7.5 4.4-14.4 9.9-29.3 16.3-44.5 4.6 8.8 9.3 17.5 14.3 26.1zm-30.3-120.3c14.4-3.2 29.7-5.8 45.6-7.8-5.3 8.3-10.5 16.8-15.4 25.4-4.9 8.5-9.7 17.2-14.2 26-6.3-14.9-11.6-29.5-16-43.6zm27.4 68.9c6.6-13.8 13.8-27.3 21.4-40.6s15.8-26.2 24.4-38.9c15-1.1 30.3-1.7 45.9-1.7s31 .6 45.9 1.7c8.5 12.6 16.6 25.5 24.3 38.7s14.9 26.7 21.7 40.4c-6.7 13.8-13.9 27.4-21.6 40.8-7.6 13.3-15.7 26.2-24.2 39-14.9 1.1-30.4 1.6-46.1 1.6s-30.9-.5-45.6-1.4c-8.7-12.7-16.9-25.7-24.6-39s-14.8-26.8-21.5-40.6zm180.6 51.2c5.1-8.8 9.9-17.7 14.6-26.7 6.4 14.5 12 29.2 16.9 44.3-15.5 3.5-31.2 6.2-47 8 5.4-8.4 10.5-17 15.5-25.6zm14.4-76.5c-4.7-8.8-9.5-17.6-14.5-26.2-4.9-8.5-10-16.9-15.3-25.2 16.1 2 31.5 4.7 45.9 8-4.6 14.8-10 29.2-16.1 43.4zM256.2 118.3c10.5 11.4 20.4 23.4 29.6 35.8-19.8-.9-39.7-.9-59.5 0 9.8-12.9 19.9-24.9 29.9-35.8zM140.2 57c16.8-9.8 54.1 4.2 93.4 39 2.5 2.2 5 4.6 7.6 7-15.5 16.7-29.8 34.5-42.9 53.1-22.6 2-45 5.5-67.2 10.4-1.3-5.1-2.4-10.3-3.5-15.5-9.4-48.4-3.2-84.9 12.6-94zm-24.5 263.6c-4.2-1.2-8.3-2.5-12.4-3.9-21.3-6.7-45.5-17.3-63-31.2-10.1-7-16.9-17.8-18.8-29.9 0-18.3 31.6-41.7 77.2-57.6 5.7-2 11.5-3.8 17.3-5.5 6.8 21.7 15 43 24.5 63.6-9.6 20.9-17.9 42.5-24.8 64.5zm116.6 98c-16.5 15.1-35.6 27.1-56.4 35.3-11.1 5.3-23.9 5.8-35.3 1.3-15.9-9.2-22.5-44.5-13.5-92 1.1-5.6 2.3-11.2 3.7-16.7 22.4 4.8 45 8.1 67.9 9.8 13.2 18.7 27.7 36.6 43.2 53.4-3.2 3.1-6.4 6.1-9.6 8.9zm24.5-24.3c-10.2-11-20.4-23.2-30.3-36.3 9.6.4 19.5.6 29.5.6 10.3 0 20.4-.2 30.4-.7-9.2 12.7-19.1 24.8-29.6 36.4zm130.7 30c-.9 12.2-6.9 23.6-16.5 31.3-15.9 9.2-49.8-2.8-86.4-34.2-4.2-3.6-8.4-7.5-12.7-11.5 15.3-16.9 29.4-34.8 42.2-53.6 22.9-1.9 45.7-5.4 68.2-10.5 1 4.1 1.9 8.2 2.7 12.2 4.9 21.6 5.7 44.1 2.5 66.3zm18.2-107.5c-2.8.9-5.6 1.8-8.5 2.6-7-21.8-15.6-43.1-25.5-63.8 9.6-20.4 17.7-41.4 24.5-62.9 5.2 1.5 10.2 3.1 15 4.7 46.6 16 79.3 39.8 79.3 58 0 19.6-34.9 44.9-84.8 61.4zm-149.7-15c25.3 0 45.8-20.5 45.8-45.8s-20.5-45.8-45.8-45.8c-25.3 0-45.8 20.5-45.8 45.8s20.5 45.8 45.8 45.8z"},child:[]}]})(n)}function qb(n){return Vt({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M24 18.588a1.529 1.529 0 01-1.895-.72l-3.45-4.771-.5-.667-4.003 5.444a1.466 1.466 0 01-1.802.708l5.158-6.92-4.798-6.251a1.595 1.595 0 011.9.666l3.576 4.83 3.596-4.81a1.435 1.435 0 011.788-.668L21.708 7.9l-2.522 3.283a.666.666 0 000 .994l4.804 6.412zM.002 11.576l.42-2.075c1.154-4.103 5.858-5.81 9.094-3.27 1.895 1.489 2.368 3.597 2.275 5.973H1.116C.943 16.447 4.005 19.009 7.92 17.7a4.078 4.078 0 002.582-2.876c.207-.666.548-.78 1.174-.588a5.417 5.417 0 01-2.589 3.957 6.272 6.272 0 01-7.306-.933 6.575 6.575 0 01-1.64-3.858c0-.235-.08-.455-.134-.666A88.33 88.33 0 010 11.577zm1.127-.286h9.654c-.06-3.076-2.001-5.258-4.59-5.278-2.882-.04-4.944 2.094-5.071 5.264z"},child:[]}]})(n)}function Zb(n){return Vt({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.483 0a1.374 1.374 0 0 0-.961.438L7.116 6.226l-3.854 4.126a5.266 5.266 0 0 0-1.209 2.104 5.35 5.35 0 0 0-.125.513 5.527 5.527 0 0 0 .062 2.362 5.83 5.83 0 0 0 .349 1.017 5.938 5.938 0 0 0 1.271 1.818l4.277 4.193.039.038c2.248 2.165 5.852 2.133 8.063-.074l2.396-2.392c.54-.54.54-1.414.003-1.955a1.378 1.378 0 0 0-1.951-.003l-2.396 2.392a3.021 3.021 0 0 1-4.205.038l-.02-.019-4.276-4.193c-.652-.64-.972-1.469-.948-2.263a2.68 2.68 0 0 1 .066-.523 2.545 2.545 0 0 1 .619-1.164L9.13 8.114c1.058-1.134 3.204-1.27 4.43-.278l3.501 2.831c.593.48 1.461.387 1.94-.207a1.384 1.384 0 0 0-.207-1.943l-3.5-2.831c-.8-.647-1.766-1.045-2.774-1.202l2.015-2.158A1.384 1.384 0 0 0 13.483 0zm-2.866 12.815a1.38 1.38 0 0 0-1.38 1.382 1.38 1.38 0 0 0 1.38 1.382H20.79a1.38 1.38 0 0 0 1.38-1.382 1.38 1.38 0 0 0-1.38-1.382z"},child:[]}]})(n)}function Kb(n){return Vt({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z"},child:[]}]})(n)}function Jb(n){return Vt({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.405 5.501c-.115 0-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77 18.695h-.927a50.854 50.854 0 00-.27-4.41h-.008l-1.41 4.41H2.45l-1.4-4.41h-.01a72.892 72.892 0 00-.195 4.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335 4.064h.008l1.347-4.064h1.095c.242 2.015.384 3.86.428 5.53zm4.017-4.08c-.378 2.045-.876 3.533-1.492 4.46-.482.716-1.01 1.073-1.583 1.073-.153 0-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268 0 .483-.075.647-.222.197-.18.295-.382.295-.605 0-.155-.077-.47-.23-.944L6.23 14.615h.91l.727 2.36c.164.536.233.91.205 1.123.4-1.064.678-2.227.835-3.483zm12.325 4.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253 0-1.83-.718-2.746-2.155-2.746-.704 0-1.254.232-1.65.697-.43.508-.646 1.256-.646 2.245 0 .972.19 1.686.574 2.14.35.41.877.615 1.583.615.264 0 .506-.033.725-.098l1.325.772.36-.622zM15.5 17.588c-.225-.36-.337-.94-.337-1.736 0-1.393.424-2.09 1.27-2.09.443 0 .77.167.977.5.224.362.336.936.336 1.723 0 1.404-.424 2.108-1.27 2.108-.445 0-.77-.167-.978-.5zm-1.658-.425c0 .47-.172.856-.516 1.156-.344.3-.803.45-1.384.45-.543 0-1.064-.172-1.573-.515l.237-.476c.438.22.833.328 1.19.328.332 0 .593-.073.783-.22a.754.754 0 00.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177 0-.45.157-.81.47-1.085.315-.278.72-.415 1.22-.415.512 0 .98.136 1.4.41l-.213.476a2.726 2.726 0 00-1.064-.23c-.283 0-.502.068-.654.206a.685.685 0 00-.248.524c0 .328.234.61.666.85.393.215 1.187.67 1.187.67.433.305.648.63.648 1.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223 3.223 0 00-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867 8.867 0 00-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69 17.69 0 01-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422 1.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146 1.693.194 2.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445 3.445 0 01-.35-.4 8.76 8.76 0 01-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188 1.01-.027.007-.014 0-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478 2.478 0 01-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953 5.953 0 012.085 2.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z"},child:[]}]})(n)}function Qb(n){return Vt({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.409 6.608L7.981.255l3.572 6.353H4.409zM8.411 0l3.569 6.348L15.552 0H8.411zm4.036 17.392l3.572 6.354 3.575-6.354h-7.147zm-.608-10.284h-7.43l3.715 6.605 3.715-6.605zm.428-.25h7.428L15.982.255l-3.715 6.603zM15.589 24l-3.569-6.349L8.448 24h7.141zm-3.856-6.858H4.306l3.712 6.603 3.715-6.603zm.428-.25h7.433l-3.718-6.605-3.715 6.605z"},child:[]}]})(n)}function $b(n){return Vt({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0a12 12 0 1012 12A12 12 0 0012 0zm0 23.52A11.52 11.52 0 1123.52 12 11.52 11.52 0 0112 23.52zm7.13-9.791c-.206.997-1.126 3.557-4.06 4.942l-1.179-1.325-1.988 2a7.338 7.338 0 01-5.804-2.978 2.859 2.859 0 00.65.123c.326.006.678-.114.678-.66v-5.394a.89.89 0 00-1.116-.89c-.92.212-1.656 2.509-1.656 2.509a7.304 7.304 0 012.528-5.597 7.408 7.408 0 013.73-1.721c-1.006.573-1.57 1.507-1.57 2.29 0 1.262.76 1.109.984.923v7.28a1.157 1.157 0 00.148.256 1.075 1.075 0 00.88.445c.76 0 1.747-.868 1.747-.868V9.172c0-.6-.452-1.324-.905-1.572 0 0 .838-.149 1.484.346a5.537 5.537 0 01.387-.425c1.508-1.48 2.929-1.902 4.112-2.112 0 0-2.151 1.69-2.151 3.96 0 1.687.043 5.801.043 5.801.799.771 1.986-.342 3.059-1.441Z"},child:[]}]})(n)}function eR(){return fe.jsx("header",{className:"bg-gradient-to-r from-blue-950 via-blue-600 to-white p-4 text-white",children:fe.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-around",children:[fe.jsx("span",{className:"text-4xl p-2 font-bold mb-2 md:mb-0",children:"My Portfolio"}),fe.jsxs("div",{className:"flex justify-around",children:[fe.jsx("a",{href:"https://github.com/Abhinav-Chdhary",target:"_blank",rel:"noopener noreferrer",children:fe.jsx("button",{className:"bg-gray-950 hover:bg-gray-800 text-white p-2 rounded-md m-2",children:fe.jsx(Hb,{size:32})})}),fe.jsx("a",{href:"https://www.linkedin.com/in/abhinavchdhary/",target:"_blank",rel:"noopener noreferrer",children:fe.jsx("button",{className:"bg-blue-600 hover:bg-blue-500 text-white p-2 rounded-md m-2",children:fe.jsx(Vb,{size:32})})}),fe.jsx("a",{href:"https://abhinav-choudhary.itch.io/",target:"_blank",rel:"noopener noreferrer",children:fe.jsx("button",{className:"bg-red-500 hover:bg-red-700 text-white p-2 rounded-md m-2",children:fe.jsx(Gb,{size:32})})}),fe.jsx("a",{href:"https://leetcode.com/Megh_nad/",target:"_blank",rel:"noopener noreferrer",children:fe.jsx("button",{className:"bg-yellow-500 hover:bg-black text-white p-2 rounded-md m-2",children:fe.jsx(Zb,{size:32})})})]})]})})}/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const Kp="160",Zo={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ko={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},RE=0,Y1=1,PE=2,tR=3,LE=0,Jp=1,hu=2,Er=3,Rs=0,vi=1,jr=2,nR=2,Es=0,ca=1,q1=2,Z1=3,K1=4,IE=5,eo=100,NE=101,DE=102,J1=103,Q1=104,UE=200,zE=201,OE=202,FE=203,Tp=204,Ap=205,kE=206,BE=207,HE=208,VE=209,GE=210,WE=211,XE=212,jE=213,YE=214,qE=0,ZE=1,KE=2,zu=3,JE=4,QE=5,$E=6,eT=7,hf=0,tT=1,nT=2,Zr=0,iT=1,rT=2,sT=3,Fy=4,oT=5,aT=6,$1="attached",lT="detached",Qp=300,Ps=301,yo=302,Ou=303,Fu=304,oc=306,ku=1e3,si=1001,Bu=1002,_n=1003,Cp=1004,iR=1004,du=1005,rR=1005,sn=1006,ky=1007,sR=1007,_o=1008,oR=1008,Kr=1009,cT=1010,uT=1011,$p=1012,By=1013,xs=1014,hr=1015,xa=1016,Hy=1017,Vy=1018,ho=1020,fT=1021,pi=1023,hT=1024,dT=1025,po=1026,Sa=1027,pT=1028,Gy=1029,mT=1030,Wy=1031,Xy=1033,Xd=33776,jd=33777,Yd=33778,qd=33779,ev=35840,tv=35841,nv=35842,iv=35843,jy=36196,rv=37492,sv=37496,ov=37808,av=37809,lv=37810,cv=37811,uv=37812,fv=37813,hv=37814,dv=37815,pv=37816,mv=37817,gv=37818,vv=37819,yv=37820,_v=37821,Zd=36492,xv=36494,Sv=36495,gT=36283,Mv=36284,wv=36285,Ev=36286,vT=2200,yT=2201,_T=2202,Hu=2300,Vu=2301,Kd=2302,ia=2400,ra=2401,Gu=2402,em=2500,Yy=2501,aR=0,lR=1,cR=2,qy=3e3,mo=3001,xT=3200,ST=3201,Eo=0,MT=1,Gi="",Cn="srgb",Qr="srgb-linear",tm="display-p3",df="display-p3-linear",Wu="linear",jt="srgb",Xu="rec709",ju="p3",uR=0,Jo=7680,fR=7681,hR=7682,dR=7683,pR=34055,mR=34056,gR=5386,vR=512,yR=513,_R=514,xR=515,SR=516,MR=517,wR=518,Tv=519,wT=512,ET=513,TT=514,Zy=515,AT=516,CT=517,bT=518,RT=519,Yu=35044,ER=35048,TR=35040,AR=35045,CR=35049,bR=35041,RR=35046,PR=35050,LR=35042,IR="100",Av="300 es",bp=1035,br=2e3,Jl=2001;class es{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+ei[n>>16&255]+ei[n>>24&255]+"-"+ei[e&255]+ei[e>>8&255]+"-"+ei[e>>16&15|64]+ei[e>>24&255]+"-"+ei[t&63|128]+ei[t>>8&255]+"-"+ei[t>>16&255]+ei[t>>24&255]+ei[i&255]+ei[i>>8&255]+ei[i>>16&255]+ei[i>>24&255]).toLowerCase()}function dn(n,e,t){return Math.max(e,Math.min(t,n))}function Ky(n,e){return(n%e+e)%e}function NR(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function DR(n,e,t){return n!==e?(t-n)/(e-n):0}function pu(n,e,t){return(1-t)*n+t*e}function UR(n,e,t,i){return pu(n,e,1-Math.exp(-t*i))}function zR(n,e=1){return e-Math.abs(Ky(n,e*2)-e)}function OR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function FR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function kR(n,e){return n+Math.floor(Math.random()*(e-n+1))}function BR(n,e){return n+Math.random()*(e-n)}function HR(n){return n*(.5-Math.random())}function VR(n){n!==void 0&&(gS=n);let e=gS+=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 GR(n){return n*ua}function WR(n){return n*Ql}function Cv(n){return(n&n-1)===0&&n!==0}function XR(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Rp(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function jR(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),u=o(t/2),f=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),v=s((i-e)/2),y=o((i-e)/2);switch(r){case"XYX":n.set(a*h,u*d,u*p,a*f);break;case"YZY":n.set(u*p,a*h,u*d,a*f);break;case"ZXZ":n.set(u*d,u*p,a*h,a*f);break;case"XZX":n.set(a*h,u*y,u*v,a*f);break;case"YXY":n.set(u*v,a*h,u*y,a*f);break;case"ZYZ":n.set(u*y,u*v,a*h,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function bi(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function xt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const YR={DEG2RAD:ua,RAD2DEG:Ql,generateUUID:Yi,clamp:dn,euclideanModulo:Ky,mapLinear:NR,inverseLerp:DR,lerp:pu,damp:UR,pingpong:zR,smoothstep:OR,smootherstep:FR,randInt:kR,randFloat:BR,randFloatSpread:HR,seededRandom:VR,degToRad:GR,radToDeg:WR,isPowerOfTwo:Cv,ceilPowerOfTwo:XR,floorPowerOfTwo:Rp,setQuaternionFromProperEuler:jR,normalize:xt,denormalize:bi};class de{constructor(e=0,t=0){de.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=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(dn(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),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class wt{constructor(e,t,i,r,s,o,a,u,f){wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,u,f)}set(e,t,i,r,s,o,a,u,f){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=u,h[6]=i,h[7]=o,h[8]=f,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,r=t.elements,s=this.elements,o=i[0],a=i[3],u=i[6],f=i[1],h=i[4],d=i[7],p=i[2],v=i[5],y=i[8],w=r[0],S=r[3],g=r[6],x=r[1],M=r[4],T=r[7],P=r[2],C=r[5],L=r[8];return s[0]=o*w+a*x+u*P,s[3]=o*S+a*M+u*C,s[6]=o*g+a*T+u*L,s[1]=f*w+h*x+d*P,s[4]=f*S+h*M+d*C,s[7]=f*g+h*T+d*L,s[2]=p*w+v*x+y*P,s[5]=p*S+v*M+y*C,s[8]=p*g+v*T+y*L,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],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],f=e[7],h=e[8];return t*o*h-t*a*f-i*s*h+i*a*u+r*s*f-r*o*u}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],f=e[7],h=e[8],d=h*o-a*f,p=a*u-h*s,v=f*s-o*u,y=t*d+i*p+r*v;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/y;return e[0]=d*w,e[1]=(r*f-h*i)*w,e[2]=(a*i-r*o)*w,e[3]=p*w,e[4]=(h*t-r*u)*w,e[5]=(r*s-a*t)*w,e[6]=v*w,e[7]=(i*u-f*t)*w,e[8]=(o*t-i*s)*w,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,r,s,o,a){const u=Math.cos(s),f=Math.sin(s);return this.set(i*u,i*f,-i*(u*o+f*a)+o+e,-r*f,r*u,-r*(-f*o+u*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(og.makeScale(e,t)),this}rotate(e){return this.premultiply(og.makeRotation(-e)),this}translate(e,t){return this.premultiply(og.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 r=0;r<9;r++)if(t[r]!==i[r])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 og=new wt;function PT(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const qR={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Ll(n,e){return new qR[n](e)}function qu(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function LT(){const n=qu("canvas");return n.style.display="block",n}const vS={};function mu(n){n in vS||(vS[n]=!0,console.warn(n))}const yS=new wt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),_S=new wt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zh={[Qr]:{transfer:Wu,primaries:Xu,toReference:n=>n,fromReference:n=>n},[Cn]:{transfer:jt,primaries:Xu,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[df]:{transfer:Wu,primaries:ju,toReference:n=>n.applyMatrix3(_S),fromReference:n=>n.applyMatrix3(yS)},[tm]:{transfer:jt,primaries:ju,toReference:n=>n.convertSRGBToLinear().applyMatrix3(_S),fromReference:n=>n.applyMatrix3(yS).convertLinearToSRGB()}},ZR=new Set([Qr,df]),Ft={enabled:!0,_workingColorSpace:Qr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!ZR.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=zh[e].toReference,r=zh[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return zh[n].primaries},getTransfer:function(n){return n===Gi?Wu:zh[n].transfer}};function Gl(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ag(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let qa;class Jy{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{qa===void 0&&(qa=qu("canvas")),qa.width=e.width,qa.height=e.height;const i=qa.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=qa}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=qu("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Qp)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ku:e.x=e.x-Math.floor(e.x);break;case si:e.x=e.x<0?0:1;break;case Bu: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 ku:e.y=e.y-Math.floor(e.y);break;case si:e.y=e.y<0?0:1;break;case Bu: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)}get encoding(){return mu("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Cn?mo:qy}set encoding(e){mu("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===mo?Cn:Gi}}mn.DEFAULT_IMAGE=null;mn.DEFAULT_MAPPING=Qp;mn.DEFAULT_ANISOTROPY=1;class kt{constructor(e=0,t=0,i=0,r=1){kt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}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,r){return this.x=e,this.y=t,this.z=i,this.w=r,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,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,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,r,s;const u=e.elements,f=u[0],h=u[4],d=u[8],p=u[1],v=u[5],y=u[9],w=u[2],S=u[6],g=u[10];if(Math.abs(h-p)<.01&&Math.abs(d-w)<.01&&Math.abs(y-S)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+w)<.1&&Math.abs(y+S)<.1&&Math.abs(f+v+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(f+1)/2,T=(v+1)/2,P=(g+1)/2,C=(h+p)/4,L=(d+w)/4,D=(y+S)/4;return M>T&&M>P?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=C/i,s=L/i):T>P?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=C/r,s=D/r):P<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(P),i=L/s,r=D/s),this.set(i,r,s,t),this}let x=Math.sqrt((S-y)*(S-y)+(d-w)*(d-w)+(p-h)*(p-h));return Math.abs(x)<.001&&(x=1),this.x=(S-y)/x,this.y=(d-w)/x,this.z=(p-h)/x,this.w=Math.acos((f+v+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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 IT extends es{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new kt(0,0,e,t),this.scissorTest=!1,this.viewport=new kt(0,0,e,t);const r={width:e,height:t,depth:1};i.encoding!==void 0&&(mu("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===mo?Cn:Gi),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:sn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new mn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){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.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new sa(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class gr extends IT{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class nm extends mn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=_n,this.minFilter=_n,this.wrapR=si,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class QR extends gr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new nm(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class Qy extends mn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=_n,this.minFilter=_n,this.wrapR=si,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class $R extends gr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new Qy(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class eP extends gr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o=0?1:-1,M=1-g*g;if(M>Number.EPSILON){const P=Math.sqrt(M),C=Math.atan2(P,g*x);S=Math.sin(S*C)/P,a=Math.sin(a*C)/P}const T=a*x;if(u=u*S+p*T,f=f*S+v*T,h=h*S+y*T,d=d*S+w*T,S===1-a){const P=1/Math.sqrt(u*u+f*f+h*h+d*d);u*=P,f*=P,h*=P,d*=P}}e[t]=u,e[t+1]=f,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],u=i[r+1],f=i[r+2],h=i[r+3],d=s[o],p=s[o+1],v=s[o+2],y=s[o+3];return e[t]=a*y+h*d+u*v-f*p,e[t+1]=u*y+h*p+f*d-a*v,e[t+2]=f*y+h*v+a*p-u*d,e[t+3]=h*y-a*d-u*p-f*v,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,r){return this._x=e,this._y=t,this._z=i,this._w=r,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,r=e._y,s=e._z,o=e._order,a=Math.cos,u=Math.sin,f=a(i/2),h=a(r/2),d=a(s/2),p=u(i/2),v=u(r/2),y=u(s/2);switch(o){case"XYZ":this._x=p*h*d+f*v*y,this._y=f*v*d-p*h*y,this._z=f*h*y+p*v*d,this._w=f*h*d-p*v*y;break;case"YXZ":this._x=p*h*d+f*v*y,this._y=f*v*d-p*h*y,this._z=f*h*y-p*v*d,this._w=f*h*d+p*v*y;break;case"ZXY":this._x=p*h*d-f*v*y,this._y=f*v*d+p*h*y,this._z=f*h*y+p*v*d,this._w=f*h*d-p*v*y;break;case"ZYX":this._x=p*h*d-f*v*y,this._y=f*v*d+p*h*y,this._z=f*h*y-p*v*d,this._w=f*h*d+p*v*y;break;case"YZX":this._x=p*h*d+f*v*y,this._y=f*v*d+p*h*y,this._z=f*h*y-p*v*d,this._w=f*h*d-p*v*y;break;case"XZY":this._x=p*h*d-f*v*y,this._y=f*v*d-p*h*y,this._z=f*h*y+p*v*d,this._w=f*h*d+p*v*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],u=t[9],f=t[2],h=t[6],d=t[10],p=i+a+d;if(p>0){const v=.5/Math.sqrt(p+1);this._w=.25/v,this._x=(h-u)*v,this._y=(s-f)*v,this._z=(o-r)*v}else if(i>a&&i>d){const v=2*Math.sqrt(1+i-a-d);this._w=(h-u)/v,this._x=.25*v,this._y=(r+o)/v,this._z=(s+f)/v}else if(a>d){const v=2*Math.sqrt(1+a-i-d);this._w=(s-f)/v,this._x=(r+o)/v,this._y=.25*v,this._z=(u+h)/v}else{const v=2*Math.sqrt(1+d-i-a);this._w=(o-r)/v,this._x=(s+f)/v,this._y=(u+h)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.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(dn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),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,r=e._y,s=e._z,o=e._w,a=t._x,u=t._y,f=t._z,h=t._w;return this._x=i*h+o*a+r*f-s*u,this._y=r*h+o*u+s*a-i*f,this._z=s*h+o*f+i*u-r*a,this._w=o*h-i*a-r*u-s*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const u=1-a*a;if(u<=Number.EPSILON){const v=1-t;return this._w=v*o+t*this._w,this._x=v*i+t*this._x,this._y=v*r+t*this._y,this._z=v*s+t*this._z,this.normalize(),this}const f=Math.sqrt(u),h=Math.atan2(f,a),d=Math.sin((1-t)*h)/f,p=Math.sin(t*h)/f;return this._w=o*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(r),i*Math.sin(s),i*Math.cos(s),t*Math.sin(r))}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 O{constructor(e=0,t=0,i=0){O.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(xS.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(xS.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,u=e.w,f=2*(o*r-a*i),h=2*(a*t-s*r),d=2*(s*i-o*t);return this.x=t+u*f+o*d-a*h,this.y=i+u*h+a*f-s*d,this.z=r+u*d+s*h-o*f,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,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,r=e.y,s=e.z,o=t.x,a=t.y,u=t.z;return this.x=r*u-s*a,this.y=s*o-i*u,this.z=i*a-r*o,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 cg.copy(this).projectOnVector(e),this.sub(cg)}reflect(e){return this.sub(cg.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(dn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}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 r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*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(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,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()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const cg=new O,xS=new oi;class yi{constructor(e=new O(1/0,1/0,1/0),t=new O(-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;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,xr),xr.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(kc),Fh.subVectors(this.max,kc),Za.subVectors(e.a,kc),Ka.subVectors(e.b,kc),Ja.subVectors(e.c,kc),Gs.subVectors(Ka,Za),Ws.subVectors(Ja,Ka),Oo.subVectors(Za,Ja);let t=[0,-Gs.z,Gs.y,0,-Ws.z,Ws.y,0,-Oo.z,Oo.y,Gs.z,0,-Gs.x,Ws.z,0,-Ws.x,Oo.z,0,-Oo.x,-Gs.y,Gs.x,0,-Ws.y,Ws.x,0,-Oo.y,Oo.x,0];return!ug(t,Za,Ka,Ja,Fh)||(t=[1,0,0,0,1,0,0,0,1],!ug(t,Za,Ka,Ja,Fh))?!1:(kh.crossVectors(Gs,Ws),t=[kh.x,kh.y,kh.z],ug(t,Za,Ka,Ja,Fh))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,xr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(xr).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:(ls[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ls[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ls[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ls[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ls[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ls[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ls[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ls[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ls),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 ls=[new O,new O,new O,new O,new O,new O,new O,new O],xr=new O,Oh=new yi,Za=new O,Ka=new O,Ja=new O,Gs=new O,Ws=new O,Oo=new O,kc=new O,Fh=new O,kh=new O,Fo=new O;function ug(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Fo.fromArray(n,s);const a=r.x*Math.abs(Fo.x)+r.y*Math.abs(Fo.y)+r.z*Math.abs(Fo.z),u=e.dot(Fo),f=t.dot(Fo),h=i.dot(Fo);if(Math.max(-Math.max(u,f,h),Math.min(u,f,h))>a)return!1}return!0}const tP=new yi,Bc=new O,fg=new O;class ai{constructor(e=new O,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):tP.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.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;Bc.subVectors(e,this.center);const t=Bc.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Bc,r/i),this.radius+=r}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):(fg.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Bc.copy(e.center).add(fg)),this.expandByPoint(Bc.copy(e.center).sub(fg))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const cs=new O,hg=new O,Bh=new O,Xs=new O,dg=new O,Hh=new O,pg=new O;class Aa{constructor(e=new O,t=new O(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,cs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=cs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(cs.copy(this.origin).addScaledVector(this.direction,t),cs.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){hg.copy(e).add(t).multiplyScalar(.5),Bh.copy(t).sub(e).normalize(),Xs.copy(this.origin).sub(hg);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Bh),a=Xs.dot(this.direction),u=-Xs.dot(Bh),f=Xs.lengthSq(),h=Math.abs(1-o*o);let d,p,v,y;if(h>0)if(d=o*u-a,p=o*a-u,y=s*h,d>=0)if(p>=-y)if(p<=y){const w=1/h;d*=w,p*=w,v=d*(d+o*p+2*a)+p*(o*d+p+2*u)+f}else p=s,d=Math.max(0,-(o*p+a)),v=-d*d+p*(p+2*u)+f;else p=-s,d=Math.max(0,-(o*p+a)),v=-d*d+p*(p+2*u)+f;else p<=-y?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-u),s),v=-d*d+p*(p+2*u)+f):p<=y?(d=0,p=Math.min(Math.max(-s,-u),s),v=p*(p+2*u)+f):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-u),s),v=-d*d+p*(p+2*u)+f);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),v=-d*d+p*(p+2*u)+f;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(hg).addScaledVector(Bh,p),v}intersectSphere(e,t){cs.subVectors(e.center,this.origin);const i=cs.dot(this.direction),r=cs.dot(cs)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,u=i+o;return u<0?null:a<0?this.at(u,t):this.at(a,t)}intersectsSphere(e){return 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,r,s,o,a,u;const f=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return f>=0?(i=(e.min.x-p.x)*f,r=(e.max.x-p.x)*f):(i=(e.max.x-p.x)*f,r=(e.min.x-p.x)*f),h>=0?(s=(e.min.y-p.y)*h,o=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,o=(e.min.y-p.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-p.z)*d,u=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,u=(e.min.z-p.z)*d),i>u||a>r)||((a>i||i!==i)&&(i=a),(u=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,cs)!==null}intersectTriangle(e,t,i,r,s){dg.subVectors(t,e),Hh.subVectors(i,e),pg.crossVectors(dg,Hh);let o=this.direction.dot(pg),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Xs.subVectors(this.origin,e);const u=a*this.direction.dot(Hh.crossVectors(Xs,Hh));if(u<0)return null;const f=a*this.direction.dot(dg.cross(Xs));if(f<0||u+f>o)return null;const h=-a*Xs.dot(pg);return h<0?null:this.at(h/o,s)}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 ft{constructor(e,t,i,r,s,o,a,u,f,h,d,p,v,y,w,S){ft.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,u,f,h,d,p,v,y,w,S)}set(e,t,i,r,s,o,a,u,f,h,d,p,v,y,w,S){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=s,g[5]=o,g[9]=a,g[13]=u,g[2]=f,g[6]=h,g[10]=d,g[14]=p,g[3]=v,g[7]=y,g[11]=w,g[15]=S,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new ft().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/Qa.setFromMatrixColumn(e,0).length(),s=1/Qa.setFromMatrixColumn(e,1).length(),o=1/Qa.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),u=Math.cos(r),f=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=o*h,v=o*d,y=a*h,w=a*d;t[0]=u*h,t[4]=-u*d,t[8]=f,t[1]=v+y*f,t[5]=p-w*f,t[9]=-a*u,t[2]=w-p*f,t[6]=y+v*f,t[10]=o*u}else if(e.order==="YXZ"){const p=u*h,v=u*d,y=f*h,w=f*d;t[0]=p+w*a,t[4]=y*a-v,t[8]=o*f,t[1]=o*d,t[5]=o*h,t[9]=-a,t[2]=v*a-y,t[6]=w+p*a,t[10]=o*u}else if(e.order==="ZXY"){const p=u*h,v=u*d,y=f*h,w=f*d;t[0]=p-w*a,t[4]=-o*d,t[8]=y+v*a,t[1]=v+y*a,t[5]=o*h,t[9]=w-p*a,t[2]=-o*f,t[6]=a,t[10]=o*u}else if(e.order==="ZYX"){const p=o*h,v=o*d,y=a*h,w=a*d;t[0]=u*h,t[4]=y*f-v,t[8]=p*f+w,t[1]=u*d,t[5]=w*f+p,t[9]=v*f-y,t[2]=-f,t[6]=a*u,t[10]=o*u}else if(e.order==="YZX"){const p=o*u,v=o*f,y=a*u,w=a*f;t[0]=u*h,t[4]=w-p*d,t[8]=y*d+v,t[1]=d,t[5]=o*h,t[9]=-a*h,t[2]=-f*h,t[6]=v*d+y,t[10]=p-w*d}else if(e.order==="XZY"){const p=o*u,v=o*f,y=a*u,w=a*f;t[0]=u*h,t[4]=-d,t[8]=f*h,t[1]=p*d+w,t[5]=o*h,t[9]=v*d-y,t[2]=y*d-v,t[6]=a*h,t[10]=w*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(nP,e,iP)}lookAt(e,t,i){const r=this.elements;return ki.subVectors(e,t),ki.lengthSq()===0&&(ki.z=1),ki.normalize(),js.crossVectors(i,ki),js.lengthSq()===0&&(Math.abs(i.z)===1?ki.x+=1e-4:ki.z+=1e-4,ki.normalize(),js.crossVectors(i,ki)),js.normalize(),Vh.crossVectors(ki,js),r[0]=js.x,r[4]=Vh.x,r[8]=ki.x,r[1]=js.y,r[5]=Vh.y,r[9]=ki.y,r[2]=js.z,r[6]=Vh.z,r[10]=ki.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],u=i[8],f=i[12],h=i[1],d=i[5],p=i[9],v=i[13],y=i[2],w=i[6],S=i[10],g=i[14],x=i[3],M=i[7],T=i[11],P=i[15],C=r[0],L=r[4],D=r[8],b=r[12],R=r[1],k=r[5],q=r[9],oe=r[13],V=r[2],Q=r[6],te=r[10],ae=r[14],N=r[3],B=r[7],H=r[11],Y=r[15];return s[0]=o*C+a*R+u*V+f*N,s[4]=o*L+a*k+u*Q+f*B,s[8]=o*D+a*q+u*te+f*H,s[12]=o*b+a*oe+u*ae+f*Y,s[1]=h*C+d*R+p*V+v*N,s[5]=h*L+d*k+p*Q+v*B,s[9]=h*D+d*q+p*te+v*H,s[13]=h*b+d*oe+p*ae+v*Y,s[2]=y*C+w*R+S*V+g*N,s[6]=y*L+w*k+S*Q+g*B,s[10]=y*D+w*q+S*te+g*H,s[14]=y*b+w*oe+S*ae+g*Y,s[3]=x*C+M*R+T*V+P*N,s[7]=x*L+M*k+T*Q+P*B,s[11]=x*D+M*q+T*te+P*H,s[15]=x*b+M*oe+T*ae+P*Y,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],u=e[9],f=e[13],h=e[2],d=e[6],p=e[10],v=e[14],y=e[3],w=e[7],S=e[11],g=e[15];return y*(+s*u*d-r*f*d-s*a*p+i*f*p+r*a*v-i*u*v)+w*(+t*u*v-t*f*p+s*o*p-r*o*v+r*f*h-s*u*h)+S*(+t*f*d-t*a*v-s*o*d+i*o*v+s*a*h-i*f*h)+g*(-r*a*h-t*u*d+t*a*p+r*o*d-i*o*p+i*u*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],f=e[7],h=e[8],d=e[9],p=e[10],v=e[11],y=e[12],w=e[13],S=e[14],g=e[15],x=d*S*f-w*p*f+w*u*v-a*S*v-d*u*g+a*p*g,M=y*p*f-h*S*f-y*u*v+o*S*v+h*u*g-o*p*g,T=h*w*f-y*d*f+y*a*v-o*w*v-h*a*g+o*d*g,P=y*d*u-h*w*u-y*a*p+o*w*p+h*a*S-o*d*S,C=t*x+i*M+r*T+s*P;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/C;return e[0]=x*L,e[1]=(w*p*s-d*S*s-w*r*v+i*S*v+d*r*g-i*p*g)*L,e[2]=(a*S*s-w*u*s+w*r*f-i*S*f-a*r*g+i*u*g)*L,e[3]=(d*u*s-a*p*s-d*r*f+i*p*f+a*r*v-i*u*v)*L,e[4]=M*L,e[5]=(h*S*s-y*p*s+y*r*v-t*S*v-h*r*g+t*p*g)*L,e[6]=(y*u*s-o*S*s-y*r*f+t*S*f+o*r*g-t*u*g)*L,e[7]=(o*p*s-h*u*s+h*r*f-t*p*f-o*r*v+t*u*v)*L,e[8]=T*L,e[9]=(y*d*s-h*w*s-y*i*v+t*w*v+h*i*g-t*d*g)*L,e[10]=(o*w*s-y*a*s+y*i*f-t*w*f-o*i*g+t*a*g)*L,e[11]=(h*a*s-o*d*s-h*i*f+t*d*f+o*i*v-t*a*v)*L,e[12]=P*L,e[13]=(h*w*r-y*d*r+y*i*p-t*w*p-h*i*S+t*d*S)*L,e[14]=(y*a*r-o*w*r-y*i*u+t*w*u+o*i*S-t*a*S)*L,e[15]=(o*d*r-h*a*r+h*i*u-t*d*u-o*i*p+t*a*p)*L,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,u=e.z,f=s*o,h=s*a;return this.set(f*o+i,f*a-r*u,f*u+r*a,0,f*a+r*u,h*a+i,h*u-r*o,0,f*u-r*a,h*u+r*o,s*u*u+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,u=t._w,f=s+s,h=o+o,d=a+a,p=s*f,v=s*h,y=s*d,w=o*h,S=o*d,g=a*d,x=u*f,M=u*h,T=u*d,P=i.x,C=i.y,L=i.z;return r[0]=(1-(w+g))*P,r[1]=(v+T)*P,r[2]=(y-M)*P,r[3]=0,r[4]=(v-T)*C,r[5]=(1-(p+g))*C,r[6]=(S+x)*C,r[7]=0,r[8]=(y+M)*L,r[9]=(S-x)*L,r[10]=(1-(p+w))*L,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=Qa.set(r[0],r[1],r[2]).length();const o=Qa.set(r[4],r[5],r[6]).length(),a=Qa.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Sr.copy(this);const f=1/s,h=1/o,d=1/a;return Sr.elements[0]*=f,Sr.elements[1]*=f,Sr.elements[2]*=f,Sr.elements[4]*=h,Sr.elements[5]*=h,Sr.elements[6]*=h,Sr.elements[8]*=d,Sr.elements[9]*=d,Sr.elements[10]*=d,t.setFromRotationMatrix(Sr),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=br){const u=this.elements,f=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),p=(i+r)/(i-r);let v,y;if(a===br)v=-(o+s)/(o-s),y=-2*o*s/(o-s);else if(a===Jl)v=-o/(o-s),y=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return u[0]=f,u[4]=0,u[8]=d,u[12]=0,u[1]=0,u[5]=h,u[9]=p,u[13]=0,u[2]=0,u[6]=0,u[10]=v,u[14]=y,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=br){const u=this.elements,f=1/(t-e),h=1/(i-r),d=1/(o-s),p=(t+e)*f,v=(i+r)*h;let y,w;if(a===br)y=(o+s)*d,w=-2*d;else if(a===Jl)y=s*d,w=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return u[0]=2*f,u[4]=0,u[8]=0,u[12]=-p,u[1]=0,u[5]=2*h,u[9]=0,u[13]=-v,u[2]=0,u[6]=0,u[10]=w,u[14]=-y,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Qa=new O,Sr=new ft,nP=new O(0,0,0),iP=new O(1,1,1),js=new O,Vh=new O,ki=new O,SS=new ft,MS=new oi;class pf{constructor(e=0,t=0,i=0,r=pf.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],u=r[1],f=r[5],h=r[9],d=r[2],p=r[6],v=r[10];switch(t){case"XYZ":this._y=Math.asin(dn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,f),this._z=0);break;case"YXZ":this._x=Math.asin(-dn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,v),this._z=Math.atan2(u,f)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(dn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,v),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-dn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,v),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(dn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,f),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,v));break;case"XZY":this._z=Math.asin(-dn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,f),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,v),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return SS.makeRotationFromQuaternion(e),this.setFromRotationMatrix(SS,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return MS.setFromEuler(this),this.setFromQuaternion(MS,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pf.DEFAULT_ORDER="XYZ";class fa{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,u){return a[u.uuid]===void 0&&(a[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const u=a.shapes;if(Array.isArray(u))for(let f=0,h=u.length;f0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),u.length>0&&(i.materials=u),f.length>0&&(i.textures=f),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),v.length>0&&(i.animations=v),y.length>0&&(i.nodes=y)}return i.object=r,i;function o(a){const u=[];for(const f in a){const h=a[f];delete h.metadata,u.push(h)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Mr.subVectors(r,t),fs.subVectors(i,t),mg.subVectors(e,t);const o=Mr.dot(Mr),a=Mr.dot(fs),u=Mr.dot(mg),f=fs.dot(fs),h=fs.dot(mg),d=o*f-a*a;if(d===0)return s.set(0,0,0),null;const p=1/d,v=(f*u-a*h)*p,y=(o*h-a*u)*p;return s.set(1-v-y,y,v)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,hs)===null?!1:hs.x>=0&&hs.y>=0&&hs.x+hs.y<=1}static getUV(e,t,i,r,s,o,a,u){return Wh===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Wh=!0),this.getInterpolation(e,t,i,r,s,o,a,u)}static getInterpolation(e,t,i,r,s,o,a,u){return this.getBarycoord(e,t,i,r,hs)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(s,hs.x),u.addScaledVector(o,hs.y),u.addScaledVector(a,hs.z),u)}static isFrontFacing(e,t,i,r){return Mr.subVectors(i,t),fs.subVectors(e,t),Mr.cross(fs).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),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 Mr.subVectors(this.c,this.b),fs.subVectors(this.a,this.b),Mr.cross(fs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ci.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ci.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return Wh===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Wh=!0),Ci.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}getInterpolation(e,t,i,r,s){return Ci.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Ci.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ci.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;el.subVectors(r,i),tl.subVectors(s,i),gg.subVectors(e,i);const u=el.dot(gg),f=tl.dot(gg);if(u<=0&&f<=0)return t.copy(i);vg.subVectors(e,r);const h=el.dot(vg),d=tl.dot(vg);if(h>=0&&d<=h)return t.copy(r);const p=u*d-h*f;if(p<=0&&u>=0&&h<=0)return o=u/(u-h),t.copy(i).addScaledVector(el,o);yg.subVectors(e,s);const v=el.dot(yg),y=tl.dot(yg);if(y>=0&&v<=y)return t.copy(s);const w=v*f-u*y;if(w<=0&&f>=0&&y<=0)return a=f/(f-y),t.copy(i).addScaledVector(tl,a);const S=h*y-v*d;if(S<=0&&d-h>=0&&v-y>=0)return CS.subVectors(s,r),a=(d-h)/(d-h+(v-y)),t.copy(r).addScaledVector(CS,a);const g=1/(S+w+p);return o=w*g,a=p*g,t.copy(i).addScaledVector(el,o).addScaledVector(tl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const NT={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},Ys={h:0,s:0,l:0},Xh={h:0,s:0,l:0};function _g(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Be{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 r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Cn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ft.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Ft.workingColorSpace){return this.r=e,this.g=t,this.b=i,Ft.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Ft.workingColorSpace){if(e=Ky(e,1),t=dn(t,0,1),i=dn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=_g(o,s,e+1/3),this.g=_g(o,s,e),this.b=_g(o,s,e-1/3)}return Ft.toWorkingColorSpace(this,r),this}setStyle(e,t=Cn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Cn){const i=NT[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Gl(e.r),this.g=Gl(e.g),this.b=Gl(e.b),this}copyLinearToSRGB(e){return this.r=ag(e.r),this.g=ag(e.g),this.b=ag(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cn){return Ft.fromWorkingColorSpace(ti.copy(this),e),Math.round(dn(ti.r*255,0,255))*65536+Math.round(dn(ti.g*255,0,255))*256+Math.round(dn(ti.b*255,0,255))}getHexString(e=Cn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ft.workingColorSpace){Ft.fromWorkingColorSpace(ti.copy(this),t);const i=ti.r,r=ti.g,s=ti.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let u,f;const h=(a+o)/2;if(a===o)u=0,f=0;else{const d=o-a;switch(f=h<=.5?d/(o+a):d/(2-o-a),o){case i:u=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}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){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,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&&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.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.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!==ca&&(i.blending=this.blending),this.side!==Rs&&(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!==Tp&&(i.blendSrc=this.blendSrc),this.blendDst!==Ap&&(i.blendDst=this.blendDst),this.blendEquation!==eo&&(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!==zu&&(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!==Tv&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Jo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Jo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Jo&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const u=s[a];delete u.metadata,o.push(u)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}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 r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class To extends Yn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=hf,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.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 vs=uP();function uP(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let u=0;u<256;++u){const f=u-127;f<-27?(i[u]=0,i[u|256]=32768,r[u]=24,r[u|256]=24):f<-14?(i[u]=1024>>-f-14,i[u|256]=1024>>-f-14|32768,r[u]=-f-1,r[u|256]=-f-1):f<=15?(i[u]=f+15<<10,i[u|256]=f+15<<10|32768,r[u]=13,r[u|256]=13):f<128?(i[u]=31744,i[u|256]=64512,r[u]=24,r[u|256]=24):(i[u]=31744,i[u|256]=64512,r[u]=13,r[u|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let u=1;u<1024;++u){let f=u<<13,h=0;for(;!(f&8388608);)f<<=1,h-=8388608;f&=-8388609,h+=947912704,s[u]=f|h}for(let u=1024;u<2048;++u)s[u]=939524096+(u-1024<<13);for(let u=1;u<31;++u)o[u]=u<<23;o[31]=1199570944,o[32]=2147483648;for(let u=33;u<63;++u)o[u]=2147483648+(u-32<<23);o[63]=3347054592;for(let u=1;u<64;++u)u!==32&&(a[u]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Ti(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=dn(n,-65504,65504),vs.floatView[0]=n;const e=vs.uint32View[0],t=e>>23&511;return vs.baseTable[t]+((e&8388607)>>vs.shiftTable[t])}function nu(n){const e=n>>10;return vs.uint32View[0]=vs.mantissaTable[vs.offsetTable[e]+(n&1023)]+vs.exponentTable[e],vs.floatView[0]}const fP={toHalfFloat:Ti,fromHalfFloat:nu},wn=new O,jh=new de;class Ht{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Yu,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=hr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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 r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const f in u)u[f]!==void 0&&(e[f]=u[f]);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 u in i){const f=i[u];e.data.attributes[u]=f.toJSON(e.data)}const r={};let s=!1;for(const u in this.morphAttributes){const f=this.morphAttributes[u],h=[];for(let d=0,p=f.length;d0&&(r[u]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),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(t));const r=e.attributes;for(const f in r){const h=r[f];this.setAttribute(f,h.clone(t))}const s=e.morphAttributes;for(const f in s){const h=[],d=s[f];for(let p=0,v=d.length;p0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(bS.copy(s).invert(),ko.copy(e.ray).applyMatrix4(bS),!(i.boundingBox!==null&&ko.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,ko)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,u=s.attributes.position,f=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,v=s.drawRange;if(a!==null)if(Array.isArray(o))for(let y=0,w=p.length;yt.far?null:{distance:f,point:$h.clone(),object:n}}function ed(n,e,t,i,r,s,o,a,u,f){n.getVertexPosition(a,il),n.getVertexPosition(u,rl),n.getVertexPosition(f,sl);const h=xP(n,e,t,i,il,rl,sl,Qh);if(h){r&&(Zh.fromBufferAttribute(r,a),Kh.fromBufferAttribute(r,u),Jh.fromBufferAttribute(r,f),h.uv=Ci.getInterpolation(Qh,il,rl,sl,Zh,Kh,Jh,new de)),s&&(Zh.fromBufferAttribute(s,a),Kh.fromBufferAttribute(s,u),Jh.fromBufferAttribute(s,f),h.uv1=Ci.getInterpolation(Qh,il,rl,sl,Zh,Kh,Jh,new de),h.uv2=h.uv1),o&&(PS.fromBufferAttribute(o,a),LS.fromBufferAttribute(o,u),IS.fromBufferAttribute(o,f),h.normal=Ci.getInterpolation(Qh,il,rl,sl,PS,LS,IS,new O),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:u,c:f,normal:new O,materialIndex:0};Ci.getNormal(il,rl,sl,d.normal),h.face=d}return h}class Ca extends St{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const u=[],f=[],h=[],d=[];let p=0,v=0;y("z","y","x",-1,-1,i,t,e,o,s,0),y("z","y","x",1,-1,i,t,-e,o,s,1),y("x","z","y",1,1,e,i,t,r,o,2),y("x","z","y",1,-1,e,i,-t,r,o,3),y("x","y","z",1,-1,e,t,i,r,s,4),y("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(u),this.setAttribute("position",new qe(f,3)),this.setAttribute("normal",new qe(h,3)),this.setAttribute("uv",new qe(d,2));function y(w,S,g,x,M,T,P,C,L,D,b){const R=T/L,k=P/D,q=T/2,oe=P/2,V=C/2,Q=L+1,te=D+1;let ae=0,N=0;const B=new O;for(let H=0;H0?1:-1,h.push(B.x,B.y,B.z),d.push(J/L),d.push(1-H/D),ae+=1}}for(let H=0;H0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class mf extends Ot{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ft,this.projectionMatrix=new ft,this.projectionMatrixInverse=new ft,this.coordinateSystem=br}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let pn=class extends mf{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ql*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ua*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ql*2*Math.atan(Math.tan(ua*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ua*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const u=o.fullWidth,f=o.fullHeight;s+=o.offsetX*r/u,t-=o.offsetY*i/f,r*=o.width/u,i*=o.height/f}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const ol=-90,al=1;class zT extends Ot{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new pn(ol,al,e,t);r.layers=this.layers,this.add(r);const s=new pn(ol,al,e,t);s.layers=this.layers,this.add(s);const o=new pn(ol,al,e,t);o.layers=this.layers,this.add(o);const a=new pn(ol,al,e,t);a.layers=this.layers,this.add(a);const u=new pn(ol,al,e,t);u.layers=this.layers,this.add(u);const f=new pn(ol,al,e,t);f.layers=this.layers,this.add(f)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,u]=t;for(const f of t)this.remove(f);if(e===br)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(e===Jl)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const f of t)this.add(f),f.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,u,f,h]=this.children,d=e.getRenderTarget(),p=e.getActiveCubeFace(),v=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const w=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,u),e.setRenderTarget(i,4,r),e.render(t,f),i.texture.generateMipmaps=w,e.setRenderTarget(i,5,r),e.render(t,h),e.setRenderTarget(d,p,v),e.xr.enabled=y,i.texture.needsPMREMUpdate=!0}}class gf extends mn{constructor(e,t,i,r,s,o,a,u,f,h){e=e!==void 0?e:[],t=t!==void 0?t:Ps,super(e,t,i,r,s,o,a,u,f,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class OT extends gr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];t.encoding!==void 0&&(mu("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===mo?Cn:Gi),this.texture=new gf(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:sn}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 ); + + } + `},r=new Ca(5,5,5),s=new $r({name:"CubemapFromEquirect",uniforms:$l(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:vi,blending:Es});s.uniforms.tEquirect.value=t;const o=new Rn(r,s),a=t.minFilter;return t.minFilter===_o&&(t.minFilter=sn),new zT(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const Mg=new O,EP=new O,TP=new wt;class gs{constructor(e=new O(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Mg.subVectors(i,t).cross(EP.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Mg),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}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||TP.getNormalMatrix(e),r=this.coplanarPoint(Mg).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),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 Bo=new ai,td=new O;class vf{constructor(e=new gs,t=new gs,i=new gs,r=new gs,s=new gs,o=new gs){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=br){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],u=r[3],f=r[4],h=r[5],d=r[6],p=r[7],v=r[8],y=r[9],w=r[10],S=r[11],g=r[12],x=r[13],M=r[14],T=r[15];if(i[0].setComponents(u-s,p-f,S-v,T-g).normalize(),i[1].setComponents(u+s,p+f,S+v,T+g).normalize(),i[2].setComponents(u+o,p+h,S+y,T+x).normalize(),i[3].setComponents(u-o,p-h,S-y,T-x).normalize(),i[4].setComponents(u-a,p-d,S-w,T-M).normalize(),t===br)i[5].setComponents(u+a,p+d,S+w,T+M).normalize();else if(t===Jl)i[5].setComponents(a,d,w,M).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(),Bo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Bo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Bo)}intersectsSprite(e){return Bo.center.set(0,0,0),Bo.radius=.7071067811865476,Bo.applyMatrix4(e.matrixWorld),this.intersectsSphere(Bo)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,td.y=r.normal.y>0?e.max.y:e.min.y,td.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(td)<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)}}function FT(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function AP(n,e){const t=e.isWebGL2,i=new WeakMap;function r(f,h){const d=f.array,p=f.usage,v=d.byteLength,y=n.createBuffer();n.bindBuffer(h,y),n.bufferData(h,d,p),f.onUploadCallback();let w;if(d instanceof Float32Array)w=n.FLOAT;else if(d instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)w=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else w=n.UNSIGNED_SHORT;else if(d instanceof Int16Array)w=n.SHORT;else if(d instanceof Uint32Array)w=n.UNSIGNED_INT;else if(d instanceof Int32Array)w=n.INT;else if(d instanceof Int8Array)w=n.BYTE;else if(d instanceof Uint8Array)w=n.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)w=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:y,type:w,bytesPerElement:d.BYTES_PER_ELEMENT,version:f.version,size:v}}function s(f,h,d){const p=h.array,v=h._updateRange,y=h.updateRanges;if(n.bindBuffer(d,f),v.count===-1&&y.length===0&&n.bufferSubData(d,0,p),y.length!==0){for(let w=0,S=y.length;w 0 + vec4 plane; + #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`,GP=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,WP=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,XP=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,jP=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,YP=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,qP=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,ZP=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,KP=`#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 ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +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`,JP=`#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`,QP=`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`,$P=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,eL=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,tL=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,nL=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,iL="gl_FragColor = linearToOutputTexel( gl_FragColor );",rL=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +} +vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return sRGBTransferOETF( value ); +}`,sL=`#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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #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`,oL=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,aL=`#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`,lL=`#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`,cL=`#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`,uL=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,fL=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,hL=`#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`,dL=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,pL=`#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 +}`,mL=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,gL=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,vL=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,yL=`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`,_L=`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 ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +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`,xL=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, 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, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, 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`,SL=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,ML=`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`,wL=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,EL=`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`,TL=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +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 = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), 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_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.07, 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`,AL=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + #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; + #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 saturate(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.specularColor; + 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 * transposeMat3( 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 a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + 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 + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #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; +} +#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.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#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 ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +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 ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +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 ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#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 ); +}`,CL=` +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.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + 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 ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, 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.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.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`,bL=`#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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #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`,RL=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,PL=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,LL=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,IL=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,NL=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); + #else + if ( isPerspectiveMatrix( projectionMatrix ) ) { + gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; + gl_Position.z *= gl_Position.w; + } + #endif +#endif`,DL=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,UL=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,zL=`#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`,OL=`#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`,FL=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,kL=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,BL=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + 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`,HL=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,VL=`#ifdef USE_MORPHTARGETS + uniform float morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + 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 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,GL=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,WL=`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;`,XL=`#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`,jL=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,YL=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,qL=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,ZL=`#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`,KL=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,JL=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,QL=`#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`,$L=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,e6=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,t6=`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 vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( 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( 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 ) { + return depth * ( near - far ) - near; +} +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 ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,n6=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,i6=`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;`,r6=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,s6=`#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`,o6=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,a6=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,l6=`#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 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, 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 ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + vec3 lightToPosition = shadowCoord.xyz; + float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + return ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } +#endif`,c6=`#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 shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + 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 shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,u6=`#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`,f6=`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.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.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + 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.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,h6=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,d6=`#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`,p6=`#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`,m6=`#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`,g6=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,v6=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,y6=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,_6=`#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 OptimizedCineonToneMapping( 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 = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color *= toneMappingExposure; + 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; + return color; +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,x6=`#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.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, 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`,S6=`#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 ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + 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; + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + 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`,M6=`#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`,w6=`#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`,E6=`#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`,T6=`#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 A6=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,C6=`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 +}`,b6=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,R6=`#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; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,P6=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,L6=`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 +}`,I6=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,N6=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + vec4 diffuseColor = vec4( 1.0 ); + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,D6=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,U6=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + #include + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,z6=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,O6=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,F6=`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 +}`,k6=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,B6=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #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 +}`,H6=`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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #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 +}`,V6=`#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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,G6=`#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 +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,W6=`#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 + vViewPosition = - mvPosition.xyz; +}`,X6=`#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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #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 +}`,j6=`#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 +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Y6=`#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 +#include +void main() { + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,q6=`#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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Z6=`#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 +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,K6=`#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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,J6=`#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_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 +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + 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 +}`,Q6=`#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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,$6=`#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 +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,eI=`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 + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,tI=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,nI=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,iI=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,rI=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #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 +}`,sI=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,_t={alphahash_fragment:CP,alphahash_pars_fragment:bP,alphamap_fragment:RP,alphamap_pars_fragment:PP,alphatest_fragment:LP,alphatest_pars_fragment:IP,aomap_fragment:NP,aomap_pars_fragment:DP,batching_pars_vertex:UP,batching_vertex:zP,begin_vertex:OP,beginnormal_vertex:FP,bsdfs:kP,iridescence_fragment:BP,bumpmap_pars_fragment:HP,clipping_planes_fragment:VP,clipping_planes_pars_fragment:GP,clipping_planes_pars_vertex:WP,clipping_planes_vertex:XP,color_fragment:jP,color_pars_fragment:YP,color_pars_vertex:qP,color_vertex:ZP,common:KP,cube_uv_reflection_fragment:JP,defaultnormal_vertex:QP,displacementmap_pars_vertex:$P,displacementmap_vertex:eL,emissivemap_fragment:tL,emissivemap_pars_fragment:nL,colorspace_fragment:iL,colorspace_pars_fragment:rL,envmap_fragment:sL,envmap_common_pars_fragment:oL,envmap_pars_fragment:aL,envmap_pars_vertex:lL,envmap_physical_pars_fragment:xL,envmap_vertex:cL,fog_vertex:uL,fog_pars_vertex:fL,fog_fragment:hL,fog_pars_fragment:dL,gradientmap_pars_fragment:pL,lightmap_fragment:mL,lightmap_pars_fragment:gL,lights_lambert_fragment:vL,lights_lambert_pars_fragment:yL,lights_pars_begin:_L,lights_toon_fragment:SL,lights_toon_pars_fragment:ML,lights_phong_fragment:wL,lights_phong_pars_fragment:EL,lights_physical_fragment:TL,lights_physical_pars_fragment:AL,lights_fragment_begin:CL,lights_fragment_maps:bL,lights_fragment_end:RL,logdepthbuf_fragment:PL,logdepthbuf_pars_fragment:LL,logdepthbuf_pars_vertex:IL,logdepthbuf_vertex:NL,map_fragment:DL,map_pars_fragment:UL,map_particle_fragment:zL,map_particle_pars_fragment:OL,metalnessmap_fragment:FL,metalnessmap_pars_fragment:kL,morphcolor_vertex:BL,morphnormal_vertex:HL,morphtarget_pars_vertex:VL,morphtarget_vertex:GL,normal_fragment_begin:WL,normal_fragment_maps:XL,normal_pars_fragment:jL,normal_pars_vertex:YL,normal_vertex:qL,normalmap_pars_fragment:ZL,clearcoat_normal_fragment_begin:KL,clearcoat_normal_fragment_maps:JL,clearcoat_pars_fragment:QL,iridescence_pars_fragment:$L,opaque_fragment:e6,packing:t6,premultiplied_alpha_fragment:n6,project_vertex:i6,dithering_fragment:r6,dithering_pars_fragment:s6,roughnessmap_fragment:o6,roughnessmap_pars_fragment:a6,shadowmap_pars_fragment:l6,shadowmap_pars_vertex:c6,shadowmap_vertex:u6,shadowmask_pars_fragment:f6,skinbase_vertex:h6,skinning_pars_vertex:d6,skinning_vertex:p6,skinnormal_vertex:m6,specularmap_fragment:g6,specularmap_pars_fragment:v6,tonemapping_fragment:y6,tonemapping_pars_fragment:_6,transmission_fragment:x6,transmission_pars_fragment:S6,uv_pars_fragment:M6,uv_pars_vertex:w6,uv_vertex:E6,worldpos_vertex:T6,background_vert:A6,background_frag:C6,backgroundCube_vert:b6,backgroundCube_frag:R6,cube_vert:P6,cube_frag:L6,depth_vert:I6,depth_frag:N6,distanceRGBA_vert:D6,distanceRGBA_frag:U6,equirect_vert:z6,equirect_frag:O6,linedashed_vert:F6,linedashed_frag:k6,meshbasic_vert:B6,meshbasic_frag:H6,meshlambert_vert:V6,meshlambert_frag:G6,meshmatcap_vert:W6,meshmatcap_frag:X6,meshnormal_vert:j6,meshnormal_frag:Y6,meshphong_vert:q6,meshphong_frag:Z6,meshphysical_vert:K6,meshphysical_frag:J6,meshtoon_vert:Q6,meshtoon_frag:$6,points_vert:eI,points_frag:tI,shadow_vert:nI,shadow_frag:iI,sprite_vert:rI,sprite_frag:sI},Pe={common:{diffuse:{value:new Be(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new wt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new wt},normalScale:{value:new de(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Be(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Be(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0},uvTransform:{value:new wt}},sprite:{diffuse:{value:new Be(16777215)},opacity:{value:1},center:{value:new de(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}}},Cr={basic:{uniforms:hi([Pe.common,Pe.specularmap,Pe.envmap,Pe.aomap,Pe.lightmap,Pe.fog]),vertexShader:_t.meshbasic_vert,fragmentShader:_t.meshbasic_frag},lambert:{uniforms:hi([Pe.common,Pe.specularmap,Pe.envmap,Pe.aomap,Pe.lightmap,Pe.emissivemap,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.fog,Pe.lights,{emissive:{value:new Be(0)}}]),vertexShader:_t.meshlambert_vert,fragmentShader:_t.meshlambert_frag},phong:{uniforms:hi([Pe.common,Pe.specularmap,Pe.envmap,Pe.aomap,Pe.lightmap,Pe.emissivemap,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.fog,Pe.lights,{emissive:{value:new Be(0)},specular:{value:new Be(1118481)},shininess:{value:30}}]),vertexShader:_t.meshphong_vert,fragmentShader:_t.meshphong_frag},standard:{uniforms:hi([Pe.common,Pe.envmap,Pe.aomap,Pe.lightmap,Pe.emissivemap,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.roughnessmap,Pe.metalnessmap,Pe.fog,Pe.lights,{emissive:{value:new Be(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_t.meshphysical_vert,fragmentShader:_t.meshphysical_frag},toon:{uniforms:hi([Pe.common,Pe.aomap,Pe.lightmap,Pe.emissivemap,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.gradientmap,Pe.fog,Pe.lights,{emissive:{value:new Be(0)}}]),vertexShader:_t.meshtoon_vert,fragmentShader:_t.meshtoon_frag},matcap:{uniforms:hi([Pe.common,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,Pe.fog,{matcap:{value:null}}]),vertexShader:_t.meshmatcap_vert,fragmentShader:_t.meshmatcap_frag},points:{uniforms:hi([Pe.points,Pe.fog]),vertexShader:_t.points_vert,fragmentShader:_t.points_frag},dashed:{uniforms:hi([Pe.common,Pe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_t.linedashed_vert,fragmentShader:_t.linedashed_frag},depth:{uniforms:hi([Pe.common,Pe.displacementmap]),vertexShader:_t.depth_vert,fragmentShader:_t.depth_frag},normal:{uniforms:hi([Pe.common,Pe.bumpmap,Pe.normalmap,Pe.displacementmap,{opacity:{value:1}}]),vertexShader:_t.meshnormal_vert,fragmentShader:_t.meshnormal_frag},sprite:{uniforms:hi([Pe.sprite,Pe.fog]),vertexShader:_t.sprite_vert,fragmentShader:_t.sprite_frag},background:{uniforms:{uvTransform:{value:new wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_t.background_vert,fragmentShader:_t.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:_t.backgroundCube_vert,fragmentShader:_t.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_t.cube_vert,fragmentShader:_t.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_t.equirect_vert,fragmentShader:_t.equirect_frag},distanceRGBA:{uniforms:hi([Pe.common,Pe.displacementmap,{referencePosition:{value:new O},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_t.distanceRGBA_vert,fragmentShader:_t.distanceRGBA_frag},shadow:{uniforms:hi([Pe.lights,Pe.fog,{color:{value:new Be(0)},opacity:{value:1}}]),vertexShader:_t.shadow_vert,fragmentShader:_t.shadow_frag}};Cr.physical={uniforms:hi([Cr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new wt},clearcoatNormalScale:{value:new de(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new wt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new wt},sheen:{value:0},sheenColor:{value:new Be(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new wt},transmissionSamplerSize:{value:new de},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new wt},attenuationDistance:{value:0},attenuationColor:{value:new Be(0)},specularColor:{value:new Be(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new wt},anisotropyVector:{value:new de},anisotropyMap:{value:null},anisotropyMapTransform:{value:new wt}}]),vertexShader:_t.meshphysical_vert,fragmentShader:_t.meshphysical_frag};const nd={r:0,b:0,g:0};function oI(n,e,t,i,r,s,o){const a=new Be(0);let u=s===!0?0:1,f,h,d=null,p=0,v=null;function y(S,g){let x=!1,M=g.isScene===!0?g.background:null;M&&M.isTexture&&(M=(g.backgroundBlurriness>0?t:e).get(M)),M===null?w(a,u):M&&M.isColor&&(w(M,1),x=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||x)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),M&&(M.isCubeTexture||M.mapping===oc)?(h===void 0&&(h=new Rn(new Ca(1,1,1),new $r({name:"BackgroundCubeMaterial",uniforms:$l(Cr.backgroundCube.uniforms),vertexShader:Cr.backgroundCube.vertexShader,fragmentShader:Cr.backgroundCube.fragmentShader,side:vi,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(P,C,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),h.material.uniforms.envMap.value=M,h.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,h.material.toneMapped=Ft.getTransfer(M.colorSpace)!==jt,(d!==M||p!==M.version||v!==n.toneMapping)&&(h.material.needsUpdate=!0,d=M,p=M.version,v=n.toneMapping),h.layers.enableAll(),S.unshift(h,h.geometry,h.material,0,0,null)):M&&M.isTexture&&(f===void 0&&(f=new Rn(new yf(2,2),new $r({name:"BackgroundMaterial",uniforms:$l(Cr.background.uniforms),vertexShader:Cr.background.vertexShader,fragmentShader:Cr.background.fragmentShader,side:Rs,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),Object.defineProperty(f.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(f)),f.material.uniforms.t2D.value=M,f.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,f.material.toneMapped=Ft.getTransfer(M.colorSpace)!==jt,M.matrixAutoUpdate===!0&&M.updateMatrix(),f.material.uniforms.uvTransform.value.copy(M.matrix),(d!==M||p!==M.version||v!==n.toneMapping)&&(f.material.needsUpdate=!0,d=M,p=M.version,v=n.toneMapping),f.layers.enableAll(),S.unshift(f,f.geometry,f.material,0,0,null))}function w(S,g){S.getRGB(nd,DT(n)),i.buffers.color.setClear(nd.r,nd.g,nd.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(S,g=1){a.set(S),u=g,w(a,u)},getClearAlpha:function(){return u},setClearAlpha:function(S){u=S,w(a,u)},render:y}}function aI(n,e,t,i){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},u=S(null);let f=u,h=!1;function d(V,Q,te,ae,N){let B=!1;if(o){const H=w(ae,te,Q);f!==H&&(f=H,v(f.object)),B=g(V,ae,te,N),B&&x(V,ae,te,N)}else{const H=Q.wireframe===!0;(f.geometry!==ae.id||f.program!==te.id||f.wireframe!==H)&&(f.geometry=ae.id,f.program=te.id,f.wireframe=H,B=!0)}N!==null&&t.update(N,n.ELEMENT_ARRAY_BUFFER),(B||h)&&(h=!1,D(V,Q,te,ae),N!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(N).buffer))}function p(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function v(V){return i.isWebGL2?n.bindVertexArray(V):s.bindVertexArrayOES(V)}function y(V){return i.isWebGL2?n.deleteVertexArray(V):s.deleteVertexArrayOES(V)}function w(V,Q,te){const ae=te.wireframe===!0;let N=a[V.id];N===void 0&&(N={},a[V.id]=N);let B=N[Q.id];B===void 0&&(B={},N[Q.id]=B);let H=B[ae];return H===void 0&&(H=S(p()),B[ae]=H),H}function S(V){const Q=[],te=[],ae=[];for(let N=0;N=0){const ie=N[J];let pe=B[J];if(pe===void 0&&(J==="instanceMatrix"&&V.instanceMatrix&&(pe=V.instanceMatrix),J==="instanceColor"&&V.instanceColor&&(pe=V.instanceColor)),ie===void 0||ie.attribute!==pe||pe&&ie.data!==pe.data)return!0;H++}return f.attributesNum!==H||f.index!==ae}function x(V,Q,te,ae){const N={},B=Q.attributes;let H=0;const Y=te.getAttributes();for(const J in Y)if(Y[J].location>=0){let ie=B[J];ie===void 0&&(J==="instanceMatrix"&&V.instanceMatrix&&(ie=V.instanceMatrix),J==="instanceColor"&&V.instanceColor&&(ie=V.instanceColor));const pe={};pe.attribute=ie,ie&&ie.data&&(pe.data=ie.data),N[J]=pe,H++}f.attributes=N,f.attributesNum=H,f.index=ae}function M(){const V=f.newAttributes;for(let Q=0,te=V.length;Q=0){let Z=N[Y];if(Z===void 0&&(Y==="instanceMatrix"&&V.instanceMatrix&&(Z=V.instanceMatrix),Y==="instanceColor"&&V.instanceColor&&(Z=V.instanceColor)),Z!==void 0){const ie=Z.normalized,pe=Z.itemSize,Ee=t.get(Z);if(Ee===void 0)continue;const Te=Ee.buffer,nt=Ee.type,lt=Ee.bytesPerElement,Xe=i.isWebGL2===!0&&(nt===n.INT||nt===n.UNSIGNED_INT||Z.gpuType===By);if(Z.isInterleavedBufferAttribute){const Ke=Z.data,G=Ke.stride,we=Z.offset;if(Ke.isInstancedInterleavedBuffer){for(let me=0;me0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";L="mediump"}return L==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const u=s(a);u!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",u,"instead."),a=u);const f=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),w=n.getParameter(n.MAX_VERTEX_ATTRIBS),S=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),x=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),M=p>0,T=o||e.has("OES_texture_float"),P=M&&T,C=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:f,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:v,maxCubemapSize:y,maxAttributes:w,maxVertexUniforms:S,maxVaryings:g,maxFragmentUniforms:x,vertexTextures:M,floatFragmentTextures:T,floatVertexTextures:P,maxSamples:C}}function uI(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new gs,a=new wt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const v=d.length!==0||p||i!==0||r;return r=p,i=d.length,v},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,p){t=h(d,p,0)},this.setState=function(d,p,v){const y=d.clippingPlanes,w=d.clipIntersection,S=d.clipShadows,g=n.get(d);if(!r||y===null||y.length===0||s&&!S)s?h(null):f();else{const x=s?0:i,M=x*4;let T=g.clippingState||null;u.value=T,T=h(y,p,M,v);for(let P=0;P!==M;++P)T[P]=t[P];g.clippingState=T,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=x}};function f(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,v,y){const w=d!==null?d.length:0;let S=null;if(w!==0){if(S=u.value,y!==!0||S===null){const g=v+w*4,x=p.matrixWorldInverse;a.getNormalMatrix(x),(S===null||S.length0){const f=new OT(u.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const u=e.get(a);u!==void 0&&(e.delete(a),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Ss extends mf{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=f*this.view.offsetX,o=s+f*this.view.width,a-=h*this.view.offsetY,u=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,u,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Il=4,NS=[.125,.215,.35,.446,.526,.582],$o=20,wg=new Ss,DS=new Be;let Eg=null,Tg=0,Ag=0;const Qo=(1+Math.sqrt(5))/2,ll=1/Qo,US=[new O(1,1,1),new O(-1,1,1),new O(1,1,-1),new O(-1,1,-1),new O(0,Qo,ll),new O(0,Qo,-ll),new O(ll,0,Qo),new O(-ll,0,Qo),new O(Qo,ll,0),new O(-Qo,ll,0)];class bv{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Eg=this._renderer.getRenderTarget(),Tg=this._renderer.getActiveCubeFace(),Ag=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=FS(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=OS(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.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._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?M:0,M,M),h.setRenderTarget(r),w&&h.render(y,a),h.render(e,a)}y.geometry.dispose(),y.material.dispose(),h.toneMapping=p,h.autoClear=d,e.background=S}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Ps||e.mapping===yo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=FS()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=OS());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Rn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const u=this._cubeSize;id(t,0,0,3*u,2*u),i.setRenderTarget(t),i.render(o,wg)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r$o&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${S} samples when the maximum is set to ${$o}`);const g=[];let x=0;for(let L=0;L<$o;++L){const D=L/w,b=Math.exp(-D*D/2);g.push(b),L===0?x+=b:LM-Il?r-M+Il:0),C=4*(this._cubeSize-T);id(t,P,C,3*T,2*T),u.setRenderTarget(t),u.render(d,wg)}}function hI(n){const e=[],t=[],i=[];let r=n;const s=n-Il+1+NS.length;for(let o=0;on-Il?u=NS[o-n+Il-1]:o===0&&(u=0),i.push(u);const f=1/(a-2),h=-f,d=1+f,p=[h,h,d,h,d,d,h,h,d,d,h,d],v=6,y=6,w=3,S=2,g=1,x=new Float32Array(w*y*v),M=new Float32Array(S*y*v),T=new Float32Array(g*y*v);for(let C=0;C2?0:-1,b=[L,D,0,L+2/3,D,0,L+2/3,D+1,0,L,D,0,L+2/3,D+1,0,L,D+1,0];x.set(b,w*y*C),M.set(p,S*y*C);const R=[C,C,C,C,C,C];T.set(R,g*y*C)}const P=new St;P.setAttribute("position",new Ht(x,w)),P.setAttribute("uv",new Ht(M,S)),P.setAttribute("faceIndex",new Ht(T,g)),e.push(P),r>Il&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function zS(n,e,t){const i=new gr(n,e,t);return i.texture.mapping=oc,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function id(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function dI(n,e,t){const i=new Float32Array($o),r=new O(0,1,0);return new $r({name:"SphericalGaussianBlur",defines:{n:$o,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:t_(),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:Es,depthTest:!1,depthWrite:!1})}function OS(){return new $r({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:t_(),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:Es,depthTest:!1,depthWrite:!1})}function FS(){return new $r({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:t_(),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:Es,depthTest:!1,depthWrite:!1})}function t_(){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 ); + + } + `}function pI(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const u=a.mapping,f=u===Ou||u===Fu,h=u===Ps||u===yo;if(f||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return t===null&&(t=new bv(n)),d=f?t.fromEquirectangular(a,d):t.fromCubemap(a,d),e.set(a,d),d.texture}else{if(e.has(a))return e.get(a).texture;{const d=a.image;if(f&&d&&d.height>0||h&&d&&r(d)){t===null&&(t=new bv(n));const p=f?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function r(a){let u=0;const f=6;for(let h=0;he.maxTextureSize&&(k=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const q=new Float32Array(R*k*4*w),oe=new nm(q,R,k,w);oe.type=hr,oe.needsUpdate=!0;const V=b*4;for(let te=0;te0)return n;const r=e*t;let s=kS[r];if(s===void 0&&(s=new Float32Array(r),kS[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Pn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}function g8(n){const e=Ft.getPrimaries(Ft.workingColorSpace),t=Ft.getPrimaries(n);let i;switch(e===t?i="":e===ju&&t===Xu?i="LinearDisplayP3ToLinearSRGB":e===Xu&&t===ju&&(i="LinearSRGBToLinearDisplayP3"),n){case Qr:case df:return[i,"LinearTransferOETF"];case Cn:case tm:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function jS(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` + +`+r+` + +`+m8(n.getShaderSource(e),o)}else return r}function v8(n,e){const t=g8(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function y8(n,e){let t;switch(e){case iT:t="Linear";break;case rT:t="Reinhard";break;case sT:t="OptimizedCineon";break;case Fy:t="ACESFilmic";break;case aT:t="AgX";break;case oT:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function _8(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Nl).join(` +`)}function x8(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":""].filter(Nl).join(` +`)}function S8(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function M8(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function Rv(n){return n.replace(w8,T8)}const E8=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function T8(n,e){let t=_t[e];if(t===void 0){const i=E8.get(e);if(i!==void 0)t=_t[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Rv(t)}const A8=/#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 ZS(n){return n.replace(A8,C8)}function C8(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(g+=` +`),x=[v,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w].filter(Nl).join(` +`),x.length>0&&(x+=` +`)):(g=[KS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",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 "+h:"",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&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+u:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Nl).join(` +`),x=[v,KS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.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.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?"#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 "+u:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Zr?"#define TONE_MAPPING":"",t.toneMapping!==Zr?_t.tonemapping_pars_fragment:"",t.toneMapping!==Zr?y8("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",_t.colorspace_pars_fragment,v8("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Nl).join(` +`)),o=Rv(o),o=YS(o,t),o=qS(o,t),a=Rv(a),a=YS(a,t),a=qS(a,t),o=ZS(o),a=ZS(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(M=`#version 300 es +`,g=[y,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,x=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===Av?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Av?"":"#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(` +`)+` +`+x);const T=M+g+o,P=M+x+a,C=XS(r,r.VERTEX_SHADER,T),L=XS(r,r.FRAGMENT_SHADER,P);r.attachShader(S,C),r.attachShader(S,L),t.index0AttributeName!==void 0?r.bindAttribLocation(S,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(S,0,"position"),r.linkProgram(S);function D(q){if(n.debug.checkShaderErrors){const oe=r.getProgramInfoLog(S).trim(),V=r.getShaderInfoLog(C).trim(),Q=r.getShaderInfoLog(L).trim();let te=!0,ae=!0;if(r.getProgramParameter(S,r.LINK_STATUS)===!1)if(te=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,S,C,L);else{const N=jS(r,C,"vertex"),B=jS(r,L,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(S,r.VALIDATE_STATUS)+` + +Program Info Log: `+oe+` +`+N+` +`+B)}else oe!==""?console.warn("THREE.WebGLProgram: Program Info Log:",oe):(V===""||Q==="")&&(ae=!1);ae&&(q.diagnostics={runnable:te,programLog:oe,vertexShader:{log:V,prefix:g},fragmentShader:{log:Q,prefix:x}})}r.deleteShader(C),r.deleteShader(L),b=new Jd(r,S),R=M8(r,S)}let b;this.getUniforms=function(){return b===void 0&&D(this),b};let R;this.getAttributes=function(){return R===void 0&&D(this),R};let k=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return k===!1&&(k=r.getProgramParameter(S,d8)),k},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=p8++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=C,this.fragmentShader=L,this}let D8=0;class U8{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.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 z8(e),t.set(e,i)),i}}class z8{constructor(e){this.id=D8++,this.code=e,this.usedTimes=0}}function O8(n,e,t,i,r,s,o){const a=new fa,u=new U8,f=[],h=r.isWebGL2,d=r.logarithmicDepthBuffer,p=r.vertexTextures;let v=r.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function w(b){return b===0?"uv":`uv${b}`}function S(b,R,k,q,oe){const V=q.fog,Q=oe.geometry,te=b.isMeshStandardMaterial?q.environment:null,ae=(b.isMeshStandardMaterial?t:e).get(b.envMap||te),N=ae&&ae.mapping===oc?ae.image.height:null,B=y[b.type];b.precision!==null&&(v=r.getMaxPrecision(b.precision),v!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",v,"instead."));const H=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,Y=H!==void 0?H.length:0;let J=0;Q.morphAttributes.position!==void 0&&(J=1),Q.morphAttributes.normal!==void 0&&(J=2),Q.morphAttributes.color!==void 0&&(J=3);let Z,ie,pe,Ee;if(B){const Jt=Cr[B];Z=Jt.vertexShader,ie=Jt.fragmentShader}else Z=b.vertexShader,ie=b.fragmentShader,u.update(b),pe=u.getVertexShaderID(b),Ee=u.getFragmentShaderID(b);const Te=n.getRenderTarget(),nt=oe.isInstancedMesh===!0,lt=oe.isBatchedMesh===!0,Xe=!!b.map,Ke=!!b.matcap,G=!!ae,we=!!b.aoMap,me=!!b.lightMap,Ce=!!b.bumpMap,he=!!b.normalMap,Ze=!!b.displacementMap,Ne=!!b.emissiveMap,U=!!b.metalnessMap,I=!!b.roughnessMap,ee=b.anisotropy>0,xe=b.clearcoat>0,_e=b.iridescence>0,ye=b.sheen>0,je=b.transmission>0,Le=ee&&!!b.anisotropyMap,Fe=xe&&!!b.clearcoatMap,tt=xe&&!!b.clearcoatNormalMap,dt=xe&&!!b.clearcoatRoughnessMap,Se=_e&&!!b.iridescenceMap,Ct=_e&&!!b.iridescenceThicknessMap,yt=ye&&!!b.sheenColorMap,ct=ye&&!!b.sheenRoughnessMap,et=!!b.specularMap,He=!!b.specularColorMap,X=!!b.specularIntensityMap,ge=je&&!!b.transmissionMap,Oe=je&&!!b.thicknessMap,Ue=!!b.gradientMap,Me=!!b.alphaMap,W=b.alphaTest>0,Re=!!b.alphaHash,Ie=!!b.extensions,it=!!Q.attributes.uv1,Ye=!!Q.attributes.uv2,At=!!Q.attributes.uv3;let Rt=Zr;return b.toneMapped&&(Te===null||Te.isXRRenderTarget===!0)&&(Rt=n.toneMapping),{isWebGL2:h,shaderID:B,shaderType:b.type,shaderName:b.name,vertexShader:Z,fragmentShader:ie,defines:b.defines,customVertexShaderID:pe,customFragmentShaderID:Ee,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:v,batching:lt,instancing:nt,instancingColor:nt&&oe.instanceColor!==null,supportsVertexTextures:p,outputColorSpace:Te===null?n.outputColorSpace:Te.isXRRenderTarget===!0?Te.texture.colorSpace:Qr,map:Xe,matcap:Ke,envMap:G,envMapMode:G&&ae.mapping,envMapCubeUVHeight:N,aoMap:we,lightMap:me,bumpMap:Ce,normalMap:he,displacementMap:p&&Ze,emissiveMap:Ne,normalMapObjectSpace:he&&b.normalMapType===MT,normalMapTangentSpace:he&&b.normalMapType===Eo,metalnessMap:U,roughnessMap:I,anisotropy:ee,anisotropyMap:Le,clearcoat:xe,clearcoatMap:Fe,clearcoatNormalMap:tt,clearcoatRoughnessMap:dt,iridescence:_e,iridescenceMap:Se,iridescenceThicknessMap:Ct,sheen:ye,sheenColorMap:yt,sheenRoughnessMap:ct,specularMap:et,specularColorMap:He,specularIntensityMap:X,transmission:je,transmissionMap:ge,thicknessMap:Oe,gradientMap:Ue,opaque:b.transparent===!1&&b.blending===ca,alphaMap:Me,alphaTest:W,alphaHash:Re,combine:b.combine,mapUv:Xe&&w(b.map.channel),aoMapUv:we&&w(b.aoMap.channel),lightMapUv:me&&w(b.lightMap.channel),bumpMapUv:Ce&&w(b.bumpMap.channel),normalMapUv:he&&w(b.normalMap.channel),displacementMapUv:Ze&&w(b.displacementMap.channel),emissiveMapUv:Ne&&w(b.emissiveMap.channel),metalnessMapUv:U&&w(b.metalnessMap.channel),roughnessMapUv:I&&w(b.roughnessMap.channel),anisotropyMapUv:Le&&w(b.anisotropyMap.channel),clearcoatMapUv:Fe&&w(b.clearcoatMap.channel),clearcoatNormalMapUv:tt&&w(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:dt&&w(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Se&&w(b.iridescenceMap.channel),iridescenceThicknessMapUv:Ct&&w(b.iridescenceThicknessMap.channel),sheenColorMapUv:yt&&w(b.sheenColorMap.channel),sheenRoughnessMapUv:ct&&w(b.sheenRoughnessMap.channel),specularMapUv:et&&w(b.specularMap.channel),specularColorMapUv:He&&w(b.specularColorMap.channel),specularIntensityMapUv:X&&w(b.specularIntensityMap.channel),transmissionMapUv:ge&&w(b.transmissionMap.channel),thicknessMapUv:Oe&&w(b.thicknessMap.channel),alphaMapUv:Me&&w(b.alphaMap.channel),vertexTangents:!!Q.attributes.tangent&&(he||ee),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!Q.attributes.color&&Q.attributes.color.itemSize===4,vertexUv1s:it,vertexUv2s:Ye,vertexUv3s:At,pointsUvs:oe.isPoints===!0&&!!Q.attributes.uv&&(Xe||Me),fog:!!V,useFog:b.fog===!0,fogExp2:V&&V.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:oe.isSkinnedMesh===!0,morphTargets:Q.morphAttributes.position!==void 0,morphNormals:Q.morphAttributes.normal!==void 0,morphColors:Q.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:J,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&k.length>0,shadowMapType:n.shadowMap.type,toneMapping:Rt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Xe&&b.map.isVideoTexture===!0&&Ft.getTransfer(b.map.colorSpace)===jt,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===jr,flipSided:b.side===vi,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Ie&&b.extensions.derivatives===!0,extensionFragDepth:Ie&&b.extensions.fragDepth===!0,extensionDrawBuffers:Ie&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ie&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Ie&&b.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()}}function g(b){const R=[];if(b.shaderID?R.push(b.shaderID):(R.push(b.customVertexShaderID),R.push(b.customFragmentShaderID)),b.defines!==void 0)for(const k in b.defines)R.push(k),R.push(b.defines[k]);return b.isRawShaderMaterial===!1&&(x(R,b),M(R,b),R.push(n.outputColorSpace)),R.push(b.customProgramCacheKey),R.join()}function x(b,R){b.push(R.precision),b.push(R.outputColorSpace),b.push(R.envMapMode),b.push(R.envMapCubeUVHeight),b.push(R.mapUv),b.push(R.alphaMapUv),b.push(R.lightMapUv),b.push(R.aoMapUv),b.push(R.bumpMapUv),b.push(R.normalMapUv),b.push(R.displacementMapUv),b.push(R.emissiveMapUv),b.push(R.metalnessMapUv),b.push(R.roughnessMapUv),b.push(R.anisotropyMapUv),b.push(R.clearcoatMapUv),b.push(R.clearcoatNormalMapUv),b.push(R.clearcoatRoughnessMapUv),b.push(R.iridescenceMapUv),b.push(R.iridescenceThicknessMapUv),b.push(R.sheenColorMapUv),b.push(R.sheenRoughnessMapUv),b.push(R.specularMapUv),b.push(R.specularColorMapUv),b.push(R.specularIntensityMapUv),b.push(R.transmissionMapUv),b.push(R.thicknessMapUv),b.push(R.combine),b.push(R.fogExp2),b.push(R.sizeAttenuation),b.push(R.morphTargetsCount),b.push(R.morphAttributeCount),b.push(R.numDirLights),b.push(R.numPointLights),b.push(R.numSpotLights),b.push(R.numSpotLightMaps),b.push(R.numHemiLights),b.push(R.numRectAreaLights),b.push(R.numDirLightShadows),b.push(R.numPointLightShadows),b.push(R.numSpotLightShadows),b.push(R.numSpotLightShadowsWithMaps),b.push(R.numLightProbes),b.push(R.shadowMapType),b.push(R.toneMapping),b.push(R.numClippingPlanes),b.push(R.numClipIntersection),b.push(R.depthPacking)}function M(b,R){a.disableAll(),R.isWebGL2&&a.enable(0),R.supportsVertexTextures&&a.enable(1),R.instancing&&a.enable(2),R.instancingColor&&a.enable(3),R.matcap&&a.enable(4),R.envMap&&a.enable(5),R.normalMapObjectSpace&&a.enable(6),R.normalMapTangentSpace&&a.enable(7),R.clearcoat&&a.enable(8),R.iridescence&&a.enable(9),R.alphaTest&&a.enable(10),R.vertexColors&&a.enable(11),R.vertexAlphas&&a.enable(12),R.vertexUv1s&&a.enable(13),R.vertexUv2s&&a.enable(14),R.vertexUv3s&&a.enable(15),R.vertexTangents&&a.enable(16),R.anisotropy&&a.enable(17),R.alphaHash&&a.enable(18),R.batching&&a.enable(19),b.push(a.mask),a.disableAll(),R.fog&&a.enable(0),R.useFog&&a.enable(1),R.flatShading&&a.enable(2),R.logarithmicDepthBuffer&&a.enable(3),R.skinning&&a.enable(4),R.morphTargets&&a.enable(5),R.morphNormals&&a.enable(6),R.morphColors&&a.enable(7),R.premultipliedAlpha&&a.enable(8),R.shadowMapEnabled&&a.enable(9),R.useLegacyLights&&a.enable(10),R.doubleSided&&a.enable(11),R.flipSided&&a.enable(12),R.useDepthPacking&&a.enable(13),R.dithering&&a.enable(14),R.transmission&&a.enable(15),R.sheen&&a.enable(16),R.opaque&&a.enable(17),R.pointsUvs&&a.enable(18),R.decodeVideoTexture&&a.enable(19),b.push(a.mask)}function T(b){const R=y[b.type];let k;if(R){const q=Cr[R];k=UT.clone(q.uniforms)}else k=b.uniforms;return k}function P(b,R){let k;for(let q=0,oe=f.length;q0?i.push(g):v.transparent===!0?r.push(g):t.push(g)}function u(d,p,v,y,w,S){const g=o(d,p,v,y,w,S);v.transmission>0?i.unshift(g):v.transparent===!0?r.unshift(g):t.unshift(g)}function f(d,p){t.length>1&&t.sort(d||k8),i.length>1&&i.sort(p||JS),r.length>1&&r.sort(p||JS)}function h(){for(let d=e,p=n.length;d=s.length?(o=new QS,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function H8(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new O,color:new Be};break;case"SpotLight":t={position:new O,direction:new O,color:new Be,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new O,color:new Be,distance:0,decay:0};break;case"HemisphereLight":t={direction:new O,skyColor:new Be,groundColor:new Be};break;case"RectAreaLight":t={color:new Be,position:new O,halfWidth:new O,halfHeight:new O};break}return n[e.id]=t,t}}}function V8(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let G8=0;function W8(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function X8(n,e){const t=new H8,i=V8(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)r.probe.push(new O);const s=new O,o=new ft,a=new ft;function u(h,d){let p=0,v=0,y=0;for(let q=0;q<9;q++)r.probe[q].set(0,0,0);let w=0,S=0,g=0,x=0,M=0,T=0,P=0,C=0,L=0,D=0,b=0;h.sort(W8);const R=d===!0?Math.PI:1;for(let q=0,oe=h.length;q0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Pe.LTC_FLOAT_1,r.rectAreaLTC2=Pe.LTC_FLOAT_2):(r.rectAreaLTC1=Pe.LTC_HALF_1,r.rectAreaLTC2=Pe.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Pe.LTC_FLOAT_1,r.rectAreaLTC2=Pe.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Pe.LTC_HALF_1,r.rectAreaLTC2=Pe.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=p,r.ambient[1]=v,r.ambient[2]=y;const k=r.hash;(k.directionalLength!==w||k.pointLength!==S||k.spotLength!==g||k.rectAreaLength!==x||k.hemiLength!==M||k.numDirectionalShadows!==T||k.numPointShadows!==P||k.numSpotShadows!==C||k.numSpotMaps!==L||k.numLightProbes!==b)&&(r.directional.length=w,r.spot.length=g,r.rectArea.length=x,r.point.length=S,r.hemi.length=M,r.directionalShadow.length=T,r.directionalShadowMap.length=T,r.pointShadow.length=P,r.pointShadowMap.length=P,r.spotShadow.length=C,r.spotShadowMap.length=C,r.directionalShadowMatrix.length=T,r.pointShadowMatrix.length=P,r.spotLightMatrix.length=C+L-D,r.spotLightMap.length=L,r.numSpotLightShadowsWithMaps=D,r.numLightProbes=b,k.directionalLength=w,k.pointLength=S,k.spotLength=g,k.rectAreaLength=x,k.hemiLength=M,k.numDirectionalShadows=T,k.numPointShadows=P,k.numSpotShadows=C,k.numSpotMaps=L,k.numLightProbes=b,r.version=G8++)}function f(h,d){let p=0,v=0,y=0,w=0,S=0;const g=d.matrixWorldInverse;for(let x=0,M=h.length;x=a.length?(u=new $S(n,e),a.push(u)):u=a[o],u}function r(){t=new WeakMap}return{get:i,dispose:r}}class n_ extends Yn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=xT,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 i_ extends Yn{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}}const Y8=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,q8=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +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 = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Z8(n,e,t){let i=new vf;const r=new de,s=new de,o=new kt,a=new n_({depthPacking:ST}),u=new i_,f={},h=t.maxTextureSize,d={[Rs]:vi,[vi]:Rs,[jr]:jr},p=new $r({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new de},radius:{value:4}},vertexShader:Y8,fragmentShader:q8}),v=p.clone();v.defines.HORIZONTAL_PASS=1;const y=new St;y.setAttribute("position",new Ht(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new Rn(y,p),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Jp;let g=this.type;this.render=function(C,L,D){if(S.enabled===!1||S.autoUpdate===!1&&S.needsUpdate===!1||C.length===0)return;const b=n.getRenderTarget(),R=n.getActiveCubeFace(),k=n.getActiveMipmapLevel(),q=n.state;q.setBlending(Es),q.buffers.color.setClear(1,1,1,1),q.buffers.depth.setTest(!0),q.setScissorTest(!1);const oe=g!==Er&&this.type===Er,V=g===Er&&this.type!==Er;for(let Q=0,te=C.length;Qh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/B.x),r.x=s.x*B.x,N.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/B.y),r.y=s.y*B.y,N.mapSize.y=s.y)),N.map===null||oe===!0||V===!0){const Y=this.type!==Er?{minFilter:_n,magFilter:_n}:{};N.map!==null&&N.map.dispose(),N.map=new gr(r.x,r.y,Y),N.map.texture.name=ae.name+".shadowMap",N.camera.updateProjectionMatrix()}n.setRenderTarget(N.map),n.clear();const H=N.getViewportCount();for(let Y=0;Y0||L.map&&L.alphaTest>0){const q=R.uuid,oe=L.uuid;let V=f[q];V===void 0&&(V={},f[q]=V);let Q=V[oe];Q===void 0&&(Q=R.clone(),V[oe]=Q,L.addEventListener("dispose",P)),R=Q}if(R.visible=L.visible,R.wireframe=L.wireframe,b===Er?R.side=L.shadowSide!==null?L.shadowSide:L.side:R.side=L.shadowSide!==null?L.shadowSide:d[L.side],R.alphaMap=L.alphaMap,R.alphaTest=L.alphaTest,R.map=L.map,R.clipShadows=L.clipShadows,R.clippingPlanes=L.clippingPlanes,R.clipIntersection=L.clipIntersection,R.displacementMap=L.displacementMap,R.displacementScale=L.displacementScale,R.displacementBias=L.displacementBias,R.wireframeLinewidth=L.wireframeLinewidth,R.linewidth=L.linewidth,D.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const q=n.properties.get(R);q.light=D}return R}function T(C,L,D,b,R){if(C.visible===!1)return;if(C.layers.test(L.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&R===Er)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,C.matrixWorld);const oe=e.update(C),V=C.material;if(Array.isArray(V)){const Q=oe.groups;for(let te=0,ae=Q.length;te=1):H.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),N=B>=2);let Y=null,J={};const Z=n.getParameter(n.SCISSOR_BOX),ie=n.getParameter(n.VIEWPORT),pe=new kt().fromArray(Z),Ee=new kt().fromArray(ie);function Te(W,Re,Ie,it){const Ye=new Uint8Array(4),At=n.createTexture();n.bindTexture(W,At),n.texParameteri(W,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(W,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Rt=0;Rt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new WeakMap;let d;const p=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(U,I){return v?new OffscreenCanvas(U,I):qu("canvas")}function w(U,I,ee,xe){let _e=1;if((U.width>xe||U.height>xe)&&(_e=xe/Math.max(U.width,U.height)),_e<1||I===!0)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap){const ye=I?Rp:Math.floor,je=ye(_e*U.width),Le=ye(_e*U.height);d===void 0&&(d=y(je,Le));const Fe=ee?y(je,Le):d;return Fe.width=je,Fe.height=Le,Fe.getContext("2d").drawImage(U,0,0,je,Le),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+U.width+"x"+U.height+") to ("+je+"x"+Le+")."),Fe}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+U.width+"x"+U.height+")."),U;return U}function S(U){return Cv(U.width)&&Cv(U.height)}function g(U){return a?!1:U.wrapS!==si||U.wrapT!==si||U.minFilter!==_n&&U.minFilter!==sn}function x(U,I){return U.generateMipmaps&&I&&U.minFilter!==_n&&U.minFilter!==sn}function M(U){n.generateMipmap(U)}function T(U,I,ee,xe,_e=!1){if(a===!1)return I;if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let ye=I;if(I===n.RED&&(ee===n.FLOAT&&(ye=n.R32F),ee===n.HALF_FLOAT&&(ye=n.R16F),ee===n.UNSIGNED_BYTE&&(ye=n.R8)),I===n.RED_INTEGER&&(ee===n.UNSIGNED_BYTE&&(ye=n.R8UI),ee===n.UNSIGNED_SHORT&&(ye=n.R16UI),ee===n.UNSIGNED_INT&&(ye=n.R32UI),ee===n.BYTE&&(ye=n.R8I),ee===n.SHORT&&(ye=n.R16I),ee===n.INT&&(ye=n.R32I)),I===n.RG&&(ee===n.FLOAT&&(ye=n.RG32F),ee===n.HALF_FLOAT&&(ye=n.RG16F),ee===n.UNSIGNED_BYTE&&(ye=n.RG8)),I===n.RGBA){const je=_e?Wu:Ft.getTransfer(xe);ee===n.FLOAT&&(ye=n.RGBA32F),ee===n.HALF_FLOAT&&(ye=n.RGBA16F),ee===n.UNSIGNED_BYTE&&(ye=je===jt?n.SRGB8_ALPHA8:n.RGBA8),ee===n.UNSIGNED_SHORT_4_4_4_4&&(ye=n.RGBA4),ee===n.UNSIGNED_SHORT_5_5_5_1&&(ye=n.RGB5_A1)}return(ye===n.R16F||ye===n.R32F||ye===n.RG16F||ye===n.RG32F||ye===n.RGBA16F||ye===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ye}function P(U,I,ee){return x(U,ee)===!0||U.isFramebufferTexture&&U.minFilter!==_n&&U.minFilter!==sn?Math.log2(Math.max(I.width,I.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?I.mipmaps.length:1}function C(U){return U===_n||U===Cp||U===du?n.NEAREST:n.LINEAR}function L(U){const I=U.target;I.removeEventListener("dispose",L),b(I),I.isVideoTexture&&h.delete(I)}function D(U){const I=U.target;I.removeEventListener("dispose",D),k(I)}function b(U){const I=i.get(U);if(I.__webglInit===void 0)return;const ee=U.source,xe=p.get(ee);if(xe){const _e=xe[I.__cacheKey];_e.usedTimes--,_e.usedTimes===0&&R(U),Object.keys(xe).length===0&&p.delete(ee)}i.remove(U)}function R(U){const I=i.get(U);n.deleteTexture(I.__webglTexture);const ee=U.source,xe=p.get(ee);delete xe[I.__cacheKey],o.memory.textures--}function k(U){const I=U.texture,ee=i.get(U),xe=i.get(I);if(xe.__webglTexture!==void 0&&(n.deleteTexture(xe.__webglTexture),o.memory.textures--),U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++){if(Array.isArray(ee.__webglFramebuffer[_e]))for(let ye=0;ye=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+r.maxTextures),q+=1,U}function Q(U){const I=[];return I.push(U.wrapS),I.push(U.wrapT),I.push(U.wrapR||0),I.push(U.magFilter),I.push(U.minFilter),I.push(U.anisotropy),I.push(U.internalFormat),I.push(U.format),I.push(U.type),I.push(U.generateMipmaps),I.push(U.premultiplyAlpha),I.push(U.flipY),I.push(U.unpackAlignment),I.push(U.colorSpace),I.join()}function te(U,I){const ee=i.get(U);if(U.isVideoTexture&&Ze(U),U.isRenderTargetTexture===!1&&U.version>0&&ee.__version!==U.version){const xe=U.image;if(xe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(xe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{pe(ee,U,I);return}}t.bindTexture(n.TEXTURE_2D,ee.__webglTexture,n.TEXTURE0+I)}function ae(U,I){const ee=i.get(U);if(U.version>0&&ee.__version!==U.version){pe(ee,U,I);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ee.__webglTexture,n.TEXTURE0+I)}function N(U,I){const ee=i.get(U);if(U.version>0&&ee.__version!==U.version){pe(ee,U,I);return}t.bindTexture(n.TEXTURE_3D,ee.__webglTexture,n.TEXTURE0+I)}function B(U,I){const ee=i.get(U);if(U.version>0&&ee.__version!==U.version){Ee(ee,U,I);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ee.__webglTexture,n.TEXTURE0+I)}const H={[ku]:n.REPEAT,[si]:n.CLAMP_TO_EDGE,[Bu]:n.MIRRORED_REPEAT},Y={[_n]:n.NEAREST,[Cp]:n.NEAREST_MIPMAP_NEAREST,[du]:n.NEAREST_MIPMAP_LINEAR,[sn]:n.LINEAR,[ky]:n.LINEAR_MIPMAP_NEAREST,[_o]:n.LINEAR_MIPMAP_LINEAR},J={[wT]:n.NEVER,[RT]:n.ALWAYS,[ET]:n.LESS,[Zy]:n.LEQUAL,[TT]:n.EQUAL,[bT]:n.GEQUAL,[AT]:n.GREATER,[CT]:n.NOTEQUAL};function Z(U,I,ee){if(ee?(n.texParameteri(U,n.TEXTURE_WRAP_S,H[I.wrapS]),n.texParameteri(U,n.TEXTURE_WRAP_T,H[I.wrapT]),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,H[I.wrapR]),n.texParameteri(U,n.TEXTURE_MAG_FILTER,Y[I.magFilter]),n.texParameteri(U,n.TEXTURE_MIN_FILTER,Y[I.minFilter])):(n.texParameteri(U,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(U,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(I.wrapS!==si||I.wrapT!==si)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(U,n.TEXTURE_MAG_FILTER,C(I.magFilter)),n.texParameteri(U,n.TEXTURE_MIN_FILTER,C(I.minFilter)),I.minFilter!==_n&&I.minFilter!==sn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),I.compareFunction&&(n.texParameteri(U,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(U,n.TEXTURE_COMPARE_FUNC,J[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const xe=e.get("EXT_texture_filter_anisotropic");if(I.magFilter===_n||I.minFilter!==du&&I.minFilter!==_o||I.type===hr&&e.has("OES_texture_float_linear")===!1||a===!1&&I.type===xa&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||i.get(I).__currentAnisotropy)&&(n.texParameterf(U,xe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,r.getMaxAnisotropy())),i.get(I).__currentAnisotropy=I.anisotropy)}}function ie(U,I){let ee=!1;U.__webglInit===void 0&&(U.__webglInit=!0,I.addEventListener("dispose",L));const xe=I.source;let _e=p.get(xe);_e===void 0&&(_e={},p.set(xe,_e));const ye=Q(I);if(ye!==U.__cacheKey){_e[ye]===void 0&&(_e[ye]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ee=!0),_e[ye].usedTimes++;const je=_e[U.__cacheKey];je!==void 0&&(_e[U.__cacheKey].usedTimes--,je.usedTimes===0&&R(I)),U.__cacheKey=ye,U.__webglTexture=_e[ye].texture}return ee}function pe(U,I,ee){let xe=n.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(xe=n.TEXTURE_2D_ARRAY),I.isData3DTexture&&(xe=n.TEXTURE_3D);const _e=ie(U,I),ye=I.source;t.bindTexture(xe,U.__webglTexture,n.TEXTURE0+ee);const je=i.get(ye);if(ye.version!==je.__version||_e===!0){t.activeTexture(n.TEXTURE0+ee);const Le=Ft.getPrimaries(Ft.workingColorSpace),Fe=I.colorSpace===Gi?null:Ft.getPrimaries(I.colorSpace),tt=I.colorSpace===Gi||Le===Fe?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,I.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,I.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,tt);const dt=g(I)&&S(I.image)===!1;let Se=w(I.image,dt,!1,r.maxTextureSize);Se=Ne(I,Se);const Ct=S(Se)||a,yt=s.convert(I.format,I.colorSpace);let ct=s.convert(I.type),et=T(I.internalFormat,yt,ct,I.colorSpace,I.isVideoTexture);Z(xe,I,Ct);let He;const X=I.mipmaps,ge=a&&I.isVideoTexture!==!0&&et!==jy,Oe=je.__version===void 0||_e===!0,Ue=P(I,Se,Ct);if(I.isDepthTexture)et=n.DEPTH_COMPONENT,a?I.type===hr?et=n.DEPTH_COMPONENT32F:I.type===xs?et=n.DEPTH_COMPONENT24:I.type===ho?et=n.DEPTH24_STENCIL8:et=n.DEPTH_COMPONENT16:I.type===hr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===po&&et===n.DEPTH_COMPONENT&&I.type!==$p&&I.type!==xs&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=xs,ct=s.convert(I.type)),I.format===Sa&&et===n.DEPTH_COMPONENT&&(et=n.DEPTH_STENCIL,I.type!==ho&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=ho,ct=s.convert(I.type))),Oe&&(ge?t.texStorage2D(n.TEXTURE_2D,1,et,Se.width,Se.height):t.texImage2D(n.TEXTURE_2D,0,et,Se.width,Se.height,0,yt,ct,null));else if(I.isDataTexture)if(X.length>0&&Ct){ge&&Oe&&t.texStorage2D(n.TEXTURE_2D,Ue,et,X[0].width,X[0].height);for(let Me=0,W=X.length;Me>=1,W>>=1}}else if(X.length>0&&Ct){ge&&Oe&&t.texStorage2D(n.TEXTURE_2D,Ue,et,X[0].width,X[0].height);for(let Me=0,W=X.length;Me0&&Oe++,t.texStorage2D(n.TEXTURE_CUBE_MAP,Oe,He,Se[0].width,Se[0].height));for(let Me=0;Me<6;Me++)if(dt){X?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Me,0,0,0,Se[Me].width,Se[Me].height,ct,et,Se[Me].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Me,0,He,Se[Me].width,Se[Me].height,0,ct,et,Se[Me].data);for(let W=0;W>ye),Se=Math.max(1,I.height>>ye);_e===n.TEXTURE_3D||_e===n.TEXTURE_2D_ARRAY?t.texImage3D(_e,ye,Fe,dt,Se,I.depth,0,je,Le,null):t.texImage2D(_e,ye,Fe,dt,Se,0,je,Le,null)}t.bindFramebuffer(n.FRAMEBUFFER,U),he(I)?u.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,xe,_e,i.get(ee).__webglTexture,0,Ce(I)):(_e===n.TEXTURE_2D||_e>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&_e<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,xe,_e,i.get(ee).__webglTexture,ye),t.bindFramebuffer(n.FRAMEBUFFER,null)}function nt(U,I,ee){if(n.bindRenderbuffer(n.RENDERBUFFER,U),I.depthBuffer&&!I.stencilBuffer){let xe=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(ee||he(I)){const _e=I.depthTexture;_e&&_e.isDepthTexture&&(_e.type===hr?xe=n.DEPTH_COMPONENT32F:_e.type===xs&&(xe=n.DEPTH_COMPONENT24));const ye=Ce(I);he(I)?u.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ye,xe,I.width,I.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,ye,xe,I.width,I.height)}else n.renderbufferStorage(n.RENDERBUFFER,xe,I.width,I.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,U)}else if(I.depthBuffer&&I.stencilBuffer){const xe=Ce(I);ee&&he(I)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,xe,n.DEPTH24_STENCIL8,I.width,I.height):he(I)?u.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,xe,n.DEPTH24_STENCIL8,I.width,I.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,I.width,I.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,U)}else{const xe=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let _e=0;_e0){ee.__webglFramebuffer[Le]=[];for(let Fe=0;Fe0){ee.__webglFramebuffer=[];for(let Le=0;Le0&&he(U)===!1){const Le=ye?I:[I];ee.__webglMultisampledFramebuffer=n.createFramebuffer(),ee.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ee.__webglMultisampledFramebuffer);for(let Fe=0;Fe0)for(let Fe=0;Fe0)for(let Fe=0;Fe0&&he(U)===!1){const I=U.isWebGLMultipleRenderTargets?U.texture:[U.texture],ee=U.width,xe=U.height;let _e=n.COLOR_BUFFER_BIT;const ye=[],je=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Le=i.get(U),Fe=U.isWebGLMultipleRenderTargets===!0;if(Fe)for(let tt=0;tt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function Ze(U){const I=o.render.frame;h.get(U)!==I&&(h.set(U,I),U.update())}function Ne(U,I){const ee=U.colorSpace,xe=U.format,_e=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||U.format===bp||ee!==Qr&&ee!==Gi&&(Ft.getTransfer(ee)===jt?a===!1?e.has("EXT_sRGB")===!0&&xe===pi?(U.format=bp,U.minFilter=sn,U.generateMipmaps=!1):I=Jy.sRGBToLinear(I):(xe!==pi||_e!==Kr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ee)),I}this.allocateTextureUnit=V,this.resetTextureUnits=oe,this.setTexture2D=te,this.setTexture2DArray=ae,this.setTexture3D=N,this.setTextureCube=B,this.rebindTextures=Ke,this.setupRenderTarget=G,this.updateRenderTargetMipmap=we,this.updateMultisampleRenderTarget=me,this.setupDepthRenderbuffer=Xe,this.setupFrameBufferTexture=Te,this.useMultisampledRTT=he}function WT(n,e,t){const i=t.isWebGL2;function r(s,o=Gi){let a;const u=Ft.getTransfer(o);if(s===Kr)return n.UNSIGNED_BYTE;if(s===Hy)return n.UNSIGNED_SHORT_4_4_4_4;if(s===Vy)return n.UNSIGNED_SHORT_5_5_5_1;if(s===cT)return n.BYTE;if(s===uT)return n.SHORT;if(s===$p)return n.UNSIGNED_SHORT;if(s===By)return n.INT;if(s===xs)return n.UNSIGNED_INT;if(s===hr)return n.FLOAT;if(s===xa)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===fT)return n.ALPHA;if(s===pi)return n.RGBA;if(s===hT)return n.LUMINANCE;if(s===dT)return n.LUMINANCE_ALPHA;if(s===po)return n.DEPTH_COMPONENT;if(s===Sa)return n.DEPTH_STENCIL;if(s===bp)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===pT)return n.RED;if(s===Gy)return n.RED_INTEGER;if(s===mT)return n.RG;if(s===Wy)return n.RG_INTEGER;if(s===Xy)return n.RGBA_INTEGER;if(s===Xd||s===jd||s===Yd||s===qd)if(u===jt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Xd)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===jd)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Yd)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===qd)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Xd)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===jd)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Yd)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===qd)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===ev||s===tv||s===nv||s===iv)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===ev)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===tv)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===nv)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===iv)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===jy)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===rv||s===sv)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===rv)return u===jt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===sv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===ov||s===av||s===lv||s===cv||s===uv||s===fv||s===hv||s===dv||s===pv||s===mv||s===gv||s===vv||s===yv||s===_v)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===ov)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===av)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===lv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===cv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===uv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===fv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===hv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===dv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===pv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===mv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===gv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===vv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===yv)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===_v)return u===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Zd||s===xv||s===Sv)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===Zd)return u===jt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===xv)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Sv)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===gT||s===Mv||s===wv||s===Ev)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===Zd)return a.COMPRESSED_RED_RGTC1_EXT;if(s===Mv)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===wv)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Ev)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===ho?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class XT extends pn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Dl extends Ot{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Q8={type:"move"};class bg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Dl,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Dl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new O,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new O),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Dl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new O,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new O),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,u=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const w of e.hand.values()){const S=t.getJointPose(w,i),g=this._getHandJoint(f,w);S!==null&&(g.matrix.fromArray(S.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=S.radius),g.visible=S!==null}const h=f.joints["index-finger-tip"],d=f.joints["thumb-tip"],p=h.position.distanceTo(d.position),v=.02,y=.005;f.inputState.pinching&&p>v+y?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&p<=v-y&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Q8)))}return a!==null&&(a.visible=r!==null),u!==null&&(u.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Dl;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class $8 extends es{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",u=1,f=null,h=null,d=null,p=null,v=null,y=null;const w=t.getContextAttributes();let S=null,g=null;const x=[],M=[],T=new de;let P=null;const C=new pn;C.layers.enable(1),C.viewport=new kt;const L=new pn;L.layers.enable(2),L.viewport=new kt;const D=[C,L],b=new XT;b.layers.enable(1),b.layers.enable(2);let R=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let ie=x[Z];return ie===void 0&&(ie=new bg,x[Z]=ie),ie.getTargetRaySpace()},this.getControllerGrip=function(Z){let ie=x[Z];return ie===void 0&&(ie=new bg,x[Z]=ie),ie.getGripSpace()},this.getHand=function(Z){let ie=x[Z];return ie===void 0&&(ie=new bg,x[Z]=ie),ie.getHandSpace()};function q(Z){const ie=M.indexOf(Z.inputSource);if(ie===-1)return;const pe=x[ie];pe!==void 0&&(pe.update(Z.inputSource,Z.frame,f||o),pe.dispatchEvent({type:Z.type,data:Z.inputSource}))}function oe(){r.removeEventListener("select",q),r.removeEventListener("selectstart",q),r.removeEventListener("selectend",q),r.removeEventListener("squeeze",q),r.removeEventListener("squeezestart",q),r.removeEventListener("squeezeend",q),r.removeEventListener("end",oe),r.removeEventListener("inputsourceschange",V);for(let Z=0;Z=0&&(M[Ee]=null,x[Ee].disconnect(pe))}for(let ie=0;ie=M.length){M.push(pe),Ee=nt;break}else if(M[nt]===null){M[nt]=pe,Ee=nt;break}if(Ee===-1)break}const Te=x[Ee];Te&&Te.connect(pe)}}const Q=new O,te=new O;function ae(Z,ie,pe){Q.setFromMatrixPosition(ie.matrixWorld),te.setFromMatrixPosition(pe.matrixWorld);const Ee=Q.distanceTo(te),Te=ie.projectionMatrix.elements,nt=pe.projectionMatrix.elements,lt=Te[14]/(Te[10]-1),Xe=Te[14]/(Te[10]+1),Ke=(Te[9]+1)/Te[5],G=(Te[9]-1)/Te[5],we=(Te[8]-1)/Te[0],me=(nt[8]+1)/nt[0],Ce=lt*we,he=lt*me,Ze=Ee/(-we+me),Ne=Ze*-we;ie.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(Ne),Z.translateZ(Ze),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert();const U=lt+Ze,I=Xe+Ze,ee=Ce-Ne,xe=he+(Ee-Ne),_e=Ke*Xe/I*U,ye=G*Xe/I*U;Z.projectionMatrix.makePerspective(ee,xe,_e,ye,U,I),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}function N(Z,ie){ie===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(ie.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(r===null)return;b.near=L.near=C.near=Z.near,b.far=L.far=C.far=Z.far,(R!==b.near||k!==b.far)&&(r.updateRenderState({depthNear:b.near,depthFar:b.far}),R=b.near,k=b.far);const ie=Z.parent,pe=b.cameras;N(b,ie);for(let Ee=0;Ee0&&(S.alphaTest.value=g.alphaTest);const x=e.get(g).envMap;if(x&&(S.envMap.value=x,S.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,S.reflectivity.value=g.reflectivity,S.ior.value=g.ior,S.refractionRatio.value=g.refractionRatio),g.lightMap){S.lightMap.value=g.lightMap;const M=n._useLegacyLights===!0?Math.PI:1;S.lightMapIntensity.value=g.lightMapIntensity*M,t(g.lightMap,S.lightMapTransform)}g.aoMap&&(S.aoMap.value=g.aoMap,S.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,S.aoMapTransform))}function o(S,g){S.diffuse.value.copy(g.color),S.opacity.value=g.opacity,g.map&&(S.map.value=g.map,t(g.map,S.mapTransform))}function a(S,g){S.dashSize.value=g.dashSize,S.totalSize.value=g.dashSize+g.gapSize,S.scale.value=g.scale}function u(S,g,x,M){S.diffuse.value.copy(g.color),S.opacity.value=g.opacity,S.size.value=g.size*x,S.scale.value=M*.5,g.map&&(S.map.value=g.map,t(g.map,S.uvTransform)),g.alphaMap&&(S.alphaMap.value=g.alphaMap,t(g.alphaMap,S.alphaMapTransform)),g.alphaTest>0&&(S.alphaTest.value=g.alphaTest)}function f(S,g){S.diffuse.value.copy(g.color),S.opacity.value=g.opacity,S.rotation.value=g.rotation,g.map&&(S.map.value=g.map,t(g.map,S.mapTransform)),g.alphaMap&&(S.alphaMap.value=g.alphaMap,t(g.alphaMap,S.alphaMapTransform)),g.alphaTest>0&&(S.alphaTest.value=g.alphaTest)}function h(S,g){S.specular.value.copy(g.specular),S.shininess.value=Math.max(g.shininess,1e-4)}function d(S,g){g.gradientMap&&(S.gradientMap.value=g.gradientMap)}function p(S,g){S.metalness.value=g.metalness,g.metalnessMap&&(S.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,S.metalnessMapTransform)),S.roughness.value=g.roughness,g.roughnessMap&&(S.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,S.roughnessMapTransform)),e.get(g).envMap&&(S.envMapIntensity.value=g.envMapIntensity)}function v(S,g,x){S.ior.value=g.ior,g.sheen>0&&(S.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),S.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(S.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,S.sheenColorMapTransform)),g.sheenRoughnessMap&&(S.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,S.sheenRoughnessMapTransform))),g.clearcoat>0&&(S.clearcoat.value=g.clearcoat,S.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(S.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,S.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(S.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,S.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(S.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,S.clearcoatNormalMapTransform),S.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===vi&&S.clearcoatNormalScale.value.negate())),g.iridescence>0&&(S.iridescence.value=g.iridescence,S.iridescenceIOR.value=g.iridescenceIOR,S.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],S.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(S.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,S.iridescenceMapTransform)),g.iridescenceThicknessMap&&(S.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,S.iridescenceThicknessMapTransform))),g.transmission>0&&(S.transmission.value=g.transmission,S.transmissionSamplerMap.value=x.texture,S.transmissionSamplerSize.value.set(x.width,x.height),g.transmissionMap&&(S.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,S.transmissionMapTransform)),S.thickness.value=g.thickness,g.thicknessMap&&(S.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,S.thicknessMapTransform)),S.attenuationDistance.value=g.attenuationDistance,S.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(S.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(S.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,S.anisotropyMapTransform))),S.specularIntensity.value=g.specularIntensity,S.specularColor.value.copy(g.specularColor),g.specularColorMap&&(S.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,S.specularColorMapTransform)),g.specularIntensityMap&&(S.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,S.specularIntensityMapTransform))}function y(S,g){g.matcap&&(S.matcap.value=g.matcap)}function w(S,g){const x=e.get(g).light;S.referencePosition.value.setFromMatrixPosition(x.matrixWorld),S.nearDistance.value=x.shadow.camera.near,S.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function tN(n,e,t,i){let r={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function u(x,M){const T=M.program;i.uniformBlockBinding(x,T)}function f(x,M){let T=r[x.id];T===void 0&&(y(x),T=h(x),r[x.id]=T,x.addEventListener("dispose",S));const P=M.program;i.updateUBOMapping(x,P);const C=e.render.frame;s[x.id]!==C&&(p(x),s[x.id]=C)}function h(x){const M=d();x.__bindingPointIndex=M;const T=n.createBuffer(),P=x.__size,C=x.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,P,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,M,T),T}function d(){for(let x=0;x0&&(T+=P-C),x.__size=T,x.__cache={},this}function w(x){const M={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(M.boundary=4,M.storage=4):x.isVector2?(M.boundary=8,M.storage=8):x.isVector3||x.isColor?(M.boundary=16,M.storage=12):x.isVector4?(M.boundary=16,M.storage=16):x.isMatrix3?(M.boundary=48,M.storage=48):x.isMatrix4?(M.boundary=64,M.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),M}function S(x){const M=x.target;M.removeEventListener("dispose",S);const T=o.indexOf(M.__bindingPointIndex);o.splice(T,1),n.deleteBuffer(r[M.id]),delete r[M.id],delete s[M.id]}function g(){for(const x in r)n.deleteBuffer(r[x]);o=[],r={},s={}}return{bind:u,update:f,dispose:g}}class r_{constructor(e={}){const{canvas:t=LT(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:f=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let p;i!==null?p=i.getContextAttributes().alpha:p=o;const v=new Uint32Array(4),y=new Int32Array(4);let w=null,S=null;const g=[],x=[];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._outputColorSpace=Cn,this._useLegacyLights=!1,this.toneMapping=Zr,this.toneMappingExposure=1;const M=this;let T=!1,P=0,C=0,L=null,D=-1,b=null;const R=new kt,k=new kt;let q=null;const oe=new Be(0);let V=0,Q=t.width,te=t.height,ae=1,N=null,B=null;const H=new kt(0,0,Q,te),Y=new kt(0,0,Q,te);let J=!1;const Z=new vf;let ie=!1,pe=!1,Ee=null;const Te=new ft,nt=new de,lt=new O,Xe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ke(){return L===null?ae:1}let G=i;function we(z,$){for(let se=0;se{function ke(){if(le.forEach(function(Qe){Ne.get(Qe).currentProgram.isReady()&&le.delete(Qe)}),le.size===0){re(z);return}setTimeout(ke,10)}me.get("KHR_parallel_shader_compile")!==null?ke():setTimeout(ke,10)})};let Rt=null;function Gt(z){Rt&&Rt(z)}function Jt(){Bn.stop()}function Lt(){Bn.start()}const Bn=new FT;Bn.setAnimationLoop(Gt),typeof self<"u"&&Bn.setContext(self),this.setAnimationLoop=function(z){Rt=z,Ue.setAnimationLoop(z),z===null?Bn.stop():Bn.start()},Ue.addEventListener("sessionstart",Jt),Ue.addEventListener("sessionend",Lt),this.render=function(z,$){if($!==void 0&&$.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),$.parent===null&&$.matrixWorldAutoUpdate===!0&&$.updateMatrixWorld(),Ue.enabled===!0&&Ue.isPresenting===!0&&(Ue.cameraAutoUpdate===!0&&Ue.updateCamera($),$=Ue.getCamera()),z.isScene===!0&&z.onBeforeRender(M,z,$,L),S=tt.get(z,x.length),S.init(),x.push(S),Te.multiplyMatrices($.projectionMatrix,$.matrixWorldInverse),Z.setFromProjectionMatrix(Te),pe=this.localClippingEnabled,ie=dt.init(this.clippingPlanes,pe),w=Fe.get(z,g.length),w.init(),g.push(w),Ji(z,$,0,M.sortObjects),w.finish(),M.sortObjects===!0&&w.sort(N,B),this.info.render.frame++,ie===!0&&dt.beginShadows();const se=S.state.shadowsArray;if(Se.render(se,z,$),ie===!0&&dt.endShadows(),this.info.autoReset===!0&&this.info.reset(),Ct.render(w,z),S.setupLights(M._useLegacyLights),$.isArrayCamera){const le=$.cameras;for(let re=0,ke=le.length;re0?S=x[x.length-1]:S=null,g.pop(),g.length>0?w=g[g.length-1]:w=null};function Ji(z,$,se,le){if(z.visible===!1)return;if(z.layers.test($.layers)){if(z.isGroup)se=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update($);else if(z.isLight)S.pushLight(z),z.castShadow&&S.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||Z.intersectsSprite(z)){le&<.setFromMatrixPosition(z.matrixWorld).applyMatrix4(Te);const Qe=ye.update(z),st=z.material;st.visible&&w.push(z,Qe,st,se,lt.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||Z.intersectsObject(z))){const Qe=ye.update(z),st=z.material;if(le&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),lt.copy(z.boundingSphere.center)):(Qe.boundingSphere===null&&Qe.computeBoundingSphere(),lt.copy(Qe.boundingSphere.center)),lt.applyMatrix4(z.matrixWorld).applyMatrix4(Te)),Array.isArray(st)){const ot=Qe.groups;for(let pt=0,ht=ot.length;pt0&&fc(re,ke,$,se),le&&he.viewport(R.copy(le)),re.length>0&&La(re,$,se),ke.length>0&&La(ke,$,se),Qe.length>0&&La(Qe,$,se),he.buffers.depth.setTest(!0),he.buffers.depth.setMask(!0),he.buffers.color.setMask(!0),he.setPolygonOffset(!1)}function fc(z,$,se,le){if((se.isScene===!0?se.overrideMaterial:null)!==null)return;const ke=Ce.isWebGL2;Ee===null&&(Ee=new gr(1,1,{generateMipmaps:!0,type:me.has("EXT_color_buffer_half_float")?xa:Kr,minFilter:_o,samples:ke?4:0})),M.getDrawingBufferSize(nt),ke?Ee.setSize(nt.x,nt.y):Ee.setSize(Rp(nt.x),Rp(nt.y));const Qe=M.getRenderTarget();M.setRenderTarget(Ee),M.getClearColor(oe),V=M.getClearAlpha(),V<1&&M.setClearColor(16777215,.5),M.clear();const st=M.toneMapping;M.toneMapping=Zr,La(z,se,le),U.updateMultisampleRenderTarget(Ee),U.updateRenderTargetMipmap(Ee);let ot=!1;for(let pt=0,ht=$.length;pt0),mt=!!se.morphAttributes.position,tn=!!se.morphAttributes.normal,Hn=!!se.morphAttributes.color;let qt=Zr;le.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(qt=M.toneMapping);const In=se.morphAttributes.position||se.morphAttributes.normal||se.morphAttributes.color,at=In!==void 0?In.length:0,Ge=Ne.get(le),Qi=S.state.lights;if(ie===!0&&(pe===!0||z!==b)){const Vn=z===b&&le.id===D;dt.setState(le,z,Vn)}let Et=!1;le.version===Ge.__version?(Ge.needsLights&&Ge.lightsStateVersion!==Qi.state.version||Ge.outputColorSpace!==st||re.isBatchedMesh&&Ge.batching===!1||!re.isBatchedMesh&&Ge.batching===!0||re.isInstancedMesh&&Ge.instancing===!1||!re.isInstancedMesh&&Ge.instancing===!0||re.isSkinnedMesh&&Ge.skinning===!1||!re.isSkinnedMesh&&Ge.skinning===!0||re.isInstancedMesh&&Ge.instancingColor===!0&&re.instanceColor===null||re.isInstancedMesh&&Ge.instancingColor===!1&&re.instanceColor!==null||Ge.envMap!==ot||le.fog===!0&&Ge.fog!==ke||Ge.numClippingPlanes!==void 0&&(Ge.numClippingPlanes!==dt.numPlanes||Ge.numIntersection!==dt.numIntersection)||Ge.vertexAlphas!==pt||Ge.vertexTangents!==ht||Ge.morphTargets!==mt||Ge.morphNormals!==tn||Ge.morphColors!==Hn||Ge.toneMapping!==qt||Ce.isWebGL2===!0&&Ge.morphTargetsCount!==at)&&(Et=!0):(Et=!0,Ge.__version=le.version);let cn=Ge.currentProgram;Et===!0&&(cn=Ia(le,$,re));let Dr=!1,$i=!1,Nn=!1;const gn=cn.getUniforms(),Ur=Ge.uniforms;if(he.useProgram(cn.program)&&(Dr=!0,$i=!0,Nn=!0),le.id!==D&&(D=le.id,$i=!0),Dr||b!==z){gn.setValue(G,"projectionMatrix",z.projectionMatrix),gn.setValue(G,"viewMatrix",z.matrixWorldInverse);const Vn=gn.map.cameraPosition;Vn!==void 0&&Vn.setValue(G,lt.setFromMatrixPosition(z.matrixWorld)),Ce.logarithmicDepthBuffer&&gn.setValue(G,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(le.isMeshPhongMaterial||le.isMeshToonMaterial||le.isMeshLambertMaterial||le.isMeshBasicMaterial||le.isMeshStandardMaterial||le.isShaderMaterial)&&gn.setValue(G,"isOrthographic",z.isOrthographicCamera===!0),b!==z&&(b=z,$i=!0,Nn=!0)}if(re.isSkinnedMesh){gn.setOptional(G,re,"bindMatrix"),gn.setOptional(G,re,"bindMatrixInverse");const Vn=re.skeleton;Vn&&(Ce.floatVertexTextures?(Vn.boneTexture===null&&Vn.computeBoneTexture(),gn.setValue(G,"boneTexture",Vn.boneTexture,U)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}re.isBatchedMesh&&(gn.setOptional(G,re,"batchingTexture"),gn.setValue(G,"batchingTexture",re._matricesTexture,U));const Na=se.morphAttributes;if((Na.position!==void 0||Na.normal!==void 0||Na.color!==void 0&&Ce.isWebGL2===!0)&&yt.update(re,se,cn),($i||Ge.receiveShadow!==re.receiveShadow)&&(Ge.receiveShadow=re.receiveShadow,gn.setValue(G,"receiveShadow",re.receiveShadow)),le.isMeshGouraudMaterial&&le.envMap!==null&&(Ur.envMap.value=ot,Ur.flipEnvMap.value=ot.isCubeTexture&&ot.isRenderTargetTexture===!1?-1:1),$i&&(gn.setValue(G,"toneMappingExposure",M.toneMappingExposure),Ge.needsLights&&bm(Ur,Nn),ke&&le.fog===!0&&Le.refreshFogUniforms(Ur,ke),Le.refreshMaterialUniforms(Ur,le,ae,te,Ee),Jd.upload(G,Ef(Ge),Ur,U)),le.isShaderMaterial&&le.uniformsNeedUpdate===!0&&(Jd.upload(G,Ef(Ge),Ur,U),le.uniformsNeedUpdate=!1),le.isSpriteMaterial&&gn.setValue(G,"center",re.center),gn.setValue(G,"modelViewMatrix",re.modelViewMatrix),gn.setValue(G,"normalMatrix",re.normalMatrix),gn.setValue(G,"modelMatrix",re.matrixWorld),le.isShaderMaterial||le.isRawShaderMaterial){const Vn=le.uniformsGroups;for(let Da=0,Di=Vn.length;Da0&&U.useMultisampledRTT(z)===!1?re=Ne.get(z).__webglMultisampledFramebuffer:Array.isArray(ht)?re=ht[se]:re=ht,R.copy(z.viewport),k.copy(z.scissor),q=z.scissorTest}else R.copy(H).multiplyScalar(ae).floor(),k.copy(Y).multiplyScalar(ae).floor(),q=J;if(he.bindFramebuffer(G.FRAMEBUFFER,re)&&Ce.drawBuffers&&le&&he.drawBuffers(z,re),he.viewport(R),he.scissor(k),he.setScissorTest(q),ke){const ot=Ne.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot.__webglTexture,se)}else if(Qe){const ot=Ne.get(z.texture),pt=$||0;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,ot.__webglTexture,se||0,pt)}D=-1},this.readRenderTargetPixels=function(z,$,se,le,re,ke,Qe){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let st=Ne.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Qe!==void 0&&(st=st[Qe]),st){he.bindFramebuffer(G.FRAMEBUFFER,st);try{const ot=z.texture,pt=ot.format,ht=ot.type;if(pt!==pi&&He.convert(pt)!==G.getParameter(G.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const mt=ht===xa&&(me.has("EXT_color_buffer_half_float")||Ce.isWebGL2&&me.has("EXT_color_buffer_float"));if(ht!==Kr&&He.convert(ht)!==G.getParameter(G.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ht===hr&&(Ce.isWebGL2||me.has("OES_texture_float")||me.has("WEBGL_color_buffer_float")))&&!mt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}$>=0&&$<=z.width-le&&se>=0&&se<=z.height-re&&G.readPixels($,se,le,re,He.convert(pt),He.convert(ht),ke)}finally{const ot=L!==null?Ne.get(L).__webglFramebuffer:null;he.bindFramebuffer(G.FRAMEBUFFER,ot)}}},this.copyFramebufferToTexture=function(z,$,se=0){const le=Math.pow(2,-se),re=Math.floor($.image.width*le),ke=Math.floor($.image.height*le);U.setTexture2D($,0),G.copyTexSubImage2D(G.TEXTURE_2D,se,0,0,z.x,z.y,re,ke),he.unbindTexture()},this.copyTextureToTexture=function(z,$,se,le=0){const re=$.image.width,ke=$.image.height,Qe=He.convert(se.format),st=He.convert(se.type);U.setTexture2D(se,0),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,se.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,se.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,se.unpackAlignment),$.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,le,z.x,z.y,re,ke,Qe,st,$.image.data):$.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,le,z.x,z.y,$.mipmaps[0].width,$.mipmaps[0].height,Qe,$.mipmaps[0].data):G.texSubImage2D(G.TEXTURE_2D,le,z.x,z.y,Qe,st,$.image),le===0&&se.generateMipmaps&&G.generateMipmap(G.TEXTURE_2D),he.unbindTexture()},this.copyTextureToTexture3D=function(z,$,se,le,re=0){if(M.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ke=z.max.x-z.min.x+1,Qe=z.max.y-z.min.y+1,st=z.max.z-z.min.z+1,ot=He.convert(le.format),pt=He.convert(le.type);let ht;if(le.isData3DTexture)U.setTexture3D(le,0),ht=G.TEXTURE_3D;else if(le.isDataArrayTexture||le.isCompressedArrayTexture)U.setTexture2DArray(le,0),ht=G.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,le.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,le.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,le.unpackAlignment);const mt=G.getParameter(G.UNPACK_ROW_LENGTH),tn=G.getParameter(G.UNPACK_IMAGE_HEIGHT),Hn=G.getParameter(G.UNPACK_SKIP_PIXELS),qt=G.getParameter(G.UNPACK_SKIP_ROWS),In=G.getParameter(G.UNPACK_SKIP_IMAGES),at=se.isCompressedTexture?se.mipmaps[re]:se.image;G.pixelStorei(G.UNPACK_ROW_LENGTH,at.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,at.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,z.min.x),G.pixelStorei(G.UNPACK_SKIP_ROWS,z.min.y),G.pixelStorei(G.UNPACK_SKIP_IMAGES,z.min.z),se.isDataTexture||se.isData3DTexture?G.texSubImage3D(ht,re,$.x,$.y,$.z,ke,Qe,st,ot,pt,at.data):se.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),G.compressedTexSubImage3D(ht,re,$.x,$.y,$.z,ke,Qe,st,ot,at.data)):G.texSubImage3D(ht,re,$.x,$.y,$.z,ke,Qe,st,ot,pt,at),G.pixelStorei(G.UNPACK_ROW_LENGTH,mt),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,tn),G.pixelStorei(G.UNPACK_SKIP_PIXELS,Hn),G.pixelStorei(G.UNPACK_SKIP_ROWS,qt),G.pixelStorei(G.UNPACK_SKIP_IMAGES,In),re===0&&le.generateMipmaps&&G.generateMipmap(ht),he.unbindTexture()},this.initTexture=function(z){z.isCubeTexture?U.setTextureCube(z,0):z.isData3DTexture?U.setTexture3D(z,0):z.isDataArrayTexture||z.isCompressedArrayTexture?U.setTexture2DArray(z,0):U.setTexture2D(z,0),he.unbindTexture()},this.resetState=function(){P=0,C=0,L=null,he.reset(),X.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return br}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===tm?"display-p3":"srgb",t.unpackColorSpace=Ft.workingColorSpace===df?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Cn?mo:qy}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===mo?Cn:Qr}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class jT extends r_{}jT.prototype.isWebGL1Renderer=!0;class sm{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Be(e),this.density=t}clone(){return new sm(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class om{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Be(e),this.near=t,this.far=i}clone(){return new om(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Pp extends Ot{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class am{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Yu,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Yi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:u,point:Gc.clone(),uv:Ci.getInterpolation(Gc,rd,Xc,sd,e3,Rg,t3,new de),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function od(n,e,t,i,r,s){hl.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Wc.x=s*hl.x-r*hl.y,Wc.y=r*hl.x+s*hl.y):Wc.copy(hl),n.copy(e),n.x+=Wc.x,n.y+=Wc.y,n.applyMatrix4(YT)}const ad=new O,n3=new O;class ZT extends Ot{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){ad.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(ad);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){ad.setFromMatrixPosition(e.matrixWorld),n3.setFromMatrixPosition(this.matrixWorld);const i=ad.distanceTo(n3)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=i.length&&i.push({start:-1,count:-1,z:-1});const s=i[this.index];r.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const pl="batchId",qs=new ft,f3=new ft,lN=new ft,h3=new ft,Ig=new vf,ud=new yi,Ho=new ai,qc=new O,Ng=new aN,ni=new Rn,fd=[];function cN(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new Ht(a,1))}const o=r>65536?new Uint32Array(i):new Uint16Array(i);t.setAttribute(pl,new Ht(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(pl))throw new Error(`BatchedMesh: Geometry cannot use attribute "${pl}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(i===pl)continue;if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new yi);const e=this._geometryCount,t=this.boundingBox,i=this._active;t.makeEmpty();for(let r=0;r=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,u=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const f=e.getIndex(),h=f!==null;if(h&&(i===-1?r.indexCount=f.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const d=this._visibility,p=this._active,v=this._matricesTexture,y=this._matricesTexture.image.data;d.push(!0),p.push(!0);const w=this._geometryCount;this._geometryCount++,lN.toArray(y,w*16),v.needsUpdate=!0,o.push(r),a.push({start:h?r.indexStart:r.vertexStart,count:-1}),u.push({boxInitialized:!1,box:new yi,sphereInitialized:!1,sphere:new ai});const S=this.geometry.getAttribute(pl);for(let g=0;g=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const u=a.vertexStart,f=a.vertexCount;for(const v in i.attributes){if(v===pl)continue;const y=t.getAttribute(v),w=i.getAttribute(v);cN(y,w,u);const S=y.itemSize;for(let g=y.count,x=f;g=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return this;const r=this._bounds[e],s=r.box,o=this.geometry;if(r.boxInitialized===!1){s.makeEmpty();const a=o.index,u=o.attributes.position,f=this._drawRanges[e];for(let h=f.start,d=f.start+f.count;h=o||i[e]===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._active,r=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||i[e]===!1?null:t.fromArray(r,e*16)}setVisibleAt(e,t){const i=this._visibility,r=this._active,s=this._geometryCount;return e>=s||r[e]===!1||i[e]===t?this:(i[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,i=this._active,r=this._geometryCount;return e>=r||i[e]===!1?!1:t[e]}raycast(e,t){const i=this._visibility,r=this._active,s=this._drawRanges,o=this._geometryCount,a=this.matrixWorld,u=this.geometry;ni.material=this.material,ni.geometry.index=u.index,ni.geometry.attributes=u.attributes,ni.geometry.boundingBox===null&&(ni.geometry.boundingBox=new yi),ni.geometry.boundingSphere===null&&(ni.geometry.boundingSphere=new ai);for(let f=0;f({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,u=this._visibility,f=this._multiDrawStarts,h=this._multiDrawCounts,d=this._drawRanges,p=this.perObjectFrustumCulled;p&&(h3.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Ig.setFromProjectionMatrix(h3,e.isWebGPURenderer?Jl:br));let v=0;if(this.sortObjects){f3.copy(this.matrixWorld).invert(),qc.setFromMatrixPosition(i.matrixWorld).applyMatrix4(f3);for(let S=0,g=u.length;Su)continue;p.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(p);De.far||t.push({distance:D,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),x=Math.min(S.count,o.start+o.count);for(let M=g,T=x-1;Mu)continue;p.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(p);Ce.far||t.push({distance:C,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:f,distanceToRay:Math.sqrt(a),point:u,index:e,face:null,object:o})}}class uN extends mn{constructor(e,t,i,r,s,o,a,u,f){super(e,t,i,r,s,o,a,u,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:sn,this.magFilter=s!==void 0?s:sn,this.generateMipmaps=!1;const h=this;function d(){h.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class fN extends mn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=_n,this.minFilter=_n,this.generateMipmaps=!1,this.needsUpdate=!0}}class cm extends mn{constructor(e,t,i,r,s,o,a,u,f,h,d,p){super(null,o,a,u,f,h,r,s,d,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class hN extends cm{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=si}}class dN extends cm{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Ps),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class pN extends mn{constructor(e,t,i,r,s,o,a,u,f){super(e,t,i,r,s,o,a,u,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ir{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,u=s-1,f;for(;a<=u;)if(r=Math.floor(a+(u-a)/2),f=i[r]-o,f<0)a=r+1;else if(f>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const h=i[r],p=i[r+1]-h,v=(o-h)/p;return(r+v)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),u=t||(o.isVector2?new de:new O);return u.copy(a).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new O,r=[],s=[],o=[],a=new O,u=new ft;for(let v=0;v<=e;v++){const y=v/e;r[v]=this.getTangentAt(y,new O)}s[0]=new O,o[0]=new O;let f=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=f&&(f=h,i.set(1,0,0)),d<=f&&(f=d,i.set(0,1,0)),p<=f&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let v=1;v<=e;v++){if(s[v]=s[v-1].clone(),o[v]=o[v-1].clone(),a.crossVectors(r[v-1],r[v]),a.length()>Number.EPSILON){a.normalize();const y=Math.acos(dn(r[v-1].dot(r[v]),-1,1));s[v].applyMatrix4(u.makeRotationAxis(a,y))}o[v].crossVectors(r[v],s[v])}if(t===!0){let v=Math.acos(dn(s[0].dot(s[e]),-1,1));v/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(v=-v);for(let y=1;y<=e;y++)s[y].applyMatrix4(u.makeRotationAxis(r[y],v*y)),o[y].crossVectors(r[y],s[y])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class um extends Ir{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,u=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=u}getPoint(e,t){const i=t||new de,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:u===0&&a===s-1&&(a=s-2,u=1);let f,h;this.closed||a>0?f=r[(a-1)%s]:(md.subVectors(r[0],r[1]).add(r[0]),f=md);const d=r[a%s],p=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(x3(a,u.x,f.x,h.x,d.x),x3(a,u.y,f.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],u=a.getLength(),f=u===0?0:1-o/u;return a.getPointAt(f,t)}s++}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,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const d=f.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(f);const h=f.getPoint(1);return this.currentPoint.copy(h),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 _f extends St{constructor(e=[new de(0,-.5),new de(.5,0),new de(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=dn(r,0,Math.PI*2);const s=[],o=[],a=[],u=[],f=[],h=1/t,d=new O,p=new de,v=new O,y=new O,w=new O;let S=0,g=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:S=e[x+1].x-e[x].x,g=e[x+1].y-e[x].y,v.x=g*1,v.y=-S,v.z=g*0,w.copy(v),v.normalize(),u.push(v.x,v.y,v.z);break;case e.length-1:u.push(w.x,w.y,w.z);break;default:S=e[x+1].x-e[x].x,g=e[x+1].y-e[x].y,v.x=g*1,v.y=-S,v.z=g*0,y.copy(v),v.x+=w.x,v.y+=w.y,v.z+=w.z,v.normalize(),u.push(v.x,v.y,v.z),w.copy(y)}for(let x=0;x<=t;x++){const M=i+x*h*r,T=Math.sin(M),P=Math.cos(M);for(let C=0;C<=e.length-1;C++){d.x=e[C].x*T,d.y=e[C].y,d.z=e[C].x*P,o.push(d.x,d.y,d.z),p.x=x/t,p.y=C/(e.length-1),a.push(p.x,p.y);const L=u[3*C+0]*T,D=u[3*C+1],b=u[3*C+0]*P;f.push(L,D,b)}}for(let x=0;x0&&M(!0),t>0&&M(!1)),this.setIndex(h),this.setAttribute("position",new qe(d,3)),this.setAttribute("normal",new qe(p,3)),this.setAttribute("uv",new qe(v,2));function x(){const T=new O,P=new O;let C=0;const L=(t-e)/i;for(let D=0;D<=s;D++){const b=[],R=D/s,k=R*(t-e)+e;for(let q=0;q<=r;q++){const oe=q/r,V=oe*u+a,Q=Math.sin(V),te=Math.cos(V);P.x=k*Q,P.y=-R*i+S,P.z=k*te,d.push(P.x,P.y,P.z),T.set(Q,L,te).normalize(),p.push(T.x,T.y,T.z),v.push(oe,1-R),b.push(y++)}w.push(b)}for(let D=0;D.9&&L<.1&&(M<.2&&(o[x+0]+=1),T<.2&&(o[x+2]+=1),P<.2&&(o[x+4]+=1))}}function p(x){s.push(x.x,x.y,x.z)}function v(x,M){const T=x*3;M.x=e[T+0],M.y=e[T+1],M.z=e[T+2]}function y(){const x=new O,M=new O,T=new O,P=new O,C=new de,L=new de,D=new de;for(let b=0,R=0;b80*t){a=f=n[0],u=h=n[1];for(let y=t;yf&&(f=d),p>h&&(h=p);v=Math.max(f-a,h-u),v=v!==0?32767/v:0}return Ku(s,o,t,a,u,v,0),o}};function a4(n,e,t,i,r){let s,o;if(r===FN(n,e,t,i)>0)for(s=e;s=e;s-=i)o=S3(s,n[s],n[s+1],o);return o&&mm(o,o.next)&&(Qu(o),o=o.next),o}function wa(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(mm(t,t.next)||on(t.prev,t,t.next)===0)){if(Qu(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Ku(n,e,t,i,r,s,o){if(!n)return;!o&&s&&IN(n,i,r,s);let a=n,u,f;for(;n.prev!==n.next;){if(u=n.prev,f=n.next,s?EN(n,i,r,s):wN(n)){e.push(u.i/t|0),e.push(n.i/t|0),e.push(f.i/t|0),Qu(n),n=f.next,a=f.next;continue}if(n=f,n===a){o?o===1?(n=TN(wa(n),e,t),Ku(n,e,t,i,r,s,2)):o===2&&AN(n,e,t,i,r,s):Ku(wa(n),e,t,i,r,s,1);break}}}function wN(n){const e=n.prev,t=n,i=n.next;if(on(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,u=t.y,f=i.y,h=rs?r>o?r:o:s>o?s:o,v=a>u?a>f?a:f:u>f?u:f;let y=i.next;for(;y!==e;){if(y.x>=h&&y.x<=p&&y.y>=d&&y.y<=v&&Ul(r,a,s,u,o,f,y.x,y.y)&&on(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function EN(n,e,t,i){const r=n.prev,s=n,o=n.next;if(on(r,s,o)>=0)return!1;const a=r.x,u=s.x,f=o.x,h=r.y,d=s.y,p=o.y,v=au?a>f?a:f:u>f?u:f,S=h>d?h>p?h:p:d>p?d:p,g=Lv(v,y,e,t,i),x=Lv(w,S,e,t,i);let M=n.prevZ,T=n.nextZ;for(;M&&M.z>=g&&T&&T.z<=x;){if(M.x>=v&&M.x<=w&&M.y>=y&&M.y<=S&&M!==r&&M!==o&&Ul(a,h,u,d,f,p,M.x,M.y)&&on(M.prev,M,M.next)>=0||(M=M.prevZ,T.x>=v&&T.x<=w&&T.y>=y&&T.y<=S&&T!==r&&T!==o&&Ul(a,h,u,d,f,p,T.x,T.y)&&on(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;M&&M.z>=g;){if(M.x>=v&&M.x<=w&&M.y>=y&&M.y<=S&&M!==r&&M!==o&&Ul(a,h,u,d,f,p,M.x,M.y)&&on(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;T&&T.z<=x;){if(T.x>=v&&T.x<=w&&T.y>=y&&T.y<=S&&T!==r&&T!==o&&Ul(a,h,u,d,f,p,T.x,T.y)&&on(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function TN(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!mm(r,s)&&l4(r,i,i.next,s)&&Ju(r,s)&&Ju(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Qu(i),Qu(i.next),i=n=s),i=i.next}while(i!==n);return wa(i)}function AN(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&UN(o,a)){let u=c4(o,a);o=wa(o,o.next),u=wa(u,u.next),Ku(o,e,t,i,r,s,0),Ku(u,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function CN(n,e,t,i){const r=[];let s,o,a,u,f;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x=t.x&&t.x>=u&&s!==t.x&&Ul(or.x||t.x===r.x&&LN(r,t)))&&(r=t,h=d)),t=t.next;while(t!==a);return r}function LN(n,e){return on(n.prev,n,e.prev)<0&&on(e.next,n,n.next)<0}function IN(n,e,t,i){let r=n;do r.z===0&&(r.z=Lv(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,NN(r)}function NN(n){let e,t,i,r,s,o,a,u,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||u>0&&i;)a!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,f*=2}while(o>1);return n}function Lv(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function DN(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function UN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!zN(n,e)&&(Ju(n,e)&&Ju(e,n)&&ON(n,e)&&(on(n.prev,n,e.prev)||on(n,e.prev,e))||mm(n,e)&&on(n.prev,n,n.next)>0&&on(e.prev,e,e.next)>0)}function on(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function mm(n,e){return n.x===e.x&&n.y===e.y}function l4(n,e,t,i){const r=xd(on(n,e,t)),s=xd(on(n,e,i)),o=xd(on(t,i,n)),a=xd(on(t,i,e));return!!(r!==s&&o!==a||r===0&&_d(n,t,e)||s===0&&_d(n,i,e)||o===0&&_d(t,n,i)||a===0&&_d(t,e,i))}function _d(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function xd(n){return n>0?1:n<0?-1:0}function zN(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&l4(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Ju(n,e){return on(n.prev,n,n.next)<0?on(n,e,n.next)>=0&&on(n,n.prev,e)>=0:on(n,e,n.prev)<0||on(n,n.next,e)<0}function ON(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function c4(n,e){const t=new Iv(n.i,n.x,n.y),i=new Iv(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function S3(n,e,t,i){const r=new Iv(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Qu(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Iv(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function FN(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function w3(n,e){for(let t=0;tNumber.EPSILON){const ye=Math.sqrt(xe),je=Math.sqrt(I*I+ee*ee),Le=we.x-U/ye,Fe=we.y+Ne/ye,tt=me.x-ee/je,dt=me.y+I/je,Se=((tt-Le)*ee-(dt-Fe)*I)/(Ne*ee-U*I);Ce=Le+Ne*Se-G.x,he=Fe+U*Se-G.y;const Ct=Ce*Ce+he*he;if(Ct<=2)return new de(Ce,he);Ze=Math.sqrt(Ct/2)}else{let ye=!1;Ne>Number.EPSILON?I>Number.EPSILON&&(ye=!0):Ne<-Number.EPSILON?I<-Number.EPSILON&&(ye=!0):Math.sign(U)===Math.sign(ee)&&(ye=!0),ye?(Ce=-U,he=Ne,Ze=Math.sqrt(xe)):(Ce=Ne,he=U,Ze=Math.sqrt(xe/2))}return new de(Ce/Ze,he/Ze)}const B=[];for(let G=0,we=V.length,me=we-1,Ce=G+1;G=0;G--){const we=G/S,me=v*Math.cos(we*Math.PI/2),Ce=y*Math.sin(we*Math.PI/2)+w;for(let he=0,Ze=V.length;he=0;){const Ce=me;let he=me-1;he<0&&(he=G.length-1);for(let Ze=0,Ne=h+S*2;Ze0)&&v.push(M,T,C),(g!==i-1||u0!=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 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.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 p4 extends Yn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Be(16777215),this.specular=new Be(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Eo,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=hf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class m4 extends Yn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Be(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Eo,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class g4 extends Yn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Eo,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class v4 extends Yn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Eo,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=hf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class y4 extends Yn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Be(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Eo,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.flatShading=e.flatShading,this.fog=e.fog,this}}class _4 extends Si{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 oa(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function x4(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function S4(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function Nv(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[a+u]}return r}function m_(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function VN(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u=i)){d.push(f.times[v]);for(let w=0;ws.tracks[u].times[0]&&(a=s.tracks[u].times[0]);for(let u=0;u=a.times[y]){const g=y*d+h,x=g+d-h;w=a.values.slice(g,x)}else{const g=a.createInterpolant(),x=h,M=d-h;g.evaluate(s),w=g.resultBuffer.slice(x,M)}u==="quaternion"&&new oi().fromArray(w).normalize().conjugate().toArray(w);const S=f.times.length;for(let g=0;g=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const u=i[a];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,u,o),e=!1;break}o=u}if(r!==void 0&&x4(r))for(let a=0,u=r.length;a!==u;++a){const f=r[a];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,f),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Kd,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,u=o*i,f=0;f!==i;++f)t[u+f]=t[a+f];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Nr.prototype.TimeBufferType=Float32Array;Nr.prototype.ValueBufferType=Float32Array;Nr.prototype.DefaultInterpolation=Vu;class ba extends Nr{}ba.prototype.ValueTypeName="bool";ba.prototype.ValueBufferType=Array;ba.prototype.DefaultInterpolation=Hu;ba.prototype.InterpolantFactoryMethodLinear=void 0;ba.prototype.InterpolantFactoryMethodSmooth=void 0;class v_ extends Nr{}v_.prototype.ValueTypeName="color";class $u extends Nr{}$u.prototype.ValueTypeName="number";class E4 extends Mf{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,u=(i-t)/(r-t);let f=e*a;for(let h=f+a;f!==h;f+=4)oi.slerpFlat(s,0,o,f-a,o,f,u);return s}}class cc extends Nr{InterpolantFactoryMethodLinear(e){return new E4(this.times,this.values,this.getValueSize(),e)}}cc.prototype.ValueTypeName="quaternion";cc.prototype.DefaultInterpolation=Vu;cc.prototype.InterpolantFactoryMethodSmooth=void 0;class Ra extends Nr{}Ra.prototype.ValueTypeName="string";Ra.prototype.ValueBufferType=Array;Ra.prototype.DefaultInterpolation=Hu;Ra.prototype.InterpolantFactoryMethodLinear=void 0;Ra.prototype.InterpolantFactoryMethodSmooth=void 0;class ef extends Nr{}ef.prototype.ValueTypeName="vector";class tf{constructor(e,t=-1,i,r=em){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Yi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(jN(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Nr.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(f)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,v,y,w){if(v.length!==0){const S=[],g=[];m_(v,S,g,y),S.length!==0&&w.push(new d(p,S,g))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let u=e.length||-1;const f=e.hierarchy||[];for(let d=0;d{t&&t(s),this.manager.itemEnd(e)},0),s;if(ds[e]!==void 0){ds[e].push({onLoad:t,onProgress:i,onError:r});return}ds[e]=[],ds[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,u=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const h=ds[e],d=f.body.getReader(),p=f.headers.get("Content-Length")||f.headers.get("X-File-Size"),v=p?parseInt(p):0,y=v!==0;let w=0;const S=new ReadableStream({start(g){x();function x(){d.read().then(({done:M,value:T})=>{if(M)g.close();else{w+=T.byteLength;const P=new ProgressEvent("progress",{lengthComputable:y,loaded:w,total:v});for(let C=0,L=h.length;C{switch(u){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return f.json();default:if(a===void 0)return f.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),p=d&&d[1]?d[1].toLowerCase():void 0,v=new TextDecoder(p);return f.arrayBuffer().then(y=>v.decode(y))}}}).then(f=>{Ms.add(e,f);const h=ds[e];delete ds[e];for(let d=0,p=h.length;d{const h=ds[e];if(h===void 0)throw this.manager.itemError(e),f;delete ds[e];for(let d=0,p=h.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class qN extends Ni{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Ls(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Be().setHex(o.value);break;case"v2":r.uniforms[s].value=new de().fromArray(o.value);break;case"v3":r.uniforms[s].value=new O().fromArray(o.value);break;case"v4":r.uniforms[s].value=new kt().fromArray(o.value);break;case"m3":r.uniforms[s].value=new wt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new ft().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new de().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new de().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:f4,SpriteMaterial:s_,RawShaderMaterial:h4,ShaderMaterial:$r,PointsMaterial:a_,MeshPhysicalMaterial:d4,MeshStandardMaterial:p_,MeshPhongMaterial:p4,MeshToonMaterial:m4,MeshNormalMaterial:g4,MeshLambertMaterial:v4,MeshDepthMaterial:n_,MeshDistanceMaterial:i_,MeshBasicMaterial:To,MeshMatcapMaterial:y4,LineDashedMaterial:_4,LineBasicMaterial:Si,Material:Yn};return new t[e]}}class Uv{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const u=new y_(t);s=new nf(u),s.setCrossOrigin(this.crossOrigin);for(let f=0,h=e.length;f0){r=new nf(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const S=new yi;S.min.fromArray(w.boxMin),S.max.fromArray(w.boxMax);const g=new ai;return g.radius=w.sphereRadius,g.center.fromArray(w.sphereCenter),{boxInitialized:w.boxInitialized,box:S,sphereInitialized:w.sphereInitialized,sphere:g}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=f(e.matricesTexture.uuid);break;case"LOD":o=new ZT;break;case"Line":o=new xo(a(e.geometry),u(e.material));break;case"LineLoop":o=new $T(a(e.geometry),u(e.material));break;case"LineSegments":o=new ts(a(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new e4(a(e.geometry),u(e.material));break;case"Sprite":o=new qT(u(e.material));break;case"Group":o=new Dl;break;case"Bone":o=new o_;break;default:o=new Ot}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let v=0;v"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Ms.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(f=>{t&&t(f),s.manager.itemEnd(e)}).catch(f=>{r&&r(f)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const u=fetch(e,a).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(f){return Ms.add(e,f),t&&t(f),s.manager.itemEnd(e),f}).catch(function(f){r&&r(f),Ms.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Ms.add(e,u),s.manager.itemStart(e)}}let Sd;class x_{static getContext(){return Sd===void 0&&(Sd=new(window.AudioContext||window.webkitAudioContext)),Sd}static setContext(e){Sd=e}}class rD extends Ni{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Ls(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){try{const f=u.slice(0);x_.getContext().decodeAudioData(f,function(d){t(d)}).catch(a)}catch(f){a(f)}},i,r);function a(u){r?r(u):console.error(u),s.manager.itemError(e)}}}const L3=new ft,I3=new ft,Vo=new ft;class sD{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new pn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new pn,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,Vo.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(ua*t.fov*.5)/t.zoom;let a,u;I3.elements[12]=-r,L3.elements[12]=r,a=-o*t.aspect+s,u=o*t.aspect+s,Vo.elements[0]=2*t.near/(u-a),Vo.elements[8]=(u+a)/(u-a),this.cameraL.projectionMatrix.copy(Vo),a=-o*t.aspect-s,u=o*t.aspect-s,Vo.elements[0]=2*t.near/(u-a),Vo.elements[8]=(u+a)/(u-a),this.cameraR.projectionMatrix.copy(Vo)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(I3),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(L3)}}class S_{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=N3(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=N3();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function N3(){return(typeof performance>"u"?Date:performance).now()}const Go=new O,D3=new oi,oD=new O,Wo=new O;class aD extends Ot{constructor(){super(),this.type="AudioListener",this.context=x_.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new S_}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Go,D3,oD),Wo.set(0,0,-1).applyQuaternion(D3),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Go.x,r),t.positionY.linearRampToValueAtTime(Go.y,r),t.positionZ.linearRampToValueAtTime(Go.z,r),t.forwardX.linearRampToValueAtTime(Wo.x,r),t.forwardY.linearRampToValueAtTime(Wo.y,r),t.forwardZ.linearRampToValueAtTime(Wo.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Go.x,Go.y,Go.z),t.setOrientation(Wo.x,Wo.y,Wo.z,i.x,i.y,i.z)}}class z4 extends Ot{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){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;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){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),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,r,this._addIndex*t,1,t);for(let u=t,f=t+t;u!==f;++u)if(i[u]!==i[u+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%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 o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){oi.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;oi.multiplyQuaternionsFlat(e,o,e,t,e,i),oi.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const u=t+a;e[u]=e[u]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const M_="\\[\\]\\.:\\/",fD=new RegExp("["+M_+"]","g"),w_="[^"+M_+"]",hD="[^"+M_.replace("\\.","")+"]",dD=/((?:WC+[\/:])*)/.source.replace("WC",w_),pD=/(WCOD+)?/.source.replace("WCOD",hD),mD=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",w_),gD=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",w_),vD=new RegExp("^"+dD+pD+mD+gD+"$"),yD=["material","materials","bones","map"];class _D{constructor(e,t,i){const r=i||It.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].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 It{constructor(e,t,i){this.path=t,this.parsedPath=i||It.parseTrackName(t),this.node=It.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 It.Composite(e,t,i):new It(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(fD,"")}static parseTrackName(e){const t=vD.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]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);yD.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}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(s){for(let o=0;o=s){const d=s++,p=e[d];t[p.uuid]=h,e[h]=p,t[f]=d,e[d]=u;for(let v=0,y=r;v!==y;++v){const w=i[v],S=w[d],g=w[h];w[h]=S,w[d]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,u=arguments.length;a!==u;++a){const f=arguments[a],h=f.uuid,d=t[h];if(d!==void 0)if(delete t[h],d0&&(t[v.uuid]=d),e[d]=v,e.pop();for(let y=0,w=r;y!==w;++y){const S=i[y];S[d]=S[p],S.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,u=this._objects,f=u.length,h=this.nCachedObjects_,d=new Array(f);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(d);for(let p=h,v=u.length;p!==v;++p){const y=u[p];d[p]=new It(y,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,u=o[a],f=e[a];t[f]=i,o[i]=u,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class F4{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),u={endingStart:ia,endingEnd:ia};for(let f=0;f!==o;++f){const h=s[f].createInterpolant(null);a[f]=h,h.settings=u}this._interpolantSettings=u,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=yT,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){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){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 r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const u=a.parameterPositions,f=a.sampleValues;return u[0]=s,u[1]=s+i,f[0]=e/o,f[1]=t/o,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,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const u=(e-s)*i;u<0||i===0?t=0:(this._startTime=null,t=i*u)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const u=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case Yy:for(let h=0,d=u.length;h!==d;++h)u[h].evaluate(o),f[h].accumulateAdditive(a);break;case em:default:for(let h=0,d=u.length;h!==d;++h)u[h].evaluate(o),f[h].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===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 r=i.evaluate(e)[0];t*=r,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 r=this.time+e,s=this._loopCount;const o=i===_T;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===vT){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const u=this.repetitions-s;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=ra,r.endingEnd=ra):(e?r.endingStart=this.zeroSlopeAtStart?ra:ia:r.endingStart=Gu,t?r.endingEnd=this.zeroSlopeAtEnd?ra:ia:r.endingEnd=Gu)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,u=o.sampleValues;return a[0]=s,u[0]=t,a[1]=s+e,u[1]=i,this}}const SD=new Float32Array(1);class MD extends es{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,u=i.uuid,f=this._bindingsByRootAndName;let h=f[u];h===void 0&&(h={},f[u]=h);for(let d=0;d!==s;++d){const p=r[d],v=p.name;let y=h[v];if(y!==void 0)++y.referenceCount,o[d]=y;else{if(y=o[d],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,u,v));continue}const w=t&&t._propertyBindings[d].binding.parsedPath;y=new O4(It.create(i,v,w),p.ValueTypeName,p.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,u,v),o[d]=y}a[d].resultBuffer=y.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}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,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==i;++f)t[f]._update(r,e,s,o);const a=this._bindings,u=this._nActiveBindings;for(let f=0;f!==u;++f)a[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.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.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,O3).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 F3=new O,Md=new O;class RD{constructor(e=new O,t=new O){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){F3.subVectors(e,this.start),Md.subVectors(this.end,this.start);const i=Md.dot(Md);let s=Md.dot(F3)/i;return t&&(s=dn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const k3=new O;class PD extends Ot{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new St,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,u=32;o1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{W3.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(W3,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 GD extends ts{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],r=new St;r.setAttribute("position",new qe(t,3)),r.setAttribute("color",new qe(i,3));const s=new Si({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Be,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class WD{constructor(){this.type="ShapePath",this.color=new Be,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Zu,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,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const x=[];for(let M=0,T=g.length;MNumber.EPSILON){if(R<0&&(L=x[C],b=-b,D=x[P],R=-R),g.yD.y)continue;if(g.y===L.y){if(g.x===L.x)return!0}else{const k=R*(g.x-L.x)-b*(g.y-L.y);if(k===0)return!0;if(k<0)continue;T=!T}}else{if(g.y!==L.y)continue;if(D.x<=g.x&&g.x<=L.x||L.x<=g.x&&g.x<=D.x)return!0}}return T}const r=Jr.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,u;const f=[];if(s.length===1)return a=s[0],u=new da,u.curves=a.curves,f.push(u),f;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],p=[];let v=[],y=0,w;p[y]=void 0,v[y]=[];for(let g=0,x=s.length;g1){let g=!1,x=0;for(let M=0,T=p.length;M0&&g===!1&&(v=d)}let S;for(let g=0,x=p.length;g{const d=typeof f=="function"?f(e):f;if(d!==e){const p=e;e=h?d:Object.assign({},e,d),t.forEach(v=>v(e,p))}},r=()=>e,s=(f,h=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(e);function v(){const y=h(e);if(!d(p,y)){const w=p;f(p=y,w)}}return t.add(v),()=>t.delete(v)},u={setState:i,getState:r,subscribe:(f,h,d)=>h||d?s(f,h,d):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(i,r,u),u}const YD=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),X3=YD?ve.useEffect:ve.useLayoutEffect;function qD(n){const e=typeof n=="function"?jD(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=ve.useReducer(S=>S+1,0),o=e.getState(),a=ve.useRef(o),u=ve.useRef(i),f=ve.useRef(r),h=ve.useRef(!1),d=ve.useRef();d.current===void 0&&(d.current=i(o));let p,v=!1;(a.current!==o||u.current!==i||f.current!==r||h.current)&&(p=i(o),v=!r(d.current,p)),X3(()=>{v&&(d.current=p),a.current=o,u.current=i,f.current=r,h.current=!1});const y=ve.useRef(o);X3(()=>{const S=()=>{try{const x=e.getState(),M=u.current(x);f.current(d.current,M)||(a.current=x,d.current=M,s())}catch{h.current=!0,s()}},g=e.subscribe(S);return e.getState()!==y.current&&S(),g},[]);const w=v?p:d.current;return ve.useDebugValue(w),w};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}var V4={exports:{}},Gg={exports:{}},Wg={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var j3;function ZD(){return j3||(j3=1,function(n){function e(N,B){var H=N.length;N.push(B);e:for(;0>>1,J=N[Y];if(0>>1;Yr(pe,H))Eer(Te,pe)?(N[Y]=Te,N[Ee]=H,Y=Ee):(N[Y]=pe,N[ie]=H,Y=ie);else if(Eer(Te,H))N[Y]=Te,N[Ee]=H,Y=Ee;else break e}}return B}function r(N,B){var H=N.sortIndex-B.sortIndex;return H!==0?H:N.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var u=[],f=[],h=1,d=null,p=3,v=!1,y=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(N){for(var B=t(f);B!==null;){if(B.callback===null)i(f);else if(B.startTime<=N)i(f),B.sortIndex=B.expirationTime,e(u,B);else break;B=t(f)}}function T(N){if(w=!1,M(N),!y)if(t(u)!==null)y=!0,te(P);else{var B=t(f);B!==null&&ae(T,B.startTime-N)}}function P(N,B){y=!1,w&&(w=!1,g(D),D=-1),v=!0;var H=p;try{for(M(B),d=t(u);d!==null&&(!(d.expirationTime>B)||N&&!k());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,p=d.priorityLevel;var J=Y(d.expirationTime<=B);B=n.unstable_now(),typeof J=="function"?d.callback=J:d===t(u)&&i(u),M(B)}else i(u);d=t(u)}if(d!==null)var Z=!0;else{var ie=t(f);ie!==null&&ae(T,ie.startTime-B),Z=!1}return Z}finally{d=null,p=H,v=!1}}var C=!1,L=null,D=-1,b=5,R=-1;function k(){return!(n.unstable_now()-RN||125Y?(N.sortIndex=H,e(f,N),t(u)===null&&N===t(f)&&(w?(g(D),D=-1):w=!0,ae(T,H-Y))):(N.sortIndex=J,e(u,N),y||v||(y=!0,te(P))),N},n.unstable_shouldYield=k,n.unstable_wrapCallback=function(N){var B=p;return function(){var H=p;p=B;try{return N.apply(this,arguments)}finally{p=H}}}}(Wg)),Wg}var Y3;function KD(){return Y3||(Y3=1,Gg.exports=ZD()),Gg.exports}/** + * @license React + * react-reconciler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var JD=function(e){var t={},i=ve,r=KD(),s=Object.assign;function o(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;mj||E[F]!==A[j]){var ue=` +`+E[F].replace(" at new "," at ");return l.displayName&&ue.includes("")&&(ue=ue.replace("",l.displayName)),ue}while(1<=F&&0<=j);break}}}finally{ht=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?pt(l):""}var tn=Object.prototype.hasOwnProperty,Hn=[],qt=-1;function In(l){return{current:l}}function at(l){0>qt||(l.current=Hn[qt],Hn[qt]=null,qt--)}function Ge(l,c){qt++,Hn[qt]=l.current,l.current=c}var Qi={},Et=In(Qi),cn=In(!1),Dr=Qi;function $i(l,c){var m=l.type.contextTypes;if(!m)return Qi;var _=l.stateNode;if(_&&_.__reactInternalMemoizedUnmaskedChildContext===c)return _.__reactInternalMemoizedMaskedChildContext;var E={},A;for(A in m)E[A]=c[A];return _&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=E),E}function Nn(l){return l=l.childContextTypes,l!=null}function gn(){at(cn),at(Et)}function Ur(l,c,m){if(Et.current!==Qi)throw Error(o(168));Ge(Et,c),Ge(cn,m)}function Na(l,c,m){var _=l.stateNode;if(c=c.childContextTypes,typeof _.getChildContext!="function")return m;_=_.getChildContext();for(var E in _)if(!(E in c))throw Error(o(108,D(l)||"Unknown",E));return s({},m,_)}function Vn(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Qi,Dr=Et.current,Ge(Et,l),Ge(cn,cn.current),!0}function Da(l,c,m){var _=l.stateNode;if(!_)throw Error(o(169));m?(l=Na(l,c,Dr),_.__reactInternalMemoizedMergedChildContext=l,at(cn),at(Et),Ge(Et,l)):at(cn),Ge(cn,m)}var Di=Math.clz32?Math.clz32:_A,Af=Math.log,yA=Math.LN2;function _A(l){return l>>>=0,l===0?32:31-(Af(l)/yA|0)|0}var Cf=64,bf=4194304;function hc(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Rf(l,c){var m=l.pendingLanes;if(m===0)return 0;var _=0,E=l.suspendedLanes,A=l.pingedLanes,F=m&268435455;if(F!==0){var j=F&~E;j!==0?_=hc(j):(A&=F,A!==0&&(_=hc(A)))}else F=m&~E,F!==0?_=hc(F):A!==0&&(_=hc(A));if(_===0)return 0;if(c!==0&&c!==_&&!(c&E)&&(E=_&-_,A=c&-c,E>=A||E===16&&(A&4194240)!==0))return c;if(_&4&&(_|=m&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=_;0m;m++)c.push(l);return c}function dc(l,c,m){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-Di(c),l[c]=m}function MA(l,c){var m=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var _=l.eventTimes;for(l=l.expirationTimes;0>=F,E-=F,rs=1<<32-Di(c)+E|m<Ut?(zn=vt,vt=null):zn=vt.sibling;var zt=rt(ne,vt,ce[Ut],ze);if(zt===null){vt===null&&(vt=zn);break}l&&vt&&zt.alternate===null&&c(ne,vt),K=A(zt,K,Ut),Mt===null?Je=zt:Mt.sibling=zt,Mt=zt,vt=zn}if(Ut===ce.length)return m(ne,vt),Qt&&Ro(ne,Ut),Je;if(vt===null){for(;UtUt?(zn=vt,vt=null):zn=vt.sibling;var Hs=rt(ne,vt,zt.value,ze);if(Hs===null){vt===null&&(vt=zn);break}l&&vt&&Hs.alternate===null&&c(ne,vt),K=A(Hs,K,Ut),Mt===null?Je=Hs:Mt.sibling=Hs,Mt=Hs,vt=zn}if(zt.done)return m(ne,vt),Qt&&Ro(ne,Ut),Je;if(vt===null){for(;!zt.done;Ut++,zt=ce.next())zt=gt(ne,zt.value,ze),zt!==null&&(K=A(zt,K,Ut),Mt===null?Je=zt:Mt.sibling=zt,Mt=zt);return Qt&&Ro(ne,Ut),Je}for(vt=_(ne,vt);!zt.done;Ut++,zt=ce.next())zt=Wt(vt,ne,Ut,zt.value,ze),zt!==null&&(l&&zt.alternate!==null&&vt.delete(zt.key===null?Ut:zt.key),K=A(zt,K,Ut),Mt===null?Je=zt:Mt.sibling=zt,Mt=zt);return l&&vt.forEach(function(aC){return c(ne,aC)}),Qt&&Ro(ne,Ut),Je}function ar(ne,K,ce,ze){if(typeof ce=="object"&&ce!==null&&ce.type===h&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case u:e:{for(var Je=ce.key,Mt=K;Mt!==null;){if(Mt.key===Je){if(Je=ce.type,Je===h){if(Mt.tag===7){m(ne,Mt.sibling),K=E(Mt,ce.props.children),K.return=ne,ne=K;break e}}else if(Mt.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===M&&G_(Je)===Mt.type){m(ne,Mt.sibling),K=E(Mt,ce.props),K.ref=gc(ne,Mt,ce),K.return=ne,ne=K;break e}m(ne,Mt);break}else c(ne,Mt);Mt=Mt.sibling}ce.type===h?(K=zo(ce.props.children,ne.mode,ze,ce.key),K.return=ne,ne=K):(ze=vh(ce.type,ce.key,ce.props,null,ne.mode,ze),ze.ref=gc(ne,K,ce),ze.return=ne,ne=ze)}return F(ne);case f:e:{for(Mt=ce.key;K!==null;){if(K.key===Mt)if(K.tag===4&&K.stateNode.containerInfo===ce.containerInfo&&K.stateNode.implementation===ce.implementation){m(ne,K.sibling),K=E(K,ce.children||[]),K.return=ne,ne=K;break e}else{m(ne,K);break}else c(ne,K);K=K.sibling}K=I0(ce,ne.mode,ze),K.return=ne,ne=K}return F(ne);case M:return Mt=ce._init,ar(ne,K,Mt(ce._payload),ze)}if(Q(ce))return $e(ne,K,ce,ze);if(C(ce))return Jn(ne,K,ce,ze);Bf(ne,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,K!==null&&K.tag===6?(m(ne,K.sibling),K=E(K,ce),K.return=ne,ne=K):(m(ne,K),K=L0(ce,ne.mode,ze),K.return=ne,ne=K),F(ne)):m(ne,K)}return ar}var Ba=W_(!0),X_=W_(!1),vc={},ir=In(vc),yc=In(vc),Ha=In(vc);function Br(l){if(l===vc)throw Error(o(174));return l}function Zm(l,c){Ge(Ha,c),Ge(yc,l),Ge(ir,vc),l=ae(c),at(ir),Ge(ir,l)}function Va(){at(ir),at(yc),at(Ha)}function j_(l){var c=Br(Ha.current),m=Br(ir.current);c=N(m,l.type,c),m!==c&&(Ge(yc,l),Ge(ir,c))}function Km(l){yc.current===l&&(at(ir),at(yc))}var nn=In(0);function Hf(l){for(var c=l;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||uc(m)||fc(m)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}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 null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Jm=[];function Qm(){for(var l=0;lm?m:4,l(!0);var _=rr.transition;rr.transition={};try{l(!1),c()}finally{Dt=m,rr.transition=_}}function ox(){return Hr().memoizedState}function DA(l,c,m){var _=Fs(l);m={lane:_,action:m,hasEagerState:!1,eagerState:null,next:null},ax(l)?lx(c,m):(cx(l,c,m),m=ui(),l=sr(l,_,m),l!==null&&ux(l,c,_))}function UA(l,c,m){var _=Fs(l),E={lane:_,action:m,hasEagerState:!1,eagerState:null,next:null};if(ax(l))lx(c,E);else{cx(l,c,E);var A=l.alternate;if(l.lanes===0&&(A===null||A.lanes===0)&&(A=c.lastRenderedReducer,A!==null))try{var F=c.lastRenderedState,j=A(F,m);if(E.hasEagerState=!0,E.eagerState=j,Or(j,F))return}catch{}finally{}m=ui(),l=sr(l,_,m),l!==null&&ux(l,c,_)}}function ax(l){var c=l.alternate;return l===un||c!==null&&c===un}function lx(l,c){_c=Gf=!0;var m=l.pending;m===null?c.next=c:(c.next=m.next,m.next=c),l.pending=c}function cx(l,c,m){Sn!==null&&l.mode&1&&!(Tt&2)?(l=c.interleaved,l===null?(m.next=m,kr===null?kr=[c]:kr.push(c)):(m.next=l.next,l.next=m),c.interleaved=m):(l=c.pending,l===null?m.next=m:(m.next=l.next,l.next=m),c.pending=m)}function ux(l,c,m){if(m&4194240){var _=c.lanes;_&=l.pendingLanes,m|=_,c.lanes=m,Im(l,m)}}var qf={readContext:er,useCallback:Zn,useContext:Zn,useEffect:Zn,useImperativeHandle:Zn,useInsertionEffect:Zn,useLayoutEffect:Zn,useMemo:Zn,useReducer:Zn,useRef:Zn,useState:Zn,useDebugValue:Zn,useDeferredValue:Zn,useTransition:Zn,useMutableSource:Zn,useSyncExternalStore:Zn,useId:Zn,unstable_isNewReconciler:!1},zA={readContext:er,useCallback:function(l,c){return os().memoizedState=[l,c===void 0?null:c],l},useContext:er,useEffect:i0,useImperativeHandle:function(l,c,m){return m=m!=null?m.concat([l]):null,jf(4194308,4,nx.bind(null,c,l),m)},useLayoutEffect:function(l,c){return jf(4194308,4,l,c)},useInsertionEffect:function(l,c){return jf(4,2,l,c)},useMemo:function(l,c){var m=os();return c=c===void 0?null:c,l=l(),m.memoizedState=[l,c],l},useReducer:function(l,c,m){var _=os();return c=m!==void 0?m(c):c,_.memoizedState=_.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},_.queue=l,l=l.dispatch=DA.bind(null,un,l),[_.memoizedState,l]},useRef:function(l){var c=os();return l={current:l},c.memoizedState=l},useState:n0,useDebugValue:r0,useDeferredValue:function(l){var c=n0(l),m=c[0],_=c[1];return i0(function(){var E=rr.transition;rr.transition={};try{_(l)}finally{rr.transition=E}},[l]),m},useTransition:function(){var l=n0(!1),c=l[0];return l=NA.bind(null,l[1]),os().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,m){var _=un,E=os();if(Qt){if(m===void 0)throw Error(o(407));m=m()}else{if(m=c(),Sn===null)throw Error(o(349));Ga&30||Z_(_,c,m)}E.memoizedState=m;var A={value:m,getSnapshot:c};return E.queue=A,i0(J_.bind(null,_,A,l),[l]),_.flags|=2048,Sc(9,K_.bind(null,_,A,m,c),void 0,null),m},useId:function(){var l=os(),c=Sn.identifierPrefix;if(Qt){var m=ss,_=rs;m=(_&~(1<<32-Di(_)-1)).toString(32)+m,c=":"+c+"R"+m,m=xc++,0w0&&(c.flags|=128,_=!0,Tc(E,!1),c.lanes=4194304)}else{if(!_)if(l=Hf(A),l!==null){if(c.flags|=128,_=!0,l=l.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),Tc(E,!0),E.tail===null&&E.tailMode==="hidden"&&!A.alternate&&!Qt)return Kn(c),null}else 2*Dn()-E.renderingStartTime>w0&&m!==1073741824&&(c.flags|=128,_=!0,Tc(E,!1),c.lanes=4194304);E.isBackwards?(A.sibling=c.child,c.child=A):(l=E.last,l!==null?l.sibling=A:c.child=A,E.last=A)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=Dn(),c.sibling=null,l=nn.current,Ge(nn,_?l&1|2:l&1),c):(Kn(c),null);case 22:case 23:return b0(),_=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==_&&(c.flags|=8192),_&&c.mode&1?Fi&1073741824&&(Kn(c),Ke&&c.subtreeFlags&6&&(c.flags|=8192)):Kn(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}var HA=a.ReactCurrentOwner,Oi=!1;function ci(l,c,m,_){c.child=l===null?X_(c,null,m,_):Ba(c,l.child,m,_)}function yx(l,c,m,_,E){m=m.render;var A=c.ref;return za(c,E),_=e0(l,c,m,_,A,E),m=t0(),l!==null&&!Oi?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~E,as(l,c,E)):(Qt&&m&&Wm(c),c.flags|=1,ci(l,c,_,E),c.child)}function _x(l,c,m,_,E){if(l===null){var A=m.type;return typeof A=="function"&&!P0(A)&&A.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(c.tag=15,c.type=A,xx(l,c,A,_,E)):(l=vh(m.type,null,_,c,c.mode,E),l.ref=c.ref,l.return=c,c.child=l)}if(A=l.child,!(l.lanes&E)){var F=A.memoizedProps;if(m=m.compare,m=m!==null?m:If,m(F,_)&&l.ref===c.ref)return as(l,c,E)}return c.flags|=1,l=Bs(A,_),l.ref=c.ref,l.return=c,c.child=l}function xx(l,c,m,_,E){if(l!==null&&If(l.memoizedProps,_)&&l.ref===c.ref)if(Oi=!1,(l.lanes&E)!==0)l.flags&131072&&(Oi=!0);else return c.lanes=l.lanes,as(l,c,E);return a0(l,c,m,_,E)}function Sx(l,c,m){var _=c.pendingProps,E=_.children,A=l!==null?l.memoizedState:null;if(_.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null},Ge(Wa,Fi),Fi|=m;else if(m&1073741824)c.memoizedState={baseLanes:0,cachePool:null},_=A!==null?A.baseLanes:m,Ge(Wa,Fi),Fi|=_;else return l=A!==null?A.baseLanes|m:m,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null},c.updateQueue=null,Ge(Wa,Fi),Fi|=l,null;else A!==null?(_=A.baseLanes|m,c.memoizedState=null):_=m,Ge(Wa,Fi),Fi|=_;return ci(l,c,E,m),c.child}function Mx(l,c){var m=c.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(c.flags|=512,c.flags|=2097152)}function a0(l,c,m,_,E){var A=Nn(m)?Dr:Et.current;return A=$i(c,A),za(c,E),m=e0(l,c,m,_,A,E),_=t0(),l!==null&&!Oi?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~E,as(l,c,E)):(Qt&&_&&Wm(c),c.flags|=1,ci(l,c,m,E),c.child)}function wx(l,c,m,_,E){if(Nn(m)){var A=!0;Vn(c)}else A=!1;if(za(c,E),c.stateNode===null)l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),O_(c,m,_),Gm(c,m,_,E),_=!0;else if(l===null){var F=c.stateNode,j=c.memoizedProps;F.props=j;var ue=F.context,be=m.contextType;typeof be=="object"&&be!==null?be=er(be):(be=Nn(m)?Dr:Et.current,be=$i(c,be));var We=m.getDerivedStateFromProps,gt=typeof We=="function"||typeof F.getSnapshotBeforeUpdate=="function";gt||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(j!==_||ue!==be)&&F_(c,F,_,be),Ds=!1;var rt=c.memoizedState;F.state=rt,zf(c,_,F,E),ue=c.memoizedState,j!==_||rt!==ue||cn.current||Ds?(typeof We=="function"&&(Vm(c,m,We,_),ue=c.memoizedState),(j=Ds||z_(c,m,j,_,rt,ue,be))?(gt||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(c.flags|=4194308)):(typeof F.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=_,c.memoizedState=ue),F.props=_,F.state=ue,F.context=be,_=j):(typeof F.componentDidMount=="function"&&(c.flags|=4194308),_=!1)}else{F=c.stateNode,I_(l,c),j=c.memoizedProps,be=c.type===c.elementType?j:vr(c.type,j),F.props=be,gt=c.pendingProps,rt=F.context,ue=m.contextType,typeof ue=="object"&&ue!==null?ue=er(ue):(ue=Nn(m)?Dr:Et.current,ue=$i(c,ue));var Wt=m.getDerivedStateFromProps;(We=typeof Wt=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(j!==gt||rt!==ue)&&F_(c,F,_,ue),Ds=!1,rt=c.memoizedState,F.state=rt,zf(c,_,F,E);var $e=c.memoizedState;j!==gt||rt!==$e||cn.current||Ds?(typeof Wt=="function"&&(Vm(c,m,Wt,_),$e=c.memoizedState),(be=Ds||z_(c,m,be,_,rt,$e,ue)||!1)?(We||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(_,$e,ue),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(_,$e,ue)),typeof F.componentDidUpdate=="function"&&(c.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof F.componentDidUpdate!="function"||j===l.memoizedProps&&rt===l.memoizedState||(c.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||j===l.memoizedProps&&rt===l.memoizedState||(c.flags|=1024),c.memoizedProps=_,c.memoizedState=$e),F.props=_,F.state=$e,F.context=ue,_=be):(typeof F.componentDidUpdate!="function"||j===l.memoizedProps&&rt===l.memoizedState||(c.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||j===l.memoizedProps&&rt===l.memoizedState||(c.flags|=1024),_=!1)}return l0(l,c,m,_,A,E)}function l0(l,c,m,_,E,A){Mx(l,c);var F=(c.flags&128)!==0;if(!_&&!F)return E&&Da(c,m,!1),as(l,c,A);_=c.stateNode,HA.current=c;var j=F&&typeof m.getDerivedStateFromError!="function"?null:_.render();return c.flags|=1,l!==null&&F?(c.child=Ba(c,l.child,null,A),c.child=Ba(c,null,j,A)):ci(l,c,j,A),c.memoizedState=_.state,E&&Da(c,m,!0),c.child}function Ex(l){var c=l.stateNode;c.pendingContext?Ur(l,c.pendingContext,c.pendingContext!==c.context):c.context&&Ur(l,c.context,!1),Zm(l,c.containerInfo)}function Tx(l,c,m,_,E){return ka(),qm(E),c.flags|=256,ci(l,c,m,_),c.child}var Jf={dehydrated:null,treeContext:null,retryLane:0};function Qf(l){return{baseLanes:l,cachePool:null}}function Ax(l,c,m){var _=c.pendingProps,E=nn.current,A=!1,F=(c.flags&128)!==0,j;if((j=F)||(j=l!==null&&l.memoizedState===null?!1:(E&2)!==0),j?(A=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(E|=1),Ge(nn,E&1),l===null)return Ym(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(c.mode&1?fc(l)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(E=_.children,l=_.fallback,A?(_=c.mode,A=c.child,E={mode:"hidden",children:E},!(_&1)&&A!==null?(A.childLanes=0,A.pendingProps=E):A=yh(E,_,0,null),l=zo(l,_,m,null),A.return=c,l.return=c,A.sibling=l,c.child=A,c.child.memoizedState=Qf(m),c.memoizedState=Jf,l):c0(c,E));if(E=l.memoizedState,E!==null){if(j=E.dehydrated,j!==null){if(F)return c.flags&256?(c.flags&=-257,$f(l,c,m,Error(o(422)))):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(A=_.fallback,E=c.mode,_=yh({mode:"visible",children:_.children},E,0,null),A=zo(A,E,m,null),A.flags|=2,_.return=c,A.return=c,_.sibling=A,c.child=_,c.mode&1&&Ba(c,l.child,null,m),c.child.memoizedState=Qf(m),c.memoizedState=Jf,A);if(!(c.mode&1))c=$f(l,c,m,null);else if(fc(j))c=$f(l,c,m,Error(o(419)));else if(_=(m&l.childLanes)!==0,Oi||_){if(_=Sn,_!==null){switch(m&-m){case 4:A=2;break;case 16:A=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:A=32;break;case 536870912:A=268435456;break;default:A=0}_=A&(_.suspendedLanes|m)?0:A,_!==0&&_!==E.retryLane&&(E.retryLane=_,sr(l,_,-1))}R0(),c=$f(l,c,m,Error(o(421)))}else uc(j)?(c.flags|=128,c.child=l.child,c=eC.bind(null,l),La(j,c),c=null):(m=E.treeContext,we&&(zi=Tf(j),Ui=c,Qt=!0,yr=null,pc=!1,m!==null&&(tr[nr++]=rs,tr[nr++]=ss,tr[nr++]=bo,rs=m.id,ss=m.overflow,bo=c)),c=c0(c,c.pendingProps.children),c.flags|=4096);return c}return A?(_=bx(l,c,_.children,_.fallback,m),A=c.child,E=l.child.memoizedState,A.memoizedState=E===null?Qf(m):{baseLanes:E.baseLanes|m,cachePool:null},A.childLanes=l.childLanes&~m,c.memoizedState=Jf,_):(m=Cx(l,c,_.children,m),c.memoizedState=null,m)}return A?(_=bx(l,c,_.children,_.fallback,m),A=c.child,E=l.child.memoizedState,A.memoizedState=E===null?Qf(m):{baseLanes:E.baseLanes|m,cachePool:null},A.childLanes=l.childLanes&~m,c.memoizedState=Jf,_):(m=Cx(l,c,_.children,m),c.memoizedState=null,m)}function c0(l,c){return c=yh({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function Cx(l,c,m,_){var E=l.child;return l=E.sibling,m=Bs(E,{mode:"visible",children:m}),!(c.mode&1)&&(m.lanes=_),m.return=c,m.sibling=null,l!==null&&(_=c.deletions,_===null?(c.deletions=[l],c.flags|=16):_.push(l)),c.child=m}function bx(l,c,m,_,E){var A=c.mode;l=l.child;var F=l.sibling,j={mode:"hidden",children:m};return!(A&1)&&c.child!==l?(m=c.child,m.childLanes=0,m.pendingProps=j,c.deletions=null):(m=Bs(l,j),m.subtreeFlags=l.subtreeFlags&14680064),F!==null?_=Bs(F,_):(_=zo(_,A,E,null),_.flags|=2),_.return=c,m.return=c,m.sibling=_,c.child=m,_}function $f(l,c,m,_){return _!==null&&qm(_),Ba(c,l.child,null,m),l=c0(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function Rx(l,c,m){l.lanes|=c;var _=l.alternate;_!==null&&(_.lanes|=c),Bm(l.return,c,m)}function u0(l,c,m,_,E){var A=l.memoizedState;A===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:_,tail:m,tailMode:E}:(A.isBackwards=c,A.rendering=null,A.renderingStartTime=0,A.last=_,A.tail=m,A.tailMode=E)}function Px(l,c,m){var _=c.pendingProps,E=_.revealOrder,A=_.tail;if(ci(l,c,_.children,m),_=nn.current,_&2)_=_&1|2,c.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Rx(l,m,c);else if(l.tag===19)Rx(l,m,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}_&=1}if(Ge(nn,_),!(c.mode&1))c.memoizedState=null;else switch(E){case"forwards":for(m=c.child,E=null;m!==null;)l=m.alternate,l!==null&&Hf(l)===null&&(E=m),m=m.sibling;m=E,m===null?(E=c.child,c.child=null):(E=m.sibling,m.sibling=null),u0(c,!1,E,m,A);break;case"backwards":for(m=null,E=c.child,c.child=null;E!==null;){if(l=E.alternate,l!==null&&Hf(l)===null){c.child=E;break}l=E.sibling,E.sibling=m,m=E,E=l}u0(c,!0,m,null,A);break;case"together":u0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function as(l,c,m){if(l!==null&&(c.dependencies=l.dependencies),Xa|=c.lanes,!(m&c.childLanes))return null;if(l!==null&&c.child!==l.child)throw Error(o(153));if(c.child!==null){for(l=c.child,m=Bs(l,l.pendingProps),c.child=m,m.return=c;l.sibling!==null;)l=l.sibling,m=m.sibling=Bs(l,l.pendingProps),m.return=c;m.sibling=null}return c.child}function VA(l,c,m){switch(c.tag){case 3:Ex(c),ka();break;case 5:j_(c);break;case 1:Nn(c.type)&&Vn(c);break;case 4:Zm(c,c.stateNode.containerInfo);break;case 10:L_(c,c.type._context,c.memoizedProps.value);break;case 13:var _=c.memoizedState;if(_!==null)return _.dehydrated!==null?(Ge(nn,nn.current&1),c.flags|=128,null):m&c.child.childLanes?Ax(l,c,m):(Ge(nn,nn.current&1),l=as(l,c,m),l!==null?l.sibling:null);Ge(nn,nn.current&1);break;case 19:if(_=(m&c.childLanes)!==0,l.flags&128){if(_)return Px(l,c,m);c.flags|=128}var E=c.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Ge(nn,nn.current),_)break;return null;case 22:case 23:return c.lanes=0,Sx(l,c,m)}return as(l,c,m)}function GA(l,c){switch(Xm(c),c.tag){case 1:return Nn(c.type)&&gn(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return Va(),at(cn),at(Et),Qm(),l=c.flags,l&65536&&!(l&128)?(c.flags=l&-65537|128,c):null;case 5:return Km(c),null;case 13:if(at(nn),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(o(340));ka()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return at(nn),null;case 4:return Va(),null;case 10:return km(c.type._context),null;case 22:case 23:return b0(),null;case 24:return null;default:return null}}var eh=!1,Lo=!1,WA=typeof WeakSet=="function"?WeakSet:Set,De=null;function th(l,c){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(_){Ei(l,c,_)}else m.current=null}function f0(l,c,m){try{m()}catch(_){Ei(l,c,_)}}var Lx=!1;function XA(l,c){for(B(l.containerInfo),De=c;De!==null;)if(l=De,c=l.child,(l.subtreeFlags&1028)!==0&&c!==null)c.return=l,De=c;else for(;De!==null;){l=De;try{var m=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var _=m.memoizedProps,E=m.memoizedState,A=l.stateNode,F=A.getSnapshotBeforeUpdate(l.elementType===l.type?_:vr(l.type,_),E);A.__reactInternalSnapshotBeforeUpdate=F}break;case 3:Ke&&Re(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(j){Ei(l,l.return,j)}if(c=l.sibling,c!==null){c.return=l.return,De=c;break}De=l.return}return m=Lx,Lx=!1,m}function Io(l,c,m){var _=c.updateQueue;if(_=_!==null?_.lastEffect:null,_!==null){var E=_=_.next;do{if((E.tag&l)===l){var A=E.destroy;E.destroy=void 0,A!==void 0&&f0(c,m,A)}E=E.next}while(E!==_)}}function Ac(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var m=c=c.next;do{if((m.tag&l)===l){var _=m.create;m.destroy=_()}m=m.next}while(m!==c)}}function h0(l){var c=l.ref;if(c!==null){var m=l.stateNode;switch(l.tag){case 5:l=te(m);break;default:l=m}typeof c=="function"?c(l):c.current=l}}function Ix(l,c,m){if(zr&&typeof zr.onCommitFiberUnmount=="function")try{zr.onCommitFiberUnmount(Pf,c)}catch{}switch(c.tag){case 0:case 11:case 14:case 15:if(l=c.updateQueue,l!==null&&(l=l.lastEffect,l!==null)){var _=l=l.next;do{var E=_,A=E.destroy;E=E.tag,A!==void 0&&(E&2||E&4)&&f0(c,m,A),_=_.next}while(_!==l)}break;case 1:if(th(c,m),l=c.stateNode,typeof l.componentWillUnmount=="function")try{l.props=c.memoizedProps,l.state=c.memoizedState,l.componentWillUnmount()}catch(F){Ei(c,m,F)}break;case 5:th(c,m);break;case 4:Ke?Fx(l,c,m):G&&G&&(c=c.stateNode.containerInfo,m=it(c),Rt(c,m))}}function Nx(l,c,m){for(var _=c;;)if(Ix(l,_,m),_.child===null||Ke&&_.tag===4){if(_===c)break;for(;_.sibling===null;){if(_.return===null||_.return===c)return;_=_.return}_.sibling.return=_.return,_=_.sibling}else _.child.return=_,_=_.child}function Dx(l){var c=l.alternate;c!==null&&(l.alternate=null,Dx(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&Ze(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Ux(l){return l.tag===5||l.tag===3||l.tag===4}function zx(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Ux(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ox(l){if(Ke){e:{for(var c=l.return;c!==null;){if(Ux(c))break e;c=c.return}throw Error(o(160))}var m=c;switch(m.tag){case 5:c=m.stateNode,m.flags&32&&(ge(c),m.flags&=-33),m=zx(l),p0(l,m,c);break;case 3:case 4:c=m.stateNode.containerInfo,m=zx(l),d0(l,m,c);break;default:throw Error(o(161))}}}function d0(l,c,m){var _=l.tag;if(_===5||_===6)l=l.stateNode,c?et(m,l,c):dt(m,l);else if(_!==4&&(l=l.child,l!==null))for(d0(l,c,m),l=l.sibling;l!==null;)d0(l,c,m),l=l.sibling}function p0(l,c,m){var _=l.tag;if(_===5||_===6)l=l.stateNode,c?ct(m,l,c):tt(m,l);else if(_!==4&&(l=l.child,l!==null))for(p0(l,c,m),l=l.sibling;l!==null;)p0(l,c,m),l=l.sibling}function Fx(l,c,m){for(var _=c,E=!1,A,F;;){if(!E){E=_.return;e:for(;;){if(E===null)throw Error(o(160));switch(A=E.stateNode,E.tag){case 5:F=!1;break e;case 3:A=A.containerInfo,F=!0;break e;case 4:A=A.containerInfo,F=!0;break e}E=E.return}E=!0}if(_.tag===5||_.tag===6)Nx(l,_,m),F?X(A,_.stateNode):He(A,_.stateNode);else if(_.tag===18)F?re(A,_.stateNode):le(A,_.stateNode);else if(_.tag===4){if(_.child!==null){A=_.stateNode.containerInfo,F=!0,_.child.return=_,_=_.child;continue}}else if(Ix(l,_,m),_.child!==null){_.child.return=_,_=_.child;continue}if(_===c)break;for(;_.sibling===null;){if(_.return===null||_.return===c)return;_=_.return,_.tag===4&&(E=!1)}_.sibling.return=_.return,_=_.sibling}}function m0(l,c){if(Ke){switch(c.tag){case 0:case 11:case 14:case 15:Io(3,c,c.return),Ac(3,c),Io(5,c,c.return);return;case 1:return;case 5:var m=c.stateNode;if(m!=null){var _=c.memoizedProps;l=l!==null?l.memoizedProps:_;var E=c.type,A=c.updateQueue;c.updateQueue=null,A!==null&&yt(m,A,E,l,_,c)}return;case 6:if(c.stateNode===null)throw Error(o(162));m=c.memoizedProps,Se(c.stateNode,l!==null?l.memoizedProps:m,m);return;case 3:we&&l!==null&&l.memoizedState.isDehydrated&&$(c.stateNode.containerInfo);return;case 12:return;case 13:nh(c);return;case 19:nh(c);return;case 17:return}throw Error(o(163))}switch(c.tag){case 0:case 11:case 14:case 15:Io(3,c,c.return),Ac(3,c),Io(5,c,c.return);return;case 12:return;case 13:nh(c);return;case 19:nh(c);return;case 3:we&&l!==null&&l.memoizedState.isDehydrated&&$(c.stateNode.containerInfo);break;case 22:case 23:return}e:if(G){switch(c.tag){case 1:case 5:case 6:break e;case 3:case 4:c=c.stateNode,Rt(c.containerInfo,c.pendingChildren);break e}throw Error(o(163))}}function nh(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new WA),c.forEach(function(_){var E=tC.bind(null,l,_);m.has(_)||(m.add(_),_.then(E,E))})}}function jA(l,c){for(De=c;De!==null;){c=De;var m=c.deletions;if(m!==null)for(var _=0;_";case rh:return":has("+(y0(l)||"")+")";case sh:return'[role="'+l.value+'"]';case ah:return'"'+l.value+'"';case oh:return'[data-testname="'+l.value+'"]';default:throw Error(o(365))}}function Gx(l,c){var m=[];l=[l,0];for(var _=0;_E&&(E=F),_&=~A}if(_=E,_=Dn()-_,_=(120>_?120:480>_?480:1080>_?1080:1920>_?1920:3e3>_?3e3:4320>_?4320:1960*qA(_/1960))-_,10<_){l.timeoutHandle=Te(Do.bind(null,l,Mi),_);break}Do(l,Mi);break;case 5:Do(l,Mi);break;default:throw Error(o(329))}}}return wi(l,Dn()),l.callbackNode===m?Wx.bind(null,l):null}function A0(l,c){var m=Rc;return l.current.memoizedState.isDehydrated&&(No(l,c).flags|=256),l=gh(l,c),l!==2&&(c=Mi,Mi=m,c!==null&&C0(c)),l}function C0(l){Mi===null?Mi=l:Mi.push.apply(Mi,l)}function ZA(l){for(var c=l;;){if(c.flags&16384){var m=c.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var _=0;_l?16:l,Os===null)var _=!1;else{if(l=Os,Os=null,hh=0,Tt&6)throw Error(o(331));var E=Tt;for(Tt|=4,De=l.current;De!==null;){var A=De,F=A.child;if(De.flags&16){var j=A.deletions;if(j!==null){for(var ue=0;ueDn()-M0?No(l,0):S0|=m),wi(l,c)}function Qx(l,c){c===0&&(l.mode&1?(c=bf,bf<<=1,!(bf&130023424)&&(bf=4194304)):c=1);var m=ui();l=mh(l,c),l!==null&&(dc(l,c,m),wi(l,m))}function eC(l){var c=l.memoizedState,m=0;c!==null&&(m=c.retryLane),Qx(l,m)}function tC(l,c){var m=0;switch(l.tag){case 13:var _=l.stateNode,E=l.memoizedState;E!==null&&(m=E.retryLane);break;case 19:_=l.stateNode;break;default:throw Error(o(314))}_!==null&&_.delete(c),Qx(l,m)}var $x;$x=function(l,c,m){if(l!==null)if(l.memoizedProps!==c.pendingProps||cn.current)Oi=!0;else{if(!(l.lanes&m)&&!(c.flags&128))return Oi=!1,VA(l,c,m);Oi=!!(l.flags&131072)}else Oi=!1,Qt&&c.flags&1048576&&k_(c,kf,c.index);switch(c.lanes=0,c.tag){case 2:var _=c.type;l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),l=c.pendingProps;var E=$i(c,Et.current);za(c,m),E=e0(null,c,_,l,E,m);var A=t0();return c.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Nn(_)?(A=!0,Vn(c)):A=!1,c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Hm(c),E.updater=Of,c.stateNode=E,E._reactInternals=c,Gm(c,_,l,m),c=l0(null,c,_,!0,A,m)):(c.tag=0,Qt&&A&&Wm(c),ci(null,c,E,m),c=c.child),c;case 16:_=c.elementType;e:{switch(l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),l=c.pendingProps,E=_._init,_=E(_._payload),c.type=_,E=c.tag=iC(_),l=vr(_,l),E){case 0:c=a0(null,c,_,l,m);break e;case 1:c=wx(null,c,_,l,m);break e;case 11:c=yx(null,c,_,l,m);break e;case 14:c=_x(null,c,_,vr(_.type,l),m);break e}throw Error(o(306,_,""))}return c;case 0:return _=c.type,E=c.pendingProps,E=c.elementType===_?E:vr(_,E),a0(l,c,_,E,m);case 1:return _=c.type,E=c.pendingProps,E=c.elementType===_?E:vr(_,E),wx(l,c,_,E,m);case 3:e:{if(Ex(c),l===null)throw Error(o(387));_=c.pendingProps,A=c.memoizedState,E=A.element,I_(l,c),zf(c,_,null,m);var F=c.memoizedState;if(_=F.element,we&&A.isDehydrated)if(A={element:_,isDehydrated:!1,cache:F.cache,transitions:F.transitions},c.updateQueue.baseState=A,c.memoizedState=A,c.flags&256){E=Error(o(423)),c=Tx(l,c,_,m,E);break e}else if(_!==E){E=Error(o(424)),c=Tx(l,c,_,m,E);break e}else for(we&&(zi=Ef(c.stateNode.containerInfo),Ui=c,Qt=!0,yr=null,pc=!1),m=X_(c,null,_,m),c.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(ka(),_===E){c=as(l,c,m);break e}ci(l,c,_,m)}c=c.child}return c;case 5:return j_(c),l===null&&Ym(c),_=c.type,E=c.pendingProps,A=l!==null?l.memoizedProps:null,F=E.children,pe(_,E)?F=null:A!==null&&pe(_,A)&&(c.flags|=32),Mx(l,c),ci(l,c,F,m),c.child;case 6:return l===null&&Ym(c),null;case 13:return Ax(l,c,m);case 4:return Zm(c,c.stateNode.containerInfo),_=c.pendingProps,l===null?c.child=Ba(c,null,_,m):ci(l,c,_,m),c.child;case 11:return _=c.type,E=c.pendingProps,E=c.elementType===_?E:vr(_,E),yx(l,c,_,E,m);case 7:return ci(l,c,c.pendingProps,m),c.child;case 8:return ci(l,c,c.pendingProps.children,m),c.child;case 12:return ci(l,c,c.pendingProps.children,m),c.child;case 10:e:{if(_=c.type._context,E=c.pendingProps,A=c.memoizedProps,F=E.value,L_(c,_,F),A!==null)if(Or(A.value,F)){if(A.children===E.children&&!cn.current){c=as(l,c,m);break e}}else for(A=c.child,A!==null&&(A.return=c);A!==null;){var j=A.dependencies;if(j!==null){F=A.child;for(var ue=j.firstContext;ue!==null;){if(ue.context===_){if(A.tag===1){ue=is(-1,m&-m),ue.tag=2;var be=A.updateQueue;if(be!==null){be=be.shared;var We=be.pending;We===null?ue.next=ue:(ue.next=We.next,We.next=ue),be.pending=ue}}A.lanes|=m,ue=A.alternate,ue!==null&&(ue.lanes|=m),Bm(A.return,m,c),j.lanes|=m;break}ue=ue.next}}else if(A.tag===10)F=A.type===c.type?null:A.child;else if(A.tag===18){if(F=A.return,F===null)throw Error(o(341));F.lanes|=m,j=F.alternate,j!==null&&(j.lanes|=m),Bm(F,m,c),F=A.sibling}else F=A.child;if(F!==null)F.return=A;else for(F=A;F!==null;){if(F===c){F=null;break}if(A=F.sibling,A!==null){A.return=F.return,F=A;break}F=F.return}A=F}ci(l,c,E.children,m),c=c.child}return c;case 9:return E=c.type,_=c.pendingProps.children,za(c,m),E=er(E),_=_(E),c.flags|=1,ci(l,c,_,m),c.child;case 14:return _=c.type,E=vr(_,c.pendingProps),E=vr(_.type,E),_x(l,c,_,E,m);case 15:return xx(l,c,c.type,c.pendingProps,m);case 17:return _=c.type,E=c.pendingProps,E=c.elementType===_?E:vr(_,E),l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),c.tag=1,Nn(_)?(l=!0,Vn(c)):l=!1,za(c,m),O_(c,_,E),Gm(c,_,E,m),l0(null,c,_,!0,l,m);case 19:return Px(l,c,m);case 22:return Sx(l,c,m)}throw Error(o(156,c.tag))};function e2(l,c){return Nm(l,c)}function nC(l,c,m,_){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function or(l,c,m,_){return new nC(l,c,m,_)}function P0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function iC(l){if(typeof l=="function")return P0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===w)return 11;if(l===x)return 14}return 2}function Bs(l,c){var m=l.alternate;return m===null?(m=or(l.tag,c,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=c,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,c=l.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function vh(l,c,m,_,E,A){var F=2;if(_=l,typeof l=="function")P0(l)&&(F=1);else if(typeof l=="string")F=5;else e:switch(l){case h:return zo(m.children,E,A,c);case d:F=8,E|=8;break;case p:return l=or(12,m,c,E|2),l.elementType=p,l.lanes=A,l;case S:return l=or(13,m,c,E),l.elementType=S,l.lanes=A,l;case g:return l=or(19,m,c,E),l.elementType=g,l.lanes=A,l;case T:return yh(m,E,A,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case v:F=10;break e;case y:F=9;break e;case w:F=11;break e;case x:F=14;break e;case M:F=16,_=null;break e}throw Error(o(130,l==null?l:typeof l,""))}return c=or(F,m,c,E),c.elementType=l,c.type=_,c.lanes=A,c}function zo(l,c,m,_){return l=or(7,l,_,c),l.lanes=m,l}function yh(l,c,m,_){return l=or(22,l,_,c),l.elementType=T,l.lanes=m,l.stateNode={},l}function L0(l,c,m){return l=or(6,l,null,c),l.lanes=m,l}function I0(l,c,m){return c=or(4,l.children!==null?l.children:[],l.key,c),c.lanes=m,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function rC(l,c,m,_,E){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=lt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lm(0),this.expirationTimes=Lm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lm(0),this.identifierPrefix=_,this.onRecoverableError=E,we&&(this.mutableSourceEagerHydrationData=null)}function t2(l,c,m,_,E,A,F,j,ue){return l=new rC(l,c,m,j,ue),c===1?(c=1,A===!0&&(c|=8)):c=0,A=or(3,null,null,c),l.current=A,A.stateNode=l,A.memoizedState={element:_,isDehydrated:m,cache:null,transitions:null},Hm(A),l}function n2(l){if(!l)return Qi;l=l._reactInternals;e:{if(b(l)!==l||l.tag!==1)throw Error(o(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Nn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(l.tag===1){var m=l.type;if(Nn(m))return Na(l,m,c)}return c}function i2(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(o(188)):(l=Object.keys(l).join(","),Error(o(268,l)));return l=q(c),l===null?null:l.stateNode}function r2(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m=be&&A>=gt&&E<=We&&F<=rt){l.splice(c,1);break}else if(_!==be||m.width!==ue.width||rtF){if(!(A!==gt||m.height!==ue.height||We<_||be>E)){be>_&&(ue.width+=be-_,ue.x=_),WeA&&(ue.height+=gt-A,ue.y=A),rtm&&(m=F)),F ")+` + +No matching component was found for: + `)+l.join(" > ")}return null},t.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return te(l.child.stateNode);default:return l.child.stateNode}},t.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:sC,findFiberByHostInstance:l.findFiberByHostInstance||oC,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{Pf=c.inject(l),zr=c}catch{}l=!!c.checkDCE}}return l},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(l,c,m,_){if(!I)throw Error(o(363));l=_0(l,c);var E=Fe(l,m,_).disconnect;return{disconnect:function(){E()}}},t.registerMutableSourceForHydration=function(l,c){var m=c._getVersion;m=m(c._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[c,m]:l.mutableSourceEagerHydrationData.push(c,m)},t.runWithPriority=function(l,c){var m=Dt;try{return Dt=l,c()}finally{Dt=m}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(l,c,m,_){var E=c.current,A=ui(),F=Fs(E);return m=n2(m),c.context===null?c.context=m:c.pendingContext=m,c=is(A,F),c.payload={element:l},_=_===void 0?null:_,_!==null&&(c.callback=_),Us(E,c),l=sr(E,F,A),l!==null&&Uf(l,E,F),F},t};V4.exports=JD;var QD=V4.exports;const $D=Gv(QD);var G4={exports:{}},W4={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(n){function e(N,B){var H=N.length;N.push(B);e:for(;0>>1,J=N[Y];if(0>>1;Yr(pe,H))Eer(Te,pe)?(N[Y]=Te,N[Ee]=H,Y=Ee):(N[Y]=pe,N[ie]=H,Y=ie);else if(Eer(Te,H))N[Y]=Te,N[Ee]=H,Y=Ee;else break e}}return B}function r(N,B){var H=N.sortIndex-B.sortIndex;return H!==0?H:N.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var u=[],f=[],h=1,d=null,p=3,v=!1,y=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(N){for(var B=t(f);B!==null;){if(B.callback===null)i(f);else if(B.startTime<=N)i(f),B.sortIndex=B.expirationTime,e(u,B);else break;B=t(f)}}function T(N){if(w=!1,M(N),!y)if(t(u)!==null)y=!0,te(P);else{var B=t(f);B!==null&&ae(T,B.startTime-N)}}function P(N,B){y=!1,w&&(w=!1,g(D),D=-1),v=!0;var H=p;try{for(M(B),d=t(u);d!==null&&(!(d.expirationTime>B)||N&&!k());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,p=d.priorityLevel;var J=Y(d.expirationTime<=B);B=n.unstable_now(),typeof J=="function"?d.callback=J:d===t(u)&&i(u),M(B)}else i(u);d=t(u)}if(d!==null)var Z=!0;else{var ie=t(f);ie!==null&&ae(T,ie.startTime-B),Z=!1}return Z}finally{d=null,p=H,v=!1}}var C=!1,L=null,D=-1,b=5,R=-1;function k(){return!(n.unstable_now()-RN||125Y?(N.sortIndex=H,e(f,N),t(u)===null&&N===t(f)&&(w?(g(D),D=-1):w=!0,ae(T,H-Y))):(N.sortIndex=J,e(u,N),y||v||(y=!0,te(P))),N},n.unstable_shouldYield=k,n.unstable_wrapCallback=function(N){var B=p;return function(){var H=p;p=B;try{return N.apply(this,arguments)}finally{p=H}}}})(W4);G4.exports=W4;var q3=G4.exports;const T_={},e7=n=>void Object.assign(T_,n);function t7(n,e){function t(h,{args:d=[],attach:p,...v},y){let w=`${h[0].toUpperCase()}${h.slice(1)}`,S;if(h==="primitive"){if(v.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=v.object;S=vl(g,{type:h,root:y,attach:p,primitive:!0})}else{const g=T_[w];if(!g)throw new Error(`R3F: ${w} 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(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");S=vl(new g(...d),{type:h,root:y,attach:p,memoizedProps:{args:d}})}return S.__r3f.attach===void 0&&(S instanceof St?S.__r3f.attach="geometry":S instanceof Yn&&(S.__r3f.attach="material")),w!=="inject"&&Yg(S,v),S}function i(h,d){let p=!1;if(d){var v,y;(v=d.__r3f)!=null&&v.attach?jg(h,d,d.__r3f.attach):d.isObject3D&&h.isObject3D&&(h.add(d),p=!0),p||(y=h.__r3f)==null||y.objects.push(d),d.__r3f||vl(d,{}),d.__r3f.parent=h,kv(d),yl(d)}}function r(h,d,p){let v=!1;if(d){var y,w;if((y=d.__r3f)!=null&&y.attach)jg(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"});const S=h.children.filter(x=>x!==d),g=S.indexOf(p);h.children=[...S.slice(0,g),d,...S.slice(g)],v=!0}v||(w=h.__r3f)==null||w.objects.push(d),d.__r3f||vl(d,{}),d.__r3f.parent=h,kv(d),yl(d)}}function s(h,d,p=!1){h&&[...h].forEach(v=>o(d,v,p))}function o(h,d,p){if(d){var v,y,w;if(d.__r3f&&(d.__r3f.parent=null),(v=h.__r3f)!=null&&v.objects&&(h.__r3f.objects=h.__r3f.objects.filter(T=>T!==d)),(y=d.__r3f)!=null&&y.attach)$3(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var S;h.remove(d),(S=d.__r3f)!=null&&S.root&&c7(d.__r3f.root,d)}const x=(w=d.__r3f)==null?void 0:w.primitive,M=!x&&(p===void 0?d.dispose!==null:p);if(!x){var g;s((g=d.__r3f)==null?void 0:g.objects,d,M),s(d.children,d,M)}if(delete d.__r3f,M&&d.dispose&&d.type!=="Scene"){const T=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?q3.unstable_scheduleCallback(q3.unstable_IdlePriority,T):T()}yl(h)}}function a(h,d,p,v){var y;const w=(y=h.__r3f)==null?void 0:y.parent;if(!w)return;const S=t(d,p,h.__r3f.root);if(h.children){for(const g of h.children)g.__r3f&&i(S,g);h.children=h.children.filter(g=>!g.__r3f)}h.__r3f.objects.forEach(g=>i(S,g)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||o(w,h),S.parent&&(S.__r3f.autoRemovedBeforeAppend=!0),i(w,S),S.raycast&&S.__r3f.eventCount&&S.__r3f.root.getState().internal.interaction.push(S),[v,v.alternate].forEach(g=>{g!==null&&(g.stateNode=S,g.ref&&(typeof g.ref=="function"?g.ref(S):g.ref.current=S))})}const u=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:$D({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,d)=>{if(!d)return;const p=h.getState().scene;p.__r3f&&(p.__r3f.root=h,i(p,d))},removeChildFromContainer:(h,d)=>{d&&o(h.getState().scene,d)},insertInContainerBefore:(h,d,p)=>{if(!d||!p)return;const v=h.getState().scene;v.__r3f&&r(v,d,p)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var d;return!!((d=h==null?void 0:h.__r3f)!=null?d:{}).handlers},prepareUpdate(h,d,p,v){var y;if(((y=h==null?void 0:h.__r3f)!=null?y:{}).primitive&&v.object&&v.object!==h)return[!0];{const{args:S=[],children:g,...x}=v,{args:M=[],children:T,...P}=p;if(!Array.isArray(S))throw new Error("R3F: the args prop must be an array!");if(S.some((L,D)=>L!==M[D]))return[!0];const C=J4(h,x,P,!0);return C.changes.length?[!1,C]:null}},commitUpdate(h,[d,p],v,y,w,S){d?a(h,v,w,S):Yg(h,p)},commitMount(h,d,p,v){var y;const w=(y=h.__r3f)!=null?y:{};h.raycast&&w.handlers&&w.eventCount&&h.__r3f.root.getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>vl(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:p,parent:v}=(d=h.__r3f)!=null?d:{};p&&v&&$3(v,h,p),h.isObject3D&&(h.visible=!1),yl(h)},unhideInstance(h,d){var p;const{attach:v,parent:y}=(p=h.__r3f)!=null?p:{};v&&y&&jg(y,h,v),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),yl(h)},createTextInstance:u,hideTextInstance:u,unhideTextInstance:u,getCurrentEventPriority:()=>e?e():zl.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&$t.fun(performance.now)?performance.now:$t.fun(Date.now)?Date.now:()=>0,scheduleTimeout:$t.fun(setTimeout)?setTimeout:void 0,cancelTimeout:$t.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Yg}}var Z3,K3;const Xg=n=>"colorSpace"in n||"outputColorSpace"in n,X4=()=>{var n;return(n=T_.ColorManagement)!=null?n:null},j4=n=>n&&n.isOrthographicCamera,n7=n=>n&&n.hasOwnProperty("current"),wf=typeof window<"u"&&((Z3=window.document)!=null&&Z3.createElement||((K3=window.navigator)==null?void 0:K3.product)==="ReactNative")?ve.useLayoutEffect:ve.useEffect;function Y4(n){const e=ve.useRef(n);return wf(()=>void(e.current=n),[n]),e}function i7({set:n}){return wf(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class q4 extends ve.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}q4.getDerivedStateFromError=()=>({error:!0});const Z4="__default",J3=new Map,r7=n=>n&&!!n.memoized&&!!n.changes;function K4(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Kc=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},$t={obj:n=>n===Object(n)&&!$t.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if($t.str(n)||$t.num(n))return n===e;const s=$t.obj(n);if(s&&i==="reference")return n===e;const o=$t.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!$t.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if($t.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function s7(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function vl(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function Fv(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const Q3=/-\d+$/;function jg(n,e,t){if($t.str(t)){if(Q3.test(t)){const s=t.replace(Q3,""),{target:o,key:a}=Fv(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=Fv(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function $3(n,e,t){var i,r;if($t.str(t)){const{target:s,key:o}=Fv(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function J4(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...u}={},f=!1){var h;const d=(h=n==null?void 0:n.__r3f)!=null?h:{},p=Object.entries(r),v=[];if(f){const w=Object.keys(u);for(let S=0;S{var g;if((g=n.__r3f)!=null&&g.primitive&&w==="object"||$t.equ(S,u[w]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(w))return v.push([w,S,!0,[]]);let x=[];w.includes("-")&&(x=w.split("-")),v.push([w,S,!1,x]);for(const M in r){const T=r[M];M.startsWith(`${w}-`)&&v.push([M,T,!1,M.split("-")])}});const y={...r};return d.memoizedProps&&d.memoizedProps.args&&(y.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(y.attach=d.memoizedProps.attach),{memoized:y,changes:v}}const o7=typeof process<"u"&&!1;function Yg(n,e){var t,i,r;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:u,changes:f}=r7(e)?e:J4(n,e),h=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=u);for(let p=0;pM[T],n),!(x&&x.set))){const[M,...T]=S.reverse();g=T.reverse().reduce((P,C)=>P[C],n),v=M}if(y===Z4+"remove")if(g.constructor){let M=J3.get(g.constructor);M||(M=new g.constructor,J3.set(g.constructor,M)),y=M[v]}else y=0;if(w)y?s.handlers[v]=y:delete s.handlers[v],s.eventCount=Object.keys(s.handlers).length;else if(x&&x.set&&(x.copy||x instanceof fa)){if(Array.isArray(y))x.fromArray?x.fromArray(y):x.set(...y);else if(x.copy&&y&&y.constructor&&(o7?x.constructor.name===y.constructor.name:x.constructor===y.constructor))x.copy(y);else if(y!==void 0){const M=x instanceof Be;!M&&x.setScalar?x.setScalar(y):x instanceof fa&&y instanceof fa?x.mask=y.mask:x.set(y),!X4()&&!a.linear&&M&&x.convertSRGBToLinear()}}else if(g[v]=y,g[v]instanceof mn&&g[v].format===pi&&g[v].type===Kr){const M=g[v];Xg(M)&&Xg(a.gl)?M.colorSpace=a.gl.outputColorSpace:M.encoding=a.gl.outputEncoding}yl(n)}if(s.parent&&a.internal&&n.raycast&&h!==s.eventCount){const p=a.internal.interaction.indexOf(n);p>-1&&a.internal.interaction.splice(p,1),s.eventCount&&a.internal.interaction.push(n)}return!(f.length===1&&f[0][0]==="onUpdate")&&f.length&&(r=n.__r3f)!=null&&r.parent&&kv(n),n}function yl(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function kv(n){n.onUpdate==null||n.onUpdate(n)}function a7(n,e){n.manual||(j4(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function bd(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function l7(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return zl.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return zl.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return zl.ContinuousEventPriority;default:return zl.DefaultEventPriority}}function Q4(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function c7(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{Q4(t.capturedMap,e,i,r)})}function u7(n){function e(u){const{internal:f}=n.getState(),h=u.offsetX-f.initialClick[0],d=u.offsetY-f.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(u){return u.filter(f=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=f.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(u,f){const h=n.getState(),d=new Set,p=[],v=f?f(h.internal.interaction):h.internal.interaction;for(let g=0;g{const M=Kc(g.object),T=Kc(x.object);return!M||!T?g.distance-x.distance:T.events.priority-M.events.priority||g.distance-x.distance}).filter(g=>{const x=bd(g);return d.has(x)?!1:(d.add(x),!0)});h.events.filter&&(w=h.events.filter(w,h));for(const g of w){let x=g.object;for(;x;){var S;(S=x.__r3f)!=null&&S.eventCount&&p.push({...g,eventObject:x}),x=x.parent}}if("pointerId"in u&&h.internal.capturedMap.has(u.pointerId))for(let g of h.internal.capturedMap.get(u.pointerId).values())d.has(bd(g.intersection))||p.push(g.intersection);return p}function r(u,f,h,d){const p=n.getState();if(u.length){const v={stopped:!1};for(const y of u){const w=Kc(y.object)||p,{raycaster:S,pointer:g,camera:x,internal:M}=w,T=new O(g.x,g.y,0).unproject(x),P=R=>{var k,q;return(k=(q=M.capturedMap.get(R))==null?void 0:q.has(y.eventObject))!=null?k:!1},C=R=>{const k={intersection:y,target:f.target};M.capturedMap.has(R)?M.capturedMap.get(R).set(y.eventObject,k):M.capturedMap.set(R,new Map([[y.eventObject,k]])),f.target.setPointerCapture(R)},L=R=>{const k=M.capturedMap.get(R);k&&Q4(M.capturedMap,y.eventObject,k,R)};let D={};for(let R in f){let k=f[R];typeof k!="function"&&(D[R]=k)}let b={...y,...D,pointer:g,intersections:u,stopped:v.stopped,delta:h,unprojectedPoint:T,ray:S.ray,camera:x,stopPropagation(){const R="pointerId"in f&&M.capturedMap.get(f.pointerId);if((!R||R.has(y.eventObject))&&(b.stopped=v.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(k=>k.eventObject===y.eventObject))){const k=u.slice(0,u.indexOf(y));s([...k,y])}},target:{hasPointerCapture:P,setPointerCapture:C,releasePointerCapture:L},currentTarget:{hasPointerCapture:P,setPointerCapture:C,releasePointerCapture:L},nativeEvent:f};if(d(b),v.stopped===!0)break}}return u}function s(u){const{internal:f}=n.getState();for(const h of f.hovered.values())if(!u.length||!u.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f,v=p==null?void 0:p.handlers;if(f.hovered.delete(bd(h)),p!=null&&p.eventCount){const y={...h,intersections:u};v.onPointerOut==null||v.onPointerOut(y),v.onPointerLeave==null||v.onPointerLeave(y)}}}function o(u,f){for(let h=0;hs([]);case"onLostPointerCapture":return f=>{const{internal:h}=n.getState();"pointerId"in f&&h.capturedMap.has(f.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(f.pointerId)&&(h.capturedMap.delete(f.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=h;const v=u==="onPointerMove",y=u==="onClick"||u==="onContextMenu"||u==="onDoubleClick",S=i(h,v?t:void 0),g=y?e(h):0;u==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=S.map(M=>M.eventObject)),y&&!S.length&&g<=2&&(o(h,p.interaction),d&&d(h)),v&&s(S);function x(M){const T=M.eventObject,P=T.__r3f,C=P==null?void 0:P.handlers;if(P!=null&&P.eventCount)if(v){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){const L=bd(M),D=p.hovered.get(L);D?D.stopped&&M.stopPropagation():(p.hovered.set(L,M),C.onPointerOver==null||C.onPointerOver(M),C.onPointerEnter==null||C.onPointerEnter(M))}C.onPointerMove==null||C.onPointerMove(M)}else{const L=C[u];L?(!y||p.initialHits.includes(T))&&(o(h,p.interaction.filter(D=>!p.initialHits.includes(D))),L(M)):y&&p.initialHits.includes(T)&&o(h,p.interaction.filter(D=>!p.initialHits.includes(D)))}}r(S,h,g,x)}}return{handlePointer:a}}const $4=n=>!!(n!=null&&n.render),eA=ve.createContext(null),f7=(n,e)=>{const t=qD((a,u)=>{const f=new O,h=new O,d=new O;function p(g=u().camera,x=h,M=u().size){const{width:T,height:P,top:C,left:L}=M,D=T/P;x instanceof O?d.copy(x):d.set(...x);const b=g.getWorldPosition(f).distanceTo(d);if(j4(g))return{width:T/g.zoom,height:P/g.zoom,top:C,left:L,factor:1,distance:b,aspect:D};{const R=g.fov*Math.PI/180,k=2*Math.tan(R/2)*b,q=k*(T/P);return{width:q,height:k,top:C,left:L,factor:T/q,distance:b,aspect:D}}}let v;const y=g=>a(x=>({performance:{...x.performance,current:g}})),w=new de;return{set:a,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(u(),g),advance:(g,x)=>e(g,x,u()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new S_,pointer:w,mouse:w,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=u();v&&clearTimeout(v),g.performance.current!==g.performance.min&&y(g.performance.min),v=setTimeout(()=>y(u().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(x=>({...x,events:{...x.events,...g}})),setSize:(g,x,M,T,P)=>{const C=u().camera,L={width:g,height:x,top:T||0,left:P||0,updateStyle:M};a(D=>({size:L,viewport:{...D.viewport,...p(C,h,L)}}))},setDpr:g=>a(x=>{const M=K4(g);return{viewport:{...x.viewport,dpr:M,initialDpr:x.viewport.initialDpr||M}}}),setFrameloop:(g="always")=>{const x=u().clock;x.stop(),x.elapsedTime=0,g!=="never"&&(x.start(),x.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:ve.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,x,M)=>{const T=u().internal;return T.priority=T.priority+(x>0?1:0),T.subscribers.push({ref:g,priority:x,store:M}),T.subscribers=T.subscribers.sort((P,C)=>P.priority-C.priority),()=>{const P=u().internal;P!=null&&P.subscribers&&(P.priority=P.priority-(x>0?1:0),P.subscribers=P.subscribers.filter(C=>C.ref!==g))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:u,viewport:f,gl:h,set:d}=t.getState();if(u.width!==r.width||u.height!==r.height||f.dpr!==s){var p;r=u,s=f.dpr,a7(a,u),h.setPixelRatio(f.dpr);const v=(p=u.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(u.width,u.height,v)}a!==o&&(o=a,d(v=>({viewport:{...v.viewport,...v.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Rd,h7=new Set,d7=new Set,p7=new Set;function qg(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Jc(n,e){switch(n){case"before":return qg(h7,e);case"after":return qg(d7,e);case"tail":return qg(p7,e)}}let Zg,Kg;function Jg(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Zg=e.internal.subscribers,Rd=0;Rd0)&&!((f=r.gl.xr)!=null&&f.isPresenting)&&(t+=Jg(u,r))}if(Jc("after",u),t===0)return Jc("tail",u),e=!1,cancelAnimationFrame(i)}function o(u,f=1){var h;if(!u)return n.forEach(d=>o(d.store.getState()),f);(h=u.gl.xr)!=null&&h.isPresenting||!u.internal.active||u.frameloop==="never"||(u.internal.frames=Math.min(60,u.internal.frames+f),e||(e=!0,requestAnimationFrame(s)))}function a(u,f=!0,h,d){if(f&&Jc("before",u),h)Jg(u,h,d);else for(const p of n.values())Jg(u,p.store.getState());f&&Jc("after",u)}return{loop:s,invalidate:o,advance:a}}function tA(){const n=ve.useContext(eA);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Vi(n=t=>t,e){return tA()(n,e)}function A_(n,e=0){const t=tA(),i=t.getState().internal.subscribe,r=Y4(n);return wf(()=>i(r,e,t),[e,i,t]),null}const tc=new Map,{invalidate:eM,advance:tM}=m7(tc),{reconciler:Ip,applyProps:ml}=t7(tc,l7),gl={objects:"shallow",strict:!1},g7=(n,e)=>{const t=typeof n=="function"?n(e):n;return $4(t)?t:new r_({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function v7(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function y7(n){const e=tc.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||f7(eM,tM),o=t||Ip.createContainer(s,zl.ConcurrentRoot,null,!1,null,"",r,null);e||tc.set(n,{fiber:o,store:s});let a,u=!1,f;return{configure(h={}){let{gl:d,size:p,scene:v,events:y,onCreated:w,shadows:S=!1,linear:g=!1,flat:x=!1,legacy:M=!1,orthographic:T=!1,frameloop:P="always",dpr:C=[1,2],performance:L,raycaster:D,camera:b,onPointerMissed:R}=h,k=s.getState(),q=k.gl;k.gl||k.set({gl:q=g7(d,n)});let oe=k.raycaster;oe||k.set({raycaster:oe=new k4});const{params:V,...Q}=D||{};if($t.equ(Q,oe,gl)||ml(oe,{...Q}),$t.equ(V,oe.params,gl)||ml(oe,{params:{...oe.params,...V}}),!k.camera||k.camera===f&&!$t.equ(f,b,gl)){f=b;const J=b instanceof mf,Z=J?b:T?new Ss(0,0,0,0,.1,1e3):new pn(75,0,.1,1e3);J||(Z.position.z=5,b&&ml(Z,b),!k.camera&&!(b!=null&&b.rotation)&&Z.lookAt(0,0,0)),k.set({camera:Z}),oe.camera=Z}if(!k.scene){let J;v instanceof Pp?J=v:(J=new Pp,v&&ml(J,v)),k.set({scene:vl(J)})}if(!k.xr){var te;const J=(pe,Ee)=>{const Te=s.getState();Te.frameloop!=="never"&&tM(pe,!0,Te,Ee)},Z=()=>{const pe=s.getState();pe.gl.xr.enabled=pe.gl.xr.isPresenting,pe.gl.xr.setAnimationLoop(pe.gl.xr.isPresenting?J:null),pe.gl.xr.isPresenting||eM(pe)},ie={connect(){const pe=s.getState().gl;pe.xr.addEventListener("sessionstart",Z),pe.xr.addEventListener("sessionend",Z)},disconnect(){const pe=s.getState().gl;pe.xr.removeEventListener("sessionstart",Z),pe.xr.removeEventListener("sessionend",Z)}};typeof((te=q.xr)==null?void 0:te.addEventListener)=="function"&&ie.connect(),k.set({xr:ie})}if(q.shadowMap){const J=q.shadowMap.enabled,Z=q.shadowMap.type;if(q.shadowMap.enabled=!!S,$t.boo(S))q.shadowMap.type=hu;else if($t.str(S)){var ae;const ie={basic:LE,percentage:Jp,soft:hu,variance:Er};q.shadowMap.type=(ae=ie[S])!=null?ae:hu}else $t.obj(S)&&Object.assign(q.shadowMap,S);(J!==q.shadowMap.enabled||Z!==q.shadowMap.type)&&(q.shadowMap.needsUpdate=!0)}const N=X4();N&&("enabled"in N?N.enabled=!M:"legacyMode"in N&&(N.legacyMode=M)),ml(q,{outputEncoding:g?3e3:3001,toneMapping:x?Zr:Fy}),k.legacy!==M&&k.set(()=>({legacy:M})),k.linear!==g&&k.set(()=>({linear:g})),k.flat!==x&&k.set(()=>({flat:x})),d&&!$t.fun(d)&&!$4(d)&&!$t.equ(d,q,gl)&&ml(q,d),y&&!k.events.handlers&&k.set({events:y(s)});const Y=v7(n,p);return $t.equ(Y,k.size,gl)||k.setSize(Y.width,Y.height,Y.updateStyle,Y.top,Y.left),C&&k.viewport.dpr!==K4(C)&&k.setDpr(C),k.frameloop!==P&&k.setFrameloop(P),k.onPointerMissed||k.set({onPointerMissed:R}),L&&!$t.equ(L,k.performance,gl)&&k.set(J=>({performance:{...J.performance,...L}})),a=w,u=!0,this},render(h){return u||this.configure(),Ip.updateContainer(ve.createElement(_7,{store:s,children:h,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){nA(n)}}}function _7({store:n,children:e,onCreated:t,rootElement:i}){return wf(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),ve.createElement(eA.Provider,{value:n},e)}function nA(n,e){const t=tc.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),Ip.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,u;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(u=r.gl)!=null&&u.xr&&r.xr.disconnect(),s7(r),tc.delete(n),e&&e(n)}catch{}},500)})}}Ip.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:ve.version});function nc(){return nc=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(u,e-h):(i=null,t||(a=n.apply(s,r),s=r=null))}var f=function(){s=this,r=arguments,o=Date.now();var h=t&&!i;return i||(i=setTimeout(u,e)),h&&(a=n.apply(s,r),s=r=null),a};return f.clear=function(){i&&(clearTimeout(i),i=null)},f.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},f}Bv.debounce=Bv;var x7=Bv;const nM=Gv(x7);function S7(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)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[o,a]=ve.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=ve.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,h=e?typeof e=="number"?e:e.resize:null,d=ve.useRef(!1);ve.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,v,y]=ve.useMemo(()=>{const x=()=>{if(!u.current.element)return;const{left:M,top:T,width:P,height:C,bottom:L,right:D,x:b,y:R}=u.current.element.getBoundingClientRect(),k={left:M,top:T,width:P,height:C,bottom:L,right:D,x:b,y:R};u.current.element instanceof HTMLElement&&r&&(k.height=u.current.element.offsetHeight,k.width=u.current.element.offsetWidth),Object.freeze(k),d.current&&!T7(u.current.lastBounds,k)&&a(u.current.lastBounds=k)};return[x,h?nM(x,h):x,f?nM(x,f):x]},[a,r,f,h]);function w(){u.current.scrollContainers&&(u.current.scrollContainers.forEach(x=>x.removeEventListener("scroll",y,!0)),u.current.scrollContainers=null),u.current.resizeObserver&&(u.current.resizeObserver.disconnect(),u.current.resizeObserver=null)}function S(){u.current.element&&(u.current.resizeObserver=new s(y),u.current.resizeObserver.observe(u.current.element),t&&u.current.scrollContainers&&u.current.scrollContainers.forEach(x=>x.addEventListener("scroll",y,{capture:!0,passive:!0})))}const g=x=>{!x||x===u.current.element||(w(),u.current.element=x,u.current.scrollContainers=iA(x),S())};return w7(y,!!t),M7(v),ve.useEffect(()=>{w(),S()},[t,y,v]),ve.useEffect(()=>w,[]),[g,o,p]}function M7(n){ve.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function w7(n,e){ve.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function iA(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...iA(n.parentElement)]}const E7=["x","y","top","bottom","left","right","width","height"],T7=(n,e)=>E7.every(t=>n[t]===e[t]);var A7=Object.defineProperty,C7=Object.defineProperties,b7=Object.getOwnPropertyDescriptors,iM=Object.getOwnPropertySymbols,R7=Object.prototype.hasOwnProperty,P7=Object.prototype.propertyIsEnumerable,rM=(n,e,t)=>e in n?A7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,sM=(n,e)=>{for(var t in e||(e={}))R7.call(e,t)&&rM(n,t,e[t]);if(iM)for(var t of iM(e))P7.call(e,t)&&rM(n,t,e[t]);return n},L7=(n,e)=>C7(n,b7(e));function rA(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=rA(i,e,t);if(r)return r;i=e?null:i.sibling}}function sA(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const C_=sA(ve.createContext(null));class oA extends ve.Component{render(){return ve.createElement(C_.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:oM,ReactCurrentDispatcher:aM}=ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function I7(){const n=ve.useContext(C_);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=ve.useId();return ve.useMemo(()=>{for(const i of[oM==null?void 0:oM.current,n,n==null?void 0:n.alternate]){if(!i)continue;const r=rA(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function N7(){var n,e;const t=I7(),[i]=ve.useState(()=>new Map);i.clear();let r=t;for(;r;){const s=(n=r.type)==null?void 0:n._context;s&&s!==C_&&!i.has(s)&&i.set(s,(e=aM==null?void 0:aM.current)==null?void 0:e.readContext(sA(s))),r=r.return}return i}function D7(){const n=N7();return ve.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>ve.createElement(e,null,ve.createElement(t.Provider,L7(sM({},i),{value:n.get(t)}))),e=>ve.createElement(oA,sM({},e))),[n])}const Qg={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 U7(n){const{handlePointer:e}=u7(n);return{priority:1,enabled:!0,compute(t,i,r){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(Qg).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[u,f]=Qg[o];t.addEventListener(u,a,{passive:f})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=Qg[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const z7=ve.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=U7,eventSource:a,eventPrefix:u,shadows:f,linear:h,flat:d,legacy:p,orthographic:v,frameloop:y,dpr:w,performance:S,raycaster:g,camera:x,scene:M,onPointerMissed:T,onCreated:P,...C},L){ve.useMemo(()=>e7(XD),[]);const D=D7(),[b,R]=S7({scroll:!0,debounce:{scroll:50,resize:0},...i}),k=ve.useRef(null),q=ve.useRef(null);ve.useImperativeHandle(L,()=>k.current);const oe=Y4(T),[V,Q]=ve.useState(!1),[te,ae]=ve.useState(!1);if(V)throw V;if(te)throw te;const N=ve.useRef(null);wf(()=>{const H=k.current;R.width>0&&R.height>0&&H&&(N.current||(N.current=y7(H)),N.current.configure({gl:s,events:o,shadows:f,linear:h,flat:d,legacy:p,orthographic:v,frameloop:y,dpr:w,performance:S,raycaster:g,camera:x,scene:M,size:R,onPointerMissed:(...Y)=>oe.current==null?void 0:oe.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(a?n7(a)?a.current:a:q.current),u&&Y.setEvents({compute:(J,Z)=>{const ie=J[u+"X"],pe=J[u+"Y"];Z.pointer.set(ie/Z.size.width*2-1,-(pe/Z.size.height)*2+1),Z.raycaster.setFromCamera(Z.pointer,Z.camera)}}),P==null||P(Y)}}),N.current.render(ve.createElement(D,null,ve.createElement(q4,{set:ae},ve.createElement(ve.Suspense,{fallback:ve.createElement(i7,{set:Q})},e)))))}),ve.useEffect(()=>{const H=k.current;if(H)return()=>nA(H)},[]);const B=a?"none":"auto";return ve.createElement("div",nc({ref:q,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:B,...r}},C),ve.createElement("div",{ref:b,style:{width:"100%",height:"100%"}},ve.createElement("canvas",{ref:k,style:{display:"block"}},t)))}),O7=ve.forwardRef(function(e,t){return ve.createElement(oA,null,ve.createElement(z7,nc({},e,{ref:t})))}),F7="/my-portfolio/assets/moon-EUT5YxWH.jpg",k7="/my-portfolio/assets/normal-J2JQSlYj.jpg";function B7(){const n=new Dv().load(F7);new Dv().load(k7);const e=ve.useRef();return A_(()=>{e.current.rotation.y+=.002}),fe.jsxs("mesh",{ref:e,children:[fe.jsx("sphereGeometry",{args:[3,64,64]}),fe.jsx("meshStandardMaterial",{map:n})]})}function H7(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var V7=Object.defineProperty,G7=(n,e,t)=>e in n?V7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ut=(n,e,t)=>(G7(n,typeof e!="symbol"?e+"":e,t),t);const Pd=new Aa,lM=new gs,W7=Math.cos(70*(Math.PI/180)),cM=(n,e)=>(n%e+e)%e;let X7=class extends es{constructor(e,t){super(),ut(this,"object"),ut(this,"domElement"),ut(this,"enabled",!0),ut(this,"target",new O),ut(this,"minDistance",0),ut(this,"maxDistance",1/0),ut(this,"minZoom",0),ut(this,"maxZoom",1/0),ut(this,"minPolarAngle",0),ut(this,"maxPolarAngle",Math.PI),ut(this,"minAzimuthAngle",-1/0),ut(this,"maxAzimuthAngle",1/0),ut(this,"enableDamping",!1),ut(this,"dampingFactor",.05),ut(this,"enableZoom",!0),ut(this,"zoomSpeed",1),ut(this,"enableRotate",!0),ut(this,"rotateSpeed",1),ut(this,"enablePan",!0),ut(this,"panSpeed",1),ut(this,"screenSpacePanning",!0),ut(this,"keyPanSpeed",7),ut(this,"zoomToCursor",!1),ut(this,"autoRotate",!1),ut(this,"autoRotateSpeed",2),ut(this,"reverseOrbit",!1),ut(this,"reverseHorizontalOrbit",!1),ut(this,"reverseVerticalOrbit",!1),ut(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ut(this,"mouseButtons",{LEFT:Zo.ROTATE,MIDDLE:Zo.DOLLY,RIGHT:Zo.PAN}),ut(this,"touches",{ONE:Ko.ROTATE,TWO:Ko.DOLLY_PAN}),ut(this,"target0"),ut(this,"position0"),ut(this,"zoom0"),ut(this,"_domElementKeyEvents",null),ut(this,"getPolarAngle"),ut(this,"getAzimuthalAngle"),ut(this,"setPolarAngle"),ut(this,"setAzimuthalAngle"),ut(this,"getDistance"),ut(this,"listenToKeyEvents"),ut(this,"stopListenToKeyEvents"),ut(this,"saveState"),ut(this,"reset"),ut(this,"update"),ut(this,"connect"),ut(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=X=>{let ge=cM(X,2*Math.PI),Oe=h.phi;Oe<0&&(Oe+=2*Math.PI),ge<0&&(ge+=2*Math.PI);let Ue=Math.abs(ge-Oe);2*Math.PI-Ue{let ge=cM(X,2*Math.PI),Oe=h.theta;Oe<0&&(Oe+=2*Math.PI),ge<0&&(ge+=2*Math.PI);let Ue=Math.abs(ge-Oe);2*Math.PI-Uei.object.position.distanceTo(i.target),this.listenToKeyEvents=X=>{X.addEventListener("keydown",tt),this._domElementKeyEvents=X},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",tt),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),u=a.NONE},this.update=(()=>{const X=new O,ge=new O(0,1,0),Oe=new oi().setFromUnitVectors(e.up,ge),Ue=Oe.clone().invert(),Me=new O,W=new oi,Re=2*Math.PI;return function(){const it=i.object.position;Oe.setFromUnitVectors(e.up,ge),Ue.copy(Oe).invert(),X.copy(it).sub(i.target),X.applyQuaternion(Oe),h.setFromVector3(X),i.autoRotate&&u===a.NONE&&V(q()),i.enableDamping?(h.theta+=d.theta*i.dampingFactor,h.phi+=d.phi*i.dampingFactor):(h.theta+=d.theta,h.phi+=d.phi);let Ye=i.minAzimuthAngle,At=i.maxAzimuthAngle;isFinite(Ye)&&isFinite(At)&&(Ye<-Math.PI?Ye+=Re:Ye>Math.PI&&(Ye-=Re),At<-Math.PI?At+=Re:At>Math.PI&&(At-=Re),Ye<=At?h.theta=Math.max(Ye,Math.min(At,h.theta)):h.theta=h.theta>(Ye+At)/2?Math.max(Ye,h.theta):Math.min(At,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(v,i.dampingFactor):i.target.add(v),i.zoomToCursor&&b||i.object.isOrthographicCamera?h.radius=J(h.radius):h.radius=J(h.radius*p),X.setFromSpherical(h),X.applyQuaternion(Ue),it.copy(i.target).add(X),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,v.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),v.set(0,0,0));let Rt=!1;if(i.zoomToCursor&&b){let Gt=null;if(i.object instanceof pn&&i.object.isPerspectiveCamera){const Jt=X.length();Gt=J(Jt*p);const Lt=Jt-Gt;i.object.position.addScaledVector(L,Lt),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const Jt=new O(D.x,D.y,0);Jt.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Rt=!0;const Lt=new O(D.x,D.y,0);Lt.unproject(i.object),i.object.position.sub(Lt).add(Jt),i.object.updateMatrixWorld(),Gt=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Gt!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Gt).add(i.object.position):(Pd.origin.copy(i.object.position),Pd.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Pd.direction))f||8*(1-W.dot(i.object.quaternion))>f?(i.dispatchEvent(r),Me.copy(i.object.position),W.copy(i.object.quaternion),Rt=!1,!0):!1}})(),this.connect=X=>{X===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=X,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Ct),i.domElement.addEventListener("pointerdown",ee),i.domElement.addEventListener("pointercancel",ye),i.domElement.addEventListener("wheel",Fe)},this.dispose=()=>{var X,ge,Oe,Ue,Me,W;(X=i.domElement)==null||X.removeEventListener("contextmenu",Ct),(ge=i.domElement)==null||ge.removeEventListener("pointerdown",ee),(Oe=i.domElement)==null||Oe.removeEventListener("pointercancel",ye),(Ue=i.domElement)==null||Ue.removeEventListener("wheel",Fe),(Me=i.domElement)==null||Me.ownerDocument.removeEventListener("pointermove",xe),(W=i.domElement)==null||W.ownerDocument.removeEventListener("pointerup",_e),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",tt)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let u=a.NONE;const f=1e-6,h=new Ov,d=new Ov;let p=1;const v=new O,y=new de,w=new de,S=new de,g=new de,x=new de,M=new de,T=new de,P=new de,C=new de,L=new O,D=new de;let b=!1;const R=[],k={};function q(){return 2*Math.PI/60/60*i.autoRotateSpeed}function oe(){return Math.pow(.95,i.zoomSpeed)}function V(X){i.reverseOrbit||i.reverseHorizontalOrbit?d.theta+=X:d.theta-=X}function Q(X){i.reverseOrbit||i.reverseVerticalOrbit?d.phi+=X:d.phi-=X}const te=(()=>{const X=new O;return function(Oe,Ue){X.setFromMatrixColumn(Ue,0),X.multiplyScalar(-Oe),v.add(X)}})(),ae=(()=>{const X=new O;return function(Oe,Ue){i.screenSpacePanning===!0?X.setFromMatrixColumn(Ue,1):(X.setFromMatrixColumn(Ue,0),X.crossVectors(i.object.up,X)),X.multiplyScalar(Oe),v.add(X)}})(),N=(()=>{const X=new O;return function(Oe,Ue){const Me=i.domElement;if(Me&&i.object instanceof pn&&i.object.isPerspectiveCamera){const W=i.object.position;X.copy(W).sub(i.target);let Re=X.length();Re*=Math.tan(i.object.fov/2*Math.PI/180),te(2*Oe*Re/Me.clientHeight,i.object.matrix),ae(2*Ue*Re/Me.clientHeight,i.object.matrix)}else Me&&i.object instanceof Ss&&i.object.isOrthographicCamera?(te(Oe*(i.object.right-i.object.left)/i.object.zoom/Me.clientWidth,i.object.matrix),ae(Ue*(i.object.top-i.object.bottom)/i.object.zoom/Me.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function B(X){i.object instanceof pn&&i.object.isPerspectiveCamera||i.object instanceof Ss&&i.object.isOrthographicCamera?p/=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function H(X){i.object instanceof pn&&i.object.isPerspectiveCamera||i.object instanceof Ss&&i.object.isOrthographicCamera?p*=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function Y(X){if(!i.zoomToCursor||!i.domElement)return;b=!0;const ge=i.domElement.getBoundingClientRect(),Oe=X.clientX-ge.left,Ue=X.clientY-ge.top,Me=ge.width,W=ge.height;D.x=Oe/Me*2-1,D.y=-(Ue/W)*2+1,L.set(D.x,D.y,1).unproject(i.object).sub(i.object.position).normalize()}function J(X){return Math.max(i.minDistance,Math.min(i.maxDistance,X))}function Z(X){y.set(X.clientX,X.clientY)}function ie(X){Y(X),T.set(X.clientX,X.clientY)}function pe(X){g.set(X.clientX,X.clientY)}function Ee(X){w.set(X.clientX,X.clientY),S.subVectors(w,y).multiplyScalar(i.rotateSpeed);const ge=i.domElement;ge&&(V(2*Math.PI*S.x/ge.clientHeight),Q(2*Math.PI*S.y/ge.clientHeight)),y.copy(w),i.update()}function Te(X){P.set(X.clientX,X.clientY),C.subVectors(P,T),C.y>0?B(oe()):C.y<0&&H(oe()),T.copy(P),i.update()}function nt(X){x.set(X.clientX,X.clientY),M.subVectors(x,g).multiplyScalar(i.panSpeed),N(M.x,M.y),g.copy(x),i.update()}function lt(X){Y(X),X.deltaY<0?H(oe()):X.deltaY>0&&B(oe()),i.update()}function Xe(X){let ge=!1;switch(X.code){case i.keys.UP:N(0,i.keyPanSpeed),ge=!0;break;case i.keys.BOTTOM:N(0,-i.keyPanSpeed),ge=!0;break;case i.keys.LEFT:N(i.keyPanSpeed,0),ge=!0;break;case i.keys.RIGHT:N(-i.keyPanSpeed,0),ge=!0;break}ge&&(X.preventDefault(),i.update())}function Ke(){if(R.length==1)y.set(R[0].pageX,R[0].pageY);else{const X=.5*(R[0].pageX+R[1].pageX),ge=.5*(R[0].pageY+R[1].pageY);y.set(X,ge)}}function G(){if(R.length==1)g.set(R[0].pageX,R[0].pageY);else{const X=.5*(R[0].pageX+R[1].pageX),ge=.5*(R[0].pageY+R[1].pageY);g.set(X,ge)}}function we(){const X=R[0].pageX-R[1].pageX,ge=R[0].pageY-R[1].pageY,Oe=Math.sqrt(X*X+ge*ge);T.set(0,Oe)}function me(){i.enableZoom&&we(),i.enablePan&&G()}function Ce(){i.enableZoom&&we(),i.enableRotate&&Ke()}function he(X){if(R.length==1)w.set(X.pageX,X.pageY);else{const Oe=He(X),Ue=.5*(X.pageX+Oe.x),Me=.5*(X.pageY+Oe.y);w.set(Ue,Me)}S.subVectors(w,y).multiplyScalar(i.rotateSpeed);const ge=i.domElement;ge&&(V(2*Math.PI*S.x/ge.clientHeight),Q(2*Math.PI*S.y/ge.clientHeight)),y.copy(w)}function Ze(X){if(R.length==1)x.set(X.pageX,X.pageY);else{const ge=He(X),Oe=.5*(X.pageX+ge.x),Ue=.5*(X.pageY+ge.y);x.set(Oe,Ue)}M.subVectors(x,g).multiplyScalar(i.panSpeed),N(M.x,M.y),g.copy(x)}function Ne(X){const ge=He(X),Oe=X.pageX-ge.x,Ue=X.pageY-ge.y,Me=Math.sqrt(Oe*Oe+Ue*Ue);P.set(0,Me),C.set(0,Math.pow(P.y/T.y,i.zoomSpeed)),B(C.y),T.copy(P)}function U(X){i.enableZoom&&Ne(X),i.enablePan&&Ze(X)}function I(X){i.enableZoom&&Ne(X),i.enableRotate&&he(X)}function ee(X){var ge,Oe;i.enabled!==!1&&(R.length===0&&((ge=i.domElement)==null||ge.ownerDocument.addEventListener("pointermove",xe),(Oe=i.domElement)==null||Oe.ownerDocument.addEventListener("pointerup",_e)),yt(X),X.pointerType==="touch"?dt(X):je(X))}function xe(X){i.enabled!==!1&&(X.pointerType==="touch"?Se(X):Le(X))}function _e(X){var ge,Oe,Ue;ct(X),R.length===0&&((ge=i.domElement)==null||ge.releasePointerCapture(X.pointerId),(Oe=i.domElement)==null||Oe.ownerDocument.removeEventListener("pointermove",xe),(Ue=i.domElement)==null||Ue.ownerDocument.removeEventListener("pointerup",_e)),i.dispatchEvent(o),u=a.NONE}function ye(X){ct(X)}function je(X){let ge;switch(X.button){case 0:ge=i.mouseButtons.LEFT;break;case 1:ge=i.mouseButtons.MIDDLE;break;case 2:ge=i.mouseButtons.RIGHT;break;default:ge=-1}switch(ge){case Zo.DOLLY:if(i.enableZoom===!1)return;ie(X),u=a.DOLLY;break;case Zo.ROTATE:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enablePan===!1)return;pe(X),u=a.PAN}else{if(i.enableRotate===!1)return;Z(X),u=a.ROTATE}break;case Zo.PAN:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enableRotate===!1)return;Z(X),u=a.ROTATE}else{if(i.enablePan===!1)return;pe(X),u=a.PAN}break;default:u=a.NONE}u!==a.NONE&&i.dispatchEvent(s)}function Le(X){if(i.enabled!==!1)switch(u){case a.ROTATE:if(i.enableRotate===!1)return;Ee(X);break;case a.DOLLY:if(i.enableZoom===!1)return;Te(X);break;case a.PAN:if(i.enablePan===!1)return;nt(X);break}}function Fe(X){i.enabled===!1||i.enableZoom===!1||u!==a.NONE&&u!==a.ROTATE||(X.preventDefault(),i.dispatchEvent(s),lt(X),i.dispatchEvent(o))}function tt(X){i.enabled===!1||i.enablePan===!1||Xe(X)}function dt(X){switch(et(X),R.length){case 1:switch(i.touches.ONE){case Ko.ROTATE:if(i.enableRotate===!1)return;Ke(),u=a.TOUCH_ROTATE;break;case Ko.PAN:if(i.enablePan===!1)return;G(),u=a.TOUCH_PAN;break;default:u=a.NONE}break;case 2:switch(i.touches.TWO){case Ko.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;me(),u=a.TOUCH_DOLLY_PAN;break;case Ko.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Ce(),u=a.TOUCH_DOLLY_ROTATE;break;default:u=a.NONE}break;default:u=a.NONE}u!==a.NONE&&i.dispatchEvent(s)}function Se(X){switch(et(X),u){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;he(X),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;Ze(X),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;U(X),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;I(X),i.update();break;default:u=a.NONE}}function Ct(X){i.enabled!==!1&&X.preventDefault()}function yt(X){R.push(X)}function ct(X){delete k[X.pointerId];for(let ge=0;gep.size),r=Vi(p=>p.viewport),s=typeof n=="number"?n:i.width*r.dpr,o=typeof e=="number"?e:i.height*r.dpr,a=(typeof n=="number"?t:n)||{},{samples:u=0,depth:f,...h}=a,d=ve.useMemo(()=>{const p=new gr(s,o,{minFilter:sn,magFilter:sn,type:xa,...h});return f&&(p.depthTexture=new im(s,o,hr)),p.samples=u,p},[]);return ve.useLayoutEffect(()=>{d.setSize(s,o),u&&(d.samples=u)},[u,d,s,o]),ve.useEffect(()=>()=>d.dispose(),[]),d}const Y7=n=>typeof n=="function",q7=ve.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:i,children:r,...s},o)=>{const a=Vi(({set:S})=>S),u=Vi(({camera:S})=>S),f=Vi(({size:S})=>S),h=ve.useRef(null),d=ve.useRef(null),p=j7(e);ve.useLayoutEffect(()=>{s.manual||(h.current.aspect=f.width/f.height)},[f,s]),ve.useLayoutEffect(()=>{h.current.updateProjectionMatrix()});let v=0,y=null;const w=Y7(r);return A_(S=>{w&&(t===1/0||v{if(i){const S=u;return a(()=>({camera:h.current})),()=>a(()=>({camera:S}))}},[h,i,a]),ve.createElement(ve.Fragment,null,ve.createElement("perspectiveCamera",nc({ref:H7([h,o])},s),!w&&r),ve.createElement("group",{ref:d},w&&r(p.texture)))}),Z7=ve.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:u,...f},h)=>{const d=Vi(C=>C.invalidate),p=Vi(C=>C.camera),v=Vi(C=>C.gl),y=Vi(C=>C.events),w=Vi(C=>C.setEvents),S=Vi(C=>C.set),g=Vi(C=>C.get),x=Vi(C=>C.performance),M=e||p,T=i||y.connected||v.domElement,P=ve.useMemo(()=>new X7(M),[M]);return A_(()=>{P.enabled&&P.update()},-1),ve.useEffect(()=>(s&&P.connect(s===!0?T:s),P.connect(T),()=>void P.dispose()),[s,T,t,P,d]),ve.useEffect(()=>{const C=b=>{d(),t&&x.regress(),o&&o(b)},L=b=>{a&&a(b)},D=b=>{u&&u(b)};return P.addEventListener("change",C),P.addEventListener("start",L),P.addEventListener("end",D),()=>{P.removeEventListener("start",L),P.removeEventListener("end",D),P.removeEventListener("change",C)}},[o,a,u,P,d,w]),ve.useEffect(()=>{if(n){const C=g().controls;return S({controls:P}),()=>S({controls:C})}},[n,P]),ve.createElement("primitive",nc({ref:h,object:P,enableDamping:r},f))}),ii=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let uM=1234567;const aA=Math.PI/180,lA=180/Math.PI;function K7(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(ii[n&255]+ii[n>>8&255]+ii[n>>16&255]+ii[n>>24&255]+"-"+ii[e&255]+ii[e>>8&255]+"-"+ii[e>>16&15|64]+ii[e>>24&255]+"-"+ii[t&63|128]+ii[t>>8&255]+"-"+ii[t>>16&255]+ii[t>>24&255]+ii[i&255]+ii[i>>8&255]+ii[i>>16&255]+ii[i>>24&255]).toLowerCase()}function J7(n,e,t){return Math.max(e,Math.min(t,n))}function cA(n,e){return(n%e+e)%e}function Q7(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function $7(n,e,t){return n!==e?(t-n)/(e-n):0}function uA(n,e,t){return(1-t)*n+t*e}function eU(n,e,t,i){return uA(n,e,1-Math.exp(-t*i))}function tU(n,e=1){return e-Math.abs(cA(n,e*2)-e)}function nU(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function iU(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function rU(n,e){return n+Math.floor(Math.random()*(e-n+1))}function sU(n,e){return n+Math.random()*(e-n)}function oU(n){return n*(.5-Math.random())}function aU(n){n!==void 0&&(uM=n);let e=uM+=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 lU(n){return n*aA}function cU(n){return n*lA}function uU(n){return(n&n-1)===0&&n!==0}function fU(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function hU(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function dU(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),u=o(t/2),f=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),v=s((i-e)/2),y=o((i-e)/2);switch(r){case"XYX":n.set(a*h,u*d,u*p,a*f);break;case"YZY":n.set(u*p,a*h,u*d,a*f);break;case"ZXZ":n.set(u*d,u*p,a*h,a*f);break;case"XZX":n.set(a*h,u*y,u*v,a*f);break;case"YXY":n.set(u*v,a*h,u*y,a*f);break;case"ZYZ":n.set(u*y,u*v,a*h,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function pU(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function mU(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const gU={DEG2RAD:aA,RAD2DEG:lA,generateUUID:K7,clamp:J7,euclideanModulo:cA,mapLinear:Q7,inverseLerp:$7,lerp:uA,damp:eU,pingpong:tU,smoothstep:nU,smootherstep:iU,randInt:rU,randFloat:sU,randFloatSpread:oU,seededRandom:aU,degToRad:lU,radToDeg:cU,isPowerOfTwo:uU,ceilPowerOfTwo:fU,floorPowerOfTwo:hU,setQuaternionFromProperEuler:dU,normalize:mU,denormalize:pU};function vU(){const n=Array(3).fill().map(()=>gU.randFloatSpread(200));return fe.jsxs("mesh",{position:n,children:[fe.jsx("sphereGeometry",{args:[.25,24,24]}),fe.jsx("meshBasicMaterial",{color:"#ffffff"})]})}function yU(){return fe.jsxs(O7,{children:[fe.jsx(q7,{makeDefault:!0,fov:50,position:[0,0,10]}),fe.jsx("color",{args:[0,0,0],attach:"background"}),fe.jsx("ambientLight",{intensity:.5}),fe.jsx("pointLight",{position:[-5,1.5,5],angle:.5,intensity:200}),fe.jsx(B7,{}),fe.jsx(Z7,{enableZoom:!1,enableDamping:!0,autoRotate:!0,autoRotateSpeed:.4}),Array(200).fill().map((n,e)=>fe.jsx(vU,{},e))]})}const _U="/my-portfolio/assets/SitePhoto-ttmvt0EA.jpg";function xU(){return fe.jsx("div",{className:"bg-blue-950",children:fe.jsxs("div",{className:"p-8 flex flex-col md:flex-row justify-around container mx-auto",children:[fe.jsxs("div",{className:"flex-1 justify-center",children:[fe.jsxs("h2",{className:"text-3xl font-bold mb-4 text-center my-2 flex justify-start text-white",children:["Hi there",fe.jsxs("picture",{className:"mx-2",children:[fe.jsx("source",{srcSet:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f44b/512.webp",type:"image/webp"}),fe.jsx("img",{src:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f44b/512.gif",alt:"👋",width:"32",height:"32"})]})]}),fe.jsx("p",{className:"text-gray-200 mx-auto",children:"Hi there! I'm Abhinav Choudhary, a passionate developer who loves creating awesome web applications. I have experience with front-end technologies like React and enjoy exploring new technologies to enhance my skills."}),fe.jsx("p",{className:"text-gray-200 mt-2",children:"In my free time, I enjoy solving coding challenges, making games, and staying up-to-date with the latest trends in the tech world."})]}),fe.jsx("div",{className:"flex-1 flex justify-center items-center",children:fe.jsx("img",{src:_U,alt:"Avatar",className:"rounded-full object-cover w-full md:w-64 h-auto my-2 md:mb-0 shadow-md shadow-white/70 hover:shadow-white hover:shadow-lg"})})]})})}function SU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M243.583 91.6027L323.695 138.384C326.575 140.026 326.68 144.583 323.695 146.225L228.503 201.854C225.623 203.55 222.22 203.444 219.549 201.854L124.357 146.225C121.425 144.636 121.373 139.973 124.357 138.384L204.417 91.6027V0L0 119.417V358.252L78.3843 312.477V218.914C78.3319 215.576 82.2066 213.192 85.0865 214.993L180.279 270.622C183.159 272.318 184.782 275.338 184.782 278.464V389.669C184.834 393.007 180.959 395.391 178.079 393.589L97.9673 346.808L19.583 392.583L224 512L428.417 392.583L350.033 346.808L269.921 393.589C267.093 395.338 263.114 393.06 263.218 389.669V278.464C263.218 275.126 265.051 272.159 267.721 270.622L362.914 214.993C365.741 213.245 369.72 215.47 369.616 218.914V312.477L448 358.252V119.417L243.583 0V91.6027Z"},child:[]}]})(n)}function MU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 32v448h448V32zm240 348c0 43.61-25.76 64.87-63.05 64.87-33.68 0-53.23-17.44-63.15-38.49l34.28-20.75c6.61 11.73 11.63 21.65 26.06 21.65 12 0 21.86-5.41 21.86-26.46V240h44zm99.35 63.87c-39.09 0-64.35-17.64-76.68-42L329 382c9 14.74 20.75 24.56 41.5 24.56 17.44 0 27.57-7.72 27.57-19.75 0-14.43-10.43-19.54-29.68-28l-10.52-4.52c-30.38-12.92-50.52-29.16-50.52-63.45 0-31.57 24.05-54.63 61.64-54.63 26.77 0 46 8.32 59.85 32.68L396 290c-7.22-12.93-15-18-27.06-18-12.33 0-20.15 7.82-20.15 18 0 12.63 7.82 17.74 25.86 25.56l10.52 4.51c35.79 15.34 55.94 31 55.94 66.16.01 37.9-29.76 57.64-69.76 57.64z"},child:[]}]})(n)}function wU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.281 11.156a.84.84 0 0 1 .375.297c.084.125.143.276.18.453.02.104.044.2.07.29a1.772 1.772 0 0 0 .219.476c.047.073.11.153.188.242.067.073.127.167.18.281a.793.793 0 0 1 .077.328.49.49 0 0 1-.093.305.944.944 0 0 1-.235.219c-.12.083-.245.156-.375.219-.13.062-.26.127-.39.195a3.624 3.624 0 0 0-.555.328c-.156.115-.313.26-.469.438a2.815 2.815 0 0 1-.625.523 1.471 1.471 0 0 1-.383.172c-.13.036-.26.06-.39.07-.302 0-.552-.052-.75-.156-.198-.104-.37-.294-.516-.57-.042-.079-.083-.128-.125-.149a.774.774 0 0 0-.203-.055L8.67 15c-.26-.02-.525-.031-.796-.031a4.28 4.28 0 0 0-.672.054c-.229.037-.456.081-.68.133-.046.01-.093.05-.14.117a1.7 1.7 0 0 1-.196.227 1.106 1.106 0 0 1-.335.219 1.475 1.475 0 0 1-.555.101c-.172 0-.357-.018-.555-.054a1.82 1.82 0 0 1-.531-.18 3.578 3.578 0 0 0-.953-.328c-.313-.057-.643-.11-.992-.156a3.392 3.392 0 0 1-.344-.063.774.774 0 0 1-.29-.133.705.705 0 0 1-.194-.219.78.78 0 0 1-.079-.351c0-.162.021-.318.063-.469.042-.15.065-.31.07-.476 0-.115-.008-.227-.023-.336a3.53 3.53 0 0 1-.032-.352c0-.265.063-.46.188-.586.125-.125.307-.224.547-.297a.99.99 0 0 0 .297-.148 2.27 2.27 0 0 0 .234-.203 1.86 1.86 0 0 0 .203-.242c.063-.089.133-.178.211-.266a.114.114 0 0 0 .024-.07c0-.063-.003-.123-.008-.18l-.016-.188c0-.354.055-.71.164-1.07.11-.36.253-.71.43-1.055a9.08 9.08 0 0 1 .594-.992c.218-.317.435-.612.648-.883a4.35 4.35 0 0 0 .68-1.203c.15-.416.229-.87.234-1.36 0-.207-.01-.413-.031-.616a6.122 6.122 0 0 1-.031-.625c0-.417.047-.792.14-1.125.094-.334.24-.62.438-.86s.456-.419.773-.539C7.474.075 7.854.01 8.296 0c.527 0 .946.104 1.259.313.312.208.552.481.718.82.167.338.274.716.32 1.133.048.416.074.838.079 1.265v.133c0 .214.002.404.008.57a2.527 2.527 0 0 0 .226.977c.073.161.182.336.328.523.25.329.506.66.766.993.26.333.497.677.71 1.03.214.355.389.725.524 1.11.136.386.206.802.211 1.25a3.3 3.3 0 0 1-.164 1.04zm-6.554-8.14c.072 0 .132.018.18.054a.357.357 0 0 1 .109.149.85.85 0 0 1 .054.187c.01.063.016.128.016.196a.282.282 0 0 1-.024.125.27.27 0 0 1-.07.086l-.094.078a.796.796 0 0 0-.093.093.428.428 0 0 1-.149.141 2.129 2.129 0 0 0-.18.117 1.31 1.31 0 0 0-.156.133.264.264 0 0 0-.07.195c0 .047.023.086.07.117a.704.704 0 0 1 .266.305c.052.12.11.237.172.352.062.114.143.21.242.289.099.078.253.117.46.117h.048c.208-.01.406-.065.594-.164.187-.099.375-.203.562-.313a.633.633 0 0 1 .102-.046.37.37 0 0 0 .101-.055l.57-.445a.926.926 0 0 0 .024-.102 2.75 2.75 0 0 0 .016-.11.236.236 0 0 0-.04-.14.4.4 0 0 0-.093-.094.34.34 0 0 0-.133-.054.909.909 0 0 1-.14-.04 1.083 1.083 0 0 1-.352-.14 1.457 1.457 0 0 0-.344-.156c-.02-.006-.036-.021-.047-.047a.983.983 0 0 1-.031-.094.23.23 0 0 1-.008-.102.126.126 0 0 0-.008-.078c0-.062.005-.127.016-.195a.551.551 0 0 1 .07-.195.417.417 0 0 1 .125-.14.411.411 0 0 1 .203-.056c.162 0 .279.06.352.18.073.12.112.25.117.39a.397.397 0 0 1-.039.18.379.379 0 0 0-.04.172c0 .042.014.07.04.086a.26.26 0 0 0 .102.031c.12 0 .197-.028.234-.085a.533.533 0 0 0 .062-.258c0-.12-.01-.253-.03-.399a1.32 1.32 0 0 0-.126-.406.969.969 0 0 0-.242-.313.574.574 0 0 0-.383-.124c-.27 0-.466.067-.586.203-.12.135-.182.338-.187.609 0 .078.005.156.015.234.01.079.016.157.016.235 0 .026-.003.039-.008.039a.218.218 0 0 1-.047-.016 4.263 4.263 0 0 1-.093-.039.774.774 0 0 0-.118-.039.514.514 0 0 0-.203-.008 1.007 1.007 0 0 1-.125.008c-.073 0-.11-.013-.11-.039 0-.078-.004-.177-.015-.297-.01-.12-.036-.24-.078-.36a.995.995 0 0 0-.156-.296c-.063-.078-.156-.12-.281-.125a.323.323 0 0 0-.227.086.905.905 0 0 0-.164.203.64.64 0 0 0-.086.266 5.4 5.4 0 0 1-.031.25 1.459 1.459 0 0 0 .07.406c.026.083.055.156.086.219.031.062.068.093.11.093.025 0 .06-.018.101-.054.042-.037.063-.07.063-.102 0-.016-.008-.026-.024-.031a.147.147 0 0 0-.047-.008c-.036 0-.068-.018-.094-.055a.468.468 0 0 1-.062-.125 5.144 5.144 0 0 1-.047-.148.564.564 0 0 1 .055-.398c.047-.084.133-.128.258-.133zM5.023 15.18c.125 0 .248-.01.368-.032a.97.97 0 0 0 .336-.125.614.614 0 0 0 .234-.242.943.943 0 0 0 .094-.375.816.816 0 0 0-.047-.273.963.963 0 0 0-.133-.25 2.763 2.763 0 0 0-.203-.281 2.763 2.763 0 0 1-.203-.282 62.93 62.93 0 0 1-.29-.43c-.093-.14-.187-.288-.28-.445a8.124 8.124 0 0 1-.235-.406 2.646 2.646 0 0 0-.266-.398 1.203 1.203 0 0 0-.218-.211.469.469 0 0 0-.29-.094.436.436 0 0 0-.296.11 2.26 2.26 0 0 0-.258.265 3.241 3.241 0 0 1-.297.305c-.11.099-.25.177-.422.234a.744.744 0 0 0-.312.172c-.073.073-.11.185-.11.336 0 .104.008.208.024.312.015.104.026.209.031.313 0 .14-.02.273-.063.398a1.157 1.157 0 0 0-.062.367c0 .141.05.24.148.297.1.058.211.097.336.117.157.027.305.047.446.063.14.016.278.04.414.07.135.032.27.065.406.102.135.036.279.094.43.172.03.015.078.034.14.054l.211.07c.078.027.151.048.219.063a.741.741 0 0 0 .148.024zm2.86-.938c.146 0 .302-.015.469-.047a3.54 3.54 0 0 0 .976-.336 2.59 2.59 0 0 0 .406-.257.222.222 0 0 0 .032-.047.305.305 0 0 0 .023-.063v-.008c.031-.114.057-.24.078-.375a8.63 8.63 0 0 0 .055-.414 8.98 8.98 0 0 1 .055-.414c.02-.135.039-.268.054-.398.021-.14.047-.276.078-.406.032-.13.073-.253.125-.368a1.03 1.03 0 0 1 .211-.304 1.54 1.54 0 0 1 .344-.25v-.016l-.008-.023a.29.29 0 0 1 .047-.149 1.4 1.4 0 0 1 .117-.164.582.582 0 0 1 .149-.133.946.946 0 0 1 .164-.078 9.837 9.837 0 0 0-.102-.375 4.938 4.938 0 0 1-.094-.375 7.126 7.126 0 0 0-.093-.476 2.954 2.954 0 0 0-.11-.36 1.317 1.317 0 0 0-.18-.32c-.077-.104-.174-.23-.288-.375a1.189 1.189 0 0 1-.118-.156.555.555 0 0 1-.046-.196 2.206 2.206 0 0 0-.047-.203 9.48 9.48 0 0 0-.242-.75 2.91 2.91 0 0 0-.172-.383 3.87 3.87 0 0 0-.172-.289c-.052-.078-.107-.117-.164-.117-.125 0-.274.05-.446.149-.171.099-.354.208-.546.328-.193.12-.38.232-.563.336-.182.104-.346.153-.492.148a.7.7 0 0 1-.43-.148 2.236 2.236 0 0 1-.36-.344c-.109-.13-.2-.242-.273-.336-.073-.094-.127-.146-.164-.156-.041 0-.065.031-.07.093a2.56 2.56 0 0 0-.008.211v.133c0 .032-.005.052-.016.063-.057.12-.12.237-.187.351-.068.115-.135.232-.203.352a1.611 1.611 0 0 0-.219.758c0 .078.005.156.016.234.01.078.036.154.078.227l-.016.03a1.31 1.31 0 0 1-.133.157 1.072 1.072 0 0 0-.132.164 2.796 2.796 0 0 0-.407.93c-.078.333-.12.672-.125 1.015 0 .089.006.178.016.266.01.089.016.177.016.266a.526.526 0 0 1-.008.086.525.525 0 0 0-.008.086.75.75 0 0 1 .313.109c.12.068.25.154.39.258.14.104.274.224.399.36.125.135.244.267.359.398.115.13.198.26.25.39.052.13.086.237.101.32a.444.444 0 0 1-.125.329.955.955 0 0 1-.312.203c.089.156.198.289.328.398.13.11.271.198.422.266.151.068.315.117.492.148.177.032.35.047.516.047zm3.133 1.11c.109 0 .216-.016.32-.047a1.65 1.65 0 0 0 .445-.203c.136-.089.26-.198.375-.329a3.07 3.07 0 0 1 .977-.75l.258-.117a2.18 2.18 0 0 0 .257-.133.962.962 0 0 0 .165-.132.256.256 0 0 0 .078-.188.295.295 0 0 0-.024-.117.58.58 0 0 0-.07-.117 5.136 5.136 0 0 1-.203-.305 1.978 1.978 0 0 1-.149-.297l-.125-.312a2.558 2.558 0 0 1-.11-.352.28.28 0 0 0-.054-.101.53.53 0 0 0-.46-.235.533.533 0 0 0-.266.07l-.266.149a7.335 7.335 0 0 1-.281.148.656.656 0 0 1-.297.07.411.411 0 0 1-.258-.077.636.636 0 0 1-.172-.211 2.218 2.218 0 0 1-.117-.258l-.094-.258a1.26 1.26 0 0 1-.14.188.666.666 0 0 0-.125.203c-.068.156-.11.33-.125.523-.026.302-.06.596-.102.883a4.7 4.7 0 0 1-.21.86 1.914 1.914 0 0 0-.063.273 2.88 2.88 0 0 0-.032.289c0 .255.079.466.235.633.156.166.367.25.633.25z"},child:[]}]})(n)}function EU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M10 9a3 3 0 0 0 -3 -3h-.5a3.5 3.5 0 0 0 -3.5 3.5v5a3.5 3.5 0 0 0 3.5 3.5h.5a3 3 0 0 0 3 -3"},child:[]},{tag:"path",attr:{d:"M16 7l-1 10"},child:[]},{tag:"path",attr:{d:"M20 7l-1 10"},child:[]},{tag:"path",attr:{d:"M14 10h7.5"},child:[]},{tag:"path",attr:{d:"M21 14h-7.5"},child:[]}]})(n)}function TU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M18 12h4"},child:[]},{tag:"path",attr:{d:"M20 10v4"},child:[]},{tag:"path",attr:{d:"M11 12h4"},child:[]},{tag:"path",attr:{d:"M13 10v4"},child:[]},{tag:"path",attr:{d:"M9 9a3 3 0 0 0 -3 -3h-.5a3.5 3.5 0 0 0 -3.5 3.5v5a3.5 3.5 0 0 0 3.5 3.5h.5a3 3 0 0 0 3 -3"},child:[]}]})(n)}function AU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.344 8.71c-.707 0-1.279.572-1.279 1.278v4.53a1.278 1.278 0 1 0 2.558 0v-4.53c0-.706-.572-1.278-1.279-1.278zm-12.688 0c-.707 0-1.279.572-1.279 1.278v4.53a1.278 1.278 0 1 0 2.558 0v-4.53A1.277 1.277 0 0 0 5.656 8.71zm8.889-3.809.768-1.388a.343.343 0 0 0-.133-.47.344.344 0 0 0-.471.135l-.789 1.42c-.588-.235-1.236-.368-1.92-.368s-1.332.132-1.92.367l-.789-1.418a.344.344 0 0 0-.471-.135.345.345 0 0 0-.133.47l.768 1.388C8.072 5.69 7.148 7.099 7.148 8.71c0 .011 0 .021.002.034-.002.006-.002.013-.002.019v.001h9.703V8.71c.001-1.611-.923-3.019-2.306-3.809zM9.76 6.869a.346.346 0 1 1 .005-.693.346.346 0 0 1-.005.693zm4.48 0a.347.347 0 0 1 0-.692.346.346 0 0 1 0 .692zM7.148 16.12c0 .646.525 1.171 1.174 1.171h.586v2.401a1.279 1.279 0 0 0 2.558 0v-2.401h1.066v2.401c0 .707.572 1.278 1.277 1.278.709 0 1.281-.571 1.281-1.278v-2.401h.586c.648 0 1.174-.524 1.174-1.171V9.028H7.148v7.092z"},child:[]}]})(n)}function CU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.78 18.29c0 .12.15 0 0 0zm-3.35-2.7c.39.17-.31-.6 0 0zm-5.03.28c.15.26 0-.12 0 0zm5.6.39c-.27-.42-.2.06 0 .32.48.47.18-.26 0-.32z"},child:[]},{tag:"path",attr:{d:"M20.24 19.06c-.53.63-1-.07-1.63.13-1.1 0 .09-.5.06-1-.58-.45-1.24.61-1.62.9a10.75 10.75 0 0 1-2.67-.83 8 8 0 0 1-2.6-1.94 8.36 8.36 0 0 1-1.87-2.84 21.36 21.36 0 0 1-.84-5.74c.07-1.3 1.44.14 2-.33-.21-.67-1.29-.88-1.89-1.16-.58 0-.79-.55-1.4-.59 0-.73-1.13-.33-1.56-.84.42-1.08-1.37 0-1.23-.91.58-1.2-1.78-1-.8.06.95.54-.93.93-.38 1.29a.59.59 0 0 1-.53.86c-.74.07-.67 1.09.06.55.81-.25.14.11-.25.18a1.3 1.3 0 0 0-.95 1.9 35.32 35.32 0 0 1 1 3.42A16.25 16.25 0 0 0 5.84 17 9.78 9.78 0 0 0 8 19a9.89 9.89 0 0 0 2.43 1.22 18 18 0 0 0 4.73.73 16.53 16.53 0 0 0 2.9-.24c.87.09 1.49-.65 2.26-.26.48-.42 1.16-.23 1.63-.54.32-1.22-1.22-.27-1.71-.85zm-1.74-.74c-.22 0 .05-.34 0 0zm-7.63-11c-.1 0-.08-.12-.16-.15-.8-.37.39-.23.16.19zm6.76 11.39c-.35-.08.28-.25 0 0zm-2.81.11c-.23 0 .18-.14 0 0zm-1.88-1.18c-.13 0 0-.13 0 0zm-.22-.17c-.36 0-.09-.23 0 0zm-.42-.36c-.33.08 0-.34 0 0zm-6-11.66c-.53-.28.11.33-.34.32-.24 0-.69-.52-.54-.78.3.16.83.21.92.5zm-.92-.81h-.11c-.03-.27.87-.06.15.04zm-1.02-.79c-.42-.19 0-.93.44-.58.51.73-.95-.08-.44.58zm.49.69c-.27.11.16-.21 0 0zm.48.92c.6.46-.34 0-.72.29-.61.06.66-.34.72-.29zm.17.6c.35 0 1.88-.69 1.37-.07.47.55.1.37-.21 0 .28.19.06 1-.37.45s-.5-.18-.17.21C5.8 6 4.88 6.28 4.21 6.5c-.43-.04 1.13-.37 1.29-.44zM3.58 7.51c-.16.4.24.53.62.6.62-.17-.41-.28.06-.44.26 0-.82-.26.08-.38S6.09 6.77 7 6.58a8.71 8.71 0 0 1 2.35-.19c.3.35-.23.94-.77 1a8.61 8.61 0 0 1-2 .39c-.8-.1-1.37.61-2.19.7.22-.4-.18-.14-.59-.16.21.82-1.47-.21-.48-.41-.74-.26-.75.52-.67 1-.65-.91.07-1.29.93-1.4zm1.88 1.08c-.22-.05.17-.2 0 0zm-.72.88s-.34-.08-.2-.17c1 .13-.9-.33.13-.22.66-.02.44.36.07.39zm.33.17c-.12.12 0-.24 0 0zm-.71 0c-.44-.09.21-.22 0 0zm-.06 1.43c-.07.1-.1-.08 0 0zM4 10.9c-.55-.19 0-.21 0 0zm-.12 1.28c-.26-.09-.25-.5-.37-.72-.38-1.03.41.4.33.72zm.23-1.49c-.69-.08-.05-.49 0 0zm0-.34h-.09c-.76-.35.45-.17-.02 0zM4 9.56c-.61-.31.58-.36 0 0zm.21.26c-.34.06.05-.32 0 0zm-1.3.07c-.12.08 0-.23 0 0zM3 9.75c-.16 0 0-.27 0 0zm.08-1c-.4-.1.33-.25 0 0zm.26 2c-.44-.1-.12-.65 0 0zm.3 1.25c.42.51.26.79.69 1.41-.56-.35-.67-1.2-1-1.75-.41-.9.23-.01.31.34zm4.09 6.38c-.34-.07-.57-.43-.81-.66a4.88 4.88 0 0 1-1.57-1.94 12.26 12.26 0 0 1-1.46-2.38c-.41-.92.25.07.35.42.21.68.88 1.07.94 1.52.74.42.36 1.12 1 1.31.27-.14.3.84.89.64-.33.15.13.33.3.61.35-.05 1.17.82.36.52zM4.62 12c-.31-.07.33-.11 0 0zm.2.47c-.55-.14.52-.2 0 0zm1.39.47c.4-.17.16.78.55.9.76 1-.53 0-1-.07.06 0-.38-.12-.19-.16-.14-.15-.45-.66.26-.32.6.24.65.06.38-.39zm1.31 1.76c0 .15-.72.13-.06.42-.38 0-.5 0 0 .3-.22.17.43.31.21.57.66.52-.12.13-.4-.08s-.85-.35-.75-.5c.81.42.21 0-.15-.3.65.16-.51-.48.1-.31.19.05-.27-.38.33-.07-.54-.52.47-.12.72-.07zm.48-.17c-.61-.14 0-.34 0 0zm-.17 2c-.61-.26.39 0 0 0zm-.45-.17c-.71-.23.52 0 0 0zm-.09.11c-.22 0 0-.17 0 0zm-1.08-1.55c-.72-.3-.2-.33 0 0zm-.54-.35c-.58-.33-.08-.33 0 0zm0 .65c-.57-.44-.07-.25 0 0zm-.15-1.34c-.35 0 .13-.2 0 0zM8 17.38c-.51-.15 0-.14 0 0zM7.63 17h-.16c-.68-.54.31-.38.75-.14.97.14-.22.39-.59.14zm2.7 1.65c-.68-.16.16-.27 0 0zm-.17-.52c-.05 0-.1-.11 0 0zm-.86-1.34c-.59-.14.21-.19.36 0 1.02.21-.06.26-.36 0zM9.51 18H9.4l-.13-.06c-.56-.59 1.19.28.24.06zm-.28.69c-.15.06 0-.14 0 0zm.29-1.19-.16-.05c-.66-.45.84.09.16 0zm.16 1.72c-.4-.16.26-.25 0 0zm.1-.74c-.58-.14.36-.13 0 0zm.13-.61c-.44-.06.05-.21 0 0zm-.72-.88c.46.06.47.27 0 .14-.09 0-.24 0-.28-.17-.76-.5.03-.25.28-.02zm-.06 2c-.2.12 0-.22 0 0zm-.31-.51c-.53 0 .4-.26 0 0zm-.12.35c-.26-.1.17-.08 0 0zm.3-.89c-.52-.14.25-.18 0 0zm-.16-.57c-.28 0-.06-.16 0 0zm-.54-.95c-.57-.46 1.18.38 0 0zm-.06.19c0 .06-.11-.09 0 0zm3.65 3.78a9.4 9.4 0 0 1-2.56-.85l-.33-.2c-.57-.31-.5-.38.06-.07.19.16 1.59.73.93.35-.29-.07-1.9-.95-.84-.57a20.92 20.92 0 0 0 2.74 1.21 7.14 7.14 0 0 0 2.43.15c.65.33 1.33-.08 2 .21a13.05 13.05 0 0 1-4.45-.23zm-1.25-.7c-.51-.09.16-.23 0 0zm.73-1c-.58-.11.6-.23 0 0zm.84 1.31c1 .37-.6.12-.93-.09-.92-.38.72.09.93.09zm-1.06-1.1c-.81-.12.9 0 0 0zm1.52.85c-.29.23 0-.3 0 0zm.29.05c-.15.06 0-.17 0 0zm.27-.38c-.16.2 0-.23 0 0zm.31 0c-.45.17.47-.39 0 0zm.14 0c.49-.42.51-.22.5.13-.43.48-.17-.2-.44.06s-.19-.1-.06-.17zm.83.45c-.5 0 .51-.54 0 0zm0 .18c-.2.05 0-.13 0 0zm-.16-.35c-.39-.26.94-.61 0 0zm.57.09h-.08c-.03-.23.54-.27.08.02zm.15.19c-.3-.08.47-.4 0 0zm.36-.1c-.51.18.48-.4 0 0zm.22.11-.12.08c-.23-.14.71-.48.12-.07zm-.43-.53c-.54-.18-1.4-.76-2-.37-.8.51.41-.56-.24-.08-.66.79-.45-.5-1.09-.11 0-.12-.57-.16-.17-.37-.36 0-.13-.05 0-.34-.16 0-1 0-1.36-.29-.4-.52.07-.3.48-.23-.67.12.24.5.68.29-.2-.09-.43-.52-1-.9a18.83 18.83 0 0 0-2.13-1c-.84-.5.18-.18.47.08.84.37.51-.51 0-.74-.54 0-.67-.59-1.1-.56.67.11 1.14-.17.39-.85s.3.63-.11.44c-.19-.25-.05-.6-.65-.73 0 .23-.08.58-.21.1-.17 0-.36.21-.5-.28.13-.57-.56-.7-.67-1.06.6.38.87.08.45-.33s-.33-.11-.49 0c-.59.6-.06-1-.32-.56-.26 0-.11.29-.1.65-.86-.21.2.45.45.81-.39-.4-.32.31-.65 0-.11-.3-.12-.77-.67-.85.62-.22-.36-.65-.28-.67.35-.32.4-.76.82-.07-.53 0 0 .88.12.6 0-.47.22-1-.59-1.19-.24.32-.65-.63-.18-.43-.06-.63.74-.26.69-.53.42-.18-.5-.77 0-1 .38.24 1.36-.36.7-.44.42 0 .75.18.79-.24.33.07 1.24.36.42-.09a3.45 3.45 0 0 1 1.13-.25c.79-.61.63 1 .45 1.45.3-.21.24.94.14 1.37.16-.22.23.36 0 .77 0-.07.4-.13.12.35-.22-.47-.31 1-.17.32.37-.61.28 0 .39.24.08.55.32 1.06.4 1.56.35.35-.15.11-.15.59.11-.14.58.19.57.68 0-.78.09-.18.47 0a5.48 5.48 0 0 0 1 1.42c.37.43 0 .13.14.39a3.19 3.19 0 0 0 2.09 1.28 1.46 1.46 0 0 0 1.57.7c-.6.37 1.68.47.91.67-.23.16-.62-.2-1.01-.18zM8.7 15.89c-.24 0 0-.2 0 0zm.38.22c-.18 0-.12-.24 0 0zm-2.61-3.65c-.24-.07.1-.09 0 0zm-.59 0c-.26 0 0-.34 0 0zm-.3-.08c-.1.05 0-.11 0 0zm11 8.25c-.39-.07.32-.22 0 0zm.73-1.05h-.3c.06-.45 1.33-.1 1.85-.09-.16.34-1.13.04-1.55.13zm2 0c-.27 0 .12-.32 0 0zm1-.09c-.25.13 0-.3 0 0zm.48.11c-.52-.12.24-.12.4-.14.94.02 0 .16-.47.16z"},child:[]},{tag:"path",attr:{d:"M6.51 7.11c1-.2-.38-.33-.69 0 .18.13.41-.21.69 0zm-.82.13c0 .19.18-.22 0 0zm2.62-.48c.67-.11.11-.41-.09.1.07.14.11-.05.09-.1zm-.62.1c.93.36-.05-1 0 0zm-2.92.93a.51.51 0 0 1 .33.1c.75.52-.1-.84-.33-.1z"},child:[]},{tag:"path",attr:{d:"M4.81 7.43c.16.13.29-.21 0 0zm.37.01.14.12c.68.06-.11-.46-.14-.12zM10.69 16c.09.3 0-.39 0 0zm-4.78-5c.1.18.18-.18 0 0zm.09.61c.19.34 0-.51 0 0zm.21-.49c.33.21-.28-.52 0 0zm-.41-.82c.07.15.24.16.37.2 1.32.61-.95-1-.37-.2zm.54 1.43c.31.53.18-.37 0 0zm.48-.16c.37.92-.23-.12-.3-.43a2.11 2.11 0 0 0 .28 1c.34.51.19-.28.55.23-.2-.45.1-.2.06-.4s-1-1.17-.59-.4zm.36 1.78c.09.31.18 0 0 0zM5.85 9c.06.14.11 0 0 0zm.67.42c.32.41.17-.36 0 0zm-.89 1.14.14.15c.99.29-1.05-.95-.14-.15zm.7-.37c1 .41-.09-.27-.44-.2.11.13.32.07.44.2zm-.18-.44c.18.18.82.51.31.06.32-.06 0-.16-.24-.32-.44-.67.07.06-.07.26z"},child:[]},{tag:"path",attr:{d:"M5.51 10.64c-.53-.44.16.21-.06.2-.55-.4-.32-.11 0 .2.33.5.6-.3.06-.4zm2.14.64c.12.11-.06-.68 0 0zm1.02-3.5c0 .12.07-.1 0 0zM9 12.47c0 .21 0-.18 0 0zm-.29-1.22c.08.46.1-.78 0 0zm.14.22v.1c.21-.51.04-.79 0-.1zm-.1-2.7c-.14.7-.27.41-.08-.11-.05-.67-.45.41-.27.72.29.47.6-1.16.35-.61zm1.01 5.98c.13.35.11-.42 0 0zm-1.35-4.28c0 .2 0-.14 0 0zm.64 1.7c0 .26.11-.38 0 0zM9.5 14l.07.11c.14-.49-.36-.79-.07-.11zm-1.56-.52c.27.22-.13-.23 0 0zm1.23-.85c.08.29 0-.42 0 0zM8.14 9.81c.15.33-.05-.27 0 0z"},child:[]},{tag:"path",attr:{d:"M8.3 10.23c.24.34-.26-.64 0 0zm-.06 1.15c-.13-1-.42.45 0 .69.13.34.25.2.3-.19-.32 0 .08-.62-.3-.5z"},child:[]}]})(n)}function bU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m21.62 11.108-8.731-8.729a1.292 1.292 0 0 0-1.823 0L9.257 4.19l2.299 2.3a1.532 1.532 0 0 1 1.939 1.95l2.214 2.217a1.53 1.53 0 0 1 1.583 2.531c-.599.6-1.566.6-2.166 0a1.536 1.536 0 0 1-.337-1.662l-2.074-2.063V14.9c.146.071.286.169.407.29a1.537 1.537 0 0 1 0 2.166 1.536 1.536 0 0 1-2.174 0 1.528 1.528 0 0 1 0-2.164c.152-.15.322-.264.504-.339v-5.49a1.529 1.529 0 0 1-.83-2.008l-2.26-2.271-5.987 5.982c-.5.504-.5 1.32 0 1.824l8.731 8.729a1.286 1.286 0 0 0 1.821 0l8.69-8.689a1.284 1.284 0 0 0 .003-1.822"},child:[]}]})(n)}function RU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M12.026 2c-5.509 0-9.974 4.465-9.974 9.974 0 4.406 2.857 8.145 6.821 9.465.499.09.679-.217.679-.481 0-.237-.008-.865-.011-1.696-2.775.602-3.361-1.338-3.361-1.338-.452-1.152-1.107-1.459-1.107-1.459-.905-.619.069-.605.069-.605 1.002.07 1.527 1.028 1.527 1.028.89 1.524 2.336 1.084 2.902.829.091-.645.351-1.085.635-1.334-2.214-.251-4.542-1.107-4.542-4.93 0-1.087.389-1.979 1.024-2.675-.101-.253-.446-1.268.099-2.64 0 0 .837-.269 2.742 1.021a9.582 9.582 0 0 1 2.496-.336 9.554 9.554 0 0 1 2.496.336c1.906-1.291 2.742-1.021 2.742-1.021.545 1.372.203 2.387.099 2.64.64.696 1.024 1.587 1.024 2.675 0 3.833-2.33 4.675-4.552 4.922.355.308.675.916.675 1.846 0 1.334-.012 2.41-.012 2.737 0 .267.178.577.687.479C19.146 20.115 22 16.379 22 11.974 22 6.465 17.535 2 12.026 2z"},child:[]}]})(n)}function PU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.136 3.012h15.729l-1.431 16.15-6.451 1.826-6.414-1.826-1.433-16.15zm5.266 7.302-.173-2.035 7.533.002.173-1.963-9.87-.002.522 5.998h6.835l-.243 2.566-2.179.602-2.214-.605-.141-1.58H7.691l.247 3.123L12 17.506l4.028-1.08.558-6.111H9.402v-.001z"},child:[]}]})(n)}function LU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.55 21H3v-8.55h8.55V21zM21 21h-8.55v-8.55H21V21zm-9.45-9.45H3V3h8.55v8.55zm9.45 0h-8.55V3H21v8.55z"},child:[]}]})(n)}function IU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M15.661 15.549a1.315 1.315 0 0 0 1.185-1.386 1.363 1.363 0 0 0-1.35-1.302h-.048a1.352 1.352 0 0 0-1.303 1.397c.024.379.179.687.391.911-.827 1.609-2.07 2.794-3.954 3.788-1.266.663-2.604.912-3.905.734-1.089-.153-1.94-.64-2.463-1.421-.78-1.185-.852-2.462-.201-3.74a5.597 5.597 0 0 1 1.658-1.931 7.88 7.88 0 0 1-.331-1.218c-3.506 2.51-3.148 5.942-2.084 7.564.794 1.184 2.415 1.941 4.19 1.941.474 0 .972-.035 1.457-.154 3.077-.592 5.409-2.438 6.747-5.16l.011-.023z"},child:[]},{tag:"path",attr:{d:"M19.887 12.589c-1.834-2.154-4.533-3.337-7.611-3.337h-.403c-.2-.438-.661-.711-1.183-.711h-.036c-.744 0-1.325.64-1.301 1.385.023.71.627 1.302 1.35 1.302h.059a1.332 1.332 0 0 0 1.183-.828h.439c1.824 0 3.551.532 5.126 1.574 1.206.792 2.072 1.834 2.557 3.077.425 1.019.402 2.013-.035 2.843-.675 1.302-1.812 1.988-3.314 1.988-.947 0-1.871-.296-2.345-.509-.283.235-.758.626-1.102.863 1.042.473 2.096.746 3.113.746 2.309 0 4.023-1.302 4.676-2.557.709-1.422.651-3.813-1.161-5.859l-.012.023z"},child:[]},{tag:"path",attr:{d:"M7.647 15.975c.023.71.626 1.302 1.35 1.302h.048a1.334 1.334 0 0 0 1.302-1.397c0-.71-.616-1.301-1.338-1.301h-.048c-.048 0-.118 0-.178.022-.982-1.657-1.397-3.434-1.242-5.349.094-1.445.567-2.7 1.42-3.742.71-.888 2.048-1.326 2.96-1.35 2.556-.048 3.622 3.138 3.704 4.404l1.184.354C16.536 5.036 14.122 3 11.813 3 9.647 3 7.647 4.574 6.842 6.884c-1.102 3.077-.379 6.036.971 8.404-.118.154-.189.426-.166.687z"},child:[]}]})(n)}function NU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.5 9.51a4.22 4.22 0 0 1-1.91-1.34A5.77 5.77 0 0 0 12 6a4.72 4.72 0 0 0-5 4 3.23 3.23 0 0 1 3.5-1.49 4.32 4.32 0 0 1 1.91 1.35A5.77 5.77 0 0 0 17 12a4.72 4.72 0 0 0 5-4 3.2 3.2 0 0 1-3.5 1.51zm-13 4.98a4.22 4.22 0 0 1 1.91 1.34A5.77 5.77 0 0 0 12 18a4.72 4.72 0 0 0 5-4 3.23 3.23 0 0 1-3.5 1.49 4.32 4.32 0 0 1-1.91-1.35A5.8 5.8 0 0 0 7 12a4.72 4.72 0 0 0-5 4 3.2 3.2 0 0 1 3.5-1.51z"},child:[]}]})(n)}function DU(n){return Vt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m21.29 4.1-4.12-2a1.36 1.36 0 0 0-.48-.1h-.08a1.18 1.18 0 0 0-.72.24l-.14.12-7.88 7.19L4.44 7a.83.83 0 0 0-.54-.17.88.88 0 0 0-.53.17l-1.1 1a.8.8 0 0 0-.27.61.84.84 0 0 0 .27.62l3 2.71-3 2.72a.84.84 0 0 0 0 1.23l1.1 1a.89.89 0 0 0 .6.22.93.93 0 0 0 .47-.17l3.43-2.61 7.88 7.19a1.2 1.2 0 0 0 .76.36h.17a1 1 0 0 0 .49-.12l4.12-2a1.25 1.25 0 0 0 .71-1.1V5.23a1.26 1.26 0 0 0-.71-1.13zM17 16.47l-6-4.53 6-4.53z"},child:[]}]})(n)}function UU(){const n=[fe.jsx(Yb,{color:"#46d3f2",size:64}),fe.jsx(CU,{size:64}),fe.jsx(Xb,{color:"green",size:64}),fe.jsx(qb,{size:64}),fe.jsx(Kb,{color:"green",size:64}),fe.jsx(Jb,{color:"#f78f07",size:64}),fe.jsx(SU,{size:64}),fe.jsx($b,{size:64}),fe.jsx(jb,{color:"#2027b0",size:64}),fe.jsx(MU,{color:"#f5dd07",size:64}),fe.jsx(Wb,{color:"#6d7ecf",size:64}),fe.jsx(TU,{color:"#002aff",size:64}),fe.jsx(PU,{color:"#fc0303",size:64}),fe.jsx(EU,{color:"#a004d4",size:64}),fe.jsx(Qb,{size:64}),fe.jsx(NU,{color:"#03f4fc",size:64}),fe.jsx(Bb,{color:"#01056b",size:64}),fe.jsx(AU,{color:"#09ff00",size:64}),fe.jsx(RU,{size:64}),fe.jsx(bU,{color:"#fa1919",size:64}),fe.jsx(wU,{size:64}),fe.jsx(LU,{color:"blue",size:64}),fe.jsx(IU,{color:"#46d3f2",size:64}),fe.jsx(DU,{color:"#0390fc",size:64})];return fe.jsx("div",{className:"grid grid-cols-4 md:grid-cols-6 2xl:grid-cols-8 gap-4",children:n.map((e,t)=>fe.jsx("div",{className:"p-2",children:e},t))})}function zU(){return fe.jsxs("div",{className:"bg-white container flex flex-col items-center justify-center mx-auto my-3",children:[fe.jsx("h2",{className:"text-3xl font-bold text-black",children:"Skills"}),fe.jsx("p",{className:"text-gray-950 mx-auto",children:"You name it! I've done it!"}),fe.jsx("div",{className:"flex justify-center",children:fe.jsx(UU,{})})]})}const OU="/my-portfolio/assets/GEU-CyzQLqoM.jpg",FU="/my-portfolio/assets/Clairco-QdSIebFl.jpg",kU=()=>fe.jsx("div",{className:"bg-blue-950 p-8 text-white ",children:fe.jsxs("div",{className:"container mx-auto max-w-4xl",children:[fe.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Experience"}),fe.jsxs("div",{className:"mb-8 flex flex-col-reverse md:flex-row",children:[fe.jsx("img",{src:OU,alt:"GEU image",className:"rounded-full object-cover w-48 md:w-48 h-auto my-2 md:mb-0 mx-auto md:mr-3 shadow-md shadow-white/70 hover:shadow-white hover:shadow-lg"}),fe.jsxs("div",{children:[fe.jsx("h2",{className:"text-2xl font-bold",children:"Graphic Era University"}),fe.jsx("h3",{className:"font-semibold text-gray-400 text-sm md:text-lg",children:"CS Student | 2021-2025 | SCGPA: 8.47"}),fe.jsx("p",{className:"text-white",children:"Dedicated Computer Science student with expertise in data structures, algorithms, cybersecurity, blockchain, game development and web development. Certified in Cloud computing, Frontend development, and AI. Passionate about continuous learning and active participation in computer science discussions."})]})]}),fe.jsxs("div",{className:"mb-8 flex flex-col-reverse md:flex-row",children:[fe.jsx("img",{src:FU,alt:"Clairco Image",className:"rounded-full object-cover w-48 md:w-48 h-auto my-2 md:mb-0 mx-auto md:mr-3 shadow-md shadow-white/70 hover:shadow-white hover:shadow-lg"}),fe.jsxs("div",{children:[fe.jsx("h2",{className:"text-2xl font-bold",children:"Clairco"}),fe.jsx("h3",{className:"text-sm md:text-lg font-semibold text-gray-400",children:"Software Development Intern | Jun'23 - Aug'23"}),fe.jsx("p",{className:"text-white",children:"Clairco (Aliferous Technologies Pvt Ltd) is a Bangalore based startup. As a Software Developer intern, I contributed to interactive applications using React, MongoDB, Express.js, and Node.js, gaining hands-on experience across the software development lifecycle."})]})]})]})}),rf={_origin:"https://api.emailjs.com"},BU=(n,e="https://api.emailjs.com")=>{rf._userID=n,rf._origin=e},fA=(n,e,t)=>{if(!n)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates";return!0};class fM{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const hA=(n,e,t={})=>new Promise((i,r)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new fM(o);a.status===200||a.text==="OK"?i(a):r(a)}),s.addEventListener("error",({target:o})=>{r(new fM(o))}),s.open("POST",rf._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),HU=(n,e,t,i)=>{const r=i||rf._userID;return fA(r,n,e),hA("/api/v1.0/email/send",JSON.stringify({lib_version:"3.12.1",user_id:r,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},VU=n=>{let e;if(typeof n=="string"?e=document.querySelector(n):e=n,!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of form";return e},GU=(n,e,t,i)=>{const r=i||rf._userID,s=VU(t);fA(r,n,e);const o=new FormData(s);return o.append("lib_version","3.12.1"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",r),hA("/api/v1.0/email/send-form",o)},WU={init:BU,send:HU,sendForm:GU};function dA(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(e=0;etypeof n=="number"&&!isNaN(n),pa=n=>typeof n=="string",Xi=n=>typeof n=="function",Qd=n=>pa(n)||Xi(n)?n:null,Hv=n=>ve.isValidElement(n)||pa(n)||Xi(n)||sf(n);function XU(n,e,t){t===void 0&&(t=300);const{scrollHeight:i,style:r}=n;requestAnimationFrame(()=>{r.minHeight="initial",r.height=i+"px",r.transition=`all ${t}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(e,t)})})}function Tm(n){let{enter:e,exit:t,appendPosition:i=!1,collapse:r=!0,collapseDuration:s=300}=n;return function(o){let{children:a,position:u,preventExitTransition:f,done:h,nodeRef:d,isIn:p,playToast:v}=o;const y=i?`${e}--${u}`:e,w=i?`${t}--${u}`:t,S=ve.useRef(0);return ve.useLayoutEffect(()=>{const g=d.current,x=y.split(" "),M=T=>{T.target===d.current&&(v(),g.removeEventListener("animationend",M),g.removeEventListener("animationcancel",M),S.current===0&&T.type!=="animationcancel"&&g.classList.remove(...x))};g.classList.add(...x),g.addEventListener("animationend",M),g.addEventListener("animationcancel",M)},[]),ve.useEffect(()=>{const g=d.current,x=()=>{g.removeEventListener("animationend",x),r?XU(g,h,s):h()};p||(f?x():(S.current=1,g.className+=` ${w}`,g.addEventListener("animationend",x)))},[p]),Pt.createElement(Pt.Fragment,null,a)}}function hM(n,e){return n!=null?{content:n.content,containerId:n.props.containerId,id:n.props.toastId,theme:n.props.theme,type:n.props.type,data:n.props.data||{},isLoading:n.props.isLoading,icon:n.props.icon,status:e}:{}}const mi=new Map;let of=[];const Vv=new Set,jU=n=>Vv.forEach(e=>e(n)),pA=()=>mi.size>0;function mA(n,e){var t;if(e)return!((t=mi.get(e))==null||!t.isToastActive(n));let i=!1;return mi.forEach(r=>{r.isToastActive(n)&&(i=!0)}),i}function gA(n,e){Hv(n)&&(pA()||of.push({content:n,options:e}),mi.forEach(t=>{t.buildToast(n,e)}))}function dM(n,e){mi.forEach(t=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===t.id&&t.toggle(n,e==null?void 0:e.id):t.toggle(n,e==null?void 0:e.id)})}function YU(n){const{subscribe:e,getSnapshot:t,setProps:i}=ve.useRef(function(s){const o=s.containerId||1;return{subscribe(a){const u=function(h,d,p){let v=1,y=0,w=[],S=[],g=[],x=d;const M=new Map,T=new Set,P=()=>{g=Array.from(M.values()),T.forEach(D=>D())},C=D=>{S=D==null?[]:S.filter(b=>b!==D),P()},L=D=>{const{toastId:b,onOpen:R,updateId:k,children:q}=D.props,oe=k==null;D.staleId&&M.delete(D.staleId),M.set(b,D),S=[...S,D.props.toastId].filter(V=>V!==D.staleId),P(),p(hM(D,oe?"added":"updated")),oe&&Xi(R)&&R(ve.isValidElement(q)&&q.props)};return{id:h,props:x,observe:D=>(T.add(D),()=>T.delete(D)),toggle:(D,b)=>{M.forEach(R=>{b!=null&&b!==R.props.toastId||Xi(R.toggle)&&R.toggle(D)})},removeToast:C,toasts:M,clearQueue:()=>{y-=w.length,w=[]},buildToast:(D,b)=>{if((J=>{let{containerId:Z,toastId:ie,updateId:pe}=J;const Ee=Z?Z!==h:h!==1,Te=M.has(ie)&&pe==null;return Ee||Te})(b))return;const{toastId:R,updateId:k,data:q,staleId:oe,delay:V}=b,Q=()=>{C(R)},te=k==null;te&&y++;const ae={...x,style:x.toastStyle,key:v++,...Object.fromEntries(Object.entries(b).filter(J=>{let[Z,ie]=J;return ie!=null})),toastId:R,updateId:k,data:q,closeToast:Q,isIn:!1,className:Qd(b.className||x.toastClassName),bodyClassName:Qd(b.bodyClassName||x.bodyClassName),progressClassName:Qd(b.progressClassName||x.progressClassName),autoClose:!b.isLoading&&(N=b.autoClose,B=x.autoClose,N===!1||sf(N)&&N>0?N:B),deleteToast(){const J=M.get(R),{onClose:Z,children:ie}=J.props;Xi(Z)&&Z(ve.isValidElement(ie)&&ie.props),p(hM(J,"removed")),M.delete(R),y--,y<0&&(y=0),w.length>0?L(w.shift()):P()}};var N,B;ae.closeButton=x.closeButton,b.closeButton===!1||Hv(b.closeButton)?ae.closeButton=b.closeButton:b.closeButton===!0&&(ae.closeButton=!Hv(x.closeButton)||x.closeButton);let H=D;ve.isValidElement(D)&&!pa(D.type)?H=ve.cloneElement(D,{closeToast:Q,toastProps:ae,data:q}):Xi(D)&&(H=D({closeToast:Q,toastProps:ae,data:q}));const Y={content:H,props:ae,staleId:oe};x.limit&&x.limit>0&&y>x.limit&&te?w.push(Y):sf(V)?setTimeout(()=>{L(Y)},V):L(Y)},setProps(D){x=D},setToggle:(D,b)=>{M.get(D).toggle=b},isToastActive:D=>S.some(b=>b===D),getSnapshot:()=>x.newestOnTop?g.reverse():g}}(o,s,jU);mi.set(o,u);const f=u.observe(a);return of.forEach(h=>gA(h.content,h.options)),of=[],()=>{f(),mi.delete(o)}},setProps(a){var u;(u=mi.get(o))==null||u.setProps(a)},getSnapshot(){var a;return(a=mi.get(o))==null?void 0:a.getSnapshot()}}}(n)).current;i(n);const r=ve.useSyncExternalStore(e,t,t);return{getToastToRender:function(s){if(!r)return[];const o=new Map;return r.forEach(a=>{const{position:u}=a.props;o.has(u)||o.set(u,[]),o.get(u).push(a)}),Array.from(o,a=>s(a[0],a[1]))},isToastActive:mA,count:r==null?void 0:r.length}}function qU(n){const[e,t]=ve.useState(!1),[i,r]=ve.useState(!1),s=ve.useRef(null),o=ve.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:u,closeToast:f,onClick:h,closeOnClick:d}=n;var p,v;function y(){t(!0)}function w(){t(!1)}function S(M){const T=s.current;o.canDrag&&T&&(o.didMove=!0,e&&w(),o.delta=n.draggableDirection==="x"?M.clientX-o.start:M.clientY-o.start,o.start!==M.clientX&&(o.canCloseOnClick=!1),T.style.transform=`translate3d(${n.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,T.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function g(){document.removeEventListener("pointermove",S),document.removeEventListener("pointerup",g);const M=s.current;if(o.canDrag&&o.didMove&&M){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return r(!0),n.closeToast(),void n.collapseAll();M.style.transition="transform 0.2s, opacity 0.2s",M.style.removeProperty("transform"),M.style.removeProperty("opacity")}}(v=mi.get((p={id:n.toastId,containerId:n.containerId,fn:t}).containerId||1))==null||v.setToggle(p.id,p.fn),ve.useEffect(()=>{if(n.pauseOnFocusLoss)return document.hasFocus()||w(),window.addEventListener("focus",y),window.addEventListener("blur",w),()=>{window.removeEventListener("focus",y),window.removeEventListener("blur",w)}},[n.pauseOnFocusLoss]);const x={onPointerDown:function(M){if(n.draggable===!0||n.draggable===M.pointerType){o.didMove=!1,document.addEventListener("pointermove",S),document.addEventListener("pointerup",g);const T=s.current;o.canCloseOnClick=!0,o.canDrag=!0,T.style.transition="none",n.draggableDirection==="x"?(o.start=M.clientX,o.removalDistance=T.offsetWidth*(n.draggablePercent/100)):(o.start=M.clientY,o.removalDistance=T.offsetHeight*(n.draggablePercent===80?1.5*n.draggablePercent:n.draggablePercent)/100)}},onPointerUp:function(M){const{top:T,bottom:P,left:C,right:L}=s.current.getBoundingClientRect();M.nativeEvent.type!=="touchend"&&n.pauseOnHover&&M.clientX>=C&&M.clientX<=L&&M.clientY>=T&&M.clientY<=P?w():y()}};return a&&u&&(x.onMouseEnter=w,n.stacked||(x.onMouseLeave=y)),d&&(x.onClick=M=>{h&&h(M),o.canCloseOnClick&&f()}),{playToast:y,pauseToast:w,isRunning:e,preventExitTransition:i,toastRef:s,eventHandlers:x}}function ZU(n){let{delay:e,isRunning:t,closeToast:i,type:r="default",hide:s,className:o,style:a,controlledProgress:u,progress:f,rtl:h,isIn:d,theme:p}=n;const v=s||u&&f===0,y={...a,animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};u&&(y.transform=`scaleX(${f})`);const w=io("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${p}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":h}),S=Xi(o)?o({rtl:h,type:r,defaultClassName:w}):io(w,o),g={[u&&f>=1?"onTransitionEnd":"onAnimationEnd"]:u&&f<1?null:()=>{d&&i()}};return Pt.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":v},Pt.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${p} Toastify__progress-bar--${r}`}),Pt.createElement("div",{role:"progressbar","aria-hidden":v?"true":"false","aria-label":"notification timer",className:S,style:y,...g}))}let KU=1;const vA=()=>""+KU++;function JU(n){return n&&(pa(n.toastId)||sf(n.toastId))?n.toastId:vA()}function yu(n,e){return gA(n,e),e.toastId}function Np(n,e){return{...e,type:e&&e.type||n,toastId:JU(e)}}function Ld(n){return(e,t)=>yu(e,Np(n,t))}function Xt(n,e){return yu(n,Np("default",e))}Xt.loading=(n,e)=>yu(n,Np("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Xt.promise=function(n,e,t){let i,{pending:r,error:s,success:o}=e;r&&(i=pa(r)?Xt.loading(r,t):Xt.loading(r.render,{...t,...r}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(h,d,p)=>{if(d==null)return void Xt.dismiss(i);const v={type:h,...a,...t,data:p},y=pa(d)?{render:d}:d;return i?Xt.update(i,{...v,...y}):Xt(y.render,{...v,...y}),p},f=Xi(n)?n():n;return f.then(h=>u("success",o,h)).catch(h=>u("error",s,h)),f},Xt.success=Ld("success"),Xt.info=Ld("info"),Xt.error=Ld("error"),Xt.warning=Ld("warning"),Xt.warn=Xt.warning,Xt.dark=(n,e)=>yu(n,Np("default",{theme:"dark",...e})),Xt.dismiss=function(n){(function(e){var t;if(pA()){if(e==null||pa(t=e)||sf(t))mi.forEach(r=>{r.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){var i;(i=mi.get(e.containerId))!=null&&i.removeToast(e.id)||mi.forEach(r=>{r.removeToast(e.id)})}}else of=of.filter(r=>e!=null&&r.options.toastId!==e)})(n)},Xt.clearWaitingQueue=function(n){n===void 0&&(n={}),mi.forEach(e=>{!e.props.limit||n.containerId&&e.id!==n.containerId||e.clearQueue()})},Xt.isActive=mA,Xt.update=function(n,e){e===void 0&&(e={});const t=((i,r)=>{var s;let{containerId:o}=r;return(s=mi.get(o||1))==null?void 0:s.toasts.get(i)})(n,e);if(t){const{props:i,content:r}=t,s={delay:100,...i,...e,toastId:e.toastId||n,updateId:vA()};s.toastId!==n&&(s.staleId=n);const o=s.render||r;delete s.render,yu(o,s)}},Xt.done=n=>{Xt.update(n,{progress:1})},Xt.onChange=function(n){return Vv.add(n),()=>{Vv.delete(n)}},Xt.play=n=>dM(!0,n),Xt.pause=n=>dM(!1,n);const QU=typeof window<"u"?ve.useLayoutEffect:ve.useEffect,Id=n=>{let{theme:e,type:t,isLoading:i,...r}=n;return Pt.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r})},$g={info:function(n){return Pt.createElement(Id,{...n},Pt.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(n){return Pt.createElement(Id,{...n},Pt.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(n){return Pt.createElement(Id,{...n},Pt.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(n){return Pt.createElement(Id,{...n},Pt.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Pt.createElement("div",{className:"Toastify__spinner"})}},$U=n=>{const{isRunning:e,preventExitTransition:t,toastRef:i,eventHandlers:r,playToast:s}=qU(n),{closeButton:o,children:a,autoClose:u,onClick:f,type:h,hideProgressBar:d,closeToast:p,transition:v,position:y,className:w,style:S,bodyClassName:g,bodyStyle:x,progressClassName:M,progressStyle:T,updateId:P,role:C,progress:L,rtl:D,toastId:b,deleteToast:R,isIn:k,isLoading:q,closeOnClick:oe,theme:V}=n,Q=io("Toastify__toast",`Toastify__toast-theme--${V}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":D},{"Toastify__toast--close-on-click":oe}),te=Xi(w)?w({rtl:D,position:y,type:h,defaultClassName:Q}):io(Q,w),ae=function(Y){let{theme:J,type:Z,isLoading:ie,icon:pe}=Y,Ee=null;const Te={theme:J,type:Z,isLoading:ie};return pe===!1||(Xi(pe)?Ee=pe(Te):ve.isValidElement(pe)?Ee=ve.cloneElement(pe,Te):ie?Ee=$g.spinner():(nt=>nt in $g)(Z)&&(Ee=$g[Z](Te))),Ee}(n),N=!!L||!u,B={closeToast:p,type:h,theme:V};let H=null;return o===!1||(H=Xi(o)?o(B):ve.isValidElement(o)?ve.cloneElement(o,B):function(Y){let{closeToast:J,theme:Z,ariaLabel:ie="close"}=Y;return Pt.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Z}`,type:"button",onClick:pe=>{pe.stopPropagation(),J(pe)},"aria-label":ie},Pt.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Pt.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(B)),Pt.createElement(v,{isIn:k,done:R,position:y,preventExitTransition:t,nodeRef:i,playToast:s},Pt.createElement("div",{id:b,onClick:f,"data-in":k,className:te,...r,style:S,ref:i},Pt.createElement("div",{...k&&{role:C},className:Xi(g)?g({type:h}):io("Toastify__toast-body",g),style:x},ae!=null&&Pt.createElement("div",{className:io("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!q})},ae),Pt.createElement("div",null,a)),H,Pt.createElement(ZU,{...P&&!N?{key:`pb-${P}`}:{},rtl:D,theme:V,delay:u,isRunning:e,isIn:k,closeToast:p,hide:d,type:h,style:T,className:M,controlledProgress:N,progress:L||0})))},Am=function(n,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${n}-enter`,exit:`Toastify--animate Toastify__${n}-exit`,appendPosition:e}},ez=Tm(Am("bounce",!0));Tm(Am("slide",!0));Tm(Am("zoom"));Tm(Am("flip"));const tz={position:"top-right",transition:ez,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function nz(n){let e={...tz,...n};const t=n.stacked,[i,r]=ve.useState(!0),s=ve.useRef(null),{getToastToRender:o,isToastActive:a,count:u}=YU(e),{className:f,style:h,rtl:d,containerId:p}=e;function v(w){const S=io("Toastify__toast-container",`Toastify__toast-container--${w}`,{"Toastify__toast-container--rtl":d});return Xi(f)?f({position:w,rtl:d,defaultClassName:S}):io(S,Qd(f))}function y(){t&&(r(!0),Xt.play())}return QU(()=>{if(t){var w;const S=s.current.querySelectorAll('[data-in="true"]'),g=12,x=(w=e.position)==null?void 0:w.includes("top");let M=0,T=0;Array.from(S).reverse().forEach((P,C)=>{const L=P;L.classList.add("Toastify__toast--stacked"),C>0&&(L.dataset.collapsed=`${i}`),L.dataset.pos||(L.dataset.pos=x?"top":"bot");const D=M*(i?.2:1)+(i?0:g*C);L.style.setProperty("--y",`${x?D:-1*D}px`),L.style.setProperty("--g",`${g}`),L.style.setProperty("--s",""+(1-(i?T:0))),M+=L.offsetHeight,T+=.025})}},[i,u,t]),Pt.createElement("div",{ref:s,className:"Toastify",id:p,onMouseEnter:()=>{t&&(r(!1),Xt.pause())},onMouseLeave:y},o((w,S)=>{const g=S.length?{...h}:{...h,pointerEvents:"none"};return Pt.createElement("div",{className:v(w),style:g,key:`container-${w}`},S.map(x=>{let{content:M,props:T}=x;return Pt.createElement($U,{...T,stacked:t,collapseAll:y,isIn:a(T.toastId,T.containerId),style:T.style,key:`toast-${T.key}`},M)}))}))}function iz(){const n=ve.useRef(),e=r=>{r.preventDefault(),WU.sendForm("service_kz36odt","template_h2od0rf",n.current,"y3RyWxgsJ48z6erxD").then(s=>{const o=s.text;console.log(o),o==="OK"?t("Email sent successfully!"):i("Error sending email. Please try again later.")},s=>{console.log(s.text),i("Error sending email. Please try again later.")})},t=r=>{Xt.success(r,{position:"top-center",autoClose:3e3})},i=r=>{Xt.error(r,{position:"top-center",autoClose:3e3})};return fe.jsxs("div",{className:"my-10",children:[fe.jsx(nz,{}),fe.jsxs("h2",{className:"text-3xl font-bold mb-4 text-center my-2 flex justify-center",children:["Contact Me",fe.jsxs("picture",{className:"mx-2",children:[fe.jsx("source",{srcSet:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f60e/512.webp",type:"image/webp"}),fe.jsx("img",{src:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f60e/512.gif",alt:"😎",width:"32",height:"32"})]})]}),fe.jsxs("form",{ref:n,onSubmit:e,className:"max-w-md mx-5 md:mx-auto",children:[fe.jsxs("div",{className:"mb-4",children:[fe.jsx("label",{className:"block text-gray-800 font-bold mb-2",htmlFor:"user_name",children:"Name"}),fe.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-800 leading-tight focus:outline-none focus:shadow-outline",id:"user_name",type:"text",name:"user_name",placeholder:"Enter your name"})]}),fe.jsxs("div",{className:"mb-4",children:[fe.jsx("label",{className:"block text-gray-800 font-bold mb-2",htmlFor:"user_email",children:"Email"}),fe.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-800 leading-tight focus:outline-none focus:shadow-outline",id:"user_email",type:"email",name:"user_email",placeholder:"Enter your email"})]}),fe.jsxs("div",{className:"mb-4",children:[fe.jsx("label",{className:"block text-gray-800 font-bold mb-2",htmlFor:"message",children:"Message"}),fe.jsx("textarea",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-800 leading-tight focus:outline-none focus:shadow-outline",id:"message",name:"message",placeholder:"Enter your message"})]}),fe.jsx("div",{className:"flex items-center justify-center",children:fe.jsx("button",{className:"bg-blue-950 hover:bg-blue-800 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline w-full",type:"submit",children:"Send"})})]})]})}function rz(){return fe.jsx("div",{className:"bg-blue-950 text-white py-6 text-center",children:fe.jsxs("div",{className:"container mx-auto",children:[fe.jsx("p",{className:"text-sm",children:"© 2024 Abhinav Choudhary. All rights reserved."}),fe.jsxs("p",{className:"mt-2",children:["Connect with me:"," ",fe.jsx("a",{href:"https://www.linkedin.com/in/abhinavchdhary/",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:underline",children:"LinkedIn"})," ","|"," ",fe.jsx("a",{href:"https://github.com/Abhinav-Chdhary",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:underline",children:"GitHub"})," ","|"," ",fe.jsx("a",{href:"mailto:abhinavchdhary@gmail.com",className:"text-blue-400 hover:underline",children:"Email"})]})]})})}function sz(){return fe.jsxs("div",{children:[fe.jsx(eR,{}),fe.jsx(yU,{}),fe.jsx(xU,{}),fe.jsx(zU,{}),fe.jsx(kU,{}),fe.jsx(iz,{}),fe.jsx(rz,{})]})}e1.createRoot(document.getElementById("root")).render(fe.jsx(Pt.StrictMode,{children:fe.jsx(sz,{})})); diff --git a/assets/index-s3jhMeAI.css b/assets/index-s3jhMeAI.css deleted file mode 100644 index ee4547d..0000000 --- a/assets/index-s3jhMeAI.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.m-2{margin:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-2{margin-top:.5rem}.flex{display:flex}.grid{display:grid}.h-auto{height:auto}.w-full{width:100%}.max-w-4xl{max-width:56rem}.flex-1{flex:1 1 0%}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.gap-4{gap:1rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-blue-950{--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity))}.bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-950{--tw-gradient-from: #172554 var(--tw-gradient-from-position);--tw-gradient-to: rgb(23 37 84 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-blue-600{--tw-gradient-to: rgb(37 99 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #2563eb var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\:bg-black:hover{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}@media (min-width: 768px){.md\:mx-2{margin-left:.5rem;margin-right:.5rem}.md\:mb-0{margin-bottom:0}.md\:w-48{width:12rem}.md\:w-64{width:16rem}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}}@media (min-width: 1536px){.\32xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}} diff --git a/index.html b/index.html index 91e5ecb..1bb6521 100644 --- a/index.html +++ b/index.html @@ -5,8 +5,8 @@ Abhinav - - + +