diff --git a/assets/index-4f82b8bd.js b/assets/index-4f82b8bd.js new file mode 100644 index 0000000..165c90e --- /dev/null +++ b/assets/index-4f82b8bd.js @@ -0,0 +1,3830 @@ +function YN(n,e){for(var t=0;ti[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(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 tS(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function qN(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var yC={exports:{}},sg={},xC={exports:{}},Pt={};/** + * @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 hh=Symbol.for("react.element"),ZN=Symbol.for("react.portal"),KN=Symbol.for("react.fragment"),JN=Symbol.for("react.strict_mode"),QN=Symbol.for("react.profiler"),$N=Symbol.for("react.provider"),eD=Symbol.for("react.context"),tD=Symbol.for("react.forward_ref"),nD=Symbol.for("react.suspense"),iD=Symbol.for("react.memo"),rD=Symbol.for("react.lazy"),ZM=Symbol.iterator;function sD(n){return n===null||typeof n!="object"?null:(n=ZM&&n[ZM]||n["@@iterator"],typeof n=="function"?n:null)}var _C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},SC=Object.assign,AC={};function qc(n,e,t){this.props=n,this.context=e,this.refs=AC,this.updater=t||_C}qc.prototype.isReactComponent={};qc.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")};qc.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function MC(){}MC.prototype=qc.prototype;function nS(n,e,t){this.props=n,this.context=e,this.refs=AC,this.updater=t||_C}var iS=nS.prototype=new MC;iS.constructor=nS;SC(iS,qc.prototype);iS.isPureReactComponent=!0;var KM=Array.isArray,wC=Object.prototype.hasOwnProperty,rS={current:null},EC={key:!0,ref:!0,__self:!0,__source:!0};function TC(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)wC.call(e,i)&&!EC.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,ie=k[J];if(0>>1;J<$;){var fe=2*(J+1)-1,ve=k[fe],be=fe+1,Pe=k[be];if(0>r(ve,Y))ber(Pe,ve)?(k[J]=Pe,k[be]=Y,J=be):(k[J]=ve,k[fe]=Y,J=fe);else if(ber(Pe,Y))k[J]=Pe,k[be]=Y,J=be;else break e}}return j}function r(k,j){var Y=k.sortIndex-j.sortIndex;return Y!==0?Y:k.id-j.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 l=[],f=[],h=1,d=null,p=3,m=!1,y=!1,A=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(k){for(var j=t(f);j!==null;){if(j.callback===null)i(f);else if(j.startTime<=k)i(f),j.sortIndex=j.expirationTime,e(l,j);else break;j=t(f)}}function E(k){if(A=!1,S(k),!y)if(t(l)!==null)y=!0,ee(P);else{var j=t(f);j!==null&&oe(E,j.startTime-k)}}function P(k,j){y=!1,A&&(A=!1,g(N),N=-1),m=!0;var Y=p;try{for(S(j),d=t(l);d!==null&&(!(d.expirationTime>j)||k&&!F());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var ie=J(d.expirationTime<=j);j=n.unstable_now(),typeof ie=="function"?d.callback=ie:d===t(l)&&i(l),S(j)}else i(l);d=t(l)}if(d!==null)var $=!0;else{var fe=t(f);fe!==null&&oe(E,fe.startTime-j),$=!1}return $}finally{d=null,p=Y,m=!1}}var b=!1,L=null,N=-1,C=5,R=-1;function F(){return!(n.unstable_now()-Rk||125J?(k.sortIndex=Y,e(f,k),t(l)===null&&k===t(f)&&(A?(g(N),N=-1):A=!0,oe(E,Y-J))):(k.sortIndex=ie,e(l,k),y||m||(y=!0,ee(P))),k},n.unstable_shouldYield=F,n.unstable_wrapCallback=function(k){var j=p;return function(){var Y=p;p=j;try{return k.apply(this,arguments)}finally{p=Y}}}})(RC);PC.exports=RC;var vD=PC.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 LC=V,er=vD;function Ee(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"),Zy=Object.prototype.hasOwnProperty,yD=/^[: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]*$/,QM={},$M={};function xD(n){return Zy.call($M,n)?!0:Zy.call(QM,n)?!1:yD.test(n)?$M[n]=!0:(QM[n]=!0,!1)}function _D(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 SD(n,e,t,i){if(e===null||typeof e>"u"||_D(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 Ti(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 Qn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Qn[n]=new Ti(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Qn[e]=new Ti(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Qn[n]=new Ti(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Qn[n]=new Ti(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){Qn[n]=new Ti(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Qn[n]=new Ti(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Qn[n]=new Ti(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Qn[n]=new Ti(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Qn[n]=new Ti(n,5,!1,n.toLowerCase(),null,!1,!1)});var oS=/[\-:]([a-z])/g;function aS(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(oS,aS);Qn[e]=new Ti(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(oS,aS);Qn[e]=new Ti(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(oS,aS);Qn[e]=new Ti(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Qn[n]=new Ti(n,1,!1,n.toLowerCase(),null,!1,!1)});Qn.xlinkHref=new Ti("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Qn[n]=new Ti(n,1,!1,n.toLowerCase(),null,!0,!0)});function lS(n,e,t,i){var r=Qn.hasOwnProperty(e)?Qn[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var l=` +`+r[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{vv=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Ku(n):""}function AD(n){switch(n.tag){case 5:return Ku(n.type);case 16:return Ku("Lazy");case 13:return Ku("Suspense");case 19:return Ku("SuspenseList");case 0:case 2:case 15:return n=yv(n.type,!1),n;case 11:return n=yv(n.type.render,!1),n;case 1:return n=yv(n.type,!0),n;default:return""}}function $y(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 rc:return"Fragment";case ic:return"Portal";case Ky:return"Profiler";case cS:return"StrictMode";case Jy:return"Suspense";case Qy:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case DC:return(n.displayName||"Context")+".Consumer";case NC:return(n._context.displayName||"Context")+".Provider";case uS:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case fS:return e=n.displayName||null,e!==null?e:$y(n.type)||"Memo";case xo:e=n._payload,n=n._init;try{return $y(n(e))}catch{}}return null}function MD(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 $y(e);case 8:return e===cS?"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 Ho(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function OC(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function wD(n){var e=OC(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 Nd(n){n._valueTracker||(n._valueTracker=wD(n))}function FC(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=OC(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function gm(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 ex(n,e){var t=e.checked;return fn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function tw(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Ho(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 kC(n,e){e=e.checked,e!=null&&lS(n,"checked",e,!1)}function tx(n,e){kC(n,e);var t=Ho(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")?nx(n,e.type,t):e.hasOwnProperty("defaultValue")&&nx(n,e.type,Ho(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function nw(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 nx(n,e,t){(e!=="number"||gm(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Ju=Array.isArray;function Tc(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=Dd.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Mf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var nf={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},ED=["Webkit","ms","Moz","O"];Object.keys(nf).forEach(function(n){ED.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),nf[e]=nf[n]})});function HC(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||nf.hasOwnProperty(n)&&nf[n]?(""+e).trim():e+"px"}function WC(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=HC(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var TD=fn({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 sx(n,e){if(e){if(TD[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ee(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ee(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ee(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ee(62))}}function ox(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 ax=null;function hS(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var lx=null,bc=null,Cc=null;function sw(n){if(n=gh(n)){if(typeof lx!="function")throw Error(Ee(280));var e=n.stateNode;e&&(e=ug(e),lx(n.stateNode,n.type,e))}}function GC(n){bc?Cc?Cc.push(n):Cc=[n]:bc=n}function jC(){if(bc){var n=bc,e=Cc;if(Cc=bc=null,sw(n),e)for(n=0;n>>=0,n===0?32:31-(FD(n)/kD|0)|0}var Ud=64,Od=4194304;function Qu(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 _m(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=Qu(a):(s&=o,s!==0&&(i=Qu(s)))}else o=t&~r,o!==0?i=Qu(o):s!==0&&(i=Qu(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 ph(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-kr(e),n[e]=t}function HD(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=sf),pw=String.fromCharCode(32),mw=!1;function fP(n,e){switch(n){case"keyup":return gU.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hP(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var sc=!1;function yU(n,e){switch(n){case"compositionend":return hP(e);case"keypress":return e.which!==32?null:(mw=!0,pw);case"textInput":return n=e.data,n===pw&&mw?null:n;default:return null}}function xU(n,e){if(sc)return n==="compositionend"||!_S&&fP(n,e)?(n=cP(),Qp=vS=Eo=null,sc=!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=xw(t)}}function gP(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?gP(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function vP(){for(var n=window,e=gm();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=gm(n.document)}return e}function SS(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 CU(n){var e=vP(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&gP(t.ownerDocument.documentElement,t)){if(i!==null&&SS(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=_w(t,s);var o=_w(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,oc=null,px=null,af=null,mx=!1;function Sw(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;mx||oc==null||oc!==gm(i)||(i=oc,"selectionStart"in i&&SS(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}),af&&Pf(af,i)||(af=i,i=Mm(px,"onSelect"),0cc||(n.current=Sx[cc],Sx[cc]=null,cc--)}function jt(n,e){cc++,Sx[cc]=n.current,n.current=e}var Wo={},pi=Ko(Wo),Oi=Ko(!1),Za=Wo;function Dc(n,e){var t=n.type.contextTypes;if(!t)return Wo;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 Fi(n){return n=n.childContextTypes,n!=null}function Em(){Kt(Oi),Kt(pi)}function Cw(n,e,t){if(pi.current!==Wo)throw Error(Ee(168));jt(pi,e),jt(Oi,t)}function TP(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(Ee(108,MD(n)||"Unknown",r));return fn({},t,i)}function Tm(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Wo,Za=pi.current,jt(pi,n),jt(Oi,Oi.current),!0}function Pw(n,e,t){var i=n.stateNode;if(!i)throw Error(Ee(169));t?(n=TP(n,e,Za),i.__reactInternalMemoizedMergedChildContext=n,Kt(Oi),Kt(pi),jt(pi,n)):Kt(Oi),jt(Oi,t)}var Ps=null,fg=!1,Iv=!1;function bP(n){Ps===null?Ps=[n]:Ps.push(n)}function zU(n){fg=!0,bP(n)}function Jo(){if(!Iv&&Ps!==null){Iv=!0;var n=0,e=zt;try{var t=Ps;for(zt=1;n>=o,r-=o,Is=1<<32-kr(e)+r|t<N?(C=L,L=null):C=L.sibling;var R=p(g,L,S[N],E);if(R===null){L===null&&(L=C);break}n&&L&&R.alternate===null&&e(g,L),_=s(R,_,N),b===null?P=R:b.sibling=R,b=R,L=C}if(N===S.length)return t(g,L),tn&&wa(g,N),P;if(L===null){for(;NN?(C=L,L=null):C=L.sibling;var F=p(g,L,R.value,E);if(F===null){L===null&&(L=C);break}n&&L&&F.alternate===null&&e(g,L),_=s(F,_,N),b===null?P=F:b.sibling=F,b=F,L=C}if(R.done)return t(g,L),tn&&wa(g,N),P;if(L===null){for(;!R.done;N++,R=S.next())R=d(g,R.value,E),R!==null&&(_=s(R,_,N),b===null?P=R:b.sibling=R,b=R);return tn&&wa(g,N),P}for(L=i(g,L);!R.done;N++,R=S.next())R=m(L,g,N,R.value,E),R!==null&&(n&&R.alternate!==null&&L.delete(R.key===null?N:R.key),_=s(R,_,N),b===null?P=R:b.sibling=R,b=R);return n&&L.forEach(function(K){return e(g,K)}),tn&&wa(g,N),P}function x(g,_,S,E){if(typeof S=="object"&&S!==null&&S.type===rc&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Id:e:{for(var P=S.key,b=_;b!==null;){if(b.key===P){if(P=S.type,P===rc){if(b.tag===7){t(g,b.sibling),_=r(b,S.props.children),_.return=g,g=_;break e}}else if(b.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===xo&&Ow(P)===b.type){t(g,b.sibling),_=r(b,S.props),_.ref=Pu(g,b,S),_.return=g,g=_;break e}t(g,b);break}else e(g,b);b=b.sibling}S.type===rc?(_=Wa(S.props.children,g.mode,E,S.key),_.return=g,g=_):(E=om(S.type,S.key,S.props,null,g.mode,E),E.ref=Pu(g,_,S),E.return=g,g=E)}return o(g);case ic:e:{for(b=S.key;_!==null;){if(_.key===b)if(_.tag===4&&_.stateNode.containerInfo===S.containerInfo&&_.stateNode.implementation===S.implementation){t(g,_.sibling),_=r(_,S.children||[]),_.return=g,g=_;break e}else{t(g,_);break}else e(g,_);_=_.sibling}_=zv(S,g.mode,E),_.return=g,g=_}return o(g);case xo:return b=S._init,x(g,_,b(S._payload),E)}if(Ju(S))return y(g,_,S,E);if(wu(S))return A(g,_,S,E);Wd(g,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,_!==null&&_.tag===6?(t(g,_.sibling),_=r(_,S),_.return=g,g=_):(t(g,_),_=Bv(S,g.mode,E),_.return=g,g=_),o(g)):t(g,_)}return x}var Oc=UP(!0),OP=UP(!1),vh={},os=Ko(vh),Nf=Ko(vh),Df=Ko(vh);function Ua(n){if(n===vh)throw Error(Ee(174));return n}function RS(n,e){switch(jt(Df,e),jt(Nf,n),jt(os,vh),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:rx(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=rx(e,n)}Kt(os),jt(os,e)}function Fc(){Kt(os),Kt(Nf),Kt(Df)}function FP(n){Ua(Df.current);var e=Ua(os.current),t=rx(e,n.type);e!==t&&(jt(Nf,n),jt(os,t))}function LS(n){Nf.current===n&&(Kt(os),Kt(Nf))}var on=Ko(0);function Im(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 Nv=[];function IS(){for(var n=0;nt?t:4,n(!0);var i=Dv.transition;Dv.transition={};try{n(!1),e()}finally{zt=t,Dv.transition=i}}function $P(){return Ar().memoizedState}function GU(n,e,t){var i=Do(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},eR(n))tR(e,t);else if(t=LP(n,e,t,i),t!==null){var r=Ai();Br(t,n,i,r),nR(t,e,i)}}function jU(n,e,t){var i=Do(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(eR(n))tR(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,zr(a,o)){var l=e.interleaved;l===null?(r.next=r,CS(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=LP(n,e,r,i),t!==null&&(r=Ai(),Br(t,n,i,r),nR(t,e,i))}}function eR(n){var e=n.alternate;return n===cn||e!==null&&e===cn}function tR(n,e){lf=Nm=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function nR(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,pS(n,t)}}var Dm={readContext:Sr,useCallback:ri,useContext:ri,useEffect:ri,useImperativeHandle:ri,useInsertionEffect:ri,useLayoutEffect:ri,useMemo:ri,useReducer:ri,useRef:ri,useState:ri,useDebugValue:ri,useDeferredValue:ri,useTransition:ri,useMutableSource:ri,useSyncExternalStore:ri,useId:ri,unstable_isNewReconciler:!1},XU={readContext:Sr,useCallback:function(n,e){return ts().memoizedState=[n,e===void 0?null:e],n},useContext:Sr,useEffect:kw,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,nm(4194308,4,qP.bind(null,e,n),t)},useLayoutEffect:function(n,e){return nm(4194308,4,n,e)},useInsertionEffect:function(n,e){return nm(4,2,n,e)},useMemo:function(n,e){var t=ts();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=ts();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=GU.bind(null,cn,n),[i.memoizedState,n]},useRef:function(n){var e=ts();return n={current:n},e.memoizedState=n},useState:Fw,useDebugValue:FS,useDeferredValue:function(n){return ts().memoizedState=n},useTransition:function(){var n=Fw(!1),e=n[0];return n=WU.bind(null,n[1]),ts().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=cn,r=ts();if(tn){if(t===void 0)throw Error(Ee(407));t=t()}else{if(t=e(),jn===null)throw Error(Ee(349));Ja&30||zP(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,kw(HP.bind(null,i,s,n),[n]),i.flags|=2048,Ff(9,VP.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=ts(),e=jn.identifierPrefix;if(tn){var t=Ns,i=Is;t=(i&~(1<<32-kr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Uf++,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[rs]=e,n[If]=i,fR(n,e,!1,!1),e.stateNode=n;e:{switch(o=ox(t,i),t){case"dialog":qt("cancel",n),qt("close",n),r=i;break;case"iframe":case"object":case"embed":qt("load",n),r=i;break;case"video":case"audio":for(r=0;r<$u.length;r++)qt($u[r],n);r=i;break;case"source":qt("error",n),r=i;break;case"img":case"image":case"link":qt("error",n),qt("load",n),r=i;break;case"details":qt("toggle",n),r=i;break;case"input":tw(n,i),r=ex(n,i),qt("invalid",n);break;case"option":r=i;break;case"select":n._wrapperState={wasMultiple:!!i.multiple},r=fn({},i,{value:void 0}),qt("invalid",n);break;case"textarea":iw(n,i),r=ix(n,i),qt("invalid",n);break;default:r=i}sx(t,r),a=r;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?WC(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&VC(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&Mf(n,l):typeof l=="number"&&Mf(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Af.hasOwnProperty(s)?l!=null&&s==="onScroll"&&qt("scroll",n):l!=null&&lS(n,s,l,o))}switch(t){case"input":Nd(n),nw(n,i,!1);break;case"textarea":Nd(n),rw(n);break;case"option":i.value!=null&&n.setAttribute("value",""+Ho(i.value));break;case"select":n.multiple=!!i.multiple,s=i.value,s!=null?Tc(n,!!i.multiple,s,!1):i.defaultValue!=null&&Tc(n,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(n.onclick=wm)}switch(t){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return si(e),null;case 6:if(n&&e.stateNode!=null)dR(n,e,n.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Ee(166));if(t=Ua(Df.current),Ua(os.current),Hd(e)){if(i=e.stateNode,t=e.memoizedProps,i[rs]=e,(s=i.nodeValue!==t)&&(n=Qi,n!==null))switch(n.tag){case 3:Vd(i.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Vd(i.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else i=(t.nodeType===9?t:t.ownerDocument).createTextNode(i),i[rs]=e,e.stateNode=i}return si(e),null;case 13:if(Kt(on),i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(tn&&Ji!==null&&e.mode&1&&!(e.flags&128))RP(),Uc(),e.flags|=98560,s=!1;else if(s=Hd(e),i!==null&&i.dehydrated!==null){if(n===null){if(!s)throw Error(Ee(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Ee(317));s[rs]=e}else Uc(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;si(e),s=!1}else Ir!==null&&(zx(Ir),Ir=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(i=i!==null,i!==(n!==null&&n.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(n===null||on.current&1?Un===0&&(Un=3):GS())),e.updateQueue!==null&&(e.flags|=4),si(e),null);case 4:return Fc(),Ix(n,e),n===null&&Rf(e.stateNode.containerInfo),si(e),null;case 10:return bS(e.type._context),si(e),null;case 17:return Fi(e.type)&&Em(),si(e),null;case 19:if(Kt(on),s=e.memoizedState,s===null)return si(e),null;if(i=(e.flags&128)!==0,o=s.rendering,o===null)if(i)Ru(s,!1);else{if(Un!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=Im(n),o!==null){for(e.flags|=128,Ru(s,!1),i=o.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=t,t=e.child;t!==null;)s=t,n=i,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return jt(on,on.current&1|2),e.child}n=n.sibling}s.tail!==null&&Mn()>Bc&&(e.flags|=128,i=!0,Ru(s,!1),e.lanes=4194304)}else{if(!i)if(n=Im(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ru(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!tn)return si(e),null}else 2*Mn()-s.renderingStartTime>Bc&&t!==1073741824&&(e.flags|=128,i=!0,Ru(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=Mn(),e.sibling=null,t=on.current,jt(on,i?t&1|2:t&1),e):(si(e),null);case 22:case 23:return WS(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?qi&1073741824&&(si(e),e.subtreeFlags&6&&(e.flags|=8192)):si(e),null;case 24:return null;case 25:return null}throw Error(Ee(156,e.tag))}function eO(n,e){switch(MS(e),e.tag){case 1:return Fi(e.type)&&Em(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Fc(),Kt(Oi),Kt(pi),IS(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return LS(e),null;case 13:if(Kt(on),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ee(340));Uc()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Kt(on),null;case 4:return Fc(),null;case 10:return bS(e.type._context),null;case 22:case 23:return WS(),null;case 24:return null;default:return null}}var jd=!1,ui=!1,tO=typeof WeakSet=="function"?WeakSet:Set,je=null;function dc(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){mn(n,e,i)}else t.current=null}function Nx(n,e,t){try{t()}catch(i){mn(n,e,i)}}var Yw=!1;function nO(n,e){if(gx=Sm,n=vP(),SS(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,l=-1,f=0,h=0,d=n,p=null;t:for(;;){for(var m;d!==t||r!==0&&d.nodeType!==3||(a=o+r),d!==s||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===n)break t;if(p===t&&++f===r&&(a=o),p===s&&++h===i&&(l=o),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(vx={focusedElem:n,selectionRange:t},Sm=!1,je=e;je!==null;)if(e=je,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,je=n;else for(;je!==null;){e=je;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 A=y.memoizedProps,x=y.memoizedState,g=e.stateNode,_=g.getSnapshotBeforeUpdate(e.elementType===e.type?A:Pr(e.type,A),x);g.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ee(163))}}catch(E){mn(e,e.return,E)}if(n=e.sibling,n!==null){n.return=e.return,je=n;break}je=e.return}return y=Yw,Yw=!1,y}function cf(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&&Nx(e,t,s)}r=r.next}while(r!==i)}}function pg(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 Dx(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 pR(n){var e=n.alternate;e!==null&&(n.alternate=null,pR(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[rs],delete e[If],delete e[_x],delete e[kU],delete e[BU])),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 mR(n){return n.tag===5||n.tag===3||n.tag===4}function qw(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||mR(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 Ux(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=wm));else if(i!==4&&(n=n.child,n!==null))for(Ux(n,e,t),n=n.sibling;n!==null;)Ux(n,e,t),n=n.sibling}function Ox(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(Ox(n,e,t),n=n.sibling;n!==null;)Ox(n,e,t),n=n.sibling}var Kn=null,Lr=!1;function ao(n,e,t){for(t=t.child;t!==null;)gR(n,e,t),t=t.sibling}function gR(n,e,t){if(ss&&typeof ss.onCommitFiberUnmount=="function")try{ss.onCommitFiberUnmount(og,t)}catch{}switch(t.tag){case 5:ui||dc(t,e);case 6:var i=Kn,r=Lr;Kn=null,ao(n,e,t),Kn=i,Lr=r,Kn!==null&&(Lr?(n=Kn,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Kn.removeChild(t.stateNode));break;case 18:Kn!==null&&(Lr?(n=Kn,t=t.stateNode,n.nodeType===8?Lv(n.parentNode,t):n.nodeType===1&&Lv(n,t),bf(n)):Lv(Kn,t.stateNode));break;case 4:i=Kn,r=Lr,Kn=t.stateNode.containerInfo,Lr=!0,ao(n,e,t),Kn=i,Lr=r;break;case 0:case 11:case 14:case 15:if(!ui&&(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)&&Nx(t,e,o),r=r.next}while(r!==i)}ao(n,e,t);break;case 1:if(!ui&&(dc(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){mn(t,e,a)}ao(n,e,t);break;case 21:ao(n,e,t);break;case 22:t.mode&1?(ui=(i=ui)||t.memoizedState!==null,ao(n,e,t),ui=i):ao(n,e,t);break;default:ao(n,e,t)}}function Zw(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new tO),e.forEach(function(i){var r=fO.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function Er(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=Mn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*rO(i/1960))-i,10n?16:n,To===null)var i=!1;else{if(n=To,To=null,Fm=0,Nt&6)throw Error(Ee(331));var r=Nt;for(Nt|=4,je=n.current;je!==null;){var s=je,o=s.child;if(je.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lMn()-VS?Ha(n,0):zS|=t),ki(n,e)}function wR(n,e){e===0&&(n.mode&1?(e=Od,Od<<=1,!(Od&130023424)&&(Od=4194304)):e=1);var t=Ai();n=Ws(n,e),n!==null&&(ph(n,e,t),ki(n,t))}function uO(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),wR(n,t)}function fO(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(Ee(314))}i!==null&&i.delete(e),wR(n,t)}var ER;ER=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Oi.current)Ui=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Ui=!1,QU(n,e,t);Ui=!!(n.flags&131072)}else Ui=!1,tn&&e.flags&1048576&&CP(e,Cm,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;im(n,e),n=e.pendingProps;var r=Dc(e,pi.current);Rc(e,t),r=DS(null,e,i,n,r,t);var s=US();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,Fi(i)?(s=!0,Tm(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,PS(e),r.updater=hg,e.stateNode=r,r._reactInternals=e,Tx(e,i,n,t),e=Px(null,e,i,!0,s,t)):(e.tag=0,tn&&s&&AS(e),_i(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(im(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=dO(i),n=Pr(i,n),r){case 0:e=Cx(null,e,i,n,t);break e;case 1:e=Gw(null,e,i,n,t);break e;case 11:e=Hw(null,e,i,n,t);break e;case 14:e=Ww(null,e,i,Pr(i.type,n),t);break e}throw Error(Ee(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Pr(i,r),Cx(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Pr(i,r),Gw(n,e,i,r,t);case 3:e:{if(lR(e),n===null)throw Error(Ee(387));i=e.pendingProps,s=e.memoizedState,r=s.element,IP(n,e),Lm(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=kc(Error(Ee(423)),e),e=jw(n,e,i,t,r);break e}else if(i!==r){r=kc(Error(Ee(424)),e),e=jw(n,e,i,t,r);break e}else for(Ji=Lo(e.stateNode.containerInfo.firstChild),Qi=e,tn=!0,Ir=null,t=OP(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Uc(),i===r){e=Gs(n,e,t);break e}_i(n,e,i,t)}e=e.child}return e;case 5:return FP(e),n===null&&Mx(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,yx(i,r)?o=null:s!==null&&yx(i,s)&&(e.flags|=32),aR(n,e),_i(n,e,o,t),e.child;case 6:return n===null&&Mx(e),null;case 13:return cR(n,e,t);case 4:return RS(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Oc(e,null,i,t):_i(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Pr(i,r),Hw(n,e,i,r,t);case 7:return _i(n,e,e.pendingProps,t),e.child;case 8:return _i(n,e,e.pendingProps.children,t),e.child;case 12:return _i(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,jt(Pm,i._currentValue),i._currentValue=o,s!==null)if(zr(s.value,o)){if(s.children===r.children&&!Oi.current){e=Gs(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 l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Fs(-1,t&-t),l.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?l.next=l:(l.next=h.next,h.next=l),f.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),wx(s.return,t,e),a.lanes|=t;break}l=l.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(Ee(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),wx(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}_i(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Rc(e,t),r=Sr(r),i=i(r),e.flags|=1,_i(n,e,i,t),e.child;case 14:return i=e.type,r=Pr(i,e.pendingProps),r=Pr(i.type,r),Ww(n,e,i,r,t);case 15:return sR(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Pr(i,r),im(n,e),e.tag=1,Fi(i)?(n=!0,Tm(e)):n=!1,Rc(e,t),DP(e,i,r),Tx(e,i,r,t),Px(null,e,i,!0,n,t);case 19:return uR(n,e,t);case 22:return oR(n,e,t)}throw Error(Ee(156,e.tag))};function TR(n,e){return QC(n,e)}function hO(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 xr(n,e,t,i){return new hO(n,e,t,i)}function jS(n){return n=n.prototype,!(!n||!n.isReactComponent)}function dO(n){if(typeof n=="function")return jS(n)?1:0;if(n!=null){if(n=n.$$typeof,n===uS)return 11;if(n===fS)return 14}return 2}function Uo(n,e){var t=n.alternate;return t===null?(t=xr(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 om(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")jS(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case rc:return Wa(t.children,r,s,e);case cS:o=8,r|=8;break;case Ky:return n=xr(12,t,e,r|2),n.elementType=Ky,n.lanes=s,n;case Jy:return n=xr(13,t,e,r),n.elementType=Jy,n.lanes=s,n;case Qy:return n=xr(19,t,e,r),n.elementType=Qy,n.lanes=s,n;case UC:return gg(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case NC:o=10;break e;case DC:o=9;break e;case uS:o=11;break e;case fS:o=14;break e;case xo:o=16,i=null;break e}throw Error(Ee(130,n==null?n:typeof n,""))}return e=xr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Wa(n,e,t,i){return n=xr(7,n,i,e),n.lanes=t,n}function gg(n,e,t,i){return n=xr(22,n,i,e),n.elementType=UC,n.lanes=t,n.stateNode={isHidden:!1},n}function Bv(n,e,t){return n=xr(6,n,null,e),n.lanes=t,n}function zv(n,e,t){return e=xr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function pO(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=_v(0),this.expirationTimes=_v(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_v(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function XS(n,e,t,i,r,s,o,a,l){return n=new pO(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=xr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},PS(s),n}function mO(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RR)}catch(n){console.error(n)}}RR(),CC.exports=nr;var _O=CC.exports,LR,iE=_O;LR=qy.createRoot=iE.createRoot,qy.hydrateRoot=iE.hydrateRoot;/** + * @remix-run/router v1.14.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Bf(){return Bf=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function KS(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function AO(){return Math.random().toString(36).substr(2,8)}function sE(n,e){return{usr:n.state,key:n.key,idx:e}}function Vx(n,e,t,i){return t===void 0&&(t=null),Bf({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Jc(e):e,{state:t,key:e&&e.key||i||AO()})}function zm(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Jc(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function MO(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=bo.Pop,l=null,f=h();f==null&&(f=0,o.replaceState(Bf({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function d(){a=bo.Pop;let x=h(),g=x==null?null:x-f;f=x,l&&l({action:a,location:A.location,delta:g})}function p(x,g){a=bo.Push;let _=Vx(A.location,x,g);t&&t(_,x),f=h()+1;let S=sE(_,f),E=A.createHref(_);try{o.pushState(S,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;r.location.assign(E)}s&&l&&l({action:a,location:A.location,delta:1})}function m(x,g){a=bo.Replace;let _=Vx(A.location,x,g);t&&t(_,x),f=h();let S=sE(_,f),E=A.createHref(_);o.replaceState(S,"",E),s&&l&&l({action:a,location:A.location,delta:0})}function y(x){let g=r.location.origin!=="null"?r.location.origin:r.location.href,_=typeof x=="string"?x:zm(x);return Ln(g,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,g)}let A={get action(){return a},get location(){return n(r,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(rE,d),l=x,()=>{r.removeEventListener(rE,d),l=null}},createHref(x){return e(r,x)},createURL:y,encodeLocation(x){let g=y(x);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:m,go(x){return o.go(x)}};return A}var oE;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(oE||(oE={}));function wO(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?Jc(e):e,r=JS(i.pathname||"/",t);if(r==null)return null;let s=IR(n);EO(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Ln(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let f=Oo([i,l.relativePath]),h=t.concat(l);s.children&&s.children.length>0&&(Ln(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),IR(s.children,e,h,f)),!(s.path==null&&!s.index)&&e.push({path:f,score:IO(f,s.index),routesMeta:h})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))r(s,o);else for(let l of NR(s.path))r(s,o,l)}),e}function NR(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=NR(i.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),r&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function EO(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:NO(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const TO=/^:\w+$/,bO=3,CO=2,PO=1,RO=10,LO=-2,aE=n=>n==="*";function IO(n,e){let t=n.split("/"),i=t.length;return t.some(aE)&&(i+=LO),e&&(i+=CO),t.filter(r=>!aE(r)).reduce((r,s)=>r+(TO.test(s)?bO:s===""?PO:RO),i)}function NO(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function DO(n,e){let{routesMeta:t}=n,i={},r="/",s=[];for(let o=0;o{let{paramName:p,isOptional:m}=h;if(p==="*"){let A=a[d]||"";o=s.slice(0,s.length-A.length).replace(/(.)\/+$/,"$1")}const y=a[d];return m&&!y?f[p]=void 0:f[p]=kO(y||"",p),f},{}),pathname:s,pathnameBase:o,pattern:n}}function OO(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),KS(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(o,a,l)=>(i.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function FO(n){try{return decodeURI(n)}catch(e){return KS(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function kO(n,e){try{return decodeURIComponent(n)}catch(t){return KS(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),n}}function JS(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function BO(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?Jc(n):n;return{pathname:t?t.startsWith("/")?t:zO(t,e):e,search:WO(i),hash:GO(r)}}function zO(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function Vv(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function VO(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function DR(n,e){let t=VO(n);return e?t.map((i,r)=>r===n.length-1?i.pathname:i.pathnameBase):t.map(i=>i.pathnameBase)}function UR(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=Jc(n):(r=Bf({},n),Ln(!r.pathname||!r.pathname.includes("?"),Vv("?","pathname","search",r)),Ln(!r.pathname||!r.pathname.includes("#"),Vv("#","pathname","hash",r)),Ln(!r.search||!r.search.includes("#"),Vv("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(o==null)a=t;else{let d=e.length-1;if(!i&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;r.pathname=p.join("/")}a=d>=0?e[d]:"/"}let l=BO(r,a),f=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(f||h)&&(l.pathname+="/"),l}const Oo=n=>n.join("/").replace(/\/\/+/g,"/"),HO=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),WO=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,GO=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function jO(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const OR=["post","put","patch","delete"];new Set(OR);const XO=["get",...OR];new Set(XO);/** + * React Router v6.21.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function zf(){return zf=Object.assign?Object.assign.bind():function(n){for(var e=1;e{a.current=!0}),V.useCallback(function(f,h){if(h===void 0&&(h={}),!a.current)return;if(typeof f=="number"){i.go(f);return}let d=UR(f,JSON.parse(o),s,h.relative==="path");n==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Oo([e,d.pathname])),(h.replace?i.replace:i.push)(d,h.state,h)},[e,i,o,s,n])}function BR(n,e){let{relative:t}=e===void 0?{}:e,{future:i}=V.useContext(ol),{matches:r}=V.useContext(al),{pathname:s}=Ag(),o=JSON.stringify(DR(r,i.v7_relativeSplatPath));return V.useMemo(()=>UR(n,JSON.parse(o),s,t==="path"),[n,o,s,t])}function JO(n,e){return QO(n,e)}function QO(n,e,t,i){yh()||Ln(!1);let{navigator:r}=V.useContext(ol),{matches:s}=V.useContext(al),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let f=Ag(),h;if(e){var d;let x=typeof e=="string"?Jc(e):e;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||Ln(!1),h=x}else h=f;let p=h.pathname||"/",m=l==="/"?p:p.slice(l.length)||"/",y=wO(n,{pathname:m}),A=iF(y&&y.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:Oo([l,r.encodeLocation?r.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:Oo([l,r.encodeLocation?r.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,t,i);return e&&A?V.createElement(Sg.Provider,{value:{location:zf({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:bo.Pop}},A):A}function $O(){let n=aF(),e=jO(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return V.createElement(V.Fragment,null,V.createElement("h2",null,"Unexpected Application Error!"),V.createElement("h3",{style:{fontStyle:"italic"}},e),t?V.createElement("pre",{style:r},t):null,s)}const eF=V.createElement($O,null);class tF extends V.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?V.createElement(al.Provider,{value:this.props.routeContext},V.createElement(FR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nF(n){let{routeContext:e,match:t,children:i}=n,r=V.useContext(QS);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),V.createElement(al.Provider,{value:e},i)}function iF(n,e,t,i){var r;if(e===void 0&&(e=[]),t===void 0&&(t=null),i===void 0&&(i=null),n==null){var s;if((s=t)!=null&&s.errors)n=t.matches;else return null}let o=n,a=(r=t)==null?void 0:r.errors;if(a!=null){let h=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id]));h>=0||Ln(!1),o=o.slice(0,Math.min(o.length,h+1))}let l=!1,f=-1;if(t&&i&&i.v7_partialHydration)for(let h=0;h=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,d,p)=>{let m,y=!1,A=null,x=null;t&&(m=a&&d.route.id?a[d.route.id]:void 0,A=d.route.errorElement||eF,l&&(f<0&&p===0?(cF("route-fallback",!1),y=!0,x=null):f===p&&(y=!0,x=d.route.hydrateFallbackElement||null)));let g=e.concat(o.slice(0,p+1)),_=()=>{let S;return m?S=A:y?S=x:d.route.Component?S=V.createElement(d.route.Component,null):d.route.element?S=d.route.element:S=h,V.createElement(nF,{match:d,routeContext:{outlet:h,matches:g,isDataRoute:t!=null},children:S})};return t&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?V.createElement(tF,{location:t.location,revalidation:t.revalidation,component:A,error:m,children:_(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):_()},null)}var zR=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(zR||{}),Vm=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(Vm||{});function rF(n){let e=V.useContext(QS);return e||Ln(!1),e}function sF(n){let e=V.useContext(YO);return e||Ln(!1),e}function oF(n){let e=V.useContext(al);return e||Ln(!1),e}function VR(n){let e=oF(),t=e.matches[e.matches.length-1];return t.route.id||Ln(!1),t.route.id}function aF(){var n;let e=V.useContext(FR),t=sF(Vm.UseRouteError),i=VR(Vm.UseRouteError);return e!==void 0?e:(n=t.errors)==null?void 0:n[i]}function lF(){let{router:n}=rF(zR.UseNavigateStable),e=VR(Vm.UseNavigateStable),t=V.useRef(!1);return kR(()=>{t.current=!0}),V.useCallback(function(r,s){s===void 0&&(s={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,zf({fromRouteId:e},s)))},[n,e])}const lE={};function cF(n,e,t){!e&&!lE[n]&&(lE[n]=!0)}function es(n){Ln(!1)}function uF(n){let{basename:e="/",children:t=null,location:i,navigationType:r=bo.Pop,navigator:s,static:o=!1,future:a}=n;yh()&&Ln(!1);let l=e.replace(/^\/*/,"/"),f=V.useMemo(()=>({basename:l,navigator:s,static:o,future:zf({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof i=="string"&&(i=Jc(i));let{pathname:h="/",search:d="",hash:p="",state:m=null,key:y="default"}=i,A=V.useMemo(()=>{let x=JS(h,l);return x==null?null:{location:{pathname:x,search:d,hash:p,state:m,key:y},navigationType:r}},[l,h,d,p,m,y,r]);return A==null?null:V.createElement(ol.Provider,{value:f},V.createElement(Sg.Provider,{children:t,value:A}))}function fF(n){let{children:e,location:t}=n;return JO(Hx(e),t)}new Promise(()=>{});function Hx(n,e){e===void 0&&(e=[]);let t=[];return V.Children.forEach(n,(i,r)=>{if(!V.isValidElement(i))return;let s=[...e,r];if(i.type===V.Fragment){t.push.apply(t,Hx(i.props.children,s));return}i.type!==es&&Ln(!1),!i.props.index||!i.props.children||Ln(!1);let o={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=Hx(i.props.children,s)),t.push(o)}),t}/** + * React Router DOM v6.21.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Wx(){return Wx=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}function dF(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function pF(n,e){return n.button===0&&(!e||e==="_self")&&!dF(n)}const mF=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],gF="startTransition",cE=uD[gF];function vF(n){let{basename:e,children:t,future:i,window:r}=n,s=V.useRef();s.current==null&&(s.current=SO({window:r,v5Compat:!0}));let o=s.current,[a,l]=V.useState({action:o.action,location:o.location}),{v7_startTransition:f}=i||{},h=V.useCallback(d=>{f&&cE?cE(()=>l(d)):l(d)},[l,f]);return V.useLayoutEffect(()=>o.listen(h),[o,h]),V.createElement(uF,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,future:i})}const yF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xF=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hv=V.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:f,preventScrollReset:h,unstable_viewTransition:d}=e,p=hF(e,mF),{basename:m}=V.useContext(ol),y,A=!1;if(typeof f=="string"&&xF.test(f)&&(y=f,yF))try{let S=new URL(window.location.href),E=f.startsWith("//")?new URL(S.protocol+f):new URL(f),P=JS(E.pathname,m);E.origin===S.origin&&P!=null?f=P+E.search+E.hash:A=!0}catch{}let x=qO(f,{relative:r}),g=_F(f,{replace:o,state:a,target:l,preventScrollReset:h,relative:r,unstable_viewTransition:d});function _(S){i&&i(S),S.defaultPrevented||g(S)}return V.createElement("a",Wx({},p,{href:y||x,onClick:A||s?i:_,ref:t,target:l}))});var uE;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(uE||(uE={}));var fE;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(fE||(fE={}));function _F(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,l=ZO(),f=Ag(),h=BR(n,{relative:o});return V.useCallback(d=>{if(pF(d,t)){d.preventDefault();let p=i!==void 0?i:zm(f)===zm(h);l(n,{replace:p,state:r,preventScrollReset:s,relative:o,unstable_viewTransition:a})}},[f,l,h,i,r,t,n,s,o,a])}const Qc="/portfolio-react-threejs/assets/anim-bg-41fcb528.gif",HR=V.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),Mg=V.createContext({}),$S=V.createContext(null),wg=typeof document<"u",SF=wg?V.useLayoutEffect:V.useEffect,WR=V.createContext({strict:!1}),e1=n=>n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),AF="framerAppearId",GR="data-"+e1(AF);function MF(n,e,t,i){const{visualElement:r}=V.useContext(Mg),s=V.useContext(WR),o=V.useContext($S),a=V.useContext(HR).reducedMotion,l=V.useRef();i=i||s.renderer,!l.current&&i&&(l.current=i(n,{visualState:e,parent:r,props:t,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const f=l.current;V.useInsertionEffect(()=>{f&&f.update(t,o)});const h=V.useRef(!!(t[GR]&&!window.HandoffComplete));return SF(()=>{f&&(f.render(),h.current&&f.animationState&&f.animationState.animateChanges())}),V.useEffect(()=>{f&&(f.updateFeatures(),!h.current&&f.animationState&&f.animationState.animateChanges(),h.current&&(h.current=!1,window.HandoffComplete=!0))}),f}function mc(n){return typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function wF(n,e,t){return V.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):mc(t)&&(t.current=i))},[e])}function Vf(n){return typeof n=="string"||Array.isArray(n)}function Eg(n){return typeof n=="object"&&typeof n.start=="function"}const t1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],n1=["initial",...t1];function Tg(n){return Eg(n.animate)||n1.some(e=>Vf(n[e]))}function jR(n){return!!(Tg(n)||n.variants)}function EF(n,e){if(Tg(n)){const{initial:t,animate:i}=n;return{initial:t===!1||Vf(t)?t:void 0,animate:Vf(i)?i:void 0}}return n.inherit!==!1?e:{}}function TF(n){const{initial:e,animate:t}=EF(n,V.useContext(Mg));return V.useMemo(()=>({initial:e,animate:t}),[hE(e),hE(t)])}function hE(n){return Array.isArray(n)?n.join(" "):n}const dE={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Hf={};for(const n in dE)Hf[n]={isEnabled:e=>dE[n].some(t=>!!e[t])};function bF(n){for(const e in n)Hf[e]={...Hf[e],...n[e]}}const XR=V.createContext({}),YR=V.createContext({}),CF=Symbol.for("motionComponentSymbol");function PF({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&bF(n);function s(a,l){let f;const h={...V.useContext(HR),...a,layoutId:RF(a)},{isStatic:d}=h,p=TF(a),m=i(a,d);if(!d&&wg){p.visualElement=MF(r,m,h,e);const y=V.useContext(YR),A=V.useContext(WR).strict;p.visualElement&&(f=p.visualElement.loadFeatures(h,A,n,y))}return V.createElement(Mg.Provider,{value:p},f&&p.visualElement?V.createElement(f,{visualElement:p.visualElement,...h}):null,t(r,a,wF(m,p.visualElement,l),m,d,p.visualElement))}const o=V.forwardRef(s);return o[CF]=r,o}function RF({layoutId:n}){const e=V.useContext(XR).id;return e&&n!==void 0?e+"-"+n:n}function LF(n){function e(i,r={}){return PF(n(i,r))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(i,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}const IF=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function i1(n){return typeof n!="string"||n.includes("-")?!1:!!(IF.indexOf(n)>-1||/[A-Z]/.test(n))}const Hm={};function NF(n){Object.assign(Hm,n)}const xh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ll=new Set(xh);function qR(n,{layout:e,layoutId:t}){return ll.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!Hm[n]||n==="opacity")}const Bi=n=>!!(n&&n.getVelocity),DF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},UF=xh.length;function OF(n,{enableHardwareAcceleration:e=!0,allowTransformNone:t=!0},i,r){let s="";for(let o=0;oe=>typeof e=="string"&&e.startsWith(n),KR=ZR("--"),Gx=ZR("var(--"),FF=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,kF=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Go=(n,e,t)=>Math.min(Math.max(t,n),e),cl={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},hf={...cl,transform:n=>Go(0,1,n)},qd={...cl,default:1},df=n=>Math.round(n*1e5)/1e5,bg=/(-)?([\d]*\.?[\d])+/g,JR=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,BF=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function _h(n){return typeof n=="string"}const Sh=n=>({test:e=>_h(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),yo=Sh("deg"),as=Sh("%"),ct=Sh("px"),zF=Sh("vh"),VF=Sh("vw"),pE={...as,parse:n=>as.parse(n)/100,transform:n=>as.transform(n*100)},mE={...cl,transform:Math.round},QR={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,radius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,size:ct,top:ct,right:ct,bottom:ct,left:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,rotate:yo,rotateX:yo,rotateY:yo,rotateZ:yo,scale:qd,scaleX:qd,scaleY:qd,scaleZ:qd,skew:yo,skewX:yo,skewY:yo,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:hf,originX:pE,originY:pE,originZ:ct,zIndex:mE,fillOpacity:hf,strokeOpacity:hf,numOctaves:mE};function r1(n,e,t,i){const{style:r,vars:s,transform:o,transformOrigin:a}=n;let l=!1,f=!1,h=!0;for(const d in e){const p=e[d];if(KR(d)){s[d]=p;continue}const m=QR[d],y=kF(p,m);if(ll.has(d)){if(l=!0,o[d]=y,!h)continue;p!==(m.default||0)&&(h=!1)}else d.startsWith("origin")?(f=!0,a[d]=y):r[d]=y}if(e.transform||(l||i?r.transform=OF(n.transform,t,h,i):r.transform&&(r.transform="none")),f){const{originX:d="50%",originY:p="50%",originZ:m=0}=a;r.transformOrigin=`${d} ${p} ${m}`}}const s1=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $R(n,e,t){for(const i in e)!Bi(e[i])&&!qR(i,t)&&(n[i]=e[i])}function HF({transformTemplate:n},e,t){return V.useMemo(()=>{const i=s1();return r1(i,e,{enableHardwareAcceleration:!t},n),Object.assign({},i.vars,i.style)},[e])}function WF(n,e,t){const i=n.style||{},r={};return $R(r,i,n),Object.assign(r,HF(n,e,t)),n.transformValues?n.transformValues(r):r}function GF(n,e,t){const i={},r=WF(n,e,t);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=r,i}const jF=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Wm(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||jF.has(n)}let e2=n=>!Wm(n);function XF(n){n&&(e2=e=>e.startsWith("on")?!Wm(e):n(e))}try{XF(require("@emotion/is-prop-valid").default)}catch{}function YF(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(e2(r)||t===!0&&Wm(r)||!e&&!Wm(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function gE(n,e,t){return typeof n=="string"?n:ct.transform(e+t*n)}function qF(n,e,t){const i=gE(e,n.x,n.width),r=gE(t,n.y,n.height);return`${i} ${r}`}const ZF={offset:"stroke-dashoffset",array:"stroke-dasharray"},KF={offset:"strokeDashoffset",array:"strokeDasharray"};function JF(n,e,t=1,i=0,r=!0){n.pathLength=1;const s=r?ZF:KF;n[s.offset]=ct.transform(-i);const o=ct.transform(e),a=ct.transform(t);n[s.array]=`${o} ${a}`}function o1(n,{attrX:e,attrY:t,attrScale:i,originX:r,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...f},h,d,p){if(r1(n,f,h,p),d){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:m,style:y,dimensions:A}=n;m.transform&&(A&&(y.transform=m.transform),delete m.transform),A&&(r!==void 0||s!==void 0||y.transform)&&(y.transformOrigin=qF(A,r!==void 0?r:.5,s!==void 0?s:.5)),e!==void 0&&(m.x=e),t!==void 0&&(m.y=t),i!==void 0&&(m.scale=i),o!==void 0&&JF(m,o,a,l,!1)}const t2=()=>({...s1(),attrs:{}}),a1=n=>typeof n=="string"&&n.toLowerCase()==="svg";function QF(n,e,t,i){const r=V.useMemo(()=>{const s=t2();return o1(s,e,{enableHardwareAcceleration:!1},a1(i),n.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};$R(s,n.style,n),r.style={...s,...r.style}}return r}function $F(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(i1(t)?QF:GF)(i,s,o,t),h={...YF(i,typeof t=="string",n),...l,ref:r},{children:d}=i,p=V.useMemo(()=>Bi(d)?d.get():d,[d]);return V.createElement(t,{...h,children:p})}}function n2(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const i2=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function r2(n,e,t,i){n2(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(i2.has(r)?r:e1(r),e.attrs[r])}function l1(n,e){const{style:t}=n,i={};for(const r in t)(Bi(t[r])||e.style&&Bi(e.style[r])||qR(r,n))&&(i[r]=t[r]);return i}function s2(n,e){const t=l1(n,e);for(const i in n)if(Bi(n[i])||Bi(e[i])){const r=xh.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;t[r]=n[i]}return t}function c1(n,e,t,i={},r={}){return typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),e}function ek(n){const e=V.useRef(null);return e.current===null&&(e.current=n()),e.current}const Gm=n=>Array.isArray(n),tk=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),nk=n=>Gm(n)?n[n.length-1]||0:n;function am(n){const e=Bi(n)?n.get():n;return tk(e)?e.toValue():e}function ik({scrapeMotionValuesFromProps:n,createRenderState:e,onMount:t},i,r,s){const o={latestValues:rk(i,r,s,n),renderState:e()};return t&&(o.mount=a=>t(i,a,o)),o}const o2=n=>(e,t)=>{const i=V.useContext(Mg),r=V.useContext($S),s=()=>ik(n,e,i,r);return t?s():ek(s)};function rk(n,e,t,i){const r={},s=i(n,{});for(const p in s)r[p]=am(s[p]);let{initial:o,animate:a}=n;const l=Tg(n),f=jR(n);e&&f&&!l&&n.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let h=t?t.initial===!1:!1;h=h||o===!1;const d=h?a:o;return d&&typeof d!="boolean"&&!Eg(d)&&(Array.isArray(d)?d:[d]).forEach(m=>{const y=c1(n,m);if(!y)return;const{transitionEnd:A,transition:x,...g}=y;for(const _ in g){let S=g[_];if(Array.isArray(S)){const E=h?S.length-1:0;S=S[E]}S!==null&&(r[_]=S)}for(const _ in A)r[_]=A[_]}),r}const vn=n=>n;class vE{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);t!==-1&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function sk(n){let e=new vE,t=new vE,i=0,r=!1,s=!1;const o=new WeakSet,a={schedule:(l,f=!1,h=!1)=>{const d=h&&r,p=d?e:t;return f&&o.add(l),p.add(l)&&d&&r&&(i=e.order.length),l},cancel:l=>{t.remove(l),o.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[e,t]=[t,e],t.clear(),i=e.order.length,i)for(let f=0;f(d[p]=sk(()=>t=!0),d),{}),o=d=>s[d].process(r),a=()=>{const d=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(d-r.timestamp,ok),1),r.timestamp=d,r.isProcessing=!0,Zd.forEach(o),r.isProcessing=!1,t&&e&&(i=!1,n(a))},l=()=>{t=!0,i=!0,r.isProcessing||n(a)};return{schedule:Zd.reduce((d,p)=>{const m=s[p];return d[p]=(y,A=!1,x=!1)=>(t||l(),m.schedule(y,A,x)),d},{}),cancel:d=>Zd.forEach(p=>s[p].cancel(d)),state:r,steps:s}}const{schedule:Jt,cancel:js,state:ci,steps:Wv}=ak(typeof requestAnimationFrame<"u"?requestAnimationFrame:vn,!0),lk={useVisualState:o2({scrapeMotionValuesFromProps:s2,createRenderState:t2,onMount:(n,e,{renderState:t,latestValues:i})=>{Jt.read(()=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}),Jt.render(()=>{o1(t,i,{enableHardwareAcceleration:!1},a1(e.tagName),n.transformTemplate),r2(e,t)})}})},ck={useVisualState:o2({scrapeMotionValuesFromProps:l1,createRenderState:s1})};function uk(n,{forwardMotionProps:e=!1},t,i){return{...i1(n)?lk:ck,preloadedFeatures:t,useRender:$F(e),createVisualElement:i,Component:n}}function Ds(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}const a2=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function Cg(n,e="page"){return{point:{x:n[e+"X"],y:n[e+"Y"]}}}const fk=n=>e=>a2(e)&&n(e,Cg(e));function ks(n,e,t,i){return Ds(n,e,fk(t),i)}const hk=(n,e)=>t=>e(n(t)),Fo=(...n)=>n.reduce(hk);function l2(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const yE=l2("dragHorizontal"),xE=l2("dragVertical");function c2(n){let e=!1;if(n==="y")e=xE();else if(n==="x")e=yE();else{const t=yE(),i=xE();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function u2(){const n=c2(!0);return n?(n(),!1):!0}class Qo{constructor(e){this.isMounted=!1,this.node=e}update(){}}function _E(n,e){const t="pointer"+(e?"enter":"leave"),i="onHover"+(e?"Start":"End"),r=(s,o)=>{if(s.type==="touch"||u2())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e),a[i]&&Jt.update(()=>a[i](s,o))};return ks(n.current,t,r,{passive:!n.getProps()[i]})}class dk extends Qo{mount(){this.unmount=Fo(_E(this.node,!0),_E(this.node,!1))}unmount(){}}class pk extends Qo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Fo(Ds(this.node.current,"focus",()=>this.onFocus()),Ds(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const f2=(n,e)=>e?n===e?!0:f2(n,e.parentElement):!1;function Gv(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,Cg(t))}class mk extends Qo{constructor(){super(...arguments),this.removeStartListeners=vn,this.removeEndListeners=vn,this.removeAccessibleListeners=vn,this.startPointerPress=(e,t)=>{if(this.removeEndListeners(),this.isPressing)return;const i=this.node.getProps(),s=ks(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:f,onTapCancel:h}=this.node.getProps();Jt.update(()=>{f2(this.node.current,a.target)?f&&f(a,l):h&&h(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=ks(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Fo(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Gv("up",(l,f)=>{const{onTap:h}=this.node.getProps();h&&Jt.update(()=>h(l,f))})};this.removeEndListeners(),this.removeEndListeners=Ds(this.node.current,"keyup",o),Gv("down",(a,l)=>{this.startPress(a,l)})},t=Ds(this.node.current,"keydown",e),i=()=>{this.isPressing&&Gv("cancel",(s,o)=>this.cancelPress(s,o))},r=Ds(this.node.current,"blur",i);this.removeAccessibleListeners=Fo(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&Jt.update(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!u2()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&Jt.update(()=>i(e,t))}mount(){const e=this.node.getProps(),t=ks(this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=Ds(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Fo(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const jx=new WeakMap,jv=new WeakMap,gk=n=>{const e=jx.get(n.target);e&&e(n)},vk=n=>{n.forEach(gk)};function yk({root:n,...e}){const t=n||document;jv.has(t)||jv.set(t,{});const i=jv.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(vk,{root:n,...e})),i[r]}function xk(n,e,t){const i=yk(e);return jx.set(n,t),i.observe(n),()=>{jx.delete(n),i.unobserve(n)}}const _k={some:0,all:1};class Sk extends Qo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:_k[r]},a=l=>{const{isIntersecting:f}=l;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:d}=this.node.getProps(),p=f?h:d;p&&p(l)};return xk(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(Ak(e,t))&&this.startObserver()}unmount(){}}function Ak({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const Mk={inView:{Feature:Sk},tap:{Feature:mk},focus:{Feature:pk},hover:{Feature:dk}};function h2(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;ie[i]=t.get()),e}function Ek(n){const e={};return n.values.forEach((t,i)=>e[i]=t.getVelocity()),e}function Pg(n,e,t){const i=n.getProps();return c1(i,e,t!==void 0?t:i.custom,wk(n),Ek(n))}let Tk=vn,u1=vn;const ko=n=>n*1e3,Bs=n=>n/1e3,bk={current:!1},d2=n=>Array.isArray(n)&&typeof n[0]=="number";function p2(n){return!!(!n||typeof n=="string"&&m2[n]||d2(n)||Array.isArray(n)&&n.every(p2))}const ef=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,m2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ef([0,.65,.55,1]),circOut:ef([.55,0,1,.45]),backIn:ef([.31,.01,.66,-.59]),backOut:ef([.33,1.53,.69,.99])};function g2(n){if(n)return d2(n)?ef(n):Array.isArray(n)?n.map(g2):m2[n]}function Ck(n,e,t,{delay:i=0,duration:r,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const f={[e]:t};l&&(f.offset=l);const h=g2(a);return Array.isArray(h)&&(f.easing=h),n.animate(f,{delay:i,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function Pk(n,{repeat:e,repeatType:t="loop"}){const i=e&&t!=="loop"&&e%2===1?0:n.length-1;return n[i]}const v2=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,Rk=1e-7,Lk=12;function Ik(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=v2(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>Rk&&++aIk(s,0,1,n,t);return s=>s===0||s===1?s:v2(r(s),e,i)}const Nk=Ah(.42,0,1,1),Dk=Ah(0,0,.58,1),y2=Ah(.42,0,.58,1),Uk=n=>Array.isArray(n)&&typeof n[0]!="number",x2=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,_2=n=>e=>1-n(1-e),f1=n=>1-Math.sin(Math.acos(n)),S2=_2(f1),Ok=x2(f1),A2=Ah(.33,1.53,.69,.99),h1=_2(A2),Fk=x2(h1),kk=n=>(n*=2)<1?.5*h1(n):.5*(2-Math.pow(2,-10*(n-1))),Bk={linear:vn,easeIn:Nk,easeInOut:y2,easeOut:Dk,circIn:f1,circInOut:Ok,circOut:S2,backIn:h1,backInOut:Fk,backOut:A2,anticipate:kk},SE=n=>{if(Array.isArray(n)){u1(n.length===4);const[e,t,i,r]=n;return Ah(e,t,i,r)}else if(typeof n=="string")return Bk[n];return n},d1=(n,e)=>t=>!!(_h(t)&&BF.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),M2=(n,e,t)=>i=>{if(!_h(i))return i;const[r,s,o,a]=i.match(bg);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},zk=n=>Go(0,255,n),Xv={...cl,transform:n=>Math.round(zk(n))},Oa={test:d1("rgb","red"),parse:M2("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+Xv.transform(n)+", "+Xv.transform(e)+", "+Xv.transform(t)+", "+df(hf.transform(i))+")"};function Vk(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Xx={test:d1("#"),parse:Vk,transform:Oa.transform},gc={test:d1("hsl","hue"),parse:M2("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+as.transform(df(e))+", "+as.transform(df(t))+", "+df(hf.transform(i))+")"},xi={test:n=>Oa.test(n)||Xx.test(n)||gc.test(n),parse:n=>Oa.test(n)?Oa.parse(n):gc.test(n)?gc.parse(n):Xx.parse(n),transform:n=>_h(n)?n:n.hasOwnProperty("red")?Oa.transform(n):gc.transform(n)},an=(n,e,t)=>-t*n+t*e+n;function Yv(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)*(2/3-t)*6:n}function Hk({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=Yv(l,a,n+1/3),s=Yv(l,a,n),o=Yv(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}const qv=(n,e,t)=>{const i=n*n;return Math.sqrt(Math.max(0,t*(e*e-i)+i))},Wk=[Xx,Oa,gc],Gk=n=>Wk.find(e=>e.test(n));function AE(n){const e=Gk(n);let t=e.parse(n);return e===gc&&(t=Hk(t)),t}const w2=(n,e)=>{const t=AE(n),i=AE(e),r={...t};return s=>(r.red=qv(t.red,i.red,s),r.green=qv(t.green,i.green,s),r.blue=qv(t.blue,i.blue,s),r.alpha=an(t.alpha,i.alpha,s),Oa.transform(r))};function jk(n){var e,t;return isNaN(n)&&_h(n)&&(((e=n.match(bg))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(JR))===null||t===void 0?void 0:t.length)||0)>0}const E2={regex:FF,countKey:"Vars",token:"${v}",parse:vn},T2={regex:JR,countKey:"Colors",token:"${c}",parse:xi.parse},b2={regex:bg,countKey:"Numbers",token:"${n}",parse:cl.parse};function Zv(n,{regex:e,countKey:t,token:i,parse:r}){const s=n.tokenised.match(e);s&&(n["num"+t]=s.length,n.tokenised=n.tokenised.replace(e,i),n.values.push(...s.map(r)))}function jm(n){const e=n.toString(),t={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return t.value.includes("var(--")&&Zv(t,E2),Zv(t,T2),Zv(t,b2),t}function C2(n){return jm(n).values}function P2(n){const{values:e,numColors:t,numVars:i,tokenised:r}=jm(n),s=e.length;return o=>{let a=r;for(let l=0;ltypeof n=="number"?0:n;function Yk(n){const e=C2(n);return P2(n)(e.map(Xk))}const jo={test:jk,parse:C2,createTransformer:P2,getAnimatableNone:Yk},R2=(n,e)=>t=>`${t>0?e:n}`;function L2(n,e){return typeof n=="number"?t=>an(n,e,t):xi.test(n)?w2(n,e):n.startsWith("var(")?R2(n,e):N2(n,e)}const I2=(n,e)=>{const t=[...n],i=t.length,r=n.map((s,o)=>L2(s,e[o]));return s=>{for(let o=0;o{const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=L2(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}},N2=(n,e)=>{const t=jo.createTransformer(e),i=jm(n),r=jm(e);return i.numVars===r.numVars&&i.numColors===r.numColors&&i.numNumbers>=r.numNumbers?Fo(I2(i.values,r.values),t):R2(n,e)},Wf=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},ME=(n,e)=>t=>an(n,e,t);function Zk(n){return typeof n=="number"?ME:typeof n=="string"?xi.test(n)?w2:N2:Array.isArray(n)?I2:typeof n=="object"?qk:ME}function Kk(n,e,t){const i=[],r=t||Zk(n[0]),s=n.length-1;for(let o=0;oe[0];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=Kk(e,i,r),a=o.length,l=f=>{let h=0;if(a>1)for(;hl(Go(n[0],n[s-1],f)):l}function Jk(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=Wf(0,e,i);n.push(an(t,1,r))}}function Qk(n){const e=[0];return Jk(e,n.length-1),e}function $k(n,e){return n.map(t=>t*e)}function eB(n,e){return n.map(()=>e||y2).splice(0,n.length-1)}function Xm({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=Uk(i)?i.map(SE):SE(i),s={done:!1,value:e[0]},o=$k(t&&t.length===e.length?t:Qk(e),n),a=D2(o,e,{ease:Array.isArray(r)?r:eB(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}function U2(n,e){return e?n*(1e3/e):0}const tB=5;function O2(n,e,t){const i=Math.max(e-tB,0);return U2(t-n(i),e-i)}const Kv=.001,nB=.01,wE=10,iB=.05,rB=1;function sB({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s;Tk(n<=ko(wE));let o=1-e;o=Go(iB,rB,o),n=Go(nB,wE,Bs(n)),o<1?(r=f=>{const h=f*o,d=h*n,p=h-t,m=Yx(f,o),y=Math.exp(-d);return Kv-p/m*y},s=f=>{const d=f*o*n,p=d*t+t,m=Math.pow(o,2)*Math.pow(f,2)*n,y=Math.exp(-d),A=Yx(Math.pow(f,2),o);return(-r(f)+Kv>0?-1:1)*((p-m)*y)/A}):(r=f=>{const h=Math.exp(-f*n),d=(f-t)*n+1;return-Kv+h*d},s=f=>{const h=Math.exp(-f*n),d=(t-f)*(n*n);return h*d});const a=5/n,l=aB(r,s,a);if(n=ko(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const f=Math.pow(l,2)*i;return{stiffness:f,damping:o*2*Math.sqrt(i*f),duration:n}}}const oB=12;function aB(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function uB(n){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...n};if(!EE(n,cB)&&EE(n,lB)){const t=sB(n);e={...e,...t,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}function F2({keyframes:n,restDelta:e,restSpeed:t,...i}){const r=n[0],s=n[n.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:f,velocity:h,duration:d,isResolvedFromDuration:p}=uB(i),m=h?-Bs(h):0,y=l/(2*Math.sqrt(a*f)),A=s-r,x=Bs(Math.sqrt(a/f)),g=Math.abs(A)<5;t||(t=g?.01:2),e||(e=g?.005:.5);let _;if(y<1){const S=Yx(x,y);_=E=>{const P=Math.exp(-y*x*E);return s-P*((m+y*x*A)/S*Math.sin(S*E)+A*Math.cos(S*E))}}else if(y===1)_=S=>s-Math.exp(-x*S)*(A+(m+x*A)*S);else{const S=x*Math.sqrt(y*y-1);_=E=>{const P=Math.exp(-y*x*E),b=Math.min(S*E,300);return s-P*((m+y*x*A)*Math.sinh(b)+S*A*Math.cosh(b))/S}}return{calculatedDuration:p&&d||null,next:S=>{const E=_(S);if(p)o.done=S>=d;else{let P=m;S!==0&&(y<1?P=O2(_,S,E):P=0);const b=Math.abs(P)<=t,L=Math.abs(s-E)<=e;o.done=b&&L}return o.value=o.done?s:E,o}}}function TE({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:f=.5,restSpeed:h}){const d=n[0],p={done:!1,value:d},m=N=>a!==void 0&&Nl,y=N=>a===void 0?l:l===void 0||Math.abs(a-N)-A*Math.exp(-N/i),S=N=>g+_(N),E=N=>{const C=_(N),R=S(N);p.done=Math.abs(C)<=f,p.value=p.done?g:R};let P,b;const L=N=>{m(p.value)&&(P=N,b=F2({keyframes:[p.value,y(p.value)],velocity:O2(S,N,p.value),damping:r,stiffness:s,restDelta:f,restSpeed:h}))};return L(0),{calculatedDuration:null,next:N=>{let C=!1;return!b&&P===void 0&&(C=!0,E(N),L(N)),P!==void 0&&N>P?b.next(N-P):(!C&&E(N),p)}}}const fB=n=>{const e=({timestamp:t})=>n(t);return{start:()=>Jt.update(e,!0),stop:()=>js(e),now:()=>ci.isProcessing?ci.timestamp:performance.now()}},bE=2e4;function CE(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=bE?1/0:e}const hB={decay:TE,inertia:TE,tween:Xm,keyframes:Xm,spring:F2};function Ym({autoplay:n=!0,delay:e=0,driver:t=fB,keyframes:i,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:f,onComplete:h,onUpdate:d,...p}){let m=1,y=!1,A,x;const g=()=>{x=new Promise(J=>{A=J})};g();let _;const S=hB[r]||Xm;let E;S!==Xm&&typeof i[0]!="number"&&(E=D2([0,100],i,{clamp:!1}),i=[0,100]);const P=S({...p,keyframes:i});let b;a==="mirror"&&(b=S({...p,keyframes:[...i].reverse(),velocity:-(p.velocity||0)}));let L="idle",N=null,C=null,R=null;P.calculatedDuration===null&&s&&(P.calculatedDuration=CE(P));const{calculatedDuration:F}=P;let K=1/0,le=1/0;F!==null&&(K=F+o,le=K*(s+1)-o);let H=0;const q=J=>{if(C===null)return;m>0&&(C=Math.min(C,J)),m<0&&(C=Math.min(J-le/m,C)),N!==null?H=N:H=Math.round(J-C)*m;const ie=H-e*(m>=0?1:-1),$=m>=0?ie<0:ie>le;H=Math.max(ie,0),L==="finished"&&N===null&&(H=le);let fe=H,ve=P;if(s){const nt=H/K;let Le=Math.floor(nt),Te=nt%1;!Te&&nt>=1&&(Te=1),Te===1&&Le--,Le=Math.min(Le,s+1);const W=!!(Le%2);W&&(a==="reverse"?(Te=1-Te,o&&(Te-=o/K)):a==="mirror"&&(ve=b));let ye=Go(0,1,Te);H>le&&(ye=a==="reverse"&&W?1:0),fe=ye*K}const be=$?{done:!1,value:i[0]}:ve.next(fe);E&&(be.value=E(be.value));let{done:Pe}=be;!$&&F!==null&&(Pe=m>=0?H>=le:H<=0);const Je=N===null&&(L==="finished"||L==="running"&&Pe);return d&&d(be.value),Je&&k(),be},ee=()=>{_&&_.stop(),_=void 0},oe=()=>{L="idle",ee(),A(),g(),C=R=null},k=()=>{L="finished",h&&h(),ee(),A()},j=()=>{if(y)return;_||(_=t(q));const J=_.now();l&&l(),N!==null?C=J-N:(!C||L==="finished")&&(C=J),L==="finished"&&g(),R=C,N=null,L="running",_.start()};n&&j();const Y={then(J,ie){return x.then(J,ie)},get time(){return Bs(H)},set time(J){J=ko(J),H=J,N!==null||!_||m===0?N=J:C=_.now()-J/m},get duration(){const J=P.calculatedDuration===null?CE(P):P.calculatedDuration;return Bs(J)},get speed(){return m},set speed(J){J===m||!_||(m=J,Y.time=Bs(H))},get state(){return L},play:j,pause:()=>{L="paused",N=H},stop:()=>{y=!0,L!=="idle"&&(L="idle",f&&f(),oe())},cancel:()=>{R!==null&&q(R),oe()},complete:()=>{L="finished"},sample:J=>(C=0,q(J))};return Y}function dB(n){let e;return()=>(e===void 0&&(e=n()),e)}const pB=dB(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),mB=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Kd=10,gB=2e4,vB=(n,e)=>e.type==="spring"||n==="backgroundColor"||!p2(e.ease);function yB(n,e,{onUpdate:t,onComplete:i,...r}){if(!(pB()&&mB.has(e)&&!r.repeatDelay&&r.repeatType!=="mirror"&&r.damping!==0&&r.type!=="inertia"))return!1;let o=!1,a,l;const f=()=>{l=new Promise(_=>{a=_})};f();let{keyframes:h,duration:d=300,ease:p,times:m}=r;if(vB(e,r)){const _=Ym({...r,repeat:0,delay:0});let S={done:!1,value:h[0]};const E=[];let P=0;for(;!S.done&&Py.cancel(),x=()=>{Jt.update(A),a(),f()};return y.onfinish=()=>{n.set(Pk(h,r)),i&&i(),x()},{then(_,S){return l.then(_,S)},attachTimeline(_){return y.timeline=_,y.onfinish=null,vn},get time(){return Bs(y.currentTime||0)},set time(_){y.currentTime=ko(_)},get speed(){return y.playbackRate},set speed(_){y.playbackRate=_},get duration(){return Bs(d)},play:()=>{o||(y.play(),js(A))},pause:()=>y.pause(),stop:()=>{if(o=!0,y.playState==="idle")return;const{currentTime:_}=y;if(_){const S=Ym({...r,autoplay:!1});n.setWithVelocity(S.sample(_-Kd).value,S.sample(_).value,Kd)}x()},complete:()=>y.finish(),cancel:x}}function xB({keyframes:n,delay:e,onUpdate:t,onComplete:i}){const r=()=>(t&&t(n[n.length-1]),i&&i(),{time:0,speed:1,duration:0,play:vn,pause:vn,stop:vn,then:s=>(s(),Promise.resolve()),cancel:vn,complete:vn});return e?Ym({keyframes:[0,1],duration:0,delay:e,onComplete:r}):r()}const _B={type:"spring",stiffness:500,damping:25,restSpeed:10},SB=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),AB={type:"keyframes",duration:.8},MB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wB=(n,{keyframes:e})=>e.length>2?AB:ll.has(n)?n.startsWith("scale")?SB(e[1]):_B:MB,qx=(n,e)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(jo.test(e)||e==="0")&&!e.startsWith("url(")),EB=new Set(["brightness","contrast","saturate","opacity"]);function TB(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(bg)||[];if(!i)return n;const r=t.replace(i,"");let s=EB.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const bB=/([a-z-]*)\(.*?\)/g,Zx={...jo,getAnimatableNone:n=>{const e=n.match(bB);return e?e.map(TB).join(" "):n}},CB={...QR,color:xi,backgroundColor:xi,outlineColor:xi,fill:xi,stroke:xi,borderColor:xi,borderTopColor:xi,borderRightColor:xi,borderBottomColor:xi,borderLeftColor:xi,filter:Zx,WebkitFilter:Zx},p1=n=>CB[n];function k2(n,e){let t=p1(n);return t!==Zx&&(t=jo),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const B2=n=>/^0[^.\s]+$/.test(n);function PB(n){if(typeof n=="number")return n===0;if(n!==null)return n==="none"||n==="0"||B2(n)}function RB(n,e,t,i){const r=qx(e,t);let s;Array.isArray(t)?s=[...t]:s=[null,t];const o=i.from!==void 0?i.from:n.get();let a;const l=[];for(let f=0;fr=>{const s=m1(i,n)||{},o=s.delay||i.delay||0;let{elapsed:a=0}=i;a=a-ko(o);const l=RB(e,n,t,s),f=l[0],h=l[l.length-1],d=qx(n,f),p=qx(n,h);let m={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:y=>{e.set(y),s.onUpdate&&s.onUpdate(y)},onComplete:()=>{r(),s.onComplete&&s.onComplete()}};if(LB(s)||(m={...m,...wB(n,m)}),m.duration&&(m.duration=ko(m.duration)),m.repeatDelay&&(m.repeatDelay=ko(m.repeatDelay)),!d||!p||bk.current||s.type===!1)return xB(m);if(!i.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const y=yB(e,n,m);if(y)return y}return Ym(m)};function qm(n){return!!(Bi(n)&&n.add)}const z2=n=>/^\-?\d*\.?\d+$/.test(n);function v1(n,e){n.indexOf(e)===-1&&n.push(e)}function y1(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class x1{constructor(){this.subscriptions=[]}add(e){return v1(this.subscriptions,e),()=>y1(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s!isNaN(parseFloat(n));class NB{constructor(e,t={}){this.version="10.16.16",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,r=!0)=>{this.prev=this.current,this.current=i;const{delta:s,timestamp:o}=ci;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,Jt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Jt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=IB(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new x1);const i=this.events[e].add(t);return e==="change"?()=>{i(),Jt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=e,this.timeDelta=i}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?U2(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zc(n,e){return new NB(n,e)}const V2=n=>e=>e.test(n),DB={test:n=>n==="auto",parse:n=>n},H2=[cl,ct,as,yo,VF,zF,DB],Iu=n=>H2.find(V2(n)),UB=[...H2,xi,jo],OB=n=>UB.find(V2(n));function FB(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,zc(t))}function kB(n,e){const t=Pg(n,e);let{transitionEnd:i={},transition:r={},...s}=t?n.makeTargetAnimatable(t,!1):{};s={...s,...i};for(const o in s){const a=nk(s[o]);FB(n,o,a)}}function BB(n,e,t){var i,r;const s=Object.keys(e).filter(a=>!n.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(d))),f.push(x)}return o&&Promise.all(f).then(()=>{o&&kB(n,o)}),f}function Kx(n,e,t={}){const i=Pg(n,e,t.custom);let{transition:r=n.getDefaultTransition()||{}}=i||{};t.transitionOverride&&(r=t.transitionOverride);const s=i?()=>Promise.all(W2(n,i,t)):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(l=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:d}=r;return GB(n,e,f+l,h,d,t)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,f]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>f())}else return Promise.all([s(),o(t.delay)])}function GB(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(f=0)=>f*i:(f=0)=>a-f*i;return Array.from(n.variantChildren).sort(jB).forEach((f,h)=>{f.notify("AnimationStart",e),o.push(Kx(f,e,{...s,delay:t+l(h)}).then(()=>f.notify("AnimationComplete",e)))}),Promise.all(o)}function jB(n,e){return n.sortNodePosition(e)}function XB(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>Kx(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=Kx(n,e,t);else{const r=typeof e=="function"?Pg(n,e,t.custom):e;i=Promise.all(W2(n,r,t))}return i.then(()=>n.notify("AnimationComplete",e))}const YB=[...t1].reverse(),qB=t1.length;function ZB(n){return e=>Promise.all(e.map(({animation:t,options:i})=>XB(n,t,i)))}function KB(n){let e=ZB(n);const t=QB();let i=!0;const r=(l,f)=>{const h=Pg(n,f);if(h){const{transition:d,transitionEnd:p,...m}=h;l={...l,...m,...p}}return l};function s(l){e=l(n)}function o(l,f){const h=n.getProps(),d=n.getVariantContext(!0)||{},p=[],m=new Set;let y={},A=1/0;for(let g=0;gA&&P;const R=Array.isArray(E)?E:[E];let F=R.reduce(r,{});b===!1&&(F={});const{prevResolvedValues:K={}}=S,le={...K,...F},H=q=>{C=!0,m.delete(q),S.needsAnimating[q]=!0};for(const q in le){const ee=F[q],oe=K[q];y.hasOwnProperty(q)||(ee!==oe?Gm(ee)&&Gm(oe)?!h2(ee,oe)||N?H(q):S.protectedKeys[q]=!0:ee!==void 0?H(q):m.add(q):ee!==void 0&&m.has(q)?H(q):S.protectedKeys[q]=!0)}S.prevProp=E,S.prevResolvedValues=F,S.isActive&&(y={...y,...F}),i&&n.blockInitialAnimation&&(C=!1),C&&!L&&p.push(...R.map(q=>({animation:q,options:{type:_,...l}})))}if(m.size){const g={};m.forEach(_=>{const S=n.getBaseTarget(_);S!==void 0&&(g[_]=S)}),p.push({animation:g})}let x=!!p.length;return i&&(h.initial===!1||h.initial===h.animate)&&!n.manuallyAnimateOnMount&&(x=!1),i=!1,x?e(p):Promise.resolve()}function a(l,f,h){var d;if(t[l].isActive===f)return Promise.resolve();(d=n.variantChildren)===null||d===void 0||d.forEach(m=>{var y;return(y=m.animationState)===null||y===void 0?void 0:y.setActive(l,f)}),t[l].isActive=f;const p=o(h,l);for(const m in t)t[m].protectedKeys={};return p}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t}}function JB(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!h2(e,n):!1}function da(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function QB(){return{animate:da(!0),whileInView:da(),whileHover:da(),whileTap:da(),whileDrag:da(),whileFocus:da(),exit:da()}}class $B extends Qo{constructor(e){super(e),e.animationState||(e.animationState=KB(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Eg(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}let ez=0;class tz extends Qo{constructor(){super(...arguments),this.id=ez++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:i}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e,{custom:i??this.node.getProps().custom});t&&!e&&s.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const nz={animation:{Feature:$B},exit:{Feature:tz}},PE=(n,e)=>Math.abs(n-e);function iz(n,e){const t=PE(n.x,e.x),i=PE(n.y,e.y);return Math.sqrt(t**2+i**2)}class G2{constructor(e,t,{transformPagePoint:i,contextWindow:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Qv(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,p=iz(h.offset,{x:0,y:0})>=3;if(!d&&!p)return;const{point:m}=h,{timestamp:y}=ci;this.history.push({...m,timestamp:y});const{onStart:A,onMove:x}=this.handlers;d||(A&&A(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,h)},this.handlePointerMove=(h,d)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Jv(d,this.transformPagePoint),Jt.update(this.updatePoint,!0)},this.handlePointerUp=(h,d)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:p,onSessionEnd:m}=this.handlers,y=Qv(h.type==="pointercancel"?this.lastMoveEventInfo:Jv(d,this.transformPagePoint),this.history);this.startEvent&&p&&p(h,y),m&&m(h,y)},!a2(e))return;this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const s=Cg(e),o=Jv(s,this.transformPagePoint),{point:a}=o,{timestamp:l}=ci;this.history=[{...a,timestamp:l}];const{onSessionStart:f}=t;f&&f(e,Qv(o,this.history)),this.removeListeners=Fo(ks(this.contextWindow,"pointermove",this.handlePointerMove),ks(this.contextWindow,"pointerup",this.handlePointerUp),ks(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),js(this.updatePoint)}}function Jv(n,e){return e?{point:e(n.point)}:n}function RE(n,e){return{x:n.x-e.x,y:n.y-e.y}}function Qv({point:n},e){return{point:n,delta:RE(n,j2(e)),offset:RE(n,rz(e)),velocity:sz(e,.1)}}function rz(n){return n[0]}function j2(n){return n[n.length-1]}function sz(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=j2(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>ko(e)));)t--;if(!i)return{x:0,y:0};const s=Bs(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function tr(n){return n.max-n.min}function Jx(n,e=0,t=.01){return Math.abs(n-e)<=t}function LE(n,e,t,i=.5){n.origin=i,n.originPoint=an(e.min,e.max,n.origin),n.scale=tr(t)/tr(e),(Jx(n.scale,1,1e-4)||isNaN(n.scale))&&(n.scale=1),n.translate=an(t.min,t.max,n.origin)-n.originPoint,(Jx(n.translate)||isNaN(n.translate))&&(n.translate=0)}function pf(n,e,t,i){LE(n.x,e.x,t.x,i?i.originX:void 0),LE(n.y,e.y,t.y,i?i.originY:void 0)}function IE(n,e,t){n.min=t.min+e.min,n.max=n.min+tr(e)}function oz(n,e,t){IE(n.x,e.x,t.x),IE(n.y,e.y,t.y)}function NE(n,e,t){n.min=e.min-t.min,n.max=n.min+tr(e)}function mf(n,e,t){NE(n.x,e.x,t.x),NE(n.y,e.y,t.y)}function az(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?an(t,n,i.max):Math.min(n,t)),n}function DE(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function lz(n,{top:e,left:t,bottom:i,right:r}){return{x:DE(n.x,t,r),y:DE(n.y,e,i)}}function UE(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=Wf(e.min,e.max-i,n.min):i>r&&(t=Wf(n.min,n.max-r,e.min)),Go(0,1,t)}function fz(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const Qx=.35;function hz(n=Qx){return n===!1?n=0:n===!0&&(n=Qx),{x:OE(n,"left","right"),y:OE(n,"top","bottom")}}function OE(n,e,t){return{min:FE(n,e),max:FE(n,t)}}function FE(n,e){return typeof n=="number"?n:n[e]||0}const kE=()=>({translate:0,scale:1,origin:0,originPoint:0}),vc=()=>({x:kE(),y:kE()}),BE=()=>({min:0,max:0}),Cn=()=>({x:BE(),y:BE()});function ns(n){return[n("x"),n("y")]}function X2({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function dz({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function pz(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function $v(n){return n===void 0||n===1}function $x({scale:n,scaleX:e,scaleY:t}){return!$v(n)||!$v(e)||!$v(t)}function Ta(n){return $x(n)||Y2(n)||n.z||n.rotate||n.rotateX||n.rotateY}function Y2(n){return zE(n.x)||zE(n.y)}function zE(n){return n&&n!=="0%"}function Zm(n,e,t){const i=n-t,r=e*i;return t+r}function VE(n,e,t,i,r){return r!==void 0&&(n=Zm(n,r,i)),Zm(n,t,i)+e}function e_(n,e=0,t=1,i,r){n.min=VE(n.min,e,t,i,r),n.max=VE(n.max,e,t,i,r)}function q2(n,{x:e,y:t}){e_(n.x,e.translate,e.scale,e.originPoint),e_(n.y,t.translate,t.scale,t.originPoint)}function mz(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;a1.0000000000001||n<.999999999999?n:1}function So(n,e){n.min=n.min+e,n.max=n.max+e}function WE(n,e,[t,i,r]){const s=e[r]!==void 0?e[r]:.5,o=an(n.min,n.max,s);e_(n,e[t],e[i],o,e.scale)}const gz=["x","scaleX","originX"],vz=["y","scaleY","originY"];function yc(n,e){WE(n.x,e,gz),WE(n.y,e,vz)}function Z2(n,e){return X2(pz(n.getBoundingClientRect(),e))}function yz(n,e,t){const i=Z2(n,t),{scroll:r}=e;return r&&(So(i.x,r.offset.x),So(i.y,r.offset.y)),i}const K2=({current:n})=>n?n.ownerDocument.defaultView:null,xz=new WeakMap;class _z{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Cn(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=l=>{this.stopAnimation(),t&&this.snapToCursor(Cg(l,"page").point)},s=(l,f)=>{const{drag:h,dragPropagation:d,onDragStart:p}=this.getProps();if(h&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=c2(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ns(y=>{let A=this.getAxisMotionValue(y).get()||0;if(as.test(A)){const{projection:x}=this.visualElement;if(x&&x.layout){const g=x.layout.layoutBox[y];g&&(A=tr(g)*(parseFloat(A)/100))}}this.originPoint[y]=A}),p&&Jt.update(()=>p(l,f),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(l,f)=>{const{dragPropagation:h,dragDirectionLock:d,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:y}=f;if(d&&this.currentDirection===null){this.currentDirection=Sz(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),m&&m(l,f)},a=(l,f)=>this.stop(l,f);this.panSession=new G2(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),contextWindow:K2(this.visualElement)})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Jt.update(()=>s(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!Jd(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=az(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;t&&mc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=lz(r.layoutBox,t):this.constraints=!1,this.elastic=hz(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ns(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=fz(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!mc(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=yz(i,r.root,this.visualElement.getTransformPagePoint());let o=cz(r.layout.layoutBox,s);if(t){const a=t(dz(o));this.hasMutatedConstraints=!!a,a&&(o=X2(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},f=ns(h=>{if(!Jd(h,t,this.currentDirection))return;let d=l&&l[h]||{};o&&(d={min:0,max:0});const p=r?200:1e6,m=r?40:1e7,y={type:"inertia",velocity:i?e[h]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(h,y)});return Promise.all(f).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(g1(e,i,0,t))}stopAnimation(){ns(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t="_drag"+e.toUpperCase(),i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){ns(t=>{const{drag:i}=this.getProps();if(!Jd(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-an(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!mc(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ns(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();r[o]=uz({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),ns(o=>{if(!Jd(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:f}=this.constraints[o];a.set(an(l,f,r[o]))})}addListeners(){if(!this.visualElement.current)return;xz.set(this.visualElement,this);const e=this.visualElement.current,t=ks(e,"pointerdown",l=>{const{drag:f,dragListener:h=!0}=this.getProps();f&&h&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();mc(l)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),i();const o=Ds(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f})=>{this.isDragging&&f&&(ns(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=Qx,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Jd(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function Sz(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class Az extends Qo{constructor(e){super(e),this.removeGroupControls=vn,this.removeListeners=vn,this.controls=new _z(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vn}unmount(){this.removeGroupControls(),this.removeListeners()}}const GE=n=>(e,t)=>{n&&Jt.update(()=>n(e,t))};class Mz extends Qo{constructor(){super(...arguments),this.removePointerDownListener=vn}onPointerDown(e){this.session=new G2(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:K2(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:GE(e),onStart:GE(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Jt.update(()=>r(s,o))}}}mount(){this.removePointerDownListener=ks(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function wz(){const n=V.useContext($S);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=V.useId();return V.useEffect(()=>i(r),[]),!e&&t?[!1,()=>t&&t(r)]:[!0]}const lm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function jE(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const Nu={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(ct.test(n))n=parseFloat(n);else return n;const t=jE(n,e.target.x),i=jE(n,e.target.y);return`${t}% ${i}%`}},Ez={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=jo.parse(n);if(r.length>5)return i;const s=jo.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const f=an(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=f),typeof r[3+o]=="number"&&(r[3+o]/=f),s(r)}};class Tz extends dh.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;NF(bz),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),lm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Jt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function J2(n){const[e,t]=wz(),i=V.useContext(XR);return dh.createElement(Tz,{...n,layoutGroup:i,switchLayoutGroup:V.useContext(YR),isPresent:e,safeToRemove:t})}const bz={borderRadius:{...Nu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Nu,borderTopRightRadius:Nu,borderBottomLeftRadius:Nu,borderBottomRightRadius:Nu,boxShadow:Ez},Q2=["TopLeft","TopRight","BottomLeft","BottomRight"],Cz=Q2.length,XE=n=>typeof n=="string"?parseFloat(n):n,YE=n=>typeof n=="number"||ct.test(n);function Pz(n,e,t,i,r,s){r?(n.opacity=an(0,t.opacity!==void 0?t.opacity:1,Rz(i)),n.opacityExit=an(e.opacity!==void 0?e.opacity:1,0,Lz(i))):s&&(n.opacity=an(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;oie?1:t(Wf(n,e,i))}function ZE(n,e){n.min=e.min,n.max=e.max}function mr(n,e){ZE(n.x,e.x),ZE(n.y,e.y)}function KE(n,e,t,i,r){return n-=e,n=Zm(n,1/t,i),r!==void 0&&(n=Zm(n,1/r,i)),n}function Iz(n,e=0,t=1,i=.5,r,s=n,o=n){if(as.test(e)&&(e=parseFloat(e),e=an(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=an(s.min,s.max,i);n===s&&(a-=e),n.min=KE(n.min,e,t,a,r),n.max=KE(n.max,e,t,a,r)}function JE(n,e,[t,i,r],s,o){Iz(n,e[t],e[i],e[r],e.scale,s,o)}const Nz=["x","scaleX","originX"],Dz=["y","scaleY","originY"];function QE(n,e,t,i){JE(n.x,e,Nz,t?t.x:void 0,i?i.x:void 0),JE(n.y,e,Dz,t?t.y:void 0,i?i.y:void 0)}function $E(n){return n.translate===0&&n.scale===1}function eL(n){return $E(n.x)&&$E(n.y)}function Uz(n,e){return n.x.min===e.x.min&&n.x.max===e.x.max&&n.y.min===e.y.min&&n.y.max===e.y.max}function tL(n,e){return Math.round(n.x.min)===Math.round(e.x.min)&&Math.round(n.x.max)===Math.round(e.x.max)&&Math.round(n.y.min)===Math.round(e.y.min)&&Math.round(n.y.max)===Math.round(e.y.max)}function eT(n){return tr(n.x)/tr(n.y)}class Oz{constructor(){this.members=[]}add(e){v1(this.members,e),e.scheduleRender()}remove(e){if(y1(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function tT(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y;if((r||s)&&(i=`translate3d(${r}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{rotate:l,rotateX:f,rotateY:h}=t;l&&(i+=`rotate(${l}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `)}const o=n.x.scale*e.x,a=n.y.scale*e.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const Fz=(n,e)=>n.depth-e.depth;class kz{constructor(){this.children=[],this.isDirty=!1}add(e){v1(this.children,e),this.isDirty=!0}remove(e){y1(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Fz),this.isDirty=!1,this.children.forEach(e)}}function Bz(n,e){const t=performance.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(js(i),n(s-e))};return Jt.read(i,!0),()=>js(i)}function zz(n){window.MotionDebug&&window.MotionDebug.record(n)}function Vz(n){return n instanceof SVGElement&&n.tagName!=="svg"}function Hz(n,e,t){const i=Bi(n)?n:zc(n);return i.start(g1("",i,e,t)),i.animation}const nT=["","X","Y","Z"],Wz={visibility:"hidden"},iT=1e3;let Gz=0;const ba={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nL({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Gz++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ba.totalNodes=ba.resolvedTargetDeltas=ba.recalculatedProjection=0,this.nodes.forEach(Yz),this.nodes.forEach(Qz),this.nodes.forEach($z),this.nodes.forEach(qz),zz(ba)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Bz(p,250),lm.hasAnimatedSinceResize&&(lm.hasAnimatedSinceResize=!1,this.nodes.forEach(sT))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&h&&(l||f)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeTargetChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||h.getDefaultTransition()||r4,{onLayoutAnimationStart:x,onLayoutAnimationComplete:g}=h.getProps(),_=!this.targetLayout||!tL(this.targetLayout,y)||m,S=!p&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||S||p&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,S);const E={...m1(A,"layout"),onPlay:x,onComplete:g};(h.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else p||sT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,js(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(e4),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;hthis.update()))}clearAllSnapshots(){this.nodes.forEach(Zz),this.sharedNodes.forEach(t4)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Jt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Jt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const P=E/1e3;oT(d.x,o.x,P),oT(d.y,o.y,P),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mf(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),n4(this.relativeTarget,this.relativeTargetOrigin,p,P),S&&Uz(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Cn()),mr(S,this.relativeTarget)),A&&(this.animationValues=h,Pz(h,f,this.latestValues,P,_,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(js(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Jt.update(()=>{lm.hasAnimatedSinceResize=!0,this.currentAnimation=Hz(0,iT,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(iT),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:f,latestValues:h}=o;if(!(!a||!l||!f)){if(this!==o&&this.layout&&f&&iL(this.options.animationType,this.layout.layoutBox,f.layoutBox)){l=this.target||Cn();const d=tr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const p=tr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}mr(a,l),yc(a,h),pf(this.projectionDeltaWithTransform,this.layoutCorrected,a,h)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Oz),this.sharedNodes.get(o).add(a);const f=a.options.initialPromotionConfig;a.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const f=this.getStack();f&&f.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const f={};for(let h=0;h{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(rT),this.root.sharedNodes.clear()}}}function jz(n){n.updateLayout()}function Xz(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?ns(d=>{const p=o?t.measuredBox[d]:t.layoutBox[d],m=tr(p);p.min=i[d].min,p.max=p.min+m}):iL(s,t.layoutBox,i)&&ns(d=>{const p=o?t.measuredBox[d]:t.layoutBox[d],m=tr(i[d]);p.max=p.min+m,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[d].max=n.relativeTarget[d].min+m)});const a=vc();pf(a,i,t.layoutBox);const l=vc();o?pf(l,n.applyTransform(r,!0),t.measuredBox):pf(l,i,t.layoutBox);const f=!eL(a);let h=!1;if(!n.resumeFrom){const d=n.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:m}=d;if(p&&m){const y=Cn();mf(y,t.layoutBox,p.layoutBox);const A=Cn();mf(A,i,m.layoutBox),tL(y,A)||(h=!0),d.options.layoutRoot&&(n.relativeTarget=A,n.relativeTargetOrigin=y,n.relativeParent=d)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:f,hasRelativeTargetChanged:h})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function Yz(n){ba.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function qz(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Zz(n){n.clearSnapshot()}function rT(n){n.clearMeasurements()}function Kz(n){n.isLayoutDirty=!1}function Jz(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function sT(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function Qz(n){n.resolveTargetDelta()}function $z(n){n.calcProjection()}function e4(n){n.resetRotation()}function t4(n){n.removeLeadSnapshot()}function oT(n,e,t){n.translate=an(e.translate,0,t),n.scale=an(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function aT(n,e,t,i){n.min=an(e.min,t.min,i),n.max=an(e.max,t.max,i)}function n4(n,e,t,i){aT(n.x,e.x,t.x,i),aT(n.y,e.y,t.y,i)}function i4(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const r4={duration:.45,ease:[.4,0,.1,1]},lT=n=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(n),cT=lT("applewebkit/")&&!lT("chrome/")?Math.round:vn;function uT(n){n.min=cT(n.min),n.max=cT(n.max)}function s4(n){uT(n.x),uT(n.y)}function iL(n,e,t){return n==="position"||n==="preserve-aspect"&&!Jx(eT(e),eT(t),.2)}const o4=nL({attachResizeListener:(n,e)=>Ds(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ey={current:void 0},rL=nL({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!ey.current){const n=new o4({});n.mount(window),n.setOptions({layoutScroll:!0}),ey.current=n}return ey.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),a4={pan:{Feature:Mz},drag:{Feature:Az,ProjectionNode:rL,MeasureLayout:J2}},l4=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function c4(n){const e=l4.exec(n);if(!e)return[,];const[,t,i]=e;return[t,i]}function t_(n,e,t=1){const[i,r]=c4(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return z2(o)?parseFloat(o):o}else return Gx(r)?t_(r,e,t+1):r}function u4(n,{...e},t){const i=n.current;if(!(i instanceof Element))return{target:e,transitionEnd:t};t&&(t={...t}),n.values.forEach(r=>{const s=r.get();if(!Gx(s))return;const o=t_(s,i);o&&r.set(o)});for(const r in e){const s=e[r];if(!Gx(s))continue;const o=t_(s,i);o&&(e[r]=o,t||(t={}),t[r]===void 0&&(t[r]=s))}return{target:e,transitionEnd:t}}const f4=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),sL=n=>f4.has(n),h4=n=>Object.keys(n).some(sL),fT=n=>n===cl||n===ct,hT=(n,e)=>parseFloat(n.split(", ")[e]),dT=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/);if(r)return hT(r[1],e);{const s=i.match(/^matrix\((.+)\)$/);return s?hT(s[1],n):0}},d4=new Set(["x","y","z"]),p4=xh.filter(n=>!d4.has(n));function m4(n){const e=[];return p4.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e.length&&n.render(),e}const Vc={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:dT(4,13),y:dT(5,14)};Vc.translateX=Vc.x;Vc.translateY=Vc.y;const g4=(n,e,t)=>{const i=e.measureViewportBox(),r=e.current,s=getComputedStyle(r),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",n.display||"block"),t.forEach(f=>{a[f]=Vc[f](i,s)}),e.render();const l=e.measureViewportBox();return t.forEach(f=>{const h=e.getValue(f);h&&h.jump(a[f]),n[f]=Vc[f](l,s)}),n},v4=(n,e,t={},i={})=>{e={...e},i={...i};const r=Object.keys(e).filter(sL);let s=[],o=!1;const a=[];if(r.forEach(l=>{const f=n.getValue(l);if(!n.hasValue(l))return;let h=t[l],d=Iu(h);const p=e[l];let m;if(Gm(p)){const y=p.length,A=p[0]===null?1:0;h=p[A],d=Iu(h);for(let x=A;x=0?window.pageYOffset:null,f=g4(e,n,a);return s.length&&s.forEach(([h,d])=>{n.getValue(h).set(d)}),n.render(),wg&&l!==null&&window.scrollTo({top:l}),{target:f,transitionEnd:i}}else return{target:e,transitionEnd:i}};function y4(n,e,t,i){return h4(e)?v4(n,e,t,i):{target:e,transitionEnd:i}}const x4=(n,e,t,i)=>{const r=u4(n,e,i);return e=r.target,i=r.transitionEnd,y4(n,e,t,i)},n_={current:null},oL={current:!1};function _4(){if(oL.current=!0,!!wg)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>n_.current=n.matches;n.addListener(e),e()}else n_.current=!1}function S4(n,e,t){const{willChange:i}=e;for(const r in e){const s=e[r],o=t[r];if(Bi(s))n.addValue(r,s),qm(i)&&i.add(r);else if(Bi(o))n.addValue(r,zc(s,{owner:n})),qm(i)&&i.remove(r);else if(o!==s)if(n.hasValue(r)){const a=n.getValue(r);!a.hasAnimated&&a.set(s)}else{const a=n.getStaticValue(r);n.addValue(r,zc(a!==void 0?a:s,{owner:n}))}}for(const r in t)e[r]===void 0&&n.removeValue(r);return e}const pT=new WeakMap,aL=Object.keys(Hf),A4=aL.length,mT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],M4=n1.length;class w4{constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Jt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=Tg(t),this.isVariantNode=jR(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(t,{});for(const d in h){const p=h[d];a[d]!==void 0&&Bi(p)&&(p.set(a[d],!1),qm(f)&&f.add(d))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,pT.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),oL.current||_4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:n_.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){pT.delete(this.current),this.projection&&this.projection.unmount(),js(this.notifyUpdate),js(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const i=ll.has(e),r=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Jt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...t},i,r,s){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof f=="string"?f:"both",initialPromotionConfig:s,layoutScroll:p,layoutRoot:m})}return a}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Cn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;it.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=zc(t,{owner:this}),this.addValue(e,i)),i}readValue(e){var t;return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(t=this.getBaseTargetFromProps(this.props,e))!==null&&t!==void 0?t:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props,r=typeof i=="string"||typeof i=="object"?(t=c1(this.props,i))===null||t===void 0?void 0:t[e]:void 0;if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Bi(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new x1),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class lL extends w4{sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...i},{transformValues:r},s){let o=VB(i,e||{},this);if(r&&(t&&(t=r(t)),i&&(i=r(i)),o&&(o=r(o))),s){BB(this,i,o);const a=x4(this,i,o,t);t=a.transitionEnd,i=a.target}return{transition:e,transitionEnd:t,...i}}}function E4(n){return window.getComputedStyle(n)}class T4 extends lL{readValueFromInstance(e,t){if(ll.has(t)){const i=p1(t);return i&&i.default||0}else{const i=E4(e),r=(KR(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Z2(e,t)}build(e,t,i,r){r1(e,t,i,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return l1(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Bi(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(e,t,i,r){n2(e,t,i,r)}}class b4 extends lL{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ll.has(t)){const i=p1(t);return i&&i.default||0}return t=i2.has(t)?t:e1(t),e.getAttribute(t)}measureInstanceViewportBox(){return Cn()}scrapeMotionValuesFromProps(e,t){return s2(e,t)}build(e,t,i,r){o1(e,t,i,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,i,r){r2(e,t,i,r)}mount(e){this.isSVGTag=a1(e.tagName),super.mount(e)}}const C4=(n,e)=>i1(n)?new b4(e,{enableHardwareAcceleration:!1}):new T4(e,{enableHardwareAcceleration:!0}),P4={layout:{ProjectionNode:rL,MeasureLayout:J2}},R4={...nz,...Mk,...a4,...P4},un=LF((n,e)=>uk(n,e,R4,C4)),Xt={paddingX:"sm:px-16 px-6",paddingY:"sm:py-16 py-6",padding:"sm:px-16 px-6 sm:py-16 py-10",heroHeadText:"font-black text-[#373737] lg:text-[80px] sm:text-[60px] xs:text-[50px] text-[40px] lg:leading-[98px] mt-2",heroSubText:"text-[#dfd9ff] font-medium lg:text-[30px] sm:text-[26px] xs:text-[20px] text-[16px] lg:leading-[40px]",sectionHeadText:"text-black font-black md:text-[60px] sm:text-[50px] xs:text-[40px] text-[30px]",sectionSubText:"sm:text-[18px] text-[14px] text-secondary uppercase tracking-wider"},L4="/portfolio-react-threejs/assets/web-0c6824d5.webp",I4="/portfolio-react-threejs/assets/mobile-84df6906.webp",N4="/portfolio-react-threejs/assets/creator-ab86683b.webp",D4="/portfolio-react-threejs/assets/csi-1f769921.webp",U4="/portfolio-react-threejs/assets/msc-abe50c5d.webp",O4="/portfolio-react-threejs/assets/techyv-adede69e.webp",F4="/portfolio-react-threejs/assets/shapeout-d15c331a.webp",k4="/portfolio-react-threejs/assets/facedetection-65dc0246.webp",B4="/portfolio-react-threejs/assets/Hi-783be2bb.webp",z4="/portfolio-react-threejs/assets/langgo-41707292.webp",V4="/portfolio-react-threejs/assets/lifeoverseas-fd137d40.webp",H4="/portfolio-react-threejs/assets/velox-429d856c.webp",W4="/portfolio-react-threejs/assets/yolo-9ff20b51.webp",G4="/portfolio-react-threejs/assets/anon_exchange-3f3d612c.webp",j4="/portfolio-react-threejs/assets/banana_class-8925bee5.webp",X4="/portfolio-react-threejs/assets/convogen-ba953cbd.webp",Y4="/portfolio-react-threejs/assets/1-710ab004.webp",q4="/portfolio-react-threejs/assets/2-bd31252c.webp",Z4="/portfolio-react-threejs/assets/3-da0bbfbc.webp",K4="/portfolio-react-threejs/assets/4-8d092131.webp",J4="/portfolio-react-threejs/assets/5-b3191ff5.webp",Q4="/portfolio-react-threejs/assets/6-b412236c.webp",$4="/portfolio-react-threejs/assets/7-21761f9b.webp",eV="/portfolio-react-threejs/assets/8-b4888019.webp",tV="/portfolio-react-threejs/assets/9-22d557f1.webp",nV="/portfolio-react-threejs/assets/1-bc4e4556.webp",iV="/portfolio-react-threejs/assets/2-466546d5.webp",rV="/portfolio-react-threejs/assets/1-c8ded170.webp",gT=[{id:"",title:"Home",type:"route"},{id:"projects",title:"Projects",type:"route"},{id:"skills",title:"Skills",type:"route"},{id:"certificate",title:"Certificates",type:"route"},{id:"resume",title:"Resume",type:"route"},{id:"blogs",title:"Blogs",type:"route"},{id:"contact",title:"Contact",type:"route"},{id:"freetools",title:"Free Tools",type:"tools"}],sV=[{id:"downloadtube",title:"DownloadTube (Youtube Downloader)",type:"video",url:"https://downloadtube-iota.vercel.app/"}],oV=[{title:"Full Stack Web Development",icon:L4},{title:"Designing",icon:N4},{title:"ML and DL Learner",icon:I4}],aV=[{title:"Content Writer",company_name:"Techyv",icon:O4,iconBg:"white",date:"October 2023 - Ongoing",points:["Writing Professional articles related to IT.","Ensuring use of no AI content in articles.","Creating articles on real facts and data."]},{title:"Technical member",company_name:"Microsoft Student Chapter",icon:U4,iconBg:"black",date:"October 2022 - March 2023",points:["Maintaining the website and ensuring that it is up-to-date and functioning properly.","Collaborating with other members of the chapter to identify areas for improvement on the website.","Implementing changes and updates to the website using programming languages such as React.js, tailwind and JavaScript.","Debugging any issues or errors that arise on the website and working to resolve them."]},{title:"V open source member",company_name:"CSI Chapter",icon:D4,iconBg:"white",date:"Augest 2021 - June 2022",points:["Conducting regular meetings to discuss open source projects and new initiatives.","Conducting workshops and training sessions to help members learn more about open source technologies.","Coordinating with other teams within the CSI chapter to ensure smooth execution of events."]}],lV=[{name:"ConvoGen AI",description:"'ConvoGen' is the virtual embodiment of me, a chatbot that offers lifelike insights and information about my experiences, interests, and personality. Engage in conversations that feel as real as speaking with me in person, as 'ConvoGen' shares a wealth of personal details and knowledge, creating a truly immersive and authentic chatbot experience.",tags:[{name:"T5 model",color:"blue-text-gradient"},{name:"Transformer",color:"green-text-gradient"},{name:"Colab",color:"pink-text-gradient"}],image:X4,source_code_link:"https://colab.research.google.com/drive/1a6LATySYKaS8qqfk_4maSaV4guvTRA-8?usp=sharing",date:"October 2023",link_type:"colab"},{name:"Anon Exchange - Anonymous chatting app",description:"An innovative anonymous chatting app that redefines digital interactions. This project empowers strangers to connect seamlessly, engaging in candid conversations without the constraints of identity. What sets us apart is our commitment to privacy, allowing users to create exclusive private chat rooms for confidential discussions.",tags:[{name:"vitejs",color:"blue-text-gradient"},{name:"supabase",color:"green-text-gradient"},{name:"tailwind CSS",color:"pink-text-gradient"}],image:G4,source_code_link:"https://github.com/bedead/Anon-Exchange-chatting",date:"August 2023",link_type:"github"},{name:"Banana disease classification",description:"Banana disease classification is a project that uses a YOLOv8 deep learning model to detect and identify various diseases affecting banana plants. The project is based on a custom dataset of images of banana leaves with different types of infections. The project aims to provide a fast and accurate diagnosis of banana diseases, which can help farmers and researchers to prevent crop losses and improve banana production.",tags:[{name:"YOLOv8",color:"green-text-gradient"},{name:"Colab",color:"pink-text-gradient"}],image:j4,source_code_link:"https://colab.research.google.com/drive/1TLumA28dCY-9_lzouIJtt2CsCjONGdNy?usp=sharing",date:"August 2023",link_type:"colab"},{name:"PATENT - CLASSIFICATION OF LUNG CANCER USING DEEP LEARNING TECHNIQUES.",description:"Application No - 202341039647 The model is based on a YOLOv8 (Deep learning Neural network architecture) and is trained on the publicly available dataset, which consists of lung CT scans of patients with and without lung cancer.",tags:[{name:"Gradio",color:"blue-text-gradient"},{name:"YOLO",color:"green-text-gradient"},{name:"Roboflow",color:"pink-text-gradient"}],image:W4,source_code_link:"https://github.com/bedead/lung-cancer-classification-yoloV8---gradio.git",date:"June 2023",link_type:"huggingface"},{name:"Face Detection",description:"'FACE-DETECTOR' is a GitHub repository showcasing an OpenCV project for detecting human faces using a cascade classifier. The project utilizes the OpenCV library, which is a popular computer vision library in Python, to detect human faces in images or video streams.",tags:[{name:"Cascade classifier",color:"blue-text-gradient"},{name:"Python",color:"green-text-gradient"},{name:"OpenCV",color:"pink-text-gradient"}],image:k4,source_code_link:"https://github.com/bedead/FACE-DETECTOR.git",date:"Feb 2023",link_type:"github"},{name:"Life Overseas",description:"Life Overseas is a concept website that aims to provide students with valuable resources and information to successfully clear entrance exams for foreign colleges.",tags:[{name:"Flask",color:"blue-text-gradient"},{name:"Python",color:"green-text-gradient"}],image:V4,source_code_link:"https://github.com/bedead/Life-Overseas-webiste.git",date:"Jan 2023",link_type:"github"},{name:"Velox Todo",description:"Velox Todo is a Windows application built using JavaFX and JSON files. It is a task management tool designed to help users organize and prioritize their daily tasks efficiently.",tags:[{name:"Java",color:"blue-text-gradient"},{name:"JavaFX",color:"green-text-gradient"},{name:"JSON",color:"pink-text-gradient"}],image:H4,source_code_link:"https://github.com/bedead/Velox-Todo-Application.git",date:"Sep 2022",link_type:"github"},{name:"HI",description:"'HI' is a console-based conversational app written in Python. It utilizes various libraries such as pyinstaller, pyjokes, PyDictionary, platform, psutil, requests, getpass, pywhatkit, pyttsx3, speechrecognition, Wikipedia, Pyaudio, speedtest-cli, pyautogui, and py-cpuinfo to provide a wide range of functionalities.",tags:[{name:"Python",color:"blue-text-gradient"},{name:"JSON",color:"green-text-gradient"}],image:B4,source_code_link:"https://github.com/bedead/HI_2021.12.22.4.git",date:"Mar 2022",link_type:"github"},{name:"Lang go",description:"'Lang Go' is a language translation app that is built using the Kivy and KivyMD frameworks in Python. The app utilizes the TextBlob library for translation capabilities. With 'Lang Go', users can input text in one language and translate it to another language seamlessly.",tags:[{name:"Kivy",color:"blue-text-gradient"},{name:"Kivymd",color:"green-text-gradient"},{name:"textBlob",color:"pink-text-gradient"}],image:z4,source_code_link:"https://github.com/bedead/kivymd-language-translation-app.git",date:"Mar 2022",link_type:"github"},{name:"Shape out",description:"'Shape Out' is a 2D platformer game available on Amazon, created using the Godot game engine. The game features intuitive controls, colorful graphics, and engaging gameplay that requires players to jump, run, and solve puzzles to progress through the levels.",tags:[{name:"Godot engine",color:"blue-text-gradient"},{name:"GD-script",color:"green-text-gradient"}],image:F4,source_code_link:"https://www.amazon.com/Bedead-Shape-Out-2d-platformer/dp/B0999LHBYN",date:"Aug 2021",link_type:"appstore"}],cV=[{name:"Basics of Machien Learing",image:Y4},{name:"C++ Course",image:q4},{name:"Making a Webiste",image:Z4},{name:"Java (Basics)",image:K4},{name:"Matlab Onramp",image:J4},{name:"MongoDB Tutorial",image:Q4},{name:"Python (Basics)",image:$4},{name:"Responsive Web Design Course",image:eV},{name:"TensorFlow Python",image:tV}],uV=[{name:"Technical Member | CSI ",image:nV},{name:"Technical Member | MSC",image:iV}],fV=[{name:" Google Cloud Digital Leader",image:rV}],hV="/portfolio-react-threejs/assets/logo-white-f51edd31.webp",dV="data:image/webp;base64,UklGRmQCAABXRUJQVlA4WAoAAAAwAAAAOwAAOwAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBIPwAAAAFHoJBtBOime96H8WhEROhZb4CaSFYrLDAowA0OUIAD/DffJB2TJqL/AoIiF6yAJSV4nAc6xy/oOftIb+woAABWUDggLgAAAJADAJ0BKjwAPAA+bTaYSSQjIqEiCACADYlpAAAQN1NQBXiFuQAA/vucwAAAAAA=",pV="data:image/webp;base64,UklGRvwCAABXRUJQVlA4WAoAAAAwAAAALwAALwAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBI2wAAAAF3oKCNFDb4bDxgYMkjIgJHTaxUSfkkcBTJtqu8T84gJEpAwheABSQkIVEIq7R9a7KCV9fDr3duIK4j+s/IbSRFteDDwEL9wv2lo6Ml4bmW5Yx2LFuayjlSHbMnX5SSBupihiFD9llir3CgZ1kYDzTJ3kFCU0RWRlZBUkNShavDNYBaiBpKPpEPNHbOBNMwbBnHf5bVaQj8s1jnu6bgL451auP4i+PPNol1WsQ6TerwAhGDOrxvjqoF7FtC0cKefFFKGqiLWcS+ZarsDc4wLgwv+Rt0tC4S948OBwBWUDggKgAAADADAJ0BKjAAMAA+bTaYSKQjIqEjiACADYlpAAAbgb0+DgAA/vucwAAAAA==",ls=n=>({hidden:{y:-50,opacity:0},show:{y:0,opacity:1,transition:{type:"spring",duration:1.25,delay:n}}}),$o=(n,e,t,i)=>({hidden:{x:n==="left"?100:n==="right"?-100:0,y:n==="up"?100:n==="down"?-100:0,opacity:0},show:{x:0,y:0,opacity:1,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),mV=(n,e,t,i)=>({hidden:{x:n==="left"?"-100%":n==="right"?"100%":0,y:n==="up"||n==="down"?"100%":0},show:{x:0,y:0,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),gV=(n,e)=>({hidden:{},show:{transition:{staggerChildren:n,delayChildren:e||0}}}),Ks=()=>{const[n,e]=V.useState(""),[t,i]=V.useState(!1),[r,s]=V.useState(!1);return z.jsx("nav",{className:`${Xt.paddingX} w-full flex items-center py-5 fixed top-0 z-20 bg-gradient-to-b from-white to-primary`,children:z.jsxs("div",{className:"w-full flex justify-between items-center max-w-7xl mx-auto",children:[z.jsxs(Hv,{to:"/",className:"flex items-center gap-2",onClick:()=>{e(""),window.scrollTo(0,0)},children:[z.jsx("img",{src:hV,className:"w-10 h-10 object-contain",alt:"logo"}),z.jsxs("div",{className:" md:block lg:flex ",children:[z.jsx("p",{className:"text-black text-[18px] flex",children:"Satyam Mishra  "}),z.jsx("span",{className:"text-[18px] sm:block hidden",children:"| Bedead"})]})]}),z.jsxs("ul",{className:"list-none hidden sm:flex flex-row md:gap-4 items-center",children:[gT.map(o=>z.jsx("li",{className:o.type=="tools"?"bg-black text-white hover:text-white-100 hover:bg-secondary py-2 px-3 rounded-xl text-[18px] font-medium cursor-pointer":`${n==o.title?"text-black":"text-secondary"} + hover:text-black hover:underline underline-offset-8 text-[18px] font-medium cursor-pointer`,onClick:()=>{e(o.title),o.type=="tools"&&s(!r)},children:o.type=="tools"?o.title:z.jsxs(Hv,{to:`/${o.id}`,children:[o.title," "]})},o.id))," "]}),z.jsx("div",{className:`${r?"flex":"hidden"} p-6 bg-gradient-to-r from-[#f6f6f6] to-white absolute + top-60 right-40 sm:top-20 sm:right-5 mx-4 my-2 min-w-[140px] z-10 rounded-xl outline`,children:z.jsxs("ul",{className:"list-none flex justify-end items-start flex-col gap-2",children:[sV.map(o=>z.jsx(un.li,{variants:$o("right","spring",.1,.75),className:`${n==o.title?"text-black":"text-secondary"} font-poppins hover:underline underline-offset-8 font-medium cursor-pointer text-[16px] hover:text-black`,onClick:()=>{s(!r),e(o.title),window.open(o.url,"_blank")},children:o.title},o.id))," "]})}),z.jsxs("div",{className:"sm:hidden flex flex-1 justify-end items-center",children:[z.jsx("img",{src:t?pV:dV,alt:"menu",className:"w-[28px] h-[28px] object-contain cursor-pointer",onClick:()=>i(!t)}),z.jsx("div",{className:`${t?"flex":"hidden"} p-6 bg-gradient-to-r from-[#f6f6f6] to-white absolute + top-20 right-0 mx-4 my-2 min-w-[140px] z-10 rounded-xl outline`,children:z.jsxs("ul",{className:"list-none flex justify-end items-start flex-col gap-2",children:[gT.map(o=>z.jsx("li",{className:`${n==o.title?"text-black":"text-secondary"} font-poppins hover:underline underline-offset-8 font-medium cursor-pointer text-[16px] hover:text-black`,onClick:()=>{o.type!="tools"&&i(!t),e(o.title),o.type=="tools"&&s(!r)},children:o.type=="tools"?o.title:z.jsxs(Hv,{to:`/${o.id}`,children:[o.title," "]})},o.id))," "]})})]})]})})},Js=(n,e)=>function(){return z.jsxs(un.section,{variants:gV(),initial:"hidden",whileInView:"show",viewport:{once:!0,amount:0},exit:"hidden",className:`${Xt.padding} max-w-7xl mx-auto relative z-0`,children:[z.jsx("span",{className:"hash-span",id:e,children:" "}),z.jsx(n,{})]})},vV=()=>{const n="Hi, I'm Satyam";return z.jsxs("section",{className:"relative w-full h-screen mx-auto overflow-hidden",children:[z.jsxs("div",{className:`${Xt.paddingX} flex absolute z-10 inset-0 top-[120px] items-start gap-5`,children:[z.jsxs("div",{className:"flex flex-col justify-center items-center mt-5",children:[z.jsx("div",{className:"w-5 h-5 rounded-full bg-[#373737] "}),z.jsx("div",{className:"w-1 sm:h-80 h-40 violet-gradient"})]}),z.jsxs("div",{children:[z.jsx(un.h1,{variants:ls(0),className:`${Xt.heroHeadText} funky-text-outline-2 `,children:n}),z.jsxs(un.div,{variants:$o("","",.1,1),children:[z.jsx("p",{className:`${Xt.heroSubText} funky-text-outline mt-2 text-black-100`,children:"I'm a computer science student with simple and dumb mind."}),z.jsx("p",{className:`${Xt.sectionSubText} mt-2 text-gray-600`,children:"This is just a website showcasing some of my works and experiments. Have a look untill you get bored 🥱"})]})]})]}),z.jsx("div",{className:"absolute z-10 xs:bottom-15 bottom-32 w-full flex justify-center items-center",children:z.jsx("a",{href:"#about",children:z.jsx("div",{className:"w-[35px] h-[64px] rounded-3xl border-4 border-[#373737] flex justify-center items-start p-2 ",children:z.jsx(un.div,{animate:{y:[0,24,0]},transition:{duration:1.5,repeat:1/0,repeatType:"loop"},className:"w-3 h-3 rounded-full bg-secondary mb-2"})})})})]})},yV=Js(vV,"Hero");var xV=Object.defineProperty,_V=Object.defineProperties,SV=Object.getOwnPropertyDescriptors,vT=Object.getOwnPropertySymbols,AV=Object.prototype.hasOwnProperty,MV=Object.prototype.propertyIsEnumerable,yT=(n,e,t)=>e in n?xV(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Du=(n,e)=>{for(var t in e||(e={}))AV.call(e,t)&&yT(n,t,e[t]);if(vT)for(var t of vT(e))MV.call(e,t)&&yT(n,t,e[t]);return n},Uu=(n,e)=>_V(n,SV(e)),Rg=class extends V.Component{constructor(n){super(n),this.ref=dh.createRef(),this.state={style:{}};const e={reverse:!1,max:35,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:"1.1",speed:"1000",transition:!0,axis:null,reset:!0};this.width=null,this.height=null,this.left=null,this.top=null,this.transitionTimeout=null,this.updateCall=null,this.element=null,this.settings=Object.assign({},e,this.props.options),this.reverse=this.settings.reverse?-1:1,this.onMouseEnter=this.onMouseEnter.bind(this,this.props.onMouseEnter),this.onMouseMove=this.onMouseMove.bind(this,this.props.onMouseMove),this.onMouseLeave=this.onMouseLeave.bind(this,this.props.onMouseLeave)}componentDidMount(){this.element=this.ref.current,setTimeout(()=>{this.element.parentElement.querySelector(":hover")===this.element&&this.onMouseEnter()},0)}componentWillUnmount(){clearTimeout(this.transitionTimeout),cancelAnimationFrame(this.updateCall)}onMouseEnter(n=()=>{},e){return this.updateElementPosition(),this.setState(Object.assign({},this.state,{style:Uu(Du({},this.state.style),{willChange:"transform"})})),this.setTransition(),n(e)}reset(){window.requestAnimationFrame(()=>{this.setState(Object.assign({},this.state,{style:Uu(Du({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`})}))})}onMouseMove(n=()=>{},e){return e.persist(),this.updateCall!==null&&window.cancelAnimationFrame(this.updateCall),this.event=e,this.updateCall=requestAnimationFrame(this.update.bind(this,e)),n(e)}setTransition(){clearTimeout(this.transitionTimeout),this.setState(Object.assign({},this.state,{style:Uu(Du({},this.state.style),{transition:`${this.settings.speed}ms ${this.settings.easing}`})})),this.transitionTimeout=setTimeout(()=>{this.setState(Object.assign({},this.state,{style:Uu(Du({},this.state.style),{transition:""})}))},this.settings.speed)}onMouseLeave(n=()=>{},e){return this.setTransition(),this.settings.reset&&this.reset(),n(e)}getValues(n){const e=(n.nativeEvent.clientX-this.left)/this.width,t=(n.nativeEvent.clientY-this.top)/this.height,i=Math.min(Math.max(e,0),1),r=Math.min(Math.max(t,0),1),s=(this.reverse*(this.settings.max/2-i*this.settings.max)).toFixed(2),o=(this.reverse*(r*this.settings.max-this.settings.max/2)).toFixed(2),a=i*100,l=r*100;return{tiltX:s,tiltY:o,percentageX:a,percentageY:l}}updateElementPosition(){const n=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=n.left,this.top=n.top}update(n){const e=this.getValues(n);this.setState(Object.assign({},this.state,{style:Uu(Du({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(${this.settings.axis==="x"?0:e.tiltY}deg) rotateY(${this.settings.axis==="y"?0:e.tiltX}deg) scale3d(${this.settings.scale}, ${this.settings.scale}, ${this.settings.scale})`})})),this.updateCall=null}render(){const n=Object.assign({},this.props.style,this.state.style);return z.jsx("div",{style:n,ref:this.ref,className:this.props.className,onMouseEnter:this.onMouseEnter,onMouseMove:this.onMouseMove,onMouseLeave:this.onMouseLeave,children:this.props.children})}};const wV=({index:n,title:e,icon:t})=>z.jsx(Rg,{className:"xs:w-[250px] w-full ",children:z.jsx(un.div,{variants:$o("right","spring",.5*n,.75),className:" w-full green-pink-gradient p-[1px] rounded-[20px] shadow-[#fcd4d4] shadow-card ",children:z.jsxs("div",{options:{max:45,scale:1,speed:450},className:"bg-primary rounded-[20px] py-5 px-12 min-h-[280px] flex justify-evenly items-center flex-col ",children:[z.jsx("img",{src:t,alt:e,className:"w-16 h-16 object-contain"}),z.jsxs("h3",{className:"text-black text-[20px] font-bold text-center ",children:[e," "]})]})})}),EV=()=>z.jsxs(z.Fragment,{children:[z.jsxs(un.div,{variants:ls(0),children:[z.jsx("h2",{className:`${Xt.sectionHeadText} text-center`,children:"Overview."}),z.jsx("p",{className:`${Xt.sectionSubText} text-center`,children:"Introduction?"})]}),z.jsx(un.p,{variants:$o("","",.1,1),className:"mt-4 text-secondary text-center text-[17px] max-w-full leading-[30px] ",children:"I am a full stack web developer, graphic designer, and machine learning enthusiast. I have experience in creating dynamic and responsive websites using HTML, CSS, JavaScript, and other frameworks. I also have a passion for designing graphics that are eye-catching and appealing. I am always eager to learn new skills and technologies in the field of machine learning and deep learning. I have completed several projects and courses on various topics such as computer vision, and natural language processing."}),z.jsxs("div",{className:"mt-20 flex flex-wrap justify-center gap-10",children:[oV.map((n,e)=>z.jsx(wV,{index:e,...n},n.title))," "]})]}),TV=Js(EV,"about");var Lg={},cL={exports:{}},bV="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",CV=bV,PV=CV;function uL(){}function fL(){}fL.resetWarningCache=uL;var RV=function(){function n(i,r,s,o,a,l){if(l!==PV){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:fL,resetWarningCache:uL};return t.PropTypes=t,t};cL.exports=RV();var hL=cL.exports,dL={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var i=[],r=0;r(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",i),LV.default.createElement("div",{className:(0,IV.default)(e,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":t==="2-columns","vertical-timeline--one-column-left":t==="1-column"||t==="1-column-left","vertical-timeline--one-column-right":t==="1-column-right"})},r));mL.propTypes={children:lo.default.oneOfType([lo.default.arrayOf(lo.default.node),lo.default.node]).isRequired,className:lo.default.string,animate:lo.default.bool,layout:lo.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:lo.default.string};var NV=mL;Lg.default=NV;var Ig={};function i_(){return i_=Object.assign||function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}var s_=new Map,Qd=new WeakMap,xT=0,gL=void 0;function OV(n){gL=n}function FV(n){return n?(Qd.has(n)||(xT+=1,Qd.set(n,xT.toString())),Qd.get(n)):"0"}function kV(n){return Object.keys(n).sort().filter(function(e){return n[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?FV(n.root):n[e])}).toString()}function BV(n){var e=kV(n),t=s_.get(e);if(!t){var i=new Map,r,s=new IntersectionObserver(function(o){o.forEach(function(a){var l,f=a.isIntersecting&&r.some(function(h){return a.intersectionRatio>=h});n.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=f),(l=i.get(a.target))==null||l.forEach(function(h){h(f,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},s_.set(e,t)}return t}function S1(n,e,t,i){if(t===void 0&&(t={}),i===void 0&&(i=gL),typeof window.IntersectionObserver>"u"&&i!==void 0){var r=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=BV(t),o=s.id,a=s.observer,l=s.elements,f=l.get(n)||[];return l.has(n)||l.set(n,f),f.push(e),a.observe(n),function(){f.splice(f.indexOf(e),1),f.length===0&&(l.delete(n),a.unobserve(n)),l.size===0&&(a.disconnect(),s_.delete(o))}}var zV=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function _T(n){return typeof n.children!="function"}var Km=function(n){DV(e,n);function e(i){var r;return r=n.call(this,i)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,o){s&&r.props.triggerOnce&&r.unobserve(),_T(r.props)||r.setState({inView:s,entry:o}),r.props.onChange&&r.props.onChange(s,o)},r.state={inView:!!i.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,o=r.root,a=r.rootMargin,l=r.trackVisibility,f=r.delay,h=r.fallbackInView;this._unobserveCb=S1(this.node,this.handleChange,{threshold:s,root:o,rootMargin:a,trackVisibility:l,delay:f},h)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!_T(this.props)){var r=this.state,s=r.inView,o=r.entry;return this.props.children({inView:s,entry:o,ref:this.handleNode})}var a=this.props,l=a.children,f=a.as,h=UV(a,zV);return V.createElement(f||"div",i_({ref:this.handleNode},h),l)},e}(V.Component);Km.displayName="InView";Km.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function VV(n){var e=n===void 0?{}:n,t=e.threshold,i=e.delay,r=e.trackVisibility,s=e.rootMargin,o=e.root,a=e.triggerOnce,l=e.skip,f=e.initialInView,h=e.fallbackInView,d=V.useRef(),p=V.useState({inView:!!f}),m=p[0],y=p[1],A=V.useCallback(function(g){d.current!==void 0&&(d.current(),d.current=void 0),!l&&g&&(d.current=S1(g,function(_,S){y({inView:_,entry:S}),S.isIntersecting&&a&&d.current&&(d.current(),d.current=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:r,delay:i},h))},[Array.isArray(t)?t.toString():t,o,s,a,l,r,h,i]);V.useEffect(function(){!d.current&&m.entry&&!a&&!l&&y({inView:!!f})});var x=[A,m.inView,m.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}const HV=Object.freeze(Object.defineProperty({__proto__:null,InView:Km,default:Km,defaultFallbackInView:OV,observe:S1,useInView:VV},Symbol.toStringTag,{value:"Module"})),WV=qN(HV);Ig.__esModule=!0;Ig.default=void 0;var co=A1(V),en=A1(hL),$d=A1(pL),GV=WV;function A1(n){return n&&n.__esModule?n:{default:n}}const vL=({children:n="",className:e="",contentArrowStyle:t=null,contentStyle:i=null,date:r="",dateClassName:s="",icon:o=null,iconClassName:a="",iconOnClick:l=null,onTimelineElementClick:f=null,iconStyle:h=null,id:d="",position:p="",style:m=null,textClassName:y="",intersectionObserverProps:A={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:x=!1})=>co.default.createElement(GV.InView,A,({inView:g,ref:_})=>co.default.createElement("div",{ref:_,id:d,className:(0,$d.default)(e,"vertical-timeline-element",{"vertical-timeline-element--left":p==="left","vertical-timeline-element--right":p==="right","vertical-timeline-element--no-children":n===""}),style:m},co.default.createElement(co.default.Fragment,null,co.default.createElement("span",{style:h,onClick:l,className:(0,$d.default)(a,"vertical-timeline-element-icon",{"bounce-in":g||x,"is-hidden":!(g||x)})},o),co.default.createElement("div",{style:i,onClick:f,className:(0,$d.default)(y,"vertical-timeline-element-content",{"bounce-in":g||x,"is-hidden":!(g||x)})},co.default.createElement("div",{style:t,className:"vertical-timeline-element-content-arrow"}),n,co.default.createElement("span",{className:(0,$d.default)(s,"vertical-timeline-element-date")},r)))));vL.propTypes={children:en.default.oneOfType([en.default.arrayOf(en.default.node),en.default.node]),className:en.default.string,contentArrowStyle:en.default.shape({}),contentStyle:en.default.shape({}),date:en.default.node,dateClassName:en.default.string,icon:en.default.element,iconClassName:en.default.string,iconStyle:en.default.shape({}),iconOnClick:en.default.func,onTimelineElementClick:en.default.func,id:en.default.string,position:en.default.string,style:en.default.shape({}),textClassName:en.default.string,visible:en.default.bool,intersectionObserverProps:en.default.shape({root:en.default.object,rootMargin:en.default.string,threshold:en.default.number,triggerOnce:en.default.bool})};var jV=vL;Ig.default=jV;var yL={VerticalTimeline:Lg.default,VerticalTimelineElement:Ig.default};const XV=({experience:n})=>z.jsxs(yL.VerticalTimelineElement,{contentStyle:{background:"black",color:"black"},contentArrowStyle:{borderRight:"7px solid black"},date:n.date,iconStyle:{background:n.iconBg},icon:z.jsx("div",{className:"flex justify-center items-center w-full h-full",children:z.jsx("img",{src:n.icon,alt:n.company_name,className:"w-[75%] h-[75%] object-contain"})}),children:[z.jsxs("div",{children:[z.jsx("h3",{className:"text-[#fcd4d4] text-[24px] font-bold",children:n.title}),z.jsxs("p",{className:"text-white text-[16px] font-semibold",style:{margin:0},children:[n.company_name," "]})]}),z.jsxs("ul",{className:"mt-5 list-disc ml-5 space-y-2",children:[n.points.map((e,t)=>z.jsxs("li",{className:"text-white-100 text-[14px] pl-1 tracking-wider",children:[e," "]},`experience-point-${t}`))," "]})]}),YV=()=>z.jsxs(z.Fragment,{children:[z.jsxs(un.div,{variants:ls(),children:[z.jsx("h2",{className:`${Xt.sectionHeadText} text-center`,children:"Work Experience."}),z.jsx("p",{className:`${Xt.sectionSubText} text-center`,children:"Where I have worked so far?"})]}),z.jsx("div",{className:"mt-20 flex flex-col",children:z.jsxs(yL.VerticalTimeline,{lineColor:"#373737",children:[aV.map((n,e)=>z.jsx(XV,{experience:n},`experience-${e}`))," "]})})]}),qV=Js(YV,"work"),ZV=()=>z.jsx("div",{className:"h-screen flex justify-center items-center",children:z.jsx("img",{src:Qc,className:"w-[150px] h-[117px] "})});function KV(){return z.jsx(V.Suspense,{fallback:ZV(),children:z.jsxs("div",{className:" z-0 bg-white",children:[z.jsx(Ks,{}),z.jsxs("div",{className:"bg-gradient-to-b from-white to-primary",children:[z.jsx(yV,{}),z.jsx(TV,{}),z.jsx(qV,{})]})]})})}const ty=({index:n,name:e,image:t})=>z.jsx(un.div,{children:z.jsx("div",{children:z.jsx(un.div,{variants:$o("right","spring",.5*n,.75),children:z.jsxs(Rg,{options:{max:45,scale:1,speed:450},className:"bg-white shadow-[#fcd4d4] shadow-card p-5 rounded-2xl sm:w-[360px] w-full",children:[z.jsx("div",{className:"relative w-full h-[230px]",children:z.jsx("img",{src:t,placeholder:`${e}`,loading:"lazy",alt:"certificate image",className:"w-full h-full object-cover rounded-2xl"})}),z.jsx("h3",{className:"mt-5 text-black font-bold text-[24px] text-center",children:e})]})})})}),JV=()=>z.jsxs("div",{className:"-m-5 md:-m-10",children:[z.jsxs(un.div,{variants:ls(0),children:[z.jsx("h2",{className:`${Xt.sectionHeadText} text-center`,children:"Certificates."}),z.jsx("p",{className:`${Xt.sectionSubText} text-center`,children:"Professional Certificates"})]}),z.jsxs("div",{className:"my-20 flex flex-wrap justify-center mx-auto space-x-5 gap-5 w-full",children:[fV.map((n,e)=>z.jsx(ty,{index:e,...n},`project-${e}`))," "]}),z.jsx(un.p,{variants:ls(0),className:`${Xt.sectionSubText} text-center`,children:"Work Certificates"}),z.jsxs("div",{className:"my-20 flex flex-wrap justify-center mx-auto space-x-5 gap-5 w-full",children:[uV.map((n,e)=>z.jsx(ty,{index:e,...n},`project-${e}`))," "]}),z.jsx(un.p,{variants:ls(0),className:`${Xt.sectionSubText} text-center`,children:"Course Certificates"}),z.jsxs("div",{className:"my-20 flex flex-wrap justify-center mx-auto space-x-5 gap-5 w-full",children:[cV.map((n,e)=>z.jsx(ty,{index:e,...n},`project-${e}`))," "]})]}),QV=Js(JV,"CertificateLists");function $V(){return z.jsxs("div",{className:"bg-white",children:[z.jsx(Ks,{}),z.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:z.jsx(QV,{})})]})}const e5="/portfolio-react-threejs/assets/cover_img-73d442a3.png",ST="/portfolio-react-threejs/assets/resume-a68436d4.pdf",t5=()=>{const[n,e]=V.useState(!1),t=()=>e(!0),i=()=>e(!1),r=()=>{const s=document.createElement("a");s.href=ST,s.download="Satyam_Mishra_Resume",s.click()};return z.jsxs("div",{className:"-m-5 md:-m-10 max-w-screen-xl mx-auto my-10 space-y-10 max",children:[z.jsxs(un.div,{variants:ls(0),children:[z.jsx("h2",{className:`${Xt.sectionHeadText} text-center`,children:"Resume."}),z.jsx("p",{className:`${Xt.sectionSubText} text-center`,children:"Check out my beginner resume🤣"})]}),z.jsx(un.div,{variants:$o("right","spring",.5*0,.75),className:"md:flex justify-center items-center",children:z.jsxs(Rg,{options:{max:45,scale:1,speed:450},className:"group bg-white shadow-[#fcd4d4] shadow-card rounded-2xl mx-auto w-[90%] md:min-w-1/3 md:max-w-3xl h-full",children:[z.jsx("div",{className:"group-hover:opacity-100 relative w-full h-full mb-5",children:z.jsx("img",{src:e5,loading:"lazy",alt:"Resume cover image",className:"w-full h-full object-cover rounded-2xl"})}),z.jsxs("div",{className:"group-hover:opacity-100 flex items-center space-x-5 md:space-y-5 justify-center md:absolute md:top-10 md:-right-10 md:bottom-0 md:flex md:flex-col md:items-center md:justify-center opacity-0 hover:opacity-100 transition-opacity duration-300",children:[z.jsx("button",{className:"bg-blue-600 text-white hover:text-white-100 hover:bg-blue-800 py-2 px-3 rounded-xl text-[15px] font-medium cursor-pointer mb-2 md:mb-0",onClick:r,children:"Download"}),z.jsx("button",{className:"bg-green-600 text-white hover:text-white-100 hover:bg-green-800 py-2 px-3 rounded-xl text-[15px] font-medium cursor-pointer mb-2 md:mb-0",onClick:t,children:"View"})]})]})}),n&&z.jsx("div",{className:"fixed inset-0 z-50 overflow-auto -top-10 bg-black bg-opacity-60 flex items-center justify-center",children:z.jsxs("div",{className:"bg-white p-2 rounded-2xl max-w-screen-lg w-[70%] relative",children:[z.jsx("button",{className:"absolute -top-12 right-0 md:top-2 md:-right-20 bg-black hover:bg-gray-800 py-2 px-3 rounded-xl text-white hover:text-gray-200",onClick:i,children:"Close"}),z.jsx("iframe",{title:"PDF Viewer",src:ST,className:"w-full h-[400px]"})]})})]})},n5=Js(t5,"ResumeComp");function i5(){return z.jsxs("div",{className:"bg-white",children:[z.jsx(Ks,{}),z.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:z.jsx(n5,{})})]})}function r5(){return z.jsxs(un.div,{variants:ls(0),className:"h-screen ",children:[z.jsx("h1",{className:`${Xt.sectionHeadText} text-center`,children:"Coming soon"}),z.jsx("p",{className:`${Xt.heroSubText} mt-2 text-black-100 text-center`,children:"More things are on the way ✌️."})]})}const xL=Js(r5,"ComingSoon"),s5=()=>z.jsx("div",{className:"h-screen flex justify-center items-center",children:z.jsx("img",{src:Qc,className:"w-[150px] h-[117px] "})});function o5(){return z.jsx(V.Suspense,{fallback:s5(),children:z.jsxs("div",{className:"bg-white",children:[z.jsx(Ks,{}),z.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:z.jsx(xL,{})})]})})}const Gf={_origin:"https://api.emailjs.com"},a5=(n,e="https://api.emailjs.com")=>{Gf._userID=n,Gf._origin=e},_L=(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 AT{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const SL=(n,e,t={})=>new Promise((i,r)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new AT(o);a.status===200||a.text==="OK"?i(a):r(a)}),s.addEventListener("error",({target:o})=>{r(new AT(o))}),s.open("POST",Gf._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),l5=(n,e,t,i)=>{const r=i||Gf._userID;return _L(r,n,e),SL("/api/v1.0/email/send",JSON.stringify({lib_version:"3.11.0",user_id:r,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},c5=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},u5=(n,e,t,i)=>{const r=i||Gf._userID,s=c5(t);_L(r,n,e);const o=new FormData(s);return o.append("lib_version","3.11.0"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",r),SL("/api/v1.0/email/send-form",o)},f5={init:a5,send:l5,sendForm:u5},h5=()=>{const n=V.useRef(),[e,t]=V.useState({name:"",email:"",message:""}),[i,r]=V.useState(!1),s=a=>{const{target:l}=a,{name:f,value:h}=l;t({...e,[f]:h})},o=a=>{a.preventDefault(),r(!0),f5.send("service_w2nrv74","template_hmf109b",{from_name:e.name,to_name:"Satyam Mishra",from_email:e.email,to_email:"satyammishra9050@gmail.com",message:e.message},"Tlnn1O7PC8WlYPRT7").then(()=>{r(!1),alert("Thank you. I will get back to you as soon as possible."),t({name:"",email:"",message:""})},l=>{r(!1),console.error(l),alert("Ahh, something went wrong. Please try again.")})};return z.jsxs("div",{className:"xl:mt-6 flex xl:flex-row flex-col-reverse gap-10 overflow-hidden md:w-[80%] lg:w-[70%] ",children:[z.jsxs(un.div,{variants:mV("left","tween",.2,1),className:"flex-[0.75] bg-white p-8 shadow-[#fcd4d4] shadow-card rounded-2xl",children:[z.jsx("p",{className:Xt.sectionSubText,children:"I am open to work"}),z.jsx("h3",{className:Xt.sectionHeadText,children:"Get In Touch."}),z.jsxs("form",{ref:n,onSubmit:o,className:"mt-12 flex flex-col gap-8",children:[z.jsxs("label",{className:"flex flex-col",children:[z.jsx("span",{className:"text-black font-medium mb-4",children:"Your Name"}),z.jsx("input",{type:"text",name:"name",value:e.name,onChange:s,placeholder:"What's your good name?",className:"bg-secondary py-4 px-6 placeholder:text-white-100 text-white rounded-lg outline-none border-none font-medium"})]}),z.jsxs("label",{className:"flex flex-col",children:[z.jsx("span",{className:"text-black font-medium mb-4",children:"Your email"}),z.jsx("input",{type:"email",name:"email",value:e.email,onChange:s,placeholder:"What's your web address?",className:"bg-secondary py-4 px-6 placeholder:text-white-100 text-white rounded-lg outline-none border-none font-medium"})]}),z.jsxs("label",{className:"flex flex-col",children:[z.jsx("span",{className:"text-black font-medium mb-4",children:"Your Message"}),z.jsx("textarea",{rows:7,name:"message",value:e.message,onChange:s,placeholder:"What you want to say?",className:"bg-secondary py-4 px-6 placeholder:text-white-100 text-white rounded-lg outline-none border-none font-medium"})]}),z.jsxs("button",{type:"submit",className:"bg-black hover:bg-slate-600 py-3 px-8 rounded-xl outline-none w-fit text-white font-bold shadow-md shadow-primary",children:[i?"Sending...":"Send"," "]})]})]})," "]})},d5=Js(h5,"contact");function p5(){return z.jsxs("div",{className:"bg-white",children:[z.jsx(Ks,{}),z.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:z.jsx(d5,{})})]})}const MT="data:image/webp;base64,UklGRggMAABXRUJQVlA4WAoAAAAwAAAA7wAA7wAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBIggkAAAGwBgC0MTfWGWamsV3bbVDbdvu29tp23dRuk7VRu12btW0H89Kkk0wwcx6Ce8+959tf721ETAD87f//pevfqP+jaW9v+fHERZfrHuI9l+viiR+3vJX2aP9G/n81nMlTln+biVLvfLN8SrLzr0HMgLSfPUi05ETG+OrGztE9bT+Sv5AxwGHQQibsdKOi7h3jgw2X/5jtHlTas220v5FqlJaDGrybkWSQnNMPoDb3T3MYn8jnb6BWM9PijE3V9ALUbsHaROMSlVaIWi7KiDMmYUsKUNsFi0ONh3V6Jmo953Grweh5ArV/rLuRCMtAFtdHGoYRmcika7oxiNuDjO6ONQCDs5DVrEHcOVcgux/4s1b/JDJ8vC5jA/6JLOcN48oy34dM++ZaWPLfhozvCWQoZh+yfjienUaXkflLDZlJykb2Xa1Z6XAXDWB+V0a65KMhdPdio6cHDaKnBxNt89EwujuxkJqHBvJuCgONXGgosxtqL+YyGsxL0Zpz/o6Gc7+/1izb0IBuMetsPhrS2Rob5DMmvmHaqpuLBjWvgab8T6JhPVZFT2+ggV2rpcEoPbuWf2i9HtNW/1akH8+vq6Z2rxvqXztbmG+AhuKy5A2CcgMGvOnSSU5Gf38od6gwzIzRzx6U/g1U2G/UL7r4abgdKvy9MNypnXEof2DFAKDD7zr4tR1Udog4HK2ZqCx5LmulwDTinGrnhpug0rZccXci9PIJyt8IIh1LvCp5F/qByC3i8H2t9ESCrwgB6HpVnUudQOwLErCLRqwnKIwWBBE/qvJtGAgeIOOIRR+PIMVWosDv/cpk7duw+JH+bVrWjAu1WEMTaia1HfDY0s0HXZV52w6im8nAB7QRlk0iShiYVpSXtWtGv0gQHjtw9heu8paA+GgpmSG6WIIkg8SBaQUiurdPrwnyTXUf2lOIiEtAYogUXKCJuAIagRLAvC69nxPI+g9+K90kI0iOO0YPa5Cmvwy9BsrB5Vqo5jEWAZIKE3SQjkTjuUiQhKs1EFlApTkXSbLcEerNQKo9uegjC19VzplJZgwXE6Tddqg2Dcm+ysUMaThFtQN0PuTiM3l/KpaEdPdxcUgetlArnVCeiQezm8BqpfzvEsI6PDRAgrlVVBqLlMfwMJECjlJpB6kVPKwjsVmhEA+pP3g4SKIwUJ2JSLo0lINwLwkco85OWjiYg+FIc6syDjex+RwsJ5JvV6UX0r4czUH1TBrYVZXltAqSgMX2RTQWqnKa1jBg8iEaxxSJQ9IZwOYGEhijxkhS5wP5iLhFYogayyh5WwOjA0ksVmMfpXRgdTuF35RwFhNyRfJS20OgyKFCChJ+HJhdQACTVJhK6LaDm7B8AhNVWEHoWWB3GYElKnxHJzeYn4QieV+pcIfOCmD4c3k3FfBHukkcDZDnq0KvMZ0TwLH1tjRsQK8/nddYgnXy+tJ7lE5bnobLe4heGpk8G0/hXmnz6L1FZjcwfUjaG/S2kpnP1fvSNtH7icwErl6S9j29U2RacTVE2nF618jEcZUk7Qq9TDIBXNWVdoteLhWvmatYaS56BVTuAdeB0tz0SqmUsBUlrZSelwr6cVVDPx4yYVw1kVZIL49MDa7aScujl0OmC1djpGXTu05mGlevS7tC7ziZNK4+lHaE3s9ktnO1T9qP9HaQyTHzFFgibQe998hgU556o/S36M2l8whP8+XNpPcQnb08HZX3AL2BdEpiOGqK8gfQa0EHn+BoIYFG9AJ8dA4yZLsmz+ekBzfoYE9+JqH8a6DgN4R+ZMdylsDXKqwhhJ24GYMEF6owjdJhGy9VLlIYqUISJXyGl2VIsaYK9iJK7pqcJJdSyDGpAAcp4c92PoJOIsUvQcmVpHANG6YNSHKuGsNp4WQuXkWaw9SI9tEq6sfDZC+N0nA14CQt9PTlYIIXaf4Kii4lhp6++hvvRaKvqtKTGpY8rznT816kmqyKXz41xDftOgvYhGQzzarAVnr4Sy19NT+OdD8AZccogPceM+vJNqMYCd+nTlChAog/1NdRymGk7A5SB7Ypgd711XRTLcOLpD8AhUepgeieF66T+DXFSLy7Sg6XIoieD5roouUHxUj9mkUlWKMMou+roQ71Asb8igrOAaVTFELEux/0tankHLa+AFX01VEL/lQKEXM+mVJNjboPbcpDRX8Gxcep9t/n1o1vbKVkbznlnSuo8CjV/G5r4L8L/lj3QM/adll+9fs8+uaBIlT7vEU1mKGJsksvv2oRZ3n9mg91+CAoH54v6tLQyLovnqHmug+kjs7VwR2nerBEVFcAAPOQk6QO1QTJNQ5r4BXQYJxH0MD/ArA9U0jnS3+QHvilcvlhOoAVgq7VKwOgySkqOx1A0LFXtcWgxah8MXh3aFkQ8iWN35xA0rlfLVeYHmCWIPQ+WBbYN1G4GAVEq2Yq9SRoMuiOIPSNKAusW+QVpwLZziUKnbPrAqaJQndSWVBln7TngPALCg0FbZoPiMKrQWVB7FVJf5op2Y4q8wNotJ1PFC4rB5rlSSlNAtLtfIp4k3UCbworaVYODPPJeBOIv6XIatBq6E1RuK08mCPBk0gttlCJCwF6geHCfA3LM70jbiWQT1fB1wV0u14UvlMemJeJ8taiV7tUgTWg3fAbou4FlAcw8IKY7aDg5/QuBugHevoE4YSKgLn7gq9PuYoQ81xXLxz7dfs7aQ/3behQoSc5XxfQ8VJRX1dIn9Y71OaDlm0/C/Im6gjWEvvGoidIzBKDz2upE60rkaDrXqViTmjJXkjJkwL6fkYMpuoIfqU0FXT+rph0LS0j9CZo3e9HIe5IHY2ms9umNwg9LgJn66g9md/8QffxV0S4a2moPpWzUaD/RlkC8EuzfiKIXE0EDlu4BOBy/ZhpZDcAHlNyBeBck26ARFYScNnKJQA3BvNzoyHw2ey2ALw52sTMhZrAab2rAhBPPhDKyYk44DX+sAjEkh9mjmySGMzCvgjgNugLIUJ1tT0Q+LVlMOabYwaWpxdxdW84cN3+Fk8XmwLfMV9z9FUEcG56vJibwufNwHzbc7wcaAT8O9O8fJSm2cEQdjvPxdk2YBQdMzwcuGc4wEA2+Ep7vk8TwGB2P6a3Qx3BeNoeuamvGw9YwJD6Tb+lpyuPO8GwBjx1TT/nJtvA0NonHNfLsbFWMLymLuuLK2RVxYaI7vfagUGOfelUBaJVqYqHHw4BI5266nZZjVSJTwXDbU6acRoR/6GKUa85ff2Cv1Z/+///8wRWUDggkAAAAFAPAJ0BKvAA8AA+bTaZSaQjIqEgKACADYlpbuF2sRtACewD32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D31gAAP7/1gAAAAAAAAAAAA==",m5="/portfolio-react-threejs/assets/appstore-0b8f390b.png",g5="/portfolio-react-threejs/assets/colab-9e4861eb.png",v5="/portfolio-react-threejs/assets/huggingface-720eadc9.png",y5=({index:n,name:e,description:t,tags:i,image:r,source_code_link:s,date:o,link_type:a})=>z.jsx(un.div,{children:z.jsx("div",{children:z.jsx(un.div,{variants:$o("right","spring",.5*n,.75),children:z.jsxs(Rg,{options:{max:45,scale:1,speed:450},className:"bg-white shadow-[#fcd4d4] shadow-card p-5 rounded-2xl sm:w-[360px] w-full",children:[z.jsxs("div",{className:"relative w-full h-[230px]",children:[z.jsx("img",{src:r,alt:"project_image",className:"w-full h-full object-cover rounded-2xl"}),z.jsx("div",{className:"absolute inset-0 flex justify-end m-3 card-img_hover",children:z.jsx("div",{onClick:()=>window.open(s,"_blank"),className:"white-gradient w-10 h-10 rounded-full flex justify-center items-center cursor-pointer",children:z.jsx("img",{src:a=="github"?MT:a=="colab"?g5:a=="huggingface"?v5:a=="appstore"?m5:MT,alt:"github repositories for projects",className:"w-1/2 h-1/2 object-contain"})})})]}),z.jsxs("div",{className:"mt-5",children:[z.jsx("h3",{className:"text-black font-bold text-[24px]",children:e}),z.jsx("p",{className:"mt-2 text-secondary text-[14px]",children:t})]}),z.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[i.map(l=>z.jsxs("p",{className:`text-[14px] ${l.color}`,children:["#",l.name," "]},`${e}-${l.name}`))," "]}),z.jsx("p",{children:o})]})})})}),x5=()=>z.jsxs("div",{className:"-m-5 md:-m-10 ",children:[z.jsxs(un.div,{variants:ls(0),children:[z.jsx("h2",{className:`${Xt.sectionHeadText} text-center`,children:"Projects."}),z.jsx("p",{className:`${Xt.sectionSubText} text-center`,children:"My works?"})]}),z.jsx(un.div,{variants:$o("","",.1,1),className:"w-full flex",children:z.jsx("p",{className:"mt-3 text-secondary text-center text-[17px] max-w-full leading-[30px]",children:"The projects that are listed below provide examples of my work in the real world, showcasing my abilities and experience. Each project has a brief description, links to code repositories, and live demonstrations. It exhibits my ability to work with various technologies, manage projects efficiently, and solve complex problems."})}),z.jsxs("div",{className:" mt-20 grid md:grid-cols-2 lg:grid-cols-3 gap-5",children:[lV.map((n,e)=>z.jsx(y5,{index:e,...n},`project-${e}`))," "]})]}),_5=Js(x5,"project");function S5(){return z.jsxs("div",{className:"bg-white",children:[z.jsx(Ks,{}),z.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:z.jsx(_5,{})})]})}/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const Ng="160",Ca={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Pa={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},AL=0,o_=1,ML=2,A5=3,wL=0,Dg=1,gf=2,Rr=3,Xs=0,Mi=1,Dr=2,M5=2,zs=0,Ga=1,a_=2,l_=3,c_=4,EL=5,wo=100,TL=101,bL=102,u_=103,f_=104,CL=200,PL=201,RL=202,LL=203,Jm=204,Qm=205,IL=206,NL=207,DL=208,UL=209,OL=210,FL=211,kL=212,BL=213,zL=214,VL=0,HL=1,WL=2,jf=3,GL=4,jL=5,XL=6,YL=7,Mh=0,qL=1,ZL=2,cs=0,KL=1,JL=2,QL=3,M1=4,$L=5,eI=6,h_="attached",tI="detached",Ug=300,Ys=301,Xo=302,Xf=303,Yf=304,$c=306,qf=1e3,fi=1001,Zf=1002,An=1003,$m=1004,w5=1004,vf=1005,E5=1005,wn=1006,w1=1007,T5=1007,Yo=1008,b5=1008,us=1009,nI=1010,iI=1011,Og=1012,E1=1013,Us=1014,Ur=1015,Hc=1016,T1=1017,b1=1018,Bo=1020,rI=1021,Si=1023,sI=1024,oI=1025,zo=1026,el=1027,aI=1028,C1=1029,lI=1030,P1=1031,R1=1033,cm=33776,um=33777,fm=33778,hm=33779,d_=35840,p_=35841,m_=35842,g_=35843,L1=36196,v_=37492,y_=37496,x_=37808,__=37809,S_=37810,A_=37811,M_=37812,w_=37813,E_=37814,T_=37815,b_=37816,C_=37817,P_=37818,R_=37819,L_=37820,I_=37821,dm=36492,N_=36494,D_=36495,cI=36283,U_=36284,O_=36285,F_=36286,uI=2200,fI=2201,hI=2202,Kf=2300,Jf=2301,pm=2302,Fa=2400,ka=2401,Qf=2402,Fg=2500,I1=2501,C5=0,P5=1,R5=2,N1=3e3,Vo=3001,dI=3200,pI=3201,ea=0,mI=1,Ki="",Dn="srgb",hs="srgb-linear",kg="display-p3",wh="display-p3-linear",$f="linear",Gt="srgb",eh="rec709",th="p3",L5=0,Ra=7680,I5=7681,N5=7682,D5=7683,U5=34055,O5=34056,F5=5386,k5=512,B5=513,z5=514,V5=515,H5=516,W5=517,G5=518,k_=519,gI=512,vI=513,yI=514,D1=515,xI=516,_I=517,SI=518,AI=519,nh=35044,j5=35048,X5=35040,Y5=35045,q5=35049,Z5=35041,K5=35046,J5=35050,Q5=35042,$5="100",B_="300 es",eg=1035,Or=2e3,Wc=2001;class ps{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]+oi[n>>16&255]+oi[n>>24&255]+"-"+oi[e&255]+oi[e>>8&255]+"-"+oi[e>>16&15|64]+oi[e>>24&255]+"-"+oi[t&63|128]+oi[t>>8&255]+"-"+oi[t>>16&255]+oi[t>>24&255]+oi[i&255]+oi[i>>8&255]+oi[i>>16&255]+oi[i>>24&255]).toLowerCase()}function gn(n,e,t){return Math.max(e,Math.min(t,n))}function U1(n,e){return(n%e+e)%e}function eH(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function tH(n,e,t){return n!==e?(t-n)/(e-n):0}function yf(n,e,t){return(1-t)*n+t*e}function nH(n,e,t,i){return yf(n,e,1-Math.exp(-t*i))}function iH(n,e=1){return e-Math.abs(U1(n,e*2)-e)}function rH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function sH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function oH(n,e){return n+Math.floor(Math.random()*(e-n+1))}function aH(n,e){return n+Math.random()*(e-n)}function lH(n){return n*(.5-Math.random())}function cH(n){n!==void 0&&(wT=n);let e=wT+=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 uH(n){return n*ja}function fH(n){return n*Gc}function z_(n){return(n&n-1)===0&&n!==0}function hH(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function tg(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function dH(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),f=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),y=o((i-e)/2);switch(r){case"XYX":n.set(a*h,l*d,l*p,a*f);break;case"YZY":n.set(l*p,a*h,l*d,a*f);break;case"ZXZ":n.set(l*d,l*p,a*h,a*f);break;case"XZX":n.set(a*h,l*y,l*m,a*f);break;case"YXY":n.set(l*m,a*h,l*y,a*f);break;case"ZYZ":n.set(l*y,l*m,a*h,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Di(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 At(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 MI={DEG2RAD:ja,RAD2DEG:Gc,generateUUID:$i,clamp:gn,euclideanModulo:U1,mapLinear:eH,inverseLerp:tH,lerp:yf,damp:nH,pingpong:iH,smoothstep:rH,smootherstep:sH,randInt:oH,randFloat:aH,randFloatSpread:lH,seededRandom:cH,degToRad:uH,radToDeg:fH,isPowerOfTwo:z_,ceilPowerOfTwo:hH,floorPowerOfTwo:tg,setQuaternionFromProperEuler:dH,normalize:At,denormalize:Di};class me{constructor(e=0,t=0){me.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(gn(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,l,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,l,f)}set(e,t,i,r,s,o,a,l,f){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,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],l=i[6],f=i[1],h=i[4],d=i[7],p=i[2],m=i[5],y=i[8],A=r[0],x=r[3],g=r[6],_=r[1],S=r[4],E=r[7],P=r[2],b=r[5],L=r[8];return s[0]=o*A+a*_+l*P,s[3]=o*x+a*S+l*b,s[6]=o*g+a*E+l*L,s[1]=f*A+h*_+d*P,s[4]=f*x+h*S+d*b,s[7]=f*g+h*E+d*L,s[2]=p*A+m*_+y*P,s[5]=p*x+m*S+y*b,s[8]=p*g+m*E+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],l=e[6],f=e[7],h=e[8];return t*o*h-t*a*f-i*s*h+i*a*l+r*s*f-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],h=e[8],d=h*o-a*f,p=a*l-h*s,m=f*s-o*l,y=t*d+i*p+r*m;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const A=1/y;return e[0]=d*A,e[1]=(r*f-h*i)*A,e[2]=(a*i-r*o)*A,e[3]=p*A,e[4]=(h*t-r*l)*A,e[5]=(r*s-a*t)*A,e[6]=m*A,e[7]=(i*l-f*t)*A,e[8]=(o*t-i*s)*A,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 l=Math.cos(s),f=Math.sin(s);return this.set(i*l,i*f,-i*(l*o+f*a)+o+e,-r*f,r*l,-r*(-f*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(ny.makeScale(e,t)),this}rotate(e){return this.premultiply(ny.makeRotation(-e)),this}translate(e,t){return this.premultiply(ny.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 ny=new wt;function wI(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const pH={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function xc(n,e){return new pH[n](e)}function ih(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function EI(){const n=ih("canvas");return n.style.display="block",n}const ET={};function xf(n){n in ET||(ET[n]=!0,console.warn(n))}const TT=new wt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),bT=new wt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ep={[hs]:{transfer:$f,primaries:eh,toReference:n=>n,fromReference:n=>n},[Dn]:{transfer:Gt,primaries:eh,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[wh]:{transfer:$f,primaries:th,toReference:n=>n.applyMatrix3(bT),fromReference:n=>n.applyMatrix3(TT)},[kg]:{transfer:Gt,primaries:th,toReference:n=>n.convertSRGBToLinear().applyMatrix3(bT),fromReference:n=>n.applyMatrix3(TT).convertLinearToSRGB()}},mH=new Set([hs,wh]),kt={enabled:!0,_workingColorSpace:hs,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!mH.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=ep[e].toReference,r=ep[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 ep[n].primaries},getTransfer:function(n){return n===Ki?$f:ep[n].transfer}};function Ic(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function iy(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Nl;class O1{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Nl===void 0&&(Nl=ih("canvas")),Nl.width=e.width,Nl.height=e.height;const i=Nl.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Nl}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=ih("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!==Ug)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case qf:e.x=e.x-Math.floor(e.x);break;case fi:e.x=e.x<0?0:1;break;case Zf: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 qf:e.y=e.y-Math.floor(e.y);break;case fi:e.y=e.y<0?0:1;break;case Zf: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 xf("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Dn?Vo:N1}set encoding(e){xf("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Vo?Dn:Ki}}yn.DEFAULT_IMAGE=null;yn.DEFAULT_MAPPING=Ug;yn.DEFAULT_ANISOTROPY=1;class Bt{constructor(e=0,t=0,i=0,r=1){Bt.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 l=e.elements,f=l[0],h=l[4],d=l[8],p=l[1],m=l[5],y=l[9],A=l[2],x=l[6],g=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-A)<.01&&Math.abs(y-x)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+A)<.1&&Math.abs(y+x)<.1&&Math.abs(f+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const S=(f+1)/2,E=(m+1)/2,P=(g+1)/2,b=(h+p)/4,L=(d+A)/4,N=(y+x)/4;return S>E&&S>P?S<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(S),r=b/i,s=L/i):E>P?E<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(E),i=b/r,s=N/r):P<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(P),i=L/s,r=N/s),this.set(i,r,s,t),this}let _=Math.sqrt((x-y)*(x-y)+(d-A)*(d-A)+(p-h)*(p-h));return Math.abs(_)<.001&&(_=1),this.x=(x-y)/_,this.y=(d-A)/_,this.z=(p-h)/_,this.w=Math.acos((f+m+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 TI extends ps{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Bt(0,0,e,t),this.scissorTest=!1,this.viewport=new Bt(0,0,e,t);const r={width:e,height:t,depth:1};i.encoding!==void 0&&(xf("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===Vo?Dn:Ki),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new yn(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 Ba(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 Vr extends TI{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class Bg extends yn{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=An,this.minFilter=An,this.wrapR=fi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class yH extends Vr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new Bg(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class F1 extends yn{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=An,this.minFilter=An,this.wrapR=fi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class xH extends Vr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new F1(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class _H extends Vr{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,S=1-g*g;if(S>Number.EPSILON){const P=Math.sqrt(S),b=Math.atan2(P,g*_);x=Math.sin(x*b)/P,a=Math.sin(a*b)/P}const E=a*_;if(l=l*x+p*E,f=f*x+m*E,h=h*x+y*E,d=d*x+A*E,x===1-a){const P=1/Math.sqrt(l*l+f*f+h*h+d*d);l*=P,f*=P,h*=P,d*=P}}e[t]=l,e[t+1]=f,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],f=i[r+2],h=i[r+3],d=s[o],p=s[o+1],m=s[o+2],y=s[o+3];return e[t]=a*y+h*d+l*m-f*p,e[t+1]=l*y+h*p+f*d-a*m,e[t+2]=f*y+h*m+a*p-l*d,e[t+3]=h*y-a*d-l*p-f*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,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,l=Math.sin,f=a(i/2),h=a(r/2),d=a(s/2),p=l(i/2),m=l(r/2),y=l(s/2);switch(o){case"XYZ":this._x=p*h*d+f*m*y,this._y=f*m*d-p*h*y,this._z=f*h*y+p*m*d,this._w=f*h*d-p*m*y;break;case"YXZ":this._x=p*h*d+f*m*y,this._y=f*m*d-p*h*y,this._z=f*h*y-p*m*d,this._w=f*h*d+p*m*y;break;case"ZXY":this._x=p*h*d-f*m*y,this._y=f*m*d+p*h*y,this._z=f*h*y+p*m*d,this._w=f*h*d-p*m*y;break;case"ZYX":this._x=p*h*d-f*m*y,this._y=f*m*d+p*h*y,this._z=f*h*y-p*m*d,this._w=f*h*d+p*m*y;break;case"YZX":this._x=p*h*d+f*m*y,this._y=f*m*d+p*h*y,this._z=f*h*y-p*m*d,this._w=f*h*d-p*m*y;break;case"XZY":this._x=p*h*d-f*m*y,this._y=f*m*d-p*h*y,this._z=f*h*y+p*m*d,this._w=f*h*d+p*m*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],l=t[9],f=t[2],h=t[6],d=t[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-f)*m,this._z=(o-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+f)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(s-f)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(o-r)/m,this._x=(s+f)/m,this._y=(l+h)/m,this._z=.25*m}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(gn(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,l=t._y,f=t._z,h=t._w;return this._x=i*h+o*a+r*f-s*l,this._y=r*h+o*l+s*a-i*f,this._z=s*h+o*f+i*l-r*a,this._w=o*h-i*a-r*l-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 l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const f=Math.sqrt(l),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 U{constructor(e=0,t=0,i=0){U.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(CT.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(CT.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,l=e.w,f=2*(o*r-a*i),h=2*(a*t-s*r),d=2*(s*i-o*t);return this.x=t+l*f+o*d-a*h,this.y=i+l*h+a*f-s*d,this.z=r+l*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,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,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 sy.copy(this).projectOnVector(e),this.sub(sy)}reflect(e){return this.sub(sy.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(gn(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 sy=new U,CT=new hi;class wi{constructor(e=new U(1/0,1/0,1/0),t=new U(-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,Tr),Tr.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(Ou),np.subVectors(this.max,Ou),Dl.subVectors(e.a,Ou),Ul.subVectors(e.b,Ou),Ol.subVectors(e.c,Ou),uo.subVectors(Ul,Dl),fo.subVectors(Ol,Ul),pa.subVectors(Dl,Ol);let t=[0,-uo.z,uo.y,0,-fo.z,fo.y,0,-pa.z,pa.y,uo.z,0,-uo.x,fo.z,0,-fo.x,pa.z,0,-pa.x,-uo.y,uo.x,0,-fo.y,fo.x,0,-pa.y,pa.x,0];return!oy(t,Dl,Ul,Ol,np)||(t=[1,0,0,0,1,0,0,0,1],!oy(t,Dl,Ul,Ol,np))?!1:(ip.crossVectors(uo,fo),t=[ip.x,ip.y,ip.z],oy(t,Dl,Ul,Ol,np))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Tr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Tr).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:(As[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),As[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),As[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),As[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),As[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),As[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),As[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),As[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(As),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 As=[new U,new U,new U,new U,new U,new U,new U,new U],Tr=new U,tp=new wi,Dl=new U,Ul=new U,Ol=new U,uo=new U,fo=new U,pa=new U,Ou=new U,np=new U,ip=new U,ma=new U;function oy(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){ma.fromArray(n,s);const a=r.x*Math.abs(ma.x)+r.y*Math.abs(ma.y)+r.z*Math.abs(ma.z),l=e.dot(ma),f=t.dot(ma),h=i.dot(ma);if(Math.max(-Math.max(l,f,h),Math.min(l,f,h))>a)return!1}return!0}const SH=new wi,Fu=new U,ay=new U;class di{constructor(e=new U,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):SH.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;Fu.subVectors(e,this.center);const t=Fu.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Fu,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):(ay.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Fu.copy(e.center).add(ay)),this.expandByPoint(Fu.copy(e.center).sub(ay))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ms=new U,ly=new U,rp=new U,ho=new U,cy=new U,sp=new U,uy=new U;class ul{constructor(e=new U,t=new U(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,Ms)),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=Ms.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ms.copy(this.origin).addScaledVector(this.direction,t),Ms.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){ly.copy(e).add(t).multiplyScalar(.5),rp.copy(t).sub(e).normalize(),ho.copy(this.origin).sub(ly);const s=e.distanceTo(t)*.5,o=-this.direction.dot(rp),a=ho.dot(this.direction),l=-ho.dot(rp),f=ho.lengthSq(),h=Math.abs(1-o*o);let d,p,m,y;if(h>0)if(d=o*l-a,p=o*a-l,y=s*h,d>=0)if(p>=-y)if(p<=y){const A=1/h;d*=A,p*=A,m=d*(d+o*p+2*a)+p*(o*d+p+2*l)+f}else p=s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+f;else p=-s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+f;else p<=-y?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+f):p<=y?(d=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+f):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+f);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+f;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(ly).addScaledVector(rp,p),m}intersectSphere(e,t){Ms.subVectors(e.center,this.origin);const i=Ms.dot(this.direction),r=Ms.dot(Ms)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,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,l;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,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Ms)!==null}intersectTriangle(e,t,i,r,s){cy.subVectors(t,e),sp.subVectors(i,e),uy.crossVectors(cy,sp);let o=this.direction.dot(uy),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ho.subVectors(this.origin,e);const l=a*this.direction.dot(sp.crossVectors(ho,sp));if(l<0)return null;const f=a*this.direction.dot(cy.cross(ho));if(f<0||l+f>o)return null;const h=-a*ho.dot(uy);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 ut{constructor(e,t,i,r,s,o,a,l,f,h,d,p,m,y,A,x){ut.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,l,f,h,d,p,m,y,A,x)}set(e,t,i,r,s,o,a,l,f,h,d,p,m,y,A,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]=a,g[13]=l,g[2]=f,g[6]=h,g[10]=d,g[14]=p,g[3]=m,g[7]=y,g[11]=A,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 ut().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/Fl.setFromMatrixColumn(e,0).length(),s=1/Fl.setFromMatrixColumn(e,1).length(),o=1/Fl.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),l=Math.cos(r),f=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=o*h,m=o*d,y=a*h,A=a*d;t[0]=l*h,t[4]=-l*d,t[8]=f,t[1]=m+y*f,t[5]=p-A*f,t[9]=-a*l,t[2]=A-p*f,t[6]=y+m*f,t[10]=o*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,y=f*h,A=f*d;t[0]=p+A*a,t[4]=y*a-m,t[8]=o*f,t[1]=o*d,t[5]=o*h,t[9]=-a,t[2]=m*a-y,t[6]=A+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,y=f*h,A=f*d;t[0]=p-A*a,t[4]=-o*d,t[8]=y+m*a,t[1]=m+y*a,t[5]=o*h,t[9]=A-p*a,t[2]=-o*f,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*h,m=o*d,y=a*h,A=a*d;t[0]=l*h,t[4]=y*f-m,t[8]=p*f+A,t[1]=l*d,t[5]=A*f+p,t[9]=m*f-y,t[2]=-f,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*f,y=a*l,A=a*f;t[0]=l*h,t[4]=A-p*d,t[8]=y*d+m,t[1]=d,t[5]=o*h,t[9]=-a*h,t[2]=-f*h,t[6]=m*d+y,t[10]=p-A*d}else if(e.order==="XZY"){const p=o*l,m=o*f,y=a*l,A=a*f;t[0]=l*h,t[4]=-d,t[8]=f*h,t[1]=p*d+A,t[5]=o*h,t[9]=m*d-y,t[2]=y*d-m,t[6]=a*h,t[10]=A*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(AH,e,MH)}lookAt(e,t,i){const r=this.elements;return Xi.subVectors(e,t),Xi.lengthSq()===0&&(Xi.z=1),Xi.normalize(),po.crossVectors(i,Xi),po.lengthSq()===0&&(Math.abs(i.z)===1?Xi.x+=1e-4:Xi.z+=1e-4,Xi.normalize(),po.crossVectors(i,Xi)),po.normalize(),op.crossVectors(Xi,po),r[0]=po.x,r[4]=op.x,r[8]=Xi.x,r[1]=po.y,r[5]=op.y,r[9]=Xi.y,r[2]=po.z,r[6]=op.z,r[10]=Xi.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],l=i[8],f=i[12],h=i[1],d=i[5],p=i[9],m=i[13],y=i[2],A=i[6],x=i[10],g=i[14],_=i[3],S=i[7],E=i[11],P=i[15],b=r[0],L=r[4],N=r[8],C=r[12],R=r[1],F=r[5],K=r[9],le=r[13],H=r[2],q=r[6],ee=r[10],oe=r[14],k=r[3],j=r[7],Y=r[11],J=r[15];return s[0]=o*b+a*R+l*H+f*k,s[4]=o*L+a*F+l*q+f*j,s[8]=o*N+a*K+l*ee+f*Y,s[12]=o*C+a*le+l*oe+f*J,s[1]=h*b+d*R+p*H+m*k,s[5]=h*L+d*F+p*q+m*j,s[9]=h*N+d*K+p*ee+m*Y,s[13]=h*C+d*le+p*oe+m*J,s[2]=y*b+A*R+x*H+g*k,s[6]=y*L+A*F+x*q+g*j,s[10]=y*N+A*K+x*ee+g*Y,s[14]=y*C+A*le+x*oe+g*J,s[3]=_*b+S*R+E*H+P*k,s[7]=_*L+S*F+E*q+P*j,s[11]=_*N+S*K+E*ee+P*Y,s[15]=_*C+S*le+E*oe+P*J,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],l=e[9],f=e[13],h=e[2],d=e[6],p=e[10],m=e[14],y=e[3],A=e[7],x=e[11],g=e[15];return y*(+s*l*d-r*f*d-s*a*p+i*f*p+r*a*m-i*l*m)+A*(+t*l*m-t*f*p+s*o*p-r*o*m+r*f*h-s*l*h)+x*(+t*f*d-t*a*m-s*o*d+i*o*m+s*a*h-i*f*h)+g*(-r*a*h-t*l*d+t*a*p+r*o*d-i*o*p+i*l*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],l=e[6],f=e[7],h=e[8],d=e[9],p=e[10],m=e[11],y=e[12],A=e[13],x=e[14],g=e[15],_=d*x*f-A*p*f+A*l*m-a*x*m-d*l*g+a*p*g,S=y*p*f-h*x*f-y*l*m+o*x*m+h*l*g-o*p*g,E=h*A*f-y*d*f+y*a*m-o*A*m-h*a*g+o*d*g,P=y*d*l-h*A*l-y*a*p+o*A*p+h*a*x-o*d*x,b=t*_+i*S+r*E+s*P;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/b;return e[0]=_*L,e[1]=(A*p*s-d*x*s-A*r*m+i*x*m+d*r*g-i*p*g)*L,e[2]=(a*x*s-A*l*s+A*r*f-i*x*f-a*r*g+i*l*g)*L,e[3]=(d*l*s-a*p*s-d*r*f+i*p*f+a*r*m-i*l*m)*L,e[4]=S*L,e[5]=(h*x*s-y*p*s+y*r*m-t*x*m-h*r*g+t*p*g)*L,e[6]=(y*l*s-o*x*s-y*r*f+t*x*f+o*r*g-t*l*g)*L,e[7]=(o*p*s-h*l*s+h*r*f-t*p*f-o*r*m+t*l*m)*L,e[8]=E*L,e[9]=(y*d*s-h*A*s-y*i*m+t*A*m+h*i*g-t*d*g)*L,e[10]=(o*A*s-y*a*s+y*i*f-t*A*f-o*i*g+t*a*g)*L,e[11]=(h*a*s-o*d*s-h*i*f+t*d*f+o*i*m-t*a*m)*L,e[12]=P*L,e[13]=(h*A*r-y*d*r+y*i*p-t*A*p-h*i*x+t*d*x)*L,e[14]=(y*a*r-o*A*r-y*i*l+t*A*l+o*i*x-t*a*x)*L,e[15]=(o*d*r-h*a*r+h*i*l-t*d*l-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,l=e.z,f=s*o,h=s*a;return this.set(f*o+i,f*a-r*l,f*l+r*a,0,f*a+r*l,h*a+i,h*l-r*o,0,f*l-r*a,h*l+r*o,s*l*l+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,l=t._w,f=s+s,h=o+o,d=a+a,p=s*f,m=s*h,y=s*d,A=o*h,x=o*d,g=a*d,_=l*f,S=l*h,E=l*d,P=i.x,b=i.y,L=i.z;return r[0]=(1-(A+g))*P,r[1]=(m+E)*P,r[2]=(y-S)*P,r[3]=0,r[4]=(m-E)*b,r[5]=(1-(p+g))*b,r[6]=(x+_)*b,r[7]=0,r[8]=(y+S)*L,r[9]=(x-_)*L,r[10]=(1-(p+A))*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=Fl.set(r[0],r[1],r[2]).length();const o=Fl.set(r[4],r[5],r[6]).length(),a=Fl.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],br.copy(this);const f=1/s,h=1/o,d=1/a;return br.elements[0]*=f,br.elements[1]*=f,br.elements[2]*=f,br.elements[4]*=h,br.elements[5]*=h,br.elements[6]*=h,br.elements[8]*=d,br.elements[9]*=d,br.elements[10]*=d,t.setFromRotationMatrix(br),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Or){const l=this.elements,f=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),p=(i+r)/(i-r);let m,y;if(a===Or)m=-(o+s)/(o-s),y=-2*o*s/(o-s);else if(a===Wc)m=-o/(o-s),y=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=f,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Or){const l=this.elements,f=1/(t-e),h=1/(i-r),d=1/(o-s),p=(t+e)*f,m=(i+r)*h;let y,A;if(a===Or)y=(o+s)*d,A=-2*d;else if(a===Wc)y=s*d,A=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*f,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=A,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[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 Fl=new U,br=new ut,AH=new U(0,0,0),MH=new U(1,1,1),po=new U,op=new U,Xi=new U,PT=new ut,RT=new hi;class fl{constructor(e=0,t=0,i=0,r=fl.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],l=r[1],f=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(gn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,f),this._z=0);break;case"YXZ":this._x=Math.asin(-gn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,f)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(gn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-gn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(gn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,f),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-gn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,f),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,m),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 PT.makeRotationFromQuaternion(e),this.setFromRotationMatrix(PT,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return RT.setFromEuler(this),this.setFromQuaternion(RT,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}}fl.DEFAULT_ORDER="XYZ";class Xa{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,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.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 l=a.shapes;if(Array.isArray(l))for(let f=0,h=l.length;f0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),f.length>0&&(i.textures=f),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),y.length>0&&(i.nodes=y)}return i.object=r,i;function o(a){const l=[];for(const f in a){const h=a[f];delete h.metadata,l.push(h)}return l}}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){Cr.subVectors(r,t),Es.subVectors(i,t),fy.subVectors(e,t);const o=Cr.dot(Cr),a=Cr.dot(Es),l=Cr.dot(fy),f=Es.dot(Es),h=Es.dot(fy),d=o*f-a*a;if(d===0)return s.set(0,0,0),null;const p=1/d,m=(f*l-a*h)*p,y=(o*h-a*l)*p;return s.set(1-m-y,y,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Ts)===null?!1:Ts.x>=0&&Ts.y>=0&&Ts.x+Ts.y<=1}static getUV(e,t,i,r,s,o,a,l){return lp===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),lp=!0),this.getInterpolation(e,t,i,r,s,o,a,l)}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,Ts)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Ts.x),l.addScaledVector(o,Ts.y),l.addScaledVector(a,Ts.z),l)}static isFrontFacing(e,t,i,r){return Cr.subVectors(i,t),Es.subVectors(e,t),Cr.cross(Es).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 Cr.subVectors(this.c,this.b),Es.subVectors(this.a,this.b),Cr.cross(Es).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ni.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ni.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return lp===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),lp=!0),Ni.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}getInterpolation(e,t,i,r,s){return Ni.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Ni.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ni.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;Bl.subVectors(r,i),zl.subVectors(s,i),hy.subVectors(e,i);const l=Bl.dot(hy),f=zl.dot(hy);if(l<=0&&f<=0)return t.copy(i);dy.subVectors(e,r);const h=Bl.dot(dy),d=zl.dot(dy);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*f;if(p<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(i).addScaledVector(Bl,o);py.subVectors(e,s);const m=Bl.dot(py),y=zl.dot(py);if(y>=0&&m<=y)return t.copy(s);const A=m*f-l*y;if(A<=0&&f>=0&&y<=0)return a=f/(f-y),t.copy(i).addScaledVector(zl,a);const x=h*y-m*d;if(x<=0&&d-h>=0&&m-y>=0)return UT.subVectors(s,r),a=(d-h)/(d-h+(m-y)),t.copy(r).addScaledVector(UT,a);const g=1/(x+A+p);return o=A*g,a=p*g,t.copy(i).addScaledVector(Bl,o).addScaledVector(zl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const bI={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},mo={h:0,s:0,l:0},cp={h:0,s:0,l:0};function my(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 He{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=Dn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,kt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=kt.workingColorSpace){return this.r=e,this.g=t,this.b=i,kt.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=kt.workingColorSpace){if(e=U1(e,1),t=gn(t,0,1),i=gn(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=my(o,s,e+1/3),this.g=my(o,s,e),this.b=my(o,s,e-1/3)}return kt.toWorkingColorSpace(this,r),this}setStyle(e,t=Dn){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=Dn){const i=bI[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=Ic(e.r),this.g=Ic(e.g),this.b=Ic(e.b),this}copyLinearToSRGB(e){return this.r=iy(e.r),this.g=iy(e.g),this.b=iy(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Dn){return kt.fromWorkingColorSpace(ai.copy(this),e),Math.round(gn(ai.r*255,0,255))*65536+Math.round(gn(ai.g*255,0,255))*256+Math.round(gn(ai.b*255,0,255))}getHexString(e=Dn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=kt.workingColorSpace){kt.fromWorkingColorSpace(ai.copy(this),t);const i=ai.r,r=ai.g,s=ai.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,f;const h=(a+o)/2;if(a===o)l=0,f=0;else{const d=o-a;switch(f=h<=.5?d/(o+a):d/(2-o-a),o){case i:l=(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!==Ga&&(i.blending=this.blending),this.side!==Xs&&(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!==Jm&&(i.blendSrc=this.blendSrc),this.blendDst!==Qm&&(i.blendDst=this.blendDst),this.blendEquation!==wo&&(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!==jf&&(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!==k_&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ra&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ra&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ra&&(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 l=s[a];delete l.metadata,o.push(l)}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 ta extends $n{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new He(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=Mh,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 Ls=RH();function RH(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const f=l-127;f<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):f<-14?(i[l]=1024>>-f-14,i[l|256]=1024>>-f-14|32768,r[l]=-f-1,r[l|256]=-f-1):f<=15?(i[l]=f+15<<10,i[l|256]=f+15<<10|32768,r[l]=13,r[l|256]=13):f<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let f=l<<13,h=0;for(;!(f&8388608);)f<<=1,h-=8388608;f&=-8388609,h+=947912704,s[l]=f|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Li(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=gn(n,-65504,65504),Ls.floatView[0]=n;const e=Ls.uint32View[0],t=e>>23&511;return Ls.baseTable[t]+((e&8388607)>>Ls.shiftTable[t])}function tf(n){const e=n>>10;return Ls.uint32View[0]=Ls.mantissaTable[Ls.offsetTable[e]+(n&1023)]+Ls.exponentTable[e],Ls.floatView[0]}const LH={toHalfFloat:Li,fromHalfFloat:tf},bn=new U,up=new me;class Vt{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=nh,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ur,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 l=this.parameters;for(const f in l)l[f]!==void 0&&(e[f]=l[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 l in i){const f=i[l];e.data.attributes[l]=f.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const f=this.morphAttributes[l],h=[];for(let d=0,p=f.length;d0&&(r[l]=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,m=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))&&(OT.copy(s).invert(),ga.copy(e.ray).applyMatrix4(OT),!(i.boundingBox!==null&&ga.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,ga)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,f=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let y=0,A=p.length;yt.far?null:{distance:f,point:vp.clone(),object:n}}function yp(n,e,t,i,r,s,o,a,l,f){n.getVertexPosition(a,Hl),n.getVertexPosition(l,Wl),n.getVertexPosition(f,Gl);const h=zH(n,e,t,i,Hl,Wl,Gl,gp);if(h){r&&(dp.fromBufferAttribute(r,a),pp.fromBufferAttribute(r,l),mp.fromBufferAttribute(r,f),h.uv=Ni.getInterpolation(gp,Hl,Wl,Gl,dp,pp,mp,new me)),s&&(dp.fromBufferAttribute(s,a),pp.fromBufferAttribute(s,l),mp.fromBufferAttribute(s,f),h.uv1=Ni.getInterpolation(gp,Hl,Wl,Gl,dp,pp,mp,new me),h.uv2=h.uv1),o&&(kT.fromBufferAttribute(o,a),BT.fromBufferAttribute(o,l),zT.fromBufferAttribute(o,f),h.normal=Ni.getInterpolation(gp,Hl,Wl,Gl,kT,BT,zT,new U),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:l,c:f,normal:new U,materialIndex:0};Ni.getNormal(Hl,Wl,Gl,d.normal),h.face=d}return h}class hl extends xt{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 l=[],f=[],h=[],d=[];let p=0,m=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(l),this.setAttribute("position",new Ze(f,3)),this.setAttribute("normal",new Ze(h,3)),this.setAttribute("uv",new Ze(d,2));function y(A,x,g,_,S,E,P,b,L,N,C){const R=E/L,F=P/N,K=E/2,le=P/2,H=b/2,q=L+1,ee=N+1;let oe=0,k=0;const j=new U;for(let Y=0;Y0?1:-1,h.push(j.x,j.y,j.z),d.push(ie/L),d.push(1-Y/N),oe+=1}}for(let Y=0;Y0&&(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 Eh extends Dt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ut,this.projectionMatrix=new ut,this.projectionMatrixInverse=new ut,this.coordinateSystem=Or}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)}}class nn extends Eh{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=Gc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ja*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Gc*2*Math.atan(Math.tan(ja*.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(ja*.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 l=o.fullWidth,f=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/f,r*=o.width/l,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 jl=-90,Xl=1;class z1 extends Dt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new nn(jl,Xl,e,t);r.layers=this.layers,this.add(r);const s=new nn(jl,Xl,e,t);s.layers=this.layers,this.add(s);const o=new nn(jl,Xl,e,t);o.layers=this.layers,this.add(o);const a=new nn(jl,Xl,e,t);a.layers=this.layers,this.add(a);const l=new nn(jl,Xl,e,t);l.layers=this.layers,this.add(l);const f=new nn(jl,Xl,e,t);f.layers=this.layers,this.add(f)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const f of t)this.remove(f);if(e===Or)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),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Wc)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),l.up.set(0,-1,0),l.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,l,f,h]=this.children,d=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const A=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,l),e.setRenderTarget(i,4,r),e.render(t,f),i.texture.generateMipmaps=A,e.setRenderTarget(i,5,r),e.render(t,h),e.setRenderTarget(d,p,m),e.xr.enabled=y,i.texture.needsPMREMUpdate=!0}}class Th extends yn{constructor(e,t,i,r,s,o,a,l,f,h){e=e!==void 0?e:[],t=t!==void 0?t:Ys,super(e,t,i,r,s,o,a,l,f,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class V1 extends Vr{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&&(xf("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Vo?Dn:Ki),this.texture=new Th(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:wn}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 hl(5,5,5),s=new ds({name:"CubemapFromEquirect",uniforms:jc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Mi,blending:zs});s.uniforms.tEquirect.value=t;const o=new Rn(r,s),a=t.minFilter;return t.minFilter===Yo&&(t.minFilter=wn),new z1(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 yy=new U,GH=new U,jH=new wt;class Rs{constructor(e=new U(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=yy.subVectors(i,t).cross(GH.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(yy),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||jH.getNormalMatrix(e),r=this.coplanarPoint(yy).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 va=new di,xp=new U;class bh{constructor(e=new Rs,t=new Rs,i=new Rs,r=new Rs,s=new Rs,o=new Rs){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=Or){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],f=r[4],h=r[5],d=r[6],p=r[7],m=r[8],y=r[9],A=r[10],x=r[11],g=r[12],_=r[13],S=r[14],E=r[15];if(i[0].setComponents(l-s,p-f,x-m,E-g).normalize(),i[1].setComponents(l+s,p+f,x+m,E+g).normalize(),i[2].setComponents(l+o,p+h,x+y,E+_).normalize(),i[3].setComponents(l-o,p-h,x-y,E-_).normalize(),i[4].setComponents(l-a,p-d,x-A,E-S).normalize(),t===Or)i[5].setComponents(l+a,p+d,x+A,E+S).normalize();else if(t===Wc)i[5].setComponents(a,d,A,S).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(),va.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),va.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(va)}intersectsSprite(e){return va.center.set(0,0,0),va.radius=.7071067811865476,va.applyMatrix4(e.matrixWorld),this.intersectsSphere(va)}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,xp.y=r.normal.y>0?e.max.y:e.min.y,xp.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(xp)<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 RI(){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 XH(n,e){const t=e.isWebGL2,i=new WeakMap;function r(f,h){const d=f.array,p=f.usage,m=d.byteLength,y=n.createBuffer();n.bindBuffer(h,y),n.bufferData(h,d,p),f.onUploadCallback();let A;if(d instanceof Float32Array)A=n.FLOAT;else if(d instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)A=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else A=n.UNSIGNED_SHORT;else if(d instanceof Int16Array)A=n.SHORT;else if(d instanceof Uint32Array)A=n.UNSIGNED_INT;else if(d instanceof Int32Array)A=n.INT;else if(d instanceof Int8Array)A=n.BYTE;else if(d instanceof Uint8Array)A=n.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)A=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:y,type:A,bytesPerElement:d.BYTES_PER_ELEMENT,version:f.version,size:m}}function s(f,h,d){const p=h.array,m=h._updateRange,y=h.updateRanges;if(n.bindBuffer(d,f),m.count===-1&&y.length===0&&n.bufferSubData(d,0,p),y.length!==0){for(let A=0,x=y.length;A 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`,cW=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,uW=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,fW=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,hW=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,dW=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,pW=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,mW=`#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`,gW=`#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`,vW=`#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`,yW=`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`,xW=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,_W=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,SW=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,AW=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,MW="gl_FragColor = linearToOutputTexel( gl_FragColor );",wW=` +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 ); +}`,EW=`#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`,TW=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,bW=`#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`,CW=`#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`,PW=`#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`,RW=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,LW=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,IW=`#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`,NW=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,DW=`#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 +}`,UW=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,OW=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,FW=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,kW=`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`,BW=`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`,zW=`#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`,VW=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,HW=`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`,WW=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,GW=`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`,jW=`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`,XW=`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 ); +}`,YW=` +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`,qW=`#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`,ZW=`#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`,KW=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,JW=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,QW=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,$W=`#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`,eG=`#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`,tG=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,nG=`#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`,iG=`#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`,rG=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,sG=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,oG=`#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`,aG=`#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`,lG=`#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`,cG=`#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`,uG=`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;`,fG=`#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`,hG=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,dG=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,pG=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,mG=`#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`,gG=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,vG=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,yG=`#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`,xG=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,_G=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,SG=`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 ); +}`,AG=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,MG=`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;`,wG=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,EG=`#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`,TG=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,bG=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,CG=`#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`,PG=`#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`,RG=`#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`,LG=`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; +}`,IG=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,NG=`#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`,DG=`#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`,UG=`#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`,OG=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,FG=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,kG=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,BG=`#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; }`,zG=`#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`,VG=`#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`,HG=`#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`,WG=`#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`,GG=`#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`,jG=`#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 XG=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,YG=`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 +}`,qG=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,ZG=`#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 +}`,KG=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,JG=`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 +}`,QG=`#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; +}`,$G=`#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 +}`,e6=`#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; +}`,t6=`#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 ); +}`,n6=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,i6=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,r6=`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 +}`,s6=`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 +}`,o6=`#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 +}`,a6=`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 +}`,l6=`#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 +}`,c6=`#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 +}`,u6=`#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; +}`,f6=`#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 +}`,h6=`#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 +}`,d6=`#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 +}`,p6=`#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 +}`,m6=`#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 +}`,g6=`#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 +}`,v6=`#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 +}`,y6=`#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 +}`,x6=`#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 +}`,_6=`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 +}`,S6=`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 +}`,A6=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,M6=`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 +}`,w6=`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 +}`,E6=`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 +}`,St={alphahash_fragment:YH,alphahash_pars_fragment:qH,alphamap_fragment:ZH,alphamap_pars_fragment:KH,alphatest_fragment:JH,alphatest_pars_fragment:QH,aomap_fragment:$H,aomap_pars_fragment:eW,batching_pars_vertex:tW,batching_vertex:nW,begin_vertex:iW,beginnormal_vertex:rW,bsdfs:sW,iridescence_fragment:oW,bumpmap_pars_fragment:aW,clipping_planes_fragment:lW,clipping_planes_pars_fragment:cW,clipping_planes_pars_vertex:uW,clipping_planes_vertex:fW,color_fragment:hW,color_pars_fragment:dW,color_pars_vertex:pW,color_vertex:mW,common:gW,cube_uv_reflection_fragment:vW,defaultnormal_vertex:yW,displacementmap_pars_vertex:xW,displacementmap_vertex:_W,emissivemap_fragment:SW,emissivemap_pars_fragment:AW,colorspace_fragment:MW,colorspace_pars_fragment:wW,envmap_fragment:EW,envmap_common_pars_fragment:TW,envmap_pars_fragment:bW,envmap_pars_vertex:CW,envmap_physical_pars_fragment:zW,envmap_vertex:PW,fog_vertex:RW,fog_pars_vertex:LW,fog_fragment:IW,fog_pars_fragment:NW,gradientmap_pars_fragment:DW,lightmap_fragment:UW,lightmap_pars_fragment:OW,lights_lambert_fragment:FW,lights_lambert_pars_fragment:kW,lights_pars_begin:BW,lights_toon_fragment:VW,lights_toon_pars_fragment:HW,lights_phong_fragment:WW,lights_phong_pars_fragment:GW,lights_physical_fragment:jW,lights_physical_pars_fragment:XW,lights_fragment_begin:YW,lights_fragment_maps:qW,lights_fragment_end:ZW,logdepthbuf_fragment:KW,logdepthbuf_pars_fragment:JW,logdepthbuf_pars_vertex:QW,logdepthbuf_vertex:$W,map_fragment:eG,map_pars_fragment:tG,map_particle_fragment:nG,map_particle_pars_fragment:iG,metalnessmap_fragment:rG,metalnessmap_pars_fragment:sG,morphcolor_vertex:oG,morphnormal_vertex:aG,morphtarget_pars_vertex:lG,morphtarget_vertex:cG,normal_fragment_begin:uG,normal_fragment_maps:fG,normal_pars_fragment:hG,normal_pars_vertex:dG,normal_vertex:pG,normalmap_pars_fragment:mG,clearcoat_normal_fragment_begin:gG,clearcoat_normal_fragment_maps:vG,clearcoat_pars_fragment:yG,iridescence_pars_fragment:xG,opaque_fragment:_G,packing:SG,premultiplied_alpha_fragment:AG,project_vertex:MG,dithering_fragment:wG,dithering_pars_fragment:EG,roughnessmap_fragment:TG,roughnessmap_pars_fragment:bG,shadowmap_pars_fragment:CG,shadowmap_pars_vertex:PG,shadowmap_vertex:RG,shadowmask_pars_fragment:LG,skinbase_vertex:IG,skinning_pars_vertex:NG,skinning_vertex:DG,skinnormal_vertex:UG,specularmap_fragment:OG,specularmap_pars_fragment:FG,tonemapping_fragment:kG,tonemapping_pars_fragment:BG,transmission_fragment:zG,transmission_pars_fragment:VG,uv_pars_fragment:HG,uv_pars_vertex:WG,uv_vertex:GG,worldpos_vertex:jG,background_vert:XG,background_frag:YG,backgroundCube_vert:qG,backgroundCube_frag:ZG,cube_vert:KG,cube_frag:JG,depth_vert:QG,depth_frag:$G,distanceRGBA_vert:e6,distanceRGBA_frag:t6,equirect_vert:n6,equirect_frag:i6,linedashed_vert:r6,linedashed_frag:s6,meshbasic_vert:o6,meshbasic_frag:a6,meshlambert_vert:l6,meshlambert_frag:c6,meshmatcap_vert:u6,meshmatcap_frag:f6,meshnormal_vert:h6,meshnormal_frag:d6,meshphong_vert:p6,meshphong_frag:m6,meshphysical_vert:g6,meshphysical_frag:v6,meshtoon_vert:y6,meshtoon_frag:x6,points_vert:_6,points_frag:S6,shadow_vert:A6,shadow_frag:M6,sprite_vert:w6,sprite_frag:E6},Ne={common:{diffuse:{value:new He(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 me(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 He(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 He(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 He(16777215)},opacity:{value:1},center:{value:new me(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}}},Nr={basic:{uniforms:yi([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.fog]),vertexShader:St.meshbasic_vert,fragmentShader:St.meshbasic_frag},lambert:{uniforms:yi([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new He(0)}}]),vertexShader:St.meshlambert_vert,fragmentShader:St.meshlambert_frag},phong:{uniforms:yi([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new He(0)},specular:{value:new He(1118481)},shininess:{value:30}}]),vertexShader:St.meshphong_vert,fragmentShader:St.meshphong_frag},standard:{uniforms:yi([Ne.common,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.roughnessmap,Ne.metalnessmap,Ne.fog,Ne.lights,{emissive:{value:new He(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:St.meshphysical_vert,fragmentShader:St.meshphysical_frag},toon:{uniforms:yi([Ne.common,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.gradientmap,Ne.fog,Ne.lights,{emissive:{value:new He(0)}}]),vertexShader:St.meshtoon_vert,fragmentShader:St.meshtoon_frag},matcap:{uniforms:yi([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,{matcap:{value:null}}]),vertexShader:St.meshmatcap_vert,fragmentShader:St.meshmatcap_frag},points:{uniforms:yi([Ne.points,Ne.fog]),vertexShader:St.points_vert,fragmentShader:St.points_frag},dashed:{uniforms:yi([Ne.common,Ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:St.linedashed_vert,fragmentShader:St.linedashed_frag},depth:{uniforms:yi([Ne.common,Ne.displacementmap]),vertexShader:St.depth_vert,fragmentShader:St.depth_frag},normal:{uniforms:yi([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,{opacity:{value:1}}]),vertexShader:St.meshnormal_vert,fragmentShader:St.meshnormal_frag},sprite:{uniforms:yi([Ne.sprite,Ne.fog]),vertexShader:St.sprite_vert,fragmentShader:St.sprite_frag},background:{uniforms:{uvTransform:{value:new wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:St.background_vert,fragmentShader:St.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:St.backgroundCube_vert,fragmentShader:St.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:St.cube_vert,fragmentShader:St.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:St.equirect_vert,fragmentShader:St.equirect_frag},distanceRGBA:{uniforms:yi([Ne.common,Ne.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:St.distanceRGBA_vert,fragmentShader:St.distanceRGBA_frag},shadow:{uniforms:yi([Ne.lights,Ne.fog,{color:{value:new He(0)},opacity:{value:1}}]),vertexShader:St.shadow_vert,fragmentShader:St.shadow_frag}};Nr.physical={uniforms:yi([Nr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new wt},clearcoatNormalScale:{value:new me(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 He(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 me},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new wt},attenuationDistance:{value:0},attenuationColor:{value:new He(0)},specularColor:{value:new He(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new wt},anisotropyVector:{value:new me},anisotropyMap:{value:null},anisotropyMapTransform:{value:new wt}}]),vertexShader:St.meshphysical_vert,fragmentShader:St.meshphysical_frag};const _p={r:0,b:0,g:0};function T6(n,e,t,i,r,s,o){const a=new He(0);let l=s===!0?0:1,f,h,d=null,p=0,m=null;function y(x,g){let _=!1,S=g.isScene===!0?g.background:null;S&&S.isTexture&&(S=(g.backgroundBlurriness>0?t:e).get(S)),S===null?A(a,l):S&&S.isColor&&(A(S,1),_=!0);const E=n.xr.getEnvironmentBlendMode();E==="additive"?i.buffers.color.setClear(0,0,0,1,o):E==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||_)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),S&&(S.isCubeTexture||S.mapping===$c)?(h===void 0&&(h=new Rn(new hl(1,1,1),new ds({name:"BackgroundCubeMaterial",uniforms:jc(Nr.backgroundCube.uniforms),vertexShader:Nr.backgroundCube.vertexShader,fragmentShader:Nr.backgroundCube.fragmentShader,side:Mi,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(P,b,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=S,h.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,h.material.toneMapped=kt.getTransfer(S.colorSpace)!==Gt,(d!==S||p!==S.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,d=S,p=S.version,m=n.toneMapping),h.layers.enableAll(),x.unshift(h,h.geometry,h.material,0,0,null)):S&&S.isTexture&&(f===void 0&&(f=new Rn(new Ch(2,2),new ds({name:"BackgroundMaterial",uniforms:jc(Nr.background.uniforms),vertexShader:Nr.background.vertexShader,fragmentShader:Nr.background.fragmentShader,side:Xs,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=S,f.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,f.material.toneMapped=kt.getTransfer(S.colorSpace)!==Gt,S.matrixAutoUpdate===!0&&S.updateMatrix(),f.material.uniforms.uvTransform.value.copy(S.matrix),(d!==S||p!==S.version||m!==n.toneMapping)&&(f.material.needsUpdate=!0,d=S,p=S.version,m=n.toneMapping),f.layers.enableAll(),x.unshift(f,f.geometry,f.material,0,0,null))}function A(x,g){x.getRGB(_p,CI(n)),i.buffers.color.setClear(_p.r,_p.g,_p.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(x,g=1){a.set(x),l=g,A(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,A(a,l)},render:y}}function b6(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={},l=x(null);let f=l,h=!1;function d(H,q,ee,oe,k){let j=!1;if(o){const Y=A(oe,ee,q);f!==Y&&(f=Y,m(f.object)),j=g(H,oe,ee,k),j&&_(H,oe,ee,k)}else{const Y=q.wireframe===!0;(f.geometry!==oe.id||f.program!==ee.id||f.wireframe!==Y)&&(f.geometry=oe.id,f.program=ee.id,f.wireframe=Y,j=!0)}k!==null&&t.update(k,n.ELEMENT_ARRAY_BUFFER),(j||h)&&(h=!1,N(H,q,ee,oe),k!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(k).buffer))}function p(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(H){return i.isWebGL2?n.bindVertexArray(H):s.bindVertexArrayOES(H)}function y(H){return i.isWebGL2?n.deleteVertexArray(H):s.deleteVertexArrayOES(H)}function A(H,q,ee){const oe=ee.wireframe===!0;let k=a[H.id];k===void 0&&(k={},a[H.id]=k);let j=k[q.id];j===void 0&&(j={},k[q.id]=j);let Y=j[oe];return Y===void 0&&(Y=x(p()),j[oe]=Y),Y}function x(H){const q=[],ee=[],oe=[];for(let k=0;k=0){const fe=k[ie];let ve=j[ie];if(ve===void 0&&(ie==="instanceMatrix"&&H.instanceMatrix&&(ve=H.instanceMatrix),ie==="instanceColor"&&H.instanceColor&&(ve=H.instanceColor)),fe===void 0||fe.attribute!==ve||ve&&fe.data!==ve.data)return!0;Y++}return f.attributesNum!==Y||f.index!==oe}function _(H,q,ee,oe){const k={},j=q.attributes;let Y=0;const J=ee.getAttributes();for(const ie in J)if(J[ie].location>=0){let fe=j[ie];fe===void 0&&(ie==="instanceMatrix"&&H.instanceMatrix&&(fe=H.instanceMatrix),ie==="instanceColor"&&H.instanceColor&&(fe=H.instanceColor));const ve={};ve.attribute=fe,fe&&fe.data&&(ve.data=fe.data),k[ie]=ve,Y++}f.attributes=k,f.attributesNum=Y,f.index=oe}function S(){const H=f.newAttributes;for(let q=0,ee=H.length;q=0){let $=k[J];if($===void 0&&(J==="instanceMatrix"&&H.instanceMatrix&&($=H.instanceMatrix),J==="instanceColor"&&H.instanceColor&&($=H.instanceColor)),$!==void 0){const fe=$.normalized,ve=$.itemSize,be=t.get($);if(be===void 0)continue;const Pe=be.buffer,Je=be.type,nt=be.bytesPerElement,Le=i.isWebGL2===!0&&(Je===n.INT||Je===n.UNSIGNED_INT||$.gpuType===E1);if($.isInterleavedBufferAttribute){const Te=$.data,W=Te.stride,ye=$.offset;if(Te.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 a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);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),m=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),A=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),_=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),S=p>0,E=o||e.has("OES_texture_float"),P=S&&E,b=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:m,maxCubemapSize:y,maxAttributes:A,maxVertexUniforms:x,maxVaryings:g,maxFragmentUniforms:_,vertexTextures:S,floatFragmentTextures:E,floatVertexTextures:P,maxSamples:b}}function R6(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Rs,a=new wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const m=d.length!==0||p||i!==0||r;return r=p,i=d.length,m},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,m){const y=d.clippingPlanes,A=d.clipIntersection,x=d.clipShadows,g=n.get(d);if(!r||y===null||y.length===0||s&&!x)s?h(null):f();else{const _=s?0:i,S=_*4;let E=g.clippingState||null;l.value=E,E=h(y,p,S,m);for(let P=0;P!==S;++P)E[P]=t[P];g.clippingState=E,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=_}};function f(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,m,y){const A=d!==null?d.length:0;let x=null;if(A!==0){if(x=l.value,y!==!0||x===null){const g=m+A*4,_=p.matrixWorldInverse;a.getNormalMatrix(_),(x===null||x.length0){const f=new V1(l.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 l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Fr extends Eh{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,l=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,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,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 _c=4,VT=[.125,.215,.35,.446,.526,.582],Ia=20,xy=new Fr,HT=new He;let _y=null,Sy=0,Ay=0;const La=(1+Math.sqrt(5))/2,Yl=1/La,WT=[new U(1,1,1),new U(-1,1,1),new U(1,1,-1),new U(-1,1,-1),new U(0,La,Yl),new U(0,La,-Yl),new U(Yl,0,La),new U(-Yl,0,La),new U(La,Yl,0),new U(-La,Yl,0)];class V_{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){_y=this._renderer.getRenderTarget(),Sy=this._renderer.getActiveCubeFace(),Ay=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=XT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=jT(),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?S:0,S,S),h.setRenderTarget(r),A&&h.render(y,a),h.render(e,a)}y.geometry.dispose(),y.material.dispose(),h.toneMapping=p,h.autoClear=d,e.background=x}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Ys||e.mapping===Xo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=XT()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=jT());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Rn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Sp(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,xy)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;rIa&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Ia}`);const g=[];let _=0;for(let L=0;LS-_c?r-S+_c:0),b=4*(this._cubeSize-E);Sp(t,P,b,3*E,2*E),l.setRenderTarget(t),l.render(d,xy)}}function I6(n){const e=[],t=[],i=[];let r=n;const s=n-_c+1+VT.length;for(let o=0;on-_c?l=VT[o-n+_c-1]:o===0&&(l=0),i.push(l);const f=1/(a-2),h=-f,d=1+f,p=[h,h,d,h,d,d,h,h,d,d,h,d],m=6,y=6,A=3,x=2,g=1,_=new Float32Array(A*y*m),S=new Float32Array(x*y*m),E=new Float32Array(g*y*m);for(let b=0;b2?0:-1,C=[L,N,0,L+2/3,N,0,L+2/3,N+1,0,L,N,0,L+2/3,N+1,0,L,N+1,0];_.set(C,A*y*b),S.set(p,x*y*b);const R=[b,b,b,b,b,b];E.set(R,g*y*b)}const P=new xt;P.setAttribute("position",new Vt(_,A)),P.setAttribute("uv",new Vt(S,x)),P.setAttribute("faceIndex",new Vt(E,g)),e.push(P),r>_c&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function GT(n,e,t){const i=new Vr(n,e,t);return i.texture.mapping=$c,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Sp(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function N6(n,e,t){const i=new Float32Array(Ia),r=new U(0,1,0);return new ds({name:"SphericalGaussianBlur",defines:{n:Ia,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:H1(),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:zs,depthTest:!1,depthWrite:!1})}function jT(){return new ds({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:H1(),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:zs,depthTest:!1,depthWrite:!1})}function XT(){return new ds({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:H1(),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:zs,depthTest:!1,depthWrite:!1})}function H1(){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 D6(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,f=l===Xf||l===Yf,h=l===Ys||l===Xo;if(f||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return t===null&&(t=new V_(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 V_(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 l=0;const f=6;for(let h=0;he.maxTextureSize&&(F=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const K=new Float32Array(R*F*4*A),le=new Bg(K,R,F,A);le.type=Ur,le.needsUpdate=!0;const H=C*4;for(let ee=0;ee0)return n;const r=e*t;let s=YT[r];if(s===void 0&&(s=new Float32Array(r),YT[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 On(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}function O8(n){const e=kt.getPrimaries(kt.workingColorSpace),t=kt.getPrimaries(n);let i;switch(e===t?i="":e===th&&t===eh?i="LinearDisplayP3ToLinearSRGB":e===eh&&t===th&&(i="LinearSRGBToLinearDisplayP3"),n){case hs:case wh:return[i,"LinearTransferOETF"];case Dn:case kg:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function eb(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+` + +`+U8(n.getShaderSource(e),o)}else return r}function F8(n,e){const t=O8(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function k8(n,e){let t;switch(e){case KL:t="Linear";break;case JL:t="Reinhard";break;case QL:t="OptimizedCineon";break;case M1:t="ACESFilmic";break;case eI:t="AgX";break;case $L:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function B8(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(Sc).join(` +`)}function z8(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":""].filter(Sc).join(` +`)}function V8(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function H8(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function H_(n){return n.replace(W8,j8)}const G8=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function j8(n,e){let t=St[e];if(t===void 0){const i=G8.get(e);if(i!==void 0)t=St[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 H_(t)}const X8=/#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 ib(n){return n.replace(X8,Y8)}function Y8(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(g+=` +`),_=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A].filter(Sc).join(` +`),_.length>0&&(_+=` +`)):(g=[rb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A,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 "+l:"",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(Sc).join(` +`),_=[m,rb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A,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 "+l:"",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!==cs?"#define TONE_MAPPING":"",t.toneMapping!==cs?St.tonemapping_pars_fragment:"",t.toneMapping!==cs?k8("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",St.colorspace_pars_fragment,F8("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Sc).join(` +`)),o=H_(o),o=tb(o,t),o=nb(o,t),a=H_(a),a=tb(a,t),a=nb(a,t),o=ib(o),a=ib(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(S=`#version 300 es +`,g=[y,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===B_?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===B_?"":"#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(` +`)+` +`+_);const E=S+g+o,P=S+_+a,b=$T(r,r.VERTEX_SHADER,E),L=$T(r,r.FRAGMENT_SHADER,P);r.attachShader(x,b),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 N(K){if(n.debug.checkShaderErrors){const le=r.getProgramInfoLog(x).trim(),H=r.getShaderInfoLog(b).trim(),q=r.getShaderInfoLog(L).trim();let ee=!0,oe=!0;if(r.getProgramParameter(x,r.LINK_STATUS)===!1)if(ee=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,x,b,L);else{const k=eb(r,b,"vertex"),j=eb(r,L,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(x,r.VALIDATE_STATUS)+` + +Program Info Log: `+le+` +`+k+` +`+j)}else le!==""?console.warn("THREE.WebGLProgram: Program Info Log:",le):(H===""||q==="")&&(oe=!1);oe&&(K.diagnostics={runnable:ee,programLog:le,vertexShader:{log:H,prefix:g},fragmentShader:{log:q,prefix:_}})}r.deleteShader(b),r.deleteShader(L),C=new mm(r,x),R=H8(r,x)}let C;this.getUniforms=function(){return C===void 0&&N(this),C};let R;this.getAttributes=function(){return R===void 0&&N(this),R};let F=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return F===!1&&(F=r.getProgramParameter(x,N8)),F},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(x),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=D8++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=b,this.fragmentShader=L,this}let ej=0;class tj{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 nj(e),t.set(e,i)),i}}class nj{constructor(e){this.id=ej++,this.code=e,this.usedTimes=0}}function ij(n,e,t,i,r,s,o){const a=new Xa,l=new tj,f=[],h=r.isWebGL2,d=r.logarithmicDepthBuffer,p=r.vertexTextures;let m=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 A(C){return C===0?"uv":`uv${C}`}function x(C,R,F,K,le){const H=K.fog,q=le.geometry,ee=C.isMeshStandardMaterial?K.environment:null,oe=(C.isMeshStandardMaterial?t:e).get(C.envMap||ee),k=oe&&oe.mapping===$c?oe.image.height:null,j=y[C.type];C.precision!==null&&(m=r.getMaxPrecision(C.precision),m!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",m,"instead."));const Y=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,J=Y!==void 0?Y.length:0;let ie=0;q.morphAttributes.position!==void 0&&(ie=1),q.morphAttributes.normal!==void 0&&(ie=2),q.morphAttributes.color!==void 0&&(ie=3);let $,fe,ve,be;if(j){const Qt=Nr[j];$=Qt.vertexShader,fe=Qt.fragmentShader}else $=C.vertexShader,fe=C.fragmentShader,l.update(C),ve=l.getVertexShaderID(C),be=l.getFragmentShaderID(C);const Pe=n.getRenderTarget(),Je=le.isInstancedMesh===!0,nt=le.isBatchedMesh===!0,Le=!!C.map,Te=!!C.matcap,W=!!oe,ye=!!C.aoMap,de=!!C.lightMap,we=!!C.bumpMap,pe=!!C.normalMap,We=!!C.displacementMap,De=!!C.emissiveMap,D=!!C.metalnessMap,I=!!C.roughnessMap,te=C.anisotropy>0,Se=C.clearcoat>0,_e=C.iridescence>0,xe=C.sheen>0,qe=C.transmission>0,Ie=te&&!!C.anisotropyMap,Ue=Se&&!!C.clearcoatMap,it=Se&&!!C.clearcoatNormalMap,pt=Se&&!!C.clearcoatRoughnessMap,Ae=_e&&!!C.iridescenceMap,Ct=_e&&!!C.iridescenceThicknessMap,_t=xe&&!!C.sheenColorMap,ft=xe&&!!C.sheenRoughnessMap,tt=!!C.specularMap,Ge=!!C.specularColorMap,X=!!C.specularIntensityMap,ge=qe&&!!C.transmissionMap,ze=qe&&!!C.thicknessMap,ke=!!C.gradientMap,Me=!!C.alphaMap,G=C.alphaTest>0,Re=!!C.alphaHash,Oe=!!C.extensions,rt=!!q.attributes.uv1,Ke=!!q.attributes.uv2,bt=!!q.attributes.uv3;let Rt=cs;return C.toneMapped&&(Pe===null||Pe.isXRRenderTarget===!0)&&(Rt=n.toneMapping),{isWebGL2:h,shaderID:j,shaderType:C.type,shaderName:C.name,vertexShader:$,fragmentShader:fe,defines:C.defines,customVertexShaderID:ve,customFragmentShaderID:be,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:m,batching:nt,instancing:Je,instancingColor:Je&&le.instanceColor!==null,supportsVertexTextures:p,outputColorSpace:Pe===null?n.outputColorSpace:Pe.isXRRenderTarget===!0?Pe.texture.colorSpace:hs,map:Le,matcap:Te,envMap:W,envMapMode:W&&oe.mapping,envMapCubeUVHeight:k,aoMap:ye,lightMap:de,bumpMap:we,normalMap:pe,displacementMap:p&&We,emissiveMap:De,normalMapObjectSpace:pe&&C.normalMapType===mI,normalMapTangentSpace:pe&&C.normalMapType===ea,metalnessMap:D,roughnessMap:I,anisotropy:te,anisotropyMap:Ie,clearcoat:Se,clearcoatMap:Ue,clearcoatNormalMap:it,clearcoatRoughnessMap:pt,iridescence:_e,iridescenceMap:Ae,iridescenceThicknessMap:Ct,sheen:xe,sheenColorMap:_t,sheenRoughnessMap:ft,specularMap:tt,specularColorMap:Ge,specularIntensityMap:X,transmission:qe,transmissionMap:ge,thicknessMap:ze,gradientMap:ke,opaque:C.transparent===!1&&C.blending===Ga,alphaMap:Me,alphaTest:G,alphaHash:Re,combine:C.combine,mapUv:Le&&A(C.map.channel),aoMapUv:ye&&A(C.aoMap.channel),lightMapUv:de&&A(C.lightMap.channel),bumpMapUv:we&&A(C.bumpMap.channel),normalMapUv:pe&&A(C.normalMap.channel),displacementMapUv:We&&A(C.displacementMap.channel),emissiveMapUv:De&&A(C.emissiveMap.channel),metalnessMapUv:D&&A(C.metalnessMap.channel),roughnessMapUv:I&&A(C.roughnessMap.channel),anisotropyMapUv:Ie&&A(C.anisotropyMap.channel),clearcoatMapUv:Ue&&A(C.clearcoatMap.channel),clearcoatNormalMapUv:it&&A(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pt&&A(C.clearcoatRoughnessMap.channel),iridescenceMapUv:Ae&&A(C.iridescenceMap.channel),iridescenceThicknessMapUv:Ct&&A(C.iridescenceThicknessMap.channel),sheenColorMapUv:_t&&A(C.sheenColorMap.channel),sheenRoughnessMapUv:ft&&A(C.sheenRoughnessMap.channel),specularMapUv:tt&&A(C.specularMap.channel),specularColorMapUv:Ge&&A(C.specularColorMap.channel),specularIntensityMapUv:X&&A(C.specularIntensityMap.channel),transmissionMapUv:ge&&A(C.transmissionMap.channel),thicknessMapUv:ze&&A(C.thicknessMap.channel),alphaMapUv:Me&&A(C.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(pe||te),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,vertexUv1s:rt,vertexUv2s:Ke,vertexUv3s:bt,pointsUvs:le.isPoints===!0&&!!q.attributes.uv&&(Le||Me),fog:!!H,useFog:C.fog===!0,fogExp2:H&&H.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.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:J,morphTextureStride:ie,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:C.dithering,shadowMapEnabled:n.shadowMap.enabled&&F.length>0,shadowMapType:n.shadowMap.type,toneMapping:Rt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Le&&C.map.isVideoTexture===!0&&kt.getTransfer(C.map.colorSpace)===Gt,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Dr,flipSided:C.side===Mi,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:Oe&&C.extensions.derivatives===!0,extensionFragDepth:Oe&&C.extensions.fragDepth===!0,extensionDrawBuffers:Oe&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:Oe&&C.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Oe&&C.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:C.customProgramCacheKey()}}function g(C){const R=[];if(C.shaderID?R.push(C.shaderID):(R.push(C.customVertexShaderID),R.push(C.customFragmentShaderID)),C.defines!==void 0)for(const F in C.defines)R.push(F),R.push(C.defines[F]);return C.isRawShaderMaterial===!1&&(_(R,C),S(R,C),R.push(n.outputColorSpace)),R.push(C.customProgramCacheKey),R.join()}function _(C,R){C.push(R.precision),C.push(R.outputColorSpace),C.push(R.envMapMode),C.push(R.envMapCubeUVHeight),C.push(R.mapUv),C.push(R.alphaMapUv),C.push(R.lightMapUv),C.push(R.aoMapUv),C.push(R.bumpMapUv),C.push(R.normalMapUv),C.push(R.displacementMapUv),C.push(R.emissiveMapUv),C.push(R.metalnessMapUv),C.push(R.roughnessMapUv),C.push(R.anisotropyMapUv),C.push(R.clearcoatMapUv),C.push(R.clearcoatNormalMapUv),C.push(R.clearcoatRoughnessMapUv),C.push(R.iridescenceMapUv),C.push(R.iridescenceThicknessMapUv),C.push(R.sheenColorMapUv),C.push(R.sheenRoughnessMapUv),C.push(R.specularMapUv),C.push(R.specularColorMapUv),C.push(R.specularIntensityMapUv),C.push(R.transmissionMapUv),C.push(R.thicknessMapUv),C.push(R.combine),C.push(R.fogExp2),C.push(R.sizeAttenuation),C.push(R.morphTargetsCount),C.push(R.morphAttributeCount),C.push(R.numDirLights),C.push(R.numPointLights),C.push(R.numSpotLights),C.push(R.numSpotLightMaps),C.push(R.numHemiLights),C.push(R.numRectAreaLights),C.push(R.numDirLightShadows),C.push(R.numPointLightShadows),C.push(R.numSpotLightShadows),C.push(R.numSpotLightShadowsWithMaps),C.push(R.numLightProbes),C.push(R.shadowMapType),C.push(R.toneMapping),C.push(R.numClippingPlanes),C.push(R.numClipIntersection),C.push(R.depthPacking)}function S(C,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),C.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),C.push(a.mask)}function E(C){const R=y[C.type];let F;if(R){const K=Nr[R];F=PI.clone(K.uniforms)}else F=C.uniforms;return F}function P(C,R){let F;for(let K=0,le=f.length;K0?i.push(g):m.transparent===!0?r.push(g):t.push(g)}function l(d,p,m,y,A,x){const g=o(d,p,m,y,A,x);m.transmission>0?i.unshift(g):m.transparent===!0?r.unshift(g):t.unshift(g)}function f(d,p){t.length>1&&t.sort(d||sj),i.length>1&&i.sort(p||sb),r.length>1&&r.sort(p||sb)}function h(){for(let d=e,p=n.length;d=s.length?(o=new ob,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function aj(){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 U,color:new He};break;case"SpotLight":t={position:new U,direction:new U,color:new He,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new U,color:new He,distance:0,decay:0};break;case"HemisphereLight":t={direction:new U,skyColor:new He,groundColor:new He};break;case"RectAreaLight":t={color:new He,position:new U,halfWidth:new U,halfHeight:new U};break}return n[e.id]=t,t}}}function lj(){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 me};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new me};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new me,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let cj=0;function uj(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function fj(n,e){const t=new aj,i=lj(),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 U);const s=new U,o=new ut,a=new ut;function l(h,d){let p=0,m=0,y=0;for(let K=0;K<9;K++)r.probe[K].set(0,0,0);let A=0,x=0,g=0,_=0,S=0,E=0,P=0,b=0,L=0,N=0,C=0;h.sort(uj);const R=d===!0?Math.PI:1;for(let K=0,le=h.length;K0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Ne.LTC_FLOAT_1,r.rectAreaLTC2=Ne.LTC_FLOAT_2):(r.rectAreaLTC1=Ne.LTC_HALF_1,r.rectAreaLTC2=Ne.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Ne.LTC_FLOAT_1,r.rectAreaLTC2=Ne.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Ne.LTC_HALF_1,r.rectAreaLTC2=Ne.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=p,r.ambient[1]=m,r.ambient[2]=y;const F=r.hash;(F.directionalLength!==A||F.pointLength!==x||F.spotLength!==g||F.rectAreaLength!==_||F.hemiLength!==S||F.numDirectionalShadows!==E||F.numPointShadows!==P||F.numSpotShadows!==b||F.numSpotMaps!==L||F.numLightProbes!==C)&&(r.directional.length=A,r.spot.length=g,r.rectArea.length=_,r.point.length=x,r.hemi.length=S,r.directionalShadow.length=E,r.directionalShadowMap.length=E,r.pointShadow.length=P,r.pointShadowMap.length=P,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=E,r.pointShadowMatrix.length=P,r.spotLightMatrix.length=b+L-N,r.spotLightMap.length=L,r.numSpotLightShadowsWithMaps=N,r.numLightProbes=C,F.directionalLength=A,F.pointLength=x,F.spotLength=g,F.rectAreaLength=_,F.hemiLength=S,F.numDirectionalShadows=E,F.numPointShadows=P,F.numSpotShadows=b,F.numSpotMaps=L,F.numLightProbes=C,r.version=cj++)}function f(h,d){let p=0,m=0,y=0,A=0,x=0;const g=d.matrixWorldInverse;for(let _=0,S=h.length;_=a.length?(l=new ab(n,e),a.push(l)):l=a[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class G1 extends $n{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=dI,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 j1 extends $n{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 dj=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,pj=`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 mj(n,e,t){let i=new bh;const r=new me,s=new me,o=new Bt,a=new G1({depthPacking:pI}),l=new j1,f={},h=t.maxTextureSize,d={[Xs]:Mi,[Mi]:Xs,[Dr]:Dr},p=new ds({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new me},radius:{value:4}},vertexShader:dj,fragmentShader:pj}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const y=new xt;y.setAttribute("position",new Vt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const A=new Rn(y,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Dg;let g=this.type;this.render=function(b,L,N){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||b.length===0)return;const C=n.getRenderTarget(),R=n.getActiveCubeFace(),F=n.getActiveMipmapLevel(),K=n.state;K.setBlending(zs),K.buffers.color.setClear(1,1,1,1),K.buffers.depth.setTest(!0),K.setScissorTest(!1);const le=g!==Rr&&this.type===Rr,H=g===Rr&&this.type!==Rr;for(let q=0,ee=b.length;qh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/j.x),r.x=s.x*j.x,k.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/j.y),r.y=s.y*j.y,k.mapSize.y=s.y)),k.map===null||le===!0||H===!0){const J=this.type!==Rr?{minFilter:An,magFilter:An}:{};k.map!==null&&k.map.dispose(),k.map=new Vr(r.x,r.y,J),k.map.texture.name=oe.name+".shadowMap",k.camera.updateProjectionMatrix()}n.setRenderTarget(k.map),n.clear();const Y=k.getViewportCount();for(let J=0;J0||L.map&&L.alphaTest>0){const K=R.uuid,le=L.uuid;let H=f[K];H===void 0&&(H={},f[K]=H);let q=H[le];q===void 0&&(q=R.clone(),H[le]=q,L.addEventListener("dispose",P)),R=q}if(R.visible=L.visible,R.wireframe=L.wireframe,C===Rr?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,N.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const K=n.properties.get(R);K.light=N}return R}function E(b,L,N,C,R){if(b.visible===!1)return;if(b.layers.test(L.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&R===Rr)&&(!b.frustumCulled||i.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,b.matrixWorld);const le=e.update(b),H=b.material;if(Array.isArray(H)){const q=le.groups;for(let ee=0,oe=q.length;ee=1):Y.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),k=j>=2);let J=null,ie={};const $=n.getParameter(n.SCISSOR_BOX),fe=n.getParameter(n.VIEWPORT),ve=new Bt().fromArray($),be=new Bt().fromArray(fe);function Pe(G,Re,Oe,rt){const Ke=new Uint8Array(4),bt=n.createTexture();n.bindTexture(G,bt),n.texParameteri(G,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(G,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 m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(D,I){return m?new OffscreenCanvas(D,I):ih("canvas")}function A(D,I,te,Se){let _e=1;if((D.width>Se||D.height>Se)&&(_e=Se/Math.max(D.width,D.height)),_e<1||I===!0)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap){const xe=I?tg:Math.floor,qe=xe(_e*D.width),Ie=xe(_e*D.height);d===void 0&&(d=y(qe,Ie));const Ue=te?y(qe,Ie):d;return Ue.width=qe,Ue.height=Ie,Ue.getContext("2d").drawImage(D,0,0,qe,Ie),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+D.width+"x"+D.height+") to ("+qe+"x"+Ie+")."),Ue}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 z_(D.width)&&z_(D.height)}function g(D){return a?!1:D.wrapS!==fi||D.wrapT!==fi||D.minFilter!==An&&D.minFilter!==wn}function _(D,I){return D.generateMipmaps&&I&&D.minFilter!==An&&D.minFilter!==wn}function S(D){n.generateMipmap(D)}function E(D,I,te,Se,_e=!1){if(a===!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 xe=I;if(I===n.RED&&(te===n.FLOAT&&(xe=n.R32F),te===n.HALF_FLOAT&&(xe=n.R16F),te===n.UNSIGNED_BYTE&&(xe=n.R8)),I===n.RED_INTEGER&&(te===n.UNSIGNED_BYTE&&(xe=n.R8UI),te===n.UNSIGNED_SHORT&&(xe=n.R16UI),te===n.UNSIGNED_INT&&(xe=n.R32UI),te===n.BYTE&&(xe=n.R8I),te===n.SHORT&&(xe=n.R16I),te===n.INT&&(xe=n.R32I)),I===n.RG&&(te===n.FLOAT&&(xe=n.RG32F),te===n.HALF_FLOAT&&(xe=n.RG16F),te===n.UNSIGNED_BYTE&&(xe=n.RG8)),I===n.RGBA){const qe=_e?$f:kt.getTransfer(Se);te===n.FLOAT&&(xe=n.RGBA32F),te===n.HALF_FLOAT&&(xe=n.RGBA16F),te===n.UNSIGNED_BYTE&&(xe=qe===Gt?n.SRGB8_ALPHA8:n.RGBA8),te===n.UNSIGNED_SHORT_4_4_4_4&&(xe=n.RGBA4),te===n.UNSIGNED_SHORT_5_5_5_1&&(xe=n.RGB5_A1)}return(xe===n.R16F||xe===n.R32F||xe===n.RG16F||xe===n.RG32F||xe===n.RGBA16F||xe===n.RGBA32F)&&e.get("EXT_color_buffer_float"),xe}function P(D,I,te){return _(D,te)===!0||D.isFramebufferTexture&&D.minFilter!==An&&D.minFilter!==wn?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 b(D){return D===An||D===$m||D===vf?n.NEAREST:n.LINEAR}function L(D){const I=D.target;I.removeEventListener("dispose",L),C(I),I.isVideoTexture&&h.delete(I)}function N(D){const I=D.target;I.removeEventListener("dispose",N),F(I)}function C(D){const I=i.get(D);if(I.__webglInit===void 0)return;const te=D.source,Se=p.get(te);if(Se){const _e=Se[I.__cacheKey];_e.usedTimes--,_e.usedTimes===0&&R(D),Object.keys(Se).length===0&&p.delete(te)}i.remove(D)}function R(D){const I=i.get(D);n.deleteTexture(I.__webglTexture);const te=D.source,Se=p.get(te);delete Se[I.__cacheKey],o.memory.textures--}function F(D){const I=D.texture,te=i.get(D),Se=i.get(I);if(Se.__webglTexture!==void 0&&(n.deleteTexture(Se.__webglTexture),o.memory.textures--),D.depthTexture&&D.depthTexture.dispose(),D.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++){if(Array.isArray(te.__webglFramebuffer[_e]))for(let xe=0;xe=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+r.maxTextures),K+=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 ee(D,I){const te=i.get(D);if(D.isVideoTexture&&We(D),D.isRenderTargetTexture===!1&&D.version>0&&te.__version!==D.version){const Se=D.image;if(Se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ve(te,D,I);return}}t.bindTexture(n.TEXTURE_2D,te.__webglTexture,n.TEXTURE0+I)}function oe(D,I){const te=i.get(D);if(D.version>0&&te.__version!==D.version){ve(te,D,I);return}t.bindTexture(n.TEXTURE_2D_ARRAY,te.__webglTexture,n.TEXTURE0+I)}function k(D,I){const te=i.get(D);if(D.version>0&&te.__version!==D.version){ve(te,D,I);return}t.bindTexture(n.TEXTURE_3D,te.__webglTexture,n.TEXTURE0+I)}function j(D,I){const te=i.get(D);if(D.version>0&&te.__version!==D.version){be(te,D,I);return}t.bindTexture(n.TEXTURE_CUBE_MAP,te.__webglTexture,n.TEXTURE0+I)}const Y={[qf]:n.REPEAT,[fi]:n.CLAMP_TO_EDGE,[Zf]:n.MIRRORED_REPEAT},J={[An]:n.NEAREST,[$m]:n.NEAREST_MIPMAP_NEAREST,[vf]:n.NEAREST_MIPMAP_LINEAR,[wn]:n.LINEAR,[w1]:n.LINEAR_MIPMAP_NEAREST,[Yo]:n.LINEAR_MIPMAP_LINEAR},ie={[gI]:n.NEVER,[AI]:n.ALWAYS,[vI]:n.LESS,[D1]:n.LEQUAL,[yI]:n.EQUAL,[SI]:n.GEQUAL,[xI]:n.GREATER,[_I]:n.NOTEQUAL};function $(D,I,te){if(te?(n.texParameteri(D,n.TEXTURE_WRAP_S,Y[I.wrapS]),n.texParameteri(D,n.TEXTURE_WRAP_T,Y[I.wrapT]),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,Y[I.wrapR]),n.texParameteri(D,n.TEXTURE_MAG_FILTER,J[I.magFilter]),n.texParameteri(D,n.TEXTURE_MIN_FILTER,J[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!==fi||I.wrapT!==fi)&&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,b(I.magFilter)),n.texParameteri(D,n.TEXTURE_MIN_FILTER,b(I.minFilter)),I.minFilter!==An&&I.minFilter!==wn&&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,ie[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const Se=e.get("EXT_texture_filter_anisotropic");if(I.magFilter===An||I.minFilter!==vf&&I.minFilter!==Yo||I.type===Ur&&e.has("OES_texture_float_linear")===!1||a===!1&&I.type===Hc&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||i.get(I).__currentAnisotropy)&&(n.texParameterf(D,Se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,r.getMaxAnisotropy())),i.get(I).__currentAnisotropy=I.anisotropy)}}function fe(D,I){let te=!1;D.__webglInit===void 0&&(D.__webglInit=!0,I.addEventListener("dispose",L));const Se=I.source;let _e=p.get(Se);_e===void 0&&(_e={},p.set(Se,_e));const xe=q(I);if(xe!==D.__cacheKey){_e[xe]===void 0&&(_e[xe]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,te=!0),_e[xe].usedTimes++;const qe=_e[D.__cacheKey];qe!==void 0&&(_e[D.__cacheKey].usedTimes--,qe.usedTimes===0&&R(I)),D.__cacheKey=xe,D.__webglTexture=_e[xe].texture}return te}function ve(D,I,te){let Se=n.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(Se=n.TEXTURE_2D_ARRAY),I.isData3DTexture&&(Se=n.TEXTURE_3D);const _e=fe(D,I),xe=I.source;t.bindTexture(Se,D.__webglTexture,n.TEXTURE0+te);const qe=i.get(xe);if(xe.version!==qe.__version||_e===!0){t.activeTexture(n.TEXTURE0+te);const Ie=kt.getPrimaries(kt.workingColorSpace),Ue=I.colorSpace===Ki?null:kt.getPrimaries(I.colorSpace),it=I.colorSpace===Ki||Ie===Ue?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,it);const pt=g(I)&&x(I.image)===!1;let Ae=A(I.image,pt,!1,r.maxTextureSize);Ae=De(I,Ae);const Ct=x(Ae)||a,_t=s.convert(I.format,I.colorSpace);let ft=s.convert(I.type),tt=E(I.internalFormat,_t,ft,I.colorSpace,I.isVideoTexture);$(Se,I,Ct);let Ge;const X=I.mipmaps,ge=a&&I.isVideoTexture!==!0&&tt!==L1,ze=qe.__version===void 0||_e===!0,ke=P(I,Ae,Ct);if(I.isDepthTexture)tt=n.DEPTH_COMPONENT,a?I.type===Ur?tt=n.DEPTH_COMPONENT32F:I.type===Us?tt=n.DEPTH_COMPONENT24:I.type===Bo?tt=n.DEPTH24_STENCIL8:tt=n.DEPTH_COMPONENT16:I.type===Ur&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===zo&&tt===n.DEPTH_COMPONENT&&I.type!==Og&&I.type!==Us&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=Us,ft=s.convert(I.type)),I.format===el&&tt===n.DEPTH_COMPONENT&&(tt=n.DEPTH_STENCIL,I.type!==Bo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=Bo,ft=s.convert(I.type))),ze&&(ge?t.texStorage2D(n.TEXTURE_2D,1,tt,Ae.width,Ae.height):t.texImage2D(n.TEXTURE_2D,0,tt,Ae.width,Ae.height,0,_t,ft,null));else if(I.isDataTexture)if(X.length>0&&Ct){ge&&ze&&t.texStorage2D(n.TEXTURE_2D,ke,tt,X[0].width,X[0].height);for(let Me=0,G=X.length;Me>=1,G>>=1}}else if(X.length>0&&Ct){ge&&ze&&t.texStorage2D(n.TEXTURE_2D,ke,tt,X[0].width,X[0].height);for(let Me=0,G=X.length;Me0&&ze++,t.texStorage2D(n.TEXTURE_CUBE_MAP,ze,Ge,Ae[0].width,Ae[0].height));for(let Me=0;Me<6;Me++)if(pt){X?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Me,0,0,0,Ae[Me].width,Ae[Me].height,ft,tt,Ae[Me].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Me,0,Ge,Ae[Me].width,Ae[Me].height,0,ft,tt,Ae[Me].data);for(let G=0;G>xe),Ae=Math.max(1,I.height>>xe);_e===n.TEXTURE_3D||_e===n.TEXTURE_2D_ARRAY?t.texImage3D(_e,xe,Ue,pt,Ae,I.depth,0,qe,Ie,null):t.texImage2D(_e,xe,Ue,pt,Ae,0,qe,Ie,null)}t.bindFramebuffer(n.FRAMEBUFFER,D),pe(I)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Se,_e,i.get(te).__webglTexture,0,we(I)):(_e===n.TEXTURE_2D||_e>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&_e<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Se,_e,i.get(te).__webglTexture,xe),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Je(D,I,te){if(n.bindRenderbuffer(n.RENDERBUFFER,D),I.depthBuffer&&!I.stencilBuffer){let Se=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(te||pe(I)){const _e=I.depthTexture;_e&&_e.isDepthTexture&&(_e.type===Ur?Se=n.DEPTH_COMPONENT32F:_e.type===Us&&(Se=n.DEPTH_COMPONENT24));const xe=we(I);pe(I)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,xe,Se,I.width,I.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,xe,Se,I.width,I.height)}else n.renderbufferStorage(n.RENDERBUFFER,Se,I.width,I.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,D)}else if(I.depthBuffer&&I.stencilBuffer){const Se=we(I);te&&pe(I)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Se,n.DEPTH24_STENCIL8,I.width,I.height):pe(I)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Se,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 Se=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let _e=0;_e0){te.__webglFramebuffer[Ie]=[];for(let Ue=0;Ue0){te.__webglFramebuffer=[];for(let Ie=0;Ie0&&pe(D)===!1){const Ie=xe?I:[I];te.__webglMultisampledFramebuffer=n.createFramebuffer(),te.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,te.__webglMultisampledFramebuffer);for(let Ue=0;Ue0)for(let Ue=0;Ue0)for(let Ue=0;Ue0&&pe(D)===!1){const I=D.isWebGLMultipleRenderTargets?D.texture:[D.texture],te=D.width,Se=D.height;let _e=n.COLOR_BUFFER_BIT;const xe=[],qe=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ie=i.get(D),Ue=D.isWebGLMultipleRenderTargets===!0;if(Ue)for(let it=0;it0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function We(D){const I=o.render.frame;h.get(D)!==I&&(h.set(D,I),D.update())}function De(D,I){const te=D.colorSpace,Se=D.format,_e=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||D.format===eg||te!==hs&&te!==Ki&&(kt.getTransfer(te)===Gt?a===!1?e.has("EXT_sRGB")===!0&&Se===Si?(D.format=eg,D.minFilter=wn,D.generateMipmaps=!1):I=O1.sRGBToLinear(I):(Se!==Si||_e!==us)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",te)),I}this.allocateTextureUnit=H,this.resetTextureUnits=le,this.setTexture2D=ee,this.setTexture2DArray=oe,this.setTexture3D=k,this.setTextureCube=j,this.rebindTextures=Te,this.setupRenderTarget=W,this.updateRenderTargetMipmap=ye,this.updateMultisampleRenderTarget=de,this.setupDepthRenderbuffer=Le,this.setupFrameBufferTexture=Pe,this.useMultisampledRTT=pe}function OI(n,e,t){const i=t.isWebGL2;function r(s,o=Ki){let a;const l=kt.getTransfer(o);if(s===us)return n.UNSIGNED_BYTE;if(s===T1)return n.UNSIGNED_SHORT_4_4_4_4;if(s===b1)return n.UNSIGNED_SHORT_5_5_5_1;if(s===nI)return n.BYTE;if(s===iI)return n.SHORT;if(s===Og)return n.UNSIGNED_SHORT;if(s===E1)return n.INT;if(s===Us)return n.UNSIGNED_INT;if(s===Ur)return n.FLOAT;if(s===Hc)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===rI)return n.ALPHA;if(s===Si)return n.RGBA;if(s===sI)return n.LUMINANCE;if(s===oI)return n.LUMINANCE_ALPHA;if(s===zo)return n.DEPTH_COMPONENT;if(s===el)return n.DEPTH_STENCIL;if(s===eg)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===aI)return n.RED;if(s===C1)return n.RED_INTEGER;if(s===lI)return n.RG;if(s===P1)return n.RG_INTEGER;if(s===R1)return n.RGBA_INTEGER;if(s===cm||s===um||s===fm||s===hm)if(l===Gt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===cm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===um)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===fm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===hm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===cm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===um)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===fm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===hm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===d_||s===p_||s===m_||s===g_)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===d_)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===p_)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===m_)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===g_)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===L1)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===v_||s===y_)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===v_)return l===Gt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===y_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===x_||s===__||s===S_||s===A_||s===M_||s===w_||s===E_||s===T_||s===b_||s===C_||s===P_||s===R_||s===L_||s===I_)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===x_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===__)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===S_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===A_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===M_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===w_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===E_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===T_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===b_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===C_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===P_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===R_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===L_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===I_)return l===Gt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===dm||s===N_||s===D_)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===dm)return l===Gt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===N_)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===D_)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===cI||s===U_||s===O_||s===F_)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===dm)return a.COMPRESSED_RED_RGTC1_EXT;if(s===U_)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===O_)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===F_)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Bo?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 FI extends nn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Ac extends Dt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const yj={type:"move"};class wy{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ac,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 Ac,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ac,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),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,l=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const A of e.hand.values()){const x=t.getJointPose(A,i),g=this._getHandJoint(f,A);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"],p=h.position.distanceTo(d.position),m=.02,y=.005;f.inputState.pinching&&p>m+y?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&p<=m-y&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.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(yj)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Ac;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class xj extends ps{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,f=null,h=null,d=null,p=null,m=null,y=null;const A=t.getContextAttributes();let x=null,g=null;const _=[],S=[],E=new me;let P=null;const b=new nn;b.layers.enable(1),b.viewport=new Bt;const L=new nn;L.layers.enable(2),L.viewport=new Bt;const N=[b,L],C=new FI;C.layers.enable(1),C.layers.enable(2);let R=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function($){let fe=_[$];return fe===void 0&&(fe=new wy,_[$]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function($){let fe=_[$];return fe===void 0&&(fe=new wy,_[$]=fe),fe.getGripSpace()},this.getHand=function($){let fe=_[$];return fe===void 0&&(fe=new wy,_[$]=fe),fe.getHandSpace()};function K($){const fe=S.indexOf($.inputSource);if(fe===-1)return;const ve=_[fe];ve!==void 0&&(ve.update($.inputSource,$.frame,f||o),ve.dispatchEvent({type:$.type,data:$.inputSource}))}function le(){r.removeEventListener("select",K),r.removeEventListener("selectstart",K),r.removeEventListener("selectend",K),r.removeEventListener("squeeze",K),r.removeEventListener("squeezestart",K),r.removeEventListener("squeezeend",K),r.removeEventListener("end",le),r.removeEventListener("inputsourceschange",H);for(let $=0;$<_.length;$++){const fe=S[$];fe!==null&&(S[$]=null,_[$].disconnect(fe))}R=null,F=null,e.setRenderTarget(x),m=null,p=null,d=null,r=null,g=null,ie.stop(),i.isPresenting=!1,e.setPixelRatio(P),e.setSize(E.width,E.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function($){s=$,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function($){a=$,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||o},this.setReferenceSpace=function($){f=$},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return d},this.getFrame=function(){return y},this.getSession=function(){return r},this.setSession=async function($){if(r=$,r!==null){if(x=e.getRenderTarget(),r.addEventListener("select",K),r.addEventListener("selectstart",K),r.addEventListener("selectend",K),r.addEventListener("squeeze",K),r.addEventListener("squeezestart",K),r.addEventListener("squeezeend",K),r.addEventListener("end",le),r.addEventListener("inputsourceschange",H),A.xrCompatible!==!0&&await t.makeXRCompatible(),P=e.getPixelRatio(),e.getSize(E),r.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const fe={antialias:r.renderState.layers===void 0?A.antialias:!0,alpha:!0,depth:A.depth,stencil:A.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,t,fe),r.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),g=new Vr(m.framebufferWidth,m.framebufferHeight,{format:Si,type:us,colorSpace:e.outputColorSpace,stencilBuffer:A.stencil})}else{let fe=null,ve=null,be=null;A.depth&&(be=A.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,fe=A.stencil?el:zo,ve=A.stencil?Bo:Us);const Pe={colorFormat:t.RGBA8,depthFormat:be,scaleFactor:s};d=new XRWebGLBinding(r,t),p=d.createProjectionLayer(Pe),r.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),g=new Vr(p.textureWidth,p.textureHeight,{format:Si,type:us,depthTexture:new W1(p.textureWidth,p.textureHeight,ve,void 0,void 0,void 0,void 0,void 0,void 0,fe),stencilBuffer:A.stencil,colorSpace:e.outputColorSpace,samples:A.antialias?4:0});const Je=e.properties.get(g);Je.__ignoreDepthValues=p.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(l),f=null,o=await r.requestReferenceSpace(a),ie.setContext(r),ie.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode};function H($){for(let fe=0;fe<$.removed.length;fe++){const ve=$.removed[fe],be=S.indexOf(ve);be>=0&&(S[be]=null,_[be].disconnect(ve))}for(let fe=0;fe<$.added.length;fe++){const ve=$.added[fe];let be=S.indexOf(ve);if(be===-1){for(let Je=0;Je<_.length;Je++)if(Je>=S.length){S.push(ve),be=Je;break}else if(S[Je]===null){S[Je]=ve,be=Je;break}if(be===-1)break}const Pe=_[be];Pe&&Pe.connect(ve)}}const q=new U,ee=new U;function oe($,fe,ve){q.setFromMatrixPosition(fe.matrixWorld),ee.setFromMatrixPosition(ve.matrixWorld);const be=q.distanceTo(ee),Pe=fe.projectionMatrix.elements,Je=ve.projectionMatrix.elements,nt=Pe[14]/(Pe[10]-1),Le=Pe[14]/(Pe[10]+1),Te=(Pe[9]+1)/Pe[5],W=(Pe[9]-1)/Pe[5],ye=(Pe[8]-1)/Pe[0],de=(Je[8]+1)/Je[0],we=nt*ye,pe=nt*de,We=be/(-ye+de),De=We*-ye;fe.matrixWorld.decompose($.position,$.quaternion,$.scale),$.translateX(De),$.translateZ(We),$.matrixWorld.compose($.position,$.quaternion,$.scale),$.matrixWorldInverse.copy($.matrixWorld).invert();const D=nt+We,I=Le+We,te=we-De,Se=pe+(be-De),_e=Te*Le/I*D,xe=W*Le/I*D;$.projectionMatrix.makePerspective(te,Se,_e,xe,D,I),$.projectionMatrixInverse.copy($.projectionMatrix).invert()}function k($,fe){fe===null?$.matrixWorld.copy($.matrix):$.matrixWorld.multiplyMatrices(fe.matrixWorld,$.matrix),$.matrixWorldInverse.copy($.matrixWorld).invert()}this.updateCamera=function($){if(r===null)return;C.near=L.near=b.near=$.near,C.far=L.far=b.far=$.far,(R!==C.near||F!==C.far)&&(r.updateRenderState({depthNear:C.near,depthFar:C.far}),R=C.near,F=C.far);const fe=$.parent,ve=C.cameras;k(C,fe);for(let be=0;be0&&(x.alphaTest.value=g.alphaTest);const _=e.get(g).envMap;if(_&&(x.envMap.value=_,x.flipEnvMap.value=_.isCubeTexture&&_.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 S=n._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=g.lightMapIntensity*S,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 a(x,g){x.dashSize.value=g.dashSize,x.totalSize.value=g.dashSize+g.gapSize,x.scale.value=g.scale}function l(x,g,_,S){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.size.value=g.size*_,x.scale.value=S*.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 p(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 m(x,g,_){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===Mi&&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=_.texture,x.transmissionSamplerSize.value.set(_.width,_.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 y(x,g){g.matcap&&(x.matcap.value=g.matcap)}function A(x,g){const _=e.get(g).light;x.referencePosition.value.setFromMatrixPosition(_.matrixWorld),x.nearDistance.value=_.shadow.camera.near,x.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function Sj(n,e,t,i){let r={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(_,S){const E=S.program;i.uniformBlockBinding(_,E)}function f(_,S){let E=r[_.id];E===void 0&&(y(_),E=h(_),r[_.id]=E,_.addEventListener("dispose",x));const P=S.program;i.updateUBOMapping(_,P);const b=e.render.frame;s[_.id]!==b&&(p(_),s[_.id]=b)}function h(_){const S=d();_.__bindingPointIndex=S;const E=n.createBuffer(),P=_.__size,b=_.usage;return n.bindBuffer(n.UNIFORM_BUFFER,E),n.bufferData(n.UNIFORM_BUFFER,P,b),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,E),E}function d(){for(let _=0;_0&&(E+=P-b),_.__size=E,_.__cache={},this}function A(_){const S={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(S.boundary=4,S.storage=4):_.isVector2?(S.boundary=8,S.storage=8):_.isVector3||_.isColor?(S.boundary=16,S.storage=12):_.isVector4?(S.boundary=16,S.storage=16):_.isMatrix3?(S.boundary=48,S.storage=48):_.isMatrix4?(S.boundary=64,S.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),S}function x(_){const S=_.target;S.removeEventListener("dispose",x);const E=o.indexOf(S.__bindingPointIndex);o.splice(E,1),n.deleteBuffer(r[S.id]),delete r[S.id],delete s[S.id]}function g(){for(const _ in r)n.deleteBuffer(r[_]);o=[],r={},s={}}return{bind:l,update:f,dispose:g}}class X1{constructor(e={}){const{canvas:t=EI(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!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 m=new Uint32Array(4),y=new Int32Array(4);let A=null,x=null;const g=[],_=[];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=Dn,this._useLegacyLights=!1,this.toneMapping=cs,this.toneMappingExposure=1;const S=this;let E=!1,P=0,b=0,L=null,N=-1,C=null;const R=new Bt,F=new Bt;let K=null;const le=new He(0);let H=0,q=t.width,ee=t.height,oe=1,k=null,j=null;const Y=new Bt(0,0,q,ee),J=new Bt(0,0,q,ee);let ie=!1;const $=new bh;let fe=!1,ve=!1,be=null;const Pe=new ut,Je=new me,nt=new U,Le={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Te(){return L===null?oe:1}let W=i;function ye(O,ne){for(let ae=0;ae{function Ve(){if(ce.forEach(function($e){De.get($e).currentProgram.isReady()&&ce.delete($e)}),ce.size===0){se(O);return}setTimeout(Ve,10)}de.get("KHR_parallel_shader_compile")!==null?Ve():setTimeout(Ve,10)})};let Rt=null;function Ht(O){Rt&&Rt(O)}function Qt(){Xn.stop()}function Lt(){Xn.start()}const Xn=new RI;Xn.setAnimationLoop(Ht),typeof self<"u"&&Xn.setContext(self),this.setAnimationLoop=function(O){Rt=O,ke.setAnimationLoop(O),O===null?Xn.stop():Xn.start()},ke.addEventListener("sessionstart",Qt),ke.addEventListener("sessionend",Lt),this.render=function(O,ne){if(ne!==void 0&&ne.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),ke.enabled===!0&&ke.isPresenting===!0&&(ke.cameraAutoUpdate===!0&&ke.updateCamera(ne),ne=ke.getCamera()),O.isScene===!0&&O.onBeforeRender(S,O,ne,L),x=it.get(O,_.length),x.init(),_.push(x),Pe.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),$.setFromProjectionMatrix(Pe),ve=this.localClippingEnabled,fe=pt.init(this.clippingPlanes,ve),A=Ue.get(O,g.length),A.init(),g.push(A),rr(O,ne,0,S.sortObjects),A.finish(),S.sortObjects===!0&&A.sort(k,j),this.info.render.frame++,fe===!0&&pt.beginShadows();const ae=x.state.shadowsArray;if(Ae.render(ae,O,ne),fe===!0&&pt.endShadows(),this.info.autoReset===!0&&this.info.reset(),Ct.render(A,O),x.setupLights(S._useLegacyLights),ne.isArrayCamera){const ce=ne.cameras;for(let se=0,Ve=ce.length;se0?x=_[_.length-1]:x=null,g.pop(),g.length>0?A=g[g.length-1]:A=null};function rr(O,ne,ae,ce){if(O.visible===!1)return;if(O.layers.test(ne.layers)){if(O.isGroup)ae=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(ne);else if(O.isLight)x.pushLight(O),O.castShadow&&x.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||$.intersectsSprite(O)){ce&&nt.setFromMatrixPosition(O.matrixWorld).applyMatrix4(Pe);const $e=xe.update(O),ot=O.material;ot.visible&&A.push(O,$e,ot,ae,nt.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||$.intersectsObject(O))){const $e=xe.update(O),ot=O.material;if(ce&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),nt.copy(O.boundingSphere.center)):($e.boundingSphere===null&&$e.computeBoundingSphere(),nt.copy($e.boundingSphere.center)),nt.applyMatrix4(O.matrixWorld).applyMatrix4(Pe)),Array.isArray(ot)){const at=$e.groups;for(let mt=0,dt=at.length;mt0&&ru(se,Ve,ne,ae),ce&&pe.viewport(R.copy(ce)),se.length>0&&gl(se,ne,ae),Ve.length>0&&gl(Ve,ne,ae),$e.length>0&&gl($e,ne,ae),pe.buffers.depth.setTest(!0),pe.buffers.depth.setMask(!0),pe.buffers.color.setMask(!0),pe.setPolygonOffset(!1)}function ru(O,ne,ae,ce){if((ae.isScene===!0?ae.overrideMaterial:null)!==null)return;const Ve=we.isWebGL2;be===null&&(be=new Vr(1,1,{generateMipmaps:!0,type:de.has("EXT_color_buffer_half_float")?Hc:us,minFilter:Yo,samples:Ve?4:0})),S.getDrawingBufferSize(Je),Ve?be.setSize(Je.x,Je.y):be.setSize(tg(Je.x),tg(Je.y));const $e=S.getRenderTarget();S.setRenderTarget(be),S.getClearColor(le),H=S.getClearAlpha(),H<1&&S.setClearColor(16777215,.5),S.clear();const ot=S.toneMapping;S.toneMapping=cs,gl(O,ae,ce),D.updateMultisampleRenderTarget(be),D.updateRenderTargetMipmap(be);let at=!1;for(let mt=0,dt=ne.length;mt0),gt=!!ae.morphAttributes.position,rn=!!ae.morphAttributes.normal,Yn=!!ae.morphAttributes.color;let Yt=cs;ce.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Yt=S.toneMapping);const kn=ae.morphAttributes.position||ae.morphAttributes.normal||ae.morphAttributes.color,lt=kn!==void 0?kn.length:0,Xe=De.get(ce),sr=x.state.lights;if(fe===!0&&(ve===!0||O!==C)){const qn=O===C&&ce.id===N;pt.setState(ce,O,qn)}let Et=!1;ce.version===Xe.__version?(Xe.needsLights&&Xe.lightsStateVersion!==sr.state.version||Xe.outputColorSpace!==ot||se.isBatchedMesh&&Xe.batching===!1||!se.isBatchedMesh&&Xe.batching===!0||se.isInstancedMesh&&Xe.instancing===!1||!se.isInstancedMesh&&Xe.instancing===!0||se.isSkinnedMesh&&Xe.skinning===!1||!se.isSkinnedMesh&&Xe.skinning===!0||se.isInstancedMesh&&Xe.instancingColor===!0&&se.instanceColor===null||se.isInstancedMesh&&Xe.instancingColor===!1&&se.instanceColor!==null||Xe.envMap!==at||ce.fog===!0&&Xe.fog!==Ve||Xe.numClippingPlanes!==void 0&&(Xe.numClippingPlanes!==pt.numPlanes||Xe.numIntersection!==pt.numIntersection)||Xe.vertexAlphas!==mt||Xe.vertexTangents!==dt||Xe.morphTargets!==gt||Xe.morphNormals!==rn||Xe.morphColors!==Yn||Xe.toneMapping!==Yt||we.isWebGL2===!0&&Xe.morphTargetsCount!==lt)&&(Et=!0):(Et=!0,Xe.__version=ce.version);let hn=Xe.currentProgram;Et===!0&&(hn=vl(ce,ne,se));let Gr=!1,or=!1,Bn=!1;const xn=hn.getUniforms(),jr=Xe.uniforms;if(pe.useProgram(hn.program)&&(Gr=!0,or=!0,Bn=!0),ce.id!==N&&(N=ce.id,or=!0),Gr||C!==O){xn.setValue(W,"projectionMatrix",O.projectionMatrix),xn.setValue(W,"viewMatrix",O.matrixWorldInverse);const qn=xn.map.cameraPosition;qn!==void 0&&qn.setValue(W,nt.setFromMatrixPosition(O.matrixWorld)),we.logarithmicDepthBuffer&&xn.setValue(W,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial)&&xn.setValue(W,"isOrthographic",O.isOrthographicCamera===!0),C!==O&&(C=O,or=!0,Bn=!0)}if(se.isSkinnedMesh){xn.setOptional(W,se,"bindMatrix"),xn.setOptional(W,se,"bindMatrixInverse");const qn=se.skeleton;qn&&(we.floatVertexTextures?(qn.boneTexture===null&&qn.computeBoneTexture(),xn.setValue(W,"boneTexture",qn.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."))}se.isBatchedMesh&&(xn.setOptional(W,se,"batchingTexture"),xn.setValue(W,"batchingTexture",se._matricesTexture,D));const yl=ae.morphAttributes;if((yl.position!==void 0||yl.normal!==void 0||yl.color!==void 0&&we.isWebGL2===!0)&&_t.update(se,ae,hn),(or||Xe.receiveShadow!==se.receiveShadow)&&(Xe.receiveShadow=se.receiveShadow,xn.setValue(W,"receiveShadow",se.receiveShadow)),ce.isMeshGouraudMaterial&&ce.envMap!==null&&(jr.envMap.value=at,jr.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),or&&(xn.setValue(W,"toneMappingExposure",S.toneMappingExposure),Xe.needsLights&&c0(jr,Bn),Ve&&ce.fog===!0&&Ie.refreshFogUniforms(jr,Ve),Ie.refreshMaterialUniforms(jr,ce,oe,ee,be),mm.upload(W,Oh(Xe),jr,D)),ce.isShaderMaterial&&ce.uniformsNeedUpdate===!0&&(mm.upload(W,Oh(Xe),jr,D),ce.uniformsNeedUpdate=!1),ce.isSpriteMaterial&&xn.setValue(W,"center",se.center),xn.setValue(W,"modelViewMatrix",se.modelViewMatrix),xn.setValue(W,"normalMatrix",se.normalMatrix),xn.setValue(W,"modelMatrix",se.matrixWorld),ce.isShaderMaterial||ce.isRawShaderMaterial){const qn=ce.uniformsGroups;for(let xl=0,Vi=qn.length;xl0&&D.useMultisampledRTT(O)===!1?se=De.get(O).__webglMultisampledFramebuffer:Array.isArray(dt)?se=dt[ae]:se=dt,R.copy(O.viewport),F.copy(O.scissor),K=O.scissorTest}else R.copy(Y).multiplyScalar(oe).floor(),F.copy(J).multiplyScalar(oe).floor(),K=ie;if(pe.bindFramebuffer(W.FRAMEBUFFER,se)&&we.drawBuffers&&ce&&pe.drawBuffers(O,se),pe.viewport(R),pe.scissor(F),pe.setScissorTest(K),Ve){const at=De.get(O.texture);W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_CUBE_MAP_POSITIVE_X+ne,at.__webglTexture,ae)}else if($e){const at=De.get(O.texture),mt=ne||0;W.framebufferTextureLayer(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,at.__webglTexture,ae||0,mt)}N=-1},this.readRenderTargetPixels=function(O,ne,ae,ce,se,Ve,$e){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ot=De.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&$e!==void 0&&(ot=ot[$e]),ot){pe.bindFramebuffer(W.FRAMEBUFFER,ot);try{const at=O.texture,mt=at.format,dt=at.type;if(mt!==Si&&Ge.convert(mt)!==W.getParameter(W.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const gt=dt===Hc&&(de.has("EXT_color_buffer_half_float")||we.isWebGL2&&de.has("EXT_color_buffer_float"));if(dt!==us&&Ge.convert(dt)!==W.getParameter(W.IMPLEMENTATION_COLOR_READ_TYPE)&&!(dt===Ur&&(we.isWebGL2||de.has("OES_texture_float")||de.has("WEBGL_color_buffer_float")))&&!gt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=O.width-ce&&ae>=0&&ae<=O.height-se&&W.readPixels(ne,ae,ce,se,Ge.convert(mt),Ge.convert(dt),Ve)}finally{const at=L!==null?De.get(L).__webglFramebuffer:null;pe.bindFramebuffer(W.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(O,ne,ae=0){const ce=Math.pow(2,-ae),se=Math.floor(ne.image.width*ce),Ve=Math.floor(ne.image.height*ce);D.setTexture2D(ne,0),W.copyTexSubImage2D(W.TEXTURE_2D,ae,0,0,O.x,O.y,se,Ve),pe.unbindTexture()},this.copyTextureToTexture=function(O,ne,ae,ce=0){const se=ne.image.width,Ve=ne.image.height,$e=Ge.convert(ae.format),ot=Ge.convert(ae.type);D.setTexture2D(ae,0),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,ae.flipY),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ae.premultiplyAlpha),W.pixelStorei(W.UNPACK_ALIGNMENT,ae.unpackAlignment),ne.isDataTexture?W.texSubImage2D(W.TEXTURE_2D,ce,O.x,O.y,se,Ve,$e,ot,ne.image.data):ne.isCompressedTexture?W.compressedTexSubImage2D(W.TEXTURE_2D,ce,O.x,O.y,ne.mipmaps[0].width,ne.mipmaps[0].height,$e,ne.mipmaps[0].data):W.texSubImage2D(W.TEXTURE_2D,ce,O.x,O.y,$e,ot,ne.image),ce===0&&ae.generateMipmaps&&W.generateMipmap(W.TEXTURE_2D),pe.unbindTexture()},this.copyTextureToTexture3D=function(O,ne,ae,ce,se=0){if(S.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ve=O.max.x-O.min.x+1,$e=O.max.y-O.min.y+1,ot=O.max.z-O.min.z+1,at=Ge.convert(ce.format),mt=Ge.convert(ce.type);let dt;if(ce.isData3DTexture)D.setTexture3D(ce,0),dt=W.TEXTURE_3D;else if(ce.isDataArrayTexture||ce.isCompressedArrayTexture)D.setTexture2DArray(ce,0),dt=W.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,ce.flipY),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ce.premultiplyAlpha),W.pixelStorei(W.UNPACK_ALIGNMENT,ce.unpackAlignment);const gt=W.getParameter(W.UNPACK_ROW_LENGTH),rn=W.getParameter(W.UNPACK_IMAGE_HEIGHT),Yn=W.getParameter(W.UNPACK_SKIP_PIXELS),Yt=W.getParameter(W.UNPACK_SKIP_ROWS),kn=W.getParameter(W.UNPACK_SKIP_IMAGES),lt=ae.isCompressedTexture?ae.mipmaps[se]:ae.image;W.pixelStorei(W.UNPACK_ROW_LENGTH,lt.width),W.pixelStorei(W.UNPACK_IMAGE_HEIGHT,lt.height),W.pixelStorei(W.UNPACK_SKIP_PIXELS,O.min.x),W.pixelStorei(W.UNPACK_SKIP_ROWS,O.min.y),W.pixelStorei(W.UNPACK_SKIP_IMAGES,O.min.z),ae.isDataTexture||ae.isData3DTexture?W.texSubImage3D(dt,se,ne.x,ne.y,ne.z,Ve,$e,ot,at,mt,lt.data):ae.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),W.compressedTexSubImage3D(dt,se,ne.x,ne.y,ne.z,Ve,$e,ot,at,lt.data)):W.texSubImage3D(dt,se,ne.x,ne.y,ne.z,Ve,$e,ot,at,mt,lt),W.pixelStorei(W.UNPACK_ROW_LENGTH,gt),W.pixelStorei(W.UNPACK_IMAGE_HEIGHT,rn),W.pixelStorei(W.UNPACK_SKIP_PIXELS,Yn),W.pixelStorei(W.UNPACK_SKIP_ROWS,Yt),W.pixelStorei(W.UNPACK_SKIP_IMAGES,kn),se===0&&ce.generateMipmaps&&W.generateMipmap(dt),pe.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?D.setTextureCube(O,0):O.isData3DTexture?D.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?D.setTexture2DArray(O,0):D.setTexture2D(O,0),pe.unbindTexture()},this.resetState=function(){P=0,b=0,L=null,pe.reset(),X.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Or}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===kg?"display-p3":"srgb",t.unpackColorSpace=kt.workingColorSpace===wh?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Dn?Vo:N1}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Vo?Dn:hs}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 kI extends X1{}kI.prototype.isWebGL1Renderer=!0;class Vg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new He(e),this.density=t}clone(){return new Vg(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Hg{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new He(e),this.near=t,this.far=i}clone(){return new Hg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class ng extends Dt{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 Wg{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=nh,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=$i()}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:l,point:zu.clone(),uv:Ni.getInterpolation(zu,Ap,Hu,Mp,lb,Ey,cb,new me),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 wp(n,e,t,i,r,s){Jl.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Vu.x=s*Jl.x-r*Jl.y,Vu.y=r*Jl.x+s*Jl.y):Vu.copy(Jl),n.copy(e),n.x+=Vu.x,n.y+=Vu.y,n.applyMatrix4(BI)}const Ep=new U,ub=new U;class VI extends Dt{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){Ep.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Ep);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ep.setFromMatrixPosition(e.matrixWorld),ub.setFromMatrixPosition(this.matrixWorld);const i=Ep.distanceTo(ub)/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 $l="batchId",go=new ut,xb=new ut,Cj=new ut,_b=new ut,Cy=new bh,Cp=new wi,ya=new di,ju=new U,Py=new bj,li=new Rn,Pp=[];function Pj(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 Vt(a,1))}const o=r>65536?new Uint32Array(i):new Uint16Array(i);t.setAttribute($l,new Vt(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute($l))throw new Error(`BatchedMesh: Geometry cannot use attribute "${$l}"`);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===$l)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 wi);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,l=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,m=this._matricesTexture,y=this._matricesTexture.image.data;d.push(!0),p.push(!0);const A=this._geometryCount;this._geometryCount++,Cj.toArray(y,A*16),m.needsUpdate=!0,o.push(r),a.push({start:h?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new wi,sphereInitialized:!1,sphere:new di});const x=this.geometry.getAttribute($l);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 l=a.vertexStart,f=a.vertexCount;for(const m in i.attributes){if(m===$l)continue;const y=t.getAttribute(m),A=i.getAttribute(m);Pj(y,A,l);const x=y.itemSize;for(let g=y.count,_=f;g<_;g++){const S=l+g;for(let E=0;E=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,l=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,l=this.geometry;li.material=this.material,li.geometry.index=l.index,li.geometry.attributes=l.attributes,li.geometry.boundingBox===null&&(li.geometry.boundingBox=new wi),li.geometry.boundingSphere===null&&(li.geometry.boundingSphere=new di);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,l=this._visibility,f=this._multiDrawStarts,h=this._multiDrawCounts,d=this._drawRanges,p=this.perObjectFrustumCulled;p&&(_b.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Cy.setFromProjectionMatrix(_b,e.isWebGPURenderer?Wc:Or));let m=0;if(this.sortObjects){xb.copy(this.matrixWorld).invert(),ju.setFromMatrixPosition(i.matrixWorld).applyMatrix4(xb);for(let x=0,g=l.length;xl)continue;p.applyMatrix4(this.matrixWorld);const N=e.ray.origin.distanceTo(p);Ne.far||t.push({distance:N,point:d.clone().applyMatrix4(this.matrixWorld),index:S,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),_=Math.min(x.count,o.start+o.count);for(let S=g,E=_-1;Sl)continue;p.applyMatrix4(this.matrixWorld);const b=e.ray.origin.distanceTo(p);be.far||t.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:S,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:l,index:e,face:null,object:o})}}class Rj extends yn{constructor(e,t,i,r,s,o,a,l,f){super(e,t,i,r,s,o,a,l,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:wn,this.magFilter=s!==void 0?s:wn,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 Lj extends yn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=An,this.minFilter=An,this.generateMipmaps=!1,this.needsUpdate=!0}}class jg extends yn{constructor(e,t,i,r,s,o,a,l,f,h,d,p){super(null,o,a,l,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 Ij extends jg{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=fi}}class Nj extends jg{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Ys),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class Dj extends yn{constructor(e,t,i,r,s,o,a,l,f){super(e,t,i,r,s,o,a,l,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Hr{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,l=s-1,f;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),f=i[r]-o,f<0)a=r+1;else if(f>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const h=i[r],p=i[r+1]-h,m=(o-h)/p;return(r+m)/(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),l=t||(o.isVector2?new me:new U);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new U,r=[],s=[],o=[],a=new U,l=new ut;for(let m=0;m<=e;m++){const y=m/e;r[m]=this.getTangentAt(y,new U)}s[0]=new U,o[0]=new U;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 m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const y=Math.acos(gn(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,y))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos(gn(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let y=1;y<=e;y++)s[y].applyMatrix4(l.makeRotationAxis(r[y],m*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 Xg extends Hr{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=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=l}getPoint(e,t){const i=t||new me,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:l===0&&a===s-1&&(a=s-2,l=1);let f,h;this.closed||a>0?f=r[(a-1)%s]:(Np.subVectors(r[0],r[1]).add(r[0]),f=Np);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(Cb(a,l.x,f.x,h.x,d.x),Cb(a,l.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],l=a.getLength(),f=l===0?0:1-o/l;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 Ph extends xt{constructor(e=[new me(0,-.5),new me(.5,0),new me(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=gn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],f=[],h=1/t,d=new U,p=new me,m=new U,y=new U,A=new U;let x=0,g=0;for(let _=0;_<=e.length-1;_++)switch(_){case 0:x=e[_+1].x-e[_].x,g=e[_+1].y-e[_].y,m.x=g*1,m.y=-x,m.z=g*0,A.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(A.x,A.y,A.z);break;default:x=e[_+1].x-e[_].x,g=e[_+1].y-e[_].y,m.x=g*1,m.y=-x,m.z=g*0,y.copy(m),m.x+=A.x,m.y+=A.y,m.z+=A.z,m.normalize(),l.push(m.x,m.y,m.z),A.copy(y)}for(let _=0;_<=t;_++){const S=i+_*h*r,E=Math.sin(S),P=Math.cos(S);for(let b=0;b<=e.length-1;b++){d.x=e[b].x*E,d.y=e[b].y,d.z=e[b].x*P,o.push(d.x,d.y,d.z),p.x=_/t,p.y=b/(e.length-1),a.push(p.x,p.y);const L=l[3*b+0]*E,N=l[3*b+1],C=l[3*b+0]*P;f.push(L,N,C)}}for(let _=0;_0&&S(!0),t>0&&S(!1)),this.setIndex(h),this.setAttribute("position",new Ze(d,3)),this.setAttribute("normal",new Ze(p,3)),this.setAttribute("uv",new Ze(m,2));function _(){const E=new U,P=new U;let b=0;const L=(t-e)/i;for(let N=0;N<=s;N++){const C=[],R=N/s,F=R*(t-e)+e;for(let K=0;K<=r;K++){const le=K/r,H=le*l+a,q=Math.sin(H),ee=Math.cos(H);P.x=F*q,P.y=-R*i+x,P.z=F*ee,d.push(P.x,P.y,P.z),E.set(q,L,ee).normalize(),p.push(E.x,E.y,E.z),m.push(le,1-R),C.push(y++)}A.push(C)}for(let N=0;N.9&&L<.1&&(S<.2&&(o[_+0]+=1),E<.2&&(o[_+2]+=1),P<.2&&(o[_+4]+=1))}}function p(_){s.push(_.x,_.y,_.z)}function m(_,S){const E=_*3;S.x=e[E+0],S.y=e[E+1],S.z=e[E+2]}function y(){const _=new U,S=new U,E=new U,P=new U,b=new me,L=new me,N=new me;for(let C=0,R=0;C80*t){a=f=n[0],l=h=n[1];for(let y=t;yf&&(f=d),p>h&&(h=p);m=Math.max(f-a,h-l),m=m!==0?32767/m:0}return sh(s,o,t,a,l,m,0),o}};function $I(n,e,t,i,r){let s,o;if(r===r9(n,e,t,i)>0)for(s=e;s=e;s-=i)o=Pb(s,n[s],n[s+1],o);return o&&Jg(o,o.next)&&(ah(o),o=o.next),o}function nl(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Jg(t,t.next)||ln(t.prev,t,t.next)===0)){if(ah(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function sh(n,e,t,i,r,s,o){if(!n)return;!o&&s&&Qj(n,i,r,s);let a=n,l,f;for(;n.prev!==n.next;){if(l=n.prev,f=n.next,s?Gj(n,i,r,s):Wj(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(f.i/t|0),ah(n),n=f.next,a=f.next;continue}if(n=f,n===a){o?o===1?(n=jj(nl(n),e,t),sh(n,e,t,i,r,s,2)):o===2&&Xj(n,e,t,i,r,s):sh(nl(n),e,t,i,r,s,1);break}}}function Wj(n){const e=n.prev,t=n,i=n.next;if(ln(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,f=i.y,h=rs?r>o?r:o:s>o?s:o,m=a>l?a>f?a:f:l>f?l:f;let y=i.next;for(;y!==e;){if(y.x>=h&&y.x<=p&&y.y>=d&&y.y<=m&&Mc(r,a,s,l,o,f,y.x,y.y)&&ln(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function Gj(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ln(r,s,o)>=0)return!1;const a=r.x,l=s.x,f=o.x,h=r.y,d=s.y,p=o.y,m=al?a>f?a:f:l>f?l:f,x=h>d?h>p?h:p:d>p?d:p,g=G_(m,y,e,t,i),_=G_(A,x,e,t,i);let S=n.prevZ,E=n.nextZ;for(;S&&S.z>=g&&E&&E.z<=_;){if(S.x>=m&&S.x<=A&&S.y>=y&&S.y<=x&&S!==r&&S!==o&&Mc(a,h,l,d,f,p,S.x,S.y)&&ln(S.prev,S,S.next)>=0||(S=S.prevZ,E.x>=m&&E.x<=A&&E.y>=y&&E.y<=x&&E!==r&&E!==o&&Mc(a,h,l,d,f,p,E.x,E.y)&&ln(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;S&&S.z>=g;){if(S.x>=m&&S.x<=A&&S.y>=y&&S.y<=x&&S!==r&&S!==o&&Mc(a,h,l,d,f,p,S.x,S.y)&&ln(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;E&&E.z<=_;){if(E.x>=m&&E.x<=A&&E.y>=y&&E.y<=x&&E!==r&&E!==o&&Mc(a,h,l,d,f,p,E.x,E.y)&&ln(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function jj(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Jg(r,s)&&e3(r,i,i.next,s)&&oh(r,s)&&oh(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),ah(i),ah(i.next),i=n=s),i=i.next}while(i!==n);return nl(i)}function Xj(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&t9(o,a)){let l=t3(o,a);o=nl(o,o.next),l=nl(l,l.next),sh(o,e,t,i,r,s,0),sh(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function Yj(n,e,t,i){const r=[];let s,o,a,l,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>=l&&s!==t.x&&Mc(or.x||t.x===r.x&&Jj(r,t)))&&(r=t,h=d)),t=t.next;while(t!==a);return r}function Jj(n,e){return ln(n.prev,n,e.prev)<0&&ln(e.next,n,n.next)<0}function Qj(n,e,t,i){let r=n;do r.z===0&&(r.z=G_(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,$j(r)}function $j(n){let e,t,i,r,s,o,a,l,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,f*=2}while(o>1);return n}function G_(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 e9(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 t9(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!n9(n,e)&&(oh(n,e)&&oh(e,n)&&i9(n,e)&&(ln(n.prev,n,e.prev)||ln(n,e.prev,e))||Jg(n,e)&&ln(n.prev,n,n.next)>0&&ln(e.prev,e,e.next)>0)}function ln(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Jg(n,e){return n.x===e.x&&n.y===e.y}function e3(n,e,t,i){const r=kp(ln(n,e,t)),s=kp(ln(n,e,i)),o=kp(ln(t,i,n)),a=kp(ln(t,i,e));return!!(r!==s&&o!==a||r===0&&Fp(n,t,e)||s===0&&Fp(n,i,e)||o===0&&Fp(t,n,i)||a===0&&Fp(t,e,i))}function Fp(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 kp(n){return n>0?1:n<0?-1:0}function n9(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&&e3(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function oh(n,e){return ln(n.prev,n,n.next)<0?ln(n,e,n.next)>=0&&ln(n,n.prev,e)>=0:ln(n,e,n.prev)<0||ln(n,n.next,e)<0}function i9(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 t3(n,e){const t=new j_(n.i,n.x,n.y),i=new j_(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 Pb(n,e,t,i){const r=new j_(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 ah(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 j_(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 r9(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function Lb(n,e){for(let t=0;tNumber.EPSILON){const xe=Math.sqrt(Se),qe=Math.sqrt(I*I+te*te),Ie=ye.x-D/xe,Ue=ye.y+De/xe,it=de.x-te/qe,pt=de.y+I/qe,Ae=((it-Ie)*te-(pt-Ue)*I)/(De*te-D*I);we=Ie+De*Ae-W.x,pe=Ue+D*Ae-W.y;const Ct=we*we+pe*pe;if(Ct<=2)return new me(we,pe);We=Math.sqrt(Ct/2)}else{let xe=!1;De>Number.EPSILON?I>Number.EPSILON&&(xe=!0):De<-Number.EPSILON?I<-Number.EPSILON&&(xe=!0):Math.sign(D)===Math.sign(te)&&(xe=!0),xe?(we=-D,pe=De,We=Math.sqrt(Se)):(we=De,pe=D,We=Math.sqrt(Se/2))}return new me(we/We,pe/We)}const j=[];for(let W=0,ye=H.length,de=ye-1,we=W+1;W=0;W--){const ye=W/x,de=m*Math.cos(ye*Math.PI/2),we=y*Math.sin(ye*Math.PI/2)+A;for(let pe=0,We=H.length;pe=0;){const we=de;let pe=de-1;pe<0&&(pe=W.length-1);for(let We=0,De=h+x*2;We0)&&m.push(S,E,b),(g!==i-1||l0!=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 o3 extends $n{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new He(16777215),this.specular=new He(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new He(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ea,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mh,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 a3 extends $n{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new He(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new He(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ea,this.normalScale=new me(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 l3 extends $n{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ea,this.normalScale=new me(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 c3 extends $n{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new He(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new He(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ea,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mh,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 u3 extends $n{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new He(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ea,this.normalScale=new me(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 f3 extends bi{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function za(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 h3(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function d3(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 X_(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 l=0;l!==e;++l)r[o++]=n[a+l]}return r}function iA(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 l9(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){d.push(f.times[m]);for(let A=0;As.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[y]){const g=y*d+h,_=g+d-h;A=a.values.slice(g,_)}else{const g=a.createInterpolant(),_=h,S=d-h;g.evaluate(s),A=g.resultBuffer.slice(_,S)}l==="quaternion"&&new hi().fromArray(A).normalize().conjugate().toArray(A);const x=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 l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&h3(r))for(let a=0,l=r.length;a!==l;++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()===pm,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,f=0;f!==i;++f)t[l+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}}Wr.prototype.TimeBufferType=Float32Array;Wr.prototype.ValueBufferType=Float32Array;Wr.prototype.DefaultInterpolation=Jf;class dl extends Wr{}dl.prototype.ValueTypeName="bool";dl.prototype.ValueBufferType=Array;dl.prototype.DefaultInterpolation=Kf;dl.prototype.InterpolantFactoryMethodLinear=void 0;dl.prototype.InterpolantFactoryMethodSmooth=void 0;class sA extends Wr{}sA.prototype.ValueTypeName="color";class lh extends Wr{}lh.prototype.ValueTypeName="number";class g3 extends Ih{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,l=(i-t)/(r-t);let f=e*a;for(let h=f+a;f!==h;f+=4)hi.slerpFlat(s,0,o,f-a,o,f,l);return s}}class nu extends Wr{InterpolantFactoryMethodLinear(e){return new g3(this.times,this.values,this.getValueSize(),e)}}nu.prototype.ValueTypeName="quaternion";nu.prototype.DefaultInterpolation=Jf;nu.prototype.InterpolantFactoryMethodSmooth=void 0;class pl extends Wr{}pl.prototype.ValueTypeName="string";pl.prototype.ValueBufferType=Array;pl.prototype.DefaultInterpolation=Kf;pl.prototype.InterpolantFactoryMethodLinear=void 0;pl.prototype.InterpolantFactoryMethodSmooth=void 0;class ch extends Wr{}ch.prototype.ValueTypeName="vector";class uh{constructor(e,t=-1,i,r=Fg){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=$i(),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(h9(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(Wr.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,m,y,A){if(m.length!==0){const x=[],g=[];iA(m,x,g,y),x.length!==0&&A.push(new d(p,x,g))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const f=e.hierarchy||[];for(let d=0;d{t&&t(s),this.manager.itemEnd(e)},0),s;if(bs[e]!==void 0){bs[e].push({onLoad:t,onProgress:i,onError:r});return}bs[e]=[],bs[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,l=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=bs[e],d=f.body.getReader(),p=f.headers.get("Content-Length")||f.headers.get("X-File-Size"),m=p?parseInt(p):0,y=m!==0;let A=0;const x=new ReadableStream({start(g){_();function _(){d.read().then(({done:S,value:E})=>{if(S)g.close();else{A+=E.byteLength;const P=new ProgressEvent("progress",{lengthComputable:y,loaded:A,total:m});for(let b=0,L=h.length;b{switch(l){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,m=new TextDecoder(p);return f.arrayBuffer().then(y=>m.decode(y))}}}).then(f=>{Os.add(e,f);const h=bs[e];delete bs[e];for(let d=0,p=h.length;d{const h=bs[e];if(h===void 0)throw this.manager.itemError(e),f;delete bs[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 p9 extends zi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new qs(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(l){r?r(l):console.error(l),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 He().setHex(o.value);break;case"v2":r.uniforms[s].value=new me().fromArray(o.value);break;case"v3":r.uniforms[s].value=new U().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Bt().fromArray(o.value);break;case"m3":r.uniforms[s].value=new wt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new ut().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 me().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 me().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:i3,SpriteMaterial:Y1,RawShaderMaterial:r3,ShaderMaterial:ds,PointsMaterial:Z1,MeshPhysicalMaterial:s3,MeshStandardMaterial:nA,MeshPhongMaterial:o3,MeshToonMaterial:a3,MeshNormalMaterial:l3,MeshLambertMaterial:c3,MeshDepthMaterial:G1,MeshDistanceMaterial:j1,MeshBasicMaterial:ta,MeshMatcapMaterial:u3,LineDashedMaterial:f3,LineBasicMaterial:bi,Material:$n};return new t[e]}}class Y_{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new oA(t);s=new fh(l),s.setCrossOrigin(this.crossOrigin);for(let f=0,h=e.length;f0){r=new fh(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const x=new wi;x.min.fromArray(A.boxMin),x.max.fromArray(A.boxMax);const g=new di;return g.radius=A.sphereRadius,g.center.fromArray(A.sphereCenter),{boxInitialized:A.boxInitialized,box:x,sphereInitialized:A.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 VI;break;case"Line":o=new qo(a(e.geometry),l(e.material));break;case"LineLoop":o=new jI(a(e.geometry),l(e.material));break;case"LineSegments":o=new ms(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new XI(a(e.geometry),l(e.material));break;case"Sprite":o=new zI(l(e.material));break;case"Group":o=new Ac;break;case"Bone":o=new q1;break;default:o=new Dt}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 m=0;m"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=Os.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 l=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 Os.add(e,f),t&&t(f),s.manager.itemEnd(e),f}).catch(function(f){r&&r(f),Os.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Os.add(e,l),s.manager.itemStart(e)}}let Bp;class lA{static getContext(){return Bp===void 0&&(Bp=new(window.AudioContext||window.webkitAudioContext)),Bp}static setContext(e){Bp=e}}class w9 extends zi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new qs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const f=l.slice(0);lA.getContext().decodeAudioData(f,function(d){t(d)}).catch(a)}catch(f){a(f)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const Bb=new ut,zb=new ut,xa=new ut;class E9{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nn,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,xa.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(ja*t.fov*.5)/t.zoom;let a,l;zb.elements[12]=-r,Bb.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,xa.elements[0]=2*t.near/(l-a),xa.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(xa),a=-o*t.aspect-s,l=o*t.aspect-s,xa.elements[0]=2*t.near/(l-a),xa.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(xa)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(zb),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Bb)}}class cA{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Vb(),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=Vb();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Vb(){return(typeof performance>"u"?Date:performance).now()}const _a=new U,Hb=new hi,T9=new U,Sa=new U;class b9 extends Dt{constructor(){super(),this.type="AudioListener",this.context=lA.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new cA}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(_a,Hb,T9),Sa.set(0,0,-1).applyQuaternion(Hb),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(_a.x,r),t.positionY.linearRampToValueAtTime(_a.y,r),t.positionZ.linearRampToValueAtTime(_a.z,r),t.forwardX.linearRampToValueAtTime(Sa.x,r),t.forwardY.linearRampToValueAtTime(Sa.y,r),t.forwardZ.linearRampToValueAtTime(Sa.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(_a.x,_a.y,_a.z),t.setOrientation(Sa.x,Sa.y,Sa.z,i.x,i.y,i.z)}}class b3 extends Dt{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 l=t,f=t+t;l!==f;++l)if(i[l]!==i[l+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){hi.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;hi.multiplyQuaternionsFlat(e,o,e,t,e,i),hi.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 l=t+a;e[l]=e[l]*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 uA="\\[\\]\\.:\\/",L9=new RegExp("["+uA+"]","g"),fA="[^"+uA+"]",I9="[^"+uA.replace("\\.","")+"]",N9=/((?:WC+[\/:])*)/.source.replace("WC",fA),D9=/(WCOD+)?/.source.replace("WCOD",I9),U9=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",fA),O9=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",fA),F9=new RegExp("^"+N9+D9+U9+O9+"$"),k9=["material","materials","bones","map"];class B9{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(L9,"")}static parseTrackName(e){const t=F9.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);k9.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]=l;for(let m=0,y=r;m!==y;++m){const A=i[m],x=A[d],g=A[h];A[h]=x,A[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,l=arguments.length;a!==l;++a){const f=arguments[a],h=f.uuid,d=t[h];if(d!==void 0)if(delete t[h],d0&&(t[m.uuid]=d),e[d]=m,e.pop();for(let y=0,A=r;y!==A;++y){const x=i[y];x[d]=x[p],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,a=this._parsedPaths,l=this._objects,f=l.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,m=l.length;p!==m;++p){const y=l[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,l=o[a],f=e[a];t[f]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class P3{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),l={endingStart:Fa,endingEnd:Fa};for(let f=0;f!==o;++f){const h=s[f].createInterpolant(null);a[f]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=fI,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 l=a.parameterPositions,f=a.sampleValues;return l[0]=s,l[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 l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case I1:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),f[h].accumulateAdditive(a);break;case Fg:default:for(let h=0,d=l.length;h!==d;++h)l[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===hI;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===uI){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 l=this.repetitions-s;if(l<=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(l===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=ka,r.endingEnd=ka):(e?r.endingStart=this.zeroSlopeAtStart?ka:Fa:r.endingStart=Qf,t?r.endingEnd=this.zeroSlopeAtEnd?ka:Fa:r.endingEnd=Qf)}_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,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const V9=new Float32Array(1);class H9 extends ps{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,l=i.uuid,f=this._bindingsByRootAndName;let h=f[l];h===void 0&&(h={},f[l]=h);for(let d=0;d!==s;++d){const p=r[d],m=p.name;let y=h[m];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,l,m));continue}const A=t&&t._propertyBindings[d].binding.parsedPath;y=new C3(It.create(i,m,A),p.ValueTypeName,p.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,l,m),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,l=this._nActiveBindings;for(let f=0;f!==l;++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,jb).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 Xb=new U,zp=new U;class Z9{constructor(e=new U,t=new U){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){Xb.subVectors(e,this.start),zp.subVectors(this.end,this.start);const i=zp.dot(zp);let s=zp.dot(Xb)/i;return t&&(s=gn(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 Yb=new U;class K9 extends Dt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new xt,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,l=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{Qb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Qb,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 c7 extends ms{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 xt;r.setAttribute("position",new Ze(t,3)),r.setAttribute("color",new Ze(i,3));const s=new bi({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new He,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 u7{constructor(){this.type="ShapePath",this.color=new He,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new rh,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 _=[];for(let S=0,E=g.length;SNumber.EPSILON){if(R<0&&(L=_[b],C=-C,N=_[P],R=-R),g.yN.y)continue;if(g.y===L.y){if(g.x===L.x)return!0}else{const F=R*(g.x-L.x)-C*(g.y-L.y);if(F===0)return!0;if(F<0)continue;E=!E}}else{if(g.y!==L.y)continue;if(N.x<=g.x&&g.x<=L.x||L.x<=g.x&&g.x<=N.x)return!0}}return E}const r=fs.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const f=[];if(s.length===1)return a=s[0],l=new qa,l.curves=a.curves,f.push(l),f;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],p=[];let m=[],y=0,A;p[y]=void 0,m[y]=[];for(let g=0,_=s.length;g<_;g++)a=s[g],A=a.getPoints(),o=r(A),o=e?!o:o,o?(!h&&p[y]&&y++,p[y]={s:new qa,p:A},p[y].s.curves=a.curves,h&&y++,m[y]=[]):m[y].push({h:a,p:A[0]});if(!p[0])return t(s);if(p.length>1){let g=!1,_=0;for(let S=0,E=p.length;S0&&g===!1&&(m=d)}let x;for(let g=0,_=p.length;g<_;g++){l=p[g].s,f.push(l),x=m[g];for(let S=0,E=x.length;S{const d=typeof f=="function"?f(e):f;if(d!==e){const p=e;e=h?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,s=(f,h=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(e);function m(){const y=h(e);if(!d(p,y)){const A=p;f(p=y,A)}}return t.add(m),()=>t.delete(m)},l={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,l),l}const d7=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),$b=d7?V.useEffect:V.useLayoutEffect;function N3(n){const e=typeof n=="function"?h7(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=V.useReducer(x=>x+1,0),o=e.getState(),a=V.useRef(o),l=V.useRef(i),f=V.useRef(r),h=V.useRef(!1),d=V.useRef();d.current===void 0&&(d.current=i(o));let p,m=!1;(a.current!==o||l.current!==i||f.current!==r||h.current)&&(p=i(o),m=!r(d.current,p)),$b(()=>{m&&(d.current=p),a.current=o,l.current=i,f.current=r,h.current=!1});const y=V.useRef(o);$b(()=>{const x=()=>{try{const _=e.getState(),S=l.current(_);f.current(d.current,S)||(a.current=_,d.current=S,s())}catch{h.current=!0,s()}},g=e.subscribe(x);return e.getState()!==y.current&&x(),g},[]);const A=m?p:d.current;return V.useDebugValue(A),A};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 D3={exports:{}},U3={exports:{}},O3={};/** + * @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(k,j){var Y=k.length;k.push(j);e:for(;0>>1,ie=k[J];if(0>>1;J<$;){var fe=2*(J+1)-1,ve=k[fe],be=fe+1,Pe=k[be];if(0>r(ve,Y))ber(Pe,ve)?(k[J]=Pe,k[be]=Y,J=be):(k[J]=ve,k[fe]=Y,J=fe);else if(ber(Pe,Y))k[J]=Pe,k[be]=Y,J=be;else break e}}return j}function r(k,j){var Y=k.sortIndex-j.sortIndex;return Y!==0?Y:k.id-j.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 l=[],f=[],h=1,d=null,p=3,m=!1,y=!1,A=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(k){for(var j=t(f);j!==null;){if(j.callback===null)i(f);else if(j.startTime<=k)i(f),j.sortIndex=j.expirationTime,e(l,j);else break;j=t(f)}}function E(k){if(A=!1,S(k),!y)if(t(l)!==null)y=!0,ee(P);else{var j=t(f);j!==null&&oe(E,j.startTime-k)}}function P(k,j){y=!1,A&&(A=!1,g(N),N=-1),m=!0;var Y=p;try{for(S(j),d=t(l);d!==null&&(!(d.expirationTime>j)||k&&!F());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var ie=J(d.expirationTime<=j);j=n.unstable_now(),typeof ie=="function"?d.callback=ie:d===t(l)&&i(l),S(j)}else i(l);d=t(l)}if(d!==null)var $=!0;else{var fe=t(f);fe!==null&&oe(E,fe.startTime-j),$=!1}return $}finally{d=null,p=Y,m=!1}}var b=!1,L=null,N=-1,C=5,R=-1;function F(){return!(n.unstable_now()-Rk||125J?(k.sortIndex=Y,e(f,k),t(l)===null&&k===t(f)&&(A?(g(N),N=-1):A=!0,oe(E,Y-J))):(k.sortIndex=ie,e(l,k),y||m||(y=!0,ee(P))),k},n.unstable_shouldYield=F,n.unstable_wrapCallback=function(k){var j=p;return function(){var Y=p;p=j;try{return k.apply(this,arguments)}finally{p=Y}}}})(O3);U3.exports=O3;var K_=U3.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 p7=function(e){var t={},i=V,r=K_,s=Object.assign;function o(c){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+c,v=1;vZ||w[B]!==T[Z]){var he=` +`+w[B].replace(" at new "," at ");return c.displayName&&he.includes("")&&(he=he.replace("",c.displayName)),he}while(1<=B&&0<=Z);break}}}finally{dt=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?mt(c):""}var rn=Object.prototype.hasOwnProperty,Yn=[],Yt=-1;function kn(c){return{current:c}}function lt(c){0>Yt||(c.current=Yn[Yt],Yn[Yt]=null,Yt--)}function Xe(c,u){Yt++,Yn[Yt]=c.current,c.current=u}var sr={},Et=kn(sr),hn=kn(!1),Gr=sr;function or(c,u){var v=c.type.contextTypes;if(!v)return sr;var M=c.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===u)return M.__reactInternalMemoizedMaskedChildContext;var w={},T;for(T in v)w[T]=u[T];return M&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=u,c.__reactInternalMemoizedMaskedChildContext=w),w}function Bn(c){return c=c.childContextTypes,c!=null}function xn(){lt(hn),lt(Et)}function jr(c,u,v){if(Et.current!==sr)throw Error(o(168));Xe(Et,u),Xe(hn,v)}function yl(c,u,v){var M=c.stateNode;if(u=u.childContextTypes,typeof M.getChildContext!="function")return v;M=M.getChildContext();for(var w in M)if(!(w in u))throw Error(o(108,N(c)||"Unknown",w));return s({},v,M)}function qn(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||sr,Gr=Et.current,Xe(Et,c),Xe(hn,hn.current),!0}function xl(c,u,v){var M=c.stateNode;if(!M)throw Error(o(169));v?(c=yl(c,u,Gr),M.__reactInternalMemoizedMergedChildContext=c,lt(hn),lt(Et),Xe(Et,c)):lt(hn),Xe(hn,v)}var Vi=Math.clz32?Math.clz32:rN,kh=Math.log,iN=Math.LN2;function rN(c){return c>>>=0,c===0?32:31-(kh(c)/iN|0)|0}var Bh=64,zh=4194304;function su(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function Vh(c,u){var v=c.pendingLanes;if(v===0)return 0;var M=0,w=c.suspendedLanes,T=c.pingedLanes,B=v&268435455;if(B!==0){var Z=B&~w;Z!==0?M=su(Z):(T&=B,T!==0&&(M=su(T)))}else B=v&~w,B!==0?M=su(B):T!==0&&(M=su(T));if(M===0)return 0;if(u!==0&&u!==M&&!(u&w)&&(w=M&-M,T=u&-u,w>=T||w===16&&(T&4194240)!==0))return u;if(M&4&&(M|=v&16),u=c.entangledLanes,u!==0)for(c=c.entanglements,u&=M;0v;v++)u.push(c);return u}function ou(c,u,v){c.pendingLanes|=u,u!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,u=31-Vi(u),c[u]=v}function aN(c,u){var v=c.pendingLanes&~u;c.pendingLanes=u,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=u,c.mutableReadLanes&=u,c.entangledLanes&=u,u=c.entanglements;var M=c.eventTimes;for(c=c.expirationTimes;0>=B,w-=B,ys=1<<32-Vi(u)+w|v<Ot?(Hn=yt,yt=null):Hn=yt.sibling;var Ft=st(re,yt,ue[Ot],Be);if(Ft===null){yt===null&&(yt=Hn);break}c&&yt&&Ft.alternate===null&&u(re,yt),Q=T(Ft,Q,Ot),Mt===null?Qe=Ft:Mt.sibling=Ft,Mt=Ft,yt=Hn}if(Ot===ue.length)return v(re,yt),$t&&sa(re,Ot),Qe;if(yt===null){for(;OtOt?(Hn=yt,yt=null):Hn=yt.sibling;var oo=st(re,yt,Ft.value,Be);if(oo===null){yt===null&&(yt=Hn);break}c&&yt&&oo.alternate===null&&u(re,yt),Q=T(oo,Q,Ot),Mt===null?Qe=oo:Mt.sibling=oo,Mt=oo,yt=Hn}if(Ft.done)return v(re,yt),$t&&sa(re,Ot),Qe;if(yt===null){for(;!Ft.done;Ot++,Ft=ue.next())Ft=vt(re,Ft.value,Be),Ft!==null&&(Q=T(Ft,Q,Ot),Mt===null?Qe=Ft:Mt.sibling=Ft,Mt=Ft);return $t&&sa(re,Ot),Qe}for(yt=M(re,yt);!Ft.done;Ot++,Ft=ue.next())Ft=Wt(yt,re,Ot,Ft.value,Be),Ft!==null&&(c&&Ft.alternate!==null&&yt.delete(Ft.key===null?Ot:Ft.key),Q=T(Ft,Q,Ot),Mt===null?Qe=Ft:Mt.sibling=Ft,Mt=Ft);return c&&yt.forEach(function(XN){return u(re,XN)}),$t&&sa(re,Ot),Qe}function pr(re,Q,ue,Be){if(typeof ue=="object"&&ue!==null&&ue.type===h&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var Qe=ue.key,Mt=Q;Mt!==null;){if(Mt.key===Qe){if(Qe=ue.type,Qe===h){if(Mt.tag===7){v(re,Mt.sibling),Q=w(Mt,ue.props.children),Q.return=re,re=Q;break e}}else if(Mt.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===S&&NA(Qe)===Mt.type){v(re,Mt.sibling),Q=w(Mt,ue.props),Q.ref=cu(re,Mt,ue),Q.return=re,re=Q;break e}v(re,Mt);break}else u(re,Mt);Mt=Mt.sibling}ue.type===h?(Q=ha(ue.props.children,re.mode,Be,ue.key),Q.return=re,re=Q):(Be=Pd(ue.type,ue.key,ue.props,null,re.mode,Be),Be.ref=cu(re,Q,ue),Be.return=re,re=Be)}return B(re);case f:e:{for(Mt=ue.key;Q!==null;){if(Q.key===Mt)if(Q.tag===4&&Q.stateNode.containerInfo===ue.containerInfo&&Q.stateNode.implementation===ue.implementation){v(re,Q.sibling),Q=w(Q,ue.children||[]),Q.return=re,re=Q;break e}else{v(re,Q);break}else u(re,Q);Q=Q.sibling}Q=dv(ue,re.mode,Be),Q.return=re,re=Q}return B(re);case S:return Mt=ue._init,pr(re,Q,Mt(ue._payload),Be)}if(q(ue))return et(re,Q,ue,Be);if(b(ue))return ii(re,Q,ue,Be);Qh(re,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"?(ue=""+ue,Q!==null&&Q.tag===6?(v(re,Q.sibling),Q=w(Q,ue),Q.return=re,re=Q):(v(re,Q),Q=hv(ue,re.mode,Be),Q.return=re,re=Q),B(re)):v(re,Q)}return pr}var El=DA(!0),UA=DA(!1),uu={},ur=kn(uu),fu=kn(uu),Tl=kn(uu);function Kr(c){if(c===uu)throw Error(o(174));return c}function R0(c,u){Xe(Tl,u),Xe(fu,c),Xe(ur,uu),c=oe(u),lt(ur),Xe(ur,c)}function bl(){lt(ur),lt(fu),lt(Tl)}function OA(c){var u=Kr(Tl.current),v=Kr(ur.current);u=k(v,c.type,u),v!==u&&(Xe(fu,c),Xe(ur,u))}function L0(c){fu.current===c&&(lt(ur),lt(fu))}var sn=kn(0);function $h(c){for(var u=c;u!==null;){if(u.tag===13){var v=u.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||iu(v)||ru(v)))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===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var I0=[];function N0(){for(var c=0;cv?v:4,c(!0);var M=fr.transition;fr.transition={};try{c(!1),u()}finally{Ut=v,fr.transition=M}}function KA(){return Jr().memoizedState}function xN(c,u,v){var M=io(c);v={lane:M,action:v,hasEagerState:!1,eagerState:null,next:null},JA(c)?QA(u,v):($A(c,u,v),v=gi(),c=hr(c,M,v),c!==null&&eM(c,u,M))}function _N(c,u,v){var M=io(c),w={lane:M,action:v,hasEagerState:!1,eagerState:null,next:null};if(JA(c))QA(u,w);else{$A(c,u,w);var T=c.alternate;if(c.lanes===0&&(T===null||T.lanes===0)&&(T=u.lastRenderedReducer,T!==null))try{var B=u.lastRenderedState,Z=T(B,v);if(w.hasEagerState=!0,w.eagerState=Z,Yr(Z,B))return}catch{}finally{}v=gi(),c=hr(c,M,v),c!==null&&eM(c,u,M)}}function JA(c){var u=c.alternate;return c===dn||u!==null&&u===dn}function QA(c,u){hu=td=!0;var v=c.pending;v===null?u.next=u:(u.next=v.next,v.next=u),c.pending=u}function $A(c,u,v){En!==null&&c.mode&1&&!(Tt&2)?(c=u.interleaved,c===null?(v.next=v,Zr===null?Zr=[u]:Zr.push(u)):(v.next=c.next,c.next=v),u.interleaved=v):(c=u.pending,c===null?v.next=v:(v.next=c.next,c.next=v),u.pending=v)}function eM(c,u,v){if(v&4194240){var M=u.lanes;M&=c.pendingLanes,v|=M,u.lanes=v,d0(c,v)}}var od={readContext:ar,useCallback:ti,useContext:ti,useEffect:ti,useImperativeHandle:ti,useInsertionEffect:ti,useLayoutEffect:ti,useMemo:ti,useReducer:ti,useRef:ti,useState:ti,useDebugValue:ti,useDeferredValue:ti,useTransition:ti,useMutableSource:ti,useSyncExternalStore:ti,useId:ti,unstable_isNewReconciler:!1},SN={readContext:ar,useCallback:function(c,u){return _s().memoizedState=[c,u===void 0?null:u],c},useContext:ar,useEffect:k0,useImperativeHandle:function(c,u,v){return v=v!=null?v.concat([c]):null,rd(4194308,4,XA.bind(null,u,c),v)},useLayoutEffect:function(c,u){return rd(4194308,4,c,u)},useInsertionEffect:function(c,u){return rd(4,2,c,u)},useMemo:function(c,u){var v=_s();return u=u===void 0?null:u,c=c(),v.memoizedState=[c,u],c},useReducer:function(c,u,v){var M=_s();return u=v!==void 0?v(u):u,M.memoizedState=M.baseState=u,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:u},M.queue=c,c=c.dispatch=xN.bind(null,dn,c),[M.memoizedState,c]},useRef:function(c){var u=_s();return c={current:c},u.memoizedState=c},useState:F0,useDebugValue:B0,useDeferredValue:function(c){var u=F0(c),v=u[0],M=u[1];return k0(function(){var w=fr.transition;fr.transition={};try{M(c)}finally{fr.transition=w}},[c]),v},useTransition:function(){var c=F0(!1),u=c[0];return c=yN.bind(null,c[1]),_s().memoizedState=c,[u,c]},useMutableSource:function(){},useSyncExternalStore:function(c,u,v){var M=dn,w=_s();if($t){if(v===void 0)throw Error(o(407));v=v()}else{if(v=u(),En===null)throw Error(o(349));Cl&30||BA(M,u,v)}w.memoizedState=v;var T={value:v,getSnapshot:u};return w.queue=T,k0(VA.bind(null,M,T,c),[c]),M.flags|=2048,pu(9,zA.bind(null,M,T,v,u),void 0,null),v},useId:function(){var c=_s(),u=En.identifierPrefix;if($t){var v=xs,M=ys;v=(M&~(1<<32-Vi(M)-1)).toString(32)+v,u=":"+u+"R"+v,v=du++,0rv&&(u.flags|=128,M=!0,yu(w,!1),u.lanes=4194304)}else{if(!M)if(c=$h(T),c!==null){if(u.flags|=128,M=!0,c=c.updateQueue,c!==null&&(u.updateQueue=c,u.flags|=4),yu(w,!0),w.tail===null&&w.tailMode==="hidden"&&!T.alternate&&!$t)return ni(u),null}else 2*zn()-w.renderingStartTime>rv&&v!==1073741824&&(u.flags|=128,M=!0,yu(w,!1),u.lanes=4194304);w.isBackwards?(T.sibling=u.child,u.child=T):(c=w.last,c!==null?c.sibling=T:u.child=T,w.last=T)}return w.tail!==null?(u=w.tail,w.rendering=u,w.tail=u.sibling,w.renderingStartTime=zn(),u.sibling=null,c=sn.current,Xe(sn,M?c&1|2:c&1),u):(ni(u),null);case 22:case 23:return cv(),M=u.memoizedState!==null,c!==null&&c.memoizedState!==null!==M&&(u.flags|=8192),M&&u.mode&1?ji&1073741824&&(ni(u),Te&&u.subtreeFlags&6&&(u.flags|=8192)):ni(u),null;case 24:return null;case 25:return null}throw Error(o(156,u.tag))}var TN=a.ReactCurrentOwner,Gi=!1;function mi(c,u,v,M){u.child=c===null?UA(u,null,v,M):El(u,c.child,v,M)}function lM(c,u,v,M,w){v=v.render;var T=u.ref;return Sl(u,w),M=U0(c,u,v,M,T,w),v=O0(),c!==null&&!Gi?(u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~w,Ss(c,u,w)):($t&&v&&E0(u),u.flags|=1,mi(c,u,M,w),u.child)}function cM(c,u,v,M,w){if(c===null){var T=v.type;return typeof T=="function"&&!fv(T)&&T.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(u.tag=15,u.type=T,uM(c,u,T,M,w)):(c=Pd(v.type,null,M,u,u.mode,w),c.ref=u.ref,c.return=u,u.child=c)}if(T=c.child,!(c.lanes&w)){var B=T.memoizedProps;if(v=v.compare,v=v!==null?v:Gh,v(B,M)&&c.ref===u.ref)return Ss(c,u,w)}return u.flags|=1,c=so(T,M),c.ref=u.ref,c.return=u,u.child=c}function uM(c,u,v,M,w){if(c!==null&&Gh(c.memoizedProps,M)&&c.ref===u.ref)if(Gi=!1,(c.lanes&w)!==0)c.flags&131072&&(Gi=!0);else return u.lanes=c.lanes,Ss(c,u,w);return H0(c,u,v,M,w)}function fM(c,u,v){var M=u.pendingProps,w=M.children,T=c!==null?c.memoizedState:null;if(M.mode==="hidden")if(!(u.mode&1))u.memoizedState={baseLanes:0,cachePool:null},Xe(Pl,ji),ji|=v;else if(v&1073741824)u.memoizedState={baseLanes:0,cachePool:null},M=T!==null?T.baseLanes:v,Xe(Pl,ji),ji|=M;else return c=T!==null?T.baseLanes|v:v,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:c,cachePool:null},u.updateQueue=null,Xe(Pl,ji),ji|=c,null;else T!==null?(M=T.baseLanes|v,u.memoizedState=null):M=v,Xe(Pl,ji),ji|=M;return mi(c,u,w,v),u.child}function hM(c,u){var v=u.ref;(c===null&&v!==null||c!==null&&c.ref!==v)&&(u.flags|=512,u.flags|=2097152)}function H0(c,u,v,M,w){var T=Bn(v)?Gr:Et.current;return T=or(u,T),Sl(u,w),v=U0(c,u,v,M,T,w),M=O0(),c!==null&&!Gi?(u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~w,Ss(c,u,w)):($t&&M&&E0(u),u.flags|=1,mi(c,u,v,w),u.child)}function dM(c,u,v,M,w){if(Bn(v)){var T=!0;qn(u)}else T=!1;if(Sl(u,w),u.stateNode===null)c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),bA(u,v,M),w0(u,v,M,w),M=!0;else if(c===null){var B=u.stateNode,Z=u.memoizedProps;B.props=Z;var he=B.context,Ce=v.contextType;typeof Ce=="object"&&Ce!==null?Ce=ar(Ce):(Ce=Bn(v)?Gr:Et.current,Ce=or(u,Ce));var Ye=v.getDerivedStateFromProps,vt=typeof Ye=="function"||typeof B.getSnapshotBeforeUpdate=="function";vt||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(Z!==M||he!==Ce)&&CA(u,B,M,Ce),$s=!1;var st=u.memoizedState;B.state=st,qh(u,M,B,w),he=u.memoizedState,Z!==M||st!==he||hn.current||$s?(typeof Ye=="function"&&(M0(u,v,Ye,M),he=u.memoizedState),(Z=$s||TA(u,v,Z,M,st,he,Ce))?(vt||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(u.flags|=4194308)):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=M,u.memoizedState=he),B.props=M,B.state=he,B.context=Ce,M=Z):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),M=!1)}else{B=u.stateNode,AA(c,u),Z=u.memoizedProps,Ce=u.type===u.elementType?Z:Mr(u.type,Z),B.props=Ce,vt=u.pendingProps,st=B.context,he=v.contextType,typeof he=="object"&&he!==null?he=ar(he):(he=Bn(v)?Gr:Et.current,he=or(u,he));var Wt=v.getDerivedStateFromProps;(Ye=typeof Wt=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(Z!==vt||st!==he)&&CA(u,B,M,he),$s=!1,st=u.memoizedState,B.state=st,qh(u,M,B,w);var et=u.memoizedState;Z!==vt||st!==et||hn.current||$s?(typeof Wt=="function"&&(M0(u,v,Wt,M),et=u.memoizedState),(Ce=$s||TA(u,v,Ce,M,st,et,he)||!1)?(Ye||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(M,et,he),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(M,et,he)),typeof B.componentDidUpdate=="function"&&(u.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof B.componentDidUpdate!="function"||Z===c.memoizedProps&&st===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&st===c.memoizedState||(u.flags|=1024),u.memoizedProps=M,u.memoizedState=et),B.props=M,B.state=et,B.context=he,M=Ce):(typeof B.componentDidUpdate!="function"||Z===c.memoizedProps&&st===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&st===c.memoizedState||(u.flags|=1024),M=!1)}return W0(c,u,v,M,T,w)}function W0(c,u,v,M,w,T){hM(c,u);var B=(u.flags&128)!==0;if(!M&&!B)return w&&xl(u,v,!1),Ss(c,u,T);M=u.stateNode,TN.current=u;var Z=B&&typeof v.getDerivedStateFromError!="function"?null:M.render();return u.flags|=1,c!==null&&B?(u.child=El(u,c.child,null,T),u.child=El(u,null,Z,T)):mi(c,u,Z,T),u.memoizedState=M.state,w&&xl(u,v,!0),u.child}function pM(c){var u=c.stateNode;u.pendingContext?jr(c,u.pendingContext,u.pendingContext!==u.context):u.context&&jr(c,u.context,!1),R0(c,u.containerInfo)}function mM(c,u,v,M,w){return wl(),P0(w),u.flags|=256,mi(c,u,v,M),u.child}var cd={dehydrated:null,treeContext:null,retryLane:0};function ud(c){return{baseLanes:c,cachePool:null}}function gM(c,u,v){var M=u.pendingProps,w=sn.current,T=!1,B=(u.flags&128)!==0,Z;if((Z=B)||(Z=c!==null&&c.memoizedState===null?!1:(w&2)!==0),Z?(T=!0,u.flags&=-129):(c===null||c.memoizedState!==null)&&(w|=1),Xe(sn,w&1),c===null)return C0(u),c=u.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(u.mode&1?ru(c)?u.lanes=8:u.lanes=1073741824:u.lanes=1,null):(w=M.children,c=M.fallback,T?(M=u.mode,T=u.child,w={mode:"hidden",children:w},!(M&1)&&T!==null?(T.childLanes=0,T.pendingProps=w):T=Rd(w,M,0,null),c=ha(c,M,v,null),T.return=u,c.return=u,T.sibling=c,u.child=T,u.child.memoizedState=ud(v),u.memoizedState=cd,c):G0(u,w));if(w=c.memoizedState,w!==null){if(Z=w.dehydrated,Z!==null){if(B)return u.flags&256?(u.flags&=-257,fd(c,u,v,Error(o(422)))):u.memoizedState!==null?(u.child=c.child,u.flags|=128,null):(T=M.fallback,w=u.mode,M=Rd({mode:"visible",children:M.children},w,0,null),T=ha(T,w,v,null),T.flags|=2,M.return=u,T.return=u,M.sibling=T,u.child=M,u.mode&1&&El(u,c.child,null,v),u.child.memoizedState=ud(v),u.memoizedState=cd,T);if(!(u.mode&1))u=fd(c,u,v,null);else if(ru(Z))u=fd(c,u,v,Error(o(419)));else if(M=(v&c.childLanes)!==0,Gi||M){if(M=En,M!==null){switch(v&-v){case 4:T=2;break;case 16:T=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:T=32;break;case 536870912:T=268435456;break;default:T=0}M=T&(M.suspendedLanes|v)?0:T,M!==0&&M!==w.retryLane&&(w.retryLane=M,hr(c,M,-1))}uv(),u=fd(c,u,v,Error(o(421)))}else iu(Z)?(u.flags|=128,u.child=c.child,u=BN.bind(null,c),gl(Z,u),u=null):(v=w.treeContext,ye&&(Wi=Fh(Z),Hi=u,$t=!0,wr=null,au=!1,v!==null&&(lr[cr++]=ys,lr[cr++]=xs,lr[cr++]=ra,ys=v.id,xs=v.overflow,ra=u)),u=G0(u,u.pendingProps.children),u.flags|=4096);return u}return T?(M=yM(c,u,M.children,M.fallback,v),T=u.child,w=c.child.memoizedState,T.memoizedState=w===null?ud(v):{baseLanes:w.baseLanes|v,cachePool:null},T.childLanes=c.childLanes&~v,u.memoizedState=cd,M):(v=vM(c,u,M.children,v),u.memoizedState=null,v)}return T?(M=yM(c,u,M.children,M.fallback,v),T=u.child,w=c.child.memoizedState,T.memoizedState=w===null?ud(v):{baseLanes:w.baseLanes|v,cachePool:null},T.childLanes=c.childLanes&~v,u.memoizedState=cd,M):(v=vM(c,u,M.children,v),u.memoizedState=null,v)}function G0(c,u){return u=Rd({mode:"visible",children:u},c.mode,0,null),u.return=c,c.child=u}function vM(c,u,v,M){var w=c.child;return c=w.sibling,v=so(w,{mode:"visible",children:v}),!(u.mode&1)&&(v.lanes=M),v.return=u,v.sibling=null,c!==null&&(M=u.deletions,M===null?(u.deletions=[c],u.flags|=16):M.push(c)),u.child=v}function yM(c,u,v,M,w){var T=u.mode;c=c.child;var B=c.sibling,Z={mode:"hidden",children:v};return!(T&1)&&u.child!==c?(v=u.child,v.childLanes=0,v.pendingProps=Z,u.deletions=null):(v=so(c,Z),v.subtreeFlags=c.subtreeFlags&14680064),B!==null?M=so(B,M):(M=ha(M,T,w,null),M.flags|=2),M.return=u,v.return=u,v.sibling=M,u.child=v,M}function fd(c,u,v,M){return M!==null&&P0(M),El(u,c.child,null,v),c=G0(u,u.pendingProps.children),c.flags|=2,u.memoizedState=null,c}function xM(c,u,v){c.lanes|=u;var M=c.alternate;M!==null&&(M.lanes|=u),S0(c.return,u,v)}function j0(c,u,v,M,w){var T=c.memoizedState;T===null?c.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:M,tail:v,tailMode:w}:(T.isBackwards=u,T.rendering=null,T.renderingStartTime=0,T.last=M,T.tail=v,T.tailMode=w)}function _M(c,u,v){var M=u.pendingProps,w=M.revealOrder,T=M.tail;if(mi(c,u,M.children,v),M=sn.current,M&2)M=M&1|2,u.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=u.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&xM(c,v,u);else if(c.tag===19)xM(c,v,u);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}M&=1}if(Xe(sn,M),!(u.mode&1))u.memoizedState=null;else switch(w){case"forwards":for(v=u.child,w=null;v!==null;)c=v.alternate,c!==null&&$h(c)===null&&(w=v),v=v.sibling;v=w,v===null?(w=u.child,u.child=null):(w=v.sibling,v.sibling=null),j0(u,!1,w,v,T);break;case"backwards":for(v=null,w=u.child,u.child=null;w!==null;){if(c=w.alternate,c!==null&&$h(c)===null){u.child=w;break}c=w.sibling,w.sibling=v,v=w,w=c}j0(u,!0,v,null,T);break;case"together":j0(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Ss(c,u,v){if(c!==null&&(u.dependencies=c.dependencies),Rl|=u.lanes,!(v&u.childLanes))return null;if(c!==null&&u.child!==c.child)throw Error(o(153));if(u.child!==null){for(c=u.child,v=so(c,c.pendingProps),u.child=v,v.return=u;c.sibling!==null;)c=c.sibling,v=v.sibling=so(c,c.pendingProps),v.return=u;v.sibling=null}return u.child}function bN(c,u,v){switch(u.tag){case 3:pM(u),wl();break;case 5:OA(u);break;case 1:Bn(u.type)&&qn(u);break;case 4:R0(u,u.stateNode.containerInfo);break;case 10:SA(u,u.type._context,u.memoizedProps.value);break;case 13:var M=u.memoizedState;if(M!==null)return M.dehydrated!==null?(Xe(sn,sn.current&1),u.flags|=128,null):v&u.child.childLanes?gM(c,u,v):(Xe(sn,sn.current&1),c=Ss(c,u,v),c!==null?c.sibling:null);Xe(sn,sn.current&1);break;case 19:if(M=(v&u.childLanes)!==0,c.flags&128){if(M)return _M(c,u,v);u.flags|=128}var w=u.memoizedState;if(w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Xe(sn,sn.current),M)break;return null;case 22:case 23:return u.lanes=0,fM(c,u,v)}return Ss(c,u,v)}function CN(c,u){switch(T0(u),u.tag){case 1:return Bn(u.type)&&xn(),c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 3:return bl(),lt(hn),lt(Et),N0(),c=u.flags,c&65536&&!(c&128)?(u.flags=c&-65537|128,u):null;case 5:return L0(u),null;case 13:if(lt(sn),c=u.memoizedState,c!==null&&c.dehydrated!==null){if(u.alternate===null)throw Error(o(340));wl()}return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 19:return lt(sn),null;case 4:return bl(),null;case 10:return _0(u.type._context),null;case 22:case 23:return cv(),null;case 24:return null;default:return null}}var hd=!1,aa=!1,PN=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function dd(c,u){var v=c.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(M){Ri(c,u,M)}else v.current=null}function X0(c,u,v){try{v()}catch(M){Ri(c,u,M)}}var SM=!1;function RN(c,u){for(j(c.containerInfo),Fe=u;Fe!==null;)if(c=Fe,u=c.child,(c.subtreeFlags&1028)!==0&&u!==null)u.return=c,Fe=u;else for(;Fe!==null;){c=Fe;try{var v=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var M=v.memoizedProps,w=v.memoizedState,T=c.stateNode,B=T.getSnapshotBeforeUpdate(c.elementType===c.type?M:Mr(c.type,M),w);T.__reactInternalSnapshotBeforeUpdate=B}break;case 3:Te&&Re(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Z){Ri(c,c.return,Z)}if(u=c.sibling,u!==null){u.return=c.return,Fe=u;break}Fe=c.return}return v=SM,SM=!1,v}function la(c,u,v){var M=u.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var w=M=M.next;do{if((w.tag&c)===c){var T=w.destroy;w.destroy=void 0,T!==void 0&&X0(u,v,T)}w=w.next}while(w!==M)}}function xu(c,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var v=u=u.next;do{if((v.tag&c)===c){var M=v.create;v.destroy=M()}v=v.next}while(v!==u)}}function Y0(c){var u=c.ref;if(u!==null){var v=c.stateNode;switch(c.tag){case 5:c=ee(v);break;default:c=v}typeof u=="function"?u(c):u.current=c}}function AM(c,u,v){if(Xr&&typeof Xr.onCommitFiberUnmount=="function")try{Xr.onCommitFiberUnmount(Hh,u)}catch{}switch(u.tag){case 0:case 11:case 14:case 15:if(c=u.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var M=c=c.next;do{var w=M,T=w.destroy;w=w.tag,T!==void 0&&(w&2||w&4)&&X0(u,v,T),M=M.next}while(M!==c)}break;case 1:if(dd(u,v),c=u.stateNode,typeof c.componentWillUnmount=="function")try{c.props=u.memoizedProps,c.state=u.memoizedState,c.componentWillUnmount()}catch(B){Ri(u,v,B)}break;case 5:dd(u,v);break;case 4:Te?CM(c,u,v):W&&W&&(u=u.stateNode.containerInfo,v=rt(u),Rt(u,v))}}function MM(c,u,v){for(var M=u;;)if(AM(c,M,v),M.child===null||Te&&M.tag===4){if(M===u)break;for(;M.sibling===null;){if(M.return===null||M.return===u)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function wM(c){var u=c.alternate;u!==null&&(c.alternate=null,wM(u)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(u=c.stateNode,u!==null&&We(u)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function EM(c){return c.tag===5||c.tag===3||c.tag===4}function TM(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||EM(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function bM(c){if(Te){e:{for(var u=c.return;u!==null;){if(EM(u))break e;u=u.return}throw Error(o(160))}var v=u;switch(v.tag){case 5:u=v.stateNode,v.flags&32&&(ge(u),v.flags&=-33),v=TM(c),Z0(c,v,u);break;case 3:case 4:u=v.stateNode.containerInfo,v=TM(c),q0(c,v,u);break;default:throw Error(o(161))}}}function q0(c,u,v){var M=c.tag;if(M===5||M===6)c=c.stateNode,u?tt(v,c,u):pt(v,c);else if(M!==4&&(c=c.child,c!==null))for(q0(c,u,v),c=c.sibling;c!==null;)q0(c,u,v),c=c.sibling}function Z0(c,u,v){var M=c.tag;if(M===5||M===6)c=c.stateNode,u?ft(v,c,u):it(v,c);else if(M!==4&&(c=c.child,c!==null))for(Z0(c,u,v),c=c.sibling;c!==null;)Z0(c,u,v),c=c.sibling}function CM(c,u,v){for(var M=u,w=!1,T,B;;){if(!w){w=M.return;e:for(;;){if(w===null)throw Error(o(160));switch(T=w.stateNode,w.tag){case 5:B=!1;break e;case 3:T=T.containerInfo,B=!0;break e;case 4:T=T.containerInfo,B=!0;break e}w=w.return}w=!0}if(M.tag===5||M.tag===6)MM(c,M,v),B?X(T,M.stateNode):Ge(T,M.stateNode);else if(M.tag===18)B?se(T,M.stateNode):ce(T,M.stateNode);else if(M.tag===4){if(M.child!==null){T=M.stateNode.containerInfo,B=!0,M.child.return=M,M=M.child;continue}}else if(AM(c,M,v),M.child!==null){M.child.return=M,M=M.child;continue}if(M===u)break;for(;M.sibling===null;){if(M.return===null||M.return===u)return;M=M.return,M.tag===4&&(w=!1)}M.sibling.return=M.return,M=M.sibling}}function K0(c,u){if(Te){switch(u.tag){case 0:case 11:case 14:case 15:la(3,u,u.return),xu(3,u),la(5,u,u.return);return;case 1:return;case 5:var v=u.stateNode;if(v!=null){var M=u.memoizedProps;c=c!==null?c.memoizedProps:M;var w=u.type,T=u.updateQueue;u.updateQueue=null,T!==null&&_t(v,T,w,c,M,u)}return;case 6:if(u.stateNode===null)throw Error(o(162));v=u.memoizedProps,Ae(u.stateNode,c!==null?c.memoizedProps:v,v);return;case 3:ye&&c!==null&&c.memoizedState.isDehydrated&&ne(u.stateNode.containerInfo);return;case 12:return;case 13:pd(u);return;case 19:pd(u);return;case 17:return}throw Error(o(163))}switch(u.tag){case 0:case 11:case 14:case 15:la(3,u,u.return),xu(3,u),la(5,u,u.return);return;case 12:return;case 13:pd(u);return;case 19:pd(u);return;case 3:ye&&c!==null&&c.memoizedState.isDehydrated&&ne(u.stateNode.containerInfo);break;case 22:case 23:return}e:if(W){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 pd(c){var u=c.updateQueue;if(u!==null){c.updateQueue=null;var v=c.stateNode;v===null&&(v=c.stateNode=new PN),u.forEach(function(M){var w=zN.bind(null,c,M);v.has(M)||(v.add(M),M.then(w,w))})}}function LN(c,u){for(Fe=u;Fe!==null;){u=Fe;var v=u.deletions;if(v!==null)for(var M=0;M";case gd:return":has("+($0(c)||"")+")";case vd:return'[role="'+c.value+'"]';case xd:return'"'+c.value+'"';case yd:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function NM(c,u){var v=[];c=[c,0];for(var M=0;Mw&&(w=B),M&=~T}if(M=w,M=zn()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*NN(M/1960))-M,10c?16:c,no===null)var M=!1;else{if(c=no,no=null,wd=0,Tt&6)throw Error(o(331));var w=Tt;for(Tt|=4,Fe=c.current;Fe!==null;){var T=Fe,B=T.child;if(Fe.flags&16){var Z=T.deletions;if(Z!==null){for(var he=0;hezn()-iv?ca(c,0):nv|=v),Pi(c,u)}function HM(c,u){u===0&&(c.mode&1?(u=zh,zh<<=1,!(zh&130023424)&&(zh=4194304)):u=1);var v=gi();c=bd(c,u),c!==null&&(ou(c,u,v),Pi(c,v))}function BN(c){var u=c.memoizedState,v=0;u!==null&&(v=u.retryLane),HM(c,v)}function zN(c,u){var v=0;switch(c.tag){case 13:var M=c.stateNode,w=c.memoizedState;w!==null&&(v=w.retryLane);break;case 19:M=c.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(u),HM(c,v)}var WM;WM=function(c,u,v){if(c!==null)if(c.memoizedProps!==u.pendingProps||hn.current)Gi=!0;else{if(!(c.lanes&v)&&!(u.flags&128))return Gi=!1,bN(c,u,v);Gi=!!(c.flags&131072)}else Gi=!1,$t&&u.flags&1048576&&PA(u,Jh,u.index);switch(u.lanes=0,u.tag){case 2:var M=u.type;c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),c=u.pendingProps;var w=or(u,Et.current);Sl(u,v),w=U0(null,u,M,c,w,v);var T=O0();return u.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Bn(M)?(T=!0,qn(u)):T=!1,u.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,A0(u),w.updater=Zh,u.stateNode=w,w._reactInternals=u,w0(u,M,c,v),u=W0(null,u,M,!0,T,v)):(u.tag=0,$t&&T&&E0(u),mi(null,u,w,v),u=u.child),u;case 16:M=u.elementType;e:{switch(c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),c=u.pendingProps,w=M._init,M=w(M._payload),u.type=M,w=u.tag=HN(M),c=Mr(M,c),w){case 0:u=H0(null,u,M,c,v);break e;case 1:u=dM(null,u,M,c,v);break e;case 11:u=lM(null,u,M,c,v);break e;case 14:u=cM(null,u,M,Mr(M.type,c),v);break e}throw Error(o(306,M,""))}return u;case 0:return M=u.type,w=u.pendingProps,w=u.elementType===M?w:Mr(M,w),H0(c,u,M,w,v);case 1:return M=u.type,w=u.pendingProps,w=u.elementType===M?w:Mr(M,w),dM(c,u,M,w,v);case 3:e:{if(pM(u),c===null)throw Error(o(387));M=u.pendingProps,T=u.memoizedState,w=T.element,AA(c,u),qh(u,M,null,v);var B=u.memoizedState;if(M=B.element,ye&&T.isDehydrated)if(T={element:M,isDehydrated:!1,cache:B.cache,transitions:B.transitions},u.updateQueue.baseState=T,u.memoizedState=T,u.flags&256){w=Error(o(423)),u=mM(c,u,M,v,w);break e}else if(M!==w){w=Error(o(424)),u=mM(c,u,M,v,w);break e}else for(ye&&(Wi=Oh(u.stateNode.containerInfo),Hi=u,$t=!0,wr=null,au=!1),v=UA(u,null,M,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(wl(),M===w){u=Ss(c,u,v);break e}mi(c,u,M,v)}u=u.child}return u;case 5:return OA(u),c===null&&C0(u),M=u.type,w=u.pendingProps,T=c!==null?c.memoizedProps:null,B=w.children,ve(M,w)?B=null:T!==null&&ve(M,T)&&(u.flags|=32),hM(c,u),mi(c,u,B,v),u.child;case 6:return c===null&&C0(u),null;case 13:return gM(c,u,v);case 4:return R0(u,u.stateNode.containerInfo),M=u.pendingProps,c===null?u.child=El(u,null,M,v):mi(c,u,M,v),u.child;case 11:return M=u.type,w=u.pendingProps,w=u.elementType===M?w:Mr(M,w),lM(c,u,M,w,v);case 7:return mi(c,u,u.pendingProps,v),u.child;case 8:return mi(c,u,u.pendingProps.children,v),u.child;case 12:return mi(c,u,u.pendingProps.children,v),u.child;case 10:e:{if(M=u.type._context,w=u.pendingProps,T=u.memoizedProps,B=w.value,SA(u,M,B),T!==null)if(Yr(T.value,B)){if(T.children===w.children&&!hn.current){u=Ss(c,u,v);break e}}else for(T=u.child,T!==null&&(T.return=u);T!==null;){var Z=T.dependencies;if(Z!==null){B=T.child;for(var he=Z.firstContext;he!==null;){if(he.context===M){if(T.tag===1){he=vs(-1,v&-v),he.tag=2;var Ce=T.updateQueue;if(Ce!==null){Ce=Ce.shared;var Ye=Ce.pending;Ye===null?he.next=he:(he.next=Ye.next,Ye.next=he),Ce.pending=he}}T.lanes|=v,he=T.alternate,he!==null&&(he.lanes|=v),S0(T.return,v,u),Z.lanes|=v;break}he=he.next}}else if(T.tag===10)B=T.type===u.type?null:T.child;else if(T.tag===18){if(B=T.return,B===null)throw Error(o(341));B.lanes|=v,Z=B.alternate,Z!==null&&(Z.lanes|=v),S0(B,v,u),B=T.sibling}else B=T.child;if(B!==null)B.return=T;else for(B=T;B!==null;){if(B===u){B=null;break}if(T=B.sibling,T!==null){T.return=B.return,B=T;break}B=B.return}T=B}mi(c,u,w.children,v),u=u.child}return u;case 9:return w=u.type,M=u.pendingProps.children,Sl(u,v),w=ar(w),M=M(w),u.flags|=1,mi(c,u,M,v),u.child;case 14:return M=u.type,w=Mr(M,u.pendingProps),w=Mr(M.type,w),cM(c,u,M,w,v);case 15:return uM(c,u,u.type,u.pendingProps,v);case 17:return M=u.type,w=u.pendingProps,w=u.elementType===M?w:Mr(M,w),c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),u.tag=1,Bn(M)?(c=!0,qn(u)):c=!1,Sl(u,v),bA(u,M,w),w0(u,M,w,v),W0(null,u,M,!0,c,v);case 19:return _M(c,u,v);case 22:return fM(c,u,v)}throw Error(o(156,u.tag))};function GM(c,u){return p0(c,u)}function VN(c,u,v,M){this.tag=c,this.key=v,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=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dr(c,u,v,M){return new VN(c,u,v,M)}function fv(c){return c=c.prototype,!(!c||!c.isReactComponent)}function HN(c){if(typeof c=="function")return fv(c)?1:0;if(c!=null){if(c=c.$$typeof,c===A)return 11;if(c===_)return 14}return 2}function so(c,u){var v=c.alternate;return v===null?(v=dr(c.tag,u,c.key,c.mode),v.elementType=c.elementType,v.type=c.type,v.stateNode=c.stateNode,v.alternate=c,c.alternate=v):(v.pendingProps=u,v.type=c.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=c.flags&14680064,v.childLanes=c.childLanes,v.lanes=c.lanes,v.child=c.child,v.memoizedProps=c.memoizedProps,v.memoizedState=c.memoizedState,v.updateQueue=c.updateQueue,u=c.dependencies,v.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},v.sibling=c.sibling,v.index=c.index,v.ref=c.ref,v}function Pd(c,u,v,M,w,T){var B=2;if(M=c,typeof c=="function")fv(c)&&(B=1);else if(typeof c=="string")B=5;else e:switch(c){case h:return ha(v.children,w,T,u);case d:B=8,w|=8;break;case p:return c=dr(12,v,u,w|2),c.elementType=p,c.lanes=T,c;case x:return c=dr(13,v,u,w),c.elementType=x,c.lanes=T,c;case g:return c=dr(19,v,u,w),c.elementType=g,c.lanes=T,c;case E:return Rd(v,w,T,u);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case m:B=10;break e;case y:B=9;break e;case A:B=11;break e;case _:B=14;break e;case S:B=16,M=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return u=dr(B,v,u,w),u.elementType=c,u.type=M,u.lanes=T,u}function ha(c,u,v,M){return c=dr(7,c,M,u),c.lanes=v,c}function Rd(c,u,v,M){return c=dr(22,c,M,u),c.elementType=E,c.lanes=v,c.stateNode={},c}function hv(c,u,v){return c=dr(6,c,null,u),c.lanes=v,c}function dv(c,u,v){return u=dr(4,c.children!==null?c.children:[],c.key,u),u.lanes=v,u.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},u}function WN(c,u,v,M,w){this.tag=u,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=nt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=h0(0),this.expirationTimes=h0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=h0(0),this.identifierPrefix=M,this.onRecoverableError=w,ye&&(this.mutableSourceEagerHydrationData=null)}function jM(c,u,v,M,w,T,B,Z,he){return c=new WN(c,u,v,Z,he),u===1?(u=1,T===!0&&(u|=8)):u=0,T=dr(3,null,null,u),c.current=T,T.stateNode=c,T.memoizedState={element:M,isDehydrated:v,cache:null,transitions:null},A0(T),c}function XM(c){if(!c)return sr;c=c._reactInternals;e:{if(C(c)!==c||c.tag!==1)throw Error(o(170));var u=c;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Bn(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(o(171))}if(c.tag===1){var v=c.type;if(Bn(v))return yl(c,v,u)}return u}function YM(c){var u=c._reactInternals;if(u===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=K(u),c===null?null:c.stateNode}function qM(c,u){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v=Ce&&T>=vt&&w<=Ye&&B<=st){c.splice(u,1);break}else if(M!==Ce||v.width!==he.width||stB){if(!(T!==vt||v.height!==he.height||Yew)){Ce>M&&(he.width+=Ce-M,he.x=M),YeT&&(he.height+=vt-T,he.y=T),stv&&(v=B)),B ")+` + +No matching component was found for: + `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return ee(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:GN,findFiberByHostInstance:c.findFiberByHostInstance||jN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)c=!0;else{try{Hh=u.inject(c),Xr=u}catch{}c=!!u.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,u,v,M){if(!I)throw Error(o(363));c=ev(c,u);var w=Ue(c,v,M).disconnect;return{disconnect:function(){w()}}},t.registerMutableSourceForHydration=function(c,u){var v=u._getVersion;v=v(u._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[u,v]:c.mutableSourceEagerHydrationData.push(u,v)},t.runWithPriority=function(c,u){var v=Ut;try{return Ut=c,u()}finally{Ut=v}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,u,v,M){var w=u.current,T=gi(),B=io(w);return v=XM(v),u.context===null?u.context=v:u.pendingContext=v,u=vs(T,B),u.payload={element:c},M=M===void 0?null:M,M!==null&&(u.callback=M),eo(w,u),c=hr(w,B,T),c!==null&&Yh(c,w,B),B},t};D3.exports=p7;var m7=D3.exports;const g7=tS(m7),v7=n=>typeof n=="object"&&typeof n.then=="function",Va=[];function F3(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=Va.indexOf(r);s!==-1&&Va.splice(s,1)},promise:(v7(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(Va.push(r),!t)throw r.promise}const y7=(n,e,t)=>k3(n,e,!1,t),x7=(n,e,t)=>void k3(n,e,!0,t),_7=n=>{if(n===void 0||n.length===0)Va.splice(0,Va.length);else{const e=Va.find(t=>F3(n,t.keys,t.equal));e&&e.remove()}},dA={},S7=n=>void Object.assign(dA,n);function A7(n,e){function t(h,{args:d=[],attach:p,...m},y){let A=`${h[0].toUpperCase()}${h.slice(1)}`,x;if(h==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;x=tc(g,{type:h,root:y,attach:p,primitive:!0})}else{const g=dA[A];if(!g)throw new Error(`R3F: ${A} 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=tc(new g(...d),{type:h,root:y,attach:p,memoizedProps:{args:d}})}return x.__r3f.attach===void 0&&(x instanceof xt?x.__r3f.attach="geometry":x instanceof $n&&(x.__r3f.attach="material")),A!=="inject"&&Vy(x,m),x}function i(h,d){let p=!1;if(d){var m,y;(m=d.__r3f)!=null&&m.attach?zy(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||tc(d,{}),d.__r3f.parent=h,Q_(d),nc(d)}}function r(h,d,p){let m=!1;if(d){var y,A;if((y=d.__r3f)!=null&&y.attach)zy(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"});const x=h.children.filter(_=>_!==d),g=x.indexOf(p);h.children=[...x.slice(0,g),d,...x.slice(g)],m=!0}m||(A=h.__r3f)==null||A.objects.push(d),d.__r3f||tc(d,{}),d.__r3f.parent=h,Q_(d),nc(d)}}function s(h,d,p=!1){h&&[...h].forEach(m=>o(d,m,p))}function o(h,d,p){if(d){var m,y,A;if(d.__r3f&&(d.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(E=>E!==d)),(y=d.__r3f)!=null&&y.attach)rC(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var x;h.remove(d),(x=d.__r3f)!=null&&x.root&&L7(d.__r3f.root,d)}const _=(A=d.__r3f)==null?void 0:A.primitive,S=!_&&(p===void 0?d.dispose!==null:p);if(!_){var g;s((g=d.__r3f)==null?void 0:g.objects,d,S),s(d.children,d,S)}if(delete d.__r3f,S&&d.dispose&&d.type!=="Scene"){const E=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?K_.unstable_scheduleCallback(K_.unstable_IdlePriority,E):E()}nc(h)}}function a(h,d,p,m){var y;const A=(y=h.__r3f)==null?void 0:y.parent;if(!A)return;const x=t(d,p,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(A,h),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),i(A,x),x.raycast&&x.__r3f.eventCount&&x.__r3f.root.getState().internal.interaction.push(x),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=x,g.ref&&(typeof g.ref=="function"?g.ref(x):g.ref.current=x))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:g7({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 m=h.getState().scene;m.__r3f&&r(m,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,m){var y;if(((y=h==null?void 0:h.__r3f)!=null?y:{}).primitive&&m.object&&m.object!==h)return[!0];{const{args:x=[],children:g,..._}=m,{args:S=[],children:E,...P}=p;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((L,N)=>L!==S[N]))return[!0];const b=j3(h,_,P,!0);return b.changes.length?[!1,b]:null}},commitUpdate(h,[d,p],m,y,A,x){d?a(h,m,A,x):Vy(h,p)},commitMount(h,d,p,m){var y;const A=(y=h.__r3f)!=null?y:{};h.raycast&&A.handlers&&A.eventCount&&h.__r3f.root.getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>tc(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:p,parent:m}=(d=h.__r3f)!=null?d:{};p&&m&&rC(m,h,p),h.isObject3D&&(h.visible=!1),nc(h)},unhideInstance(h,d){var p;const{attach:m,parent:y}=(p=h.__r3f)!=null?p:{};m&&y&&zy(y,h,m),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),nc(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Ec.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Zt.fun(performance.now)?performance.now:Zt.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Zt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Zt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Vy}}var eC,tC;const By=n=>"colorSpace"in n||"outputColorSpace"in n,B3=()=>{var n;return(n=dA.ColorManagement)!=null?n:null},z3=n=>n&&n.isOrthographicCamera,M7=n=>n&&n.hasOwnProperty("current"),Nh=typeof window<"u"&&((eC=window.document)!=null&&eC.createElement||((tC=window.navigator)==null?void 0:tC.product)==="ReactNative")?V.useLayoutEffect:V.useEffect;function V3(n){const e=V.useRef(n);return Nh(()=>void(e.current=n),[n]),e}function w7({set:n}){return Nh(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class H3 extends V.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}H3.getDerivedStateFromError=()=>({error:!0});const W3="__default",nC=new Map,E7=n=>n&&!!n.memoized&&!!n.changes;function G3(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 Yu=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},Zt={obj:n=>n===Object(n)&&!Zt.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(Zt.str(n)||Zt.num(n))return n===e;const s=Zt.obj(n);if(s&&i==="reference")return n===e;const o=Zt.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(!Zt.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(Zt.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 T7(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function b7(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function tc(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function J_(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 iC=/-\d+$/;function zy(n,e,t){if(Zt.str(t)){if(iC.test(t)){const s=t.replace(iC,""),{target:o,key:a}=J_(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=J_(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function rC(n,e,t){var i,r;if(Zt.str(t)){const{target:s,key:o}=J_(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 j3(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},f=!1){var h;const d=(h=n==null?void 0:n.__r3f)!=null?h:{},p=Object.entries(r),m=[];if(f){const A=Object.keys(l);for(let x=0;x{var g;if((g=n.__r3f)!=null&&g.primitive&&A==="object"||Zt.equ(x,l[A]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(A))return m.push([A,x,!0,[]]);let _=[];A.includes("-")&&(_=A.split("-")),m.push([A,x,!1,_]);for(const S in r){const E=r[S];S.startsWith(`${A}-`)&&m.push([S,E,!1,S.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:m}}const C7=typeof process<"u"&&!1;function Vy(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:l,changes:f}=E7(e)?e:j3(n,e),h=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;pS[E],n),!(_&&_.set))){const[S,...E]=x.reverse();g=E.reverse().reduce((P,b)=>P[b],n),m=S}if(y===W3+"remove")if(g.constructor){let S=nC.get(g.constructor);S||(S=new g.constructor,nC.set(g.constructor,S)),y=S[m]}else y=0;if(A)y?s.handlers[m]=y:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(_&&_.set&&(_.copy||_ instanceof Xa)){if(Array.isArray(y))_.fromArray?_.fromArray(y):_.set(...y);else if(_.copy&&y&&y.constructor&&(C7?_.constructor.name===y.constructor.name:_.constructor===y.constructor))_.copy(y);else if(y!==void 0){const S=_ instanceof He;!S&&_.setScalar?_.setScalar(y):_ instanceof Xa&&y instanceof Xa?_.mask=y.mask:_.set(y),!B3()&&!a.linear&&S&&_.convertSRGBToLinear()}}else if(g[m]=y,g[m]instanceof yn&&g[m].format===Si&&g[m].type===us){const S=g[m];By(S)&&By(a.gl)?S.colorSpace=a.gl.outputColorSpace:S.encoding=a.gl.outputEncoding}nc(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&&Q_(n),n}function nc(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 Q_(n){n.onUpdate==null||n.onUpdate(n)}function P7(n,e){n.manual||(z3(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 Xp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function R7(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Ec.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ec.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ec.ContinuousEventPriority;default:return Ec.DefaultEventPriority}}function X3(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function L7(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)=>{X3(t.capturedMap,e,i,r)})}function I7(n){function e(l){const{internal:f}=n.getState(),h=l.offsetX-f.initialClick[0],d=l.offsetY-f.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(l){return l.filter(f=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=f.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(l,f){const h=n.getState(),d=new Set,p=[],m=f?f(h.internal.interaction):h.internal.interaction;for(let g=0;g{const S=Yu(g.object),E=Yu(_.object);return!S||!E?g.distance-_.distance:E.events.priority-S.events.priority||g.distance-_.distance}).filter(g=>{const _=Xp(g);return d.has(_)?!1:(d.add(_),!0)});h.events.filter&&(A=h.events.filter(A,h));for(const g of A){let _=g.object;for(;_;){var x;(x=_.__r3f)!=null&&x.eventCount&&p.push({...g,eventObject:_}),_=_.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let g of h.internal.capturedMap.get(l.pointerId).values())d.has(Xp(g.intersection))||p.push(g.intersection);return p}function r(l,f,h,d){const p=n.getState();if(l.length){const m={stopped:!1};for(const y of l){const A=Yu(y.object)||p,{raycaster:x,pointer:g,camera:_,internal:S}=A,E=new U(g.x,g.y,0).unproject(_),P=R=>{var F,K;return(F=(K=S.capturedMap.get(R))==null?void 0:K.has(y.eventObject))!=null?F:!1},b=R=>{const F={intersection:y,target:f.target};S.capturedMap.has(R)?S.capturedMap.get(R).set(y.eventObject,F):S.capturedMap.set(R,new Map([[y.eventObject,F]])),f.target.setPointerCapture(R)},L=R=>{const F=S.capturedMap.get(R);F&&X3(S.capturedMap,y.eventObject,F,R)};let N={};for(let R in f){let F=f[R];typeof F!="function"&&(N[R]=F)}let C={...y,...N,pointer:g,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:E,ray:x.ray,camera:_,stopPropagation(){const R="pointerId"in f&&S.capturedMap.get(f.pointerId);if((!R||R.has(y.eventObject))&&(C.stopped=m.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(F=>F.eventObject===y.eventObject))){const F=l.slice(0,l.indexOf(y));s([...F,y])}},target:{hasPointerCapture:P,setPointerCapture:b,releasePointerCapture:L},currentTarget:{hasPointerCapture:P,setPointerCapture:b,releasePointerCapture:L},nativeEvent:f};if(d(C),m.stopped===!0)break}}return l}function s(l){const{internal:f}=n.getState();for(const h of f.hovered.values())if(!l.length||!l.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f,m=p==null?void 0:p.handlers;if(f.hovered.delete(Xp(h)),p!=null&&p.eventCount){const y={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(y),m.onPointerLeave==null||m.onPointerLeave(y)}}}function o(l,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 m=l==="onPointerMove",y=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=i(h,m?t:void 0),g=y?e(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=x.map(S=>S.eventObject)),y&&!x.length&&g<=2&&(o(h,p.interaction),d&&d(h)),m&&s(x);function _(S){const E=S.eventObject,P=E.__r3f,b=P==null?void 0:P.handlers;if(P!=null&&P.eventCount)if(m){if(b.onPointerOver||b.onPointerEnter||b.onPointerOut||b.onPointerLeave){const L=Xp(S),N=p.hovered.get(L);N?N.stopped&&S.stopPropagation():(p.hovered.set(L,S),b.onPointerOver==null||b.onPointerOver(S),b.onPointerEnter==null||b.onPointerEnter(S))}b.onPointerMove==null||b.onPointerMove(S)}else{const L=b[l];L?(!y||p.initialHits.includes(E))&&(o(h,p.interaction.filter(N=>!p.initialHits.includes(N))),L(S)):y&&p.initialHits.includes(E)&&o(h,p.interaction.filter(N=>!p.initialHits.includes(N)))}}r(x,h,g,_)}}return{handlePointer:a}}const Y3=n=>!!(n!=null&&n.render),q3=V.createContext(null),N7=(n,e)=>{const t=N3((a,l)=>{const f=new U,h=new U,d=new U;function p(g=l().camera,_=h,S=l().size){const{width:E,height:P,top:b,left:L}=S,N=E/P;_ instanceof U?d.copy(_):d.set(..._);const C=g.getWorldPosition(f).distanceTo(d);if(z3(g))return{width:E/g.zoom,height:P/g.zoom,top:b,left:L,factor:1,distance:C,aspect:N};{const R=g.fov*Math.PI/180,F=2*Math.tan(R/2)*C,K=F*(E/P);return{width:K,height:F,top:b,left:L,factor:E/K,distance:C,aspect:N}}}let m;const y=g=>a(_=>({performance:{..._.performance,current:g}})),A=new me;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(l(),g),advance:(g,_)=>e(g,_,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new cA,pointer:A,mouse:A,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&y(g.performance.min),m=setTimeout(()=>y(l().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(_=>({..._,events:{..._.events,...g}})),setSize:(g,_,S,E,P)=>{const b=l().camera,L={width:g,height:_,top:E||0,left:P||0,updateStyle:S};a(N=>({size:L,viewport:{...N.viewport,...p(b,h,L)}}))},setDpr:g=>a(_=>{const S=G3(g);return{viewport:{..._.viewport,dpr:S,initialDpr:_.viewport.initialDpr||S}}}),setFrameloop:(g="always")=>{const _=l().clock;_.stop(),_.elapsedTime=0,g!=="never"&&(_.start(),_.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:V.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,_,S)=>{const E=l().internal;return E.priority=E.priority+(_>0?1:0),E.subscribers.push({ref:g,priority:_,store:S}),E.subscribers=E.subscribers.sort((P,b)=>P.priority-b.priority),()=>{const P=l().internal;P!=null&&P.subscribers&&(P.priority=P.priority-(_>0?1:0),P.subscribers=P.subscribers.filter(b=>b.ref!==g))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:f,gl:h,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||f.dpr!==s){var p;r=l,s=f.dpr,P7(a,l),h.setPixelRatio(f.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,m)}a!==o&&(o=a,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Yp,D7=new Set,U7=new Set,O7=new Set;function Hy(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function qu(n,e){switch(n){case"before":return Hy(D7,e);case"after":return Hy(U7,e);case"tail":return Hy(O7,e)}}let Wy,Gy;function jy(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),Wy=e.internal.subscribers,Yp=0;Yp0)&&!((f=r.gl.xr)!=null&&f.isPresenting)&&(t+=jy(l,r))}if(qu("after",l),t===0)return qu("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,f=1){var h;if(!l)return n.forEach(d=>o(d.store.getState()),f);(h=l.gl.xr)!=null&&h.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+f),e||(e=!0,requestAnimationFrame(s)))}function a(l,f=!0,h,d){if(f&&qu("before",l),h)jy(l,h,d);else for(const p of n.values())jy(l,p.store.getState());f&&qu("after",l)}return{loop:s,invalidate:o,advance:a}}function Z3(){const n=V.useContext(q3);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Zi(n=t=>t,e){return Z3()(n,e)}function pA(n,e=0){const t=Z3(),i=t.getState().internal.subscribe,r=V3(n);return Nh(()=>i(r,e,t),[e,i,t]),null}const sC=new WeakMap;function K3(n,e){return function(t,...i){let r=sC.get(t);return r||(r=new t,sC.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,T7(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`)))))).finally(()=>r.dispose==null?void 0:r.dispose())}}function Dh(n,e,t,i){const r=Array.isArray(e)?e:[e],s=y7(K3(t,i),[n,...r],{equal:Zt.equ});return Array.isArray(e)?s:s[0]}Dh.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return x7(K3(t),[n,...i])};Dh.clear=function(n,e){const t=Array.isArray(e)?e:[e];return _7([n,...t])};const Yc=new Map,{invalidate:oC,advance:aC}=F7(Yc),{reconciler:rg,applyProps:is}=A7(Yc,R7),ec={objects:"shallow",strict:!1},k7=(n,e)=>{const t=typeof n=="function"?n(e):n;return Y3(t)?t:new X1({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function B7(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 z7(n){const e=Yc.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||N7(oC,aC),o=t||rg.createContainer(s,Ec.ConcurrentRoot,null,!1,null,"",r,null);e||Yc.set(n,{fiber:o,store:s});let a,l=!1,f;return{configure(h={}){let{gl:d,size:p,scene:m,events:y,onCreated:A,shadows:x=!1,linear:g=!1,flat:_=!1,legacy:S=!1,orthographic:E=!1,frameloop:P="always",dpr:b=[1,2],performance:L,raycaster:N,camera:C,onPointerMissed:R}=h,F=s.getState(),K=F.gl;F.gl||F.set({gl:K=k7(d,n)});let le=F.raycaster;le||F.set({raycaster:le=new R3});const{params:H,...q}=N||{};if(Zt.equ(q,le,ec)||is(le,{...q}),Zt.equ(H,le.params,ec)||is(le,{params:{...le.params,...H}}),!F.camera||F.camera===f&&!Zt.equ(f,C,ec)){f=C;const ie=C instanceof Eh,$=ie?C:E?new Fr(0,0,0,0,.1,1e3):new nn(75,0,.1,1e3);ie||($.position.z=5,C&&is($,C),!F.camera&&!(C!=null&&C.rotation)&&$.lookAt(0,0,0)),F.set({camera:$}),le.camera=$}if(!F.scene){let ie;m instanceof ng?ie=m:(ie=new ng,m&&is(ie,m)),F.set({scene:tc(ie)})}if(!F.xr){var ee;const ie=(ve,be)=>{const Pe=s.getState();Pe.frameloop!=="never"&&aC(ve,!0,Pe,be)},$=()=>{const ve=s.getState();ve.gl.xr.enabled=ve.gl.xr.isPresenting,ve.gl.xr.setAnimationLoop(ve.gl.xr.isPresenting?ie:null),ve.gl.xr.isPresenting||oC(ve)},fe={connect(){const ve=s.getState().gl;ve.xr.addEventListener("sessionstart",$),ve.xr.addEventListener("sessionend",$)},disconnect(){const ve=s.getState().gl;ve.xr.removeEventListener("sessionstart",$),ve.xr.removeEventListener("sessionend",$)}};typeof((ee=K.xr)==null?void 0:ee.addEventListener)=="function"&&fe.connect(),F.set({xr:fe})}if(K.shadowMap){const ie=K.shadowMap.enabled,$=K.shadowMap.type;if(K.shadowMap.enabled=!!x,Zt.boo(x))K.shadowMap.type=gf;else if(Zt.str(x)){var oe;const fe={basic:wL,percentage:Dg,soft:gf,variance:Rr};K.shadowMap.type=(oe=fe[x])!=null?oe:gf}else Zt.obj(x)&&Object.assign(K.shadowMap,x);(ie!==K.shadowMap.enabled||$!==K.shadowMap.type)&&(K.shadowMap.needsUpdate=!0)}const k=B3();k&&("enabled"in k?k.enabled=!S:"legacyMode"in k&&(k.legacyMode=S)),is(K,{outputEncoding:g?3e3:3001,toneMapping:_?cs:M1}),F.legacy!==S&&F.set(()=>({legacy:S})),F.linear!==g&&F.set(()=>({linear:g})),F.flat!==_&&F.set(()=>({flat:_})),d&&!Zt.fun(d)&&!Y3(d)&&!Zt.equ(d,K,ec)&&is(K,d),y&&!F.events.handlers&&F.set({events:y(s)});const J=B7(n,p);return Zt.equ(J,F.size,ec)||F.setSize(J.width,J.height,J.updateStyle,J.top,J.left),b&&F.viewport.dpr!==G3(b)&&F.setDpr(b),F.frameloop!==P&&F.setFrameloop(P),F.onPointerMissed||F.set({onPointerMissed:R}),L&&!Zt.equ(L,F.performance,ec)&&F.set(ie=>({performance:{...ie.performance,...L}})),a=A,l=!0,this},render(h){return l||this.configure(),rg.updateContainer(V.createElement(V7,{store:s,children:h,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){J3(n)}}}function V7({store:n,children:e,onCreated:t,rootElement:i}){return Nh(()=>{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)},[]),V.createElement(q3.Provider,{value:n},e)}function J3(n,e){const t=Yc.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),rg.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;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(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),b7(r),Yc.delete(n),e&&e(n)}catch{}},500)})}}rg.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:V.version});function il(){return il=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(l,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(l,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}$_.debounce=$_;var H7=$_;const lC=tS(H7);function W7(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]=V.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=V.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=V.useRef(!1);V.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,m,y]=V.useMemo(()=>{const _=()=>{if(!l.current.element)return;const{left:S,top:E,width:P,height:b,bottom:L,right:N,x:C,y:R}=l.current.element.getBoundingClientRect(),F={left:S,top:E,width:P,height:b,bottom:L,right:N,x:C,y:R};l.current.element instanceof HTMLElement&&r&&(F.height=l.current.element.offsetHeight,F.width=l.current.element.offsetWidth),Object.freeze(F),d.current&&!Y7(l.current.lastBounds,F)&&a(l.current.lastBounds=F)};return[_,h?lC(_,h):_,f?lC(_,f):_]},[a,r,f,h]);function A(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",y,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function x(){l.current.element&&(l.current.resizeObserver=new s(y),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(_=>_.addEventListener("scroll",y,{capture:!0,passive:!0})))}const g=_=>{!_||_===l.current.element||(A(),l.current.element=_,l.current.scrollContainers=Q3(_),x())};return j7(y,!!t),G7(m),V.useEffect(()=>{A(),x()},[t,y,m]),V.useEffect(()=>A,[]),[g,o,p]}function G7(n){V.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function j7(n,e){V.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function Q3(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,...Q3(n.parentElement)]}const X7=["x","y","top","bottom","left","right","width","height"],Y7=(n,e)=>X7.every(t=>n[t]===e[t]);var q7=Object.defineProperty,Z7=Object.defineProperties,K7=Object.getOwnPropertyDescriptors,cC=Object.getOwnPropertySymbols,J7=Object.prototype.hasOwnProperty,Q7=Object.prototype.propertyIsEnumerable,uC=(n,e,t)=>e in n?q7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,fC=(n,e)=>{for(var t in e||(e={}))J7.call(e,t)&&uC(n,t,e[t]);if(cC)for(var t of cC(e))Q7.call(e,t)&&uC(n,t,e[t]);return n},$7=(n,e)=>Z7(n,K7(e));function $3(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=$3(i,e,t);if(r)return r;i=e?null:i.sibling}}function eN(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const mA=eN(V.createContext(null));class tN extends V.Component{render(){return V.createElement(mA.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:hC,ReactCurrentDispatcher:dC}=V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function eX(){const n=V.useContext(mA);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=V.useId();return V.useMemo(()=>{for(const i of[hC==null?void 0:hC.current,n,n==null?void 0:n.alternate]){if(!i)continue;const r=$3(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 tX(){var n,e;const t=eX(),[i]=V.useState(()=>new Map);i.clear();let r=t;for(;r;){const s=(n=r.type)==null?void 0:n._context;s&&s!==mA&&!i.has(s)&&i.set(s,(e=dC==null?void 0:dC.current)==null?void 0:e.readContext(eN(s))),r=r.return}return i}function nX(){const n=tX();return V.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>V.createElement(e,null,V.createElement(t.Provider,$7(fC({},i),{value:n.get(t)}))),e=>V.createElement(tN,fC({},e))),[n])}const Xy={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 iX(n){const{handlePointer:e}=I7(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(Xy).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[l,f]=Xy[o];t.addEventListener(l,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]=Xy[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const rX=V.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=iX,eventSource:a,eventPrefix:l,shadows:f,linear:h,flat:d,legacy:p,orthographic:m,frameloop:y,dpr:A,performance:x,raycaster:g,camera:_,scene:S,onPointerMissed:E,onCreated:P,...b},L){V.useMemo(()=>S7(f7),[]);const N=nX(),[C,R]=W7({scroll:!0,debounce:{scroll:50,resize:0},...i}),F=V.useRef(null),K=V.useRef(null);V.useImperativeHandle(L,()=>F.current);const le=V3(E),[H,q]=V.useState(!1),[ee,oe]=V.useState(!1);if(H)throw H;if(ee)throw ee;const k=V.useRef(null);Nh(()=>{const Y=F.current;R.width>0&&R.height>0&&Y&&(k.current||(k.current=z7(Y)),k.current.configure({gl:s,events:o,shadows:f,linear:h,flat:d,legacy:p,orthographic:m,frameloop:y,dpr:A,performance:x,raycaster:g,camera:_,scene:S,size:R,onPointerMissed:(...J)=>le.current==null?void 0:le.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(a?M7(a)?a.current:a:K.current),l&&J.setEvents({compute:(ie,$)=>{const fe=ie[l+"X"],ve=ie[l+"Y"];$.pointer.set(fe/$.size.width*2-1,-(ve/$.size.height)*2+1),$.raycaster.setFromCamera($.pointer,$.camera)}}),P==null||P(J)}}),k.current.render(V.createElement(N,null,V.createElement(H3,{set:oe},V.createElement(V.Suspense,{fallback:V.createElement(w7,{set:q})},e)))))}),V.useEffect(()=>{const Y=F.current;if(Y)return()=>J3(Y)},[]);const j=a?"none":"auto";return V.createElement("div",il({ref:K,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:j,...r}},b),V.createElement("div",{ref:C,style:{width:"100%",height:"100%"}},V.createElement("canvas",{ref:F,style:{display:"block"}},t)))}),sX=V.forwardRef(function(e,t){return V.createElement(tN,null,V.createElement(rX,il({},e,{ref:t})))}),Uh=new U,gA=new U,oX=new U;function aX(n,e,t){const i=Uh.setFromMatrixPosition(n.matrixWorld);i.project(e);const r=t.width/2,s=t.height/2;return[i.x*r+r,-(i.y*s)+s]}function lX(n,e){const t=Uh.setFromMatrixPosition(n.matrixWorld),i=gA.setFromMatrixPosition(e.matrixWorld),r=t.sub(i),s=e.getWorldDirection(oX);return r.angleTo(s)>Math.PI/2}function cX(n,e,t,i){const r=Uh.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),t.setFromCamera(s,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function nN(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=eS(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const hX=(n=>e=>nN(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),dX=(n=>(e,t)=>nN(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function pX(n){return n&&typeof n=="object"&&"current"in n}const mX=V.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:f=!1,transform:h=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:y,material:A,geometry:x,zIndexRange:g=[16777271,0],calculatePosition:_=aX,as:S="div",wrapperClass:E,pointerEvents:P="auto",...b},L)=>{const{gl:N,camera:C,scene:R,size:F,raycaster:K,events:le,viewport:H}=Zi(),[q]=V.useState(()=>document.createElement(S)),ee=V.useRef(),oe=V.useRef(null),k=V.useRef(0),j=V.useRef([0,0]),Y=V.useRef(null),J=V.useRef(null),ie=(a==null?void 0:a.current)||le.connected||N.domElement.parentNode,$=V.useRef(null),fe=V.useRef(!1),ve=V.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&pX(d[0]),[d]);V.useLayoutEffect(()=>{const Le=N.domElement;d&&d==="blending"?(Le.style.zIndex=`${Math.floor(g[0]/2)}`,Le.style.position="absolute",Le.style.pointerEvents="none"):(Le.style.zIndex=null,Le.style.position=null,Le.style.pointerEvents=null)},[d]),V.useLayoutEffect(()=>{if(oe.current){const Le=ee.current=LR(q);if(R.updateMatrixWorld(),h)q.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Te=_(oe.current,C,F);q.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Te[0]}px,${Te[1]}px,0);transform-origin:0 0;`}return ie&&(r?ie.prepend(q):ie.appendChild(q)),()=>{ie&&ie.removeChild(q),Le.unmount()}}},[ie,h]),V.useLayoutEffect(()=>{E&&(q.className=E)},[E]);const be=V.useMemo(()=>h?{position:"absolute",top:0,left:0,width:F.width,height:F.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-F.height/2,left:-F.width/2,width:F.width,height:F.height},...t},[t,s,o,F,h]),Pe=V.useMemo(()=>({position:"absolute",pointerEvents:P}),[P]);V.useLayoutEffect(()=>{if(fe.current=!1,h){var Le;(Le=ee.current)==null||Le.render(V.createElement("div",{ref:Y,style:be},V.createElement("div",{ref:J,style:Pe},V.createElement("div",{ref:L,className:i,style:t,children:n}))))}else{var Te;(Te=ee.current)==null||Te.render(V.createElement("div",{ref:L,style:be,className:i,children:n}))}});const Je=V.useRef(!0);pA(Le=>{if(oe.current){C.updateMatrixWorld(),oe.current.updateWorldMatrix(!0,!1);const Te=h?j.current:_(oe.current,C,F);if(h||Math.abs(k.current-C.zoom)>e||Math.abs(j.current[0]-Te[0])>e||Math.abs(j.current[1]-Te[1])>e){const W=lX(oe.current,C);let ye=!1;ve&&(Array.isArray(d)?ye=d.map(We=>We.current):d!=="blending"&&(ye=[R]));const de=Je.current;if(ye){const We=cX(oe.current,C,K,ye);Je.current=We&&!W}else Je.current=!W;de!==Je.current&&(p?p(!Je.current):q.style.display=Je.current?"block":"none");const we=Math.floor(g[0]/2),pe=d?ve?[g[0],we]:[we-1,0]:g;if(q.style.zIndex=`${fX(oe.current,C,pe)}`,h){const[We,De]=[F.width/2,F.height/2],D=C.projectionMatrix.elements[5]*De,{isOrthographicCamera:I,top:te,left:Se,bottom:_e,right:xe}=C,qe=hX(C.matrixWorldInverse),Ie=I?`scale(${D})translate(${eS(-(xe+Se)/2)}px,${eS((te+_e)/2)}px)`:`translateZ(${D}px)`;let Ue=oe.current.matrixWorld;f&&(Ue=C.matrixWorldInverse.clone().transpose().copyPosition(Ue).scale(oe.current.scale),Ue.elements[3]=Ue.elements[7]=Ue.elements[11]=0,Ue.elements[15]=1),q.style.width=F.width+"px",q.style.height=F.height+"px",q.style.perspective=I?"":`${D}px`,Y.current&&J.current&&(Y.current.style.transform=`${Ie}${qe}translate(${We}px,${De}px)`,J.current.style.transform=dX(Ue,1/((l||10)/400)))}else{const We=l===void 0?1:uX(oe.current,C)*l;q.style.transform=`translate3d(${Te[0]}px,${Te[1]}px,0) scale(${We})`}j.current=Te,k.current=C.zoom}}if(!ve&&$.current&&!fe.current)if(h){if(Y.current){const Te=Y.current.children[0];if(Te!=null&&Te.clientWidth&&Te!=null&&Te.clientHeight){const{isOrthographicCamera:W}=C;if(W||x)b.scale&&(Array.isArray(b.scale)?b.scale instanceof U?$.current.scale.copy(b.scale.clone().divideScalar(1)):$.current.scale.set(1/b.scale[0],1/b.scale[1],1/b.scale[2]):$.current.scale.setScalar(1/b.scale));else{const ye=(l||10)/400,de=Te.clientWidth*ye,we=Te.clientHeight*ye;$.current.scale.set(de,we,1)}fe.current=!0}}}else{const Te=q.children[0];if(Te!=null&&Te.clientWidth&&Te!=null&&Te.clientHeight){const W=1/H.factor,ye=Te.clientWidth*W,de=Te.clientHeight*W;$.current.scale.set(ye,de,1),fe.current=!0}$.current.lookAt(Le.camera.position)}});const nt=V.useMemo(()=>({vertexShader:h?void 0:` + /* + This shader is from the THREE's SpriteMaterial. + We need to turn the backing plane into a Sprite + (make it always face the camera) if "transfrom" + is false. + */ + #include + + void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + // This is somewhat arbitrary, but it seems to work well + // Need to figure out how to derive this dynamically if it even matters + float size = 0.03; + + 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 ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + 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; + } + `,fragmentShader:` + void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } + `}),[h]);return V.createElement("group",il({},b,{ref:oe}),d&&!ve&&V.createElement("mesh",{castShadow:m,receiveShadow:y,ref:$},x||V.createElement("planeGeometry",null),A||V.createElement("shaderMaterial",{side:Dr,vertexShader:nt.vertexShader,fragmentShader:nt.fragmentShader})))});let Zu=0;const gX=N3(n=>(wc.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-Zu)/(i-Zu)*100})},wc.onLoad=()=>{n({active:!1})},wc.onError=e=>n(t=>({errors:[...t.errors,e]})),wc.onProgress=(e,t,i)=>{t===i&&(Zu=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-Zu)/(i-Zu)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));function vX(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var yX=Object.defineProperty,xX=(n,e,t)=>e in n?yX(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ht=(n,e,t)=>(xX(n,typeof e!="symbol"?e+"":e,t),t);const qp=new ul,pC=new Rs,_X=Math.cos(70*(Math.PI/180)),mC=(n,e)=>(n%e+e)%e;let SX=class extends ps{constructor(e,t){super(),ht(this,"object"),ht(this,"domElement"),ht(this,"enabled",!0),ht(this,"target",new U),ht(this,"minDistance",0),ht(this,"maxDistance",1/0),ht(this,"minZoom",0),ht(this,"maxZoom",1/0),ht(this,"minPolarAngle",0),ht(this,"maxPolarAngle",Math.PI),ht(this,"minAzimuthAngle",-1/0),ht(this,"maxAzimuthAngle",1/0),ht(this,"enableDamping",!1),ht(this,"dampingFactor",.05),ht(this,"enableZoom",!0),ht(this,"zoomSpeed",1),ht(this,"enableRotate",!0),ht(this,"rotateSpeed",1),ht(this,"enablePan",!0),ht(this,"panSpeed",1),ht(this,"screenSpacePanning",!0),ht(this,"keyPanSpeed",7),ht(this,"zoomToCursor",!1),ht(this,"autoRotate",!1),ht(this,"autoRotateSpeed",2),ht(this,"reverseOrbit",!1),ht(this,"reverseHorizontalOrbit",!1),ht(this,"reverseVerticalOrbit",!1),ht(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ht(this,"mouseButtons",{LEFT:Ca.ROTATE,MIDDLE:Ca.DOLLY,RIGHT:Ca.PAN}),ht(this,"touches",{ONE:Pa.ROTATE,TWO:Pa.DOLLY_PAN}),ht(this,"target0"),ht(this,"position0"),ht(this,"zoom0"),ht(this,"_domElementKeyEvents",null),ht(this,"getPolarAngle"),ht(this,"getAzimuthalAngle"),ht(this,"setPolarAngle"),ht(this,"setAzimuthalAngle"),ht(this,"getDistance"),ht(this,"listenToKeyEvents"),ht(this,"stopListenToKeyEvents"),ht(this,"saveState"),ht(this,"reset"),ht(this,"update"),ht(this,"connect"),ht(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=mC(X,2*Math.PI),ze=h.phi;ze<0&&(ze+=2*Math.PI),ge<0&&(ge+=2*Math.PI);let ke=Math.abs(ge-ze);2*Math.PI-ke{let ge=mC(X,2*Math.PI),ze=h.theta;ze<0&&(ze+=2*Math.PI),ge<0&&(ge+=2*Math.PI);let ke=Math.abs(ge-ze);2*Math.PI-kei.object.position.distanceTo(i.target),this.listenToKeyEvents=X=>{X.addEventListener("keydown",it),this._domElementKeyEvents=X},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",it),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(),l=a.NONE},this.update=(()=>{const X=new U,ge=new U(0,1,0),ze=new hi().setFromUnitVectors(e.up,ge),ke=ze.clone().invert(),Me=new U,G=new hi,Re=2*Math.PI;return function(){const rt=i.object.position;ze.setFromUnitVectors(e.up,ge),ke.copy(ze).invert(),X.copy(rt).sub(i.target),X.applyQuaternion(ze),h.setFromVector3(X),i.autoRotate&&l===a.NONE&&H(K()),i.enableDamping?(h.theta+=d.theta*i.dampingFactor,h.phi+=d.phi*i.dampingFactor):(h.theta+=d.theta,h.phi+=d.phi);let Ke=i.minAzimuthAngle,bt=i.maxAzimuthAngle;isFinite(Ke)&&isFinite(bt)&&(Ke<-Math.PI?Ke+=Re:Ke>Math.PI&&(Ke-=Re),bt<-Math.PI?bt+=Re:bt>Math.PI&&(bt-=Re),Ke<=bt?h.theta=Math.max(Ke,Math.min(bt,h.theta)):h.theta=h.theta>(Ke+bt)/2?Math.max(Ke,h.theta):Math.min(bt,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),i.zoomToCursor&&C||i.object.isOrthographicCamera?h.radius=ie(h.radius):h.radius=ie(h.radius*p),X.setFromSpherical(h),X.applyQuaternion(ke),rt.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,m.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),m.set(0,0,0));let Rt=!1;if(i.zoomToCursor&&C){let Ht=null;if(i.object instanceof nn&&i.object.isPerspectiveCamera){const Qt=X.length();Ht=ie(Qt*p);const Lt=Qt-Ht;i.object.position.addScaledVector(L,Lt),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const Qt=new U(N.x,N.y,0);Qt.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 U(N.x,N.y,0);Lt.unproject(i.object),i.object.position.sub(Lt).add(Qt),i.object.updateMatrixWorld(),Ht=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Ht!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Ht).add(i.object.position):(qp.origin.copy(i.object.position),qp.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(qp.direction))<_X?e.lookAt(i.target):(pC.setFromNormalAndCoplanarPoint(i.object.up,i.target),qp.intersectPlane(pC,i.target))))}else i.object instanceof Fr&&i.object.isOrthographicCamera&&(Rt=p!==1,Rt&&(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix()));return p=1,C=!1,Rt||Me.distanceToSquared(i.object.position)>f||8*(1-G.dot(i.object.quaternion))>f?(i.dispatchEvent(r),Me.copy(i.object.position),G.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",te),i.domElement.addEventListener("pointercancel",xe),i.domElement.addEventListener("wheel",Ue)},this.dispose=()=>{var X,ge,ze,ke,Me,G;(X=i.domElement)==null||X.removeEventListener("contextmenu",Ct),(ge=i.domElement)==null||ge.removeEventListener("pointerdown",te),(ze=i.domElement)==null||ze.removeEventListener("pointercancel",xe),(ke=i.domElement)==null||ke.removeEventListener("wheel",Ue),(Me=i.domElement)==null||Me.ownerDocument.removeEventListener("pointermove",Se),(G=i.domElement)==null||G.ownerDocument.removeEventListener("pointerup",_e),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",it)};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 l=a.NONE;const f=1e-6,h=new Z_,d=new Z_;let p=1;const m=new U,y=new me,A=new me,x=new me,g=new me,_=new me,S=new me,E=new me,P=new me,b=new me,L=new U,N=new me;let C=!1;const R=[],F={};function K(){return 2*Math.PI/60/60*i.autoRotateSpeed}function le(){return Math.pow(.95,i.zoomSpeed)}function H(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 ee=(()=>{const X=new U;return function(ze,ke){X.setFromMatrixColumn(ke,0),X.multiplyScalar(-ze),m.add(X)}})(),oe=(()=>{const X=new U;return function(ze,ke){i.screenSpacePanning===!0?X.setFromMatrixColumn(ke,1):(X.setFromMatrixColumn(ke,0),X.crossVectors(i.object.up,X)),X.multiplyScalar(ze),m.add(X)}})(),k=(()=>{const X=new U;return function(ze,ke){const Me=i.domElement;if(Me&&i.object instanceof nn&&i.object.isPerspectiveCamera){const G=i.object.position;X.copy(G).sub(i.target);let Re=X.length();Re*=Math.tan(i.object.fov/2*Math.PI/180),ee(2*ze*Re/Me.clientHeight,i.object.matrix),oe(2*ke*Re/Me.clientHeight,i.object.matrix)}else Me&&i.object instanceof Fr&&i.object.isOrthographicCamera?(ee(ze*(i.object.right-i.object.left)/i.object.zoom/Me.clientWidth,i.object.matrix),oe(ke*(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 j(X){i.object instanceof nn&&i.object.isPerspectiveCamera||i.object instanceof Fr&&i.object.isOrthographicCamera?p/=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function Y(X){i.object instanceof nn&&i.object.isPerspectiveCamera||i.object instanceof Fr&&i.object.isOrthographicCamera?p*=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function J(X){if(!i.zoomToCursor||!i.domElement)return;C=!0;const ge=i.domElement.getBoundingClientRect(),ze=X.clientX-ge.left,ke=X.clientY-ge.top,Me=ge.width,G=ge.height;N.x=ze/Me*2-1,N.y=-(ke/G)*2+1,L.set(N.x,N.y,1).unproject(i.object).sub(i.object.position).normalize()}function ie(X){return Math.max(i.minDistance,Math.min(i.maxDistance,X))}function $(X){y.set(X.clientX,X.clientY)}function fe(X){J(X),E.set(X.clientX,X.clientY)}function ve(X){g.set(X.clientX,X.clientY)}function be(X){A.set(X.clientX,X.clientY),x.subVectors(A,y).multiplyScalar(i.rotateSpeed);const ge=i.domElement;ge&&(H(2*Math.PI*x.x/ge.clientHeight),q(2*Math.PI*x.y/ge.clientHeight)),y.copy(A),i.update()}function Pe(X){P.set(X.clientX,X.clientY),b.subVectors(P,E),b.y>0?j(le()):b.y<0&&Y(le()),E.copy(P),i.update()}function Je(X){_.set(X.clientX,X.clientY),S.subVectors(_,g).multiplyScalar(i.panSpeed),k(S.x,S.y),g.copy(_),i.update()}function nt(X){J(X),X.deltaY<0?Y(le()):X.deltaY>0&&j(le()),i.update()}function Le(X){let ge=!1;switch(X.code){case i.keys.UP:k(0,i.keyPanSpeed),ge=!0;break;case i.keys.BOTTOM:k(0,-i.keyPanSpeed),ge=!0;break;case i.keys.LEFT:k(i.keyPanSpeed,0),ge=!0;break;case i.keys.RIGHT:k(-i.keyPanSpeed,0),ge=!0;break}ge&&(X.preventDefault(),i.update())}function Te(){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 W(){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 ye(){const X=R[0].pageX-R[1].pageX,ge=R[0].pageY-R[1].pageY,ze=Math.sqrt(X*X+ge*ge);E.set(0,ze)}function de(){i.enableZoom&&ye(),i.enablePan&&W()}function we(){i.enableZoom&&ye(),i.enableRotate&&Te()}function pe(X){if(R.length==1)A.set(X.pageX,X.pageY);else{const ze=Ge(X),ke=.5*(X.pageX+ze.x),Me=.5*(X.pageY+ze.y);A.set(ke,Me)}x.subVectors(A,y).multiplyScalar(i.rotateSpeed);const ge=i.domElement;ge&&(H(2*Math.PI*x.x/ge.clientHeight),q(2*Math.PI*x.y/ge.clientHeight)),y.copy(A)}function We(X){if(R.length==1)_.set(X.pageX,X.pageY);else{const ge=Ge(X),ze=.5*(X.pageX+ge.x),ke=.5*(X.pageY+ge.y);_.set(ze,ke)}S.subVectors(_,g).multiplyScalar(i.panSpeed),k(S.x,S.y),g.copy(_)}function De(X){const ge=Ge(X),ze=X.pageX-ge.x,ke=X.pageY-ge.y,Me=Math.sqrt(ze*ze+ke*ke);P.set(0,Me),b.set(0,Math.pow(P.y/E.y,i.zoomSpeed)),j(b.y),E.copy(P)}function D(X){i.enableZoom&&De(X),i.enablePan&&We(X)}function I(X){i.enableZoom&&De(X),i.enableRotate&&pe(X)}function te(X){var ge,ze;i.enabled!==!1&&(R.length===0&&((ge=i.domElement)==null||ge.ownerDocument.addEventListener("pointermove",Se),(ze=i.domElement)==null||ze.ownerDocument.addEventListener("pointerup",_e)),_t(X),X.pointerType==="touch"?pt(X):qe(X))}function Se(X){i.enabled!==!1&&(X.pointerType==="touch"?Ae(X):Ie(X))}function _e(X){var ge,ze,ke;ft(X),R.length===0&&((ge=i.domElement)==null||ge.releasePointerCapture(X.pointerId),(ze=i.domElement)==null||ze.ownerDocument.removeEventListener("pointermove",Se),(ke=i.domElement)==null||ke.ownerDocument.removeEventListener("pointerup",_e)),i.dispatchEvent(o),l=a.NONE}function xe(X){ft(X)}function qe(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 Ca.DOLLY:if(i.enableZoom===!1)return;fe(X),l=a.DOLLY;break;case Ca.ROTATE:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enablePan===!1)return;ve(X),l=a.PAN}else{if(i.enableRotate===!1)return;$(X),l=a.ROTATE}break;case Ca.PAN:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enableRotate===!1)return;$(X),l=a.ROTATE}else{if(i.enablePan===!1)return;ve(X),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ie(X){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;be(X);break;case a.DOLLY:if(i.enableZoom===!1)return;Pe(X);break;case a.PAN:if(i.enablePan===!1)return;Je(X);break}}function Ue(X){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(X.preventDefault(),i.dispatchEvent(s),nt(X),i.dispatchEvent(o))}function it(X){i.enabled===!1||i.enablePan===!1||Le(X)}function pt(X){switch(tt(X),R.length){case 1:switch(i.touches.ONE){case Pa.ROTATE:if(i.enableRotate===!1)return;Te(),l=a.TOUCH_ROTATE;break;case Pa.PAN:if(i.enablePan===!1)return;W(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case Pa.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;de(),l=a.TOUCH_DOLLY_PAN;break;case Pa.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;we(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ae(X){switch(tt(X),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;pe(X),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;We(X),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;D(X),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;I(X),i.update();break;default:l=a.NONE}}function Ct(X){i.enabled!==!1&&X.preventDefault()}function _t(X){R.push(X)}function ft(X){delete F[X.pointerId];for(let ge=0;ge0,P=le>0,b=H>0,L=(E?1:0)+(P?1:0)+(b?1:0),L){case 0:{g.push(A[S]),g.push(A[S+1]),g.push(A[S+2]);break}case 1:{if(E&&(N=A[S+1],C=A[S+2],R=y(A[S],N,x,_),F=y(A[S],C,x,_)),P){N=A[S],C=A[S+2],R=y(A[S+1],N,x,_),F=y(A[S+1],C,x,_),g.push(R),g.push(C.clone()),g.push(N.clone()),g.push(C.clone()),g.push(R.clone()),g.push(F);break}b&&(N=A[S],C=A[S+1],R=y(A[S+2],N,x,_),F=y(A[S+2],C,x,_)),g.push(N.clone()),g.push(C.clone()),g.push(R),g.push(F),g.push(R.clone()),g.push(C.clone());break}case 2:{E||(N=A[S].clone(),C=y(N,A[S+1],x,_),R=y(N,A[S+2],x,_),g.push(N),g.push(C),g.push(R)),P||(N=A[S+1].clone(),C=y(N,A[S+2],x,_),R=y(N,A[S],x,_),g.push(N),g.push(C),g.push(R)),b||(N=A[S+2].clone(),C=y(N,A[S],x,_),R=y(N,A[S+1],x,_),g.push(N),g.push(C),g.push(R));break}}}return g}function y(A,x,g,_){const S=A.position.dot(g)-_,E=x.position.dot(g)-_,P=S/(S-E);return new gC(new U(A.position.x+P*(x.position.x-A.position.x),A.position.y+P*(x.position.y-A.position.y),A.position.z+P*(x.position.z-A.position.z)),new U(A.normal.x+P*(x.normal.x-A.normal.x),A.normal.y+P*(x.normal.y-A.normal.y),A.normal.z+P*(x.normal.z-A.normal.z)))}}}class gC{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}const vC=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function vA(n,e){const t=Zi(r=>r.gl),i=Dh(o0,vC(n)?Object.values(n):n);if(V.useLayoutEffect(()=>{e==null||e(i)},[e]),V.useEffect(()=>{"initTexture"in t&&(Array.isArray(i)?i:[i]).forEach(t.initTexture)},[t,i]),vC(n)){const r={};let s=0;for(const o in n)r[o]=i[s++];return r}else return i}vA.preload=n=>Dh.preload(o0,n);vA.clear=n=>Dh.clear(o0,n);function MX(n){return Array.isArray(n)}function Yy(n=[0,0,0]){return MX(n)?n:n instanceof U||n instanceof fl?[n.x,n.y,n.z]:[n,n,n]}const wX=V.forwardRef(function({debug:e,depthTest:t=!1,polygonOffsetFactor:i=-10,map:r,mesh:s,children:o,position:a,rotation:l,scale:f,...h},d){const p=V.useRef(null);V.useImperativeHandle(d,()=>p.current);const m=V.useRef(null);return V.useLayoutEffect(()=>{const y=(s==null?void 0:s.current)||p.current.parent,A=p.current;if(!(y instanceof Rn))throw new Error('Decal must have a Mesh as parent or specify its "mesh" prop');const x={position:new U,rotation:new fl,scale:new U(1,1,1)};if(y){is(x,{position:a,scale:f});const g=y.matrixWorld.clone();if(y.matrixWorld.identity(),!l||typeof l=="number"){const _=new Dt;_.position.copy(x.position),_.lookAt(y.position),typeof l=="number"&&_.rotateZ(l),is(x,{rotation:_.rotation})}else is(x,{rotation:l});return A.geometry=new AX(y,x.position,x.rotation,x.scale),m.current&&(is(m.current,x),m.current.traverse(_=>_.raycast=()=>null)),y.matrixWorld=g,()=>{A.geometry.dispose()}}},[s,...Yy(a),...Yy(f),...Yy(l)]),V.createElement("mesh",il({ref:p,"material-transparent":!0,"material-polygonOffset":!0,"material-polygonOffsetFactor":i,"material-depthTest":t,"material-map":r},h),o,e&&V.createElement("mesh",{ref:m},V.createElement("boxGeometry",null),V.createElement("meshNormalMaterial",{wireframe:!0}),V.createElement("axesHelper",null)))}),EX=V.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...f},h)=>{const d=Zi(b=>b.invalidate),p=Zi(b=>b.camera),m=Zi(b=>b.gl),y=Zi(b=>b.events),A=Zi(b=>b.setEvents),x=Zi(b=>b.set),g=Zi(b=>b.get),_=Zi(b=>b.performance),S=e||p,E=i||y.connected||m.domElement,P=V.useMemo(()=>new SX(S),[S]);return pA(()=>{P.enabled&&P.update()},-1),V.useEffect(()=>(s&&P.connect(s===!0?E:s),P.connect(E),()=>void P.dispose()),[s,E,t,P,d]),V.useEffect(()=>{const b=C=>{d(),t&&_.regress(),o&&o(C)},L=C=>{a&&a(C)},N=C=>{l&&l(C)};return P.addEventListener("change",b),P.addEventListener("start",L),P.addEventListener("end",N),()=>{P.removeEventListener("start",L),P.removeEventListener("end",N),P.removeEventListener("change",b)}},[o,a,l,P,d,A]),V.useEffect(()=>{if(n){const b=g().controls;return x({controls:P}),()=>x({controls:b})}},[n,P]),V.createElement("primitive",il({ref:h,object:P,enableDamping:r},f))}),TX=V.forwardRef(({children:n,enabled:e=!0,speed:t=1,rotationIntensity:i=1,floatIntensity:r=1,floatingRange:s=[-.1,.1],...o},a)=>{const l=V.useRef(null),f=V.useRef(Math.random()*1e4);return pA(h=>{var d,p;if(!e||t===0)return;const m=f.current+h.clock.getElapsedTime();l.current.rotation.x=Math.cos(m/4*t)/8*i,l.current.rotation.y=Math.sin(m/4*t)/8*i,l.current.rotation.z=Math.sin(m/4*t)/20*i;let y=Math.sin(m/4*t)/10;y=MI.mapLinear(y,-.1,.1,(d=s==null?void 0:s[0])!==null&&d!==void 0?d:-.1,(p=s==null?void 0:s[1])!==null&&p!==void 0?p:.1),l.current.position.y=y*r,l.current.updateMatrix()}),V.createElement("group",o,V.createElement("group",{ref:vX([l,a]),matrixAutoUpdate:!1},n))});function bX({all:n,scene:e,camera:t}){const i=Zi(({gl:o})=>o),r=Zi(({camera:o})=>o),s=Zi(({scene:o})=>o);return V.useLayoutEffect(()=>{const o=[];n&&(e||s).traverse(f=>{f.visible===!1&&(o.push(f),f.visible=!0)}),i.compile(e||s,t||r);const a=new V1(128);new z1(.01,1e5,a).update(i,e||s),a.dispose(),o.forEach(f=>f.visible=!1)},[]),null}const CX=()=>{const{progress:n}=gX();return z.jsxs(mX,{as:"div",center:!0,style:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[z.jsx("span",{className:"canvas-loader"}),z.jsxs("p",{style:{fontSize:14,color:"#F1F1F1",fontWeight:800,marginTop:40},children:[n.toFixed(2),"%"]})]})},PX=n=>{const[e]=vA([n.imgUrl]);return z.jsxs(TX,{speed:1.5,rotationIntensity:1,floatIntensity:1,children:[z.jsx("ambientLight",{intensity:.25}),z.jsx("directionalLight",{position:[0,0,.05]}),z.jsxs("mesh",{castShadow:!0,receiveShadow:!0,scale:2.75,children:[z.jsx("icosahedronGeometry",{args:[1,1]}),z.jsx("meshStandardMaterial",{color:"#fcd4d4",polygonOffset:!0,polygonOffsetFactor:-5,flatShading:!0}),z.jsx(wX,{position:[0,0,1],rotation:[2*Math.PI,0,6.25],scale:1,map:e,flatShading:!0})]})]})},RX=({icon:n})=>z.jsxs(sX,{frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},children:[z.jsxs(V.Suspense,{fallback:z.jsx(CX,{}),children:[z.jsx(EX,{enableZoom:!1}),z.jsx(PX,{imgUrl:n})]}),z.jsx(bX,{all:!0})]}),LX="/portfolio-react-threejs/assets/texture-5adaf7bf.webp",IX=()=>z.jsxs("div",{className:"xl:mt-6 flex flex-row flex-wrap justify-center items-center gap-10",children:[z.jsxs(un.div,{variants:ls(),children:[z.jsx("h2",{className:`${Xt.sectionHeadText} text-center`,children:"Skills & Technologies."}),z.jsx("p",{className:`${Xt.sectionSubText} text-center`,children:"What have i learnd?"})]}),z.jsx("div",{className:"lg:w-[400px] lg:h-[400px]",children:z.jsx(RX,{icon:LX})},"skillsBall")]}),NX=Js(IX,"skills"),DX=()=>z.jsx("div",{className:"h-screen flex justify-center items-center",children:z.jsx("img",{src:Qc,className:"w-[150px] h-[117px] "})});function UX(){return z.jsx(V.Suspense,{fallback:DX(),children:z.jsxs("div",{className:"bg-white",children:[z.jsx(Ks,{}),z.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:z.jsx(NX,{})})]})})}const OX=()=>z.jsx("div",{className:"h-screen flex justify-center items-center",children:z.jsx("img",{src:Qc,className:"w-[150px] h-[117px] "})});function FX(){return z.jsx(V.Suspense,{fallback:OX(),children:z.jsxs("div",{className:"bg-white",children:[z.jsx(Ks,{}),z.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:z.jsx(xL,{})})]})})}const kX=()=>z.jsx("div",{className:"h-screen flex justify-center items-center",children:z.jsx("img",{src:Qc,className:"w-[150px] h-[117px] "})});function BX(){return z.jsx(V.Suspense,{fallback:kX(),children:z.jsxs("div",{className:"bg-white",children:[z.jsx(Ks,{}),z.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:z.jsxs("div",{className:"h-screen ",children:[z.jsx("h1",{className:`${Xt.sectionHeadText} text-center`,children:"No Page Found"}),z.jsx("p",{className:`${Xt.heroSubText} mt-2 text-black-100 text-center`,children:"Try after something, it might showup 😊."})]})})]})})}const zX=()=>z.jsx("div",{className:"h-screen flex justify-center items-center",children:z.jsx("img",{src:Qc,className:"w-[150px] h-[117px] "})});function VX(){return z.jsx(V.Suspense,{fallback:zX(),children:z.jsx(vF,{basename:"/portfolio-react-threejs",children:z.jsxs(fF,{children:[z.jsx(es,{index:!0,element:z.jsx(KV,{})}),z.jsx(es,{path:"/certificate",element:z.jsx($V,{})}),z.jsx(es,{path:"/resume",element:z.jsx(i5,{})}),z.jsx(es,{path:"/blogs",element:z.jsx(o5,{})}),z.jsx(es,{path:"/contact",element:z.jsx(p5,{})}),z.jsx(es,{path:"/projects",element:z.jsx(S5,{})}),z.jsx(es,{path:"/skills",element:z.jsx(UX,{})}),z.jsx(es,{path:"/freetools",element:z.jsx(FX,{})}),z.jsx(es,{path:"*",element:z.jsx(BX,{})})]})})})}qy.createRoot(document.getElementById("root")).render(z.jsx(dh.StrictMode,{children:z.jsx(VX,{})})); diff --git a/assets/index-533276be.css b/assets/index-533276be.css deleted file mode 100644 index 554ae83..0000000 --- a/assets/index-533276be.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap";.vertical-timeline *{-webkit-box-sizing:border-box;box-sizing:border-box}.vertical-timeline{width:95%;max-width:1170px;margin:0 auto;position:relative;padding:2em 0}.vertical-timeline:after{content:"";display:table;clear:both}.vertical-timeline:before{content:"";position:absolute;top:0;left:18px;height:100%;width:4px;background:var(--line-color)}.vertical-timeline.vertical-timeline--one-column-right:before{right:18px;left:unset}@media only screen and (min-width:1170px){.vertical-timeline.vertical-timeline--two-columns{width:90%}.vertical-timeline.vertical-timeline--two-columns:before{left:50%;margin-left:-2px}}.vertical-timeline-element{position:relative;margin:2em 0}.vertical-timeline-element>div{min-height:1px}.vertical-timeline-element:after{content:"";display:table;clear:both}.vertical-timeline-element:first-child{margin-top:0}.vertical-timeline-element:last-child{margin-bottom:0}@media only screen and (min-width:1170px){.vertical-timeline-element{margin:4em 0}.vertical-timeline-element:first-child{margin-top:0}.vertical-timeline-element:last-child{margin-bottom:0}}.vertical-timeline-element-icon{position:absolute;top:0;left:0;width:40px;height:40px;border-radius:50%;-webkit-box-shadow:0 0 0 4px #fff,inset 0 2px 0 rgba(0,0,0,.08),0 3px 0 4px rgba(0,0,0,.05);box-shadow:0 0 0 4px #fff,inset 0 2px #00000014,0 3px 0 4px #0000000d}.vertical-timeline--one-column-right .vertical-timeline-element-icon{right:0;left:unset}.vertical-timeline-element-icon svg{display:block;width:24px;height:24px;position:relative;left:50%;top:50%;margin-left:-12px;margin-top:-12px}@media only screen and (min-width:1170px){.vertical-timeline--two-columns .vertical-timeline-element-icon{width:60px;height:60px;left:50%;margin-left:-30px}}.vertical-timeline-element-icon{-webkit-transform:translateZ(0);-webkit-backface-visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-icon.is-hidden{visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-icon.bounce-in{visibility:visible;-webkit-animation:cd-bounce-1 .6s;animation:cd-bounce-1 .6s}@-webkit-keyframes cd-bounce-1{0%{opacity:0;-webkit-transform:scale(.5)}60%{opacity:1;-webkit-transform:scale(1.2)}to{-webkit-transform:scale(1)}}@keyframes cd-bounce-1{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}60%{opacity:1;-webkit-transform:scale(1.2);transform:scale(1.2)}to{-webkit-transform:scale(1);transform:scale(1)}}.vertical-timeline-element-content{position:relative;margin-left:60px;background:#fff;border-radius:.25em;padding:1em;-webkit-box-shadow:0 3px 0 #ddd;box-shadow:0 3px #ddd}.vertical-timeline--one-column-right .vertical-timeline-element-content{margin-right:60px;margin-left:unset}.vertical-timeline-element--no-children .vertical-timeline-element-content{background:0 0;-webkit-box-shadow:none;box-shadow:none}.vertical-timeline-element-content:after{content:"";display:table;clear:both}.vertical-timeline-element-content h2{color:#303e49}.vertical-timeline-element-content .vertical-timeline-element-date,.vertical-timeline-element-content p{font-size:13px;font-size:.8125rem;font-weight:500}.vertical-timeline-element-content .vertical-timeline-element-date{display:inline-block}.vertical-timeline-element-content p{margin:1em 0 0;line-height:1.6}.vertical-timeline-element-title,.vertical-timeline-element-subtitle{margin:0}.vertical-timeline-element-content .vertical-timeline-element-date{float:left;padding:.8em 0;opacity:.7}.vertical-timeline-element-content-arrow{content:"";position:absolute;top:16px;right:100%;height:0;width:0;border:7px solid transparent;border-right:7px solid #fff}.vertical-timeline--one-column-right .vertical-timeline-element-content-arrow{content:"";position:absolute;top:16px;right:unset;left:100%;height:0;width:0;border:7px solid transparent;border-left:7px solid #fff}.vertical-timeline--one-column-right .vertical-timeline-element-content:before{left:100%;border-left:7px solid #fff;border-right:unset}.vertical-timeline-element--no-children .vertical-timeline-element-content:before{display:none}.vertical-timeline-element--no-children .vertical-timeline-element-content-arrow{display:none}@media only screen and (min-width:768px){.vertical-timeline-element-content h2{font-size:20px;font-size:1.25rem}.vertical-timeline-element-content p{font-size:16px;font-size:1rem}.vertical-timeline-element-content .vertical-timeline-element-date{font-size:14px;font-size:.875rem}}@media only screen and (min-width:1170px){.vertical-timeline--two-columns .vertical-timeline-element-content{margin-left:0;padding:1.5em;width:44%}.vertical-timeline--two-columns .vertical-timeline-element-content-arrow{top:24px;left:100%;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.vertical-timeline--two-columns .vertical-timeline-element-content .vertical-timeline-element-date{position:absolute;width:100%;left:124%;top:6px;font-size:16px;font-size:1rem}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content{float:right}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content-arrow,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content-arrow{top:24px;left:auto;right:100%;-webkit-transform:rotate(0);transform:rotate(0)}.vertical-timeline--one-column-right .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content-arrow,.vertical-timeline--one-column-right .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content-arrow{top:24px;left:100%;right:auto;-webkit-transform:rotate(0);transform:rotate(0)}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content .vertical-timeline-element-date,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content .vertical-timeline-element-date{left:auto;right:124%;text-align:right}}.vertical-timeline--animate .vertical-timeline-element-content.is-hidden{visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-content.bounce-in{visibility:visible;-webkit-animation:cd-bounce-2 .6s;animation:cd-bounce-2 .6s}@media only screen and (min-width:1170px){.vertical-timeline--two-columns.vertical-timeline--animate .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content.bounce-in,.vertical-timeline--two-columns.vertical-timeline--animate .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content.bounce-in{-webkit-animation:cd-bounce-2-inverse .6s;animation:cd-bounce-2-inverse .6s}}@media only screen and (max-width:1169px){.vertical-timeline--animate .vertical-timeline-element-content.bounce-in{visibility:visible;-webkit-animation:cd-bounce-2-inverse .6s;animation:cd-bounce-2-inverse .6s}}@-webkit-keyframes cd-bounce-2{0%{opacity:0;-webkit-transform:translateX(-100px)}60%{opacity:1;-webkit-transform:translateX(20px)}to{-webkit-transform:translateX(0)}}@keyframes cd-bounce-2{0%{opacity:0;-webkit-transform:translateX(-100px);transform:translate(-100px)}60%{opacity:1;-webkit-transform:translateX(20px);transform:translate(20px)}to{-webkit-transform:translateX(0);transform:translate(0)}}@-webkit-keyframes cd-bounce-2-inverse{0%{opacity:0;-webkit-transform:translateX(100px)}60%{opacity:1;-webkit-transform:translateX(-20px)}to{-webkit-transform:translateX(0)}}@keyframes cd-bounce-2-inverse{0%{opacity:0;-webkit-transform:translateX(100px);transform:translate(100px)}60%{opacity:1;-webkit-transform:translateX(-20px);transform:translate(-20px)}to{-webkit-transform:translateX(0);transform:translate(0)}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{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,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}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-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-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}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-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-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: }.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-top-10{top:-2.5rem}.-top-12{top:-3rem}.bottom-32{bottom:8rem}.right-0{right:0}.right-40{right:10rem}.top-0{top:0}.top-20{top:5rem}.top-60{top:15rem}.top-\[120px\]{top:120px}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.-m-5{margin:-1.25rem}.m-3{margin:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.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-20{margin-top:5rem;margin-bottom:5rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.ml-5{margin-left:1.25rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-1\/2{height:50%}.h-10{height:2.5rem}.h-16{height:4rem}.h-3{height:.75rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-\[117px\]{height:117px}.h-\[230px\]{height:230px}.h-\[28px\]{height:28px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[64px\]{height:64px}.h-\[75\%\]{height:75%}.h-full{height:100%}.h-screen{height:100vh}.min-h-\[280px\]{min-height:280px}.w-1{width:.25rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-16{width:4rem}.w-3{width:.75rem}.w-5{width:1.25rem}.w-\[150px\]{width:150px}.w-\[28px\]{width:28px}.w-\[35px\]{width:35px}.w-\[70\%\]{width:70%}.w-\[75\%\]{width:75%}.w-\[90\%\]{width:90%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-\[140px\]{min-width:140px}.max-w-7xl{max-width:80rem}.max-w-full{max-width:100%}.max-w-screen-lg{max-width:1024px}.max-w-screen-xl{max-width:1280px}.flex-1{flex:1 1 0%}.flex-\[0\.75\]{flex:.75}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-evenly{justify-content:space-evenly}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-5{gap:1.25rem}.gap-8{gap:2rem}.space-x-5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2.5rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border-4{border-width:4px}.border-none{border-style:none}.border-\[\#373737\]{--tw-border-opacity: 1;border-color:rgb(55 55 55 / var(--tw-border-opacity))}.bg-\[\#373737\]{--tw-bg-opacity: 1;background-color:rgb(55 55 55 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(246 246 246 / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(55 55 55 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-60{--tw-bg-opacity: .6}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\[\#f6f6f6\]{--tw-gradient-from: #f6f6f6 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to: rgb(246 246 246 / 0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-primary{--tw-gradient-to: #f6f6f6 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position);--tw-gradient-to-position: }.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-12{padding-left:3rem;padding-right:3rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-10{padding-bottom:2.5rem}.pl-1{padding-left:.25rem}.text-center{text-align:center}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[24px\]{font-size:24px}.text-\[30px\]{font-size:30px}.text-\[40px\]{font-size:40px}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-\[30px\]{line-height:30px}.tracking-wider{letter-spacing:.05em}.text-\[\#373737\]{--tw-text-opacity: 1;color:rgb(55 55 55 / var(--tw-text-opacity))}.text-\[\#dfd9ff\]{--tw-text-opacity: 1;color:rgb(223 217 255 / var(--tw-text-opacity))}.text-\[\#fcd4d4\]{--tw-text-opacity: 1;color:rgb(252 212 212 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-black-100{--tw-text-opacity: 1;color:rgb(16 13 37 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-secondary{--tw-text-opacity: 1;color:rgb(55 55 55 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-white-100{--tw-text-opacity: 1;color:rgb(243 243 243 / var(--tw-text-opacity))}.underline-offset-8{text-underline-offset:8px}.opacity-0{opacity:0}.shadow-card{--tw-shadow: 0px 35px 120px -15px #211e35;--tw-shadow-colored: 0px 35px 120px -15px 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-\[\#fcd4d4\]{--tw-shadow-color: #fcd4d4;--tw-shadow: var(--tw-shadow-colored)}.shadow-primary{--tw-shadow-color: #f6f6f6;--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}*{margin:0;padding:0;box-sizing:border-box;font-family:Poppins,sans-serif;scroll-behavior:smooth}body{background:linear-gradient(180deg,#e6eaf5 0%,#f6f6f6 80%)}.hash-span{margin-top:-100px;padding-bottom:100px;display:block}.black-gradient{background:#000000;background:linear-gradient(to right,#434343,#000000)}.white-gradient{background:#ffffff;background:linear-gradient(to right,#e6eaf5,#f6f6f6)}.violet-gradient{background:#373737;background:linear-gradient(-90deg,#373737 0%,rgba(60,51,80,0) 100%);background:-webkit-linear-gradient(-90deg,#373737 0%,black 100%)}.green-pink-gradient{background:"#00cea8";background:linear-gradient(90.13deg,#00cea8 1.9%,#bf61ff 97.5%);background:-webkit-linear-gradient(-90.13deg,#00cea8 1.9%,#bf61ff 97.5%)}.orange-text-gradient{background:#f12711;background:linear-gradient(to top,#f12711,#f5af19);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.green-text-gradient{background:#11998e;background:linear-gradient(to top,#11998e,#38ef7d);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.blue-text-gradient{background:#56ccf2;background:linear-gradient(to top,#2f80ed,#56ccf2);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.pink-text-gradient{background:#ec008c;background:linear-gradient(to top,#ec008c,#fc6767);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.canvas-loader{font-size:10px;width:1em;height:1em;border-radius:50%;position:relative;text-indent:-9999em;animation:mulShdSpin 1.1s infinite ease;transform:translateZ(0)}@keyframes mulShdSpin{0%,to{box-shadow:0 -2.6em #fff,1.8em -1.8em #fff3,2.5em 0 #fff3,1.75em 1.75em #fff3,0 2.5em #fff3,-1.8em 1.8em #fff3,-2.6em 0 #ffffff80,-1.8em -1.8em #ffffffb3}12.5%{box-shadow:0 -2.6em #ffffffb3,1.8em -1.8em #fff,2.5em 0 #fff3,1.75em 1.75em #fff3,0 2.5em #fff3,-1.8em 1.8em #fff3,-2.6em 0 #fff3,-1.8em -1.8em #ffffff80}25%{box-shadow:0 -2.6em #ffffff80,1.8em -1.8em #ffffffb3,2.5em 0 #fff,1.75em 1.75em #fff3,0 2.5em #fff3,-1.8em 1.8em #fff3,-2.6em 0 #fff3,-1.8em -1.8em #fff3}37.5%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #ffffff80,2.5em 0 #ffffffb3,1.75em 1.75em #fff,0 2.5em #fff3,-1.8em 1.8em #fff3,-2.6em 0 #fff3,-1.8em -1.8em #fff3}50%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #fff3,2.5em 0 #ffffff80,1.75em 1.75em #ffffffb3,0 2.5em #fff,-1.8em 1.8em #fff3,-2.6em 0 #fff3,-1.8em -1.8em #fff3}62.5%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #fff3,2.5em 0 #fff3,1.75em 1.75em #ffffff80,0 2.5em #ffffffb3,-1.8em 1.8em #fff,-2.6em 0 #fff3,-1.8em -1.8em #fff3}75%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #fff3,2.5em 0 #fff3,1.75em 1.75em #fff3,0 2.5em #ffffff80,-1.8em 1.8em #ffffffb3,-2.6em 0 #fff,-1.8em -1.8em #fff3}87.5%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #fff3,2.5em 0 #fff3,1.75em 1.75em #fff3,0 2.5em #fff3,-1.8em 1.8em #ffffff80,-2.6em 0 #ffffffb3,-1.8em -1.8em #fff}}.funky-text-outline{text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff,2px 2px 0 #fff,-2px -2px 0 #fff,2px -2px 0 #fff,-2px 2px 0 #fff}.funky-text-outline-2{text-shadow:-3px -3px 0 #C0C0C0,3px -3px 0 #C0C0C0,-3px 3px 0 #C0C0C0,3px 3px 0 #C0C0C0}.placeholder\:text-white-100::-moz-placeholder{--tw-text-opacity: 1;color:rgb(243 243 243 / var(--tw-text-opacity))}.placeholder\:text-white-100::placeholder{--tw-text-opacity: 1;color:rgb(243 243 243 / var(--tw-text-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-green-800:hover{--tw-bg-opacity: 1;background-color:rgb(22 101 52 / var(--tw-bg-opacity))}.hover\:bg-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(55 55 55 / var(--tw-bg-opacity))}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity))}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.hover\:text-white-100:hover{--tw-text-opacity: 1;color:rgb(243 243 243 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover,.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 450px){.xs\:bottom-10{bottom:2.5rem}.xs\:w-\[250px\]{width:250px}.xs\:text-\[20px\]{font-size:20px}.xs\:text-\[40px\]{font-size:40px}.xs\:text-\[50px\]{font-size:50px}}@media (min-width: 640px){.sm\:right-5{right:1.25rem}.sm\:top-20{top:5rem}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-80{height:20rem}.sm\:w-\[360px\]{width:360px}.sm\:px-16{padding-left:4rem;padding-right:4rem}.sm\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\:text-\[18px\]{font-size:18px}.sm\:text-\[26px\]{font-size:26px}.sm\:text-\[50px\]{font-size:50px}.sm\:text-\[60px\]{font-size:60px}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:-right-10{right:-2.5rem}.md\:-right-20{right:-5rem}.md\:bottom-0{bottom:0}.md\:top-10{top:2.5rem}.md\:top-2{top:.5rem}.md\:-m-10{margin:-2.5rem}.md\:mb-0{margin-bottom:0}.md\:block{display:block}.md\:flex{display:flex}.md\:h-\[550px\]{height:550px}.md\:w-\[80\%\]{width:80%}.md\:max-w-3xl{max-width:48rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-col{flex-direction:column}.md\:items-center{align-items:center}.md\:justify-center{justify-content:center}.md\:gap-4{gap:1rem}.md\:space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.md\:text-\[60px\]{font-size:60px}}@media (min-width: 1024px){.lg\:top-\[100px\]{top:100px}.lg\:flex{display:flex}.lg\:h-\[400px\]{height:400px}.lg\:w-\[400px\]{width:400px}.lg\:w-\[70\%\]{width:70%}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:text-\[30px\]{font-size:30px}.lg\:text-\[80px\]{font-size:80px}.lg\:leading-\[40px\]{line-height:40px}.lg\:leading-\[98px\]{line-height:98px}}@media (min-width: 1280px){.xl\:mt-6{margin-top:1.5rem}.xl\:h-auto{height:auto}.xl\:flex-1{flex:1 1 0%}.xl\:flex-row{flex-direction:row}} diff --git a/assets/index-97471f9a.js b/assets/index-97471f9a.js deleted file mode 100644 index 33d8950..0000000 --- a/assets/index-97471f9a.js +++ /dev/null @@ -1,3568 +0,0 @@ -function nD(n,e){for(var t=0;ti[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(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 E_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function iD(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var FT={exports:{}},Ym={},BT={exports:{}},At={};/** - * @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 th=Symbol.for("react.element"),rD=Symbol.for("react.portal"),sD=Symbol.for("react.fragment"),oD=Symbol.for("react.strict_mode"),aD=Symbol.for("react.profiler"),lD=Symbol.for("react.provider"),uD=Symbol.for("react.context"),cD=Symbol.for("react.forward_ref"),fD=Symbol.for("react.suspense"),hD=Symbol.for("react.memo"),dD=Symbol.for("react.lazy"),xM=Symbol.iterator;function pD(n){return n===null||typeof n!="object"?null:(n=xM&&n[xM]||n["@@iterator"],typeof n=="function"?n:null)}var VT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},HT=Object.assign,WT={};function Uu(n,e,t){this.props=n,this.context=e,this.refs=WT,this.updater=t||VT}Uu.prototype.isReactComponent={};Uu.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")};Uu.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function GT(){}GT.prototype=Uu.prototype;function b_(n,e,t){this.props=n,this.context=e,this.refs=WT,this.updater=t||VT}var T_=b_.prototype=new GT;T_.constructor=b_;HT(T_,Uu.prototype);T_.isPureReactComponent=!0;var _M=Array.isArray,jT=Object.prototype.hasOwnProperty,C_={current:null},XT={key:!0,ref:!0,__self:!0,__source:!0};function YT(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)jT.call(e,i)&&!XT.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,$=D[te];if(0>>1;ter(Ee,B))we<$&&0>r(Q,Ee)?(D[te]=Q,D[we]=B,te=we):(D[te]=Ee,D[ue]=B,te=ue);else if(we<$&&0>r(Q,B))D[te]=Q,D[we]=B,te=we;else break e}}return V}function r(D,V){var B=D.sortIndex-V.sortIndex;return B!==0?B:D.id-V.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 l=[],f=[],h=1,d=null,p=3,v=!1,y=!1,_=!1,M=typeof setTimeout=="function"?setTimeout:null,m=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 w(D){for(var V=t(f);V!==null;){if(V.callback===null)i(f);else if(V.startTime<=D)i(f),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(f)}}function A(D){if(_=!1,w(D),!y)if(t(l)!==null)y=!0,se(b);else{var V=t(f);V!==null&&ae(A,V.startTime-D)}}function b(D,V){y=!1,_&&(_=!1,m(L),L=-1),v=!0;var B=p;try{for(w(V),d=t(l);d!==null&&(!(d.expirationTime>V)||D&&!W());){var te=d.callback;if(typeof te=="function"){d.callback=null,p=d.priorityLevel;var $=te(d.expirationTime<=V);V=n.unstable_now(),typeof $=="function"?d.callback=$:d===t(l)&&i(l),w(V)}else i(l);d=t(l)}if(d!==null)var ee=!0;else{var ue=t(f);ue!==null&&ae(A,ue.startTime-V),ee=!1}return ee}finally{d=null,p=B,v=!1}}var P=!1,I=null,L=-1,C=5,R=-1;function W(){return!(n.unstable_now()-RD||125te?(D.sortIndex=B,e(f,D),t(l)===null&&D===t(f)&&(_?(m(L),L=-1):_=!0,ae(A,B-te))):(D.sortIndex=$,e(l,D),y||v||(y=!0,se(b))),D},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(D){var V=p;return function(){var B=p;p=V;try{return D.apply(this,arguments)}finally{p=B}}}})(KT);JT.exports=KT;var ED=JT.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 QT=H,Xi=ED;function Ce(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"),_y=Object.prototype.hasOwnProperty,bD=/^[: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]*$/,wM={},MM={};function TD(n){return _y.call(MM,n)?!0:_y.call(wM,n)?!1:bD.test(n)?MM[n]=!0:(wM[n]=!0,!1)}function CD(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 PD(n,e,t,i){if(e===null||typeof e>"u"||CD(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 Xn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Xn[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];Xn[e]=new vi(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Xn[n]=new vi(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Xn[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){Xn[n]=new vi(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Xn[n]=new vi(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Xn[n]=new vi(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Xn[n]=new vi(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Xn[n]=new vi(n,5,!1,n.toLowerCase(),null,!1,!1)});var L_=/[\-:]([a-z])/g;function R_(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(L_,R_);Xn[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(L_,R_);Xn[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(L_,R_);Xn[e]=new vi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Xn[n]=new vi(n,1,!1,n.toLowerCase(),null,!1,!1)});Xn.xlinkHref=new vi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Xn[n]=new vi(n,1,!1,n.toLowerCase(),null,!0,!0)});function I_(n,e,t,i){var r=Xn.hasOwnProperty(e)?Xn[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var l=` -`+r[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{j0=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Vc(n):""}function LD(n){switch(n.tag){case 5:return Vc(n.type);case 16:return Vc("Lazy");case 13:return Vc("Suspense");case 19:return Vc("SuspenseList");case 0:case 2:case 15:return n=X0(n.type,!1),n;case 11:return n=X0(n.type.render,!1),n;case 1:return n=X0(n.type,!0),n;default:return""}}function Ay(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 Yl:return"Fragment";case Xl:return"Portal";case Sy:return"Profiler";case D_:return"StrictMode";case wy:return"Suspense";case My:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case tC:return(n.displayName||"Context")+".Consumer";case eC:return(n._context.displayName||"Context")+".Provider";case N_:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case k_:return e=n.displayName||null,e!==null?e:Ay(n.type)||"Memo";case fo:e=n._payload,n=n._init;try{return Ay(n(e))}catch{}}return null}function RD(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 Ay(e);case 8:return e===D_?"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 ko(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function iC(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function ID(n){var e=iC(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 Rd(n){n._valueTracker||(n._valueTracker=ID(n))}function rC(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=iC(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function am(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 Ey(n,e){var t=e.checked;return on({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function EM(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=ko(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 sC(n,e){e=e.checked,e!=null&&I_(n,"checked",e,!1)}function by(n,e){sC(n,e);var t=ko(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")?Ty(n,e.type,t):e.hasOwnProperty("defaultValue")&&Ty(n,e.type,ko(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function bM(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 Ty(n,e,t){(e!=="number"||am(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Hc=Array.isArray;function pu(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=Id.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function mf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var qc={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},DD=["Webkit","ms","Moz","O"];Object.keys(qc).forEach(function(n){DD.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),qc[e]=qc[n]})});function uC(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||qc.hasOwnProperty(n)&&qc[n]?(""+e).trim():e+"px"}function cC(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=uC(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var ND=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 Ly(n,e){if(e){if(ND[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ce(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ce(62))}}function Ry(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 Iy=null;function O_(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Dy=null,mu=null,gu=null;function PM(n){if(n=sh(n)){if(typeof Dy!="function")throw Error(Ce(280));var e=n.stateNode;e&&(e=Qm(e),Dy(n.stateNode,n.type,e))}}function fC(n){mu?gu?gu.push(n):gu=[n]:mu=n}function hC(){if(mu){var n=mu,e=gu;if(gu=mu=null,PM(n),e)for(n=0;n>>=0,n===0?32:31-(jD(n)/XD|0)|0}var Dd=64,Nd=4194304;function Wc(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 fm(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=Wc(a):(s&=o,s!==0&&(i=Wc(s)))}else o=t&~r,o!==0?i=Wc(o):s!==0&&(i=Wc(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 ih(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Ir(e),n[e]=t}function JD(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=Jc),zM=String.fromCharCode(32),FM=!1;function IC(n,e){switch(n){case"keyup":return AN.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function DC(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ql=!1;function bN(n,e){switch(n){case"compositionend":return DC(e);case"keypress":return e.which!==32?null:(FM=!0,zM);case"textInput":return n=e.data,n===zM&&FM?null:n;default:return null}}function TN(n,e){if(ql)return n==="compositionend"||!G_&&IC(n,e)?(n=LC(),Wp=V_=yo=null,ql=!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=WM(t)}}function UC(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?UC(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function zC(){for(var n=window,e=am();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=am(n.document)}return e}function j_(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 ON(n){var e=zC(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&UC(t.ownerDocument.documentElement,t)){if(i!==null&&j_(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=GM(t,s);var o=GM(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,Zl=null,Fy=null,Qc=null,By=!1;function jM(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;By||Zl==null||Zl!==am(i)||(i=Zl,"selectionStart"in i&&j_(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}),Qc&&Sf(Qc,i)||(Qc=i,i=pm(Fy,"onSelect"),0Ql||(n.current=Xy[Ql],Xy[Ql]=null,Ql--)}function Gt(n,e){Ql++,Xy[Ql]=n.current,n.current=e}var Oo={},oi=Go(Oo),Ci=Go(!1),Va=Oo;function Au(n,e){var t=n.type.contextTypes;if(!t)return Oo;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 Pi(n){return n=n.childContextTypes,n!=null}function gm(){Yt(Ci),Yt(oi)}function QM(n,e,t){if(oi.current!==Oo)throw Error(Ce(168));Gt(oi,e),Gt(Ci,t)}function YC(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(Ce(108,RD(n)||"Unknown",r));return on({},t,i)}function vm(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Oo,Va=oi.current,Gt(oi,n),Gt(Ci,Ci.current),!0}function $M(n,e,t){var i=n.stateNode;if(!i)throw Error(Ce(169));t?(n=YC(n,e,Va),i.__reactInternalMemoizedMergedChildContext=n,Yt(Ci),Yt(oi),Gt(oi,n)):Yt(Ci),Gt(Ci,t)}var As=null,$m=!1,ov=!1;function qC(n){As===null?As=[n]:As.push(n)}function qN(n){$m=!0,qC(n)}function jo(){if(!ov&&As!==null){ov=!0;var n=0,e=Nt;try{var t=As;for(Nt=1;n>=o,r-=o,Ts=1<<32-Ir(e)+r|t<L?(C=I,I=null):C=I.sibling;var R=p(m,I,w[L],A);if(R===null){I===null&&(I=C);break}n&&I&&R.alternate===null&&e(m,I),S=s(R,S,L),P===null?b=R:P.sibling=R,P=R,I=C}if(L===w.length)return t(m,I),Kt&&va(m,L),b;if(I===null){for(;LL?(C=I,I=null):C=I.sibling;var W=p(m,I,R.value,A);if(W===null){I===null&&(I=C);break}n&&I&&W.alternate===null&&e(m,I),S=s(W,S,L),P===null?b=W:P.sibling=W,P=W,I=C}if(R.done)return t(m,I),Kt&&va(m,L),b;if(I===null){for(;!R.done;L++,R=w.next())R=d(m,R.value,A),R!==null&&(S=s(R,S,L),P===null?b=R:P.sibling=R,P=R);return Kt&&va(m,L),b}for(I=i(m,I);!R.done;L++,R=w.next())R=v(I,m,L,R.value,A),R!==null&&(n&&R.alternate!==null&&I.delete(R.key===null?L:R.key),S=s(R,S,L),P===null?b=R:P.sibling=R,P=R);return n&&I.forEach(function(J){return e(m,J)}),Kt&&va(m,L),b}function M(m,S,w,A){if(typeof w=="object"&&w!==null&&w.type===Yl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ld:e:{for(var b=w.key,P=S;P!==null;){if(P.key===b){if(b=w.type,b===Yl){if(P.tag===7){t(m,P.sibling),S=r(P,w.props.children),S.return=m,m=S;break e}}else if(P.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===fo&&oA(b)===P.type){t(m,P.sibling),S=r(P,w.props),S.ref=Sc(m,P,w),S.return=m,m=S;break e}t(m,P);break}else e(m,P);P=P.sibling}w.type===Yl?(S=ka(w.props.children,m.mode,A,w.key),S.return=m,m=S):(A=Kp(w.type,w.key,w.props,null,m.mode,A),A.ref=Sc(m,S,w),A.return=m,m=A)}return o(m);case Xl:e:{for(P=w.key;S!==null;){if(S.key===P)if(S.tag===4&&S.stateNode.containerInfo===w.containerInfo&&S.stateNode.implementation===w.implementation){t(m,S.sibling),S=r(S,w.children||[]),S.return=m,m=S;break e}else{t(m,S);break}else e(m,S);S=S.sibling}S=pv(w,m.mode,A),S.return=m,m=S}return o(m);case fo:return P=w._init,M(m,S,P(w._payload),A)}if(Hc(w))return y(m,S,w,A);if(gc(w))return _(m,S,w,A);Vd(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,S!==null&&S.tag===6?(t(m,S.sibling),S=r(S,w),S.return=m,m=S):(t(m,S),S=dv(w,m.mode,A),S.return=m,m=S),o(m)):t(m,S)}return M}var bu=n2(!0),i2=n2(!1),oh={},$r=Go(oh),Ef=Go(oh),bf=Go(oh);function Ca(n){if(n===oh)throw Error(Ce(174));return n}function e1(n,e){switch(Gt(bf,e),Gt(Ef,n),Gt($r,oh),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Py(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=Py(e,n)}Yt($r),Gt($r,e)}function Tu(){Yt($r),Yt(Ef),Yt(bf)}function r2(n){Ca(bf.current);var e=Ca($r.current),t=Py(e,n.type);e!==t&&(Gt(Ef,n),Gt($r,t))}function t1(n){Ef.current===n&&(Yt($r),Yt(Ef))}var $t=Go(0);function Mm(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 av=[];function n1(){for(var n=0;nt?t:4,n(!0);var i=lv.transition;lv.transition={};try{n(!1),e()}finally{Nt=t,lv.transition=i}}function _2(){return pr().memoizedState}function QN(n,e,t){var i=Po(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},S2(n))w2(e,t);else if(t=QC(n,e,t,i),t!==null){var r=pi();Dr(t,n,i,r),M2(t,e,i)}}function $N(n,e,t){var i=Po(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(S2(n))w2(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,kr(a,o)){var l=e.interleaved;l===null?(r.next=r,Q_(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=QC(n,e,r,i),t!==null&&(r=pi(),Dr(t,n,i,r),M2(t,e,i))}}function S2(n){var e=n.alternate;return n===rn||e!==null&&e===rn}function w2(n,e){$c=Am=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function M2(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,z_(n,t)}}var Em={readContext:dr,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useInsertionEffect:$n,useLayoutEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useMutableSource:$n,useSyncExternalStore:$n,useId:$n,unstable_isNewReconciler:!1},ek={readContext:dr,useCallback:function(n,e){return Zr().memoizedState=[n,e===void 0?null:e],n},useContext:dr,useEffect:lA,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Yp(4194308,4,m2.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Yp(4194308,4,n,e)},useInsertionEffect:function(n,e){return Yp(4,2,n,e)},useMemo:function(n,e){var t=Zr();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Zr();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=QN.bind(null,rn,n),[i.memoizedState,n]},useRef:function(n){var e=Zr();return n={current:n},e.memoizedState=n},useState:aA,useDebugValue:a1,useDeferredValue:function(n){return Zr().memoizedState=n},useTransition:function(){var n=aA(!1),e=n[0];return n=KN.bind(null,n[1]),Zr().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=rn,r=Zr();if(Kt){if(t===void 0)throw Error(Ce(407));t=t()}else{if(t=e(),Bn===null)throw Error(Ce(349));Wa&30||a2(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,lA(u2.bind(null,i,s,n),[n]),i.flags|=2048,Pf(9,l2.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=Zr(),e=Bn.identifierPrefix;if(Kt){var t=Cs,i=Ts;t=(i&~(1<<32-Ir(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Tf++,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[Kr]=e,n[Af]=i,I2(n,e,!1,!1),e.stateNode=n;e:{switch(o=Ry(t,i),t){case"dialog":Xt("cancel",n),Xt("close",n),r=i;break;case"iframe":case"object":case"embed":Xt("load",n),r=i;break;case"video":case"audio":for(r=0;rPu&&(e.flags|=128,i=!0,wc(s,!1),e.lanes=4194304)}else{if(!i)if(n=Mm(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),wc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Kt)return ei(e),null}else 2*gn()-s.renderingStartTime>Pu&&t!==1073741824&&(e.flags|=128,i=!0,wc(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=gn(),e.sibling=null,t=$t.current,Gt($t,i?t&1|2:t&1),e):(ei(e),null);case 22:case 23:return d1(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Fi&1073741824&&(ei(e),e.subtreeFlags&6&&(e.flags|=8192)):ei(e),null;case 24:return null;case 25:return null}throw Error(Ce(156,e.tag))}function lk(n,e){switch(Y_(e),e.tag){case 1:return Pi(e.type)&&gm(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Tu(),Yt(Ci),Yt(oi),n1(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return t1(e),null;case 13:if(Yt($t),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ce(340));Eu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Yt($t),null;case 4:return Tu(),null;case 10:return K_(e.type._context),null;case 22:case 23:return d1(),null;case 24:return null;default:return null}}var Wd=!1,ii=!1,uk=typeof WeakSet=="function"?WeakSet:Set,Be=null;function nu(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){un(n,e,i)}else t.current=null}function rx(n,e,t){try{t()}catch(i){un(n,e,i)}}var vA=!1;function ck(n,e){if(Vy=hm,n=zC(),j_(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,l=-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||(l=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&&(l=o),(v=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=v}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(Hy={focusedElem:n,selectionRange:t},hm=!1,Be=e;Be!==null;)if(e=Be,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Be=n;else for(;Be!==null;){e=Be;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 _=y.memoizedProps,M=y.memoizedState,m=e.stateNode,S=m.getSnapshotBeforeUpdate(e.elementType===e.type?_:br(e.type,_),M);m.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(A){un(e,e.return,A)}if(n=e.sibling,n!==null){n.return=e.return,Be=n;break}Be=e.return}return y=vA,vA=!1,y}function ef(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&&rx(e,t,s)}r=r.next}while(r!==i)}}function ng(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 sx(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 k2(n){var e=n.alternate;e!==null&&(n.alternate=null,k2(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Kr],delete e[Af],delete e[jy],delete e[XN],delete e[YN])),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 O2(n){return n.tag===5||n.tag===3||n.tag===4}function yA(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||O2(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 ox(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=mm));else if(i!==4&&(n=n.child,n!==null))for(ox(n,e,t),n=n.sibling;n!==null;)ox(n,e,t),n=n.sibling}function ax(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(ax(n,e,t),n=n.sibling;n!==null;)ax(n,e,t),n=n.sibling}var Gn=null,Tr=!1;function no(n,e,t){for(t=t.child;t!==null;)U2(n,e,t),t=t.sibling}function U2(n,e,t){if(Qr&&typeof Qr.onCommitFiberUnmount=="function")try{Qr.onCommitFiberUnmount(qm,t)}catch{}switch(t.tag){case 5:ii||nu(t,e);case 6:var i=Gn,r=Tr;Gn=null,no(n,e,t),Gn=i,Tr=r,Gn!==null&&(Tr?(n=Gn,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Gn.removeChild(t.stateNode));break;case 18:Gn!==null&&(Tr?(n=Gn,t=t.stateNode,n.nodeType===8?sv(n.parentNode,t):n.nodeType===1&&sv(n,t),xf(n)):sv(Gn,t.stateNode));break;case 4:i=Gn,r=Tr,Gn=t.stateNode.containerInfo,Tr=!0,no(n,e,t),Gn=i,Tr=r;break;case 0:case 11:case 14:case 15:if(!ii&&(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)&&rx(t,e,o),r=r.next}while(r!==i)}no(n,e,t);break;case 1:if(!ii&&(nu(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){un(t,e,a)}no(n,e,t);break;case 21:no(n,e,t);break;case 22:t.mode&1?(ii=(i=ii)||t.memoizedState!==null,no(n,e,t),ii=i):no(n,e,t);break;default:no(n,e,t)}}function xA(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new uk),e.forEach(function(i){var r=xk.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function wr(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=gn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*hk(i/1960))-i,10n?16:n,xo===null)var i=!1;else{if(n=xo,xo=null,Cm=0,bt&6)throw Error(Ce(331));var r=bt;for(bt|=4,Be=n.current;Be!==null;){var s=Be,o=s.child;if(Be.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lgn()-f1?Na(n,0):c1|=t),Li(n,e)}function j2(n,e){e===0&&(n.mode&1?(e=Nd,Nd<<=1,!(Nd&130023424)&&(Nd=4194304)):e=1);var t=pi();n=Us(n,e),n!==null&&(ih(n,e,t),Li(n,t))}function yk(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),j2(n,t)}function xk(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(Ce(314))}i!==null&&i.delete(e),j2(n,t)}var X2;X2=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Ci.current)Ti=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Ti=!1,ok(n,e,t);Ti=!!(n.flags&131072)}else Ti=!1,Kt&&e.flags&1048576&&ZC(e,xm,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;qp(n,e),n=e.pendingProps;var r=Au(e,oi.current);yu(e,t),r=r1(null,e,i,n,r,t);var s=s1();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,Pi(i)?(s=!0,vm(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,$_(e),r.updater=eg,e.stateNode=r,r._reactInternals=e,Ky(e,i,n,t),e=ex(null,e,i,!0,s,t)):(e.tag=0,Kt&&s&&X_(e),di(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(qp(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=Sk(i),n=br(i,n),r){case 0:e=$y(null,e,i,n,t);break e;case 1:e=pA(null,e,i,n,t);break e;case 11:e=hA(null,e,i,n,t);break e;case 14:e=dA(null,e,i,br(i.type,n),t);break e}throw Error(Ce(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:br(i,r),$y(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:br(i,r),pA(n,e,i,r,t);case 3:e:{if(P2(e),n===null)throw Error(Ce(387));i=e.pendingProps,s=e.memoizedState,r=s.element,$C(n,e),wm(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=Cu(Error(Ce(423)),e),e=mA(n,e,i,t,r);break e}else if(i!==r){r=Cu(Error(Ce(424)),e),e=mA(n,e,i,t,r);break e}else for(Hi=bo(e.stateNode.containerInfo.firstChild),Gi=e,Kt=!0,Pr=null,t=i2(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Eu(),i===r){e=zs(n,e,t);break e}di(n,e,i,t)}e=e.child}return e;case 5:return r2(e),n===null&&qy(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,Wy(i,r)?o=null:s!==null&&Wy(i,s)&&(e.flags|=32),C2(n,e),di(n,e,o,t),e.child;case 6:return n===null&&qy(e),null;case 13:return L2(n,e,t);case 4:return e1(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=bu(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:br(i,r),hA(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,Gt(_m,i._currentValue),i._currentValue=o,s!==null)if(kr(s.value,o)){if(s.children===r.children&&!Ci.current){e=zs(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 l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Rs(-1,t&-t),l.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?l.next=l:(l.next=h.next,h.next=l),f.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),Zy(s.return,t,e),a.lanes|=t;break}l=l.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(Ce(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Zy(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,yu(e,t),r=dr(r),i=i(r),e.flags|=1,di(n,e,i,t),e.child;case 14:return i=e.type,r=br(i,e.pendingProps),r=br(i.type,r),dA(n,e,i,r,t);case 15:return b2(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:br(i,r),qp(n,e),e.tag=1,Pi(i)?(n=!0,vm(e)):n=!1,yu(e,t),t2(e,i,r),Ky(e,i,r,t),ex(null,e,i,!0,n,t);case 19:return R2(n,e,t);case 22:return T2(n,e,t)}throw Error(Ce(156,e.tag))};function Y2(n,e){return xC(n,e)}function _k(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 _k(n,e,t,i)}function m1(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Sk(n){if(typeof n=="function")return m1(n)?1:0;if(n!=null){if(n=n.$$typeof,n===N_)return 11;if(n===k_)return 14}return 2}function Lo(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 Kp(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")m1(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Yl:return ka(t.children,r,s,e);case D_:o=8,r|=8;break;case Sy:return n=fr(12,t,e,r|2),n.elementType=Sy,n.lanes=s,n;case wy:return n=fr(13,t,e,r),n.elementType=wy,n.lanes=s,n;case My:return n=fr(19,t,e,r),n.elementType=My,n.lanes=s,n;case nC:return rg(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case eC:o=10;break e;case tC:o=9;break e;case N_:o=11;break e;case k_:o=14;break e;case fo:o=16,i=null;break e}throw Error(Ce(130,n==null?n:typeof n,""))}return e=fr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function ka(n,e,t,i){return n=fr(7,n,i,e),n.lanes=t,n}function rg(n,e,t,i){return n=fr(22,n,i,e),n.elementType=nC,n.lanes=t,n.stateNode={isHidden:!1},n}function dv(n,e,t){return n=fr(6,n,null,e),n.lanes=t,n}function pv(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 wk(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=q0(0),this.expirationTimes=q0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=q0(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function g1(n,e,t,i,r,s,o,a,l){return n=new wk(n,e,t,a,l),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},$_(s),n}function Mk(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(K2)}catch(n){console.error(n)}}K2(),ZT.exports=qi;var Ck=ZT.exports,Q2,TA=Ck;Q2=xy.createRoot=TA.createRoot,xy.hydrateRoot=TA.hydrateRoot;/** - * @remix-run/router v1.5.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Rf(){return Rf=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function _1(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Lk(){return Math.random().toString(36).substr(2,8)}function PA(n,e){return{usr:n.state,key:n.key,idx:e}}function hx(n,e,t,i){return t===void 0&&(t=null),Rf({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Bu(e):e,{state:t,key:e&&e.key||i||Lk()})}function Rm(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Bu(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function Rk(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=_o.Pop,l=null,f=h();f==null&&(f=0,o.replaceState(Rf({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function d(){a=_o.Pop;let M=h(),m=M==null?null:M-f;f=M,l&&l({action:a,location:_.location,delta:m})}function p(M,m){a=_o.Push;let S=hx(_.location,M,m);t&&t(S,M),f=h()+1;let w=PA(S,f),A=_.createHref(S);try{o.pushState(w,"",A)}catch{r.location.assign(A)}s&&l&&l({action:a,location:_.location,delta:1})}function v(M,m){a=_o.Replace;let S=hx(_.location,M,m);t&&t(S,M),f=h();let w=PA(S,f),A=_.createHref(S);o.replaceState(w,"",A),s&&l&&l({action:a,location:_.location,delta:0})}function y(M){let m=r.location.origin!=="null"?r.location.origin:r.location.href,S=typeof M=="string"?M:Rm(M);return Pn(m,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,m)}let _={get action(){return a},get location(){return n(r,o)},listen(M){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(CA,d),l=M,()=>{r.removeEventListener(CA,d),l=null}},createHref(M){return e(r,M)},createURL:y,encodeLocation(M){let m=y(M);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:v,go(M){return o.go(M)}};return _}var LA;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(LA||(LA={}));function Ik(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?Bu(e):e,r=S1(i.pathname||"/",t);if(r==null)return null;let s=$2(n);Dk(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Pn(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let f=Ro([i,l.relativePath]),h=t.concat(l);s.children&&s.children.length>0&&(Pn(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),$2(s.children,e,h,f)),!(s.path==null&&!s.index)&&e.push({path:f,score:Bk(f,s.index),routesMeta:h})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))r(s,o);else for(let l of eP(s.path))r(s,o,l)}),e}function eP(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=eP(i.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),r&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function Dk(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:Vk(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const Nk=/^:\w+$/,kk=3,Ok=2,Uk=1,zk=10,Fk=-2,RA=n=>n==="*";function Bk(n,e){let t=n.split("/"),i=t.length;return t.some(RA)&&(i+=Fk),e&&(i+=Ok),t.filter(r=>!RA(r)).reduce((r,s)=>r+(Nk.test(s)?kk:s===""?Uk:zk),i)}function Vk(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function Hk(n,e){let{routesMeta:t}=n,i={},r="/",s=[];for(let o=0;o{if(h==="*"){let p=a[d]||"";o=s.slice(0,s.length-p.length).replace(/(.)\/+$/,"$1")}return f[h]=Xk(a[d]||"",h),f},{}),pathname:s,pathnameBase:o,pattern:n}}function Gk(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),_1(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,a)=>(i.push(a),"/([^\\/]+)"));return n.endsWith("*")?(i.push("*"),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function jk(n){try{return decodeURI(n)}catch(e){return _1(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function Xk(n,e){try{return decodeURIComponent(n)}catch(t){return _1(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),n}}function S1(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function Yk(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?Bu(n):n;return{pathname:t?t.startsWith("/")?t:qk(t,e):e,search:Jk(i),hash:Kk(r)}}function qk(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function mv(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function tP(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function nP(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=Bu(n):(r=Rf({},n),Pn(!r.pathname||!r.pathname.includes("?"),mv("?","pathname","search",r)),Pn(!r.pathname||!r.pathname.includes("#"),mv("#","pathname","hash",r)),Pn(!r.search||!r.search.includes("#"),mv("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(i||o==null)a=t;else{let d=e.length-1;if(o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;r.pathname=p.join("/")}a=d>=0?e[d]:"/"}let l=Yk(r,a),f=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(f||h)&&(l.pathname+="/"),l}const Ro=n=>n.join("/").replace(/\/\/+/g,"/"),Zk=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Jk=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Kk=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function Qk(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const iP=["post","put","patch","delete"];new Set(iP);const $k=["get",...iP];new Set($k);/** - * React Router v6.10.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function eO(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const tO=typeof Object.is=="function"?Object.is:eO,{useState:nO,useEffect:iO,useLayoutEffect:rO,useDebugValue:sO}=yy;function oO(n,e,t){const i=e(),[{inst:r},s]=nO({inst:{value:i,getSnapshot:e}});return rO(()=>{r.value=i,r.getSnapshot=e,gv(r)&&s({inst:r})},[n,i,e]),iO(()=>(gv(r)&&s({inst:r}),n(()=>{gv(r)&&s({inst:r})})),[n]),sO(i),i}function gv(n){const e=n.getSnapshot,t=n.value;try{const i=e();return!tO(t,i)}catch{return!0}}function aO(n,e,t){return e()}const lO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",uO=!lO,cO=uO?aO:oO;"useSyncExternalStore"in yy&&(n=>n.useSyncExternalStore)(yy);const rP=H.createContext(null),sP=H.createContext(null),ah=H.createContext(null),ug=H.createContext(null),Vu=H.createContext({outlet:null,matches:[]}),oP=H.createContext(null);function dx(){return dx=Object.assign?Object.assign.bind():function(n){for(var e=1;ea.pathnameBase)),s=H.useRef(!1);return H.useEffect(()=>{s.current=!0}),H.useCallback(function(a,l){if(l===void 0&&(l={}),!s.current)return;if(typeof a=="number"){e.go(a);return}let f=nP(a,JSON.parse(r),i,l.relative==="path");n!=="/"&&(f.pathname=f.pathname==="/"?n:Ro([n,f.pathname])),(l.replace?e.replace:e.push)(f,l.state,l)},[n,e,r,i])}function aP(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=H.useContext(Vu),{pathname:r}=cg(),s=JSON.stringify(tP(i).map(o=>o.pathnameBase));return H.useMemo(()=>nP(n,JSON.parse(s),r,t==="path"),[n,s,r,t])}function dO(n,e){lh()||Pn(!1);let{navigator:t}=H.useContext(ah),i=H.useContext(sP),{matches:r}=H.useContext(Vu),s=r[r.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let l=cg(),f;if(e){var h;let _=typeof e=="string"?Bu(e):e;a==="/"||(h=_.pathname)!=null&&h.startsWith(a)||Pn(!1),f=_}else f=l;let d=f.pathname||"/",p=a==="/"?d:d.slice(a.length)||"/",v=Ik(n,{pathname:p}),y=vO(v&&v.map(_=>Object.assign({},_,{params:Object.assign({},o,_.params),pathname:Ro([a,t.encodeLocation?t.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?a:Ro([a,t.encodeLocation?t.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),r,i||void 0);return e&&y?H.createElement(ug.Provider,{value:{location:dx({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:_o.Pop}},y):y}function pO(){let n=SO(),e=Qk(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return H.createElement(H.Fragment,null,H.createElement("h2",null,"Unexpected Application Error!"),H.createElement("h3",{style:{fontStyle:"italic"}},e),t?H.createElement("pre",{style:r},t):null,s)}class mO extends H.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?H.createElement(Vu.Provider,{value:this.props.routeContext},H.createElement(oP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function gO(n){let{routeContext:e,match:t,children:i}=n,r=H.useContext(rP);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),H.createElement(Vu.Provider,{value:e},i)}function vO(n,e,t){if(e===void 0&&(e=[]),n==null)if(t!=null&&t.errors)n=t.matches;else return null;let i=n,r=t==null?void 0:t.errors;if(r!=null){let s=i.findIndex(o=>o.route.id&&(r==null?void 0:r[o.route.id]));s>=0||Pn(!1),i=i.slice(0,Math.min(i.length,s+1))}return i.reduceRight((s,o,a)=>{let l=o.route.id?r==null?void 0:r[o.route.id]:null,f=null;t&&(o.route.ErrorBoundary?f=H.createElement(o.route.ErrorBoundary,null):o.route.errorElement?f=o.route.errorElement:f=H.createElement(pO,null));let h=e.concat(i.slice(0,a+1)),d=()=>{let p=s;return l?p=f:o.route.Component?p=H.createElement(o.route.Component,null):o.route.element&&(p=o.route.element),H.createElement(gO,{match:o,routeContext:{outlet:s,matches:h},children:p})};return t&&(o.route.ErrorBoundary||o.route.errorElement||a===0)?H.createElement(mO,{location:t.location,component:f,error:l,children:d(),routeContext:{outlet:null,matches:h}}):d()},null)}var IA;(function(n){n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator"})(IA||(IA={}));var Im;(function(n){n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator"})(Im||(Im={}));function yO(n){let e=H.useContext(sP);return e||Pn(!1),e}function xO(n){let e=H.useContext(Vu);return e||Pn(!1),e}function _O(n){let e=xO(),t=e.matches[e.matches.length-1];return t.route.id||Pn(!1),t.route.id}function SO(){var n;let e=H.useContext(oP),t=yO(Im.UseRouteError),i=_O(Im.UseRouteError);return e||((n=t.errors)==null?void 0:n[i])}function qr(n){Pn(!1)}function wO(n){let{basename:e="/",children:t=null,location:i,navigationType:r=_o.Pop,navigator:s,static:o=!1}=n;lh()&&Pn(!1);let a=e.replace(/^\/*/,"/"),l=H.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof i=="string"&&(i=Bu(i));let{pathname:f="/",search:h="",hash:d="",state:p=null,key:v="default"}=i,y=H.useMemo(()=>{let _=S1(f,a);return _==null?null:{location:{pathname:_,search:h,hash:d,state:p,key:v},navigationType:r}},[a,f,h,d,p,v,r]);return y==null?null:H.createElement(ah.Provider,{value:l},H.createElement(ug.Provider,{children:t,value:y}))}function MO(n){let{children:e,location:t}=n,i=H.useContext(rP),r=i&&!e?i.router.routes:px(e);return dO(r,t)}var DA;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(DA||(DA={}));new Promise(()=>{});function px(n,e){e===void 0&&(e=[]);let t=[];return H.Children.forEach(n,(i,r)=>{if(!H.isValidElement(i))return;let s=[...e,r];if(i.type===H.Fragment){t.push.apply(t,px(i.props.children,s));return}i.type!==qr&&Pn(!1),!i.props.index||!i.props.children||Pn(!1);let o={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=px(i.props.children,s)),t.push(o)}),t}/** - * React Router DOM v6.10.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function mx(){return mx=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}function EO(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function bO(n,e){return n.button===0&&(!e||e==="_self")&&!EO(n)}const TO=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function CO(n){let{basename:e,children:t,window:i}=n,r=H.useRef();r.current==null&&(r.current=Pk({window:i,v5Compat:!0}));let s=r.current,[o,a]=H.useState({action:s.action,location:s.location});return H.useLayoutEffect(()=>s.listen(a),[s]),H.createElement(wO,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}const PO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vv=H.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:f,preventScrollReset:h}=e,d=AO(e,TO),{basename:p}=H.useContext(ah),v,y=!1;if(typeof f=="string"&&LO.test(f)&&(v=f,PO)){let S=new URL(window.location.href),w=f.startsWith("//")?new URL(S.protocol+f):new URL(f),A=S1(w.pathname,p);w.origin===S.origin&&A!=null?f=A+w.search+w.hash:y=!0}let _=fO(f,{relative:r}),M=RO(f,{replace:o,state:a,target:l,preventScrollReset:h,relative:r});function m(S){i&&i(S),S.defaultPrevented||M(S)}return H.createElement("a",mx({},d,{href:v||_,onClick:y||s?i:m,ref:t,target:l}))});var NA;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmitImpl="useSubmitImpl",n.UseFetcher="useFetcher"})(NA||(NA={}));var kA;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(kA||(kA={}));function RO(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o}=e===void 0?{}:e,a=hO(),l=cg(),f=aP(n,{relative:o});return H.useCallback(h=>{if(bO(h,t)){h.preventDefault();let d=i!==void 0?i:Rm(l)===Rm(f);a(n,{replace:d,state:r,preventScrollReset:s,relative:o})}},[l,a,f,i,r,t,n,s,o])}const Hu="/portfolio-react-threejs/assets/anim-bg-41fcb528.gif",lP=H.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),fg=H.createContext({}),w1=H.createContext(null),hg=typeof document<"u",OA=hg?H.useLayoutEffect:H.useEffect,uP=H.createContext({strict:!1});function IO(n,e,t,i){const{visualElement:r}=H.useContext(fg),s=H.useContext(uP),o=H.useContext(w1),a=H.useContext(lP).reducedMotion,l=H.useRef();i=i||s.renderer,!l.current&&i&&(l.current=i(n,{visualState:e,parent:r,props:t,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const f=l.current;return H.useInsertionEffect(()=>{f&&f.update(t,o)}),OA(()=>{f&&f.render()}),H.useEffect(()=>{f&&f.updateFeatures()}),(window.HandoffAppearAnimations?OA:H.useEffect)(()=>{f&&f.animationState&&f.animationState.animateChanges()}),f}function ru(n){return typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function DO(n,e,t){return H.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):ru(t)&&(t.current=i))},[e])}function If(n){return typeof n=="string"||Array.isArray(n)}function dg(n){return typeof n=="object"&&typeof n.start=="function"}const M1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],A1=["initial",...M1];function pg(n){return dg(n.animate)||A1.some(e=>If(n[e]))}function cP(n){return!!(pg(n)||n.variants)}function NO(n,e){if(pg(n)){const{initial:t,animate:i}=n;return{initial:t===!1||If(t)?t:void 0,animate:If(i)?i:void 0}}return n.inherit!==!1?e:{}}function kO(n){const{initial:e,animate:t}=NO(n,H.useContext(fg));return H.useMemo(()=>({initial:e,animate:t}),[UA(e),UA(t)])}function UA(n){return Array.isArray(n)?n.join(" "):n}const zA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Df={};for(const n in zA)Df[n]={isEnabled:e=>zA[n].some(t=>!!e[t])};function OO(n){for(const e in n)Df[e]={...Df[e],...n[e]}}function fP(n){const e=H.useRef(null);return e.current===null&&(e.current=n()),e.current}const rf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let UO=1;function zO(){return fP(()=>{if(rf.hasEverUpdated)return UO++})}const hP=H.createContext({}),dP=H.createContext({}),FO=Symbol.for("motionComponentSymbol");function BO({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&OO(n);function s(a,l){let f;const h={...H.useContext(lP),...a,layoutId:VO(a)},{isStatic:d}=h,p=kO(a),v=d?void 0:zO(),y=i(a,d);if(!d&&hg){p.visualElement=IO(r,y,h,e);const _=H.useContext(dP),M=H.useContext(uP).strict;p.visualElement&&(f=p.visualElement.loadFeatures(h,M,n,v,_))}return H.createElement(fg.Provider,{value:p},f&&p.visualElement?H.createElement(f,{visualElement:p.visualElement,...h}):null,t(r,a,v,DO(y,p.visualElement,l),y,d,p.visualElement))}const o=H.forwardRef(s);return o[FO]=r,o}function VO({layoutId:n}){const e=H.useContext(hP).id;return e&&n!==void 0?e+"-"+n:n}function HO(n){function e(i,r={}){return BO(n(i,r))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(i,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}const WO=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function E1(n){return typeof n!="string"||n.includes("-")?!1:!!(WO.indexOf(n)>-1||/[A-Z]/.test(n))}const Dm={};function GO(n){Object.assign(Dm,n)}const uh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],el=new Set(uh);function pP(n,{layout:e,layoutId:t}){return el.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!Dm[n]||n==="opacity")}const Ri=n=>!!(n&&n.getVelocity),jO={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},XO=uh.length;function YO(n,{enableHardwareAcceleration:e=!0,allowTransformNone:t=!0},i,r){let s="";for(let o=0;oe=>typeof e=="string"&&e.startsWith(n),gP=mP("--"),gx=mP("var(--"),qO=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,ZO=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Xa=(n,e,t)=>Math.min(Math.max(t,n),e),tl={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},sf={...tl,transform:n=>Xa(0,1,n)},Xd={...tl,default:1},of=n=>Math.round(n*1e5)/1e5,mg=/(-)?([\d]*\.?[\d])+/g,vP=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,JO=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ch(n){return typeof n=="string"}const fh=n=>({test:e=>ch(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),co=fh("deg"),es=fh("%"),it=fh("px"),KO=fh("vh"),QO=fh("vw"),FA={...es,parse:n=>es.parse(n)/100,transform:n=>es.transform(n*100)},BA={...tl,transform:Math.round},yP={borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:co,rotateX:co,rotateY:co,rotateZ:co,scale:Xd,scaleX:Xd,scaleY:Xd,scaleZ:Xd,skew:co,skewX:co,skewY:co,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:sf,originX:FA,originY:FA,originZ:it,zIndex:BA,fillOpacity:sf,strokeOpacity:sf,numOctaves:BA};function b1(n,e,t,i){const{style:r,vars:s,transform:o,transformOrigin:a}=n;let l=!1,f=!1,h=!0;for(const d in e){const p=e[d];if(gP(d)){s[d]=p;continue}const v=yP[d],y=ZO(p,v);if(el.has(d)){if(l=!0,o[d]=y,!h)continue;p!==(v.default||0)&&(h=!1)}else d.startsWith("origin")?(f=!0,a[d]=y):r[d]=y}if(e.transform||(l||i?r.transform=YO(n.transform,t,h,i):r.transform&&(r.transform="none")),f){const{originX:d="50%",originY:p="50%",originZ:v=0}=a;r.transformOrigin=`${d} ${p} ${v}`}}const T1=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xP(n,e,t){for(const i in e)!Ri(e[i])&&!pP(i,t)&&(n[i]=e[i])}function $O({transformTemplate:n},e,t){return H.useMemo(()=>{const i=T1();return b1(i,e,{enableHardwareAcceleration:!t},n),Object.assign({},i.vars,i.style)},[e])}function eU(n,e,t){const i=n.style||{},r={};return xP(r,i,n),Object.assign(r,$O(n,e,t)),n.transformValues?n.transformValues(r):r}function tU(n,e,t){const i={},r=eU(n,e,t);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=r,i}const nU=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Nm(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||nU.has(n)}let _P=n=>!Nm(n);function iU(n){n&&(_P=e=>e.startsWith("on")?!Nm(e):n(e))}try{iU(require("@emotion/is-prop-valid").default)}catch{}function rU(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(_P(r)||t===!0&&Nm(r)||!e&&!Nm(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function VA(n,e,t){return typeof n=="string"?n:it.transform(e+t*n)}function sU(n,e,t){const i=VA(e,n.x,n.width),r=VA(t,n.y,n.height);return`${i} ${r}`}const oU={offset:"stroke-dashoffset",array:"stroke-dasharray"},aU={offset:"strokeDashoffset",array:"strokeDasharray"};function lU(n,e,t=1,i=0,r=!0){n.pathLength=1;const s=r?oU:aU;n[s.offset]=it.transform(-i);const o=it.transform(e),a=it.transform(t);n[s.array]=`${o} ${a}`}function C1(n,{attrX:e,attrY:t,attrScale:i,originX:r,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...f},h,d,p){if(b1(n,f,h,p),d){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:v,style:y,dimensions:_}=n;v.transform&&(_&&(y.transform=v.transform),delete v.transform),_&&(r!==void 0||s!==void 0||y.transform)&&(y.transformOrigin=sU(_,r!==void 0?r:.5,s!==void 0?s:.5)),e!==void 0&&(v.x=e),t!==void 0&&(v.y=t),i!==void 0&&(v.scale=i),o!==void 0&&lU(v,o,a,l,!1)}const SP=()=>({...T1(),attrs:{}}),P1=n=>typeof n=="string"&&n.toLowerCase()==="svg";function uU(n,e,t,i){const r=H.useMemo(()=>{const s=SP();return C1(s,e,{enableHardwareAcceleration:!1},P1(i),n.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};xP(s,n.style,n),r.style={...s,...r.style}}return r}function cU(n=!1){return(t,i,r,s,{latestValues:o},a)=>{const f=(E1(t)?uU:tU)(i,o,a,t),d={...rU(i,typeof t=="string",n),...f,ref:s},{children:p}=i,v=H.useMemo(()=>Ri(p)?p.get():p,[p]);return r&&(d["data-projection-id"]=r),H.createElement(t,{...d,children:v})}}const L1=n=>n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function wP(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const MP=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function AP(n,e,t,i){wP(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(MP.has(r)?r:L1(r),e.attrs[r])}function R1(n,e){const{style:t}=n,i={};for(const r in t)(Ri(t[r])||e.style&&Ri(e.style[r])||pP(r,n))&&(i[r]=t[r]);return i}function EP(n,e){const t=R1(n,e);for(const i in n)if(Ri(n[i])||Ri(e[i])){const r=uh.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;t[r]=n[i]}return t}function I1(n,e,t,i={},r={}){return typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),e}const km=n=>Array.isArray(n),fU=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),hU=n=>km(n)?n[n.length-1]||0:n;function Qp(n){const e=Ri(n)?n.get():n;return fU(e)?e.toValue():e}function dU({scrapeMotionValuesFromProps:n,createRenderState:e,onMount:t},i,r,s){const o={latestValues:pU(i,r,s,n),renderState:e()};return t&&(o.mount=a=>t(i,a,o)),o}const bP=n=>(e,t)=>{const i=H.useContext(fg),r=H.useContext(w1),s=()=>dU(n,e,i,r);return t?s():fP(s)};function pU(n,e,t,i){const r={},s=i(n,{});for(const p in s)r[p]=Qp(s[p]);let{initial:o,animate:a}=n;const l=pg(n),f=cP(n);e&&f&&!l&&n.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let h=t?t.initial===!1:!1;h=h||o===!1;const d=h?a:o;return d&&typeof d!="boolean"&&!dg(d)&&(Array.isArray(d)?d:[d]).forEach(v=>{const y=I1(n,v);if(!y)return;const{transitionEnd:_,transition:M,...m}=y;for(const S in m){let w=m[S];if(Array.isArray(w)){const A=h?w.length-1:0;w=w[A]}w!==null&&(r[S]=w)}for(const S in _)r[S]=_[S]}),r}const mU={useVisualState:bP({scrapeMotionValuesFromProps:EP,createRenderState:SP,onMount:(n,e,{renderState:t,latestValues:i})=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}C1(t,i,{enableHardwareAcceleration:!1},P1(e.tagName),n.transformTemplate),AP(e,t)}})},gU={useVisualState:bP({scrapeMotionValuesFromProps:R1,createRenderState:T1})};function vU(n,{forwardMotionProps:e=!1},t,i){return{...E1(n)?mU:gU,preloadedFeatures:t,useRender:cU(e),createVisualElement:i,Component:n}}function Ps(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}const TP=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function gg(n,e="page"){return{point:{x:n[e+"X"],y:n[e+"Y"]}}}const yU=n=>e=>TP(e)&&n(e,gg(e));function Is(n,e,t,i){return Ps(n,e,yU(t),i)}const xU=(n,e)=>t=>e(n(t)),Io=(...n)=>n.reduce(xU);function CP(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const HA=CP("dragHorizontal"),WA=CP("dragVertical");function PP(n){let e=!1;if(n==="y")e=WA();else if(n==="x")e=HA();else{const t=HA(),i=WA();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function LP(){const n=PP(!0);return n?(n(),!1):!0}class Xo{constructor(e){this.isMounted=!1,this.node=e}update(){}}function _U(n){let e=[],t=[],i=0,r=!1,s=!1;const o=new WeakSet,a={schedule:(l,f=!1,h=!1)=>{const d=h&&r,p=d?e:t;return f&&o.add(l),p.indexOf(l)===-1&&(p.push(l),d&&r&&(i=e.length)),l},cancel:l=>{const f=t.indexOf(l);f!==-1&&t.splice(f,1),o.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let f=0;f(n[e]=_U(()=>Nf=!0),n),{}),wU=n=>_u[n].process(zn),RP=n=>{Nf=!1,zn.delta=vx?1e3/60:Math.max(Math.min(n-zn.timestamp,SU),1),zn.timestamp=n,zn.isProcessing=!0,vg.forEach(wU),zn.isProcessing=!1,Nf&&(vx=!1,requestAnimationFrame(RP))},MU=()=>{Nf=!0,vx=!0,zn.isProcessing||requestAnimationFrame(RP)},nn=vg.reduce((n,e)=>{const t=_u[e];return n[e]=(i,r=!1,s=!1)=>(Nf||MU(),t.schedule(i,r,s)),n},{});function Fs(n){vg.forEach(e=>_u[e].cancel(n))}function GA(n,e){const t="pointer"+(e?"enter":"leave"),i="onHover"+(e?"Start":"End"),r=(s,o)=>{if(s.type==="touch"||LP())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e),a[i]&&nn.update(()=>a[i](s,o))};return Is(n.current,t,r,{passive:!n.getProps()[i]})}class AU extends Xo{mount(){this.unmount=Io(GA(this.node,!0),GA(this.node,!1))}unmount(){}}class EU extends Xo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Io(Ps(this.node.current,"focus",()=>this.onFocus()),Ps(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const IP=(n,e)=>e?n===e?!0:IP(n,e.parentElement):!1,Tn=n=>n;function yv(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,gg(t))}class bU extends Xo{constructor(){super(...arguments),this.removeStartListeners=Tn,this.removeEndListeners=Tn,this.removeAccessibleListeners=Tn,this.startPointerPress=(e,t)=>{if(this.removeEndListeners(),this.isPressing)return;const i=this.node.getProps(),s=Is(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:f,onTapCancel:h}=this.node.getProps();nn.update(()=>{IP(this.node.current,a.target)?f&&f(a,l):h&&h(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=Is(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Io(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||yv("up",(l,f)=>{const{onTap:h}=this.node.getProps();h&&nn.update(()=>h(l,f))})};this.removeEndListeners(),this.removeEndListeners=Ps(this.node.current,"keyup",o),yv("down",(a,l)=>{this.startPress(a,l)})},t=Ps(this.node.current,"keydown",e),i=()=>{this.isPressing&&yv("cancel",(s,o)=>this.cancelPress(s,o))},r=Ps(this.node.current,"blur",i);this.removeAccessibleListeners=Io(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&nn.update(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!LP()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&nn.update(()=>i(e,t))}mount(){const e=this.node.getProps(),t=Is(this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=Ps(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Io(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const yx=new WeakMap,xv=new WeakMap,TU=n=>{const e=yx.get(n.target);e&&e(n)},CU=n=>{n.forEach(TU)};function PU({root:n,...e}){const t=n||document;xv.has(t)||xv.set(t,{});const i=xv.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(CU,{root:n,...e})),i[r]}function LU(n,e,t){const i=PU(e);return yx.set(n,t),i.observe(n),()=>{yx.delete(n),i.unobserve(n)}}const RU={some:0,all:1};class IU extends Xo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:RU[r]},a=l=>{const{isIntersecting:f}=l;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:d}=this.node.getProps(),p=f?h:d;p&&p(l)};return LU(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(DU(e,t))&&this.startObserver()}unmount(){}}function DU({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const NU={inView:{Feature:IU},tap:{Feature:bU},focus:{Feature:EU},hover:{Feature:AU}};function DP(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;ie[i]=t.get()),e}function OU(n){const e={};return n.values.forEach((t,i)=>e[i]=t.getVelocity()),e}function yg(n,e,t){const i=n.getProps();return I1(i,e,t!==void 0?t:i.custom,kU(n),OU(n))}const UU="framerAppearId",zU="data-"+L1(UU);let FU=Tn,D1=Tn;const Do=n=>n*1e3,Ds=n=>n/1e3,BU={current:!1},NP=n=>Array.isArray(n)&&typeof n[0]=="number";function kP(n){return!!(!n||typeof n=="string"&&OP[n]||NP(n)||Array.isArray(n)&&n.every(kP))}const jc=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,OP={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jc([0,.65,.55,1]),circOut:jc([.55,0,1,.45]),backIn:jc([.31,.01,.66,-.59]),backOut:jc([.33,1.53,.69,.99])};function UP(n){if(n)return NP(n)?jc(n):Array.isArray(n)?n.map(UP):OP[n]}function VU(n,e,t,{delay:i=0,duration:r,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const f={[e]:t};l&&(f.offset=l);const h=UP(a);return Array.isArray(h)&&(f.easing=h),n.animate(f,{delay:i,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const jA={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},_v={},zP={};for(const n in jA)zP[n]=()=>(_v[n]===void 0&&(_v[n]=jA[n]()),_v[n]);function HU(n,{repeat:e,repeatType:t="loop"}){const i=e&&t!=="loop"&&e%2===1?0:n.length-1;return n[i]}const FP=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,WU=1e-7,GU=12;function jU(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=FP(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>WU&&++ajU(s,0,1,n,t);return s=>s===0||s===1?s:FP(r(s),e,i)}const XU=hh(.42,0,1,1),YU=hh(0,0,.58,1),BP=hh(.42,0,.58,1),qU=n=>Array.isArray(n)&&typeof n[0]!="number",VP=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,HP=n=>e=>1-n(1-e),WP=n=>1-Math.sin(Math.acos(n)),N1=HP(WP),ZU=VP(N1),GP=hh(.33,1.53,.69,.99),k1=HP(GP),JU=VP(k1),KU=n=>(n*=2)<1?.5*k1(n):.5*(2-Math.pow(2,-10*(n-1))),QU={linear:Tn,easeIn:XU,easeInOut:BP,easeOut:YU,circIn:WP,circInOut:ZU,circOut:N1,backIn:k1,backInOut:JU,backOut:GP,anticipate:KU},XA=n=>{if(Array.isArray(n)){D1(n.length===4);const[e,t,i,r]=n;return hh(e,t,i,r)}else if(typeof n=="string")return QU[n];return n},O1=(n,e)=>t=>!!(ch(t)&&JO.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),jP=(n,e,t)=>i=>{if(!ch(i))return i;const[r,s,o,a]=i.match(mg);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},$U=n=>Xa(0,255,n),Sv={...tl,transform:n=>Math.round($U(n))},Pa={test:O1("rgb","red"),parse:jP("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+Sv.transform(n)+", "+Sv.transform(e)+", "+Sv.transform(t)+", "+of(sf.transform(i))+")"};function ez(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const xx={test:O1("#"),parse:ez,transform:Pa.transform},su={test:O1("hsl","hue"),parse:jP("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+es.transform(of(e))+", "+es.transform(of(t))+", "+of(sf.transform(i))+")"},hi={test:n=>Pa.test(n)||xx.test(n)||su.test(n),parse:n=>Pa.test(n)?Pa.parse(n):su.test(n)?su.parse(n):xx.parse(n),transform:n=>ch(n)?n:n.hasOwnProperty("red")?Pa.transform(n):su.transform(n)},en=(n,e,t)=>-t*n+t*e+n;function wv(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)*(2/3-t)*6:n}function tz({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=wv(l,a,n+1/3),s=wv(l,a,n),o=wv(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}const Mv=(n,e,t)=>{const i=n*n;return Math.sqrt(Math.max(0,t*(e*e-i)+i))},nz=[xx,Pa,su],iz=n=>nz.find(e=>e.test(n));function YA(n){const e=iz(n);let t=e.parse(n);return e===su&&(t=tz(t)),t}const XP=(n,e)=>{const t=YA(n),i=YA(e),r={...t};return s=>(r.red=Mv(t.red,i.red,s),r.green=Mv(t.green,i.green,s),r.blue=Mv(t.blue,i.blue,s),r.alpha=en(t.alpha,i.alpha,s),Pa.transform(r))};function rz(n){var e,t;return isNaN(n)&&ch(n)&&(((e=n.match(mg))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(vP))===null||t===void 0?void 0:t.length)||0)>0}const YP={regex:qO,countKey:"Vars",token:"${v}",parse:Tn},qP={regex:vP,countKey:"Colors",token:"${c}",parse:hi.parse},ZP={regex:mg,countKey:"Numbers",token:"${n}",parse:tl.parse};function Av(n,{regex:e,countKey:t,token:i,parse:r}){const s=n.tokenised.match(e);s&&(n["num"+t]=s.length,n.tokenised=n.tokenised.replace(e,i),n.values.push(...s.map(r)))}function Om(n){const e=n.toString(),t={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return t.value.includes("var(--")&&Av(t,YP),Av(t,qP),Av(t,ZP),t}function JP(n){return Om(n).values}function KP(n){const{values:e,numColors:t,numVars:i,tokenised:r}=Om(n),s=e.length;return o=>{let a=r;for(let l=0;ltypeof n=="number"?0:n;function oz(n){const e=JP(n);return KP(n)(e.map(sz))}const Uo={test:rz,parse:JP,createTransformer:KP,getAnimatableNone:oz},QP=(n,e)=>t=>`${t>0?e:n}`;function $P(n,e){return typeof n=="number"?t=>en(n,e,t):hi.test(n)?XP(n,e):n.startsWith("var(")?QP(n,e):t3(n,e)}const e3=(n,e)=>{const t=[...n],i=t.length,r=n.map((s,o)=>$P(s,e[o]));return s=>{for(let o=0;o{const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=$P(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}},t3=(n,e)=>{const t=Uo.createTransformer(e),i=Om(n),r=Om(e);return i.numVars===r.numVars&&i.numColors===r.numColors&&i.numNumbers>=r.numNumbers?Io(e3(i.values,r.values),t):QP(n,e)},kf=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},qA=(n,e)=>t=>en(n,e,t);function lz(n){return typeof n=="number"?qA:typeof n=="string"?hi.test(n)?XP:t3:Array.isArray(n)?e3:typeof n=="object"?az:qA}function uz(n,e,t){const i=[],r=t||lz(n[0]),s=n.length-1;for(let o=0;oe[0];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=uz(e,i,r),a=o.length,l=f=>{let h=0;if(a>1)for(;hl(Xa(n[0],n[s-1],f)):l}function cz(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=kf(0,e,i);n.push(en(t,1,r))}}function fz(n){const e=[0];return cz(e,n.length-1),e}function hz(n,e){return n.map(t=>t*e)}function dz(n,e){return n.map(()=>e||BP).splice(0,n.length-1)}function Um({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=qU(i)?i.map(XA):XA(i),s={done:!1,value:e[0]},o=hz(t&&t.length===e.length?t:fz(e),n),a=n3(o,e,{ease:Array.isArray(r)?r:dz(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}function i3(n,e){return e?n*(1e3/e):0}const pz=5;function r3(n,e,t){const i=Math.max(e-pz,0);return i3(t-n(i),e-i)}const Ev=.001,mz=.01,ZA=10,gz=.05,vz=1;function yz({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s;FU(n<=Do(ZA));let o=1-e;o=Xa(gz,vz,o),n=Xa(mz,ZA,Ds(n)),o<1?(r=f=>{const h=f*o,d=h*n,p=h-t,v=_x(f,o),y=Math.exp(-d);return Ev-p/v*y},s=f=>{const d=f*o*n,p=d*t+t,v=Math.pow(o,2)*Math.pow(f,2)*n,y=Math.exp(-d),_=_x(Math.pow(f,2),o);return(-r(f)+Ev>0?-1:1)*((p-v)*y)/_}):(r=f=>{const h=Math.exp(-f*n),d=(f-t)*n+1;return-Ev+h*d},s=f=>{const h=Math.exp(-f*n),d=(t-f)*(n*n);return h*d});const a=5/n,l=_z(r,s,a);if(n=Do(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const f=Math.pow(l,2)*i;return{stiffness:f,damping:o*2*Math.sqrt(i*f),duration:n}}}const xz=12;function _z(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function Mz(n){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...n};if(!JA(n,wz)&&JA(n,Sz)){const t=yz(n);e={...e,...t,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}function s3({keyframes:n,restDelta:e,restSpeed:t,...i}){const r=n[0],s=n[n.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:f,velocity:h,duration:d,isResolvedFromDuration:p}=Mz(i),v=h?-Ds(h):0,y=l/(2*Math.sqrt(a*f)),_=s-r,M=Ds(Math.sqrt(a/f)),m=Math.abs(_)<5;t||(t=m?.01:2),e||(e=m?.005:.5);let S;if(y<1){const w=_x(M,y);S=A=>{const b=Math.exp(-y*M*A);return s-b*((v+y*M*_)/w*Math.sin(w*A)+_*Math.cos(w*A))}}else if(y===1)S=w=>s-Math.exp(-M*w)*(_+(v+M*_)*w);else{const w=M*Math.sqrt(y*y-1);S=A=>{const b=Math.exp(-y*M*A),P=Math.min(w*A,300);return s-b*((v+y*M*_)*Math.sinh(P)+w*_*Math.cosh(P))/w}}return{calculatedDuration:p&&d||null,next:w=>{const A=S(w);if(p)o.done=w>=d;else{let b=v;w!==0&&(y<1?b=r3(S,w,A):b=0);const P=Math.abs(b)<=t,I=Math.abs(s-A)<=e;o.done=P&&I}return o.value=o.done?s:A,o}}}function KA({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:f=.5,restSpeed:h}){const d=n[0],p={done:!1,value:d},v=L=>a!==void 0&&Ll,y=L=>a===void 0?l:l===void 0||Math.abs(a-L)-_*Math.exp(-L/i),w=L=>m+S(L),A=L=>{const C=S(L),R=w(L);p.done=Math.abs(C)<=f,p.value=p.done?m:R};let b,P;const I=L=>{v(p.value)&&(b=L,P=s3({keyframes:[p.value,y(p.value)],velocity:r3(w,L,p.value),damping:r,stiffness:s,restDelta:f,restSpeed:h}))};return I(0),{calculatedDuration:null,next:L=>{let C=!1;return!P&&b===void 0&&(C=!0,A(L),I(L)),b!==void 0&&L>b?P.next(L-b):(!C&&A(L),p)}}}const Az=n=>{const e=({timestamp:t})=>n(t);return{start:()=>nn.update(e,!0),stop:()=>Fs(e),now:()=>zn.isProcessing?zn.timestamp:performance.now()}},QA=2e4;function $A(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=QA?1/0:e}const Ez={decay:KA,inertia:KA,tween:Um,keyframes:Um,spring:s3};function zm({autoplay:n=!0,delay:e=0,driver:t=Az,keyframes:i,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:f,onComplete:h,onUpdate:d,...p}){let v=1,y=!1,_,M;const m=()=>{_&&_(),M=new Promise(te=>{_=te})};m();let S;const w=Ez[r]||Um;let A;w!==Um&&typeof i[0]!="number"&&(A=n3([0,100],i,{clamp:!1}),i=[0,100]);const b=w({...p,keyframes:i});let P;a==="mirror"&&(P=w({...p,keyframes:[...i].reverse(),velocity:-(p.velocity||0)}));let I="idle",L=null,C=null,R=null;b.calculatedDuration===null&&s&&(b.calculatedDuration=$A(b));const{calculatedDuration:W}=b;let J=1/0,j=1/0;W!==null&&(J=W+o,j=J*(s+1)-o);let X=0;const Z=te=>{if(C===null)return;v>0&&(C=Math.min(C,te)),L!==null?X=L:X=(te-C)*v;const $=X-e,ee=$<0;X=Math.max($,0),I==="finished"&&L===null&&(X=j);let ue=X,Ee=b;if(s){const Ye=X/J;let xe=Math.floor(Ye),Me=Ye%1;!Me&&Ye>=1&&(Me=1),Me===1&&xe--,xe=Math.min(xe,s+1);const ge=!!(xe%2);ge&&(a==="reverse"?(Me=1-Me,o&&(Me-=o/J)):a==="mirror"&&(Ee=P));let oe=Xa(0,1,Me);X>j&&(oe=a==="reverse"&&ge?1:0),ue=oe*J}const we=ee?{done:!1,value:i[0]}:Ee.next(ue);A&&(we.value=A(we.value));let{done:Q}=we;!ee&&W!==null&&(Q=X>=j);const Xe=L===null&&(I==="finished"||I==="running"&&Q||v<0&&X<=0);return d&&d(we.value),Xe&&D(),we},se=()=>{S&&S.stop(),S=void 0},ae=()=>{I="idle",se(),m(),C=R=null},D=()=>{I="finished",h&&h(),se(),m()},V=()=>{if(y)return;S||(S=t(Z));const te=S.now();l&&l(),L!==null?C=te-L:(!C||I==="finished")&&(C=te),R=C,L=null,I="running",S.start()};n&&V();const B={then(te,$){return M.then(te,$)},get time(){return Ds(X)},set time(te){te=Do(te),X=te,L!==null||!S||v===0?L=te:C=S.now()-te/v},get duration(){const te=b.calculatedDuration===null?$A(b):b.calculatedDuration;return Ds(te)},get speed(){return v},set speed(te){te===v||!S||(v=te,B.time=Ds(X))},get state(){return I},play:V,pause:()=>{I="paused",L=X},stop:()=>{y=!0,I!=="idle"&&(I="idle",f&&f(),ae())},cancel:()=>{R!==null&&Z(R),ae()},complete:()=>{I="finished"},sample:te=>(C=0,Z(te))};return B}const bz=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Yd=10,Tz=2e4,Cz=(n,e)=>e.type==="spring"||n==="backgroundColor"||!kP(e.ease);function Pz(n,e,{onUpdate:t,onComplete:i,...r}){if(!(zP.waapi()&&bz.has(e)&&!r.repeatDelay&&r.repeatType!=="mirror"&&r.damping!==0&&r.type!=="inertia"))return!1;let o=!1,a,l;const f=()=>{l=new Promise(m=>{a=m})};f();let{keyframes:h,duration:d=300,ease:p,times:v}=r;if(Cz(e,r)){const m=zm({...r,repeat:0,delay:0});let S={done:!1,value:h[0]};const w=[];let A=0;for(;!S.done&&Ay.cancel(),M=()=>{nn.update(_),a(),f()};return y.onfinish=()=>{n.set(HU(h,r)),i&&i(),M()},{then(m,S){return l.then(m,S)},get time(){return Ds(y.currentTime||0)},set time(m){y.currentTime=Do(m)},get speed(){return y.playbackRate},set speed(m){y.playbackRate=m},get duration(){return Ds(d)},play:()=>{o||(y.play(),Fs(_))},pause:()=>y.pause(),stop:()=>{if(o=!0,y.playState==="idle")return;const{currentTime:m}=y;if(m){const S=zm({...r,autoplay:!1});n.setWithVelocity(S.sample(m-Yd).value,S.sample(m).value,Yd)}M()},complete:()=>y.finish(),cancel:M}}function Lz({keyframes:n,delay:e,onUpdate:t,onComplete:i}){const r=()=>(t&&t(n[n.length-1]),i&&i(),{time:0,speed:1,duration:0,play:Tn,pause:Tn,stop:Tn,then:s=>(s(),Promise.resolve()),cancel:Tn,complete:Tn});return e?zm({keyframes:[0,1],duration:0,delay:e,onComplete:r}):r()}const Rz={type:"spring",stiffness:500,damping:25,restSpeed:10},Iz=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),Dz={type:"keyframes",duration:.8},Nz={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kz=(n,{keyframes:e})=>e.length>2?Dz:el.has(n)?n.startsWith("scale")?Iz(e[1]):Rz:Nz,Sx=(n,e)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Uo.test(e)&&!e.startsWith("url(")),Oz=new Set(["brightness","contrast","saturate","opacity"]);function Uz(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(mg)||[];if(!i)return n;const r=t.replace(i,"");let s=Oz.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const zz=/([a-z-]*)\(.*?\)/g,wx={...Uo,getAnimatableNone:n=>{const e=n.match(zz);return e?e.map(Uz).join(" "):n}},Fz={...yP,color:hi,backgroundColor:hi,outlineColor:hi,fill:hi,stroke:hi,borderColor:hi,borderTopColor:hi,borderRightColor:hi,borderBottomColor:hi,borderLeftColor:hi,filter:wx,WebkitFilter:wx},U1=n=>Fz[n];function z1(n,e){let t=U1(n);return t!==wx&&(t=Uo),t.getAnimatableNone?t.getAnimatableNone(e):void 0}function Bz({when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:f,...h}){return!!Object.keys(h).length}function eE(n){return n===0||typeof n=="string"&&parseFloat(n)===0&&n.indexOf(" ")===-1}function tE(n){return typeof n=="number"?0:z1("",n)}function o3(n,e){return n[e]||n.default||n}function Vz(n,[...e]){for(let t=0;tr=>{const s=o3(i,n)||{},o=s.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Do(o);const l=Hz(e,n,t,s),f=l[0],h=l[l.length-1],d=Sx(n,f),p=Sx(n,h);let v={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:y=>{e.set(y),s.onUpdate&&s.onUpdate(y)},onComplete:()=>{r(),s.onComplete&&s.onComplete()}};if(Bz(s)||(v={...v,...kz(n,v)}),v.duration&&(v.duration=Do(v.duration)),v.repeatDelay&&(v.repeatDelay=Do(v.repeatDelay)),!d||!p||BU.current||s.type===!1)return Lz(v);if(e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const y=Pz(e,n,v);if(y)return y}return zm(v)};function Fm(n){return!!(Ri(n)&&n.add)}const Wz=n=>/^\-?\d*\.?\d+$/.test(n),Gz=n=>/^0[^.\s]+$/.test(n);function B1(n,e){n.indexOf(e)===-1&&n.push(e)}function V1(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class H1{constructor(){this.subscriptions=[]}add(e){return B1(this.subscriptions,e),()=>V1(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s!isNaN(parseFloat(n));class Xz{constructor(e,t={}){this.version="10.12.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,r=!0)=>{this.prev=this.current,this.current=i;const{delta:s,timestamp:o}=zn;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,nn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>nn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=jz(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new H1);const i=this.events[e].add(t);return e==="change"?()=>{i(),nn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=e,this.timeDelta=i}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?i3(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Lu(n,e){return new Xz(n,e)}const a3=n=>e=>e.test(n),Yz={test:n=>n==="auto",parse:n=>n},l3=[tl,it,es,co,QO,KO,Yz],Ac=n=>l3.find(a3(n)),qz=[...l3,hi,Uo],Zz=n=>qz.find(a3(n));function Jz(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,Lu(t))}function Kz(n,e){const t=yg(n,e);let{transitionEnd:i={},transition:r={},...s}=t?n.makeTargetAnimatable(t,!1):{};s={...s,...i};for(const o in s){const a=hU(s[o]);Jz(n,o,a)}}function Qz(n,e,t){var i,r;const s=Object.keys(e).filter(a=>!n.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(d))),f.push(_)}return o&&Promise.all(f).then(()=>{o&&Kz(n,o)}),f}function Mx(n,e,t={}){const i=yg(n,e,t.custom);let{transition:r=n.getDefaultTransition()||{}}=i||{};t.transitionOverride&&(r=t.transitionOverride);const s=i?()=>Promise.all(u3(n,i,t)):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(l=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:d}=r;return nF(n,e,f+l,h,d,t)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,f]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>f())}else return Promise.all([s(),o(t.delay)])}function nF(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(f=0)=>f*i:(f=0)=>a-f*i;return Array.from(n.variantChildren).sort(iF).forEach((f,h)=>{f.notify("AnimationStart",e),o.push(Mx(f,e,{...s,delay:t+l(h)}).then(()=>f.notify("AnimationComplete",e)))}),Promise.all(o)}function iF(n,e){return n.sortNodePosition(e)}function rF(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>Mx(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=Mx(n,e,t);else{const r=typeof e=="function"?yg(n,e,t.custom):e;i=Promise.all(u3(n,r,t))}return i.then(()=>n.notify("AnimationComplete",e))}const sF=[...M1].reverse(),oF=M1.length;function aF(n){return e=>Promise.all(e.map(({animation:t,options:i})=>rF(n,t,i)))}function lF(n){let e=aF(n);const t=cF();let i=!0;const r=(l,f)=>{const h=yg(n,f);if(h){const{transition:d,transitionEnd:p,...v}=h;l={...l,...v,...p}}return l};function s(l){e=l(n)}function o(l,f){const h=n.getProps(),d=n.getVariantContext(!0)||{},p=[],v=new Set;let y={},_=1/0;for(let m=0;m_&&b;const R=Array.isArray(A)?A:[A];let W=R.reduce(r,{});P===!1&&(W={});const{prevResolvedValues:J={}}=w,j={...J,...W},X=Z=>{C=!0,v.delete(Z),w.needsAnimating[Z]=!0};for(const Z in j){const se=W[Z],ae=J[Z];y.hasOwnProperty(Z)||(se!==ae?km(se)&&km(ae)?!DP(se,ae)||L?X(Z):w.protectedKeys[Z]=!0:se!==void 0?X(Z):v.add(Z):se!==void 0&&v.has(Z)?X(Z):w.protectedKeys[Z]=!0)}w.prevProp=A,w.prevResolvedValues=W,w.isActive&&(y={...y,...W}),i&&n.blockInitialAnimation&&(C=!1),C&&!I&&p.push(...R.map(Z=>({animation:Z,options:{type:S,...l}})))}if(v.size){const m={};v.forEach(S=>{const w=n.getBaseTarget(S);w!==void 0&&(m[S]=w)}),p.push({animation:m})}let M=!!p.length;return i&&h.initial===!1&&!n.manuallyAnimateOnMount&&(M=!1),i=!1,M?e(p):Promise.resolve()}function a(l,f,h){var d;if(t[l].isActive===f)return Promise.resolve();(d=n.variantChildren)===null||d===void 0||d.forEach(v=>{var y;return(y=v.animationState)===null||y===void 0?void 0:y.setActive(l,f)}),t[l].isActive=f;const p=o(h,l);for(const v in t)t[v].protectedKeys={};return p}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t}}function uF(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!DP(e,n):!1}function la(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cF(){return{animate:la(!0),whileInView:la(),whileHover:la(),whileTap:la(),whileDrag:la(),whileFocus:la(),exit:la()}}class fF extends Xo{constructor(e){super(e),e.animationState||(e.animationState=lF(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),dg(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}let hF=0;class dF extends Xo{constructor(){super(...arguments),this.id=hF++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:i}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e,{custom:i??this.node.getProps().custom});t&&!e&&s.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const pF={animation:{Feature:fF},exit:{Feature:dF}},nE=(n,e)=>Math.abs(n-e);function mF(n,e){const t=nE(n.x,e.x),i=nE(n.y,e.y);return Math.sqrt(t**2+i**2)}class c3{constructor(e,t,{transformPagePoint:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Tv(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,d=mF(f.offset,{x:0,y:0})>=3;if(!h&&!d)return;const{point:p}=f,{timestamp:v}=zn;this.history.push({...p,timestamp:v});const{onStart:y,onMove:_}=this.handlers;h||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=bv(h,this.transformPagePoint),nn.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:p}=this.handlers,v=Tv(f.type==="pointercancel"?this.lastMoveEventInfo:bv(h,this.transformPagePoint),this.history);this.startEvent&&d&&d(f,v),p&&p(f,v)},!TP(e))return;this.handlers=t,this.transformPagePoint=i;const r=gg(e),s=bv(r,this.transformPagePoint),{point:o}=s,{timestamp:a}=zn;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Tv(s,this.history)),this.removeListeners=Io(Is(window,"pointermove",this.handlePointerMove),Is(window,"pointerup",this.handlePointerUp),Is(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Fs(this.updatePoint)}}function bv(n,e){return e?{point:e(n.point)}:n}function iE(n,e){return{x:n.x-e.x,y:n.y-e.y}}function Tv({point:n},e){return{point:n,delta:iE(n,f3(e)),offset:iE(n,gF(e)),velocity:vF(e,.1)}}function gF(n){return n[0]}function f3(n){return n[n.length-1]}function vF(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=f3(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>Do(e)));)t--;if(!i)return{x:0,y:0};const s=Ds(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Yi(n){return n.max-n.min}function Ax(n,e=0,t=.01){return Math.abs(n-e)<=t}function rE(n,e,t,i=.5){n.origin=i,n.originPoint=en(e.min,e.max,n.origin),n.scale=Yi(t)/Yi(e),(Ax(n.scale,1,1e-4)||isNaN(n.scale))&&(n.scale=1),n.translate=en(t.min,t.max,n.origin)-n.originPoint,(Ax(n.translate)||isNaN(n.translate))&&(n.translate=0)}function af(n,e,t,i){rE(n.x,e.x,t.x,i?i.originX:void 0),rE(n.y,e.y,t.y,i?i.originY:void 0)}function sE(n,e,t){n.min=t.min+e.min,n.max=n.min+Yi(e)}function yF(n,e,t){sE(n.x,e.x,t.x),sE(n.y,e.y,t.y)}function oE(n,e,t){n.min=e.min-t.min,n.max=n.min+Yi(e)}function lf(n,e,t){oE(n.x,e.x,t.x),oE(n.y,e.y,t.y)}function xF(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?en(t,n,i.max):Math.min(n,t)),n}function aE(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function _F(n,{top:e,left:t,bottom:i,right:r}){return{x:aE(n.x,t,r),y:aE(n.y,e,i)}}function lE(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=kf(e.min,e.max-i,n.min):i>r&&(t=kf(n.min,n.max-r,e.min)),Xa(0,1,t)}function MF(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const Ex=.35;function AF(n=Ex){return n===!1?n=0:n===!0&&(n=Ex),{x:uE(n,"left","right"),y:uE(n,"top","bottom")}}function uE(n,e,t){return{min:cE(n,e),max:cE(n,t)}}function cE(n,e){return typeof n=="number"?n:n[e]||0}const fE=()=>({translate:0,scale:1,origin:0,originPoint:0}),uf=()=>({x:fE(),y:fE()}),hE=()=>({min:0,max:0}),Mn=()=>({x:hE(),y:hE()});function Jr(n){return[n("x"),n("y")]}function h3({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function EF({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function bF(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function Cv(n){return n===void 0||n===1}function bx({scale:n,scaleX:e,scaleY:t}){return!Cv(n)||!Cv(e)||!Cv(t)}function xa(n){return bx(n)||d3(n)||n.z||n.rotate||n.rotateX||n.rotateY}function d3(n){return dE(n.x)||dE(n.y)}function dE(n){return n&&n!=="0%"}function Bm(n,e,t){const i=n-t,r=e*i;return t+r}function pE(n,e,t,i,r){return r!==void 0&&(n=Bm(n,r,i)),Bm(n,t,i)+e}function Tx(n,e=0,t=1,i,r){n.min=pE(n.min,e,t,i,r),n.max=pE(n.max,e,t,i,r)}function p3(n,{x:e,y:t}){Tx(n.x,e.translate,e.scale,e.originPoint),Tx(n.y,t.translate,t.scale,t.originPoint)}function TF(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;a1.0000000000001||n<.999999999999?n:1}function po(n,e){n.min=n.min+e,n.max=n.max+e}function gE(n,e,[t,i,r]){const s=e[r]!==void 0?e[r]:.5,o=en(n.min,n.max,s);Tx(n,e[t],e[i],o,e.scale)}const CF=["x","scaleX","originX"],PF=["y","scaleY","originY"];function ou(n,e){gE(n.x,e,CF),gE(n.y,e,PF)}function m3(n,e){return h3(bF(n.getBoundingClientRect(),e))}function LF(n,e,t){const i=m3(n,t),{scroll:r}=e;return r&&(po(i.x,r.offset.x),po(i.y,r.offset.y)),i}const RF=new WeakMap;class IF{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Mn(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=l=>{this.stopAnimation(),t&&this.snapToCursor(gg(l,"page").point)},s=(l,f)=>{const{drag:h,dragPropagation:d,onDragStart:p}=this.getProps();if(h&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=PP(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Jr(y=>{let _=this.getAxisMotionValue(y).get()||0;if(es.test(_)){const{projection:M}=this.visualElement;if(M&&M.layout){const m=M.layout.layoutBox[y];m&&(_=Yi(m)*(parseFloat(_)/100))}}this.originPoint[y]=_}),p&&nn.update(()=>p(l,f),!1,!0);const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(l,f)=>{const{dragPropagation:h,dragDirectionLock:d,onDirectionLock:p,onDrag:v}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:y}=f;if(d&&this.currentDirection===null){this.currentDirection=DF(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),v&&v(l,f)},a=(l,f)=>this.stop(l,f);this.panSession=new c3(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&nn.update(()=>s(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!qd(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=xF(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),{layout:i}=this.visualElement.projection||{},r=this.constraints;e&&ru(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=_F(i.layoutBox,e):this.constraints=!1,this.elastic=AF(t),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Jr(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=MF(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!ru(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=LF(i,r.root,this.visualElement.getTransformPagePoint());let o=SF(r.layout.layoutBox,s);if(t){const a=t(EF(o));this.hasMutatedConstraints=!!a,a&&(o=h3(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},f=Jr(h=>{if(!qd(h,t,this.currentDirection))return;let d=l&&l[h]||{};o&&(d={min:0,max:0});const p=r?200:1e6,v=r?40:1e7,y={type:"inertia",velocity:i?e[h]:0,bounceStiffness:p,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(h,y)});return Promise.all(f).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(F1(e,i,0,t))}stopAnimation(){Jr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t="_drag"+e.toUpperCase(),i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Jr(t=>{const{drag:i}=this.getProps();if(!qd(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-en(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!ru(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Jr(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();r[o]=wF({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Jr(o=>{if(!qd(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:f}=this.constraints[o];a.set(en(l,f,r[o]))})}addListeners(){if(!this.visualElement.current)return;RF.set(this.visualElement,this);const e=this.visualElement.current,t=Is(e,"pointerdown",l=>{const{drag:f,dragListener:h=!0}=this.getProps();f&&h&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();ru(l)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),i();const o=Ps(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f})=>{this.isDragging&&f&&(Jr(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=Ex,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function qd(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function DF(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class NF extends Xo{constructor(e){super(e),this.removeGroupControls=Tn,this.removeListeners=Tn,this.controls=new IF(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Tn}unmount(){this.removeGroupControls(),this.removeListeners()}}const vE=n=>(e,t)=>{n&&nn.update(()=>n(e,t))};class kF extends Xo{constructor(){super(...arguments),this.removePointerDownListener=Tn}onPointerDown(e){this.session=new c3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:vE(e),onStart:vE(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&nn.update(()=>r(s,o))}}}mount(){this.removePointerDownListener=Is(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function OF(){const n=H.useContext(w1);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=H.useId();return H.useEffect(()=>i(r),[]),!e&&t?[!1,()=>t&&t(r)]:[!0]}function yE(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const Ec={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(it.test(n))n=parseFloat(n);else return n;const t=yE(n,e.target.x),i=yE(n,e.target.y);return`${t}% ${i}%`}},UF={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=Uo.parse(n);if(r.length>5)return i;const s=Uo.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const f=en(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=f),typeof r[3+o]=="number"&&(r[3+o]/=f),s(r)}};class zF extends nh.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;GO(FF),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),rf.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||nn.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function g3(n){const[e,t]=OF(),i=H.useContext(hP);return nh.createElement(zF,{...n,layoutGroup:i,switchLayoutGroup:H.useContext(dP),isPresent:e,safeToRemove:t})}const FF={borderRadius:{...Ec,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ec,borderTopRightRadius:Ec,borderBottomLeftRadius:Ec,borderBottomRightRadius:Ec,boxShadow:UF},v3=["TopLeft","TopRight","BottomLeft","BottomRight"],BF=v3.length,xE=n=>typeof n=="string"?parseFloat(n):n,_E=n=>typeof n=="number"||it.test(n);function VF(n,e,t,i,r,s){r?(n.opacity=en(0,t.opacity!==void 0?t.opacity:1,HF(i)),n.opacityExit=en(e.opacity!==void 0?e.opacity:1,0,WF(i))):s&&(n.opacity=en(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;oie?1:t(kf(n,e,i))}function wE(n,e){n.min=e.min,n.max=e.max}function or(n,e){wE(n.x,e.x),wE(n.y,e.y)}function ME(n,e,t,i,r){return n-=e,n=Bm(n,1/t,i),r!==void 0&&(n=Bm(n,1/r,i)),n}function GF(n,e=0,t=1,i=.5,r,s=n,o=n){if(es.test(e)&&(e=parseFloat(e),e=en(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=en(s.min,s.max,i);n===s&&(a-=e),n.min=ME(n.min,e,t,a,r),n.max=ME(n.max,e,t,a,r)}function AE(n,e,[t,i,r],s,o){GF(n,e[t],e[i],e[r],e.scale,s,o)}const jF=["x","scaleX","originX"],XF=["y","scaleY","originY"];function EE(n,e,t,i){AE(n.x,e,jF,t?t.x:void 0,i?i.x:void 0),AE(n.y,e,XF,t?t.y:void 0,i?i.y:void 0)}function bE(n){return n.translate===0&&n.scale===1}function x3(n){return bE(n.x)&&bE(n.y)}function Cx(n,e){return n.x.min===e.x.min&&n.x.max===e.x.max&&n.y.min===e.y.min&&n.y.max===e.y.max}function TE(n){return Yi(n.x)/Yi(n.y)}class YF{constructor(){this.members=[]}add(e){B1(this.members,e),e.scheduleRender()}remove(e){if(V1(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function CE(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y;if((r||s)&&(i=`translate3d(${r}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{rotate:l,rotateX:f,rotateY:h}=t;l&&(i+=`rotate(${l}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `)}const o=n.x.scale*e.x,a=n.y.scale*e.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const qF=(n,e)=>n.depth-e.depth;class ZF{constructor(){this.children=[],this.isDirty=!1}add(e){B1(this.children,e),this.isDirty=!0}remove(e){V1(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qF),this.isDirty=!1,this.children.forEach(e)}}function JF(n,e){const t=performance.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(Fs(i),n(s-e))};return nn.read(i,!0),()=>Fs(i)}function KF(n){window.MotionDebug&&window.MotionDebug.record(n)}function QF(n){return n instanceof SVGElement&&n.tagName!=="svg"}function $F(n,e,t){const i=Ri(n)?n:Lu(n);return i.start(F1("",i,e,t)),i.animation}const PE=["","X","Y","Z"],LE=1e3;let e4=0;const _a={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function _3({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o,a={},l=e==null?void 0:e()){this.id=e4++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{_a.totalNodes=_a.resolvedTargetDeltas=_a.recalculatedProjection=0,this.nodes.forEach(i4),this.nodes.forEach(a4),this.nodes.forEach(l4),this.nodes.forEach(r4),KF(_a)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let f=0;fthis.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=JF(p,250),rf.hasAnimatedSinceResize&&(rf.hasAnimatedSinceResize=!1,this.nodes.forEach(IE))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&h&&(l||f)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeTargetChanged:v,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||h.getDefaultTransition()||d4,{onLayoutAnimationStart:M,onLayoutAnimationComplete:m}=h.getProps(),S=!this.targetLayout||!Cx(this.targetLayout,y)||v,w=!p&&v;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,w);const A={...o3(_,"layout"),onPlay:M,onComplete:m};(h.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else!p&&this.animationProgress===0&&IE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Fs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(u4),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const b=A/1e3;DE(d.x,o.x,b),DE(d.y,o.y,b),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(lf(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f4(this.relativeTarget,this.relativeTargetOrigin,p,b),w&&Cx(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Mn()),or(w,this.relativeTarget)),_&&(this.animationValues=h,VF(h,f,this.latestValues,b,S,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Fs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nn.update(()=>{rf.hasAnimatedSinceResize=!0,this.currentAnimation=$F(0,LE,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(LE),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:f,latestValues:h}=o;if(!(!a||!l||!f)){if(this!==o&&this.layout&&f&&S3(this.options.animationType,this.layout.layoutBox,f.layoutBox)){l=this.target||Mn();const d=Yi(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const p=Yi(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}or(a,l),ou(a,h),af(this.projectionDeltaWithTransform,this.layoutCorrected,a,h)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new YF),this.sharedNodes.get(o).add(a);const f=a.options.initialPromotionConfig;a.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const f=this.getStack();f&&f.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const f={};for(let h=0;h{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(RE),this.root.sharedNodes.clear()}}}function t4(n){n.updateLayout()}function n4(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?Jr(d=>{const p=o?t.measuredBox[d]:t.layoutBox[d],v=Yi(p);p.min=i[d].min,p.max=p.min+v}):S3(s,t.layoutBox,i)&&Jr(d=>{const p=o?t.measuredBox[d]:t.layoutBox[d],v=Yi(i[d]);p.max=p.min+v,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[d].max=n.relativeTarget[d].min+v)});const a=uf();af(a,i,t.layoutBox);const l=uf();o?af(l,n.applyTransform(r,!0),t.measuredBox):af(l,i,t.layoutBox);const f=!x3(a);let h=!1;if(!n.resumeFrom){const d=n.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:v}=d;if(p&&v){const y=Mn();lf(y,t.layoutBox,p.layoutBox);const _=Mn();lf(_,i,v.layoutBox),Cx(y,_)||(h=!0),d.options.layoutRoot&&(n.relativeTarget=_,n.relativeTargetOrigin=y,n.relativeParent=d)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:f,hasRelativeTargetChanged:h})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function i4(n){_a.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function r4(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function s4(n){n.clearSnapshot()}function RE(n){n.clearMeasurements()}function o4(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function IE(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0}function a4(n){n.resolveTargetDelta()}function l4(n){n.calcProjection()}function u4(n){n.resetRotation()}function c4(n){n.removeLeadSnapshot()}function DE(n,e,t){n.translate=en(e.translate,0,t),n.scale=en(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function NE(n,e,t,i){n.min=en(e.min,t.min,i),n.max=en(e.max,t.max,i)}function f4(n,e,t,i){NE(n.x,e.x,t.x,i),NE(n.y,e.y,t.y,i)}function h4(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const d4={duration:.45,ease:[.4,0,.1,1]};function p4(n,e){let t=n.root;for(let s=n.path.length-1;s>=0;s--)if(n.path[s].instance){t=n.path[s];break}const r=(t&&t!==n.root?t.instance:document).querySelector(`[data-projection-id="${e}"]`);r&&n.mount(r,!0)}function kE(n){n.min=Math.round(n.min),n.max=Math.round(n.max)}function m4(n){kE(n.x),kE(n.y)}function S3(n,e,t){return n==="position"||n==="preserve-aspect"&&!Ax(TE(e),TE(t),.2)}const g4=_3({attachResizeListener:(n,e)=>Ps(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Pv={current:void 0},w3=_3({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!Pv.current){const n=new g4(0,{});n.mount(window),n.setOptions({layoutScroll:!0}),Pv.current=n}return Pv.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),v4={pan:{Feature:kF},drag:{Feature:NF,ProjectionNode:w3,MeasureLayout:g3}},y4=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function x4(n){const e=y4.exec(n);if(!e)return[,];const[,t,i]=e;return[t,i]}function Px(n,e,t=1){const[i,r]=x4(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():gx(r)?Px(r,e,t+1):r}function _4(n,{...e},t){const i=n.current;if(!(i instanceof Element))return{target:e,transitionEnd:t};t&&(t={...t}),n.values.forEach(r=>{const s=r.get();if(!gx(s))return;const o=Px(s,i);o&&r.set(o)});for(const r in e){const s=e[r];if(!gx(s))continue;const o=Px(s,i);o&&(e[r]=o,t||(t={}),t[r]===void 0&&(t[r]=s))}return{target:e,transitionEnd:t}}const S4=new Set(["width","height","top","left","right","bottom","x","y"]),M3=n=>S4.has(n),w4=n=>Object.keys(n).some(M3),OE=n=>n===tl||n===it,UE=(n,e)=>parseFloat(n.split(", ")[e]),zE=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/);if(r)return UE(r[1],e);{const s=i.match(/^matrix\((.+)\)$/);return s?UE(s[1],n):0}},M4=new Set(["x","y","z"]),A4=uh.filter(n=>!M4.has(n));function E4(n){const e=[];return A4.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e.length&&n.render(),e}const FE={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:zE(4,13),y:zE(5,14)},b4=(n,e,t)=>{const i=e.measureViewportBox(),r=e.current,s=getComputedStyle(r),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",n.display||"block"),t.forEach(f=>{a[f]=FE[f](i,s)}),e.render();const l=e.measureViewportBox();return t.forEach(f=>{const h=e.getValue(f);h&&h.jump(a[f]),n[f]=FE[f](l,s)}),n},T4=(n,e,t={},i={})=>{e={...e},i={...i};const r=Object.keys(e).filter(M3);let s=[],o=!1;const a=[];if(r.forEach(l=>{const f=n.getValue(l);if(!n.hasValue(l))return;let h=t[l],d=Ac(h);const p=e[l];let v;if(km(p)){const y=p.length,_=p[0]===null?1:0;h=p[_],d=Ac(h);for(let M=_;M=0?window.pageYOffset:null,f=b4(e,n,a);return s.length&&s.forEach(([h,d])=>{n.getValue(h).set(d)}),n.render(),hg&&l!==null&&window.scrollTo({top:l}),{target:f,transitionEnd:i}}else return{target:e,transitionEnd:i}};function C4(n,e,t,i){return w4(e)?T4(n,e,t,i):{target:e,transitionEnd:i}}const P4=(n,e,t,i)=>{const r=_4(n,e,i);return e=r.target,i=r.transitionEnd,C4(n,e,t,i)},Lx={current:null},A3={current:!1};function L4(){if(A3.current=!0,!!hg)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>Lx.current=n.matches;n.addListener(e),e()}else Lx.current=!1}function R4(n,e,t){const{willChange:i}=e;for(const r in e){const s=e[r],o=t[r];if(Ri(s))n.addValue(r,s),Fm(i)&&i.add(r);else if(Ri(o))n.addValue(r,Lu(s,{owner:n})),Fm(i)&&i.remove(r);else if(o!==s)if(n.hasValue(r)){const a=n.getValue(r);!a.hasAnimated&&a.set(s)}else{const a=n.getStaticValue(r);n.addValue(r,Lu(a!==void 0?a:s,{owner:n}))}}for(const r in t)e[r]===void 0&&n.removeValue(r);return e}const BE=new WeakMap,E3=Object.keys(Df),I4=E3.length,VE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],D4=A1.length;class N4{constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>nn.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=pg(t),this.isVariantNode=cP(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(t,{});for(const d in h){const p=h[d];a[d]!==void 0&&Ri(p)&&(p.set(a[d],!1),Fm(f)&&f.add(d))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,BE.set(e,this),this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),A3.current||L4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Lx.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){BE.delete(this.current),this.projection&&this.projection.unmount(),Fs(this.notifyUpdate),Fs(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const i=el.has(e),r=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&nn.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...t},i,r,s,o){let a,l;for(let f=0;fthis.scheduleRender(),animationType:typeof h=="string"?h:"both",initialPromotionConfig:o,layoutScroll:v,layoutRoot:y})}return l}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update(this.props,this.prevProps):(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Mn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;it.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=Lu(t,{owner:this}),this.addValue(e,i)),i}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props,r=typeof i=="string"||typeof i=="object"?(t=I1(this.props,i))===null||t===void 0?void 0:t[e]:void 0;if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Ri(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new H1),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class b3 extends N4{sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...i},{transformValues:r},s){let o=eF(i,e||{},this);if(r&&(t&&(t=r(t)),i&&(i=r(i)),o&&(o=r(o))),s){Qz(this,i,o);const a=P4(this,i,o,t);t=a.transitionEnd,i=a.target}return{transition:e,transitionEnd:t,...i}}}function k4(n){return window.getComputedStyle(n)}class O4 extends b3{readValueFromInstance(e,t){if(el.has(t)){const i=U1(t);return i&&i.default||0}else{const i=k4(e),r=(gP(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return m3(e,t)}build(e,t,i,r){b1(e,t,i,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return R1(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ri(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(e,t,i,r){wP(e,t,i,r)}}class U4 extends b3{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(el.has(t)){const i=U1(t);return i&&i.default||0}return t=MP.has(t)?t:L1(t),e.getAttribute(t)}measureInstanceViewportBox(){return Mn()}scrapeMotionValuesFromProps(e,t){return EP(e,t)}build(e,t,i,r){C1(e,t,i,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,i,r){AP(e,t,i,r)}mount(e){this.isSVGTag=P1(e.tagName),super.mount(e)}}const z4=(n,e)=>E1(n)?new U4(e,{enableHardwareAcceleration:!1}):new O4(e,{enableHardwareAcceleration:!0}),F4={layout:{ProjectionNode:w3,MeasureLayout:g3}},B4={...pF,...NU,...v4,...F4},sn=HO((n,e)=>vU(n,e,B4,z4)),jt={paddingX:"sm:px-16 px-6",paddingY:"sm:py-16 py-6",padding:"sm:px-16 px-6 sm:py-16 py-10",heroHeadText:"font-black text-[#373737] lg:text-[80px] sm:text-[60px] xs:text-[50px] text-[40px] lg:leading-[98px] mt-2",heroSubText:"text-[#dfd9ff] font-medium lg:text-[30px] sm:text-[26px] xs:text-[20px] text-[16px] lg:leading-[40px]",sectionHeadText:"text-black font-black md:text-[60px] sm:text-[50px] xs:text-[40px] text-[30px]",sectionSubText:"sm:text-[18px] text-[14px] text-secondary uppercase tracking-wider"},V4="/portfolio-react-threejs/assets/web-0c6824d5.webp",H4="/portfolio-react-threejs/assets/mobile-84df6906.webp",W4="/portfolio-react-threejs/assets/creator-ab86683b.webp",G4="/portfolio-react-threejs/assets/csi-1f769921.webp",j4="/portfolio-react-threejs/assets/msc-abe50c5d.webp",X4="/portfolio-react-threejs/assets/techyv-adede69e.webp",Y4="/portfolio-react-threejs/assets/shapeout-d15c331a.webp",q4="/portfolio-react-threejs/assets/facedetection-65dc0246.webp",Z4="/portfolio-react-threejs/assets/Hi-783be2bb.webp",J4="/portfolio-react-threejs/assets/langgo-41707292.webp",K4="/portfolio-react-threejs/assets/lifeoverseas-fd137d40.webp",Q4="/portfolio-react-threejs/assets/velox-429d856c.webp",$4="/portfolio-react-threejs/assets/yolo-9ff20b51.webp",eB="/portfolio-react-threejs/assets/anon_exchange-3f3d612c.webp",tB="/portfolio-react-threejs/assets/banana_class-8925bee5.webp",nB="/portfolio-react-threejs/assets/convogen-ba953cbd.webp",iB="/portfolio-react-threejs/assets/1-710ab004.webp",rB="/portfolio-react-threejs/assets/2-bd31252c.webp",sB="/portfolio-react-threejs/assets/3-da0bbfbc.webp",oB="/portfolio-react-threejs/assets/4-8d092131.webp",aB="/portfolio-react-threejs/assets/5-b3191ff5.webp",lB="/portfolio-react-threejs/assets/6-b412236c.webp",uB="/portfolio-react-threejs/assets/7-21761f9b.webp",cB="/portfolio-react-threejs/assets/8-b4888019.webp",fB="/portfolio-react-threejs/assets/9-22d557f1.webp",hB="/portfolio-react-threejs/assets/1-bc4e4556.webp",dB="/portfolio-react-threejs/assets/2-466546d5.webp",pB="/portfolio-react-threejs/assets/1-c8ded170.webp",HE=[{id:"",title:"Home",type:"route"},{id:"projects",title:"Projects",type:"route"},{id:"skills",title:"Skills",type:"route"},{id:"certificate",title:"Certificates",type:"route"},{id:"resume",title:"Resume",type:"route"},{id:"blogs",title:"Blogs",type:"route"},{id:"contact",title:"Contact",type:"route"},{id:"freetools",title:"Free Tools",type:"tools"}],mB=[{id:"downloadtube",title:"DownloadTube (Youtube Downloader)",type:"video",url:"https://downloadtube-iota.vercel.app/"}],gB=[{title:"Full Stack Web Development",icon:V4},{title:"Designing",icon:W4},{title:"ML and DL Learner",icon:H4}],vB=[{title:"Content Writer",company_name:"Techyv",icon:X4,iconBg:"white",date:"October 2023 - Ongoing",points:["Writing Professional articles related to IT.","Ensuring use of no AI content in articles.","Creating articles on real facts and data."]},{title:"Technical member",company_name:"Microsoft Student Chapter",icon:j4,iconBg:"black",date:"October 2022 - March 2023",points:["Maintaining the website and ensuring that it is up-to-date and functioning properly.","Collaborating with other members of the chapter to identify areas for improvement on the website.","Implementing changes and updates to the website using programming languages such as React.js, tailwind and JavaScript.","Debugging any issues or errors that arise on the website and working to resolve them."]},{title:"V open source member",company_name:"CSI Chapter",icon:G4,iconBg:"white",date:"Augest 2021 - June 2022",points:["Conducting regular meetings to discuss open source projects and new initiatives.","Conducting workshops and training sessions to help members learn more about open source technologies.","Coordinating with other teams within the CSI chapter to ensure smooth execution of events."]}],yB=[{name:"ConvoGen AI",description:"'ConvoGen' is the virtual embodiment of me, a chatbot that offers lifelike insights and information about my experiences, interests, and personality. Engage in conversations that feel as real as speaking with me in person, as 'ConvoGen' shares a wealth of personal details and knowledge, creating a truly immersive and authentic chatbot experience.",tags:[{name:"T5 model",color:"blue-text-gradient"},{name:"Transformer",color:"green-text-gradient"},{name:"Colab",color:"pink-text-gradient"}],image:nB,source_code_link:"https://colab.research.google.com/drive/1a6LATySYKaS8qqfk_4maSaV4guvTRA-8?usp=sharing",date:"October 2023",link_type:"colab"},{name:"Anon Exchange - Anonymous chatting app",description:"An innovative anonymous chatting app that redefines digital interactions. This project empowers strangers to connect seamlessly, engaging in candid conversations without the constraints of identity. What sets us apart is our commitment to privacy, allowing users to create exclusive private chat rooms for confidential discussions.",tags:[{name:"vitejs",color:"blue-text-gradient"},{name:"supabase",color:"green-text-gradient"},{name:"tailwind CSS",color:"pink-text-gradient"}],image:eB,source_code_link:"https://github.com/bedead/Anon-Exchange-chatting",date:"August 2023",link_type:"github"},{name:"Banana disease classification",description:"Banana disease classification is a project that uses a YOLOv8 deep learning model to detect and identify various diseases affecting banana plants. The project is based on a custom dataset of images of banana leaves with different types of infections. The project aims to provide a fast and accurate diagnosis of banana diseases, which can help farmers and researchers to prevent crop losses and improve banana production.",tags:[{name:"YOLOv8",color:"green-text-gradient"},{name:"Colab",color:"pink-text-gradient"}],image:tB,source_code_link:"https://colab.research.google.com/drive/1TLumA28dCY-9_lzouIJtt2CsCjONGdNy?usp=sharing",date:"August 2023",link_type:"colab"},{name:"PATENT - CLASSIFICATION OF LUNG CANCER USING DEEP LEARNING TECHNIQUES.",description:"Application No - 202341039647 The model is based on a YOLOv8 (Deep learning Neural network architecture) and is trained on the publicly available dataset, which consists of lung CT scans of patients with and without lung cancer.",tags:[{name:"Gradio",color:"blue-text-gradient"},{name:"YOLO",color:"green-text-gradient"},{name:"Roboflow",color:"pink-text-gradient"}],image:$4,source_code_link:"https://github.com/bedead/lung-cancer-classification-yoloV8---gradio.git",date:"June 2023",link_type:"huggingface"},{name:"Face Detection",description:"'FACE-DETECTOR' is a GitHub repository showcasing an OpenCV project for detecting human faces using a cascade classifier. The project utilizes the OpenCV library, which is a popular computer vision library in Python, to detect human faces in images or video streams.",tags:[{name:"Cascade classifier",color:"blue-text-gradient"},{name:"Python",color:"green-text-gradient"},{name:"OpenCV",color:"pink-text-gradient"}],image:q4,source_code_link:"https://github.com/bedead/FACE-DETECTOR.git",date:"Feb 2023",link_type:"github"},{name:"Life Overseas",description:"Life Overseas is a concept website that aims to provide students with valuable resources and information to successfully clear entrance exams for foreign colleges.",tags:[{name:"Flask",color:"blue-text-gradient"},{name:"Python",color:"green-text-gradient"}],image:K4,source_code_link:"https://github.com/bedead/Life-Overseas-webiste.git",date:"Jan 2023",link_type:"github"},{name:"Velox Todo",description:"Velox Todo is a Windows application built using JavaFX and JSON files. It is a task management tool designed to help users organize and prioritize their daily tasks efficiently.",tags:[{name:"Java",color:"blue-text-gradient"},{name:"JavaFX",color:"green-text-gradient"},{name:"JSON",color:"pink-text-gradient"}],image:Q4,source_code_link:"https://github.com/bedead/Velox-Todo-Application.git",date:"Sep 2022",link_type:"github"},{name:"HI",description:"'HI' is a console-based conversational app written in Python. It utilizes various libraries such as pyinstaller, pyjokes, PyDictionary, platform, psutil, requests, getpass, pywhatkit, pyttsx3, speechrecognition, Wikipedia, Pyaudio, speedtest-cli, pyautogui, and py-cpuinfo to provide a wide range of functionalities.",tags:[{name:"Python",color:"blue-text-gradient"},{name:"JSON",color:"green-text-gradient"}],image:Z4,source_code_link:"https://github.com/bedead/HI_2021.12.22.4.git",date:"Mar 2022",link_type:"github"},{name:"Lang go",description:"'Lang Go' is a language translation app that is built using the Kivy and KivyMD frameworks in Python. The app utilizes the TextBlob library for translation capabilities. With 'Lang Go', users can input text in one language and translate it to another language seamlessly.",tags:[{name:"Kivy",color:"blue-text-gradient"},{name:"Kivymd",color:"green-text-gradient"},{name:"textBlob",color:"pink-text-gradient"}],image:J4,source_code_link:"https://github.com/bedead/kivymd-language-translation-app.git",date:"Mar 2022",link_type:"github"},{name:"Shape out",description:"'Shape Out' is a 2D platformer game available on Amazon, created using the Godot game engine. The game features intuitive controls, colorful graphics, and engaging gameplay that requires players to jump, run, and solve puzzles to progress through the levels.",tags:[{name:"Godot engine",color:"blue-text-gradient"},{name:"GD-script",color:"green-text-gradient"}],image:Y4,source_code_link:"https://www.amazon.com/Bedead-Shape-Out-2d-platformer/dp/B0999LHBYN",date:"Aug 2021",link_type:"appstore"}],xB=[{name:"Basics of Machien Learing",image:iB},{name:"C++ Course",image:rB},{name:"Making a Webiste",image:sB},{name:"Java (Basics)",image:oB},{name:"Matlab Onramp",image:aB},{name:"MongoDB Tutorial",image:lB},{name:"Python (Basics)",image:uB},{name:"Responsive Web Design Course",image:cB},{name:"TensorFlow Python",image:fB}],_B=[{name:"Technical Member | CSI ",image:hB},{name:"Technical Member | MSC",image:dB}],SB=[{name:" Google Cloud Digital Leader",image:pB}],wB="/portfolio-react-threejs/assets/logo-white-f51edd31.webp",MB="data:image/webp;base64,UklGRmQCAABXRUJQVlA4WAoAAAAwAAAAOwAAOwAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBIPwAAAAFHoJBtBOime96H8WhEROhZb4CaSFYrLDAowA0OUIAD/DffJB2TJqL/AoIiF6yAJSV4nAc6xy/oOftIb+woAABWUDggLgAAAJADAJ0BKjwAPAA+bTaYSSQjIqEiCACADYlpAAAQN1NQBXiFuQAA/vucwAAAAAA=",AB="data:image/webp;base64,UklGRvwCAABXRUJQVlA4WAoAAAAwAAAALwAALwAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBI2wAAAAF3oKCNFDb4bDxgYMkjIgJHTaxUSfkkcBTJtqu8T84gJEpAwheABSQkIVEIq7R9a7KCV9fDr3duIK4j+s/IbSRFteDDwEL9wv2lo6Ml4bmW5Yx2LFuayjlSHbMnX5SSBupihiFD9llir3CgZ1kYDzTJ3kFCU0RWRlZBUkNShavDNYBaiBpKPpEPNHbOBNMwbBnHf5bVaQj8s1jnu6bgL451auP4i+PPNol1WsQ6TerwAhGDOrxvjqoF7FtC0cKefFFKGqiLWcS+ZarsDc4wLgwv+Rt0tC4S948OBwBWUDggKgAAADADAJ0BKjAAMAA+bTaYSKQjIqEjiACADYlpAAAbgb0+DgAA/vucwAAAAA==",ts=n=>({hidden:{y:-50,opacity:0},show:{y:0,opacity:1,transition:{type:"spring",duration:1.25,delay:n}}}),Yo=(n,e,t,i)=>({hidden:{x:n==="left"?100:n==="right"?-100:0,y:n==="up"?100:n==="down"?-100:0,opacity:0},show:{x:0,y:0,opacity:1,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),EB=(n,e,t,i)=>({hidden:{x:n==="left"?"-100%":n==="right"?"100%":0,y:n==="up"||n==="down"?"100%":0},show:{x:0,y:0,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),bB=(n,e)=>({hidden:{},show:{transition:{staggerChildren:n,delayChildren:e||0}}}),Gs=()=>{const[n,e]=H.useState(""),[t,i]=H.useState(!1),[r,s]=H.useState(!1);return F.jsx("nav",{className:`${jt.paddingX} w-full flex items-center py-5 fixed top-0 z-20 bg-gradient-to-b from-white to-primary`,children:F.jsxs("div",{className:"w-full flex justify-between items-center max-w-7xl mx-auto",children:[F.jsxs(vv,{to:"/",className:"flex items-center gap-2",onClick:()=>{e(""),window.scrollTo(0,0)},children:[F.jsx("img",{src:wB,className:"w-10 h-10 object-contain",alt:"logo"}),F.jsxs("div",{className:" md:block lg:flex ",children:[F.jsx("p",{className:"text-black text-[18px] flex",children:"Satyam Mishra  "}),F.jsx("span",{className:"text-[18px] sm:block hidden",children:"| Bedead"})]})]}),F.jsxs("ul",{className:"list-none hidden sm:flex flex-row md:gap-4 items-center",children:[HE.map(o=>F.jsx("li",{className:o.type=="tools"?"bg-black text-white hover:text-white-100 hover:bg-secondary py-2 px-3 rounded-xl text-[18px] font-medium cursor-pointer":`${n==o.title?"text-black":"text-secondary"} - hover:text-black hover:underline underline-offset-8 text-[18px] font-medium cursor-pointer`,onClick:()=>{e(o.title),o.type=="tools"&&s(!r)},children:o.type=="tools"?o.title:F.jsxs(vv,{to:`/${o.id}`,children:[o.title," "]})},o.id))," "]}),F.jsx("div",{className:`${r?"flex":"hidden"} p-6 bg-gradient-to-r from-[#f6f6f6] to-white absolute - top-60 right-40 sm:top-20 sm:right-5 mx-4 my-2 min-w-[140px] z-10 rounded-xl outline`,children:F.jsxs("ul",{className:"list-none flex justify-end items-start flex-col gap-2",children:[mB.map(o=>F.jsx(sn.li,{variants:Yo("right","spring",.1,.75),className:`${n==o.title?"text-black":"text-secondary"} font-poppins hover:underline underline-offset-8 font-medium cursor-pointer text-[16px] hover:text-black`,onClick:()=>{s(!r),e(o.title),window.open(o.url,"_blank")},children:o.title},o.id))," "]})}),F.jsxs("div",{className:"sm:hidden flex flex-1 justify-end items-center",children:[F.jsx("img",{src:t?AB:MB,alt:"menu",className:"w-[28px] h-[28px] object-contain cursor-pointer",onClick:()=>i(!t)}),F.jsx("div",{className:`${t?"flex":"hidden"} p-6 bg-gradient-to-r from-[#f6f6f6] to-white absolute - top-20 right-0 mx-4 my-2 min-w-[140px] z-10 rounded-xl outline`,children:F.jsxs("ul",{className:"list-none flex justify-end items-start flex-col gap-2",children:[HE.map(o=>F.jsx("li",{className:`${n==o.title?"text-black":"text-secondary"} font-poppins hover:underline underline-offset-8 font-medium cursor-pointer text-[16px] hover:text-black`,onClick:()=>{o.type!="tools"&&i(!t),e(o.title),o.type=="tools"&&s(!r)},children:o.type=="tools"?o.title:F.jsxs(vv,{to:`/${o.id}`,children:[o.title," "]})},o.id))," "]})})]})]})})},js=(n,e)=>function(){return F.jsxs(sn.section,{variants:bB(),initial:"hidden",whileInView:"show",viewport:{once:!0,amount:0},exit:"hidden",className:`${jt.padding} max-w-7xl mx-auto relative z-0`,children:[F.jsx("span",{className:"hash-span",id:e,children:" "}),F.jsx(n,{})]})},TB=()=>{const n="Hi, I'm Satyam";return F.jsxs("section",{className:"relative w-full h-screen mx-auto overflow-hidden",children:[F.jsxs("div",{className:`${jt.paddingX} flex absolute z-10 inset-0 top-[120px] items-start gap-5`,children:[F.jsxs("div",{className:"flex flex-col justify-center items-center mt-5",children:[F.jsx("div",{className:"w-5 h-5 rounded-full bg-[#373737] "}),F.jsx("div",{className:"w-1 sm:h-80 h-40 violet-gradient"})]}),F.jsxs("div",{children:[F.jsx(sn.h1,{variants:ts(0),className:`${jt.heroHeadText} funky-text-outline-2 `,children:n}),F.jsxs(sn.div,{variants:Yo("","",.1,1),children:[F.jsx("p",{className:`${jt.heroSubText} funky-text-outline mt-2 text-black-100`,children:"I'm a computer science student with simple and dumb mind."}),F.jsx("p",{className:`${jt.sectionSubText} mt-2 text-gray-600`,children:"This is just a website showcasing some of my works and experiments. Have a look untill you get bored 🥱"})]})]})]}),F.jsx("div",{className:"absolute z-10 xs:bottom-10 bottom-32 w-full flex justify-center items-center",children:F.jsx("a",{href:"#about",children:F.jsx("div",{className:"w-[35px] h-[64px] rounded-3xl border-4 border-[#373737] flex justify-center items-start p-2 ",children:F.jsx(sn.div,{animate:{y:[0,24,0]},transition:{duration:1.5,repeat:1/0,repeatType:"loop"},className:"w-3 h-3 rounded-full bg-secondary mb-2"})})})})]})},CB=js(TB,"Hero");var PB=Object.defineProperty,LB=Object.defineProperties,RB=Object.getOwnPropertyDescriptors,WE=Object.getOwnPropertySymbols,IB=Object.prototype.hasOwnProperty,DB=Object.prototype.propertyIsEnumerable,GE=(n,e,t)=>e in n?PB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,bc=(n,e)=>{for(var t in e||(e={}))IB.call(e,t)&&GE(n,t,e[t]);if(WE)for(var t of WE(e))DB.call(e,t)&&GE(n,t,e[t]);return n},Tc=(n,e)=>LB(n,RB(e)),xg=class extends H.Component{constructor(n){super(n),this.ref=nh.createRef(),this.state={style:{}};const e={reverse:!1,max:35,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:"1.1",speed:"1000",transition:!0,axis:null,reset:!0};this.width=null,this.height=null,this.left=null,this.top=null,this.transitionTimeout=null,this.updateCall=null,this.element=null,this.settings=Object.assign({},e,this.props.options),this.reverse=this.settings.reverse?-1:1,this.onMouseEnter=this.onMouseEnter.bind(this,this.props.onMouseEnter),this.onMouseMove=this.onMouseMove.bind(this,this.props.onMouseMove),this.onMouseLeave=this.onMouseLeave.bind(this,this.props.onMouseLeave)}componentDidMount(){this.element=this.ref.current,setTimeout(()=>{this.element.parentElement.querySelector(":hover")===this.element&&this.onMouseEnter()},0)}componentWillUnmount(){clearTimeout(this.transitionTimeout),cancelAnimationFrame(this.updateCall)}onMouseEnter(n=()=>{},e){return this.updateElementPosition(),this.setState(Object.assign({},this.state,{style:Tc(bc({},this.state.style),{willChange:"transform"})})),this.setTransition(),n(e)}reset(){window.requestAnimationFrame(()=>{this.setState(Object.assign({},this.state,{style:Tc(bc({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`})}))})}onMouseMove(n=()=>{},e){return e.persist(),this.updateCall!==null&&window.cancelAnimationFrame(this.updateCall),this.event=e,this.updateCall=requestAnimationFrame(this.update.bind(this,e)),n(e)}setTransition(){clearTimeout(this.transitionTimeout),this.setState(Object.assign({},this.state,{style:Tc(bc({},this.state.style),{transition:`${this.settings.speed}ms ${this.settings.easing}`})})),this.transitionTimeout=setTimeout(()=>{this.setState(Object.assign({},this.state,{style:Tc(bc({},this.state.style),{transition:""})}))},this.settings.speed)}onMouseLeave(n=()=>{},e){return this.setTransition(),this.settings.reset&&this.reset(),n(e)}getValues(n){const e=(n.nativeEvent.clientX-this.left)/this.width,t=(n.nativeEvent.clientY-this.top)/this.height,i=Math.min(Math.max(e,0),1),r=Math.min(Math.max(t,0),1),s=(this.reverse*(this.settings.max/2-i*this.settings.max)).toFixed(2),o=(this.reverse*(r*this.settings.max-this.settings.max/2)).toFixed(2),a=i*100,l=r*100;return{tiltX:s,tiltY:o,percentageX:a,percentageY:l}}updateElementPosition(){const n=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=n.left,this.top=n.top}update(n){const e=this.getValues(n);this.setState(Object.assign({},this.state,{style:Tc(bc({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(${this.settings.axis==="x"?0:e.tiltY}deg) rotateY(${this.settings.axis==="y"?0:e.tiltX}deg) scale3d(${this.settings.scale}, ${this.settings.scale}, ${this.settings.scale})`})})),this.updateCall=null}render(){const n=Object.assign({},this.props.style,this.state.style);return F.jsx("div",{style:n,ref:this.ref,className:this.props.className,onMouseEnter:this.onMouseEnter,onMouseMove:this.onMouseMove,onMouseLeave:this.onMouseLeave,children:this.props.children})}};const NB=({index:n,title:e,icon:t})=>F.jsx(xg,{className:"xs:w-[250px] w-full ",children:F.jsx(sn.div,{variants:Yo("right","spring",.5*n,.75),className:" w-full green-pink-gradient p-[1px] rounded-[20px] shadow-[#fcd4d4] shadow-card ",children:F.jsxs("div",{options:{max:45,scale:1,speed:450},className:"bg-primary rounded-[20px] py-5 px-12 min-h-[280px] flex justify-evenly items-center flex-col ",children:[F.jsx("img",{src:t,alt:e,className:"w-16 h-16 object-contain"}),F.jsxs("h3",{className:"text-black text-[20px] font-bold text-center ",children:[e," "]})]})})}),kB=()=>F.jsxs(F.Fragment,{children:[F.jsxs(sn.div,{variants:ts(0),children:[F.jsx("h2",{className:`${jt.sectionHeadText} text-center`,children:"Overview."}),F.jsx("p",{className:`${jt.sectionSubText} text-center`,children:"Introduction?"})]}),F.jsx(sn.p,{variants:Yo("","",.1,1),className:"mt-4 text-secondary text-center text-[17px] max-w-full leading-[30px] ",children:"I am a full stack web developer, graphic designer, and machine learning enthusiast. I have experience in creating dynamic and responsive websites using HTML, CSS, JavaScript, and other frameworks. I also have a passion for designing graphics that are eye-catching and appealing. I am always eager to learn new skills and technologies in the field of machine learning and deep learning. I have completed several projects and courses on various topics such as computer vision, and natural language processing."}),F.jsxs("div",{className:"mt-20 flex flex-wrap justify-center gap-10",children:[gB.map((n,e)=>F.jsx(NB,{index:e,...n},n.title))," "]})]}),OB=js(kB,"about");var _g={},T3={exports:{}},UB="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",zB=UB,FB=zB;function C3(){}function P3(){}P3.resetWarningCache=C3;var BB=function(){function n(i,r,s,o,a,l){if(l!==FB){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:P3,resetWarningCache:C3};return t.PropTypes=t,t};T3.exports=BB();var L3=T3.exports,R3={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var i=[],r=0;r(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",i),VB.default.createElement("div",{className:(0,HB.default)(e,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":t==="2-columns","vertical-timeline--one-column-left":t==="1-column"||t==="1-column-left","vertical-timeline--one-column-right":t==="1-column-right"})},r));D3.propTypes={children:io.default.oneOfType([io.default.arrayOf(io.default.node),io.default.node]).isRequired,className:io.default.string,animate:io.default.bool,layout:io.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:io.default.string};var WB=D3;_g.default=WB;var Sg={};function Rx(){return Rx=Object.assign||function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}var Dx=new Map,Zd=new WeakMap,jE=0,N3=void 0;function XB(n){N3=n}function YB(n){return n?(Zd.has(n)||(jE+=1,Zd.set(n,jE.toString())),Zd.get(n)):"0"}function qB(n){return Object.keys(n).sort().filter(function(e){return n[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?YB(n.root):n[e])}).toString()}function ZB(n){var e=qB(n),t=Dx.get(e);if(!t){var i=new Map,r,s=new IntersectionObserver(function(o){o.forEach(function(a){var l,f=a.isIntersecting&&r.some(function(h){return a.intersectionRatio>=h});n.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=f),(l=i.get(a.target))==null||l.forEach(function(h){h(f,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},Dx.set(e,t)}return t}function G1(n,e,t,i){if(t===void 0&&(t={}),i===void 0&&(i=N3),typeof window.IntersectionObserver>"u"&&i!==void 0){var r=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=ZB(t),o=s.id,a=s.observer,l=s.elements,f=l.get(n)||[];return l.has(n)||l.set(n,f),f.push(e),a.observe(n),function(){f.splice(f.indexOf(e),1),f.length===0&&(l.delete(n),a.unobserve(n)),l.size===0&&(a.disconnect(),Dx.delete(o))}}var JB=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function XE(n){return typeof n.children!="function"}var Vm=function(n){GB(e,n);function e(i){var r;return r=n.call(this,i)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,o){s&&r.props.triggerOnce&&r.unobserve(),XE(r.props)||r.setState({inView:s,entry:o}),r.props.onChange&&r.props.onChange(s,o)},r.state={inView:!!i.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,o=r.root,a=r.rootMargin,l=r.trackVisibility,f=r.delay,h=r.fallbackInView;this._unobserveCb=G1(this.node,this.handleChange,{threshold:s,root:o,rootMargin:a,trackVisibility:l,delay:f},h)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!XE(this.props)){var r=this.state,s=r.inView,o=r.entry;return this.props.children({inView:s,entry:o,ref:this.handleNode})}var a=this.props,l=a.children,f=a.as,h=jB(a,JB);return H.createElement(f||"div",Rx({ref:this.handleNode},h),l)},e}(H.Component);Vm.displayName="InView";Vm.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function KB(n){var e=n===void 0?{}:n,t=e.threshold,i=e.delay,r=e.trackVisibility,s=e.rootMargin,o=e.root,a=e.triggerOnce,l=e.skip,f=e.initialInView,h=e.fallbackInView,d=H.useRef(),p=H.useState({inView:!!f}),v=p[0],y=p[1],_=H.useCallback(function(m){d.current!==void 0&&(d.current(),d.current=void 0),!l&&m&&(d.current=G1(m,function(S,w){y({inView:S,entry:w}),w.isIntersecting&&a&&d.current&&(d.current(),d.current=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:r,delay:i},h))},[Array.isArray(t)?t.toString():t,o,s,a,l,r,h,i]);H.useEffect(function(){!d.current&&v.entry&&!a&&!l&&y({inView:!!f})});var M=[_,v.inView,v.entry];return M.ref=M[0],M.inView=M[1],M.entry=M[2],M}const QB=Object.freeze(Object.defineProperty({__proto__:null,InView:Vm,default:Vm,defaultFallbackInView:XB,observe:G1,useInView:KB},Symbol.toStringTag,{value:"Module"})),$B=iD(QB);Sg.__esModule=!0;Sg.default=void 0;var ro=j1(H),Jt=j1(L3),Jd=j1(I3),e5=$B;function j1(n){return n&&n.__esModule?n:{default:n}}const k3=({children:n="",className:e="",contentArrowStyle:t=null,contentStyle:i=null,date:r="",dateClassName:s="",icon:o=null,iconClassName:a="",iconOnClick:l=null,onTimelineElementClick:f=null,iconStyle:h=null,id:d="",position:p="",style:v=null,textClassName:y="",intersectionObserverProps:_={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:M=!1})=>ro.default.createElement(e5.InView,_,({inView:m,ref:S})=>ro.default.createElement("div",{ref:S,id:d,className:(0,Jd.default)(e,"vertical-timeline-element",{"vertical-timeline-element--left":p==="left","vertical-timeline-element--right":p==="right","vertical-timeline-element--no-children":n===""}),style:v},ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("span",{style:h,onClick:l,className:(0,Jd.default)(a,"vertical-timeline-element-icon",{"bounce-in":m||M,"is-hidden":!(m||M)})},o),ro.default.createElement("div",{style:i,onClick:f,className:(0,Jd.default)(y,"vertical-timeline-element-content",{"bounce-in":m||M,"is-hidden":!(m||M)})},ro.default.createElement("div",{style:t,className:"vertical-timeline-element-content-arrow"}),n,ro.default.createElement("span",{className:(0,Jd.default)(s,"vertical-timeline-element-date")},r)))));k3.propTypes={children:Jt.default.oneOfType([Jt.default.arrayOf(Jt.default.node),Jt.default.node]),className:Jt.default.string,contentArrowStyle:Jt.default.shape({}),contentStyle:Jt.default.shape({}),date:Jt.default.node,dateClassName:Jt.default.string,icon:Jt.default.element,iconClassName:Jt.default.string,iconStyle:Jt.default.shape({}),iconOnClick:Jt.default.func,onTimelineElementClick:Jt.default.func,id:Jt.default.string,position:Jt.default.string,style:Jt.default.shape({}),textClassName:Jt.default.string,visible:Jt.default.bool,intersectionObserverProps:Jt.default.shape({root:Jt.default.object,rootMargin:Jt.default.string,threshold:Jt.default.number,triggerOnce:Jt.default.bool})};var t5=k3;Sg.default=t5;var O3={VerticalTimeline:_g.default,VerticalTimelineElement:Sg.default};const n5=({experience:n})=>F.jsxs(O3.VerticalTimelineElement,{contentStyle:{background:"black",color:"black"},contentArrowStyle:{borderRight:"7px solid black"},date:n.date,iconStyle:{background:n.iconBg},icon:F.jsx("div",{className:"flex justify-center items-center w-full h-full",children:F.jsx("img",{src:n.icon,alt:n.company_name,className:"w-[75%] h-[75%] object-contain"})}),children:[F.jsxs("div",{children:[F.jsx("h3",{className:"text-[#fcd4d4] text-[24px] font-bold",children:n.title}),F.jsxs("p",{className:"text-white text-[16px] font-semibold",style:{margin:0},children:[n.company_name," "]})]}),F.jsxs("ul",{className:"mt-5 list-disc ml-5 space-y-2",children:[n.points.map((e,t)=>F.jsxs("li",{className:"text-white-100 text-[14px] pl-1 tracking-wider",children:[e," "]},`experience-point-${t}`))," "]})]}),i5=()=>F.jsxs(F.Fragment,{children:[F.jsxs(sn.div,{variants:ts(),children:[F.jsx("h2",{className:`${jt.sectionHeadText} text-center`,children:"Work Experience."}),F.jsx("p",{className:`${jt.sectionSubText} text-center`,children:"Where I have worked so far?"})]}),F.jsx("div",{className:"mt-20 flex flex-col",children:F.jsxs(O3.VerticalTimeline,{lineColor:"#373737",children:[vB.map((n,e)=>F.jsx(n5,{experience:n},`experience-${e}`))," "]})})]}),r5=js(i5,"work"),s5=()=>F.jsx("div",{className:"h-screen flex justify-center items-center",children:F.jsx("img",{src:Hu,className:"w-[150px] h-[117px] "})});function o5(){return F.jsx(H.Suspense,{fallback:s5(),children:F.jsxs("div",{className:" z-0 bg-white",children:[F.jsx(Gs,{}),F.jsxs("div",{className:"bg-gradient-to-b from-white to-primary",children:[F.jsx(CB,{}),F.jsx(OB,{}),F.jsx(r5,{})]})]})})}const Lv=({index:n,name:e,image:t})=>F.jsx(sn.div,{children:F.jsx("div",{children:F.jsx(sn.div,{variants:Yo("right","spring",.5*n,.75),children:F.jsxs(xg,{options:{max:45,scale:1,speed:450},className:"bg-white shadow-[#fcd4d4] shadow-card p-5 rounded-2xl sm:w-[360px] w-full",children:[F.jsx("div",{className:"relative w-full h-[230px]",children:F.jsx("img",{src:t,placeholder:`${e}`,loading:"lazy",alt:"certificate image",className:"w-full h-full object-cover rounded-2xl"})}),F.jsx("h3",{className:"mt-5 text-black font-bold text-[24px] text-center",children:e})]})})})}),a5=()=>F.jsxs("div",{className:"-m-5 md:-m-10",children:[F.jsxs(sn.div,{variants:ts(0),children:[F.jsx("h2",{className:`${jt.sectionHeadText} text-center`,children:"Certificates."}),F.jsx("p",{className:`${jt.sectionSubText} text-center`,children:"Professional Certificates"})]}),F.jsxs("div",{className:"my-20 flex flex-wrap justify-center mx-auto space-x-5 gap-5 w-full",children:[SB.map((n,e)=>F.jsx(Lv,{index:e,...n},`project-${e}`))," "]}),F.jsx(sn.p,{variants:ts(0),className:`${jt.sectionSubText} text-center`,children:"Work Certificates"}),F.jsxs("div",{className:"my-20 flex flex-wrap justify-center mx-auto space-x-5 gap-5 w-full",children:[_B.map((n,e)=>F.jsx(Lv,{index:e,...n},`project-${e}`))," "]}),F.jsx(sn.p,{variants:ts(0),className:`${jt.sectionSubText} text-center`,children:"Course Certificates"}),F.jsxs("div",{className:"my-20 flex flex-wrap justify-center mx-auto space-x-5 gap-5 w-full",children:[xB.map((n,e)=>F.jsx(Lv,{index:e,...n},`project-${e}`))," "]})]}),l5=js(a5,"CertificateLists");function u5(){return F.jsxs("div",{className:"bg-white",children:[F.jsx(Gs,{}),F.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:F.jsx(l5,{})})]})}const c5="/portfolio-react-threejs/assets/cover_img-73d442a3.png",YE="/portfolio-react-threejs/assets/resume-a68436d4.pdf",f5=()=>{const[n,e]=H.useState(!1),t=()=>e(!0),i=()=>e(!1),r=()=>{const s=document.createElement("a");s.href=YE,s.download="Satyam_Mishra_Resume",s.click()};return F.jsxs("div",{className:"-m-5 md:-m-10 max-w-screen-xl mx-auto my-10 space-y-10 max",children:[F.jsxs(sn.div,{variants:ts(0),children:[F.jsx("h2",{className:`${jt.sectionHeadText} text-center`,children:"Resume."}),F.jsx("p",{className:`${jt.sectionSubText} text-center`,children:"Check out my beginner resume🤣"})]}),F.jsx(sn.div,{variants:Yo("right","spring",.5*0,.75),className:"md:flex justify-center items-center",children:F.jsxs(xg,{options:{max:45,scale:1,speed:450},className:"group bg-white shadow-[#fcd4d4] shadow-card rounded-2xl mx-auto w-[90%] md:min-w-1/3 md:max-w-3xl h-full",children:[F.jsx("div",{className:"group-hover:opacity-100 relative w-full h-full mb-5",children:F.jsx("img",{src:c5,loading:"lazy",alt:"Resume cover image",className:"w-full h-full object-cover rounded-2xl"})}),F.jsxs("div",{className:"group-hover:opacity-100 flex items-center space-x-5 md:space-y-5 justify-center md:absolute md:top-10 md:-right-10 md:bottom-0 md:flex md:flex-col md:items-center md:justify-center opacity-0 hover:opacity-100 transition-opacity duration-300",children:[F.jsx("button",{className:"bg-blue-600 text-white hover:text-white-100 hover:bg-blue-800 py-2 px-3 rounded-xl text-[15px] font-medium cursor-pointer mb-2 md:mb-0",onClick:r,children:"Download"}),F.jsx("button",{className:"bg-green-600 text-white hover:text-white-100 hover:bg-green-800 py-2 px-3 rounded-xl text-[15px] font-medium cursor-pointer mb-2 md:mb-0",onClick:t,children:"View"})]})]})}),n&&F.jsx("div",{className:"fixed inset-0 z-50 overflow-auto -top-10 bg-black bg-opacity-60 flex items-center justify-center",children:F.jsxs("div",{className:"bg-white p-2 rounded-2xl max-w-screen-lg w-[70%] relative",children:[F.jsx("button",{className:"absolute -top-12 right-0 md:top-2 md:-right-20 bg-black hover:bg-gray-800 py-2 px-3 rounded-xl text-white hover:text-gray-200",onClick:i,children:"Close"}),F.jsx("iframe",{title:"PDF Viewer",src:YE,className:"w-full h-[400px]"})]})})]})},h5=js(f5,"ResumeComp");function d5(){return F.jsxs("div",{className:"bg-white",children:[F.jsx(Gs,{}),F.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:F.jsx(h5,{})})]})}function p5(){return F.jsxs(sn.div,{variants:ts(0),className:"h-screen ",children:[F.jsx("h1",{className:`${jt.sectionHeadText} text-center`,children:"Coming soon"}),F.jsx("p",{className:`${jt.heroSubText} mt-2 text-black-100 text-center`,children:"More things are on the way ✌️."})]})}const U3=js(p5,"ComingSoon"),m5=()=>F.jsx("div",{className:"h-screen flex justify-center items-center",children:F.jsx("img",{src:Hu,className:"w-[150px] h-[117px] "})});function g5(){return F.jsx(H.Suspense,{fallback:m5(),children:F.jsxs("div",{className:"bg-white",children:[F.jsx(Gs,{}),F.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:F.jsx(U3,{})})]})})}const Of={_origin:"https://api.emailjs.com"},v5=(n,e="https://api.emailjs.com")=>{Of._userID=n,Of._origin=e},z3=(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 qE{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const F3=(n,e,t={})=>new Promise((i,r)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new qE(o);a.status===200||a.text==="OK"?i(a):r(a)}),s.addEventListener("error",({target:o})=>{r(new qE(o))}),s.open("POST",Of._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),y5=(n,e,t,i)=>{const r=i||Of._userID;return z3(r,n,e),F3("/api/v1.0/email/send",JSON.stringify({lib_version:"3.11.0",user_id:r,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},x5=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},_5=(n,e,t,i)=>{const r=i||Of._userID,s=x5(t);z3(r,n,e);const o=new FormData(s);return o.append("lib_version","3.11.0"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",r),F3("/api/v1.0/email/send-form",o)},S5={init:v5,send:y5,sendForm:_5},w5=()=>{const n=H.useRef(),[e,t]=H.useState({name:"",email:"",message:""}),[i,r]=H.useState(!1),s=a=>{const{target:l}=a,{name:f,value:h}=l;t({...e,[f]:h})},o=a=>{a.preventDefault(),r(!0),S5.send("service_w2nrv74","template_hmf109b",{from_name:e.name,to_name:"Satyam Mishra",from_email:e.email,to_email:"satyammishra9050@gmail.com",message:e.message},"Tlnn1O7PC8WlYPRT7").then(()=>{r(!1),alert("Thank you. I will get back to you as soon as possible."),t({name:"",email:"",message:""})},l=>{r(!1),console.error(l),alert("Ahh, something went wrong. Please try again.")})};return F.jsxs("div",{className:"xl:mt-6 flex xl:flex-row flex-col-reverse gap-10 overflow-hidden md:w-[80%] lg:w-[70%] ",children:[F.jsxs(sn.div,{variants:EB("left","tween",.2,1),className:"flex-[0.75] bg-white p-8 shadow-[#fcd4d4] shadow-card rounded-2xl",children:[F.jsx("p",{className:jt.sectionSubText,children:"I am open to work"}),F.jsx("h3",{className:jt.sectionHeadText,children:"Get In Touch."}),F.jsxs("form",{ref:n,onSubmit:o,className:"mt-12 flex flex-col gap-8",children:[F.jsxs("label",{className:"flex flex-col",children:[F.jsx("span",{className:"text-black font-medium mb-4",children:"Your Name"}),F.jsx("input",{type:"text",name:"name",value:e.name,onChange:s,placeholder:"What's your good name?",className:"bg-secondary py-4 px-6 placeholder:text-white-100 text-white rounded-lg outline-none border-none font-medium"})]}),F.jsxs("label",{className:"flex flex-col",children:[F.jsx("span",{className:"text-black font-medium mb-4",children:"Your email"}),F.jsx("input",{type:"email",name:"email",value:e.email,onChange:s,placeholder:"What's your web address?",className:"bg-secondary py-4 px-6 placeholder:text-white-100 text-white rounded-lg outline-none border-none font-medium"})]}),F.jsxs("label",{className:"flex flex-col",children:[F.jsx("span",{className:"text-black font-medium mb-4",children:"Your Message"}),F.jsx("textarea",{rows:7,name:"message",value:e.message,onChange:s,placeholder:"What you want to say?",className:"bg-secondary py-4 px-6 placeholder:text-white-100 text-white rounded-lg outline-none border-none font-medium"})]}),F.jsxs("button",{type:"submit",className:"bg-black hover:bg-slate-600 py-3 px-8 rounded-xl outline-none w-fit text-white font-bold shadow-md shadow-primary",children:[i?"Sending...":"Send"," "]})]})]})," "]})},M5=js(w5,"contact");function A5(){return F.jsxs("div",{className:"bg-white",children:[F.jsx(Gs,{}),F.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:F.jsx(M5,{})})]})}const ZE="data:image/webp;base64,UklGRggMAABXRUJQVlA4WAoAAAAwAAAA7wAA7wAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBIggkAAAGwBgC0MTfWGWamsV3bbVDbdvu29tp23dRuk7VRu12btW0H89Kkk0wwcx6Ce8+959tf721ETAD87f//pevfqP+jaW9v+fHERZfrHuI9l+viiR+3vJX2aP9G/n81nMlTln+biVLvfLN8SrLzr0HMgLSfPUi05ETG+OrGztE9bT+Sv5AxwGHQQibsdKOi7h3jgw2X/5jtHlTas220v5FqlJaDGrybkWSQnNMPoDb3T3MYn8jnb6BWM9PijE3V9ALUbsHaROMSlVaIWi7KiDMmYUsKUNsFi0ONh3V6Jmo953Grweh5ArV/rLuRCMtAFtdHGoYRmcika7oxiNuDjO6ONQCDs5DVrEHcOVcgux/4s1b/JDJ8vC5jA/6JLOcN48oy34dM++ZaWPLfhozvCWQoZh+yfjienUaXkflLDZlJykb2Xa1Z6XAXDWB+V0a65KMhdPdio6cHDaKnBxNt89EwujuxkJqHBvJuCgONXGgosxtqL+YyGsxL0Zpz/o6Gc7+/1izb0IBuMetsPhrS2Rob5DMmvmHaqpuLBjWvgab8T6JhPVZFT2+ggV2rpcEoPbuWf2i9HtNW/1akH8+vq6Z2rxvqXztbmG+AhuKy5A2CcgMGvOnSSU5Gf38od6gwzIzRzx6U/g1U2G/UL7r4abgdKvy9MNypnXEof2DFAKDD7zr4tR1Udog4HK2ZqCx5LmulwDTinGrnhpug0rZccXci9PIJyt8IIh1LvCp5F/qByC3i8H2t9ESCrwgB6HpVnUudQOwLErCLRqwnKIwWBBE/qvJtGAgeIOOIRR+PIMVWosDv/cpk7duw+JH+bVrWjAu1WEMTaia1HfDY0s0HXZV52w6im8nAB7QRlk0iShiYVpSXtWtGv0gQHjtw9heu8paA+GgpmSG6WIIkg8SBaQUiurdPrwnyTXUf2lOIiEtAYogUXKCJuAIagRLAvC69nxPI+g9+K90kI0iOO0YPa5Cmvwy9BsrB5Vqo5jEWAZIKE3SQjkTjuUiQhKs1EFlApTkXSbLcEerNQKo9uegjC19VzplJZgwXE6Tddqg2Dcm+ysUMaThFtQN0PuTiM3l/KpaEdPdxcUgetlArnVCeiQezm8BqpfzvEsI6PDRAgrlVVBqLlMfwMJECjlJpB6kVPKwjsVmhEA+pP3g4SKIwUJ2JSLo0lINwLwkco85OWjiYg+FIc6syDjex+RwsJ5JvV6UX0r4czUH1TBrYVZXltAqSgMX2RTQWqnKa1jBg8iEaxxSJQ9IZwOYGEhijxkhS5wP5iLhFYogayyh5WwOjA0ksVmMfpXRgdTuF35RwFhNyRfJS20OgyKFCChJ+HJhdQACTVJhK6LaDm7B8AhNVWEHoWWB3GYElKnxHJzeYn4QieV+pcIfOCmD4c3k3FfBHukkcDZDnq0KvMZ0TwLH1tjRsQK8/nddYgnXy+tJ7lE5bnobLe4heGpk8G0/hXmnz6L1FZjcwfUjaG/S2kpnP1fvSNtH7icwErl6S9j29U2RacTVE2nF618jEcZUk7Qq9TDIBXNWVdoteLhWvmatYaS56BVTuAdeB0tz0SqmUsBUlrZSelwr6cVVDPx4yYVw1kVZIL49MDa7aScujl0OmC1djpGXTu05mGlevS7tC7ziZNK4+lHaE3s9ktnO1T9qP9HaQyTHzFFgibQe998hgU556o/S36M2l8whP8+XNpPcQnb08HZX3AL2BdEpiOGqK8gfQa0EHn+BoIYFG9AJ8dA4yZLsmz+ekBzfoYE9+JqH8a6DgN4R+ZMdylsDXKqwhhJ24GYMEF6owjdJhGy9VLlIYqUISJXyGl2VIsaYK9iJK7pqcJJdSyDGpAAcp4c92PoJOIsUvQcmVpHANG6YNSHKuGsNp4WQuXkWaw9SI9tEq6sfDZC+N0nA14CQt9PTlYIIXaf4Kii4lhp6++hvvRaKvqtKTGpY8rznT816kmqyKXz41xDftOgvYhGQzzarAVnr4Sy19NT+OdD8AZccogPceM+vJNqMYCd+nTlChAog/1NdRymGk7A5SB7Ypgd711XRTLcOLpD8AhUepgeieF66T+DXFSLy7Sg6XIoieD5roouUHxUj9mkUlWKMMou+roQ71Asb8igrOAaVTFELEux/0tankHLa+AFX01VEL/lQKEXM+mVJNjboPbcpDRX8Gxcep9t/n1o1vbKVkbznlnSuo8CjV/G5r4L8L/lj3QM/adll+9fs8+uaBIlT7vEU1mKGJsksvv2oRZ3n9mg91+CAoH54v6tLQyLovnqHmug+kjs7VwR2nerBEVFcAAPOQk6QO1QTJNQ5r4BXQYJxH0MD/ArA9U0jnS3+QHvilcvlhOoAVgq7VKwOgySkqOx1A0LFXtcWgxah8MXh3aFkQ8iWN35xA0rlfLVeYHmCWIPQ+WBbYN1G4GAVEq2Yq9SRoMuiOIPSNKAusW+QVpwLZziUKnbPrAqaJQndSWVBln7TngPALCg0FbZoPiMKrQWVB7FVJf5op2Y4q8wNotJ1PFC4rB5rlSSlNAtLtfIp4k3UCbworaVYODPPJeBOIv6XIatBq6E1RuK08mCPBk0gttlCJCwF6geHCfA3LM70jbiWQT1fB1wV0u14UvlMemJeJ8taiV7tUgTWg3fAbou4FlAcw8IKY7aDg5/QuBugHevoE4YSKgLn7gq9PuYoQ81xXLxz7dfs7aQ/3behQoSc5XxfQ8VJRX1dIn9Y71OaDlm0/C/Im6gjWEvvGoidIzBKDz2upE60rkaDrXqViTmjJXkjJkwL6fkYMpuoIfqU0FXT+rph0LS0j9CZo3e9HIe5IHY2ms9umNwg9LgJn66g9md/8QffxV0S4a2moPpWzUaD/RlkC8EuzfiKIXE0EDlu4BOBy/ZhpZDcAHlNyBeBck26ARFYScNnKJQA3BvNzoyHw2ey2ALw52sTMhZrAab2rAhBPPhDKyYk44DX+sAjEkh9mjmySGMzCvgjgNugLIUJ1tT0Q+LVlMOabYwaWpxdxdW84cN3+Fk8XmwLfMV9z9FUEcG56vJibwufNwHzbc7wcaAT8O9O8fJSm2cEQdjvPxdk2YBQdMzwcuGc4wEA2+Ep7vk8TwGB2P6a3Qx3BeNoeuamvGw9YwJD6Tb+lpyuPO8GwBjx1TT/nJtvA0NonHNfLsbFWMLymLuuLK2RVxYaI7vfagUGOfelUBaJVqYqHHw4BI5266nZZjVSJTwXDbU6acRoR/6GKUa85ff2Cv1Z/+///8wRWUDggkAAAAFAPAJ0BKvAA8AA+bTaZSaQjIqEgKACADYlpbuF2sRtACewD32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D31gAAP7/1gAAAAAAAAAAAA==",E5="/portfolio-react-threejs/assets/appstore-0b8f390b.png",b5="/portfolio-react-threejs/assets/colab-9e4861eb.png",T5="/portfolio-react-threejs/assets/huggingface-720eadc9.png",C5=({index:n,name:e,description:t,tags:i,image:r,source_code_link:s,date:o,link_type:a})=>F.jsx(sn.div,{children:F.jsx("div",{children:F.jsx(sn.div,{variants:Yo("right","spring",.5*n,.75),children:F.jsxs(xg,{options:{max:45,scale:1,speed:450},className:"bg-white shadow-[#fcd4d4] shadow-card p-5 rounded-2xl sm:w-[360px] w-full",children:[F.jsxs("div",{className:"relative w-full h-[230px]",children:[F.jsx("img",{src:r,alt:"project_image",className:"w-full h-full object-cover rounded-2xl"}),F.jsx("div",{className:"absolute inset-0 flex justify-end m-3 card-img_hover",children:F.jsx("div",{onClick:()=>window.open(s,"_blank"),className:"white-gradient w-10 h-10 rounded-full flex justify-center items-center cursor-pointer",children:F.jsx("img",{src:a=="github"?ZE:a=="colab"?b5:a=="huggingface"?T5:a=="appstore"?E5:ZE,alt:"github repositories for projects",className:"w-1/2 h-1/2 object-contain"})})})]}),F.jsxs("div",{className:"mt-5",children:[F.jsx("h3",{className:"text-black font-bold text-[24px]",children:e}),F.jsx("p",{className:"mt-2 text-secondary text-[14px]",children:t})]}),F.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[i.map(l=>F.jsxs("p",{className:`text-[14px] ${l.color}`,children:["#",l.name," "]},`${e}-${l.name}`))," "]}),F.jsx("p",{children:o})]})})})}),P5=()=>F.jsxs("div",{className:"-m-5 md:-m-10 ",children:[F.jsxs(sn.div,{variants:ts(0),children:[F.jsx("h2",{className:`${jt.sectionHeadText} text-center`,children:"Projects."}),F.jsx("p",{className:`${jt.sectionSubText} text-center`,children:"My works?"})]}),F.jsx(sn.div,{variants:Yo("","",.1,1),className:"w-full flex",children:F.jsx("p",{className:"mt-3 text-secondary text-center text-[17px] max-w-full leading-[30px]",children:"The projects that are listed below provide examples of my work in the real world, showcasing my abilities and experience. Each project has a brief description, links to code repositories, and live demonstrations. It exhibits my ability to work with various technologies, manage projects efficiently, and solve complex problems."})}),F.jsxs("div",{className:" mt-20 grid md:grid-cols-2 lg:grid-cols-3 gap-5",children:[yB.map((n,e)=>F.jsx(C5,{index:e,...n},`project-${e}`))," "]})]}),L5=js(P5,"project");function R5(){return F.jsxs("div",{className:"bg-white",children:[F.jsx(Gs,{}),F.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:F.jsx(L5,{})})]})}/** - * @license - * Copyright 2010-2023 Three.js Authors - * SPDX-License-Identifier: MIT - */const wg="151",Sa={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},wa={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},B3=0,Nx=1,V3=2,I5=3,D5=0,X1=1,Y1=2,au=3,Bs=0,mi=1,Rr=2,N5=2,Ns=0,Oa=1,kx=2,Ox=3,Ux=4,H3=5,Aa=100,W3=101,G3=102,zx=103,Fx=104,j3=200,X3=201,Y3=202,q3=203,q1=204,Z1=205,Z3=206,J3=207,K3=208,Q3=209,$3=210,eL=0,tL=1,nL=2,Hm=3,iL=4,rL=5,sL=6,oL=7,dh=0,aL=1,lL=2,Nr=0,uL=1,cL=2,fL=3,J1=4,hL=5,Mg=300,zo=301,Fo=302,Uf=303,zf=304,Wu=306,Ff=1e3,ri=1001,Bf=1002,mn=1003,Wm=1004,k5=1004,cf=1005,O5=1005,vn=1006,K1=1007,U5=1007,Bo=1008,z5=1008,Vo=1009,dL=1010,pL=1011,Q1=1012,mL=1013,So=1014,Ls=1015,Ru=1016,gL=1017,vL=1018,Ua=1020,yL=1021,Vi=1023,xL=1024,_L=1025,No=1026,Ya=1027,SL=1028,wL=1029,ML=1030,AL=1031,EL=1033,$p=33776,em=33777,tm=33778,nm=33779,Bx=35840,Vx=35841,Hx=35842,Wx=35843,bL=36196,Gx=37492,jx=37496,Xx=37808,Yx=37809,qx=37810,Zx=37811,Jx=37812,Kx=37813,Qx=37814,$x=37815,e_=37816,t_=37817,n_=37818,i_=37819,r_=37820,s_=37821,im=36492,TL=36283,o_=36284,a_=36285,l_=36286,CL=2200,PL=2201,LL=2202,Vf=2300,Hf=2301,rm=2302,La=2400,Ra=2401,Wf=2402,Ag=2500,$1=2501,F5=0,B5=1,V5=2,Vs=3e3,zt=3001,RL=3200,IL=3201,qo=0,DL=1,H5="",Cr="srgb",Iu="srgb-linear",eS="display-p3",W5=0,sm=7680,G5=7681,j5=7682,X5=7683,Y5=34055,q5=34056,Z5=5386,J5=512,K5=513,Q5=514,$5=515,eV=516,tV=517,nV=518,NL=519,Gf=35044,iV=35048,rV=35040,sV=35045,oV=35049,aV=35041,lV=35046,uV=35050,cV=35042,fV="100",u_="300 es",Gm=1035;class ss{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]+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 fn(n,e,t){return Math.max(e,Math.min(t,n))}function tS(n,e){return(n%e+e)%e}function hV(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function dV(n,e,t){return n!==e?(t-n)/(e-n):0}function ff(n,e,t){return(1-t)*n+t*e}function pV(n,e,t,i){return ff(n,e,1-Math.exp(-t*i))}function mV(n,e=1){return e-Math.abs(tS(n,e*2)-e)}function gV(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function vV(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function yV(n,e){return n+Math.floor(Math.random()*(e-n+1))}function xV(n,e){return n+Math.random()*(e-n)}function _V(n){return n*(.5-Math.random())}function SV(n){n!==void 0&&(JE=n);let e=JE+=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 wV(n){return n*za}function MV(n){return n*Du}function c_(n){return(n&n-1)===0&&n!==0}function kL(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function OL(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function AV(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=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,l*d,l*p,a*f);break;case"YZY":n.set(l*p,a*h,l*d,a*f);break;case"ZXZ":n.set(l*d,l*p,a*h,a*f);break;case"XZX":n.set(a*h,l*y,l*v,a*f);break;case"YXY":n.set(l*v,a*h,l*y,a*f);break;case"ZYZ":n.set(l*y,l*v,a*h,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Wi(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function gt(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const UL={DEG2RAD:za,RAD2DEG:Du,generateUUID:ji,clamp:fn,euclideanModulo:tS,mapLinear:hV,inverseLerp:dV,lerp:ff,damp:pV,pingpong:mV,smoothstep:gV,smootherstep:vV,randInt:yV,randFloat:xV,randFloatSpread:_V,seededRandom:SV,degToRad:wV,radToDeg:MV,isPowerOfTwo:c_,ceilPowerOfTwo:kL,floorPowerOfTwo:OL,setQuaternionFromProperEuler:AV,normalize:gt,denormalize:Wi};class ye{constructor(e=0,t=0){ye.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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}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 Mt{constructor(){Mt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,i,r,s,o,a,l,f){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,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],l=i[6],f=i[1],h=i[4],d=i[7],p=i[2],v=i[5],y=i[8],_=r[0],M=r[3],m=r[6],S=r[1],w=r[4],A=r[7],b=r[2],P=r[5],I=r[8];return s[0]=o*_+a*S+l*b,s[3]=o*M+a*w+l*P,s[6]=o*m+a*A+l*I,s[1]=f*_+h*S+d*b,s[4]=f*M+h*w+d*P,s[7]=f*m+h*A+d*I,s[2]=p*_+v*S+y*b,s[5]=p*M+v*w+y*P,s[8]=p*m+v*A+y*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],h=e[8];return t*o*h-t*a*f-i*s*h+i*a*l+r*s*f-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],h=e[8],d=h*o-a*f,p=a*l-h*s,v=f*s-o*l,y=t*d+i*p+r*v;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/y;return e[0]=d*_,e[1]=(r*f-h*i)*_,e[2]=(a*i-r*o)*_,e[3]=p*_,e[4]=(h*t-r*l)*_,e[5]=(r*s-a*t)*_,e[6]=v*_,e[7]=(i*l-f*t)*_,e[8]=(o*t-i*s)*_,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 l=Math.cos(s),f=Math.sin(s);return this.set(i*l,i*f,-i*(l*o+f*a)+o+e,-r*f,r*l,-r*(-f*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Rv.makeScale(e,t)),this}rotate(e){return this.premultiply(Rv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Rv.makeTranslation(e,t)),this}makeTranslation(e,t){return 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 Rv=new Mt;function zL(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const EV={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function lu(n,e){return new EV[n](e)}function jf(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Su(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Iv(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const bV=new Mt().fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),TV=new Mt().fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function CV(n){return n.convertSRGBToLinear().applyMatrix3(TV)}function PV(n){return n.applyMatrix3(bV).convertLinearToSRGB()}const LV={[Iu]:n=>n,[Cr]:n=>n.convertSRGBToLinear(),[eS]:CV},RV={[Iu]:n=>n,[Cr]:n=>n.convertLinearToSRGB(),[eS]:PV},Mi={enabled:!1,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return Iu},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=LV[e],r=RV[t];if(i===void 0||r===void 0)throw new Error(`Unsupported color space conversion, "${e}" to "${t}".`);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)}};let Sl;class nS{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Sl===void 0&&(Sl=jf("canvas")),Sl.width=e.width,Sl.height=e.height;const i=Sl.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Sl}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=jf("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!==Mg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ff:e.x=e.x-Math.floor(e.x);break;case ri:e.x=e.x<0?0:1;break;case Bf: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 Ff:e.y=e.y-Math.floor(e.y);break;case ri:e.y=e.y<0?0:1;break;case Bf: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)}}hn.DEFAULT_IMAGE=null;hn.DEFAULT_MAPPING=Mg;hn.DEFAULT_ANISOTROPY=1;class Dt{constructor(e=0,t=0,i=0,r=1){Dt.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 l=e.elements,f=l[0],h=l[4],d=l[8],p=l[1],v=l[5],y=l[9],_=l[2],M=l[6],m=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-_)<.01&&Math.abs(y-M)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+_)<.1&&Math.abs(y+M)<.1&&Math.abs(f+v+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(f+1)/2,A=(v+1)/2,b=(m+1)/2,P=(h+p)/4,I=(d+_)/4,L=(y+M)/4;return w>A&&w>b?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=P/i,s=I/i):A>b?A<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(A),i=P/r,s=L/r):b<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(b),i=I/s,r=L/s),this.set(i,r,s,t),this}let S=Math.sqrt((M-y)*(M-y)+(d-_)*(d-_)+(p-h)*(p-h));return Math.abs(S)<.001&&(S=1),this.x=(M-y)/S,this.y=(d-_)/S,this.z=(p-h)/S,this.w=Math.acos((f+v+m-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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){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 Or extends ss{constructor(e=1,t=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Dt(0,0,e,t),this.scissorTest=!1,this.viewport=new Dt(0,0,e,t);const r={width:e,height:t,depth:1};this.texture=new hn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:vn,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null,this.samples=i.samples!==void 0?i.samples:0}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.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 Ia(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 Eg extends hn{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=mn,this.minFilter=mn,this.wrapR=ri,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class DV extends Or{constructor(e=1,t=1,i=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new Eg(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class iS extends hn{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=mn,this.minFilter=mn,this.wrapR=ri,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class NV extends Or{constructor(e=1,t=1,i=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new iS(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class kV extends Or{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,w=1-m*m;if(w>Number.EPSILON){const b=Math.sqrt(w),P=Math.atan2(b,m*S);M=Math.sin(M*P)/b,a=Math.sin(a*P)/b}const A=a*S;if(l=l*M+p*A,f=f*M+v*A,h=h*M+y*A,d=d*M+_*A,M===1-a){const b=1/Math.sqrt(l*l+f*f+h*h+d*d);l*=b,f*=b,h*=b,d*=b}}e[t]=l,e[t+1]=f,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=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+l*v-f*p,e[t+1]=l*y+h*p+f*d-a*v,e[t+2]=f*y+h*v+a*p-l*d,e[t+3]=h*y-a*d-l*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){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,f=a(i/2),h=a(r/2),d=a(s/2),p=l(i/2),v=l(r/2),y=l(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!==!1&&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],l=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-l)*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-l)/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=(l+h)/v}else{const v=2*Math.sqrt(1+d-i-a);this._w=(o-r)/v,this._x=(s+f)/v,this._y=(l+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,a=t._x,l=t._y,f=t._z,h=t._w;return this._x=i*h+o*a+r*f-s*l,this._y=r*h+o*l+s*a-i*f,this._z=s*h+o*f+i*l-r*a,this._w=o*h-i*a-r*l-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 l=1-a*a;if(l<=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._onChangeCallback(),this}const f=Math.sqrt(l),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}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 k{constructor(e=0,t=0,i=0){k.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(KE.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(KE.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,l=e.w,f=l*t+o*r-a*i,h=l*i+a*t-s*r,d=l*r+s*i-o*t,p=-s*t-o*i-a*r;return this.x=f*l+p*-s+h*-a-d*-o,this.y=h*l+p*-o+d*-s-f*-a,this.z=d*l+p*-a+f*-o-h*-s,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,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 Nv.copy(this).projectOnVector(e),this.sub(Nv)}reflect(e){return this.sub(Nv.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 Nv=new k,KE=new si;class os{constructor(e=new k(1/0,1/0,1/0),t=new k(-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,vs),vs.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(Cc),Kd.subVectors(this.max,Cc),Ml.subVectors(e.a,Cc),Al.subVectors(e.b,Cc),El.subVectors(e.c,Cc),so.subVectors(Al,Ml),oo.subVectors(El,Al),ua.subVectors(Ml,El);let t=[0,-so.z,so.y,0,-oo.z,oo.y,0,-ua.z,ua.y,so.z,0,-so.x,oo.z,0,-oo.x,ua.z,0,-ua.x,-so.y,so.x,0,-oo.y,oo.x,0,-ua.y,ua.x,0];return!kv(t,Ml,Al,El,Kd)||(t=[1,0,0,0,1,0,0,0,1],!kv(t,Ml,Al,El,Kd))?!1:(Qd.crossVectors(so,oo),t=[Qd.x,Qd.y,Qd.z],kv(t,Ml,Al,El,Kd))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(vs).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:(gs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gs),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 gs=[new k,new k,new k,new k,new k,new k,new k,new k],vs=new k,wl=new os,Ml=new k,Al=new k,El=new k,so=new k,oo=new k,ua=new k,Cc=new k,Kd=new k,Qd=new k,ca=new k;function kv(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){ca.fromArray(n,s);const a=r.x*Math.abs(ca.x)+r.y*Math.abs(ca.y)+r.z*Math.abs(ca.z),l=e.dot(ca),f=t.dot(ca),h=i.dot(ca);if(Math.max(-Math.max(l,f,h),Math.min(l,f,h))>a)return!1}return!0}const OV=new os,Pc=new k,Ov=new k;class as{constructor(e=new k,t=-1){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):OV.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;Pc.subVectors(e,this.center);const t=Pc.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Pc,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):(Ov.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Pc.copy(e.center).add(Ov)),this.expandByPoint(Pc.copy(e.center).sub(Ov))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ys=new k,Uv=new k,$d=new k,ao=new k,zv=new k,ep=new k,Fv=new k;class ph{constructor(e=new k,t=new k(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,ys)),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=ys.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ys.copy(this.origin).addScaledVector(this.direction,t),ys.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Uv.copy(e).add(t).multiplyScalar(.5),$d.copy(t).sub(e).normalize(),ao.copy(this.origin).sub(Uv);const s=e.distanceTo(t)*.5,o=-this.direction.dot($d),a=ao.dot(this.direction),l=-ao.dot($d),f=ao.lengthSq(),h=Math.abs(1-o*o);let d,p,v,y;if(h>0)if(d=o*l-a,p=o*a-l,y=s*h,d>=0)if(p>=-y)if(p<=y){const _=1/h;d*=_,p*=_,v=d*(d+o*p+2*a)+p*(o*d+p+2*l)+f}else p=s,d=Math.max(0,-(o*p+a)),v=-d*d+p*(p+2*l)+f;else p=-s,d=Math.max(0,-(o*p+a)),v=-d*d+p*(p+2*l)+f;else p<=-y?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-l),s),v=-d*d+p*(p+2*l)+f):p<=y?(d=0,p=Math.min(Math.max(-s,-l),s),v=p*(p+2*l)+f):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-l),s),v=-d*d+p*(p+2*l)+f);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),v=-d*d+p*(p+2*l)+f;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Uv).addScaledVector($d,p),v}intersectSphere(e,t){ys.subVectors(e.center,this.origin);const i=ys.dot(this.direction),r=ys.dot(ys)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,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,l;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,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,ys)!==null}intersectTriangle(e,t,i,r,s){zv.subVectors(t,e),ep.subVectors(i,e),Fv.crossVectors(zv,ep);let o=this.direction.dot(Fv),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ao.subVectors(this.origin,e);const l=a*this.direction.dot(ep.crossVectors(ao,ep));if(l<0)return null;const f=a*this.direction.dot(zv.cross(ao));if(f<0||l+f>o)return null;const h=-a*ao.dot(Fv);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 ot{constructor(){ot.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,i,r,s,o,a,l,f,h,d,p,v,y,_,M){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=f,m[6]=h,m[10]=d,m[14]=p,m[3]=v,m[7]=y,m[11]=_,m[15]=M,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 ot().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/bl.setFromMatrixColumn(e,0).length(),s=1/bl.setFromMatrixColumn(e,1).length(),o=1/bl.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),l=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,_=a*d;t[0]=l*h,t[4]=-l*d,t[8]=f,t[1]=v+y*f,t[5]=p-_*f,t[9]=-a*l,t[2]=_-p*f,t[6]=y+v*f,t[10]=o*l}else if(e.order==="YXZ"){const p=l*h,v=l*d,y=f*h,_=f*d;t[0]=p+_*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]=_+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*h,v=l*d,y=f*h,_=f*d;t[0]=p-_*a,t[4]=-o*d,t[8]=y+v*a,t[1]=v+y*a,t[5]=o*h,t[9]=_-p*a,t[2]=-o*f,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*h,v=o*d,y=a*h,_=a*d;t[0]=l*h,t[4]=y*f-v,t[8]=p*f+_,t[1]=l*d,t[5]=_*f+p,t[9]=v*f-y,t[2]=-f,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,v=o*f,y=a*l,_=a*f;t[0]=l*h,t[4]=_-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-_*d}else if(e.order==="XZY"){const p=o*l,v=o*f,y=a*l,_=a*f;t[0]=l*h,t[4]=-d,t[8]=f*h,t[1]=p*d+_,t[5]=o*h,t[9]=v*d-y,t[2]=y*d-v,t[6]=a*h,t[10]=_*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(UV,e,zV)}lookAt(e,t,i){const r=this.elements;return Ui.subVectors(e,t),Ui.lengthSq()===0&&(Ui.z=1),Ui.normalize(),lo.crossVectors(i,Ui),lo.lengthSq()===0&&(Math.abs(i.z)===1?Ui.x+=1e-4:Ui.z+=1e-4,Ui.normalize(),lo.crossVectors(i,Ui)),lo.normalize(),tp.crossVectors(Ui,lo),r[0]=lo.x,r[4]=tp.x,r[8]=Ui.x,r[1]=lo.y,r[5]=tp.y,r[9]=Ui.y,r[2]=lo.z,r[6]=tp.z,r[10]=Ui.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],l=i[8],f=i[12],h=i[1],d=i[5],p=i[9],v=i[13],y=i[2],_=i[6],M=i[10],m=i[14],S=i[3],w=i[7],A=i[11],b=i[15],P=r[0],I=r[4],L=r[8],C=r[12],R=r[1],W=r[5],J=r[9],j=r[13],X=r[2],Z=r[6],se=r[10],ae=r[14],D=r[3],V=r[7],B=r[11],te=r[15];return s[0]=o*P+a*R+l*X+f*D,s[4]=o*I+a*W+l*Z+f*V,s[8]=o*L+a*J+l*se+f*B,s[12]=o*C+a*j+l*ae+f*te,s[1]=h*P+d*R+p*X+v*D,s[5]=h*I+d*W+p*Z+v*V,s[9]=h*L+d*J+p*se+v*B,s[13]=h*C+d*j+p*ae+v*te,s[2]=y*P+_*R+M*X+m*D,s[6]=y*I+_*W+M*Z+m*V,s[10]=y*L+_*J+M*se+m*B,s[14]=y*C+_*j+M*ae+m*te,s[3]=S*P+w*R+A*X+b*D,s[7]=S*I+w*W+A*Z+b*V,s[11]=S*L+w*J+A*se+b*B,s[15]=S*C+w*j+A*ae+b*te,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],l=e[9],f=e[13],h=e[2],d=e[6],p=e[10],v=e[14],y=e[3],_=e[7],M=e[11],m=e[15];return y*(+s*l*d-r*f*d-s*a*p+i*f*p+r*a*v-i*l*v)+_*(+t*l*v-t*f*p+s*o*p-r*o*v+r*f*h-s*l*h)+M*(+t*f*d-t*a*v-s*o*d+i*o*v+s*a*h-i*f*h)+m*(-r*a*h-t*l*d+t*a*p+r*o*d-i*o*p+i*l*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],l=e[6],f=e[7],h=e[8],d=e[9],p=e[10],v=e[11],y=e[12],_=e[13],M=e[14],m=e[15],S=d*M*f-_*p*f+_*l*v-a*M*v-d*l*m+a*p*m,w=y*p*f-h*M*f-y*l*v+o*M*v+h*l*m-o*p*m,A=h*_*f-y*d*f+y*a*v-o*_*v-h*a*m+o*d*m,b=y*d*l-h*_*l-y*a*p+o*_*p+h*a*M-o*d*M,P=t*S+i*w+r*A+s*b;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/P;return e[0]=S*I,e[1]=(_*p*s-d*M*s-_*r*v+i*M*v+d*r*m-i*p*m)*I,e[2]=(a*M*s-_*l*s+_*r*f-i*M*f-a*r*m+i*l*m)*I,e[3]=(d*l*s-a*p*s-d*r*f+i*p*f+a*r*v-i*l*v)*I,e[4]=w*I,e[5]=(h*M*s-y*p*s+y*r*v-t*M*v-h*r*m+t*p*m)*I,e[6]=(y*l*s-o*M*s-y*r*f+t*M*f+o*r*m-t*l*m)*I,e[7]=(o*p*s-h*l*s+h*r*f-t*p*f-o*r*v+t*l*v)*I,e[8]=A*I,e[9]=(y*d*s-h*_*s-y*i*v+t*_*v+h*i*m-t*d*m)*I,e[10]=(o*_*s-y*a*s+y*i*f-t*_*f-o*i*m+t*a*m)*I,e[11]=(h*a*s-o*d*s-h*i*f+t*d*f+o*i*v-t*a*v)*I,e[12]=b*I,e[13]=(h*_*r-y*d*r+y*i*p-t*_*p-h*i*M+t*d*M)*I,e[14]=(y*a*r-o*_*r-y*i*l+t*_*l+o*i*M-t*a*M)*I,e[15]=(o*d*r-h*a*r+h*i*l-t*d*l-o*i*p+t*a*p)*I,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 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,l=e.z,f=s*o,h=s*a;return this.set(f*o+i,f*a-r*l,f*l+r*a,0,f*a+r*l,h*a+i,h*l-r*o,0,f*l-r*a,h*l+r*o,s*l*l+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,l=t._w,f=s+s,h=o+o,d=a+a,p=s*f,v=s*h,y=s*d,_=o*h,M=o*d,m=a*d,S=l*f,w=l*h,A=l*d,b=i.x,P=i.y,I=i.z;return r[0]=(1-(_+m))*b,r[1]=(v+A)*b,r[2]=(y-w)*b,r[3]=0,r[4]=(v-A)*P,r[5]=(1-(p+m))*P,r[6]=(M+S)*P,r[7]=0,r[8]=(y+w)*I,r[9]=(M-S)*I,r[10]=(1-(p+_))*I,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=bl.set(r[0],r[1],r[2]).length();const o=bl.set(r[4],r[5],r[6]).length(),a=bl.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],Mr.copy(this);const f=1/s,h=1/o,d=1/a;return Mr.elements[0]*=f,Mr.elements[1]*=f,Mr.elements[2]*=f,Mr.elements[4]*=h,Mr.elements[5]*=h,Mr.elements[6]*=h,Mr.elements[8]*=d,Mr.elements[9]*=d,Mr.elements[10]*=d,t.setFromRotationMatrix(Mr),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o){const a=this.elements,l=2*s/(t-e),f=2*s/(i-r),h=(t+e)/(t-e),d=(i+r)/(i-r),p=-(o+s)/(o-s),v=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=f,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=v,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,r,s,o){const a=this.elements,l=1/(t-e),f=1/(i-r),h=1/(o-s),d=(t+e)*l,p=(i+r)*f,v=(o+s)*h;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*f,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-v,a[3]=0,a[7]=0,a[11]=0,a[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 bl=new k,Mr=new ot,UV=new k(0,0,0),zV=new k(1,1,1),lo=new k,tp=new k,Ui=new k,QE=new ot,$E=new si;class nl{constructor(e=0,t=0,i=0,r=nl.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],l=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(fn(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(-fn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,v),this._z=Math.atan2(l,f)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(fn(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(l,s));break;case"ZYX":this._y=Math.asin(-fn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,v),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(fn(l,-1,1)),Math.abs(l)<.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(-fn(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 QE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(QE,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return $E.setFromEuler(this),this.setFromQuaternion($E,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}}nl.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&&(i=i.concat(o))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Lc,e,BV),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Lc,VV,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;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()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.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 l=a.shapes;if(Array.isArray(l))for(let f=0,h=l.length;f0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),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 l=[];for(const f in a){const h=a[f];delete h.metadata,l.push(h)}return l}}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.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Ar.subVectors(r,t),_s.subVectors(i,t),Bv.subVectors(e,t);const o=Ar.dot(Ar),a=Ar.dot(_s),l=Ar.dot(Bv),f=_s.dot(_s),h=_s.dot(Bv),d=o*f-a*a;if(d===0)return s.set(-2,-1,-1);const p=1/d,v=(f*l-a*h)*p,y=(o*h-a*l)*p;return s.set(1-v-y,y,v)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Ss),Ss.x>=0&&Ss.y>=0&&Ss.x+Ss.y<=1}static getUV(e,t,i,r,s,o,a,l){return ip===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ip=!0),this.getInterpolation(e,t,i,r,s,o,a,l)}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,Ss),l.setScalar(0),l.addScaledVector(s,Ss.x),l.addScaledVector(o,Ss.y),l.addScaledVector(a,Ss.z),l}static isFrontFacing(e,t,i,r){return Ar.subVectors(i,t),_s.subVectors(e,t),Ar.cross(_s).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 Ar.subVectors(this.c,this.b),_s.subVectors(this.a,this.b),Ar.cross(_s).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return bi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return bi.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return ip===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ip=!0),bi.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}getInterpolation(e,t,i,r,s){return bi.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return bi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return bi.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;Cl.subVectors(r,i),Pl.subVectors(s,i),Vv.subVectors(e,i);const l=Cl.dot(Vv),f=Pl.dot(Vv);if(l<=0&&f<=0)return t.copy(i);Hv.subVectors(e,r);const h=Cl.dot(Hv),d=Pl.dot(Hv);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*f;if(p<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(i).addScaledVector(Cl,o);Wv.subVectors(e,s);const v=Cl.dot(Wv),y=Pl.dot(Wv);if(y>=0&&v<=y)return t.copy(s);const _=v*f-l*y;if(_<=0&&f>=0&&y<=0)return a=f/(f-y),t.copy(i).addScaledVector(Pl,a);const M=h*y-v*d;if(M<=0&&d-h>=0&&v-y>=0)return sb.subVectors(s,r),a=(d-h)/(d-h+(v-y)),t.copy(r).addScaledVector(sb,a);const m=1/(M+_+p);return o=_*m,a=p*m,t.copy(i).addScaledVector(Cl,o).addScaledVector(Pl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let WV=0;class Yn extends ss{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:WV++}),this.uuid=ji(),this.name="",this.type="Material",this.blending=Oa,this.side=Bs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=q1,this.blendDst=Z1,this.blendEquation=Aa,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Hm,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=NL,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=sm,this.stencilZFail=sm,this.stencilZPass=sm,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=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.5,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.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!==Oa&&(i.blending=this.blending),this.side!==Bs&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation!==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.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(i.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(i.wireframe=this.wireframe),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=this.flatShading),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 l=s[a];delete l.metadata,o.push(l)}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.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.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++}}const FL={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},Er={h:0,s:0,l:0},rp={h:0,s:0,l:0};function Gv(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 Fe{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Cr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mi.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Mi.workingColorSpace){return this.r=e,this.g=t,this.b=i,Mi.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Mi.workingColorSpace){if(e=tS(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=Gv(o,s,e+1/3),this.g=Gv(o,s,e),this.b=Gv(o,s,e-1/3)}return Mi.toWorkingColorSpace(this,r),this}setStyle(e,t=Cr){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 this.r=Math.min(255,parseInt(s[1],10))/255,this.g=Math.min(255,parseInt(s[2],10))/255,this.b=Math.min(255,parseInt(s[3],10))/255,Mi.toWorkingColorSpace(this,t),i(s[4]),this;if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(s[1],10))/100,this.g=Math.min(100,parseInt(s[2],10))/100,this.b=Math.min(100,parseInt(s[3],10))/100,Mi.toWorkingColorSpace(this,t),i(s[4]),this;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)){const l=parseFloat(s[1])/360,f=parseFloat(s[2])/100,h=parseFloat(s[3])/100;return i(s[4]),this.setHSL(l,f,h,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=Cr){const i=FL[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=Su(e.r),this.g=Su(e.g),this.b=Su(e.b),this}copyLinearToSRGB(e){return this.r=Iv(e.r),this.g=Iv(e.g),this.b=Iv(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cr){return Mi.fromWorkingColorSpace(ni.copy(this),e),fn(ni.r*255,0,255)<<16^fn(ni.g*255,0,255)<<8^fn(ni.b*255,0,255)<<0}getHexString(e=Cr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mi.workingColorSpace){Mi.fromWorkingColorSpace(ni.copy(this),t);const i=ni.r,r=ni.g,s=ni.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,f;const h=(a+o)/2;if(a===o)l=0,f=0;else{const d=o-a;switch(f=h<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r>-f-14,i[l|256]=1024>>-f-14|32768,r[l]=-f-1,r[l|256]=-f-1):f<=15?(i[l]=f+15<<10,i[l|256]=f+15<<10|32768,r[l]=13,r[l|256]=13):f<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let f=l<<13,h=0;for(;!(f&8388608);)f<<=1,h-=8388608;f&=-8388609,h+=947912704,s[l]=f|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Ai(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=fn(n,-65504,65504),Es.floatView[0]=n;const e=Es.uint32View[0],t=e>>23&511;return Es.baseTable[t]+((e&8388607)>>Es.shiftTable[t])}function Xc(n){const e=n>>10;return Es.uint32View[0]=Es.mantissaTable[Es.offsetTable[e]+(n&1023)]+Es.exponentTable[e],Es.floatView[0]}const jV={toHalfFloat:Ai,fromHalfFloat:Xc},wn=new k,sp=new ye;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=Gf,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(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 l=this.parameters;for(const f in l)l[f]!==void 0&&(e[f]=l[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 l in i){const f=i[l];e.data.attributes[l]=f.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const f=this.morphAttributes[l],h=[];for(let d=0,p=f.length;d0&&(r[l]=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))||(ob.copy(s).invert(),Yr.copy(e.ray).applyMatrix4(ob),i.boundingBox!==null&&Yr.intersectsBox(i.boundingBox)===!1))return;let o;const a=i.index,l=i.attributes.position,f=i.attributes.uv,h=i.attributes.uv2,d=i.attributes.normal,p=i.groups,v=i.drawRange;if(a!==null)if(Array.isArray(r))for(let y=0,_=p.length;y<_;y++){const M=p[y],m=r[M.materialIndex],S=Math.max(M.start,v.start),w=Math.min(a.count,Math.min(M.start+M.count,v.start+v.count));for(let A=S,b=w;At.far?null:{distance:f,point:hp.clone(),object:n}}function dp(n,e,t,i,r,s,o,a,l,f){n.getVertexPosition(a,Rl),n.getVertexPosition(l,Il),n.getVertexPosition(f,Dl);const h=e6(n,e,t,i,Rl,Il,Dl,fp);if(h){r&&(lp.fromBufferAttribute(r,a),up.fromBufferAttribute(r,l),cp.fromBufferAttribute(r,f),h.uv=bi.getInterpolation(fp,Rl,Il,Dl,lp,up,cp,new ye)),s&&(lp.fromBufferAttribute(s,a),up.fromBufferAttribute(s,l),cp.fromBufferAttribute(s,f),h.uv2=bi.getInterpolation(fp,Rl,Il,Dl,lp,up,cp,new ye)),o&&(lb.fromBufferAttribute(o,a),ub.fromBufferAttribute(o,l),cb.fromBufferAttribute(o,f),h.normal=bi.getInterpolation(fp,Rl,Il,Dl,lb,ub,cb,new k),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:l,c:f,normal:new k,materialIndex:0};bi.getNormal(Rl,Il,Dl,d.normal),h.face=d}return h}class Jo extends dt{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 l=[],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(l),this.setAttribute("position",new We(f,3)),this.setAttribute("normal",new We(h,3)),this.setAttribute("uv",new We(d,2));function y(_,M,m,S,w,A,b,P,I,L,C){const R=A/I,W=b/L,J=A/2,j=b/2,X=P/2,Z=I+1,se=L+1;let ae=0,D=0;const V=new k;for(let B=0;B0?1:-1,h.push(V.x,V.y,V.z),d.push($/I),d.push(1-B/L),ae+=1}}for(let B=0;B0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;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 mh extends Tt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ot,this.projectionMatrix=new ot,this.projectionMatrixInverse=new ot}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Wt extends mh{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=Du*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(za*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Du*2*Math.atan(Math.tan(za*.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(za*.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 l=o.fullWidth,f=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/f,r*=o.width/l,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.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 Nl=-90,kl=1;class oS extends Tt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i;const r=new Wt(Nl,kl,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(1,0,0),this.add(r);const s=new Wt(Nl,kl,e,t);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(-1,0,0),this.add(s);const o=new Wt(Nl,kl,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);const a=new Wt(Nl,kl,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const l=new Wt(Nl,kl,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);const f=new Wt(Nl,kl,e,t);f.layers=this.layers,f.up.set(0,1,0),f.lookAt(0,0,-1),this.add(f)}update(e,t){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget,[r,s,o,a,l,f]=this.children,h=e.getRenderTarget(),d=e.toneMapping,p=e.xr.enabled;e.toneMapping=Nr,e.xr.enabled=!1;const v=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,s),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=v,e.setRenderTarget(i,5),e.render(t,f),e.setRenderTarget(h),e.toneMapping=d,e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class gh extends hn{constructor(e,t,i,r,s,o,a,l,f,h){e=e!==void 0?e:[],t=t!==void 0?t:zo,super(e,t,i,r,s,o,a,l,f,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class aS extends Or{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];this.texture=new gh(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:vn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,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 Jo(5,5,5),s=new rs({name:"CubemapFromEquirect",uniforms:Nu(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:mi,blending:Ns});s.uniforms.tEquirect.value=t;const o=new Fn(r,s),a=t.minFilter;return t.minFilter===Bo&&(t.minFilter=vn),new oS(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 Yv=new k,r6=new k,s6=new Mt;class mo{constructor(e=new k(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=Yv.subVectors(i,t).cross(r6.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(Yv),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||s6.getNormalMatrix(e),r=this.coplanarPoint(Yv).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 fa=new as,pp=new k;class bg{constructor(e=new mo,t=new mo,i=new mo,r=new mo,s=new mo,o=new mo){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){const t=this.planes,i=e.elements,r=i[0],s=i[1],o=i[2],a=i[3],l=i[4],f=i[5],h=i[6],d=i[7],p=i[8],v=i[9],y=i[10],_=i[11],M=i[12],m=i[13],S=i[14],w=i[15];return t[0].setComponents(a-r,d-l,_-p,w-M).normalize(),t[1].setComponents(a+r,d+l,_+p,w+M).normalize(),t[2].setComponents(a+s,d+f,_+v,w+m).normalize(),t[3].setComponents(a-s,d-f,_-v,w-m).normalize(),t[4].setComponents(a-o,d-h,_-y,w-S).normalize(),t[5].setComponents(a+o,d+h,_+y,w+S).normalize(),this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),fa.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),fa.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(fa)}intersectsSprite(e){return fa.center.set(0,0,0),fa.radius=.7071067811865476,fa.applyMatrix4(e.matrixWorld),this.intersectsSphere(fa)}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,pp.y=r.normal.y>0?e.max.y:e.min.y,pp.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(pp)<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 HL(){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 o6(n,e){const t=e.isWebGL2,i=new WeakMap;function r(f,h){const d=f.array,p=f.usage,v=n.createBuffer();n.bindBuffer(h,v),n.bufferData(h,d,p),f.onUploadCallback();let y;if(d instanceof Float32Array)y=5126;else if(d instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)y=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else y=5123;else if(d instanceof Int16Array)y=5122;else if(d instanceof Uint32Array)y=5125;else if(d instanceof Int32Array)y=5124;else if(d instanceof Int8Array)y=5120;else if(d instanceof Uint8Array)y=5121;else if(d instanceof Uint8ClampedArray)y=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:v,type:y,bytesPerElement:d.BYTES_PER_ELEMENT,version:f.version}}function s(f,h,d){const p=h.array,v=h.updateRange;n.bindBuffer(d,f),v.count===-1?n.bufferSubData(d,0,p):(t?n.bufferSubData(d,v.offset*p.BYTES_PER_ELEMENT,p,v.offset,v.count):n.bufferSubData(d,v.offset*p.BYTES_PER_ELEMENT,p.subarray(v.offset,v.offset+v.count)),v.count=-1),h.onUploadCallback()}function o(f){return f.isInterleavedBufferAttribute&&(f=f.data),i.get(f)}function a(f){f.isInterleavedBufferAttribute&&(f=f.data);const h=i.get(f);h&&(n.deleteBuffer(h.buffer),i.delete(f))}function l(f,h){if(f.isGLBufferAttribute){const p=i.get(f);(!p||p.version 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`,x6=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,_6=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,S6=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,w6=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,M6=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,A6=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,E6=`#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`,b6=`#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; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef USE_CLEARCOAT - vec3 clearcoatNormal; -#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`,T6=`#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_v0 0.339 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_v1 0.276 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_v4 0.046 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_v5 0.016 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_v6 0.0038 - #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`,C6=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,P6=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,L6=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,R6=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,I6=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,D6="gl_FragColor = linearToOutputTexel( gl_FragColor );",N6=`vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 LinearTosRGB( 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 ); -}`,k6=`#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`,O6=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,U6=`#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`,z6=`#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`,F6=`#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`,B6=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,V6=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,H6=`#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`,W6=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,G6=`#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 -}`,j6=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,X6=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,Y6=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,q6=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, 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`,Z6=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometry.position; - 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 GeometricContext geometry, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometry.position; - 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`,J6=`#if defined( USE_ENVMAP ) - vec3 getIBLIrradiance( const in vec3 normal ) { - #if defined( 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 ) { - #if defined( 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 - } -#endif`,K6=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,Q6=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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`,$6=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,eH=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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`,tH=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -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`,nH=`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 -}; -vec3 clearcoatSpecular = vec3( 0.0 ); -vec3 sheenSpecular = 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_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 - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometry.normal, geometry.viewDir, 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 ); -}`,iH=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef USE_CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometry.viewDir ) ); - 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, geometry, 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, geometry, 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, geometry, 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, geometry, 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, geometry, 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, geometry, 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, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,rH=`#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( geometry.normal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness ); - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,sH=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,oH=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,aH=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,lH=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,uH=`#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`,cH=`#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`,fH=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,hH=`#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`,dH=`#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`,pH=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,mH=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,gH=`#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`,vH=`#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`,yH=`#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`,xH=`#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`,_H=`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 -#ifdef USE_NORMALMAP_TANGENTSPACE - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv ); - #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 geometryNormal = normal;`,SH=`#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`,wH=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,MH=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,AH=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,EH=`#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 ) ) - 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`,bH=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,TH=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,CH=`#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`,PH=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,LH=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha + 0.1; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,RH=`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 ); -}`,IH=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,DH=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,NH=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,kH=`#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`,OH=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,UH=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,zH=`#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`,FH=`#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`,BH=`#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`,VH=`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; -}`,HH=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,WH=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } -#endif`,GH=`#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`,jH=`#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`,XH=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,YH=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,qH=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,ZH=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return 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 ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,JH=`#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 transmission = 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, transmission.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); -#endif`,KH=`#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, vec2 fullSize, 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; - - vec2 lodFudge = pow( 1.95, lod ) / fullSize; - 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; - vec2 fullSize = vec2( textureSize( sampler, 0 ) ); - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), fullSize, floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), fullSize, 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 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return radiance; - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance; - } - } - 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 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance ); - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); - } -#endif`,QH=`#ifdef USE_UV - 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_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`,$H=`#ifdef USE_UV - varying vec2 vUv; -#endif -#ifdef USE_UV2 - attribute vec2 uv2; -#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_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`,e8=`#ifdef USE_UV - 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_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`,t8=`#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_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const n8=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,i8=`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 -}`,r8=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,s8=`#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 -}`,o8=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,a8=`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 -}`,l8=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,u8=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#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 - 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 -}`,c8=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,f8=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,h8=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,d8=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,p8=`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 -}`,m8=`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 -}`,g8=`#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #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 -}`,v8=`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 -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #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 -}`,y8=`#define LAMBERT -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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,x8=`#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 -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 - #include -}`,_8=`#define MATCAP -varying vec3 vViewPosition; -#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; -}`,S8=`#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 -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #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 -}`,w8=`#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 -void main() { - #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 -}`,M8=`#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 -}`,A8=`#define PHONG -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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,E8=`#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 -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 + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,b8=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,T8=`#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 -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #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 - 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 + sheenSpecular; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,C8=`#define TOON -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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,P8=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #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 - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,L8=`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 -}`,R8=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,I8=`#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,D8=`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 -}`,N8=`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 -}`,k8=`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 - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,mt={alphamap_fragment:a6,alphamap_pars_fragment:l6,alphatest_fragment:u6,alphatest_pars_fragment:c6,aomap_fragment:f6,aomap_pars_fragment:h6,begin_vertex:d6,beginnormal_vertex:p6,bsdfs:m6,iridescence_fragment:g6,bumpmap_pars_fragment:v6,clipping_planes_fragment:y6,clipping_planes_pars_fragment:x6,clipping_planes_pars_vertex:_6,clipping_planes_vertex:S6,color_fragment:w6,color_pars_fragment:M6,color_pars_vertex:A6,color_vertex:E6,common:b6,cube_uv_reflection_fragment:T6,defaultnormal_vertex:C6,displacementmap_pars_vertex:P6,displacementmap_vertex:L6,emissivemap_fragment:R6,emissivemap_pars_fragment:I6,encodings_fragment:D6,encodings_pars_fragment:N6,envmap_fragment:k6,envmap_common_pars_fragment:O6,envmap_pars_fragment:U6,envmap_pars_vertex:z6,envmap_physical_pars_fragment:J6,envmap_vertex:F6,fog_vertex:B6,fog_pars_vertex:V6,fog_fragment:H6,fog_pars_fragment:W6,gradientmap_pars_fragment:G6,lightmap_fragment:j6,lightmap_pars_fragment:X6,lights_lambert_fragment:Y6,lights_lambert_pars_fragment:q6,lights_pars_begin:Z6,lights_toon_fragment:K6,lights_toon_pars_fragment:Q6,lights_phong_fragment:$6,lights_phong_pars_fragment:eH,lights_physical_fragment:tH,lights_physical_pars_fragment:nH,lights_fragment_begin:iH,lights_fragment_maps:rH,lights_fragment_end:sH,logdepthbuf_fragment:oH,logdepthbuf_pars_fragment:aH,logdepthbuf_pars_vertex:lH,logdepthbuf_vertex:uH,map_fragment:cH,map_pars_fragment:fH,map_particle_fragment:hH,map_particle_pars_fragment:dH,metalnessmap_fragment:pH,metalnessmap_pars_fragment:mH,morphcolor_vertex:gH,morphnormal_vertex:vH,morphtarget_pars_vertex:yH,morphtarget_vertex:xH,normal_fragment_begin:_H,normal_fragment_maps:SH,normal_pars_fragment:wH,normal_pars_vertex:MH,normal_vertex:AH,normalmap_pars_fragment:EH,clearcoat_normal_fragment_begin:bH,clearcoat_normal_fragment_maps:TH,clearcoat_pars_fragment:CH,iridescence_pars_fragment:PH,output_fragment:LH,packing:RH,premultiplied_alpha_fragment:IH,project_vertex:DH,dithering_fragment:NH,dithering_pars_fragment:kH,roughnessmap_fragment:OH,roughnessmap_pars_fragment:UH,shadowmap_pars_fragment:zH,shadowmap_pars_vertex:FH,shadowmap_vertex:BH,shadowmask_pars_fragment:VH,skinbase_vertex:HH,skinning_pars_vertex:WH,skinning_vertex:GH,skinnormal_vertex:jH,specularmap_fragment:XH,specularmap_pars_fragment:YH,tonemapping_fragment:qH,tonemapping_pars_fragment:ZH,transmission_fragment:JH,transmission_pars_fragment:KH,uv_pars_fragment:QH,uv_pars_vertex:$H,uv_vertex:e8,worldpos_vertex:t8,background_vert:n8,background_frag:i8,backgroundCube_vert:r8,backgroundCube_frag:s8,cube_vert:o8,cube_frag:a8,depth_vert:l8,depth_frag:u8,distanceRGBA_vert:c8,distanceRGBA_frag:f8,equirect_vert:h8,equirect_frag:d8,linedashed_vert:p8,linedashed_frag:m8,meshbasic_vert:g8,meshbasic_frag:v8,meshlambert_vert:y8,meshlambert_frag:x8,meshmatcap_vert:_8,meshmatcap_frag:S8,meshnormal_vert:w8,meshnormal_frag:M8,meshphong_vert:A8,meshphong_frag:E8,meshphysical_vert:b8,meshphysical_frag:T8,meshtoon_vert:C8,meshtoon_frag:P8,points_vert:L8,points_frag:R8,shadow_vert:I8,shadow_frag:D8,sprite_vert:N8,sprite_frag:k8},De={common:{diffuse:{value:new Fe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Mt},alphaMap:{value:null},alphaMapTransform:{value:new Mt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Mt}},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 Mt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Mt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Mt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Mt},normalScale:{value:new ye(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Mt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Mt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Mt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Mt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Fe(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 Fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Mt}},sprite:{diffuse:{value:new Fe(16777215)},opacity:{value:1},center:{value:new ye(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Mt},alphaMap:{value:null},alphaTest:{value:0}}},Lr={basic:{uniforms:fi([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.fog]),vertexShader:mt.meshbasic_vert,fragmentShader:mt.meshbasic_frag},lambert:{uniforms:fi([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Fe(0)}}]),vertexShader:mt.meshlambert_vert,fragmentShader:mt.meshlambert_frag},phong:{uniforms:fi([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Fe(0)},specular:{value:new Fe(1118481)},shininess:{value:30}}]),vertexShader:mt.meshphong_vert,fragmentShader:mt.meshphong_frag},standard:{uniforms:fi([De.common,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.roughnessmap,De.metalnessmap,De.fog,De.lights,{emissive:{value:new Fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag},toon:{uniforms:fi([De.common,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.gradientmap,De.fog,De.lights,{emissive:{value:new Fe(0)}}]),vertexShader:mt.meshtoon_vert,fragmentShader:mt.meshtoon_frag},matcap:{uniforms:fi([De.common,De.bumpmap,De.normalmap,De.displacementmap,De.fog,{matcap:{value:null}}]),vertexShader:mt.meshmatcap_vert,fragmentShader:mt.meshmatcap_frag},points:{uniforms:fi([De.points,De.fog]),vertexShader:mt.points_vert,fragmentShader:mt.points_frag},dashed:{uniforms:fi([De.common,De.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:mt.linedashed_vert,fragmentShader:mt.linedashed_frag},depth:{uniforms:fi([De.common,De.displacementmap]),vertexShader:mt.depth_vert,fragmentShader:mt.depth_frag},normal:{uniforms:fi([De.common,De.bumpmap,De.normalmap,De.displacementmap,{opacity:{value:1}}]),vertexShader:mt.meshnormal_vert,fragmentShader:mt.meshnormal_frag},sprite:{uniforms:fi([De.sprite,De.fog]),vertexShader:mt.sprite_vert,fragmentShader:mt.sprite_frag},background:{uniforms:{uvTransform:{value:new Mt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:mt.background_vert,fragmentShader:mt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:mt.backgroundCube_vert,fragmentShader:mt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:mt.cube_vert,fragmentShader:mt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:mt.equirect_vert,fragmentShader:mt.equirect_frag},distanceRGBA:{uniforms:fi([De.common,De.displacementmap,{referencePosition:{value:new k},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:mt.distanceRGBA_vert,fragmentShader:mt.distanceRGBA_frag},shadow:{uniforms:fi([De.lights,De.fog,{color:{value:new Fe(0)},opacity:{value:1}}]),vertexShader:mt.shadow_vert,fragmentShader:mt.shadow_frag}};Lr.physical={uniforms:fi([Lr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Mt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Mt},clearcoatNormalScale:{value:new ye(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Mt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Mt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Mt},sheen:{value:0},sheenColor:{value:new Fe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Mt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Mt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Mt},transmissionSamplerSize:{value:new ye},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Mt},attenuationDistance:{value:0},attenuationColor:{value:new Fe(0)},specularColor:{value:new Fe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Mt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Mt}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag};const mp={r:0,b:0,g:0};function O8(n,e,t,i,r,s,o){const a=new Fe(0);let l=s===!0?0:1,f,h,d=null,p=0,v=null;function y(M,m){let S=!1,w=m.isScene===!0?m.background:null;w&&w.isTexture&&(w=(m.backgroundBlurriness>0?t:e).get(w));const A=n.xr,b=A.getSession&&A.getSession();b&&b.environmentBlendMode==="additive"&&(w=null),w===null?_(a,l):w&&w.isColor&&(_(w,1),S=!0),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),w&&(w.isCubeTexture||w.mapping===Wu)?(h===void 0&&(h=new Fn(new Jo(1,1,1),new rs({name:"BackgroundCubeMaterial",uniforms:Nu(Lr.backgroundCube.uniforms),vertexShader:Lr.backgroundCube.vertexShader,fragmentShader:Lr.backgroundCube.fragmentShader,side:mi,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(P,I,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=w,h.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,h.material.toneMapped=w.encoding!==zt,(d!==w||p!==w.version||v!==n.toneMapping)&&(h.material.needsUpdate=!0,d=w,p=w.version,v=n.toneMapping),h.layers.enableAll(),M.unshift(h,h.geometry,h.material,0,0,null)):w&&w.isTexture&&(f===void 0&&(f=new Fn(new Gu(2,2),new rs({name:"BackgroundMaterial",uniforms:Nu(Lr.background.uniforms),vertexShader:Lr.background.vertexShader,fragmentShader:Lr.background.fragmentShader,side:Bs,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=w,f.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,f.material.toneMapped=w.encoding!==zt,w.matrixAutoUpdate===!0&&w.updateMatrix(),f.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||p!==w.version||v!==n.toneMapping)&&(f.material.needsUpdate=!0,d=w,p=w.version,v=n.toneMapping),f.layers.enableAll(),M.unshift(f,f.geometry,f.material,0,0,null))}function _(M,m){M.getRGB(mp,BL(n)),i.buffers.color.setClear(mp.r,mp.g,mp.b,m,o)}return{getClearColor:function(){return a},setClearColor:function(M,m=1){a.set(M),l=m,_(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(M){l=M,_(a,l)},render:y}}function U8(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},l=M(null);let f=l,h=!1;function d(X,Z,se,ae,D){let V=!1;if(o){const B=_(ae,se,Z);f!==B&&(f=B,v(f.object)),V=m(X,ae,se,D),V&&S(X,ae,se,D)}else{const B=Z.wireframe===!0;(f.geometry!==ae.id||f.program!==se.id||f.wireframe!==B)&&(f.geometry=ae.id,f.program=se.id,f.wireframe=B,V=!0)}D!==null&&t.update(D,34963),(V||h)&&(h=!1,L(X,Z,se,ae),D!==null&&n.bindBuffer(34963,t.get(D).buffer))}function p(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function v(X){return i.isWebGL2?n.bindVertexArray(X):s.bindVertexArrayOES(X)}function y(X){return i.isWebGL2?n.deleteVertexArray(X):s.deleteVertexArrayOES(X)}function _(X,Z,se){const ae=se.wireframe===!0;let D=a[X.id];D===void 0&&(D={},a[X.id]=D);let V=D[Z.id];V===void 0&&(V={},D[Z.id]=V);let B=V[ae];return B===void 0&&(B=M(p()),V[ae]=B),B}function M(X){const Z=[],se=[],ae=[];for(let D=0;D=0){const ue=D[$];let Ee=V[$];if(Ee===void 0&&($==="instanceMatrix"&&X.instanceMatrix&&(Ee=X.instanceMatrix),$==="instanceColor"&&X.instanceColor&&(Ee=X.instanceColor)),ue===void 0||ue.attribute!==Ee||Ee&&ue.data!==Ee.data)return!0;B++}return f.attributesNum!==B||f.index!==ae}function S(X,Z,se,ae){const D={},V=Z.attributes;let B=0;const te=se.getAttributes();for(const $ in te)if(te[$].location>=0){let ue=V[$];ue===void 0&&($==="instanceMatrix"&&X.instanceMatrix&&(ue=X.instanceMatrix),$==="instanceColor"&&X.instanceColor&&(ue=X.instanceColor));const Ee={};Ee.attribute=ue,ue&&ue.data&&(Ee.data=ue.data),D[$]=Ee,B++}f.attributes=D,f.attributesNum=B,f.index=ae}function w(){const X=f.newAttributes;for(let Z=0,se=X.length;Z=0){let ee=D[te];if(ee===void 0&&(te==="instanceMatrix"&&X.instanceMatrix&&(ee=X.instanceMatrix),te==="instanceColor"&&X.instanceColor&&(ee=X.instanceColor)),ee!==void 0){const ue=ee.normalized,Ee=ee.itemSize,we=t.get(ee);if(we===void 0)continue;const Q=we.buffer,Xe=we.type,Ye=we.bytesPerElement;if(ee.isInterleavedBufferAttribute){const xe=ee.data,Me=xe.stride,ge=ee.offset;if(xe.isInstancedInterleavedBuffer){for(let oe=0;oe<$.locationSize;oe++)b($.location+oe,xe.meshPerAttribute);X.isInstancedMesh!==!0&&ae._maxInstanceCount===void 0&&(ae._maxInstanceCount=xe.meshPerAttribute*xe.count)}else for(let oe=0;oe<$.locationSize;oe++)A($.location+oe);n.bindBuffer(34962,Q);for(let oe=0;oe<$.locationSize;oe++)I($.location+oe,Ee/$.locationSize,Xe,ue,Me*Ye,(ge+Ee/$.locationSize*oe)*Ye)}else{if(ee.isInstancedBufferAttribute){for(let xe=0;xe<$.locationSize;xe++)b($.location+xe,ee.meshPerAttribute);X.isInstancedMesh!==!0&&ae._maxInstanceCount===void 0&&(ae._maxInstanceCount=ee.meshPerAttribute*ee.count)}else for(let xe=0;xe<$.locationSize;xe++)A($.location+xe);n.bindBuffer(34962,Q);for(let xe=0;xe<$.locationSize;xe++)I($.location+xe,Ee/$.locationSize,Xe,ue,Ee*Ye,Ee/$.locationSize*xe*Ye)}}else if(B!==void 0){const ue=B[te];if(ue!==void 0)switch(ue.length){case 2:n.vertexAttrib2fv($.location,ue);break;case 3:n.vertexAttrib3fv($.location,ue);break;case 4:n.vertexAttrib4fv($.location,ue);break;default:n.vertexAttrib1fv($.location,ue)}}}}P()}function C(){J();for(const X in a){const Z=a[X];for(const se in Z){const ae=Z[se];for(const D in ae)y(ae[D].object),delete ae[D];delete Z[se]}delete a[X]}}function R(X){if(a[X.id]===void 0)return;const Z=a[X.id];for(const se in Z){const ae=Z[se];for(const D in ae)y(ae[D].object),delete ae[D];delete Z[se]}delete a[X.id]}function W(X){for(const Z in a){const se=a[Z];if(se[X.id]===void 0)continue;const ae=se[X.id];for(const D in ae)y(ae[D].object),delete ae[D];delete se[X.id]}}function J(){j(),h=!0,f!==l&&(f=l,v(f.object))}function j(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:d,reset:J,resetDefaultState:j,dispose:C,releaseStatesOfGeometry:R,releaseStatesOfProgram:W,initAttributes:w,enableAttribute:A,disableUnusedAttributes:P}}function z8(n,e,t,i){const r=i.isWebGL2;let s;function o(f){s=f}function a(f,h){n.drawArrays(s,f,h),t.update(h,s,1)}function l(f,h,d){if(d===0)return;let p,v;if(r)p=n,v="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),v="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[v](s,f,h,d),t.update(h,s,d)}this.setMode=o,this.render=a,this.renderInstances=l}function F8(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const I=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(I.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(I){if(I==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";I="mediump"}return I==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const f=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,d=n.getParameter(34930),p=n.getParameter(35660),v=n.getParameter(3379),y=n.getParameter(34076),_=n.getParameter(34921),M=n.getParameter(36347),m=n.getParameter(36348),S=n.getParameter(36349),w=p>0,A=o||e.has("OES_texture_float"),b=w&&A,P=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:f,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:v,maxCubemapSize:y,maxAttributes:_,maxVertexUniforms:M,maxVaryings:m,maxFragmentUniforms:S,vertexTextures:w,floatFragmentTextures:A,floatVertexTextures:b,maxSamples:P}}function B8(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new mo,a=new Mt,l={value:null,needsUpdate:!1};this.uniform=l,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,_=d.clipIntersection,M=d.clipShadows,m=n.get(d);if(!r||y===null||y.length===0||s&&!M)s?h(null):f();else{const S=s?0:i,w=S*4;let A=m.clippingState||null;l.value=A,A=h(y,p,w,v);for(let b=0;b!==w;++b)A[b]=t[b];m.clippingState=A,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function f(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,v,y){const _=d!==null?d.length:0;let M=null;if(_!==0){if(M=l.value,y!==!0||M===null){const m=v+_*4,S=p.matrixWorldInverse;a.getNormalMatrix(S),(M===null||M.length0){const f=new aS(l.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 l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class ns extends mh{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,l=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,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),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 uu=4,fb=[.125,.215,.35,.446,.526,.582],Ea=20,qv=new ns,hb=new Fe;let Zv=null;const Ma=(1+Math.sqrt(5))/2,Ol=1/Ma,db=[new k(1,1,1),new k(-1,1,1),new k(1,1,-1),new k(-1,1,-1),new k(0,Ma,Ol),new k(0,Ma,-Ol),new k(Ol,0,Ma),new k(-Ol,0,Ma),new k(Ma,Ol,0),new k(-Ma,Ol,0)];class f_{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){Zv=this._renderer.getRenderTarget(),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=gb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=mb(),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?w:0,w,w),h.setRenderTarget(r),_&&h.render(y,a),h.render(e,a)}y.geometry.dispose(),y.material.dispose(),h.toneMapping=p,h.autoClear=d,e.background=M}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===zo||e.mapping===Fo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=gb()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=mb());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Fn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;gp(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,qv)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;rEa&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${M} samples when the maximum is set to ${Ea}`);const m=[];let S=0;for(let I=0;Iw-uu?r-w+uu:0),P=4*(this._cubeSize-A);gp(t,b,P,3*A,2*A),l.setRenderTarget(t),l.render(d,qv)}}function H8(n){const e=[],t=[],i=[];let r=n;const s=n-uu+1+fb.length;for(let o=0;on-uu?l=fb[o-n+uu-1]:o===0&&(l=0),i.push(l);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,_=3,M=2,m=1,S=new Float32Array(_*y*v),w=new Float32Array(M*y*v),A=new Float32Array(m*y*v);for(let P=0;P2?0:-1,C=[I,L,0,I+2/3,L,0,I+2/3,L+1,0,I,L,0,I+2/3,L+1,0,I,L+1,0];S.set(C,_*y*P),w.set(p,M*y*P);const R=[P,P,P,P,P,P];A.set(R,m*y*P)}const b=new dt;b.setAttribute("position",new Bt(S,_)),b.setAttribute("uv",new Bt(w,M)),b.setAttribute("faceIndex",new Bt(A,m)),e.push(b),r>uu&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function pb(n,e,t){const i=new Or(n,e,t);return i.texture.mapping=Wu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function gp(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function W8(n,e,t){const i=new Float32Array(Ea),r=new k(0,1,0);return new rs({name:"SphericalGaussianBlur",defines:{n:Ea,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:lS(),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:Ns,depthTest:!1,depthWrite:!1})}function mb(){return new rs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:lS(),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:Ns,depthTest:!1,depthWrite:!1})}function gb(){return new rs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:lS(),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:Ns,depthTest:!1,depthWrite:!1})}function lS(){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 G8(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,f=l===Uf||l===zf,h=l===zo||l===Fo;if(f||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return t===null&&(t=new f_(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 f_(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 l=0;const f=6;for(let h=0;he.maxTextureSize&&(W=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const J=new Float32Array(R*W*4*_),j=new Eg(J,R,W,_);j.type=Ls,j.needsUpdate=!0;const X=C*4;for(let se=0;se<_;se++){const ae=P[se],D=I[se],V=L[se],B=R*W*4*se;for(let te=0;te0)return n;const r=e*t;let s=vb[r];if(s===void 0&&(s=new Float32Array(r),vb[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 Ln(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}function jW(n){switch(n){case Vs:return["Linear","( value )"];case zt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function Ab(n,e,t){const i=n.getShaderParameter(e,35713),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+` - -`+GW(n.getShaderSource(e),o)}else return r}function XW(n,e){const t=jW(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function YW(n,e){let t;switch(e){case uL:t="Linear";break;case cL:t="Reinhard";break;case fL:t="OptimizedCineon";break;case J1:t="ACESFilmic";break;case hL:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function qW(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(Yc).join(` -`)}function ZW(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function JW(n,e){const t={},i=n.getProgramParameter(e,35721);for(let r=0;r/gm;function h_(n){return n.replace(KW,QW)}function QW(n,e){const t=mt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return h_(t)}const $W=/#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 Tb(n){return n.replace($W,eG)}function eG(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(M+=` -`),m=[v,y].filter(Yc).join(` -`),m.length>0&&(m+=` -`)):(M=[Cb(t),"#define SHADER_NAME "+t.shaderName,y,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.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.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.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?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs2?"#define USE_UV2":"",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 "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",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_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(Yc).join(` -`),m=[v,Cb(t),"#define SHADER_NAME "+t.shaderName,y,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.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.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.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs2?"#define USE_UV2":"",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 "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Nr?"#define TONE_MAPPING":"",t.toneMapping!==Nr?mt.tonemapping_pars_fragment:"",t.toneMapping!==Nr?YW("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",mt.encodings_pars_fragment,XW("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(Yc).join(` -`)),o=h_(o),o=Eb(o,t),o=bb(o,t),a=h_(a),a=Eb(a,t),a=bb(a,t),o=Tb(o),a=Tb(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(S=`#version 300 es -`,M=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+M,m=["#define varying in",t.glslVersion===u_?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===u_?"":"#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(` -`)+` -`+m);const w=S+M+o,A=S+m+a,b=Mb(r,35633,w),P=Mb(r,35632,A);if(r.attachShader(_,b),r.attachShader(_,P),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_),n.debug.checkShaderErrors){const C=r.getProgramInfoLog(_).trim(),R=r.getShaderInfoLog(b).trim(),W=r.getShaderInfoLog(P).trim();let J=!0,j=!0;if(r.getProgramParameter(_,35714)===!1)if(J=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,b,P);else{const X=Ab(r,b,"vertex"),Z=Ab(r,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,35715)+` - -Program Info Log: `+C+` -`+X+` -`+Z)}else C!==""?console.warn("THREE.WebGLProgram: Program Info Log:",C):(R===""||W==="")&&(j=!1);j&&(this.diagnostics={runnable:J,programLog:C,vertexShader:{log:R,prefix:M},fragmentShader:{log:W,prefix:m}})}r.deleteShader(b),r.deleteShader(P);let I;this.getUniforms=function(){return I===void 0&&(I=new om(r,_)),I};let L;return this.getAttributes=function(){return L===void 0&&(L=JW(r,_)),L},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.name=t.shaderName,this.id=WW++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=b,this.fragmentShader=P,this}let aG=0;class lG{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 uG(e),t.set(e,i)),i}}class uG{constructor(e){this.id=aG++,this.code=e,this.usedTimes=0}}function cG(n,e,t,i,r,s,o){const a=new Fa,l=new lG,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 _(C){return C===1?"uv2":"uv"}function M(C,R,W,J,j){const X=J.fog,Z=j.geometry,se=C.isMeshStandardMaterial?J.environment:null,ae=(C.isMeshStandardMaterial?t:e).get(C.envMap||se),D=ae&&ae.mapping===Wu?ae.image.height:null,V=y[C.type];C.precision!==null&&(v=r.getMaxPrecision(C.precision),v!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",v,"instead."));const B=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,te=B!==void 0?B.length:0;let $=0;Z.morphAttributes.position!==void 0&&($=1),Z.morphAttributes.normal!==void 0&&($=2),Z.morphAttributes.color!==void 0&&($=3);let ee,ue,Ee,we;if(V){const Ue=Lr[V];ee=Ue.vertexShader,ue=Ue.fragmentShader}else ee=C.vertexShader,ue=C.fragmentShader,l.update(C),Ee=l.getVertexShaderID(C),we=l.getFragmentShaderID(C);const Q=n.getRenderTarget(),Xe=j.isInstancedMesh===!0,Ye=!!C.map,xe=!!C.matcap,Me=!!ae,ge=!!C.aoMap,oe=!!C.lightMap,_e=!!C.bumpMap,ke=!!C.normalMap,Ie=!!C.displacementMap,Ge=!!C.emissiveMap,qe=!!C.metalnessMap,je=!!C.roughnessMap,nt=C.clearcoat>0,_t=C.iridescence>0,z=C.sheen>0,N=C.transmission>0,le=nt&&!!C.clearcoatMap,be=nt&&!!C.clearcoatNormalMap,Te=nt&&!!C.clearcoatRoughnessMap,Re=_t&&!!C.iridescenceMap,et=_t&&!!C.iridescenceThicknessMap,ze=z&&!!C.sheenColorMap,pe=z&&!!C.sheenRoughnessMap,He=!!C.specularMap,G=!!C.specularColorMap,de=!!C.specularIntensityMap,Se=N&&!!C.transmissionMap,Pe=N&&!!C.thicknessMap,Qe=!!C.gradientMap,ct=!!C.alphaMap,kt=C.alphaTest>0,Y=!!C.extensions,fe=!!Z.attributes.uv2;return{isWebGL2:h,shaderID:V,shaderName:C.type,vertexShader:ee,fragmentShader:ue,defines:C.defines,customVertexShaderID:Ee,customFragmentShaderID:we,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:v,instancing:Xe,instancingColor:Xe&&j.instanceColor!==null,supportsVertexTextures:p,outputEncoding:Q===null?n.outputEncoding:Q.isXRRenderTarget===!0?Q.texture.encoding:Vs,map:Ye,matcap:xe,envMap:Me,envMapMode:Me&&ae.mapping,envMapCubeUVHeight:D,aoMap:ge,lightMap:oe,bumpMap:_e,normalMap:ke,displacementMap:p&&Ie,emissiveMap:Ge,normalMapObjectSpace:ke&&C.normalMapType===DL,normalMapTangentSpace:ke&&C.normalMapType===qo,decodeVideoTexture:Ye&&C.map.isVideoTexture===!0&&C.map.encoding===zt,metalnessMap:qe,roughnessMap:je,clearcoat:nt,clearcoatMap:le,clearcoatNormalMap:be,clearcoatRoughnessMap:Te,iridescence:_t,iridescenceMap:Re,iridescenceThicknessMap:et,sheen:z,sheenColorMap:ze,sheenRoughnessMap:pe,specularMap:He,specularColorMap:G,specularIntensityMap:de,transmission:N,transmissionMap:Se,thicknessMap:Pe,gradientMap:Qe,opaque:C.transparent===!1&&C.blending===Oa,alphaMap:ct,alphaTest:kt,combine:C.combine,mapUv:Ye&&_(C.map.channel),aoMapUv:ge&&_(C.aoMap.channel),lightMapUv:oe&&_(C.lightMap.channel),bumpMapUv:_e&&_(C.bumpMap.channel),normalMapUv:ke&&_(C.normalMap.channel),displacementMapUv:Ie&&_(C.displacementMap.channel),emissiveMapUv:Ge&&_(C.emissiveMap.channel),metalnessMapUv:qe&&_(C.metalnessMap.channel),roughnessMapUv:je&&_(C.roughnessMap.channel),clearcoatMapUv:le&&_(C.clearcoatMap.channel),clearcoatNormalMapUv:be&&_(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Te&&_(C.clearcoatRoughnessMap.channel),iridescenceMapUv:Re&&_(C.iridescenceMap.channel),iridescenceThicknessMapUv:et&&_(C.iridescenceThicknessMap.channel),sheenColorMapUv:ze&&_(C.sheenColorMap.channel),sheenRoughnessMapUv:pe&&_(C.sheenRoughnessMap.channel),specularMapUv:He&&_(C.specularMap.channel),specularColorMapUv:G&&_(C.specularColorMap.channel),specularIntensityMapUv:de&&_(C.specularIntensityMap.channel),transmissionMapUv:Se&&_(C.transmissionMap.channel),thicknessMapUv:Pe&&_(C.thicknessMap.channel),alphaMapUv:ct&&_(C.alphaMap.channel),vertexTangents:ke&&!!Z.attributes.tangent,vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,vertexUvs2:fe,pointsUvs:j.isPoints===!0&&!!Z.attributes.uv&&(Ye||ct),fog:!!X,useFog:C.fog===!0,fogExp2:X&&X.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:j.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:te,morphTextureStride:$,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,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:C.dithering,shadowMapEnabled:n.shadowMap.enabled&&W.length>0,shadowMapType:n.shadowMap.type,toneMapping:C.toneMapped?n.toneMapping:Nr,useLegacyLights:n.useLegacyLights,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Rr,flipSided:C.side===mi,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:Y&&C.extensions.derivatives===!0,extensionFragDepth:Y&&C.extensions.fragDepth===!0,extensionDrawBuffers:Y&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:Y&&C.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),customProgramCacheKey:C.customProgramCacheKey()}}function m(C){const R=[];if(C.shaderID?R.push(C.shaderID):(R.push(C.customVertexShaderID),R.push(C.customFragmentShaderID)),C.defines!==void 0)for(const W in C.defines)R.push(W),R.push(C.defines[W]);return C.isRawShaderMaterial===!1&&(S(R,C),w(R,C),R.push(n.outputEncoding)),R.push(C.customProgramCacheKey),R.join()}function S(C,R){C.push(R.precision),C.push(R.outputEncoding),C.push(R.envMapMode),C.push(R.envMapCubeUVHeight),C.push(R.mapUv),C.push(R.alphaMapUv),C.push(R.lightMapUv),C.push(R.aoMapUv),C.push(R.bumpMapUv),C.push(R.normalMapUv),C.push(R.displacementMapUv),C.push(R.emissiveMapUv),C.push(R.metalnessMapUv),C.push(R.roughnessMapUv),C.push(R.clearcoatMapUv),C.push(R.clearcoatNormalMapUv),C.push(R.clearcoatRoughnessMapUv),C.push(R.iridescenceMapUv),C.push(R.iridescenceThicknessMapUv),C.push(R.sheenColorMapUv),C.push(R.sheenRoughnessMapUv),C.push(R.specularMapUv),C.push(R.specularColorMapUv),C.push(R.specularIntensityMapUv),C.push(R.transmissionMapUv),C.push(R.thicknessMapUv),C.push(R.combine),C.push(R.fogExp2),C.push(R.sizeAttenuation),C.push(R.morphTargetsCount),C.push(R.morphAttributeCount),C.push(R.numDirLights),C.push(R.numPointLights),C.push(R.numSpotLights),C.push(R.numSpotLightMaps),C.push(R.numHemiLights),C.push(R.numRectAreaLights),C.push(R.numDirLightShadows),C.push(R.numPointLightShadows),C.push(R.numSpotLightShadows),C.push(R.numSpotLightShadowsWithMaps),C.push(R.shadowMapType),C.push(R.toneMapping),C.push(R.numClippingPlanes),C.push(R.numClipIntersection),C.push(R.depthPacking)}function w(C,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.vertexUvs2&&a.enable(13),R.vertexTangents&&a.enable(14),C.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.decodeVideoTexture&&a.enable(17),R.opaque&&a.enable(18),R.pointsUvs&&a.enable(19),C.push(a.mask)}function A(C){const R=y[C.type];let W;if(R){const J=Lr[R];W=VL.clone(J.uniforms)}else W=C.uniforms;return W}function b(C,R){let W;for(let J=0,j=f.length;J0?i.push(m):v.transparent===!0?r.push(m):t.push(m)}function l(d,p,v,y,_,M){const m=o(d,p,v,y,_,M);v.transmission>0?i.unshift(m):v.transparent===!0?r.unshift(m):t.unshift(m)}function f(d,p){t.length>1&&t.sort(d||hG),i.length>1&&i.sort(p||Pb),r.length>1&&r.sort(p||Pb)}function h(){for(let d=e,p=n.length;d=s.length?(o=new Lb,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function pG(){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 k,color:new Fe};break;case"SpotLight":t={position:new k,direction:new k,color:new Fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new k,color:new Fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new k,skyColor:new Fe,groundColor:new Fe};break;case"RectAreaLight":t={color:new Fe,position:new k,halfWidth:new k,halfHeight:new k};break}return n[e.id]=t,t}}}function mG(){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 ye};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let gG=0;function vG(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function yG(n,e){const t=new pG,i=mG(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let h=0;h<9;h++)r.probe.push(new k);const s=new k,o=new ot,a=new ot;function l(h,d){let p=0,v=0,y=0;for(let W=0;W<9;W++)r.probe[W].set(0,0,0);let _=0,M=0,m=0,S=0,w=0,A=0,b=0,P=0,I=0,L=0;h.sort(vG);const C=d===!0?Math.PI:1;for(let W=0,J=h.length;W0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=De.LTC_FLOAT_1,r.rectAreaLTC2=De.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=De.LTC_HALF_1,r.rectAreaLTC2=De.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 R=r.hash;(R.directionalLength!==_||R.pointLength!==M||R.spotLength!==m||R.rectAreaLength!==S||R.hemiLength!==w||R.numDirectionalShadows!==A||R.numPointShadows!==b||R.numSpotShadows!==P||R.numSpotMaps!==I)&&(r.directional.length=_,r.spot.length=m,r.rectArea.length=S,r.point.length=M,r.hemi.length=w,r.directionalShadow.length=A,r.directionalShadowMap.length=A,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=P,r.spotShadowMap.length=P,r.directionalShadowMatrix.length=A,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=P+I-L,r.spotLightMap.length=I,r.numSpotLightShadowsWithMaps=L,R.directionalLength=_,R.pointLength=M,R.spotLength=m,R.rectAreaLength=S,R.hemiLength=w,R.numDirectionalShadows=A,R.numPointShadows=b,R.numSpotShadows=P,R.numSpotMaps=I,r.version=gG++)}function f(h,d){let p=0,v=0,y=0,_=0,M=0;const m=d.matrixWorldInverse;for(let S=0,w=h.length;S=a.length?(l=new Rb(n,e),a.push(l)):l=a[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class uS extends Yn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=RL,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 cS 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 _G=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,SG=`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 wG(n,e,t){let i=new bg;const r=new ye,s=new ye,o=new Dt,a=new uS({depthPacking:IL}),l=new cS,f={},h=t.maxTextureSize,d={[Bs]:mi,[mi]:Bs,[Rr]:Rr},p=new rs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ye},radius:{value:4}},vertexShader:_G,fragmentShader:SG}),v=p.clone();v.defines.HORIZONTAL_PASS=1;const y=new dt;y.setAttribute("position",new Bt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Fn(y,p),M=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=X1,this.render=function(A,b,P){if(M.enabled===!1||M.autoUpdate===!1&&M.needsUpdate===!1||A.length===0)return;const I=n.getRenderTarget(),L=n.getActiveCubeFace(),C=n.getActiveMipmapLevel(),R=n.state;R.setBlending(Ns),R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);for(let W=0,J=A.length;Wh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/Z.x),r.x=s.x*Z.x,X.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/Z.y),r.y=s.y*Z.y,X.mapSize.y=s.y)),X.map===null){const ae=this.type!==au?{minFilter:mn,magFilter:mn}:{};X.map=new Or(r.x,r.y,ae),X.map.texture.name=j.name+".shadowMap",X.camera.updateProjectionMatrix()}n.setRenderTarget(X.map),n.clear();const se=X.getViewportCount();for(let ae=0;ae0||b.map&&b.alphaTest>0){const R=L.uuid,W=b.uuid;let J=f[R];J===void 0&&(J={},f[R]=J);let j=J[W];j===void 0&&(j=L.clone(),J[W]=j),L=j}if(L.visible=b.visible,L.wireframe=b.wireframe,I===au?L.side=b.shadowSide!==null?b.shadowSide:b.side:L.side=b.shadowSide!==null?b.shadowSide:d[b.side],L.alphaMap=b.alphaMap,L.alphaTest=b.alphaTest,L.map=b.map,L.clipShadows=b.clipShadows,L.clippingPlanes=b.clippingPlanes,L.clipIntersection=b.clipIntersection,L.displacementMap=b.displacementMap,L.displacementScale=b.displacementScale,L.displacementBias=b.displacementBias,L.wireframeLinewidth=b.wireframeLinewidth,L.linewidth=b.linewidth,P.isPointLight===!0&&L.isMeshDistanceMaterial===!0){const R=n.properties.get(L);R.light=P}return L}function w(A,b,P,I,L){if(A.visible===!1)return;if(A.layers.test(b.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&L===au)&&(!A.frustumCulled||i.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,A.matrixWorld);const W=e.update(A),J=A.material;if(Array.isArray(J)){const j=W.groups;for(let X=0,Z=j.length;X=1):D.indexOf("OpenGL ES")!==-1&&(ae=parseFloat(/^OpenGL ES (\d)/.exec(D)[1]),se=ae>=2);let V=null,B={};const te=n.getParameter(3088),$=n.getParameter(2978),ee=new Dt().fromArray(te),ue=new Dt().fromArray($);function Ee(Y,fe,Ae){const Ue=new Uint8Array(4),Je=n.createTexture();n.bindTexture(Y,Je),n.texParameteri(Y,10241,9728),n.texParameteri(Y,10240,9728);for(let Ot=0;Ot"u"?!1:/OculusBrowser/g.test(navigator.userAgent),y=new WeakMap;let _;const M=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(z,N){return m?new OffscreenCanvas(z,N):jf("canvas")}function w(z,N,le,be){let Te=1;if((z.width>be||z.height>be)&&(Te=be/Math.max(z.width,z.height)),Te<1||N===!0)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap){const Re=N?OL:Math.floor,et=Re(Te*z.width),ze=Re(Te*z.height);_===void 0&&(_=S(et,ze));const pe=le?S(et,ze):_;return pe.width=et,pe.height=ze,pe.getContext("2d").drawImage(z,0,0,et,ze),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+z.width+"x"+z.height+") to ("+et+"x"+ze+")."),pe}else return"data"in z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+z.width+"x"+z.height+")."),z;return z}function A(z){return c_(z.width)&&c_(z.height)}function b(z){return a?!1:z.wrapS!==ri||z.wrapT!==ri||z.minFilter!==mn&&z.minFilter!==vn}function P(z,N){return z.generateMipmaps&&N&&z.minFilter!==mn&&z.minFilter!==vn}function I(z){n.generateMipmap(z)}function L(z,N,le,be,Te=!1){if(a===!1)return N;if(z!==null){if(n[z]!==void 0)return n[z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let Re=N;return N===6403&&(le===5126&&(Re=33326),le===5131&&(Re=33325),le===5121&&(Re=33321)),N===33319&&(le===5126&&(Re=33328),le===5131&&(Re=33327),le===5121&&(Re=33323)),N===6408&&(le===5126&&(Re=34836),le===5131&&(Re=34842),le===5121&&(Re=be===zt&&Te===!1?35907:32856),le===32819&&(Re=32854),le===32820&&(Re=32855)),(Re===33325||Re===33326||Re===33327||Re===33328||Re===34842||Re===34836)&&e.get("EXT_color_buffer_float"),Re}function C(z,N,le){return P(z,le)===!0||z.isFramebufferTexture&&z.minFilter!==mn&&z.minFilter!==vn?Math.log2(Math.max(N.width,N.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?N.mipmaps.length:1}function R(z){return z===mn||z===Wm||z===cf?9728:9729}function W(z){const N=z.target;N.removeEventListener("dispose",W),j(N),N.isVideoTexture&&y.delete(N)}function J(z){const N=z.target;N.removeEventListener("dispose",J),Z(N)}function j(z){const N=i.get(z);if(N.__webglInit===void 0)return;const le=z.source,be=M.get(le);if(be){const Te=be[N.__cacheKey];Te.usedTimes--,Te.usedTimes===0&&X(z),Object.keys(be).length===0&&M.delete(le)}i.remove(z)}function X(z){const N=i.get(z);n.deleteTexture(N.__webglTexture);const le=z.source,be=M.get(le);delete be[N.__cacheKey],o.memory.textures--}function Z(z){const N=z.texture,le=i.get(z),be=i.get(N);if(be.__webglTexture!==void 0&&(n.deleteTexture(be.__webglTexture),o.memory.textures--),z.depthTexture&&z.depthTexture.dispose(),z.isWebGLCubeRenderTarget)for(let Te=0;Te<6;Te++)n.deleteFramebuffer(le.__webglFramebuffer[Te]),le.__webglDepthbuffer&&n.deleteRenderbuffer(le.__webglDepthbuffer[Te]);else{if(n.deleteFramebuffer(le.__webglFramebuffer),le.__webglDepthbuffer&&n.deleteRenderbuffer(le.__webglDepthbuffer),le.__webglMultisampledFramebuffer&&n.deleteFramebuffer(le.__webglMultisampledFramebuffer),le.__webglColorRenderbuffer)for(let Te=0;Te=l&&console.warn("THREE.WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+l),se+=1,z}function V(z){const N=[];return N.push(z.wrapS),N.push(z.wrapT),N.push(z.wrapR||0),N.push(z.magFilter),N.push(z.minFilter),N.push(z.anisotropy),N.push(z.internalFormat),N.push(z.format),N.push(z.type),N.push(z.generateMipmaps),N.push(z.premultiplyAlpha),N.push(z.flipY),N.push(z.unpackAlignment),N.push(z.encoding),N.join()}function B(z,N){const le=i.get(z);if(z.isVideoTexture&&nt(z),z.isRenderTargetTexture===!1&&z.version>0&&le.__version!==z.version){const be=z.image;if(be===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(be.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Xe(le,z,N);return}}t.bindTexture(3553,le.__webglTexture,33984+N)}function te(z,N){const le=i.get(z);if(z.version>0&&le.__version!==z.version){Xe(le,z,N);return}t.bindTexture(35866,le.__webglTexture,33984+N)}function $(z,N){const le=i.get(z);if(z.version>0&&le.__version!==z.version){Xe(le,z,N);return}t.bindTexture(32879,le.__webglTexture,33984+N)}function ee(z,N){const le=i.get(z);if(z.version>0&&le.__version!==z.version){Ye(le,z,N);return}t.bindTexture(34067,le.__webglTexture,33984+N)}const ue={[Ff]:10497,[ri]:33071,[Bf]:33648},Ee={[mn]:9728,[Wm]:9984,[cf]:9986,[vn]:9729,[K1]:9985,[Bo]:9987};function we(z,N,le){if(le?(n.texParameteri(z,10242,ue[N.wrapS]),n.texParameteri(z,10243,ue[N.wrapT]),(z===32879||z===35866)&&n.texParameteri(z,32882,ue[N.wrapR]),n.texParameteri(z,10240,Ee[N.magFilter]),n.texParameteri(z,10241,Ee[N.minFilter])):(n.texParameteri(z,10242,33071),n.texParameteri(z,10243,33071),(z===32879||z===35866)&&n.texParameteri(z,32882,33071),(N.wrapS!==ri||N.wrapT!==ri)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(z,10240,R(N.magFilter)),n.texParameteri(z,10241,R(N.minFilter)),N.minFilter!==mn&&N.minFilter!==vn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const be=e.get("EXT_texture_filter_anisotropic");if(N.magFilter===mn||N.minFilter!==cf&&N.minFilter!==Bo||N.type===Ls&&e.has("OES_texture_float_linear")===!1||a===!1&&N.type===Ru&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||i.get(N).__currentAnisotropy)&&(n.texParameterf(z,be.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,r.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy)}}function Q(z,N){let le=!1;z.__webglInit===void 0&&(z.__webglInit=!0,N.addEventListener("dispose",W));const be=N.source;let Te=M.get(be);Te===void 0&&(Te={},M.set(be,Te));const Re=V(N);if(Re!==z.__cacheKey){Te[Re]===void 0&&(Te[Re]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,le=!0),Te[Re].usedTimes++;const et=Te[z.__cacheKey];et!==void 0&&(Te[z.__cacheKey].usedTimes--,et.usedTimes===0&&X(N)),z.__cacheKey=Re,z.__webglTexture=Te[Re].texture}return le}function Xe(z,N,le){let be=3553;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(be=35866),N.isData3DTexture&&(be=32879);const Te=Q(z,N),Re=N.source;t.bindTexture(be,z.__webglTexture,33984+le);const et=i.get(Re);if(Re.version!==et.__version||Te===!0){t.activeTexture(33984+le),n.pixelStorei(37440,N.flipY),n.pixelStorei(37441,N.premultiplyAlpha),n.pixelStorei(3317,N.unpackAlignment),n.pixelStorei(37443,0);const ze=b(N)&&A(N.image)===!1;let pe=w(N.image,ze,!1,h);pe=_t(N,pe);const He=A(pe)||a,G=s.convert(N.format,N.encoding);let de=s.convert(N.type),Se=L(N.internalFormat,G,de,N.encoding,N.isVideoTexture);we(be,N,He);let Pe;const Qe=N.mipmaps,ct=a&&N.isVideoTexture!==!0,kt=et.__version===void 0||Te===!0,Y=C(N,pe,He);if(N.isDepthTexture)Se=6402,a?N.type===Ls?Se=36012:N.type===So?Se=33190:N.type===Ua?Se=35056:Se=33189:N.type===Ls&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===No&&Se===6402&&N.type!==Q1&&N.type!==So&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=So,de=s.convert(N.type)),N.format===Ya&&Se===6402&&(Se=34041,N.type!==Ua&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=Ua,de=s.convert(N.type))),kt&&(ct?t.texStorage2D(3553,1,Se,pe.width,pe.height):t.texImage2D(3553,0,Se,pe.width,pe.height,0,G,de,null));else if(N.isDataTexture)if(Qe.length>0&&He){ct&&kt&&t.texStorage2D(3553,Y,Se,Qe[0].width,Qe[0].height);for(let fe=0,Ae=Qe.length;fe>=1,Ae>>=1}}else if(Qe.length>0&&He){ct&&kt&&t.texStorage2D(3553,Y,Se,Qe[0].width,Qe[0].height);for(let fe=0,Ae=Qe.length;fe0&&kt++,t.texStorage2D(34067,kt,Pe,pe[0].width,pe[0].height));for(let fe=0;fe<6;fe++)if(ze){Qe?t.texSubImage2D(34069+fe,0,0,0,pe[fe].width,pe[fe].height,de,Se,pe[fe].data):t.texImage2D(34069+fe,0,Pe,pe[fe].width,pe[fe].height,0,de,Se,pe[fe].data);for(let Ae=0;Ae=34069&&Te<=34074)&&n.framebufferTexture2D(36160,be,Te,i.get(le).__webglTexture,0),t.bindFramebuffer(36160,null)}function Me(z,N,le){if(n.bindRenderbuffer(36161,z),N.depthBuffer&&!N.stencilBuffer){let be=33189;if(le||je(N)){const Te=N.depthTexture;Te&&Te.isDepthTexture&&(Te.type===Ls?be=36012:Te.type===So&&(be=33190));const Re=qe(N);je(N)?p.renderbufferStorageMultisampleEXT(36161,Re,be,N.width,N.height):n.renderbufferStorageMultisample(36161,Re,be,N.width,N.height)}else n.renderbufferStorage(36161,be,N.width,N.height);n.framebufferRenderbuffer(36160,36096,36161,z)}else if(N.depthBuffer&&N.stencilBuffer){const be=qe(N);le&&je(N)===!1?n.renderbufferStorageMultisample(36161,be,35056,N.width,N.height):je(N)?p.renderbufferStorageMultisampleEXT(36161,be,35056,N.width,N.height):n.renderbufferStorage(36161,34041,N.width,N.height),n.framebufferRenderbuffer(36160,33306,36161,z)}else{const be=N.isWebGLMultipleRenderTargets===!0?N.texture:[N.texture];for(let Te=0;Te0&&je(z)===!1){const ze=Re?N:[N];le.__webglMultisampledFramebuffer=n.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,le.__webglMultisampledFramebuffer);for(let pe=0;pe0&&je(z)===!1){const N=z.isWebGLMultipleRenderTargets?z.texture:[z.texture],le=z.width,be=z.height;let Te=16384;const Re=[],et=z.stencilBuffer?33306:36096,ze=i.get(z),pe=z.isWebGLMultipleRenderTargets===!0;if(pe)for(let He=0;He0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function nt(z){const N=o.render.frame;y.get(z)!==N&&(y.set(z,N),z.update())}function _t(z,N){const le=z.encoding,be=z.format,Te=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||z.format===Gm||le!==Vs&&(le===zt?a===!1?e.has("EXT_sRGB")===!0&&be===Vi?(z.format=Gm,z.minFilter=vn,z.generateMipmaps=!1):N=nS.sRGBToLinear(N):(be!==Vi||Te!==Vo)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",le)),N}this.allocateTextureUnit=D,this.resetTextureUnits=ae,this.setTexture2D=B,this.setTexture2DArray=te,this.setTexture3D=$,this.setTextureCube=ee,this.rebindTextures=_e,this.setupRenderTarget=ke,this.updateRenderTargetMipmap=Ie,this.updateMultisampleRenderTarget=Ge,this.setupDepthRenderbuffer=oe,this.setupFrameBufferTexture=xe,this.useMultisampledRTT=je}function YL(n,e,t){const i=t.isWebGL2;function r(s,o=null){let a;if(s===Vo)return 5121;if(s===gL)return 32819;if(s===vL)return 32820;if(s===dL)return 5120;if(s===pL)return 5122;if(s===Q1)return 5123;if(s===mL)return 5124;if(s===So)return 5125;if(s===Ls)return 5126;if(s===Ru)return i?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===yL)return 6406;if(s===Vi)return 6408;if(s===xL)return 6409;if(s===_L)return 6410;if(s===No)return 6402;if(s===Ya)return 34041;if(s===Gm)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===SL)return 6403;if(s===wL)return 36244;if(s===ML)return 33319;if(s===AL)return 33320;if(s===EL)return 36249;if(s===$p||s===em||s===tm||s===nm)if(o===zt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===$p)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===em)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===tm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===nm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===$p)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===em)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===tm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===nm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Bx||s===Vx||s===Hx||s===Wx)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Bx)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Vx)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Hx)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Wx)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===bL)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===Gx||s===jx)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Gx)return o===zt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===jx)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Xx||s===Yx||s===qx||s===Zx||s===Jx||s===Kx||s===Qx||s===$x||s===e_||s===t_||s===n_||s===i_||s===r_||s===s_)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Xx)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Yx)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===qx)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Zx)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Jx)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Kx)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Qx)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===$x)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===e_)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===t_)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===n_)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===i_)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===r_)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===s_)return o===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===im)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===im)return o===zt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===TL||s===o_||s===a_||s===l_)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===im)return a.COMPRESSED_RED_RGTC1_EXT;if(s===o_)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===a_)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===l_)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Ua?i?34042:(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 qL extends Wt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class cu extends Tt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const EG={type:"move"};class Kv{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new cu,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 cu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new k,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new k),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new cu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new k,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new k),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,l=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const _ of e.hand.values()){const M=t.getJointPose(_,i),m=this._getHandJoint(f,_);M!==null&&(m.matrix.fromArray(M.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.jointRadius=M.radius),m.visible=M!==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 l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.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),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(EG)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new cu;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class ZL extends hn{constructor(e,t,i,r,s,o,a,l,f,h){if(h=h!==void 0?h:No,h!==No&&h!==Ya)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===No&&(i=So),i===void 0&&h===Ya&&(i=Ua),super(null,r,s,o,a,l,h,i,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:mn,this.minFilter=l!==void 0?l:mn,this.flipY=!1,this.generateMipmaps=!1}}class bG extends ss{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,f=null,h=null,d=null,p=null,v=null,y=null;const _=t.getContextAttributes();let M=null,m=null;const S=[],w=[],A=new Set,b=new Map,P=new Wt;P.layers.enable(1),P.viewport=new Dt;const I=new Wt;I.layers.enable(2),I.viewport=new Dt;const L=[P,I],C=new qL;C.layers.enable(1),C.layers.enable(2);let R=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ee){let ue=S[ee];return ue===void 0&&(ue=new Kv,S[ee]=ue),ue.getTargetRaySpace()},this.getControllerGrip=function(ee){let ue=S[ee];return ue===void 0&&(ue=new Kv,S[ee]=ue),ue.getGripSpace()},this.getHand=function(ee){let ue=S[ee];return ue===void 0&&(ue=new Kv,S[ee]=ue),ue.getHandSpace()};function J(ee){const ue=w.indexOf(ee.inputSource);if(ue===-1)return;const Ee=S[ue];Ee!==void 0&&Ee.dispatchEvent({type:ee.type,data:ee.inputSource})}function j(){r.removeEventListener("select",J),r.removeEventListener("selectstart",J),r.removeEventListener("selectend",J),r.removeEventListener("squeeze",J),r.removeEventListener("squeezestart",J),r.removeEventListener("squeezeend",J),r.removeEventListener("end",j),r.removeEventListener("inputsourceschange",X);for(let ee=0;ee=0&&(w[we]=null,S[we].disconnect(Ee))}for(let ue=0;ue=w.length){w.push(Ee),we=Xe;break}else if(w[Xe]===null){w[Xe]=Ee,we=Xe;break}if(we===-1)break}const Q=S[we];Q&&Q.connect(Ee)}}const Z=new k,se=new k;function ae(ee,ue,Ee){Z.setFromMatrixPosition(ue.matrixWorld),se.setFromMatrixPosition(Ee.matrixWorld);const we=Z.distanceTo(se),Q=ue.projectionMatrix.elements,Xe=Ee.projectionMatrix.elements,Ye=Q[14]/(Q[10]-1),xe=Q[14]/(Q[10]+1),Me=(Q[9]+1)/Q[5],ge=(Q[9]-1)/Q[5],oe=(Q[8]-1)/Q[0],_e=(Xe[8]+1)/Xe[0],ke=Ye*oe,Ie=Ye*_e,Ge=we/(-oe+_e),qe=Ge*-oe;ue.matrixWorld.decompose(ee.position,ee.quaternion,ee.scale),ee.translateX(qe),ee.translateZ(Ge),ee.matrixWorld.compose(ee.position,ee.quaternion,ee.scale),ee.matrixWorldInverse.copy(ee.matrixWorld).invert();const je=Ye+Ge,nt=xe+Ge,_t=ke-qe,z=Ie+(we-qe),N=Me*xe/nt*je,le=ge*xe/nt*je;ee.projectionMatrix.makePerspective(_t,z,N,le,je,nt),ee.projectionMatrixInverse.copy(ee.projectionMatrix).invert()}function D(ee,ue){ue===null?ee.matrixWorld.copy(ee.matrix):ee.matrixWorld.multiplyMatrices(ue.matrixWorld,ee.matrix),ee.matrixWorldInverse.copy(ee.matrixWorld).invert()}this.updateCamera=function(ee){if(r===null)return;C.near=I.near=P.near=ee.near,C.far=I.far=P.far=ee.far,(R!==C.near||W!==C.far)&&(r.updateRenderState({depthNear:C.near,depthFar:C.far}),R=C.near,W=C.far);const ue=ee.parent,Ee=C.cameras;D(C,ue);for(let we=0;weQ&&(b.set(we,we.lastChangedTime),i.dispatchEvent({type:"planechanged",data:we}))}}y=null}const $=new HL;$.setAnimationLoop(te),this.setAnimationLoop=function(ee){B=ee},this.dispose=function(){}}}function TG(n,e){function t(M,m){M.matrixAutoUpdate===!0&&M.updateMatrix(),m.value.copy(M.matrix)}function i(M,m){m.color.getRGB(M.fogColor.value,BL(n)),m.isFog?(M.fogNear.value=m.near,M.fogFar.value=m.far):m.isFogExp2&&(M.fogDensity.value=m.density)}function r(M,m,S,w,A){m.isMeshBasicMaterial||m.isMeshLambertMaterial?s(M,m):m.isMeshToonMaterial?(s(M,m),d(M,m)):m.isMeshPhongMaterial?(s(M,m),h(M,m)):m.isMeshStandardMaterial?(s(M,m),p(M,m),m.isMeshPhysicalMaterial&&v(M,m,A)):m.isMeshMatcapMaterial?(s(M,m),y(M,m)):m.isMeshDepthMaterial?s(M,m):m.isMeshDistanceMaterial?(s(M,m),_(M,m)):m.isMeshNormalMaterial?s(M,m):m.isLineBasicMaterial?(o(M,m),m.isLineDashedMaterial&&a(M,m)):m.isPointsMaterial?l(M,m,S,w):m.isSpriteMaterial?f(M,m):m.isShadowMaterial?(M.color.value.copy(m.color),M.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function s(M,m){M.opacity.value=m.opacity,m.color&&M.diffuse.value.copy(m.color),m.emissive&&M.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(M.map.value=m.map,t(m.map,M.mapTransform)),m.alphaMap&&(M.alphaMap.value=m.alphaMap,t(m.alphaMap,M.alphaMapTransform)),m.bumpMap&&(M.bumpMap.value=m.bumpMap,t(m.bumpMap,M.bumpMapTransform),M.bumpScale.value=m.bumpScale,m.side===mi&&(M.bumpScale.value*=-1)),m.normalMap&&(M.normalMap.value=m.normalMap,t(m.normalMap,M.normalMapTransform),M.normalScale.value.copy(m.normalScale),m.side===mi&&M.normalScale.value.negate()),m.displacementMap&&(M.displacementMap.value=m.displacementMap,t(m.displacementMap,M.displacementMapTransform),M.displacementScale.value=m.displacementScale,M.displacementBias.value=m.displacementBias),m.emissiveMap&&(M.emissiveMap.value=m.emissiveMap,t(m.emissiveMap,M.emissiveMapTransform)),m.specularMap&&(M.specularMap.value=m.specularMap,t(m.specularMap,M.specularMapTransform)),m.alphaTest>0&&(M.alphaTest.value=m.alphaTest);const S=e.get(m).envMap;if(S&&(M.envMap.value=S,M.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,M.reflectivity.value=m.reflectivity,M.ior.value=m.ior,M.refractionRatio.value=m.refractionRatio),m.lightMap){M.lightMap.value=m.lightMap;const w=n.useLegacyLights===!0?Math.PI:1;M.lightMapIntensity.value=m.lightMapIntensity*w,t(m.lightMap,M.lightMapTransform)}m.aoMap&&(M.aoMap.value=m.aoMap,M.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,M.aoMapTransform))}function o(M,m){M.diffuse.value.copy(m.color),M.opacity.value=m.opacity,m.map&&(M.map.value=m.map,t(m.map,M.mapTransform))}function a(M,m){M.dashSize.value=m.dashSize,M.totalSize.value=m.dashSize+m.gapSize,M.scale.value=m.scale}function l(M,m,S,w){M.diffuse.value.copy(m.color),M.opacity.value=m.opacity,M.size.value=m.size*S,M.scale.value=w*.5,m.map&&(M.map.value=m.map,t(m.map,M.uvTransform)),m.alphaMap&&(M.alphaMap.value=m.alphaMap),m.alphaTest>0&&(M.alphaTest.value=m.alphaTest)}function f(M,m){M.diffuse.value.copy(m.color),M.opacity.value=m.opacity,M.rotation.value=m.rotation,m.map&&(M.map.value=m.map,t(m.map,M.mapTransform)),m.alphaMap&&(M.alphaMap.value=m.alphaMap),m.alphaTest>0&&(M.alphaTest.value=m.alphaTest)}function h(M,m){M.specular.value.copy(m.specular),M.shininess.value=Math.max(m.shininess,1e-4)}function d(M,m){m.gradientMap&&(M.gradientMap.value=m.gradientMap)}function p(M,m){M.metalness.value=m.metalness,m.metalnessMap&&(M.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,M.metalnessMapTransform)),M.roughness.value=m.roughness,m.roughnessMap&&(M.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,M.roughnessMapTransform)),e.get(m).envMap&&(M.envMapIntensity.value=m.envMapIntensity)}function v(M,m,S){M.ior.value=m.ior,m.sheen>0&&(M.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),M.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(M.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,M.sheenColorMapTransform)),m.sheenRoughnessMap&&(M.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,M.sheenRoughnessMapTransform))),m.clearcoat>0&&(M.clearcoat.value=m.clearcoat,M.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(M.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,M.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(M.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,M.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(M.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,M.clearcoatNormalMapTransform),M.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===mi&&M.clearcoatNormalScale.value.negate())),m.iridescence>0&&(M.iridescence.value=m.iridescence,M.iridescenceIOR.value=m.iridescenceIOR,M.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],M.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(M.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,M.iridescenceMapTransform)),m.iridescenceThicknessMap&&(M.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,M.iridescenceThicknessMapTransform))),m.transmission>0&&(M.transmission.value=m.transmission,M.transmissionSamplerMap.value=S.texture,M.transmissionSamplerSize.value.set(S.width,S.height),m.transmissionMap&&(M.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,M.transmissionMapTransform)),M.thickness.value=m.thickness,m.thicknessMap&&(M.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,M.thicknessMapTransform)),M.attenuationDistance.value=m.attenuationDistance,M.attenuationColor.value.copy(m.attenuationColor)),M.specularIntensity.value=m.specularIntensity,M.specularColor.value.copy(m.specularColor),m.specularColorMap&&(M.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,M.specularColorMapTransform)),m.specularIntensityMap&&(M.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,M.specularIntensityMapTransform))}function y(M,m){m.matcap&&(M.matcap.value=m.matcap)}function _(M,m){const S=e.get(m).light;M.referencePosition.value.setFromMatrixPosition(S.matrixWorld),M.nearDistance.value=S.shadow.camera.near,M.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function CG(n,e,t,i){let r={},s={},o=[];const a=t.isWebGL2?n.getParameter(35375):0;function l(S,w){const A=w.program;i.uniformBlockBinding(S,A)}function f(S,w){let A=r[S.id];A===void 0&&(y(S),A=h(S),r[S.id]=A,S.addEventListener("dispose",M));const b=w.program;i.updateUBOMapping(S,b);const P=e.render.frame;s[S.id]!==P&&(p(S),s[S.id]=P)}function h(S){const w=d();S.__bindingPointIndex=w;const A=n.createBuffer(),b=S.__size,P=S.usage;return n.bindBuffer(35345,A),n.bufferData(35345,b,P),n.bindBuffer(35345,null),n.bindBufferBase(35345,w,A),A}function d(){for(let S=0;S0){P=A%b;const J=b-P;P!==0&&J-R.boundary<0&&(A+=b-P,C.__offset=A)}A+=R.storage}return P=A%b,P>0&&(A+=b-P),S.__size=A,S.__cache={},this}function _(S){const w={boundary:0,storage:0};return typeof S=="number"?(w.boundary=4,w.storage=4):S.isVector2?(w.boundary=8,w.storage=8):S.isVector3||S.isColor?(w.boundary=16,w.storage=12):S.isVector4?(w.boundary=16,w.storage=16):S.isMatrix3?(w.boundary=48,w.storage=48):S.isMatrix4?(w.boundary=64,w.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),w}function M(S){const w=S.target;w.removeEventListener("dispose",M);const A=o.indexOf(w.__bindingPointIndex);o.splice(A,1),n.deleteBuffer(r[w.id]),delete r[w.id],delete s[w.id]}function m(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:f,dispose:m}}function PG(){const n=jf("canvas");return n.style.display="block",n}class fS{constructor(e={}){const{canvas:t=PG(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:f=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let p;i!==null?p=i.getContextAttributes().alpha:p=o;let v=null,y=null;const _=[],M=[];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.outputEncoding=Vs,this.useLegacyLights=!0,this.toneMapping=Nr,this.toneMappingExposure=1;const m=this;let S=!1,w=0,A=0,b=null,P=-1,I=null;const L=new Dt,C=new Dt;let R=null,W=t.width,J=t.height,j=1,X=null,Z=null;const se=new Dt(0,0,W,J),ae=new Dt(0,0,W,J);let D=!1;const V=new bg;let B=!1,te=!1,$=null;const ee=new ot,ue=new k,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function we(){return b===null?j:1}let Q=i;function Xe(O,re){for(let me=0;me0?y=M[M.length-1]:y=null,_.pop(),_.length>0?v=_[_.length-1]:v=null};function In(O,re,me,ne){if(O.visible===!1)return;if(O.layers.test(re.layers)){if(O.isGroup)me=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(re);else if(O.isLight)y.pushLight(O),O.castShadow&&y.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||V.intersectsSprite(O)){ne&&ue.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ee);const rt=je.update(O),st=O.material;st.visible&&v.push(O,rt,st,me,ue.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(O.isSkinnedMesh&&O.skeleton.frame!==ge.render.frame&&(O.skeleton.update(),O.skeleton.frame=ge.render.frame),!O.frustumCulled||V.intersectsObject(O))){ne&&ue.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ee);const rt=je.update(O),st=O.material;if(Array.isArray(st)){const ft=rt.groups;for(let vt=0,yt=ft.length;vt0&&qt(ve,$e,re,me),ne&&Me.viewport(L.copy(ne)),ve.length>0&&ai(ve,re,me),$e.length>0&&ai($e,re,me),rt.length>0&&ai(rt,re,me),Me.buffers.depth.setTest(!0),Me.buffers.depth.setMask(!0),Me.buffers.color.setMask(!0),Me.setPolygonOffset(!1)}function qt(O,re,me,ne){if($===null){const st=xe.isWebGL2;$=new Or(1024,1024,{generateMipmaps:!0,type:Ye.has("EXT_color_buffer_half_float")?Ru:Vo,minFilter:Bo,samples:st&&a===!0?4:0})}const ve=m.getRenderTarget();m.setRenderTarget($),m.clear();const $e=m.toneMapping;m.toneMapping=Nr,ai(O,me,ne),_e.updateMultisampleRenderTarget($),_e.updateRenderTargetMipmap($);let rt=!1;for(let st=0,ft=re.length;st0&&_e.useMultisampledRTT(O)===!1?ve=oe.get(O).__webglMultisampledFramebuffer:ve=yt,L.copy(O.viewport),C.copy(O.scissor),R=O.scissorTest}else L.copy(se).multiplyScalar(j).floor(),C.copy(ae).multiplyScalar(j).floor(),R=D;if(Me.bindFramebuffer(36160,ve)&&xe.drawBuffers&&ne&&Me.drawBuffers(O,ve),Me.viewport(L),Me.scissor(C),Me.setScissorTest(R),$e){const ft=oe.get(O.texture);Q.framebufferTexture2D(36160,36064,34069+re,ft.__webglTexture,me)}else if(rt){const ft=oe.get(O.texture),vt=re||0;Q.framebufferTextureLayer(36160,36064,ft.__webglTexture,me||0,vt)}P=-1},this.readRenderTargetPixels=function(O,re,me,ne,ve,$e,rt){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let st=oe.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&rt!==void 0&&(st=st[rt]),st){Me.bindFramebuffer(36160,st);try{const ft=O.texture,vt=ft.format,yt=ft.type;if(vt!==Vi&&pe.convert(vt)!==Q.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const St=yt===Ru&&(Ye.has("EXT_color_buffer_half_float")||xe.isWebGL2&&Ye.has("EXT_color_buffer_float"));if(yt!==Vo&&pe.convert(yt)!==Q.getParameter(35738)&&!(yt===Ls&&(xe.isWebGL2||Ye.has("OES_texture_float")||Ye.has("WEBGL_color_buffer_float")))&&!St){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}re>=0&&re<=O.width-ne&&me>=0&&me<=O.height-ve&&Q.readPixels(re,me,ne,ve,pe.convert(vt),pe.convert(yt),$e)}finally{const ft=b!==null?oe.get(b).__webglFramebuffer:null;Me.bindFramebuffer(36160,ft)}}},this.copyFramebufferToTexture=function(O,re,me=0){const ne=Math.pow(2,-me),ve=Math.floor(re.image.width*ne),$e=Math.floor(re.image.height*ne);_e.setTexture2D(re,0),Q.copyTexSubImage2D(3553,me,0,0,O.x,O.y,ve,$e),Me.unbindTexture()},this.copyTextureToTexture=function(O,re,me,ne=0){const ve=re.image.width,$e=re.image.height,rt=pe.convert(me.format),st=pe.convert(me.type);_e.setTexture2D(me,0),Q.pixelStorei(37440,me.flipY),Q.pixelStorei(37441,me.premultiplyAlpha),Q.pixelStorei(3317,me.unpackAlignment),re.isDataTexture?Q.texSubImage2D(3553,ne,O.x,O.y,ve,$e,rt,st,re.image.data):re.isCompressedTexture?Q.compressedTexSubImage2D(3553,ne,O.x,O.y,re.mipmaps[0].width,re.mipmaps[0].height,rt,re.mipmaps[0].data):Q.texSubImage2D(3553,ne,O.x,O.y,rt,st,re.image),ne===0&&me.generateMipmaps&&Q.generateMipmap(3553),Me.unbindTexture()},this.copyTextureToTexture3D=function(O,re,me,ne,ve=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const $e=O.max.x-O.min.x+1,rt=O.max.y-O.min.y+1,st=O.max.z-O.min.z+1,ft=pe.convert(ne.format),vt=pe.convert(ne.type);let yt;if(ne.isData3DTexture)_e.setTexture3D(ne,0),yt=32879;else if(ne.isDataArrayTexture)_e.setTexture2DArray(ne,0),yt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Q.pixelStorei(37440,ne.flipY),Q.pixelStorei(37441,ne.premultiplyAlpha),Q.pixelStorei(3317,ne.unpackAlignment);const St=Q.getParameter(3314),Rt=Q.getParameter(32878),Vn=Q.getParameter(3316),Ii=Q.getParameter(3315),gr=Q.getParameter(32877),Ht=me.isCompressedTexture?me.mipmaps[0]:me.image;Q.pixelStorei(3314,Ht.width),Q.pixelStorei(32878,Ht.height),Q.pixelStorei(3316,O.min.x),Q.pixelStorei(3315,O.min.y),Q.pixelStorei(32877,O.min.z),me.isDataTexture||me.isData3DTexture?Q.texSubImage3D(yt,ve,re.x,re.y,re.z,$e,rt,st,ft,vt,Ht.data):me.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Q.compressedTexSubImage3D(yt,ve,re.x,re.y,re.z,$e,rt,st,ft,Ht.data)):Q.texSubImage3D(yt,ve,re.x,re.y,re.z,$e,rt,st,ft,vt,Ht),Q.pixelStorei(3314,St),Q.pixelStorei(32878,Rt),Q.pixelStorei(3316,Vn),Q.pixelStorei(3315,Ii),Q.pixelStorei(32877,gr),ve===0&&ne.generateMipmaps&&Q.generateMipmap(yt),Me.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?_e.setTextureCube(O,0):O.isData3DTexture?_e.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?_e.setTexture2DArray(O,0):_e.setTexture2D(O,0),Me.unbindTexture()},this.resetState=function(){w=0,A=0,b=null,Me.reset(),He.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}}class JL extends fS{}JL.prototype.isWebGL1Renderer=!0;class Cg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Fe(e),this.density=t}clone(){return new Cg(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Pg{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Fe(e),this.near=t,this.far=i}clone(){return new Pg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class hS extends Tt{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}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class Lg{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Gf,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ji()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:Ic.clone(),uv:bi.getInterpolation(Ic,vp,Nc,yp,Ib,Qv,Db,new ye),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 xp(n,e,t,i,r,s){Bl.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Dc.x=s*Bl.x-r*Bl.y,Dc.y=r*Bl.x+s*Bl.y):Dc.copy(Bl),n.copy(e),n.x+=Dc.x,n.y+=Dc.y,n.applyMatrix4(KL)}const _p=new k,Nb=new k;class $L extends Tt{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){_p.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(_p);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){_p.setFromMatrixPosition(e.matrixWorld),Nb.setFromMatrixPosition(this.matrixWorld);const i=_p.distanceTo(Nb)/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;rl)continue;p.applyMatrix4(this.matrixWorld);const L=e.ray.origin.distanceTo(p);Le.far||t.push({distance:L,point:d.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),S=Math.min(M.count,o.start+o.count);for(let w=m,A=S-1;wl)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);Pe.far||t.push({distance:P,point:d.clone().applyMatrix4(this.matrixWorld),index:w,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:l,index:e,face:null,object:o})}}class DG extends hn{constructor(e,t,i,r,s,o,a,l,f){super(e,t,i,r,s,o,a,l,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:vn,this.magFilter=s!==void 0?s:vn,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 NG extends hn{constructor(e,t,i){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=i,this.magFilter=mn,this.minFilter=mn,this.generateMipmaps=!1,this.needsUpdate=!0}}class gS extends hn{constructor(e,t,i,r,s,o,a,l,f,h,d,p){super(null,o,a,l,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 kG extends gS{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=ri}}class OG extends hn{constructor(e,t,i,r,s,o,a,l,f){super(e,t,i,r,s,o,a,l,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ur{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,l=s-1,f;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),f=i[r]-o,f<0)a=r+1;else if(f>0)l=r-1;else{l=r;break}if(r=l,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),l=t||(o.isVector2?new ye:new k);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new k,r=[],s=[],o=[],a=new k,l=new ot;for(let v=0;v<=e;v++){const y=v/e;r[v]=this.getTangentAt(y,new k)}s[0]=new k,o[0]=new k;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(fn(r[v-1].dot(r[v]),-1,1));s[v].applyMatrix4(l.makeRotationAxis(a,y))}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(a.crossVectors(s[0],s[e]))>0&&(v=-v);for(let y=1;y<=e;y++)s[y].applyMatrix4(l.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.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ig extends Ur{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=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=l}getPoint(e,t){const i=t||new ye,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:l===0&&a===s-1&&(a=s-2,l=1);let f,h;this.closed||a>0?f=r[(a-1)%s]:(Ep.subVectors(r[0],r[1]).add(r[0]),f=Ep);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(Zb(a,l.x,f.x,h.x,d.x),Zb(a,l.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],l=a.getLength(),f=l===0?0:1-o/l;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 Xu extends dt{constructor(e=[new ye(0,-.5),new ye(.5,0),new ye(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=[],a=[],l=[],f=[],h=1/t,d=new k,p=new ye,v=new k,y=new k,_=new k;let M=0,m=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:M=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,v.x=m*1,v.y=-M,v.z=m*0,_.copy(v),v.normalize(),l.push(v.x,v.y,v.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:M=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,v.x=m*1,v.y=-M,v.z=m*0,y.copy(v),v.x+=_.x,v.y+=_.y,v.z+=_.z,v.normalize(),l.push(v.x,v.y,v.z),_.copy(y)}for(let S=0;S<=t;S++){const w=i+S*h*r,A=Math.sin(w),b=Math.cos(w);for(let P=0;P<=e.length-1;P++){d.x=e[P].x*A,d.y=e[P].y,d.z=e[P].x*b,o.push(d.x,d.y,d.z),p.x=S/t,p.y=P/(e.length-1),a.push(p.x,p.y);const I=l[3*P+0]*A,L=l[3*P+1],C=l[3*P+0]*b;f.push(I,L,C)}}for(let S=0;S0&&w(!0),t>0&&w(!1)),this.setIndex(h),this.setAttribute("position",new We(d,3)),this.setAttribute("normal",new We(p,3)),this.setAttribute("uv",new We(v,2));function S(){const A=new k,b=new k;let P=0;const I=(t-e)/i;for(let L=0;L<=s;L++){const C=[],R=L/s,W=R*(t-e)+e;for(let J=0;J<=r;J++){const j=J/r,X=j*l+a,Z=Math.sin(X),se=Math.cos(X);b.x=W*Z,b.y=-R*i+M,b.z=W*se,d.push(b.x,b.y,b.z),A.set(Z,I,se).normalize(),p.push(A.x,A.y,A.z),v.push(j,1-R),C.push(y++)}_.push(C)}for(let L=0;L.9&&I<.1&&(w<.2&&(o[S+0]+=1),A<.2&&(o[S+2]+=1),b<.2&&(o[S+4]+=1))}}function p(S){s.push(S.x,S.y,S.z)}function v(S,w){const A=S*3;w.x=e[A+0],w.y=e[A+1],w.z=e[A+2]}function y(){const S=new k,w=new k,A=new k,b=new k,P=new ye,I=new ye,L=new ye;for(let C=0,R=0;C80*t){a=f=n[0],l=h=n[1];for(let y=t;yf&&(f=d),p>h&&(h=p);v=Math.max(f-a,h-l),v=v!==0?32767/v:0}return Yf(s,o,t,a,l,v,0),o}};function cR(n,e,t,i,r){let s,o;if(r===oj(n,e,t,i)>0)for(s=e;s=e;s-=i)o=Jb(s,n[s],n[s+1],o);return o&&Ng(o,o.next)&&(Zf(o),o=o.next),o}function Za(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ng(t,t.next)||tn(t.prev,t,t.next)===0)){if(Zf(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Yf(n,e,t,i,r,s,o){if(!n)return;!o&&s&&ej(n,i,r,s);let a=n,l,f;for(;n.prev!==n.next;){if(l=n.prev,f=n.next,s?XG(n,i,r,s):jG(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(f.i/t|0),Zf(n),n=f.next,a=f.next;continue}if(n=f,n===a){o?o===1?(n=YG(Za(n),e,t),Yf(n,e,t,i,r,s,2)):o===2&&qG(n,e,t,i,r,s):Yf(Za(n),e,t,i,r,s,1);break}}}function jG(n){const e=n.prev,t=n,i=n.next;if(tn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,f=i.y,h=rs?r>o?r:o:s>o?s:o,v=a>l?a>f?a:f:l>f?l:f;let y=i.next;for(;y!==e;){if(y.x>=h&&y.x<=p&&y.y>=d&&y.y<=v&&fu(r,a,s,l,o,f,y.x,y.y)&&tn(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function XG(n,e,t,i){const r=n.prev,s=n,o=n.next;if(tn(r,s,o)>=0)return!1;const a=r.x,l=s.x,f=o.x,h=r.y,d=s.y,p=o.y,v=al?a>f?a:f:l>f?l:f,M=h>d?h>p?h:p:d>p?d:p,m=p_(v,y,e,t,i),S=p_(_,M,e,t,i);let w=n.prevZ,A=n.nextZ;for(;w&&w.z>=m&&A&&A.z<=S;){if(w.x>=v&&w.x<=_&&w.y>=y&&w.y<=M&&w!==r&&w!==o&&fu(a,h,l,d,f,p,w.x,w.y)&&tn(w.prev,w,w.next)>=0||(w=w.prevZ,A.x>=v&&A.x<=_&&A.y>=y&&A.y<=M&&A!==r&&A!==o&&fu(a,h,l,d,f,p,A.x,A.y)&&tn(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;w&&w.z>=m;){if(w.x>=v&&w.x<=_&&w.y>=y&&w.y<=M&&w!==r&&w!==o&&fu(a,h,l,d,f,p,w.x,w.y)&&tn(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;A&&A.z<=S;){if(A.x>=v&&A.x<=_&&A.y>=y&&A.y<=M&&A!==r&&A!==o&&fu(a,h,l,d,f,p,A.x,A.y)&&tn(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function YG(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Ng(r,s)&&fR(r,i,i.next,s)&&qf(r,s)&&qf(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Zf(i),Zf(i.next),i=n=s),i=i.next}while(i!==n);return Za(i)}function qG(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&ij(o,a)){let l=hR(o,a);o=Za(o,o.next),l=Za(l,l.next),Yf(o,e,t,i,r,s,0),Yf(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function ZG(n,e,t,i){const r=[];let s,o,a,l,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>=l&&s!==t.x&&fu(or.x||t.x===r.x&&$G(r,t)))&&(r=t,h=d)),t=t.next;while(t!==a);return r}function $G(n,e){return tn(n.prev,n,e.prev)<0&&tn(e.next,n,n.next)<0}function ej(n,e,t,i){let r=n;do r.z===0&&(r.z=p_(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,tj(r)}function tj(n){let e,t,i,r,s,o,a,l,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,f*=2}while(o>1);return n}function p_(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 nj(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 ij(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!rj(n,e)&&(qf(n,e)&&qf(e,n)&&sj(n,e)&&(tn(n.prev,n,e.prev)||tn(n,e.prev,e))||Ng(n,e)&&tn(n.prev,n,n.next)>0&&tn(e.prev,e,e.next)>0)}function tn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ng(n,e){return n.x===e.x&&n.y===e.y}function fR(n,e,t,i){const r=Lp(tn(n,e,t)),s=Lp(tn(n,e,i)),o=Lp(tn(t,i,n)),a=Lp(tn(t,i,e));return!!(r!==s&&o!==a||r===0&&Pp(n,t,e)||s===0&&Pp(n,i,e)||o===0&&Pp(t,n,i)||a===0&&Pp(t,e,i))}function Pp(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 Lp(n){return n>0?1:n<0?-1:0}function rj(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&&fR(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function qf(n,e){return tn(n.prev,n,n.next)<0?tn(n,e,n.next)>=0&&tn(n,n.prev,e)>=0:tn(n,e,n.prev)<0||tn(n,n.next,e)<0}function sj(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 hR(n,e){const t=new m_(n.i,n.x,n.y),i=new m_(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 Jb(n,e,t,i){const r=new m_(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 Zf(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 m_(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 oj(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function Qb(n,e){for(let t=0;tNumber.EPSILON){const le=Math.sqrt(z),be=Math.sqrt(nt*nt+_t*_t),Te=oe.x-je/le,Re=oe.y+qe/le,et=_e.x-_t/be,ze=_e.y+nt/be,pe=((et-Te)*_t-(ze-Re)*nt)/(qe*_t-je*nt);ke=Te+qe*pe-ge.x,Ie=Re+je*pe-ge.y;const He=ke*ke+Ie*Ie;if(He<=2)return new ye(ke,Ie);Ge=Math.sqrt(He/2)}else{let le=!1;qe>Number.EPSILON?nt>Number.EPSILON&&(le=!0):qe<-Number.EPSILON?nt<-Number.EPSILON&&(le=!0):Math.sign(je)===Math.sign(_t)&&(le=!0),le?(ke=-je,Ie=qe,Ge=Math.sqrt(z)):(ke=qe,Ie=je,Ge=Math.sqrt(z/2))}return new ye(ke/Ge,Ie/Ge)}const V=[];for(let ge=0,oe=X.length,_e=oe-1,ke=ge+1;ge=0;ge--){const oe=ge/M,_e=v*Math.cos(oe*Math.PI/2),ke=y*Math.sin(oe*Math.PI/2)+_;for(let Ie=0,Ge=X.length;Ie=0;){const ke=_e;let Ie=_e-1;Ie<0&&(Ie=ge.length-1);for(let Ge=0,qe=h+M*2;Ge0)&&v.push(w,A,P),(m!==i-1||l0!=e>0&&this.version++,this._sheen=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 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.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 vR extends Yn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Fe(16777215),this.specular=new Fe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dh,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 yR extends Yn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Fe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new ye(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 xR extends Yn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new ye(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 _R extends Yn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dh,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 SR extends Yn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Fe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new ye(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 wR 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 lr(n,e,t){return AS(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function Da(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 AS(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function MR(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 g_(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 l=0;l!==e;++l)r[o++]=n[a+l]}return r}function ES(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 cj(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){d.push(f.times[v]);for(let _=0;_s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[y]){const m=y*d+h,S=m+d-h;_=lr(a.values,m,S)}else{const m=a.createInterpolant(),S=h,w=d-h;m.evaluate(s),_=lr(m.resultBuffer,S,w)}l==="quaternion"&&new si().fromArray(_).normalize().conjugate().toArray(_);const M=f.times.length;for(let m=0;m=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=lr(i,s,o),this.values=lr(this.values,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 l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&AS(r))for(let a=0,l=r.length;a!==l;++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=lr(this.times),t=lr(this.values),i=this.getValueSize(),r=this.getInterpolation()===rm,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,f=0;f!==i;++f)t[l+f]=t[a+f];++o}return o!==e.length?(this.times=lr(e,0,o),this.values=lr(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=lr(this.times,0),t=lr(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}zr.prototype.TimeBufferType=Float32Array;zr.prototype.ValueBufferType=Float32Array;zr.prototype.DefaultInterpolation=Hf;class rl extends zr{}rl.prototype.ValueTypeName="bool";rl.prototype.ValueBufferType=Array;rl.prototype.DefaultInterpolation=Vf;rl.prototype.InterpolantFactoryMethodLinear=void 0;rl.prototype.InterpolantFactoryMethodSmooth=void 0;class TS extends zr{}TS.prototype.ValueTypeName="color";class Jf extends zr{}Jf.prototype.ValueTypeName="number";class bR extends Ph{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,l=(i-t)/(r-t);let f=e*a;for(let h=f+a;f!==h;f+=4)si.slerpFlat(s,0,o,f-a,o,f,l);return s}}class Zu extends zr{InterpolantFactoryMethodLinear(e){return new bR(this.times,this.values,this.getValueSize(),e)}}Zu.prototype.ValueTypeName="quaternion";Zu.prototype.DefaultInterpolation=Hf;Zu.prototype.InterpolantFactoryMethodSmooth=void 0;class sl extends zr{}sl.prototype.ValueTypeName="string";sl.prototype.ValueBufferType=Array;sl.prototype.DefaultInterpolation=Vf;sl.prototype.InterpolantFactoryMethodLinear=void 0;sl.prototype.InterpolantFactoryMethodSmooth=void 0;class Kf extends zr{}Kf.prototype.ValueTypeName="vector";class Qf{constructor(e,t=-1,i,r=Ag){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=ji(),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(pj(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(zr.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,_){if(v.length!==0){const M=[],m=[];ES(v,M,m,y),M.length!==0&&_.push(new d(p,M,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const f=e.hierarchy||[];for(let d=0;d{t&&t(s),this.manager.itemEnd(e)},0),s;if(ws[e]!==void 0){ws[e].push({onLoad:t,onProgress:i,onError:r});return}ws[e]=[],ws[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,l=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=ws[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 _=0;const M=new ReadableStream({start(m){S();function S(){d.read().then(({done:w,value:A})=>{if(w)m.close();else{_+=A.byteLength;const b=new ProgressEvent("progress",{lengthComputable:y,loaded:_,total:v});for(let P=0,I=h.length;P{switch(l){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=>{Ja.add(e,f);const h=ws[e];delete ws[e];for(let d=0,p=h.length;d{const h=ws[e];if(h===void 0)throw this.manager.itemError(e),f;delete ws[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 gj extends Ji{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Hs(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(l){r?r(l):console.error(l),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 Fe().setHex(o.value);break;case"v2":r.uniforms[s].value=new ye().fromArray(o.value);break;case"v3":r.uniforms[s].value=new k().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Mt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new ot().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.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 ye().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 ye().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.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:pR,SpriteMaterial:dS,RawShaderMaterial:mR,ShaderMaterial:rs,PointsMaterial:mS,MeshPhysicalMaterial:gR,MeshStandardMaterial:MS,MeshPhongMaterial:vR,MeshToonMaterial:yR,MeshNormalMaterial:xR,MeshLambertMaterial:_R,MeshDepthMaterial:uS,MeshDistanceMaterial:cS,MeshBasicMaterial:Zo,MeshMatcapMaterial:SR,LineDashedMaterial:wR,LineBasicMaterial:yi,Material:Yn};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 l=new CS(t);s=new $f(l),s.setCrossOrigin(this.crossOrigin);for(let f=0,h=e.length;f0){r=new $f(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o"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=Ja.get(e);if(o!==void 0)return s.manager.itemStart(e),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,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){Ja.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){r&&r(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let Rp;class LS{static getContext(){return Rp===void 0&&(Rp=new(window.AudioContext||window.webkitAudioContext)),Rp}static setContext(e){Rp=e}}class bj extends Ji{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Hs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const l=a.slice(0);LS.getContext().decodeAudioData(l,function(h){t(h)})}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}}class Tj extends Og{constructor(e,t,i=1){super(void 0,i),this.isHemisphereLightProbe=!0;const r=new Fe().set(e),s=new Fe().set(t),o=new k(r.r,r.g,r.b),a=new k(s.r,s.g,s.b),l=Math.sqrt(Math.PI),f=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(f)}}class Cj extends Og{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const i=new Fe().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const oT=new ot,aT=new ot,ha=new ot;class Pj{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Wt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Wt,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,ha.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(za*t.fov*.5)/t.zoom;let a,l;aT.elements[12]=-r,oT.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,ha.elements[0]=2*t.near/(l-a),ha.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(ha),a=-o*t.aspect-s,l=o*t.aspect-s,ha.elements[0]=2*t.near/(l-a),ha.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(ha)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(aT),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(oT)}}class RS{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=lT(),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=lT();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function lT(){return(typeof performance>"u"?Date:performance).now()}const da=new k,uT=new si,Lj=new k,pa=new k;class Rj extends Tt{constructor(){super(),this.type="AudioListener",this.context=LS.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new RS}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(da,uT,Lj),pa.set(0,0,-1).applyQuaternion(uT),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(da.x,r),t.positionY.linearRampToValueAtTime(da.y,r),t.positionZ.linearRampToValueAtTime(da.z,r),t.forwardX.linearRampToValueAtTime(pa.x,r),t.forwardY.linearRampToValueAtTime(pa.y,r),t.forwardZ.linearRampToValueAtTime(pa.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(da.x,da.y,da.z),t.setOrientation(pa.x,pa.y,pa.z,i.x,i.y,i.z)}}class OR extends Tt{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 l=t,f=t+t;l!==f;++l)if(i[l]!==i[l+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){si.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;si.multiplyQuaternionsFlat(e,o,e,t,e,i),si.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 l=t+a;e[l]=e[l]*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 IS="\\[\\]\\.:\\/",kj=new RegExp("["+IS+"]","g"),DS="[^"+IS+"]",Oj="[^"+IS.replace("\\.","")+"]",Uj=/((?:WC+[\/:])*)/.source.replace("WC",DS),zj=/(WCOD+)?/.source.replace("WCOD",Oj),Fj=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",DS),Bj=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",DS),Vj=new RegExp("^"+Uj+zj+Fj+Bj+"$"),Hj=["material","materials","bones","map"];class Wj{constructor(e,t,i){const r=i||Et.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 Et{constructor(e,t,i){this.path=t,this.parsedPath=i||Et.parseTrackName(t),this.node=Et.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 Et.Composite(e,t,i):new Et(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(kj,"")}static parseTrackName(e){const t=Vj.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);Hj.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]=l;for(let v=0,y=r;v!==y;++v){const _=i[v],M=_[d],m=_[h];_[h]=M,_[d]=m}}}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,l=arguments.length;a!==l;++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,_=r;y!==_;++y){const M=i[y];M[d]=M[p],M.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,l=this._objects,f=l.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=l.length;p!==v;++p){const y=l[p];d[p]=new Et(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,l=o[a],f=e[a];t[f]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class zR{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),l={endingStart:La,endingEnd:La};for(let f=0;f!==o;++f){const h=s[f].createInterpolant(null);a[f]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=PL,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 l=a.parameterPositions,f=a.sampleValues;return l[0]=s,l[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 l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case $1:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),f[h].accumulateAdditive(a);break;case Ag:default:for(let h=0,d=l.length;h!==d;++h)l[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===LL;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===CL){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 l=this.repetitions-s;if(l<=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(l===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:La:r.endingStart=Wf,t?r.endingEnd=this.zeroSlopeAtEnd?Ra:La:r.endingEnd=Wf)}_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,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const jj=new Float32Array(1);class Xj extends ss{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,l=i.uuid,f=this._bindingsByRootAndName;let h=f[l];h===void 0&&(h={},f[l]=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,l,v));continue}const _=t&&t._propertyBindings[d].binding.parsedPath;y=new UR(Et.create(i,v,_),p.ValueTypeName,p.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,l,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,l=this._nActiveBindings;for(let f=0;f!==l;++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,hT).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 dT=new k,Ip=new k;class $j{constructor(e=new k,t=new k){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){dT.subVectors(e,this.start),Ip.subVectors(this.end,this.start);const i=Ip.dot(Ip);let s=Ip.dot(dT)/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 pT=new k;class e9 extends Tt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new dt,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,l=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{xT.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(xT,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 d9 extends ls{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 dt;r.setAttribute("position",new We(t,3)),r.setAttribute("color",new We(i,3));const s=new yi({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Fe,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 p9{constructor(){this.type="ShapePath",this.color=new Fe,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Xf,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(m){const S=[];for(let w=0,A=m.length;wNumber.EPSILON){if(R<0&&(I=S[P],C=-C,L=S[b],R=-R),m.yL.y)continue;if(m.y===I.y){if(m.x===I.x)return!0}else{const W=R*(m.x-I.x)-C*(m.y-I.y);if(W===0)return!0;if(W<0)continue;A=!A}}else{if(m.y!==I.y)continue;if(L.x<=m.x&&m.x<=I.x||I.x<=m.x&&m.x<=L.x)return!0}}return A}const r=is.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const f=[];if(s.length===1)return a=s[0],l=new Ba,l.curves=a.curves,f.push(l),f;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],p=[];let v=[],y=0,_;p[y]=void 0,v[y]=[];for(let m=0,S=s.length;m1){let m=!1,S=0;for(let w=0,A=p.length;w0&&m===!1&&(v=d)}let M;for(let m=0,S=p.length;m{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 _=p;f(p=y,_)}}return t.add(v),()=>t.delete(v)},l={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,l),l}const k9=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),_T=k9?H.useEffect:H.useLayoutEffect;function HR(n){const e=typeof n=="function"?N9(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=H.useReducer(M=>M+1,0),o=e.getState(),a=H.useRef(o),l=H.useRef(i),f=H.useRef(r),h=H.useRef(!1),d=H.useRef();d.current===void 0&&(d.current=i(o));let p,v=!1;(a.current!==o||l.current!==i||f.current!==r||h.current)&&(p=i(o),v=!r(d.current,p)),_T(()=>{v&&(d.current=p),a.current=o,l.current=i,f.current=r,h.current=!1});const y=H.useRef(o);_T(()=>{const M=()=>{try{const S=e.getState(),w=l.current(S);f.current(d.current,w)||(a.current=S,d.current=w,s())}catch{h.current=!0,s()}},m=e.subscribe(M);return e.getState()!==y.current&&M(),m},[]);const _=v?p:d.current;return H.useDebugValue(_),_};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 WR={exports:{}},ly={exports:{}},uy={};/** - * @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 ST;function O9(){return ST||(ST=1,function(n){function e(D,V){var B=D.length;D.push(V);e:for(;0>>1,$=D[te];if(0>>1;ter(Ee,B))we<$&&0>r(Q,Ee)?(D[te]=Q,D[we]=B,te=we):(D[te]=Ee,D[ue]=B,te=ue);else if(we<$&&0>r(Q,B))D[te]=Q,D[we]=B,te=we;else break e}}return V}function r(D,V){var B=D.sortIndex-V.sortIndex;return B!==0?B:D.id-V.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 l=[],f=[],h=1,d=null,p=3,v=!1,y=!1,_=!1,M=typeof setTimeout=="function"?setTimeout:null,m=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 w(D){for(var V=t(f);V!==null;){if(V.callback===null)i(f);else if(V.startTime<=D)i(f),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(f)}}function A(D){if(_=!1,w(D),!y)if(t(l)!==null)y=!0,se(b);else{var V=t(f);V!==null&&ae(A,V.startTime-D)}}function b(D,V){y=!1,_&&(_=!1,m(L),L=-1),v=!0;var B=p;try{for(w(V),d=t(l);d!==null&&(!(d.expirationTime>V)||D&&!W());){var te=d.callback;if(typeof te=="function"){d.callback=null,p=d.priorityLevel;var $=te(d.expirationTime<=V);V=n.unstable_now(),typeof $=="function"?d.callback=$:d===t(l)&&i(l),w(V)}else i(l);d=t(l)}if(d!==null)var ee=!0;else{var ue=t(f);ue!==null&&ae(A,ue.startTime-V),ee=!1}return ee}finally{d=null,p=B,v=!1}}var P=!1,I=null,L=-1,C=5,R=-1;function W(){return!(n.unstable_now()-RD||125te?(D.sortIndex=B,e(f,D),t(l)===null&&D===t(f)&&(_?(m(L),L=-1):_=!0,ae(A,B-te))):(D.sortIndex=$,e(l,D),y||v||(y=!0,se(b))),D},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(D){var V=p;return function(){var B=p;p=V;try{return D.apply(this,arguments)}finally{p=B}}}}(uy)),uy}var wT;function U9(){return wT||(wT=1,ly.exports=O9()),ly.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 z9=function(e){var t={},i=H,r=U9(),s=Object.assign;function o(u){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+u,g=1;gq||E[U]!==T[q]){var he=` -`+E[U].replace(" at new "," at ");return u.displayName&&he.includes("")&&(he=he.replace("",u.displayName)),he}while(1<=U&&0<=q);break}}}finally{wt=!1,Error.prepareStackTrace=g}return(u=u?u.displayName||u.name:"")?Ht(u):""}var yn=Object.prototype.hasOwnProperty,vr=[],us=-1;function xi(u){return{current:u}}function It(u){0>us||(u.current=vr[us],vr[us]=null,us--)}function ht(u,c){us++,vr[us]=u.current,u.current=c}var qn={},xn=xi(qn),Ut=xi(!1),yr=qn;function Ys(u,c){var g=u.type.contextTypes;if(!g)return qn;var x=u.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===c)return x.__reactInternalMemoizedMaskedChildContext;var E={},T;for(T in g)E[T]=c[T];return x&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=c,u.__reactInternalMemoizedMaskedChildContext=E),E}function Hn(u){return u=u.childContextTypes,u!=null}function kh(){It(Ut),It(xn)}function FS(u,c,g){if(xn.current!==qn)throw Error(o(168));ht(xn,c),ht(Ut,g)}function BS(u,c,g){var x=u.stateNode;if(c=c.childContextTypes,typeof x.getChildContext!="function")return g;x=x.getChildContext();for(var E in x)if(!(E in c))throw Error(o(108,L(u)||"Unknown",E));return s({},g,x)}function Oh(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||qn,yr=xn.current,ht(xn,u),ht(Ut,Ut.current),!0}function VS(u,c,g){var x=u.stateNode;if(!x)throw Error(o(169));g?(u=BS(u,c,yr),x.__reactInternalMemoizedMergedChildContext=u,It(Ut),It(xn),ht(xn,u)):It(Ut),ht(Ut,g)}var xr=Math.clz32?Math.clz32:dI,fI=Math.log,hI=Math.LN2;function dI(u){return u>>>=0,u===0?32:31-(fI(u)/hI|0)|0}var Uh=64,zh=4194304;function Ku(u){switch(u&-u){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 u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function Fh(u,c){var g=u.pendingLanes;if(g===0)return 0;var x=0,E=u.suspendedLanes,T=u.pingedLanes,U=g&268435455;if(U!==0){var q=U&~E;q!==0?x=Ku(q):(T&=U,T!==0&&(x=Ku(T)))}else U=g&~E,U!==0?x=Ku(U):T!==0&&(x=Ku(T));if(x===0)return 0;if(c!==0&&c!==x&&!(c&E)&&(E=x&-x,T=c&-c,E>=T||E===16&&(T&4194240)!==0))return c;if(x&4&&(x|=g&16),c=u.entangledLanes,c!==0)for(u=u.entanglements,c&=x;0g;g++)c.push(u);return c}function Qu(u,c,g){u.pendingLanes|=c,c!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,c=31-xr(c),u[c]=g}function gI(u,c){var g=u.pendingLanes&~c;u.pendingLanes=c,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=c,u.mutableReadLanes&=c,u.entangledLanes&=c,c=u.entanglements;var x=u.eventTimes;for(u=u.expirationTimes;0>=U,E-=U,hs=1<<32-xr(c)+E|g<Pt?(kn=lt,lt=null):kn=lt.sibling;var Lt=tt(ie,lt,ce[Pt],Oe);if(Lt===null){lt===null&&(lt=kn);break}u&<&&Lt.alternate===null&&c(ie,lt),K=T(Lt,K,Pt),pt===null?Ze=Lt:pt.sibling=Lt,pt=Lt,lt=kn}if(Pt===ce.length)return g(ie,lt),Zt&&ea(ie,Pt),Ze;if(lt===null){for(;PtPt?(kn=lt,lt=null):kn=lt.sibling;var to=tt(ie,lt,Lt.value,Oe);if(to===null){lt===null&&(lt=kn);break}u&<&&to.alternate===null&&c(ie,lt),K=T(to,K,Pt),pt===null?Ze=to:pt.sibling=to,pt=to,lt=kn}if(Lt.done)return g(ie,lt),Zt&&ea(ie,Pt),Ze;if(lt===null){for(;!Lt.done;Pt++,Lt=ce.next())Lt=at(ie,Lt.value,Oe),Lt!==null&&(K=T(Lt,K,Pt),pt===null?Ze=Lt:pt.sibling=Lt,pt=Lt);return Zt&&ea(ie,Pt),Ze}for(lt=x(ie,lt);!Lt.done;Pt++,Lt=ce.next())Lt=Ft(lt,ie,Pt,Lt.value,Oe),Lt!==null&&(u&&Lt.alternate!==null&<.delete(Lt.key===null?Pt:Lt.key),K=T(Lt,K,Pt),pt===null?Ze=Lt:pt.sibling=Lt,pt=Lt);return u&<.forEach(function(tD){return c(ie,tD)}),Zt&&ea(ie,Pt),Ze}function sr(ie,K,ce,Oe){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 l:e:{for(var Ze=ce.key,pt=K;pt!==null;){if(pt.key===Ze){if(Ze=ce.type,Ze===h){if(pt.tag===7){g(ie,pt.sibling),K=E(pt,ce.props.children),K.return=ie,ie=K;break e}}else if(pt.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===w&&iw(Ze)===pt.type){g(ie,pt.sibling),K=E(pt,ce.props),K.ref=tc(ie,pt,ce),K.return=ie,ie=K;break e}g(ie,pt);break}else c(ie,pt);pt=pt.sibling}ce.type===h?(K=aa(ce.props.children,ie.mode,Oe,ce.key),K.return=ie,ie=K):(Oe=Td(ce.type,ce.key,ce.props,null,ie.mode,Oe),Oe.ref=tc(ie,K,ce),Oe.return=ie,ie=Oe)}return U(ie);case f:e:{for(pt=ce.key;K!==null;){if(K.key===pt)if(K.tag===4&&K.stateNode.containerInfo===ce.containerInfo&&K.stateNode.implementation===ce.implementation){g(ie,K.sibling),K=E(K,ce.children||[]),K.return=ie,ie=K;break e}else{g(ie,K);break}else c(ie,K);K=K.sibling}K=V0(ce,ie.mode,Oe),K.return=ie,ie=K}return U(ie);case w:return pt=ce._init,sr(ie,K,pt(ce._payload),Oe)}if(Z(ce))return Ke(ie,K,ce,Oe);if(P(ce))return Qn(ie,K,ce,Oe);Jh(ie,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,K!==null&&K.tag===6?(g(ie,K.sibling),K=E(K,ce),K.return=ie,ie=K):(g(ie,K),K=B0(ce,ie.mode,Oe),K.return=ie,ie=K),U(ie)):g(ie,K)}return sr}var dl=rw(!0),sw=rw(!1),nc={},tr=xi(nc),ic=xi(nc),pl=xi(nc);function Wr(u){if(u===nc)throw Error(o(174));return u}function r0(u,c){ht(pl,c),ht(ic,u),ht(tr,nc),u=ae(c),It(tr),ht(tr,u)}function ml(){It(tr),It(ic),It(pl)}function ow(u){var c=Wr(pl.current),g=Wr(tr.current);c=D(g,u.type,c),g!==c&&(ht(ic,u),ht(tr,c))}function s0(u){ic.current===u&&(It(tr),It(ic))}var Qt=xi(0);function Kh(u){for(var c=u;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Nh(g)||Ju(g)))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===u)break;for(;c.sibling===null;){if(c.return===null||c.return===u)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var o0=[];function a0(){for(var u=0;ug?g:4,u(!0);var x=nr.transition;nr.transition={};try{u(!1),c()}finally{Ct=g,nr.transition=x}}function _w(){return Gr().memoizedState}function CI(u,c,g){var x=Qs(u);g={lane:x,action:g,hasEagerState:!1,eagerState:null,next:null},Sw(u)?ww(c,g):(Mw(u,c,g),g=ui(),u=ir(u,x,g),u!==null&&Aw(u,c,x))}function PI(u,c,g){var x=Qs(u),E={lane:x,action:g,hasEagerState:!1,eagerState:null,next:null};if(Sw(u))ww(c,E);else{Mw(u,c,E);var T=u.alternate;if(u.lanes===0&&(T===null||T.lanes===0)&&(T=c.lastRenderedReducer,T!==null))try{var U=c.lastRenderedState,q=T(U,g);if(E.hasEagerState=!0,E.eagerState=q,Br(q,U))return}catch{}finally{}g=ui(),u=ir(u,x,g),u!==null&&Aw(u,c,x)}}function Sw(u){var c=u.alternate;return u===an||c!==null&&c===an}function ww(u,c){rc=$h=!0;var g=u.pending;g===null?c.next=c:(c.next=g.next,g.next=c),u.pending=c}function Mw(u,c,g){_n!==null&&u.mode&1&&!(xt&2)?(u=c.interleaved,u===null?(g.next=g,Hr===null?Hr=[c]:Hr.push(c)):(g.next=u.next,u.next=g),c.interleaved=g):(u=c.pending,u===null?g.next=g:(g.next=u.next,u.next=g),c.pending=g)}function Aw(u,c,g){if(g&4194240){var x=c.lanes;x&=u.pendingLanes,g|=x,c.lanes=g,Vg(u,g)}}var rd={readContext:Qi,useCallback:Jn,useContext:Jn,useEffect:Jn,useImperativeHandle:Jn,useInsertionEffect:Jn,useLayoutEffect:Jn,useMemo:Jn,useReducer:Jn,useRef:Jn,useState:Jn,useDebugValue:Jn,useDeferredValue:Jn,useTransition:Jn,useMutableSource:Jn,useSyncExternalStore:Jn,useId:Jn,unstable_isNewReconciler:!1},LI={readContext:Qi,useCallback:function(u,c){return ps().memoizedState=[u,c===void 0?null:c],u},useContext:Qi,useEffect:h0,useImperativeHandle:function(u,c,g){return g=g!=null?g.concat([u]):null,nd(4194308,4,gw.bind(null,c,u),g)},useLayoutEffect:function(u,c){return nd(4194308,4,u,c)},useInsertionEffect:function(u,c){return nd(4,2,u,c)},useMemo:function(u,c){var g=ps();return c=c===void 0?null:c,u=u(),g.memoizedState=[u,c],u},useReducer:function(u,c,g){var x=ps();return c=g!==void 0?g(c):c,x.memoizedState=x.baseState=c,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:c},x.queue=u,u=u.dispatch=CI.bind(null,an,u),[x.memoizedState,u]},useRef:function(u){var c=ps();return u={current:u},c.memoizedState=u},useState:f0,useDebugValue:d0,useDeferredValue:function(u){var c=f0(u),g=c[0],x=c[1];return h0(function(){var E=nr.transition;nr.transition={};try{x(u)}finally{nr.transition=E}},[u]),g},useTransition:function(){var u=f0(!1),c=u[0];return u=TI.bind(null,u[1]),ps().memoizedState=u,[c,u]},useMutableSource:function(){},useSyncExternalStore:function(u,c,g){var x=an,E=ps();if(Zt){if(g===void 0)throw Error(o(407));g=g()}else{if(g=c(),_n===null)throw Error(o(349));gl&30||uw(x,c,g)}E.memoizedState=g;var T={value:g,getSnapshot:c};return E.queue=T,h0(fw.bind(null,x,T,u),[u]),x.flags|=2048,oc(9,cw.bind(null,x,T,g,c),void 0,null),g},useId:function(){var u=ps(),c=_n.identifierPrefix;if(Zt){var g=ds,x=hs;g=(x&~(1<<32-xr(x)-1)).toString(32)+g,c=":"+c+"R"+g,g=sc++,0I0&&(c.flags|=128,x=!0,cc(E,!1),c.lanes=4194304)}else{if(!x)if(u=Kh(T),u!==null){if(c.flags|=128,x=!0,u=u.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),cc(E,!0),E.tail===null&&E.tailMode==="hidden"&&!T.alternate&&!Zt)return Kn(c),null}else 2*Dn()-E.renderingStartTime>I0&&g!==1073741824&&(c.flags|=128,x=!0,cc(E,!1),c.lanes=4194304);E.isBackwards?(T.sibling=c.child,c.child=T):(u=E.last,u!==null?u.sibling=T:c.child=T,E.last=T)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=Dn(),c.sibling=null,u=Qt.current,ht(Qt,x?u&1|2:u&1),c):(Kn(c),null);case 22:case 23:return U0(),x=c.memoizedState!==null,u!==null&&u.memoizedState!==null!==x&&(c.flags|=8192),x&&c.mode&1?Oi&1073741824&&(Kn(c),Me&&c.subtreeFlags&6&&(c.flags|=8192)):Kn(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}var kI=a.ReactCurrentOwner,ki=!1;function li(u,c,g,x){c.child=u===null?sw(c,null,g,x):dl(c,u.child,g,x)}function Iw(u,c,g,x,E){g=g.render;var T=c.ref;return ul(c,E),x=u0(u,c,g,x,T,E),g=c0(),u!==null&&!ki?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~E,ms(u,c,E)):(Zt&&g&&$g(c),c.flags|=1,li(u,c,x,E),c.child)}function Dw(u,c,g,x,E){if(u===null){var T=g.type;return typeof T=="function"&&!F0(T)&&T.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(c.tag=15,c.type=T,Nw(u,c,T,x,E)):(u=Td(g.type,null,x,c,c.mode,E),u.ref=c.ref,u.return=c,c.child=u)}if(T=u.child,!(u.lanes&E)){var U=T.memoizedProps;if(g=g.compare,g=g!==null?g:Hh,g(U,x)&&u.ref===c.ref)return ms(u,c,E)}return c.flags|=1,u=eo(T,x),u.ref=c.ref,u.return=c,c.child=u}function Nw(u,c,g,x,E){if(u!==null&&Hh(u.memoizedProps,x)&&u.ref===c.ref)if(ki=!1,(u.lanes&E)!==0)u.flags&131072&&(ki=!0);else return c.lanes=u.lanes,ms(u,c,E);return g0(u,c,g,x,E)}function kw(u,c,g){var x=c.pendingProps,E=x.children,T=u!==null?u.memoizedState:null;if(x.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null},ht(vl,Oi),Oi|=g;else if(g&1073741824)c.memoizedState={baseLanes:0,cachePool:null},x=T!==null?T.baseLanes:g,ht(vl,Oi),Oi|=x;else return u=T!==null?T.baseLanes|g:g,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:u,cachePool:null},c.updateQueue=null,ht(vl,Oi),Oi|=u,null;else T!==null?(x=T.baseLanes|g,c.memoizedState=null):x=g,ht(vl,Oi),Oi|=x;return li(u,c,E,g),c.child}function Ow(u,c){var g=c.ref;(u===null&&g!==null||u!==null&&u.ref!==g)&&(c.flags|=512,c.flags|=2097152)}function g0(u,c,g,x,E){var T=Hn(g)?yr:xn.current;return T=Ys(c,T),ul(c,E),g=u0(u,c,g,x,T,E),x=c0(),u!==null&&!ki?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~E,ms(u,c,E)):(Zt&&x&&$g(c),c.flags|=1,li(u,c,g,E),c.child)}function Uw(u,c,g,x,E){if(Hn(g)){var T=!0;Oh(c)}else T=!1;if(ul(c,E),c.stateNode===null)u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2),KS(c,g,x),Qg(c,g,x,E),x=!0;else if(u===null){var U=c.stateNode,q=c.memoizedProps;U.props=q;var he=U.context,Le=g.contextType;typeof Le=="object"&&Le!==null?Le=Qi(Le):(Le=Hn(g)?yr:xn.current,Le=Ys(c,Le));var Ve=g.getDerivedStateFromProps,at=typeof Ve=="function"||typeof U.getSnapshotBeforeUpdate=="function";at||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==x||he!==Le)&&QS(c,U,x,Le),qs=!1;var tt=c.memoizedState;U.state=tt,Xh(c,x,U,E),he=c.memoizedState,q!==x||tt!==he||Ut.current||qs?(typeof Ve=="function"&&(Kg(c,g,Ve,x),he=c.memoizedState),(q=qs||JS(c,g,q,x,tt,he,Le))?(at||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(c.flags|=4194308)):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=x,c.memoizedState=he),U.props=x,U.state=he,U.context=Le,x=q):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),x=!1)}else{U=c.stateNode,XS(u,c),q=c.memoizedProps,Le=c.type===c.elementType?q:_r(c.type,q),U.props=Le,at=c.pendingProps,tt=U.context,he=g.contextType,typeof he=="object"&&he!==null?he=Qi(he):(he=Hn(g)?yr:xn.current,he=Ys(c,he));var Ft=g.getDerivedStateFromProps;(Ve=typeof Ft=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==at||tt!==he)&&QS(c,U,x,he),qs=!1,tt=c.memoizedState,U.state=tt,Xh(c,x,U,E);var Ke=c.memoizedState;q!==at||tt!==Ke||Ut.current||qs?(typeof Ft=="function"&&(Kg(c,g,Ft,x),Ke=c.memoizedState),(Le=qs||JS(c,g,Le,x,tt,Ke,he)||!1)?(Ve||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(x,Ke,he),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(x,Ke,he)),typeof U.componentDidUpdate=="function"&&(c.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===u.memoizedProps&&tt===u.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===u.memoizedProps&&tt===u.memoizedState||(c.flags|=1024),c.memoizedProps=x,c.memoizedState=Ke),U.props=x,U.state=Ke,U.context=he,x=Le):(typeof U.componentDidUpdate!="function"||q===u.memoizedProps&&tt===u.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===u.memoizedProps&&tt===u.memoizedState||(c.flags|=1024),x=!1)}return v0(u,c,g,x,T,E)}function v0(u,c,g,x,E,T){Ow(u,c);var U=(c.flags&128)!==0;if(!x&&!U)return E&&VS(c,g,!1),ms(u,c,T);x=c.stateNode,kI.current=c;var q=U&&typeof g.getDerivedStateFromError!="function"?null:x.render();return c.flags|=1,u!==null&&U?(c.child=dl(c,u.child,null,T),c.child=dl(c,null,q,T)):li(u,c,q,T),c.memoizedState=x.state,E&&VS(c,g,!0),c.child}function zw(u){var c=u.stateNode;c.pendingContext?FS(u,c.pendingContext,c.pendingContext!==c.context):c.context&&FS(u,c.context,!1),r0(u,c.containerInfo)}function Fw(u,c,g,x,E){return hl(),i0(E),c.flags|=256,li(u,c,g,x),c.child}var ad={dehydrated:null,treeContext:null,retryLane:0};function ld(u){return{baseLanes:u,cachePool:null}}function Bw(u,c,g){var x=c.pendingProps,E=Qt.current,T=!1,U=(c.flags&128)!==0,q;if((q=U)||(q=u!==null&&u.memoizedState===null?!1:(E&2)!==0),q?(T=!0,c.flags&=-129):(u===null||u.memoizedState!==null)&&(E|=1),ht(Qt,E&1),u===null)return n0(c),u=c.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(c.mode&1?Ju(u)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(E=x.children,u=x.fallback,T?(x=c.mode,T=c.child,E={mode:"hidden",children:E},!(x&1)&&T!==null?(T.childLanes=0,T.pendingProps=E):T=Cd(E,x,0,null),u=aa(u,x,g,null),T.return=c,u.return=c,T.sibling=u,c.child=T,c.child.memoizedState=ld(g),c.memoizedState=ad,u):y0(c,E));if(E=u.memoizedState,E!==null){if(q=E.dehydrated,q!==null){if(U)return c.flags&256?(c.flags&=-257,ud(u,c,g,Error(o(422)))):c.memoizedState!==null?(c.child=u.child,c.flags|=128,null):(T=x.fallback,E=c.mode,x=Cd({mode:"visible",children:x.children},E,0,null),T=aa(T,E,g,null),T.flags|=2,x.return=c,T.return=c,x.sibling=T,c.child=x,c.mode&1&&dl(c,u.child,null,g),c.child.memoizedState=ld(g),c.memoizedState=ad,T);if(!(c.mode&1))c=ud(u,c,g,null);else if(Ju(q))c=ud(u,c,g,Error(o(419)));else if(x=(g&u.childLanes)!==0,ki||x){if(x=_n,x!==null){switch(g&-g){case 4:T=2;break;case 16:T=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:T=32;break;case 536870912:T=268435456;break;default:T=0}x=T&(x.suspendedLanes|g)?0:T,x!==0&&x!==E.retryLane&&(E.retryLane=x,ir(u,x,-1))}z0(),c=ud(u,c,g,Error(o(421)))}else Nh(q)?(c.flags|=128,c.child=u.child,c=qI.bind(null,u),zg(q,c),c=null):(g=E.treeContext,oe&&(Ni=ne(q),Di=c,Zt=!0,Sr=null,$u=!1,g!==null&&($i[er++]=hs,$i[er++]=ds,$i[er++]=$o,hs=g.id,ds=g.overflow,$o=c)),c=y0(c,c.pendingProps.children),c.flags|=4096);return c}return T?(x=Hw(u,c,x.children,x.fallback,g),T=c.child,E=u.child.memoizedState,T.memoizedState=E===null?ld(g):{baseLanes:E.baseLanes|g,cachePool:null},T.childLanes=u.childLanes&~g,c.memoizedState=ad,x):(g=Vw(u,c,x.children,g),c.memoizedState=null,g)}return T?(x=Hw(u,c,x.children,x.fallback,g),T=c.child,E=u.child.memoizedState,T.memoizedState=E===null?ld(g):{baseLanes:E.baseLanes|g,cachePool:null},T.childLanes=u.childLanes&~g,c.memoizedState=ad,x):(g=Vw(u,c,x.children,g),c.memoizedState=null,g)}function y0(u,c){return c=Cd({mode:"visible",children:c},u.mode,0,null),c.return=u,u.child=c}function Vw(u,c,g,x){var E=u.child;return u=E.sibling,g=eo(E,{mode:"visible",children:g}),!(c.mode&1)&&(g.lanes=x),g.return=c,g.sibling=null,u!==null&&(x=c.deletions,x===null?(c.deletions=[u],c.flags|=16):x.push(u)),c.child=g}function Hw(u,c,g,x,E){var T=c.mode;u=u.child;var U=u.sibling,q={mode:"hidden",children:g};return!(T&1)&&c.child!==u?(g=c.child,g.childLanes=0,g.pendingProps=q,c.deletions=null):(g=eo(u,q),g.subtreeFlags=u.subtreeFlags&14680064),U!==null?x=eo(U,x):(x=aa(x,T,E,null),x.flags|=2),x.return=c,g.return=c,g.sibling=x,c.child=g,x}function ud(u,c,g,x){return x!==null&&i0(x),dl(c,u.child,null,g),u=y0(c,c.pendingProps.children),u.flags|=2,c.memoizedState=null,u}function Ww(u,c,g){u.lanes|=c;var x=u.alternate;x!==null&&(x.lanes|=c),Zg(u.return,c,g)}function x0(u,c,g,x,E){var T=u.memoizedState;T===null?u.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:E}:(T.isBackwards=c,T.rendering=null,T.renderingStartTime=0,T.last=x,T.tail=g,T.tailMode=E)}function Gw(u,c,g){var x=c.pendingProps,E=x.revealOrder,T=x.tail;if(li(u,c,x.children,g),x=Qt.current,x&2)x=x&1|2,c.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=c.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Ww(u,g,c);else if(u.tag===19)Ww(u,g,c);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}x&=1}if(ht(Qt,x),!(c.mode&1))c.memoizedState=null;else switch(E){case"forwards":for(g=c.child,E=null;g!==null;)u=g.alternate,u!==null&&Kh(u)===null&&(E=g),g=g.sibling;g=E,g===null?(E=c.child,c.child=null):(E=g.sibling,g.sibling=null),x0(c,!1,E,g,T);break;case"backwards":for(g=null,E=c.child,c.child=null;E!==null;){if(u=E.alternate,u!==null&&Kh(u)===null){c.child=E;break}u=E.sibling,E.sibling=g,g=E,E=u}x0(c,!0,g,null,T);break;case"together":x0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function ms(u,c,g){if(u!==null&&(c.dependencies=u.dependencies),yl|=c.lanes,!(g&c.childLanes))return null;if(u!==null&&c.child!==u.child)throw Error(o(153));if(c.child!==null){for(u=c.child,g=eo(u,u.pendingProps),c.child=g,g.return=c;u.sibling!==null;)u=u.sibling,g=g.sibling=eo(u,u.pendingProps),g.return=c;g.sibling=null}return c.child}function OI(u,c,g){switch(c.tag){case 3:zw(c),hl();break;case 5:ow(c);break;case 1:Hn(c.type)&&Oh(c);break;case 4:r0(c,c.stateNode.containerInfo);break;case 10:jS(c,c.type._context,c.memoizedProps.value);break;case 13:var x=c.memoizedState;if(x!==null)return x.dehydrated!==null?(ht(Qt,Qt.current&1),c.flags|=128,null):g&c.child.childLanes?Bw(u,c,g):(ht(Qt,Qt.current&1),u=ms(u,c,g),u!==null?u.sibling:null);ht(Qt,Qt.current&1);break;case 19:if(x=(g&c.childLanes)!==0,u.flags&128){if(x)return Gw(u,c,g);c.flags|=128}var E=c.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),ht(Qt,Qt.current),x)break;return null;case 22:case 23:return c.lanes=0,kw(u,c,g)}return ms(u,c,g)}function UI(u,c){switch(e0(c),c.tag){case 1:return Hn(c.type)&&kh(),u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 3:return ml(),It(Ut),It(xn),a0(),u=c.flags,u&65536&&!(u&128)?(c.flags=u&-65537|128,c):null;case 5:return s0(c),null;case 13:if(It(Qt),u=c.memoizedState,u!==null&&u.dehydrated!==null){if(c.alternate===null)throw Error(o(340));hl()}return u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 19:return It(Qt),null;case 4:return ml(),null;case 10:return qg(c.type._context),null;case 22:case 23:return U0(),null;case 24:return null;default:return null}}var cd=!1,na=!1,zI=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function fd(u,c){var g=u.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(x){wi(u,c,x)}else g.current=null}function _0(u,c,g){try{g()}catch(x){wi(u,c,x)}}var jw=!1;function FI(u,c){for(V(u.containerInfo),Ne=c;Ne!==null;)if(u=Ne,c=u.child,(u.subtreeFlags&1028)!==0&&c!==null)c.return=u,Ne=c;else for(;Ne!==null;){u=Ne;try{var g=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var x=g.memoizedProps,E=g.memoizedState,T=u.stateNode,U=T.getSnapshotBeforeUpdate(u.elementType===u.type?x:_r(u.type,x),E);T.__reactInternalSnapshotBeforeUpdate=U}break;case 3:Me&&Ue(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(q){wi(u,u.return,q)}if(c=u.sibling,c!==null){c.return=u.return,Ne=c;break}Ne=u.return}return g=jw,jw=!1,g}function ia(u,c,g){var x=c.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var E=x=x.next;do{if((E.tag&u)===u){var T=E.destroy;E.destroy=void 0,T!==void 0&&_0(c,g,T)}E=E.next}while(E!==x)}}function fc(u,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var g=c=c.next;do{if((g.tag&u)===u){var x=g.create;g.destroy=x()}g=g.next}while(g!==c)}}function S0(u){var c=u.ref;if(c!==null){var g=u.stateNode;switch(u.tag){case 5:u=se(g);break;default:u=g}typeof c=="function"?c(u):c.current=u}}function Xw(u,c,g){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(Bh,c)}catch{}switch(c.tag){case 0:case 11:case 14:case 15:if(u=c.updateQueue,u!==null&&(u=u.lastEffect,u!==null)){var x=u=u.next;do{var E=x,T=E.destroy;E=E.tag,T!==void 0&&(E&2||E&4)&&_0(c,g,T),x=x.next}while(x!==u)}break;case 1:if(fd(c,g),u=c.stateNode,typeof u.componentWillUnmount=="function")try{u.props=c.memoizedProps,u.state=c.memoizedState,u.componentWillUnmount()}catch(U){wi(c,g,U)}break;case 5:fd(c,g);break;case 4:Me?Qw(u,c,g):ge&&ge&&(c=c.stateNode.containerInfo,g=Ot(c),mr(c,g))}}function Yw(u,c,g){for(var x=c;;)if(Xw(u,x,g),x.child===null||Me&&x.tag===4){if(x===c)break;for(;x.sibling===null;){if(x.return===null||x.return===c)return;x=x.return}x.sibling.return=x.return,x=x.sibling}else x.child.return=x,x=x.child}function qw(u){var c=u.alternate;c!==null&&(u.alternate=null,qw(c)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(c=u.stateNode,c!==null&&Ge(c)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function Zw(u){return u.tag===5||u.tag===3||u.tag===4}function Jw(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Zw(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Kw(u){if(Me){e:{for(var c=u.return;c!==null;){if(Zw(c))break e;c=c.return}throw Error(o(160))}var g=c;switch(g.tag){case 5:c=g.stateNode,g.flags&32&&(ct(c),g.flags&=-33),g=Jw(u),M0(u,g,c);break;case 3:case 4:c=g.stateNode.containerInfo,g=Jw(u),w0(u,g,c);break;default:throw Error(o(161))}}}function w0(u,c,g){var x=u.tag;if(x===5||x===6)u=u.stateNode,c?Se(g,u,c):ze(g,u);else if(x!==4&&(u=u.child,u!==null))for(w0(u,c,g),u=u.sibling;u!==null;)w0(u,c,g),u=u.sibling}function M0(u,c,g){var x=u.tag;if(x===5||x===6)u=u.stateNode,c?de(g,u,c):et(g,u);else if(x!==4&&(u=u.child,u!==null))for(M0(u,c,g),u=u.sibling;u!==null;)M0(u,c,g),u=u.sibling}function Qw(u,c,g){for(var x=c,E=!1,T,U;;){if(!E){E=x.return;e:for(;;){if(E===null)throw Error(o(160));switch(T=E.stateNode,E.tag){case 5:U=!1;break e;case 3:T=T.containerInfo,U=!0;break e;case 4:T=T.containerInfo,U=!0;break e}E=E.return}E=!0}if(x.tag===5||x.tag===6)Yw(u,x,g),U?Qe(T,x.stateNode):Pe(T,x.stateNode);else if(x.tag===18)U?St(T,x.stateNode):yt(T,x.stateNode);else if(x.tag===4){if(x.child!==null){T=x.stateNode.containerInfo,U=!0,x.child.return=x,x=x.child;continue}}else if(Xw(u,x,g),x.child!==null){x.child.return=x,x=x.child;continue}if(x===c)break;for(;x.sibling===null;){if(x.return===null||x.return===c)return;x=x.return,x.tag===4&&(E=!1)}x.sibling.return=x.return,x=x.sibling}}function A0(u,c){if(Me){switch(c.tag){case 0:case 11:case 14:case 15:ia(3,c,c.return),fc(3,c),ia(5,c,c.return);return;case 1:return;case 5:var g=c.stateNode;if(g!=null){var x=c.memoizedProps;u=u!==null?u.memoizedProps:x;var E=c.type,T=c.updateQueue;c.updateQueue=null,T!==null&&G(g,T,E,u,x,c)}return;case 6:if(c.stateNode===null)throw Error(o(162));g=c.memoizedProps,pe(c.stateNode,u!==null?u.memoizedProps:g,g);return;case 3:oe&&u!==null&&u.memoizedState.isDehydrated&&ft(c.stateNode.containerInfo);return;case 12:return;case 13:hd(c);return;case 19:hd(c);return;case 17:return}throw Error(o(163))}switch(c.tag){case 0:case 11:case 14:case 15:ia(3,c,c.return),fc(3,c),ia(5,c,c.return);return;case 12:return;case 13:hd(c);return;case 19:hd(c);return;case 3:oe&&u!==null&&u.memoizedState.isDehydrated&&ft(c.stateNode.containerInfo);break;case 22:case 23:return}e:if(ge){switch(c.tag){case 1:case 5:case 6:break e;case 3:case 4:c=c.stateNode,mr(c.containerInfo,c.pendingChildren);break e}throw Error(o(163))}}function hd(u){var c=u.updateQueue;if(c!==null){u.updateQueue=null;var g=u.stateNode;g===null&&(g=u.stateNode=new zI),c.forEach(function(x){var E=ZI.bind(null,u,x);g.has(x)||(g.add(x),x.then(E,E))})}}function BI(u,c){for(Ne=c;Ne!==null;){c=Ne;var g=c.deletions;if(g!==null)for(var x=0;x";case pd:return":has("+(T0(u)||"")+")";case md:return'[role="'+u.value+'"]';case vd:return'"'+u.value+'"';case gd:return'[data-testname="'+u.value+'"]';default:throw Error(o(365))}}function iM(u,c){var g=[];u=[u,0];for(var x=0;xE&&(E=U),x&=~T}if(x=E,x=Dn()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*HI(x/1960))-x,10u?16:u,Ks===null)var x=!1;else{if(u=Ks,Ks=null,wd=0,xt&6)throw Error(o(331));var E=xt;for(xt|=4,Ne=u.current;Ne!==null;){var T=Ne,U=T.child;if(Ne.flags&16){var q=T.deletions;if(q!==null){for(var he=0;heDn()-R0?ra(u,0):L0|=g),Si(u,c)}function hM(u,c){c===0&&(u.mode&1?(c=zh,zh<<=1,!(zh&130023424)&&(zh=4194304)):c=1);var g=ui();u=Ed(u,c),u!==null&&(Qu(u,c,g),Si(u,g))}function qI(u){var c=u.memoizedState,g=0;c!==null&&(g=c.retryLane),hM(u,g)}function ZI(u,c){var g=0;switch(u.tag){case 13:var x=u.stateNode,E=u.memoizedState;E!==null&&(g=E.retryLane);break;case 19:x=u.stateNode;break;default:throw Error(o(314))}x!==null&&x.delete(c),hM(u,g)}var dM;dM=function(u,c,g){if(u!==null)if(u.memoizedProps!==c.pendingProps||Ut.current)ki=!0;else{if(!(u.lanes&g)&&!(c.flags&128))return ki=!1,OI(u,c,g);ki=!!(u.flags&131072)}else ki=!1,Zt&&c.flags&1048576&&$S(c,Zh,c.index);switch(c.lanes=0,c.tag){case 2:var x=c.type;u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2),u=c.pendingProps;var E=Ys(c,xn.current);ul(c,g),E=u0(null,c,x,u,E,g);var T=c0();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,Hn(x)?(T=!0,Oh(c)):T=!1,c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Jg(c),E.updater=Yh,c.stateNode=E,E._reactInternals=c,Qg(c,x,u,g),c=v0(null,c,x,!0,T,g)):(c.tag=0,Zt&&T&&$g(c),li(null,c,E,g),c=c.child),c;case 16:x=c.elementType;e:{switch(u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2),u=c.pendingProps,E=x._init,x=E(x._payload),c.type=x,E=c.tag=KI(x),u=_r(x,u),E){case 0:c=g0(null,c,x,u,g);break e;case 1:c=Uw(null,c,x,u,g);break e;case 11:c=Iw(null,c,x,u,g);break e;case 14:c=Dw(null,c,x,_r(x.type,u),g);break e}throw Error(o(306,x,""))}return c;case 0:return x=c.type,E=c.pendingProps,E=c.elementType===x?E:_r(x,E),g0(u,c,x,E,g);case 1:return x=c.type,E=c.pendingProps,E=c.elementType===x?E:_r(x,E),Uw(u,c,x,E,g);case 3:e:{if(zw(c),u===null)throw Error(o(387));x=c.pendingProps,T=c.memoizedState,E=T.element,XS(u,c),Xh(c,x,null,g);var U=c.memoizedState;if(x=U.element,oe&&T.isDehydrated)if(T={element:x,isDehydrated:!1,cache:U.cache,transitions:U.transitions},c.updateQueue.baseState=T,c.memoizedState=T,c.flags&256){E=Error(o(423)),c=Fw(u,c,x,g,E);break e}else if(x!==E){E=Error(o(424)),c=Fw(u,c,x,g,E);break e}else for(oe&&(Ni=me(c.stateNode.containerInfo),Di=c,Zt=!0,Sr=null,$u=!1),g=sw(c,null,x,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(hl(),x===E){c=ms(u,c,g);break e}li(u,c,x,g)}c=c.child}return c;case 5:return ow(c),u===null&&n0(c),x=c.type,E=c.pendingProps,T=u!==null?u.memoizedProps:null,U=E.children,Ee(x,E)?U=null:T!==null&&Ee(x,T)&&(c.flags|=32),Ow(u,c),li(u,c,U,g),c.child;case 6:return u===null&&n0(c),null;case 13:return Bw(u,c,g);case 4:return r0(c,c.stateNode.containerInfo),x=c.pendingProps,u===null?c.child=dl(c,null,x,g):li(u,c,x,g),c.child;case 11:return x=c.type,E=c.pendingProps,E=c.elementType===x?E:_r(x,E),Iw(u,c,x,E,g);case 7:return li(u,c,c.pendingProps,g),c.child;case 8:return li(u,c,c.pendingProps.children,g),c.child;case 12:return li(u,c,c.pendingProps.children,g),c.child;case 10:e:{if(x=c.type._context,E=c.pendingProps,T=c.memoizedProps,U=E.value,jS(c,x,U),T!==null)if(Br(T.value,U)){if(T.children===E.children&&!Ut.current){c=ms(u,c,g);break e}}else for(T=c.child,T!==null&&(T.return=c);T!==null;){var q=T.dependencies;if(q!==null){U=T.child;for(var he=q.firstContext;he!==null;){if(he.context===x){if(T.tag===1){he=fs(-1,g&-g),he.tag=2;var Le=T.updateQueue;if(Le!==null){Le=Le.shared;var Ve=Le.pending;Ve===null?he.next=he:(he.next=Ve.next,Ve.next=he),Le.pending=he}}T.lanes|=g,he=T.alternate,he!==null&&(he.lanes|=g),Zg(T.return,g,c),q.lanes|=g;break}he=he.next}}else if(T.tag===10)U=T.type===c.type?null:T.child;else if(T.tag===18){if(U=T.return,U===null)throw Error(o(341));U.lanes|=g,q=U.alternate,q!==null&&(q.lanes|=g),Zg(U,g,c),U=T.sibling}else U=T.child;if(U!==null)U.return=T;else for(U=T;U!==null;){if(U===c){U=null;break}if(T=U.sibling,T!==null){T.return=U.return,U=T;break}U=U.return}T=U}li(u,c,E.children,g),c=c.child}return c;case 9:return E=c.type,x=c.pendingProps.children,ul(c,g),E=Qi(E),x=x(E),c.flags|=1,li(u,c,x,g),c.child;case 14:return x=c.type,E=_r(x,c.pendingProps),E=_r(x.type,E),Dw(u,c,x,E,g);case 15:return Nw(u,c,c.type,c.pendingProps,g);case 17:return x=c.type,E=c.pendingProps,E=c.elementType===x?E:_r(x,E),u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2),c.tag=1,Hn(x)?(u=!0,Oh(c)):u=!1,ul(c,g),KS(c,x,E),Qg(c,x,E,g),v0(null,c,x,!0,u,g);case 19:return Gw(u,c,g);case 22:return kw(u,c,g)}throw Error(o(156,c.tag))};function pM(u,c){return Hg(u,c)}function JI(u,c,g,x){this.tag=u,this.key=g,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=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rr(u,c,g,x){return new JI(u,c,g,x)}function F0(u){return u=u.prototype,!(!u||!u.isReactComponent)}function KI(u){if(typeof u=="function")return F0(u)?1:0;if(u!=null){if(u=u.$$typeof,u===_)return 11;if(u===S)return 14}return 2}function eo(u,c){var g=u.alternate;return g===null?(g=rr(u.tag,c,u.key,u.mode),g.elementType=u.elementType,g.type=u.type,g.stateNode=u.stateNode,g.alternate=u,u.alternate=g):(g.pendingProps=c,g.type=u.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=u.flags&14680064,g.childLanes=u.childLanes,g.lanes=u.lanes,g.child=u.child,g.memoizedProps=u.memoizedProps,g.memoizedState=u.memoizedState,g.updateQueue=u.updateQueue,c=u.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=u.sibling,g.index=u.index,g.ref=u.ref,g}function Td(u,c,g,x,E,T){var U=2;if(x=u,typeof u=="function")F0(u)&&(U=1);else if(typeof u=="string")U=5;else e:switch(u){case h:return aa(g.children,E,T,c);case d:U=8,E|=8;break;case p:return u=rr(12,g,c,E|2),u.elementType=p,u.lanes=T,u;case M:return u=rr(13,g,c,E),u.elementType=M,u.lanes=T,u;case m:return u=rr(19,g,c,E),u.elementType=m,u.lanes=T,u;case A:return Cd(g,E,T,c);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case v:U=10;break e;case y:U=9;break e;case _:U=11;break e;case S:U=14;break e;case w:U=16,x=null;break e}throw Error(o(130,u==null?u:typeof u,""))}return c=rr(U,g,c,E),c.elementType=u,c.type=x,c.lanes=T,c}function aa(u,c,g,x){return u=rr(7,u,x,c),u.lanes=g,u}function Cd(u,c,g,x){return u=rr(22,u,x,c),u.elementType=A,u.lanes=g,u.stateNode={},u}function B0(u,c,g){return u=rr(6,u,null,c),u.lanes=g,u}function V0(u,c,g){return c=rr(4,u.children!==null?u.children:[],u.key,c),c.lanes=g,c.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},c}function QI(u,c,g,x,E){this.tag=c,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ye,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bg(0),this.expirationTimes=Bg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bg(0),this.identifierPrefix=x,this.onRecoverableError=E,oe&&(this.mutableSourceEagerHydrationData=null)}function mM(u,c,g,x,E,T,U,q,he){return u=new QI(u,c,g,q,he),c===1?(c=1,T===!0&&(c|=8)):c=0,T=rr(3,null,null,c),u.current=T,T.stateNode=u,T.memoizedState={element:x,isDehydrated:g,cache:null,transitions:null},Jg(T),u}function gM(u){if(!u)return qn;u=u._reactInternals;e:{if(C(u)!==u||u.tag!==1)throw Error(o(170));var c=u;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Hn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(u.tag===1){var g=u.type;if(Hn(g))return BS(u,g,c)}return c}function vM(u){var c=u._reactInternals;if(c===void 0)throw typeof u.render=="function"?Error(o(188)):(u=Object.keys(u).join(","),Error(o(268,u)));return u=J(c),u===null?null:u.stateNode}function yM(u,c){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var g=u.retryLane;u.retryLane=g!==0&&g=Le&&T>=at&&E<=Ve&&U<=tt){u.splice(c,1);break}else if(x!==Le||g.width!==he.width||ttU){if(!(T!==at||g.height!==he.height||VeE)){Le>x&&(he.width+=Le-x,he.x=x),VeT&&(he.height+=at-T,he.y=T),ttg&&(g=U)),U ")+` - -No matching component was found for: - `)+u.join(" > ")}return null},t.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return se(u.child.stateNode);default:return u.child.stateNode}},t.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:$I,findFiberByHostInstance:u.findFiberByHostInstance||eD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)u=!0;else{try{Bh=c.inject(u),Fr=c}catch{}u=!!c.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,c,g,x){if(!nt)throw Error(o(363));u=C0(u,c);var E=Re(u,g,x).disconnect;return{disconnect:function(){E()}}},t.registerMutableSourceForHydration=function(u,c){var g=c._getVersion;g=g(c._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[c,g]:u.mutableSourceEagerHydrationData.push(c,g)},t.runWithPriority=function(u,c){var g=Ct;try{return Ct=u,c()}finally{Ct=g}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,c,g,x){var E=c.current,T=ui(),U=Qs(E);return g=gM(g),c.context===null?c.context=g:c.pendingContext=g,c=fs(T,U),c.payload={element:u},x=x===void 0?null:x,x!==null&&(c.callback=x),Zs(E,c),u=ir(E,U,T),u!==null&&jh(u,E,U),U},t};WR.exports=z9;var F9=WR.exports;const B9=E_(F9);var GR={exports:{}},jR={};/** - * @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(D,V){var B=D.length;D.push(V);e:for(;0>>1,$=D[te];if(0>>1;ter(Ee,B))we<$&&0>r(Q,Ee)?(D[te]=Q,D[we]=B,te=we):(D[te]=Ee,D[ue]=B,te=ue);else if(we<$&&0>r(Q,B))D[te]=Q,D[we]=B,te=we;else break e}}return V}function r(D,V){var B=D.sortIndex-V.sortIndex;return B!==0?B:D.id-V.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 l=[],f=[],h=1,d=null,p=3,v=!1,y=!1,_=!1,M=typeof setTimeout=="function"?setTimeout:null,m=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 w(D){for(var V=t(f);V!==null;){if(V.callback===null)i(f);else if(V.startTime<=D)i(f),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(f)}}function A(D){if(_=!1,w(D),!y)if(t(l)!==null)y=!0,se(b);else{var V=t(f);V!==null&&ae(A,V.startTime-D)}}function b(D,V){y=!1,_&&(_=!1,m(L),L=-1),v=!0;var B=p;try{for(w(V),d=t(l);d!==null&&(!(d.expirationTime>V)||D&&!W());){var te=d.callback;if(typeof te=="function"){d.callback=null,p=d.priorityLevel;var $=te(d.expirationTime<=V);V=n.unstable_now(),typeof $=="function"?d.callback=$:d===t(l)&&i(l),w(V)}else i(l);d=t(l)}if(d!==null)var ee=!0;else{var ue=t(f);ue!==null&&ae(A,ue.startTime-V),ee=!1}return ee}finally{d=null,p=B,v=!1}}var P=!1,I=null,L=-1,C=5,R=-1;function W(){return!(n.unstable_now()-RD||125te?(D.sortIndex=B,e(f,D),t(l)===null&&D===t(f)&&(_?(m(L),L=-1):_=!0,ae(A,B-te))):(D.sortIndex=$,e(l,D),y||v||(y=!0,se(b))),D},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(D){var V=p;return function(){var B=p;p=V;try{return D.apply(this,arguments)}finally{p=B}}}})(jR);GR.exports=jR;var MT=GR.exports;function XR(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;rr.response=s).then(()=>{i.lifespan&&i.lifespan>0&&setTimeout(()=>{const s=bs.indexOf(r);s!==-1&&bs.splice(s,1)},i.lifespan)}).catch(s=>r.error=s)};if(bs.push(r),!t)throw r.promise}const V9=(n,e,t)=>YR(n,e,!1,t),H9=(n,e,t)=>void YR(n,e,!0,t),W9=n=>{if(n===void 0||n.length===0)bs.splice(0,bs.length);else{const e=bs.find(t=>XR(n,t.keys,t.equal));if(e){const t=bs.indexOf(e);t!==-1&&bs.splice(t,1)}}};var AT,ET;const qR=n=>n&&n.isOrthographicCamera,G9=n=>n&&n.hasOwnProperty("current"),Lh=typeof window<"u"&&((AT=window.document)!=null&&AT.createElement||((ET=window.navigator)==null?void 0:ET.product)==="ReactNative")?H.useLayoutEffect:H.useEffect;function ZR(n){const e=H.useRef(n);return Lh(()=>void(e.current=n),[n]),e}function j9({set:n}){return Lh(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class JR extends H.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}JR.getDerivedStateFromError=()=>({error:!0});const KR="__default",X9=n=>n&&!!n.memoized&&!!n.changes;function QR(n){const e=typeof window<"u"?window.devicePixelRatio:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const zc=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},cn={obj:n=>n===Object(n)&&!cn.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(cn.str(n)||cn.num(n))return n===e;const s=cn.obj(n);if(s&&i==="reference")return n===e;const o=cn.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;for(a in r?e:n)if(n[a]!==e[a])return!1;if(cn.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 Y9(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function q9(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Gl(n,e){const t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function __(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 bT=/-\d+$/;function cy(n,e,t){if(cn.str(t)){if(bT.test(t)){const s=t.replace(bT,""),{target:o,key:a}=__(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=__(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function TT(n,e,t){var i,r;if(cn.str(t)){const{target:s,key:o}=__(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 $R(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},f=!1){var h;const d=(h=n==null?void 0:n.__r3f)!=null?h:{},p=Object.entries(r),v=[];if(f){const _=Object.keys(l);for(let M=0;M<_.length;M++)r.hasOwnProperty(_[M])||p.unshift([_[M],KR+"remove"])}p.forEach(([_,M])=>{var m;if((m=n.__r3f)!=null&&m.primitive&&_==="object"||cn.equ(M,l[_]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(_))return v.push([_,M,!0,[]]);let S=[];_.includes("-")&&(S=_.split("-")),v.push([_,M,!1,S]);for(const w in r){const A=r[w];w.startsWith(`${_}-`)&&v.push([w,A,!1,w.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}}function fy(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:l,changes:f}=X9(e)?e:$R(n,e),h=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let v=0;vA[b],n),!(w&&w.set))){const[A,...b]=m.reverse();S=b.reverse().reduce((P,I)=>P[I],n),y=A}if(_===KR+"remove")if(w&&w.constructor){var d;_=new w.constructor(...(d=l.args)!=null?d:[])}else if(S.constructor){var p;const A=new S.constructor(...(p=S.__r3f.memoizedProps.args)!=null?p:[]);_=A[w],A.dispose&&A.dispose()}else _=0;if(M)_?s.handlers[y]=_:delete s.handlers[y],s.eventCount=Object.keys(s.handlers).length;else if(w&&w.set&&(w.copy||w instanceof Fa)){if(Array.isArray(_))w.fromArray?w.fromArray(_):w.set(..._);else if(w.copy&&_&&_.constructor&&w.constructor.name===_.constructor.name)w.copy(_);else if(_!==void 0){const A=w instanceof Fe;!A&&w.setScalar?w.setScalar(_):w instanceof Fa&&_ instanceof Fa?w.mask=_.mask:w.set(_),!("ColorManagement"in jm)&&!a.linear&&A&&w.convertSRGBToLinear()}}else S[y]=_,!a.linear&&S[y]instanceof hn&&(S[y].encoding=zt);jl(n)}if(s.parent&&a.internal&&n.raycast&&h!==s.eventCount){const v=a.internal.interaction.indexOf(n);v>-1&&a.internal.interaction.splice(v,1),s.eventCount&&a.internal.interaction.push(n)}return f.length&&(r=n.__r3f)!=null&&r.parent&&S_(n),n}function jl(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 S_(n){n.onUpdate==null||n.onUpdate(n)}function Z9(n,e){n.manual||(qR(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 J9(n,e,t){const i=t.pop(),r=t.reduce((s,o)=>s[o],n);return r[i]=e}function zp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function K9(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return du.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return du.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return du.ContinuousEventPriority;default:return du.DefaultEventPriority}}function eI(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function Q9(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)=>{eI(t.capturedMap,e,i,r)})}function $9(n){function e(l){const{internal:f}=n.getState(),h=l.offsetX-f.initialClick[0],d=l.offsetY-f.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(l){return l.filter(f=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=f.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(l,f){const h=n.getState(),d=new Set,p=[],v=f?f(h.internal.interaction):h.internal.interaction;for(let m=0;m{const w=zc(m.object),A=zc(S.object);return!w||!A?m.distance-S.distance:A.events.priority-w.events.priority||m.distance-S.distance}).filter(m=>{const S=zp(m);return d.has(S)?!1:(d.add(S),!0)});h.events.filter&&(_=h.events.filter(_,h));for(const m of _){let S=m.object;for(;S;){var M;(M=S.__r3f)!=null&&M.eventCount&&p.push({...m,eventObject:S}),S=S.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let m of h.internal.capturedMap.get(l.pointerId).values())d.has(zp(m.intersection))||p.push(m.intersection);return p}function r(l,f,h,d){const p=n.getState();if(l.length){const v={stopped:!1};for(const y of l){const _=zc(y.object)||p,{raycaster:M,pointer:m,camera:S,internal:w}=_,A=new k(m.x,m.y,0).unproject(S),b=R=>{var W,J;return(W=(J=w.capturedMap.get(R))==null?void 0:J.has(y.eventObject))!=null?W:!1},P=R=>{const W={intersection:y,target:f.target};w.capturedMap.has(R)?w.capturedMap.get(R).set(y.eventObject,W):w.capturedMap.set(R,new Map([[y.eventObject,W]])),f.target.setPointerCapture(R)},I=R=>{const W=w.capturedMap.get(R);W&&eI(w.capturedMap,y.eventObject,W,R)};let L={};for(let R in f){let W=f[R];typeof W!="function"&&(L[R]=W)}let C={...y,...L,pointer:m,intersections:l,stopped:v.stopped,delta:h,unprojectedPoint:A,ray:M.ray,camera:S,stopPropagation(){const R="pointerId"in f&&w.capturedMap.get(f.pointerId);if((!R||R.has(y.eventObject))&&(C.stopped=v.stopped=!0,w.hovered.size&&Array.from(w.hovered.values()).find(W=>W.eventObject===y.eventObject))){const W=l.slice(0,l.indexOf(y));s([...W,y])}},target:{hasPointerCapture:b,setPointerCapture:P,releasePointerCapture:I},currentTarget:{hasPointerCapture:b,setPointerCapture:P,releasePointerCapture:I},nativeEvent:f};if(d(C),v.stopped===!0)break}}return l}function s(l){const{internal:f}=n.getState();for(const h of f.hovered.values())if(!l.length||!l.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(zp(h)),p!=null&&p.eventCount){const y={...h,intersections:l};v.onPointerOut==null||v.onPointerOut(y),v.onPointerLeave==null||v.onPointerLeave(y)}}}function o(l,f){for(let h=0;hs([]);case"onLostPointerCapture":return f=>{const{internal:h}=n.getState();"pointerId"in f&&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=l==="onPointerMove",y=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",M=i(h,v?t:void 0),m=y?e(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=M.map(w=>w.eventObject)),y&&!M.length&&m<=2&&(o(h,p.interaction),d&&d(h)),v&&s(M);function S(w){const A=w.eventObject,b=A.__r3f,P=b==null?void 0:b.handlers;if(b!=null&&b.eventCount)if(v){if(P.onPointerOver||P.onPointerEnter||P.onPointerOut||P.onPointerLeave){const I=zp(w),L=p.hovered.get(I);L?L.stopped&&w.stopPropagation():(p.hovered.set(I,w),P.onPointerOver==null||P.onPointerOver(w),P.onPointerEnter==null||P.onPointerEnter(w))}P.onPointerMove==null||P.onPointerMove(w)}else{const I=P[l];I?(!y||p.initialHits.includes(A))&&(o(h,p.interaction.filter(L=>!p.initialHits.includes(L))),I(w)):y&&p.initialHits.includes(A)&&o(h,p.interaction.filter(L=>!p.initialHits.includes(L)))}}r(M,h,m,S)}}return{handlePointer:a}}let w_={},e7=n=>void(w_={...w_,...n});function t7(n,e){function t(h,{args:d=[],attach:p,...v},y){let _=`${h[0].toUpperCase()}${h.slice(1)}`,M;if(h==="primitive"){if(v.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const m=v.object;M=Gl(m,{type:h,root:y,attach:p,primitive:!0})}else{const m=w_[_];if(!m)throw new Error(`R3F: ${_} 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!");M=Gl(new m(...d),{type:h,root:y,attach:p,memoizedProps:{args:d}})}return M.__r3f.attach===void 0&&(M instanceof dt?M.__r3f.attach="geometry":M instanceof Yn&&(M.__r3f.attach="material")),_!=="inject"&&fy(M,v),M}function i(h,d){let p=!1;if(d){var v,y;(v=d.__r3f)!=null&&v.attach?cy(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||Gl(d,{}),d.__r3f.parent=h,S_(d),jl(d)}}function r(h,d,p){let v=!1;if(d){var y,_;if((y=d.__r3f)!=null&&y.attach)cy(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"});const M=h.children.filter(S=>S!==d),m=M.indexOf(p);h.children=[...M.slice(0,m),d,...M.slice(m)],v=!0}v||(_=h.__r3f)==null||_.objects.push(d),d.__r3f||Gl(d,{}),d.__r3f.parent=h,S_(d),jl(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,_;if(d.__r3f&&(d.__r3f.parent=null),(v=h.__r3f)!=null&&v.objects&&(h.__r3f.objects=h.__r3f.objects.filter(A=>A!==d)),(y=d.__r3f)!=null&&y.attach)TT(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var M;h.remove(d),(M=d.__r3f)!=null&&M.root&&Q9(d.__r3f.root,d)}const S=(_=d.__r3f)==null?void 0:_.primitive,w=p===void 0?d.dispose!==null&&!S:p;if(!S){var m;s((m=d.__r3f)==null?void 0:m.objects,d,w),s(d.children,d,w)}d.__r3f&&(delete d.__r3f.root,delete d.__r3f.objects,delete d.__r3f.handlers,delete d.__r3f.memoizedProps,S||delete d.__r3f),w&&d.dispose&&d.type!=="Scene"&&MT.unstable_scheduleCallback(MT.unstable_IdlePriority,()=>{try{d.dispose()}catch{}}),jl(h)}}function a(h,d,p,v){var y;const _=(y=h.__r3f)==null?void 0:y.parent;if(!_)return;const M=t(d,p,h.__r3f.root);if(h.children){for(const m of h.children)m.__r3f&&i(M,m);h.children=h.children.filter(m=>!m.__r3f)}h.__r3f.objects.forEach(m=>i(M,m)),h.__r3f.objects=[],o(_,h),i(_,M),M.raycast&&M.__r3f.eventCount&&M.__r3f.root.getState().internal.interaction.push(M),[v,v.alternate].forEach(m=>{m!==null&&(m.stateNode=M,m.ref&&(typeof m.ref=="function"?m.ref(M):m.ref.current=M))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:B9({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){if(h.__r3f.primitive&&v.object&&v.object!==h)return[!0];{const{args:y=[],children:_,...M}=v,{args:m=[],children:S,...w}=p;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((b,P)=>b!==m[P]))return[!0];const A=$R(h,M,w,!0);return A.changes.length?[!1,A]:null}},commitUpdate(h,[d,p],v,y,_,M){d?a(h,v,_,M):fy(h,p)},commitMount(h,d,p,v){var y;const _=(y=h.__r3f)!=null?y:{};h.raycast&&_.handlers&&_.eventCount&&h.__r3f.root.getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>Gl(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:p,parent:v}=(d=h.__r3f)!=null?d:{};p&&v&&TT(v,h,p),h.isObject3D&&(h.visible=!1),jl(h)},unhideInstance(h,d){var p;const{attach:v,parent:y}=(p=h.__r3f)!=null?p:{};v&&y&&cy(y,h,v),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),jl(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():du.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&cn.fun(performance.now)?performance.now:cn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:cn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:cn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:fy}}const tI=n=>!!(n!=null&&n.render),nI=H.createContext(null),n7=(n,e)=>{const t=HR((a,l)=>{const f=new k,h=new k,d=new k;function p(m=l().camera,S=h,w=l().size){const{width:A,height:b,top:P,left:I}=w,L=A/b;S instanceof k?d.copy(S):d.set(...S);const C=m.getWorldPosition(f).distanceTo(d);if(qR(m))return{width:A/m.zoom,height:b/m.zoom,top:P,left:I,factor:1,distance:C,aspect:L};{const R=m.fov*Math.PI/180,W=2*Math.tan(R/2)*C,J=W*(A/b);return{width:J,height:W,top:P,left:I,factor:A/J,distance:C,aspect:L}}}let v;const y=m=>a(S=>({performance:{...S.performance,current:m}})),_=new ye;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:(m=1)=>n(l(),m),advance:(m,S)=>e(m,S,l()),legacy:!1,linear:!1,flat:!1,scene:Gl(new hS),controls:null,clock:new RS,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();v&&clearTimeout(v),m.performance.current!==m.performance.min&&y(m.performance.min),v=setTimeout(()=>y(l().performance.max),m.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:m=>a(S=>({...S,events:{...S.events,...m}})),setSize:(m,S,w,A,b)=>{const P=l().camera,I={width:m,height:S,top:A||0,left:b||0,updateStyle:w};a(L=>({size:I,viewport:{...L.viewport,...p(P,h,I)}}))},setDpr:m=>a(S=>{const w=QR(m);return{viewport:{...S.viewport,dpr:w,initialDpr:S.viewport.initialDpr||w}}}),setFrameloop:(m="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,m!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:H.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,S,w)=>{const A=l().internal;return A.priority=A.priority+(S>0?1:0),A.subscribers.push({ref:m,priority:S,store:w}),A.subscribers=A.subscribers.sort((b,P)=>b.priority-P.priority),()=>{const b=l().internal;b!=null&&b.subscribers&&(b.priority=b.priority-(S>0?1:0),b.subscribers=b.subscribers.filter(P=>P.ref!==m))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:f,gl:h,set:d}=t.getState();(l!==r||f.dpr!==s)&&(r=l,s=f.dpr,Z9(a,l),h.setPixelRatio(f.dpr),h.setSize(l.width,l.height,l.updateStyle)),a!==o&&(o=a,d(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Fp,i7=new Set,r7=new Set,s7=new Set;function hy(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Fc(n,e){switch(n){case"before":return hy(i7,e);case"after":return hy(r7,e);case"tail":return hy(s7,e)}}let dy,py;function my(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),dy=e.internal.subscribers,Fp=0;Fp0)&&!((f=r.gl.xr)!=null&&f.isPresenting)&&(t+=my(l,r))}if(Fc("after",l),t===0)return Fc("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,f=1){var h;if(!l)return n.forEach(d=>o(d.store.getState()),f);(h=l.gl.xr)!=null&&h.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+f),e||(e=!0,requestAnimationFrame(s)))}function a(l,f=!0,h,d){if(f&&Fc("before",l),h)my(l,h,d);else for(const p of n.values())my(l,p.store.getState());f&&Fc("after",l)}return{loop:s,invalidate:o,advance:a}}function iI(){const n=H.useContext(nI);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Bi(n=t=>t,e){return iI()(n,e)}function kS(n,e=0){const t=iI(),i=t.getState().internal.subscribe,r=ZR(n);return Lh(()=>i(r,e,t),[e,i,t]),null}function rI(n,e){return function(t,...i){const r=new t;return n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,Y9(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l.message})`))))))}}function Rh(n,e,t,i){const r=Array.isArray(e)?e:[e],s=V9(rI(t,i),[n,...r],{equal:cn.equ});return Array.isArray(e)?s:s[0]}Rh.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return H9(rI(t),[n,...i])};Rh.clear=function(n,e){const t=Array.isArray(e)?e:[e];return W9([n,...t])};const Ou=new Map,{invalidate:CT,advance:PT}=o7(Ou),{reconciler:Xm,applyProps:wo}=t7(Ou,K9),Wl={objects:"shallow",strict:!1},a7=(n,e)=>{const t=typeof n=="function"?n(e):n;return tI(t)?t:new fS({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function l7(n){return n instanceof HTMLCanvasElement}function u7(n,e){if(e)return e;if(l7(n)&&n.parentElement){const{width:t,height:i,top:r,left:s}=n.parentElement.getBoundingClientRect();return{width:t,height:i,top:r,left:s}}return{width:0,height:0,top:0,left:0}}function c7(n){const e=Ou.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||n7(CT,PT),o=t||Xm.createContainer(s,du.ConcurrentRoot,null,!1,null,"",r,null);e||Ou.set(n,{fiber:o,store:s});let a,l=!1;return{configure(f={}){let{gl:h,size:d,events:p,onCreated:v,shadows:y=!1,linear:_=!1,flat:M=!1,legacy:m=!1,orthographic:S=!1,frameloop:w="always",dpr:A=[1,2],performance:b,raycaster:P,camera:I,onPointerMissed:L}=f,C=s.getState(),R=C.gl;C.gl||C.set({gl:R=a7(h,n)});let W=C.raycaster;W||C.set({raycaster:W=new FR});const{params:J,...j}=P||{};if(cn.equ(j,W,Wl)||wo(W,{...j}),cn.equ(J,W.params,Wl)||wo(W,{params:{...W.params,...J}}),!C.camera){const ae=I instanceof mh,D=ae?I:S?new ns(0,0,0,0,.1,1e3):new Wt(75,0,.1,1e3);ae||(D.position.z=5,I&&wo(D,I),I!=null&&I.rotation||D.lookAt(0,0,0)),C.set({camera:D})}if(!C.xr){const ae=(B,te)=>{const $=s.getState();$.frameloop!=="never"&&PT(B,!0,$,te)},D=()=>{const B=s.getState();B.gl.xr.enabled=B.gl.xr.isPresenting,B.gl.xr.setAnimationLoop(B.gl.xr.isPresenting?ae:null),B.gl.xr.isPresenting||CT(B)},V={connect(){const B=s.getState().gl;B.xr.addEventListener("sessionstart",D),B.xr.addEventListener("sessionend",D)},disconnect(){const B=s.getState().gl;B.xr.removeEventListener("sessionstart",D),B.xr.removeEventListener("sessionend",D)}};R.xr&&V.connect(),C.set({xr:V})}if(R.shadowMap){const ae=cn.boo(y);if(ae&&R.shadowMap.enabled!==y||!cn.equ(y,R.shadowMap,Wl)){const D=R.shadowMap.enabled;R.shadowMap.enabled=!!y,ae?R.shadowMap.type=Y1:Object.assign(R.shadowMap,y),D!==R.shadowMap.enabled&&(R.shadowMap.needsUpdate=!0)}}"ColorManagement"in jm&&J9(jm,m,["ColorManagement","legacyMode"]);const X=_?Vs:zt,Z=M?Nr:J1;R.outputEncoding!==X&&(R.outputEncoding=X),R.toneMapping!==Z&&(R.toneMapping=Z),C.legacy!==m&&C.set(()=>({legacy:m})),C.linear!==_&&C.set(()=>({linear:_})),C.flat!==M&&C.set(()=>({flat:M})),h&&!cn.fun(h)&&!tI(h)&&!cn.equ(h,R,Wl)&&wo(R,h),p&&!C.events.handlers&&C.set({events:p(s)}),A&&C.viewport.dpr!==QR(A)&&C.setDpr(A);const se=u7(n,d);return cn.equ(se,C.size,Wl)||C.setSize(se.width,se.height,se.updateStyle,se.top,se.left),C.frameloop!==w&&C.setFrameloop(w),C.onPointerMissed||C.set({onPointerMissed:L}),b&&!cn.equ(b,C.performance,Wl)&&C.set(ae=>({performance:{...ae.performance,...b}})),a=v,l=!0,this},render(f){return l||this.configure(),Xm.updateContainer(H.createElement(f7,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){sI(n)}}}function f7({store:n,children:e,onCreated:t,rootElement:i}){return Lh(()=>{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)},[]),H.createElement(nI.Provider,{value:n},e)}function sI(n,e){const t=Ou.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),Xm.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;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(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),q9(r),Ou.delete(n),e&&e(n)}catch{}},500)})}}Xm.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:H.version});function Ka(){return Ka=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(l,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(l,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}M_.debounce=M_;var h7=M_;const LT=E_(h7);function d7(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]=H.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=H.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=H.useRef(!1);H.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,v,y]=H.useMemo(()=>{const S=()=>{if(!l.current.element)return;const{left:w,top:A,width:b,height:P,bottom:I,right:L,x:C,y:R}=l.current.element.getBoundingClientRect(),W={left:w,top:A,width:b,height:P,bottom:I,right:L,x:C,y:R};l.current.element instanceof HTMLElement&&r&&(W.height=l.current.element.offsetHeight,W.width=l.current.element.offsetWidth),Object.freeze(W),d.current&&!v7(l.current.lastBounds,W)&&a(l.current.lastBounds=W)};return[S,h?LT(S,h):S,f?LT(S,f):S]},[a,r,f,h]);function _(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",y,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function M(){l.current.element&&(l.current.resizeObserver=new s(y),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(S=>S.addEventListener("scroll",y,{capture:!0,passive:!0})))}const m=S=>{!S||S===l.current.element||(_(),l.current.element=S,l.current.scrollContainers=oI(S),M())};return m7(y,!!t),p7(v),H.useEffect(()=>{_(),M()},[t,y,v]),H.useEffect(()=>_,[]),[m,o,p]}function p7(n){H.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function m7(n,e){H.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function oI(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,...oI(n.parentElement)]}const g7=["x","y","top","bottom","left","right","width","height"],v7=(n,e)=>g7.every(t=>n[t]===e[t]);var y7=Object.defineProperty,x7=Object.defineProperties,_7=Object.getOwnPropertyDescriptors,RT=Object.getOwnPropertySymbols,S7=Object.prototype.hasOwnProperty,w7=Object.prototype.propertyIsEnumerable,IT=(n,e,t)=>e in n?y7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,DT=(n,e)=>{for(var t in e||(e={}))S7.call(e,t)&&IT(n,t,e[t]);if(RT)for(var t of RT(e))w7.call(e,t)&&IT(n,t,e[t]);return n},M7=(n,e)=>x7(n,_7(e));function aI(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=aI(i,e,t);if(r)return r;i=e?null:i.sibling}}function lI(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const OS=lI(H.createContext(null));class uI extends H.Component{render(){return H.createElement(OS.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:NT,ReactCurrentDispatcher:kT}=H.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A7(){const n=H.useContext(OS);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=H.useId();return H.useMemo(()=>{var i;return(i=NT==null?void 0:NT.current)!=null?i:aI(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}})},[n,e])}function E7(){var n,e;const t=A7(),[i]=H.useState(()=>new Map);i.clear();let r=t;for(;r;){const s=(n=r.type)==null?void 0:n._context;s&&s!==OS&&!i.has(s)&&i.set(s,(e=kT==null?void 0:kT.current)==null?void 0:e.readContext(lI(s))),r=r.return}return i}function b7(){const n=E7();return H.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>H.createElement(e,null,H.createElement(t.Provider,M7(DT({},i),{value:n.get(t)}))),e=>H.createElement(uI,DT({},e))),[n])}const gy={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 T7(n){const{handlePointer:e}=$9(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(gy).reduce((t,i)=>({...t,[i]:e(i)}),{}),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[l,f]=gy[o];t.addEventListener(l,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]=gy[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const C7=H.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=T7,eventSource:a,eventPrefix:l,shadows:f,linear:h,flat:d,legacy:p,orthographic:v,frameloop:y,dpr:_,performance:M,raycaster:m,camera:S,onPointerMissed:w,onCreated:A,...b},P){H.useMemo(()=>e7(jm),[]);const I=b7(),[L,C]=d7({scroll:!0,debounce:{scroll:50,resize:0},...i}),R=H.useRef(null),W=H.useRef(null),[J,j]=H.useState(null);H.useImperativeHandle(P,()=>R.current);const X=ZR(w),[Z,se]=H.useState(!1),[ae,D]=H.useState(!1);if(Z)throw Z;if(ae)throw ae;const V=H.useRef(null);C.width>0&&C.height>0&&J&&(V.current||(V.current=c7(J)),V.current.configure({gl:s,events:o,shadows:f,linear:h,flat:d,legacy:p,orthographic:v,frameloop:y,dpr:_,performance:M,raycaster:m,camera:S,size:C,onPointerMissed:(...te)=>X.current==null?void 0:X.current(...te),onCreated:te=>{te.events.connect==null||te.events.connect(a?G9(a)?a.current:a:W.current),l&&te.setEvents({compute:($,ee)=>{const ue=$[l+"X"],Ee=$[l+"Y"];ee.pointer.set(ue/ee.size.width*2-1,-(Ee/ee.size.height)*2+1),ee.raycaster.setFromCamera(ee.pointer,ee.camera)}}),A==null||A(te)}}),V.current.render(H.createElement(I,null,H.createElement(JR,{set:D},H.createElement(H.Suspense,{fallback:H.createElement(j9,{set:se})},e))))),Lh(()=>{j(R.current)},[]),H.useEffect(()=>{if(J)return()=>sI(J)},[J]);const B=a?"none":"auto";return H.createElement("div",Ka({ref:W,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:B,...r}},b),H.createElement("div",{ref:L,style:{width:"100%",height:"100%"}},H.createElement("canvas",{ref:R,style:{display:"block"}},t)))}),P7=H.forwardRef(function(e,t){return H.createElement(uI,null,H.createElement(C7,Ka({},e,{ref:t})))}),Ih=new k,US=new k,L7=new k;function R7(n,e,t){const i=Ih.setFromMatrixPosition(n.matrixWorld);i.project(e);const r=t.width/2,s=t.height/2;return[i.x*r+r,-(i.y*s)+s]}function I7(n,e){const t=Ih.setFromMatrixPosition(n.matrixWorld),i=US.setFromMatrixPosition(e.matrixWorld),r=t.sub(i),s=e.getWorldDirection(L7);return r.angleTo(s)>Math.PI/2}function D7(n,e,t,i){const r=Ih.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),t.setFromCamera(s,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function cI(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=A_(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const O7=(n=>e=>cI(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),U7=(n=>(e,t)=>cI(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function z7(n){return n&&typeof n=="object"&&"current"in n}const F7=H.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:f=!1,transform:h=!1,occlude:d,onOcclude:p,castShadow:v,receiveShadow:y,material:_,geometry:M,zIndexRange:m=[16777271,0],calculatePosition:S=R7,as:w="div",wrapperClass:A,pointerEvents:b="auto",...P},I)=>{const{gl:L,camera:C,scene:R,size:W,raycaster:J,events:j,viewport:X}=Bi(),[Z]=H.useState(()=>document.createElement(w)),se=H.useRef(),ae=H.useRef(null),D=H.useRef(0),V=H.useRef([0,0]),B=H.useRef(null),te=H.useRef(null),$=(a==null?void 0:a.current)||j.connected||L.domElement.parentNode,ee=H.useRef(null),ue=H.useRef(!1),Ee=H.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&z7(d[0]),[d]);H.useLayoutEffect(()=>{const xe=L.domElement;d&&d==="blending"?(xe.style.zIndex=`${Math.floor(m[0]/2)}`,xe.style.position="absolute",xe.style.pointerEvents="none"):(xe.style.zIndex=null,xe.style.position=null,xe.style.pointerEvents=null)},[d]),H.useLayoutEffect(()=>{if(ae.current){const xe=se.current=Q2(Z);if(R.updateMatrixWorld(),h)Z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Me=S(ae.current,C,W);Z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Me[0]}px,${Me[1]}px,0);transform-origin:0 0;`}return $&&(r?$.prepend(Z):$.appendChild(Z)),()=>{$&&$.removeChild(Z),xe.unmount()}}},[$,h]),H.useLayoutEffect(()=>{A&&(Z.className=A)},[A]);const we=H.useMemo(()=>h?{position:"absolute",top:0,left:0,width:W.width,height:W.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-W.height/2,left:-W.width/2,width:W.width,height:W.height},...t},[t,s,o,W,h]),Q=H.useMemo(()=>({position:"absolute",pointerEvents:b}),[b]);H.useLayoutEffect(()=>{if(ue.current=!1,h){var xe;(xe=se.current)==null||xe.render(H.createElement("div",{ref:B,style:we},H.createElement("div",{ref:te,style:Q},H.createElement("div",{ref:I,className:i,style:t,children:n}))))}else{var Me;(Me=se.current)==null||Me.render(H.createElement("div",{ref:I,style:we,className:i,children:n}))}});const Xe=H.useRef(!0);kS(xe=>{if(ae.current){C.updateMatrixWorld(),ae.current.updateWorldMatrix(!0,!1);const Me=h?V.current:S(ae.current,C,W);if(h||Math.abs(D.current-C.zoom)>e||Math.abs(V.current[0]-Me[0])>e||Math.abs(V.current[1]-Me[1])>e){const ge=I7(ae.current,C);let oe=!1;Ee&&(d!=="blending"?oe=[R]:Array.isArray(d)&&(oe=d.map(Ge=>Ge.current)));const _e=Xe.current;if(oe){const Ge=D7(ae.current,C,J,oe);Xe.current=Ge&&!ge}else Xe.current=!ge;_e!==Xe.current&&(p?p(!Xe.current):Z.style.display=Xe.current?"block":"none");const ke=Math.floor(m[0]/2),Ie=d?Ee?[m[0],ke]:[ke-1,0]:m;if(Z.style.zIndex=`${k7(ae.current,C,Ie)}`,h){const[Ge,qe]=[W.width/2,W.height/2],je=C.projectionMatrix.elements[5]*qe,{isOrthographicCamera:nt,top:_t,left:z,bottom:N,right:le}=C,be=O7(C.matrixWorldInverse),Te=nt?`scale(${je})translate(${A_(-(le+z)/2)}px,${A_((_t+N)/2)}px)`:`translateZ(${je}px)`;let Re=ae.current.matrixWorld;f&&(Re=C.matrixWorldInverse.clone().transpose().copyPosition(Re).scale(ae.current.scale),Re.elements[3]=Re.elements[7]=Re.elements[11]=0,Re.elements[15]=1),Z.style.width=W.width+"px",Z.style.height=W.height+"px",Z.style.perspective=nt?"":`${je}px`,B.current&&te.current&&(B.current.style.transform=`${Te}${be}translate(${Ge}px,${qe}px)`,te.current.style.transform=U7(Re,1/((l||10)/400)))}else{const Ge=l===void 0?1:N7(ae.current,C)*l;Z.style.transform=`translate3d(${Me[0]}px,${Me[1]}px,0) scale(${Ge})`}V.current=Me,D.current=C.zoom}}if(!Ee&&ee.current&&!ue.current)if(h){if(B.current){const Me=B.current.children[0];if(Me!=null&&Me.clientWidth&&Me!=null&&Me.clientHeight){const{isOrthographicCamera:ge}=C;if(ge||M)P.scale&&(Array.isArray(P.scale)?P.scale instanceof k?ee.current.scale.copy(P.scale.clone().divideScalar(1)):ee.current.scale.set(1/P.scale[0],1/P.scale[1],1/P.scale[2]):ee.current.scale.setScalar(1/P.scale));else{const oe=(l||10)/400,_e=Me.clientWidth*oe,ke=Me.clientHeight*oe;ee.current.scale.set(_e,ke,1)}ue.current=!0}}}else{const Me=Z.children[0];if(Me!=null&&Me.clientWidth&&Me!=null&&Me.clientHeight){const ge=1/X.factor,oe=Me.clientWidth*ge,_e=Me.clientHeight*ge;ee.current.scale.set(oe,_e,1),ue.current=!0}ee.current.lookAt(xe.camera.position)}});const Ye=H.useMemo(()=>({vertexShader:h?void 0:` - /* - This shader is from the THREE's SpriteMaterial. - We need to turn the backing plane into a Sprite - (make it always face the camera) if "transfrom" - is false. - */ - #include - - void main() { - vec2 center = vec2(0., 1.); - float rotation = 0.0; - - // This is somewhat arbitrary, but it seems to work well - // Need to figure out how to derive this dynamically if it even matters - float size = 0.03; - - 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 ) ); - - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; - 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; - } - `,fragmentShader:` - void main() { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); - } - `}),[h]);return H.createElement("group",Ka({},P,{ref:ae}),d&&!Ee&&H.createElement("mesh",{castShadow:v,receiveShadow:y,ref:ee},M||H.createElement("planeGeometry",null),_||H.createElement("shaderMaterial",{side:Rr,vertexShader:Ye.vertexShader,fragmentShader:Ye.fragmentShader})))});let Bc=0;const B7=HR(n=>(hu.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-Bc)/(i-Bc)*100})},hu.onLoad=()=>{n({active:!1})},hu.onError=e=>n(t=>({errors:[...t.errors,e]})),hu.onProgress=(e,t,i)=>{t===i&&(Bc=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-Bc)/(i-Bc)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));function V7(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}function eh(n){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eh(n)}function H7(n,e){if(eh(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(eh(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function W7(n){var e=H7(n,"string");return eh(e)==="symbol"?e:String(e)}function ut(n,e,t){return e=W7(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}const OT=(n,e)=>(n%e+e)%e;let G7=class extends ss{constructor(e,t){super(),ut(this,"object",void 0),ut(this,"domElement",void 0),ut(this,"enabled",!0),ut(this,"target",new k),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,"autoRotate",!1),ut(this,"autoRotateSpeed",2),ut(this,"reverseOrbit",!1),ut(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ut(this,"mouseButtons",{LEFT:Sa.ROTATE,MIDDLE:Sa.DOLLY,RIGHT:Sa.PAN}),ut(this,"touches",{ONE:wa.ROTATE,TWO:wa.DOLLY_PAN}),ut(this,"target0",void 0),ut(this,"position0",void 0),ut(this,"zoom0",void 0),ut(this,"_domElementKeyEvents",null),ut(this,"getPolarAngle",void 0),ut(this,"getAzimuthalAngle",void 0),ut(this,"setPolarAngle",void 0),ut(this,"setAzimuthalAngle",void 0),ut(this,"getDistance",void 0),ut(this,"listenToKeyEvents",void 0),ut(this,"saveState",void 0),ut(this,"reset",void 0),ut(this,"update",void 0),ut(this,"connect",void 0),ut(this,"dispose",void 0),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object instanceof Wt?this.object.zoom:1,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=G=>{let de=OT(G,2*Math.PI),Se=h.phi;Se<0&&(Se+=2*Math.PI),de<0&&(de+=2*Math.PI);let Pe=Math.abs(de-Se);2*Math.PI-Pe{let de=OT(G,2*Math.PI),Se=h.theta;Se<0&&(Se+=2*Math.PI),de<0&&(de+=2*Math.PI);let Pe=Math.abs(de-Se);2*Math.PI-Pei.object.position.distanceTo(i.target),this.listenToKeyEvents=G=>{G.addEventListener("keydown",le),this._domElementKeyEvents=G},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object instanceof Wt?i.object.zoom:1},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object instanceof Wt&&(i.object.zoom=i.zoom0,i.object.updateProjectionMatrix()),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const G=new k,de=new si().setFromUnitVectors(e.up,new k(0,1,0)),Se=de.clone().invert(),Pe=new k,Qe=new si,ct=2*Math.PI;return function(){const Y=i.object.position;G.copy(Y).sub(i.target),G.applyQuaternion(de),h.setFromVector3(G),i.autoRotate&&l===a.NONE&&J(R()),i.enableDamping?(h.theta+=d.theta*i.dampingFactor,h.phi+=d.phi*i.dampingFactor):(h.theta+=d.theta,h.phi+=d.phi);let fe=i.minAzimuthAngle,Ae=i.maxAzimuthAngle;return isFinite(fe)&&isFinite(Ae)&&(fe<-Math.PI?fe+=ct:fe>Math.PI&&(fe-=ct),Ae<-Math.PI?Ae+=ct:Ae>Math.PI&&(Ae-=ct),fe<=Ae?h.theta=Math.max(fe,Math.min(Ae,h.theta)):h.theta=h.theta>(fe+Ae)/2?Math.max(fe,h.theta):Math.min(Ae,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),h.radius*=p,h.radius=Math.max(i.minDistance,Math.min(i.maxDistance,h.radius)),i.enableDamping===!0?i.target.addScaledVector(v,i.dampingFactor):i.target.add(v),G.setFromSpherical(h),G.applyQuaternion(Se),Y.copy(i.target).add(G),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)),p=1,y||Pe.distanceToSquared(i.object.position)>f||8*(1-Qe.dot(i.object.quaternion))>f?(i.dispatchEvent(r),Pe.copy(i.object.position),Qe.copy(i.object.quaternion),y=!1,!0):!1}})(),this.connect=G=>{G===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=G,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Re),i.domElement.addEventListener("pointerdown",Ge),i.domElement.addEventListener("pointercancel",nt),i.domElement.addEventListener("wheel",N)},this.dispose=()=>{var G,de,Se,Pe,Qe,ct;(G=i.domElement)===null||G===void 0||G.removeEventListener("contextmenu",Re),(de=i.domElement)===null||de===void 0||de.removeEventListener("pointerdown",Ge),(Se=i.domElement)===null||Se===void 0||Se.removeEventListener("pointercancel",nt),(Pe=i.domElement)===null||Pe===void 0||Pe.removeEventListener("wheel",N),(Qe=i.domElement)===null||Qe===void 0||Qe.ownerDocument.removeEventListener("pointermove",qe),(ct=i.domElement)===null||ct===void 0||ct.ownerDocument.removeEventListener("pointerup",je),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",le)};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 l=a.NONE;const f=1e-6,h=new x_,d=new x_;let p=1;const v=new k;let y=!1;const _=new ye,M=new ye,m=new ye,S=new ye,w=new ye,A=new ye,b=new ye,P=new ye,I=new ye,L=[],C={};function R(){return 2*Math.PI/60/60*i.autoRotateSpeed}function W(){return Math.pow(.95,i.zoomSpeed)}function J(G){i.reverseOrbit?d.theta+=G:d.theta-=G}function j(G){i.reverseOrbit?d.phi+=G:d.phi-=G}const X=(()=>{const G=new k;return function(Se,Pe){G.setFromMatrixColumn(Pe,0),G.multiplyScalar(-Se),v.add(G)}})(),Z=(()=>{const G=new k;return function(Se,Pe){i.screenSpacePanning===!0?G.setFromMatrixColumn(Pe,1):(G.setFromMatrixColumn(Pe,0),G.crossVectors(i.object.up,G)),G.multiplyScalar(Se),v.add(G)}})(),se=(()=>{const G=new k;return function(Se,Pe){const Qe=i.domElement;if(Qe&&i.object instanceof Wt&&i.object.isPerspectiveCamera){const ct=i.object.position;G.copy(ct).sub(i.target);let kt=G.length();kt*=Math.tan(i.object.fov/2*Math.PI/180),X(2*Se*kt/Qe.clientHeight,i.object.matrix),Z(2*Pe*kt/Qe.clientHeight,i.object.matrix)}else Qe&&i.object instanceof ns&&i.object.isOrthographicCamera?(X(Se*(i.object.right-i.object.left)/i.object.zoom/Qe.clientWidth,i.object.matrix),Z(Pe*(i.object.top-i.object.bottom)/i.object.zoom/Qe.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function ae(G){i.object instanceof Wt&&i.object.isPerspectiveCamera?p/=G:i.object instanceof ns&&i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*G)),i.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function D(G){i.object instanceof Wt&&i.object.isPerspectiveCamera?p*=G:i.object instanceof ns&&i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/G)),i.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function V(G){_.set(G.clientX,G.clientY)}function B(G){b.set(G.clientX,G.clientY)}function te(G){S.set(G.clientX,G.clientY)}function $(G){M.set(G.clientX,G.clientY),m.subVectors(M,_).multiplyScalar(i.rotateSpeed);const de=i.domElement;de&&(J(2*Math.PI*m.x/de.clientHeight),j(2*Math.PI*m.y/de.clientHeight)),_.copy(M),i.update()}function ee(G){P.set(G.clientX,G.clientY),I.subVectors(P,b),I.y>0?ae(W()):I.y<0&&D(W()),b.copy(P),i.update()}function ue(G){w.set(G.clientX,G.clientY),A.subVectors(w,S).multiplyScalar(i.panSpeed),se(A.x,A.y),S.copy(w),i.update()}function Ee(G){G.deltaY<0?D(W()):G.deltaY>0&&ae(W()),i.update()}function we(G){let de=!1;switch(G.code){case i.keys.UP:se(0,i.keyPanSpeed),de=!0;break;case i.keys.BOTTOM:se(0,-i.keyPanSpeed),de=!0;break;case i.keys.LEFT:se(i.keyPanSpeed,0),de=!0;break;case i.keys.RIGHT:se(-i.keyPanSpeed,0),de=!0;break}de&&(G.preventDefault(),i.update())}function Q(){if(L.length==1)_.set(L[0].pageX,L[0].pageY);else{const G=.5*(L[0].pageX+L[1].pageX),de=.5*(L[0].pageY+L[1].pageY);_.set(G,de)}}function Xe(){if(L.length==1)S.set(L[0].pageX,L[0].pageY);else{const G=.5*(L[0].pageX+L[1].pageX),de=.5*(L[0].pageY+L[1].pageY);S.set(G,de)}}function Ye(){const G=L[0].pageX-L[1].pageX,de=L[0].pageY-L[1].pageY,Se=Math.sqrt(G*G+de*de);b.set(0,Se)}function xe(){i.enableZoom&&Ye(),i.enablePan&&Xe()}function Me(){i.enableZoom&&Ye(),i.enableRotate&&Q()}function ge(G){if(L.length==1)M.set(G.pageX,G.pageY);else{const Se=He(G),Pe=.5*(G.pageX+Se.x),Qe=.5*(G.pageY+Se.y);M.set(Pe,Qe)}m.subVectors(M,_).multiplyScalar(i.rotateSpeed);const de=i.domElement;de&&(J(2*Math.PI*m.x/de.clientHeight),j(2*Math.PI*m.y/de.clientHeight)),_.copy(M)}function oe(G){if(L.length==1)w.set(G.pageX,G.pageY);else{const de=He(G),Se=.5*(G.pageX+de.x),Pe=.5*(G.pageY+de.y);w.set(Se,Pe)}A.subVectors(w,S).multiplyScalar(i.panSpeed),se(A.x,A.y),S.copy(w)}function _e(G){const de=He(G),Se=G.pageX-de.x,Pe=G.pageY-de.y,Qe=Math.sqrt(Se*Se+Pe*Pe);P.set(0,Qe),I.set(0,Math.pow(P.y/b.y,i.zoomSpeed)),ae(I.y),b.copy(P)}function ke(G){i.enableZoom&&_e(G),i.enablePan&&oe(G)}function Ie(G){i.enableZoom&&_e(G),i.enableRotate&&ge(G)}function Ge(G){if(i.enabled!==!1){if(L.length===0){var de,Se;(de=i.domElement)===null||de===void 0||de.ownerDocument.addEventListener("pointermove",qe),(Se=i.domElement)===null||Se===void 0||Se.ownerDocument.addEventListener("pointerup",je)}et(G),G.pointerType==="touch"?be(G):_t(G)}}function qe(G){i.enabled!==!1&&(G.pointerType==="touch"?Te(G):z(G))}function je(G){if(ze(G),L.length===0){var de,Se,Pe;(de=i.domElement)===null||de===void 0||de.releasePointerCapture(G.pointerId),(Se=i.domElement)===null||Se===void 0||Se.ownerDocument.removeEventListener("pointermove",qe),(Pe=i.domElement)===null||Pe===void 0||Pe.ownerDocument.removeEventListener("pointerup",je)}i.dispatchEvent(o),l=a.NONE}function nt(G){ze(G)}function _t(G){let de;switch(G.button){case 0:de=i.mouseButtons.LEFT;break;case 1:de=i.mouseButtons.MIDDLE;break;case 2:de=i.mouseButtons.RIGHT;break;default:de=-1}switch(de){case Sa.DOLLY:if(i.enableZoom===!1)return;B(G),l=a.DOLLY;break;case Sa.ROTATE:if(G.ctrlKey||G.metaKey||G.shiftKey){if(i.enablePan===!1)return;te(G),l=a.PAN}else{if(i.enableRotate===!1)return;V(G),l=a.ROTATE}break;case Sa.PAN:if(G.ctrlKey||G.metaKey||G.shiftKey){if(i.enableRotate===!1)return;V(G),l=a.ROTATE}else{if(i.enablePan===!1)return;te(G),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function z(G){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;$(G);break;case a.DOLLY:if(i.enableZoom===!1)return;ee(G);break;case a.PAN:if(i.enablePan===!1)return;ue(G);break}}function N(G){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(G.preventDefault(),i.dispatchEvent(s),Ee(G),i.dispatchEvent(o))}function le(G){i.enabled===!1||i.enablePan===!1||we(G)}function be(G){switch(pe(G),L.length){case 1:switch(i.touches.ONE){case wa.ROTATE:if(i.enableRotate===!1)return;Q(),l=a.TOUCH_ROTATE;break;case wa.PAN:if(i.enablePan===!1)return;Xe(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case wa.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;xe(),l=a.TOUCH_DOLLY_PAN;break;case wa.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Me(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Te(G){switch(pe(G),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;ge(G),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;oe(G),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ke(G),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Ie(G),i.update();break;default:l=a.NONE}}function Re(G){i.enabled!==!1&&G.preventDefault()}function et(G){L.push(G)}function ze(G){delete C[G.pointerId];for(let de=0;de0,b=j>0,P=X>0,I=(A?1:0)+(b?1:0)+(P?1:0),I){case 0:{m.push(_[w]),m.push(_[w+1]),m.push(_[w+2]);break}case 1:{if(A&&(L=_[w+1],C=_[w+2],R=y(_[w],L,M,S),W=y(_[w],C,M,S)),b){L=_[w],C=_[w+2],R=y(_[w+1],L,M,S),W=y(_[w+1],C,M,S),m.push(R),m.push(C.clone()),m.push(L.clone()),m.push(C.clone()),m.push(R.clone()),m.push(W);break}P&&(L=_[w],C=_[w+1],R=y(_[w+2],L,M,S),W=y(_[w+2],C,M,S)),m.push(L.clone()),m.push(C.clone()),m.push(R),m.push(W),m.push(R.clone()),m.push(C.clone());break}case 2:{A||(L=_[w].clone(),C=y(L,_[w+1],M,S),R=y(L,_[w+2],M,S),m.push(L),m.push(C),m.push(R)),b||(L=_[w+1].clone(),C=y(L,_[w+2],M,S),R=y(L,_[w],M,S),m.push(L),m.push(C),m.push(R)),P||(L=_[w+2].clone(),C=y(L,_[w],M,S),R=y(L,_[w+1],M,S),m.push(L),m.push(C),m.push(R));break}}}return m}function y(_,M,m,S){const w=_.position.dot(m)-S,A=M.position.dot(m)-S,b=w/(w-A);return new UT(new k(_.position.x+b*(M.position.x-_.position.x),_.position.y+b*(M.position.y-_.position.y),_.position.z+b*(M.position.z-_.position.z)),new k(_.normal.x+b*(M.normal.x-_.normal.x),_.normal.y+b*(M.normal.y-_.normal.y),_.normal.z+b*(M.normal.z-_.normal.z)))}}}class UT{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}const zT=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function zS(n,e){const t=Bi(r=>r.gl),i=Rh(kg,zT(n)?Object.values(n):n);if(H.useLayoutEffect(()=>{e==null||e(i)},[e]),H.useEffect(()=>{(Array.isArray(i)?i:[i]).forEach(t.initTexture)},[t,i]),zT(n)){const r=Object.keys(n),s={};return r.forEach(o=>Object.assign(s,{[o]:i[r.indexOf(o)]})),s}else return i}zS.preload=n=>Rh.preload(kg,n);zS.clear=n=>Rh.clear(kg,n);function X7(n){return Array.isArray(n)}function vy(n=[0,0,0]){return X7(n)?n:n instanceof k||n instanceof nl?[n.x,n.y,n.z]:[n,n,n]}const Y7=H.forwardRef(function({debug:e,mesh:t,children:i,position:r,rotation:s,scale:o,...a},l){const f=H.useRef(null);H.useImperativeHandle(l,()=>f.current);const h=H.useRef(null);return H.useLayoutEffect(()=>{const d=(t==null?void 0:t.current)||f.current.parent,p=f.current;if(!(d instanceof Fn))throw new Error('Decal must have a Mesh as parent or specify its "mesh" prop');const v={position:new k,rotation:new nl,scale:new k(1,1,1)};if(d){wo(v,{position:r,scale:o});const y=d.matrixWorld.clone();if(d.matrixWorld.identity(),!s||typeof s=="number"){const _=new Tt;_.position.copy(v.position),_.lookAt(d.position),typeof s=="number"&&_.rotateZ(s),wo(v,{rotation:_.rotation})}else wo(v,{rotation:s});return p.geometry=new j7(d,v.position,v.rotation,v.scale),h.current&&wo(h.current,v),d.matrixWorld=y,()=>{p.geometry.dispose()}}},[t,...vy(r),...vy(o),...vy(s)]),H.createElement("mesh",{ref:f},i||H.createElement("meshStandardMaterial",Ka({transparent:!0,polygonOffset:!0,polygonOffsetFactor:-10},a)),e&&H.createElement("mesh",{ref:h},H.createElement("boxGeometry",null),H.createElement("meshNormalMaterial",{wireframe:!0}),H.createElement("axesHelper",null)))}),q7=H.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,onChange:s,onStart:o,onEnd:a,...l},f)=>{const h=Bi(b=>b.invalidate),d=Bi(b=>b.camera),p=Bi(b=>b.gl),v=Bi(b=>b.events),y=Bi(b=>b.setEvents),_=Bi(b=>b.set),M=Bi(b=>b.get),m=Bi(b=>b.performance),S=e||d,w=i||v.connected||p.domElement,A=H.useMemo(()=>new G7(S),[S]);return kS(()=>{A.enabled&&A.update()},-1),H.useEffect(()=>(A.connect(w),()=>void A.dispose()),[w,t,A,h]),H.useEffect(()=>{const b=L=>{h(),t&&m.regress(),s&&s(L)},P=L=>{o&&o(L)},I=L=>{a&&a(L)};return A.addEventListener("change",b),A.addEventListener("start",P),A.addEventListener("end",I),()=>{A.removeEventListener("start",P),A.removeEventListener("end",I),A.removeEventListener("change",b)}},[s,o,a,A,h,y]),H.useEffect(()=>{if(n){const b=M().controls;return _({controls:A}),()=>_({controls:b})}},[n,A]),H.createElement("primitive",Ka({ref:f,object:A,enableDamping:r},l))}),Z7=H.forwardRef(({children:n,enabled:e=!0,speed:t=1,rotationIntensity:i=1,floatIntensity:r=1,floatingRange:s=[-.1,.1],...o},a)=>{const l=H.useRef(null),f=H.useRef(Math.random()*1e4);return kS(h=>{var d,p;if(!e||t===0)return;const v=f.current+h.clock.getElapsedTime();l.current.rotation.x=Math.cos(v/4*t)/8*i,l.current.rotation.y=Math.sin(v/4*t)/8*i,l.current.rotation.z=Math.sin(v/4*t)/20*i;let y=Math.sin(v/4*t)/10;y=UL.mapLinear(y,-.1,.1,(d=s==null?void 0:s[0])!==null&&d!==void 0?d:-.1,(p=s==null?void 0:s[1])!==null&&p!==void 0?p:.1),l.current.position.y=y*r,l.current.updateMatrix()}),H.createElement("group",o,H.createElement("group",{ref:V7([l,a]),matrixAutoUpdate:!1},n))});function J7({all:n,scene:e,camera:t}){const i=Bi(({gl:o})=>o),r=Bi(({camera:o})=>o),s=Bi(({scene:o})=>o);return H.useLayoutEffect(()=>{const o=[];n&&(e||s).traverse(f=>{f.visible===!1&&(o.push(f),f.visible=!0)}),i.compile(e||s,t||r);const a=new aS(128);new oS(.01,1e5,a).update(i,e||s),a.dispose(),o.forEach(f=>f.visible=!1)},[]),null}const K7=()=>{const{progress:n}=B7();return F.jsxs(F7,{as:"div",center:!0,style:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[F.jsx("span",{className:"canvas-loader"}),F.jsxs("p",{style:{fontSize:14,color:"#F1F1F1",fontWeight:800,marginTop:40},children:[n.toFixed(2),"%"]})]})},Q7=n=>{const[e]=zS([n.imgUrl]);return F.jsxs(Z7,{speed:1.5,rotationIntensity:1,floatIntensity:1,children:[F.jsx("ambientLight",{intensity:.25}),F.jsx("directionalLight",{position:[0,0,.05]}),F.jsxs("mesh",{castShadow:!0,receiveShadow:!0,scale:2.75,children:[F.jsx("icosahedronGeometry",{args:[1,1]}),F.jsx("meshStandardMaterial",{color:"#fcd4d4",polygonOffset:!0,polygonOffsetFactor:-5,flatShading:!0}),F.jsx(Y7,{position:[0,0,1],rotation:[2*Math.PI,0,6.25],scale:1,map:e,flatShading:!0})]})]})},$7=({icon:n})=>F.jsxs(P7,{frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},children:[F.jsxs(H.Suspense,{fallback:F.jsx(K7,{}),children:[F.jsx(q7,{enableZoom:!1}),F.jsx(Q7,{imgUrl:n})]}),F.jsx(J7,{all:!0})]}),eX="/portfolio-react-threejs/assets/texture-5adaf7bf.webp",tX=()=>F.jsxs("div",{className:"xl:mt-6 flex flex-row flex-wrap justify-center items-center gap-10",children:[F.jsxs(sn.div,{variants:ts(),children:[F.jsx("h2",{className:`${jt.sectionHeadText} text-center`,children:"Skills & Technologies."}),F.jsx("p",{className:`${jt.sectionSubText} text-center`,children:"What have i learnd?"})]}),F.jsx("div",{className:"lg:w-[400px] lg:h-[400px]",children:F.jsx($7,{icon:eX})},"skillsBall")]}),nX=js(tX,"skills"),iX=()=>F.jsx("div",{className:"h-screen flex justify-center items-center",children:F.jsx("img",{src:Hu,className:"w-[150px] h-[117px] "})});function rX(){return F.jsx(H.Suspense,{fallback:iX(),children:F.jsxs("div",{className:"bg-white",children:[F.jsx(Gs,{}),F.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:F.jsx(nX,{})})]})})}const sX=()=>F.jsx("div",{className:"h-screen flex justify-center items-center",children:F.jsx("img",{src:Hu,className:"w-[150px] h-[117px] "})});function oX(){return F.jsx(H.Suspense,{fallback:sX(),children:F.jsxs("div",{className:"bg-white",children:[F.jsx(Gs,{}),F.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:F.jsx(U3,{})})]})})}const aX=()=>F.jsx("div",{className:"h-screen flex justify-center items-center",children:F.jsx("img",{src:Hu,className:"w-[150px] h-[117px] "})});function lX(){return F.jsx(H.Suspense,{fallback:aX(),children:F.jsxs("div",{className:"bg-white",children:[F.jsx(Gs,{}),F.jsx("div",{className:"relative pb-10 top-[120px] lg:top-[100px] bg-gradient-to-b from-white to-primary",children:F.jsxs("div",{className:"h-screen ",children:[F.jsx("h1",{className:`${jt.sectionHeadText} text-center`,children:"No Page Found"}),F.jsx("p",{className:`${jt.heroSubText} mt-2 text-black-100 text-center`,children:"Try after something, it might showup 😊."})]})})]})})}const uX=()=>F.jsx("div",{className:"h-screen flex justify-center items-center",children:F.jsx("img",{src:Hu,className:"w-[150px] h-[117px] "})});function cX(){return F.jsx(H.Suspense,{fallback:uX(),children:F.jsx(CO,{basename:"/portfolio-react-threejs",children:F.jsxs(MO,{children:[F.jsx(qr,{index:!0,element:F.jsx(o5,{})}),F.jsx(qr,{path:"/certificate",element:F.jsx(u5,{})}),F.jsx(qr,{path:"/resume",element:F.jsx(d5,{})}),F.jsx(qr,{path:"/blogs",element:F.jsx(g5,{})}),F.jsx(qr,{path:"/contact",element:F.jsx(A5,{})}),F.jsx(qr,{path:"/projects",element:F.jsx(R5,{})}),F.jsx(qr,{path:"/skills",element:F.jsx(rX,{})}),F.jsx(qr,{path:"/freetools",element:F.jsx(oX,{})}),F.jsx(qr,{path:"*",element:F.jsx(lX,{})})]})})})}xy.createRoot(document.getElementById("root")).render(F.jsx(nh.StrictMode,{children:F.jsx(cX,{})})); diff --git a/assets/index-b466cce2.css b/assets/index-b466cce2.css new file mode 100644 index 0000000..0850fea --- /dev/null +++ b/assets/index-b466cce2.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap";.vertical-timeline *{-webkit-box-sizing:border-box;box-sizing:border-box}.vertical-timeline{width:95%;max-width:1170px;margin:0 auto;position:relative;padding:2em 0}.vertical-timeline:after{content:"";display:table;clear:both}.vertical-timeline:before{content:"";position:absolute;top:0;left:18px;height:100%;width:4px;background:var(--line-color)}.vertical-timeline.vertical-timeline--one-column-right:before{right:18px;left:unset}@media only screen and (min-width:1170px){.vertical-timeline.vertical-timeline--two-columns{width:90%}.vertical-timeline.vertical-timeline--two-columns:before{left:50%;margin-left:-2px}}.vertical-timeline-element{position:relative;margin:2em 0}.vertical-timeline-element>div{min-height:1px}.vertical-timeline-element:after{content:"";display:table;clear:both}.vertical-timeline-element:first-child{margin-top:0}.vertical-timeline-element:last-child{margin-bottom:0}@media only screen and (min-width:1170px){.vertical-timeline-element{margin:4em 0}.vertical-timeline-element:first-child{margin-top:0}.vertical-timeline-element:last-child{margin-bottom:0}}.vertical-timeline-element-icon{position:absolute;top:0;left:0;width:40px;height:40px;border-radius:50%;-webkit-box-shadow:0 0 0 4px #fff,inset 0 2px 0 rgba(0,0,0,.08),0 3px 0 4px rgba(0,0,0,.05);box-shadow:0 0 0 4px #fff,inset 0 2px #00000014,0 3px 0 4px #0000000d}.vertical-timeline--one-column-right .vertical-timeline-element-icon{right:0;left:unset}.vertical-timeline-element-icon svg{display:block;width:24px;height:24px;position:relative;left:50%;top:50%;margin-left:-12px;margin-top:-12px}@media only screen and (min-width:1170px){.vertical-timeline--two-columns .vertical-timeline-element-icon{width:60px;height:60px;left:50%;margin-left:-30px}}.vertical-timeline-element-icon{-webkit-transform:translateZ(0);-webkit-backface-visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-icon.is-hidden{visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-icon.bounce-in{visibility:visible;-webkit-animation:cd-bounce-1 .6s;animation:cd-bounce-1 .6s}@-webkit-keyframes cd-bounce-1{0%{opacity:0;-webkit-transform:scale(.5)}60%{opacity:1;-webkit-transform:scale(1.2)}to{-webkit-transform:scale(1)}}@keyframes cd-bounce-1{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}60%{opacity:1;-webkit-transform:scale(1.2);transform:scale(1.2)}to{-webkit-transform:scale(1);transform:scale(1)}}.vertical-timeline-element-content{position:relative;margin-left:60px;background:#fff;border-radius:.25em;padding:1em;-webkit-box-shadow:0 3px 0 #ddd;box-shadow:0 3px #ddd}.vertical-timeline--one-column-right .vertical-timeline-element-content{margin-right:60px;margin-left:unset}.vertical-timeline-element--no-children .vertical-timeline-element-content{background:0 0;-webkit-box-shadow:none;box-shadow:none}.vertical-timeline-element-content:after{content:"";display:table;clear:both}.vertical-timeline-element-content h2{color:#303e49}.vertical-timeline-element-content .vertical-timeline-element-date,.vertical-timeline-element-content p{font-size:13px;font-size:.8125rem;font-weight:500}.vertical-timeline-element-content .vertical-timeline-element-date{display:inline-block}.vertical-timeline-element-content p{margin:1em 0 0;line-height:1.6}.vertical-timeline-element-title,.vertical-timeline-element-subtitle{margin:0}.vertical-timeline-element-content .vertical-timeline-element-date{float:left;padding:.8em 0;opacity:.7}.vertical-timeline-element-content-arrow{content:"";position:absolute;top:16px;right:100%;height:0;width:0;border:7px solid transparent;border-right:7px solid #fff}.vertical-timeline--one-column-right .vertical-timeline-element-content-arrow{content:"";position:absolute;top:16px;right:unset;left:100%;height:0;width:0;border:7px solid transparent;border-left:7px solid #fff}.vertical-timeline--one-column-right .vertical-timeline-element-content:before{left:100%;border-left:7px solid #fff;border-right:unset}.vertical-timeline-element--no-children .vertical-timeline-element-content:before{display:none}.vertical-timeline-element--no-children .vertical-timeline-element-content-arrow{display:none}@media only screen and (min-width:768px){.vertical-timeline-element-content h2{font-size:20px;font-size:1.25rem}.vertical-timeline-element-content p{font-size:16px;font-size:1rem}.vertical-timeline-element-content .vertical-timeline-element-date{font-size:14px;font-size:.875rem}}@media only screen and (min-width:1170px){.vertical-timeline--two-columns .vertical-timeline-element-content{margin-left:0;padding:1.5em;width:44%}.vertical-timeline--two-columns .vertical-timeline-element-content-arrow{top:24px;left:100%;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.vertical-timeline--two-columns .vertical-timeline-element-content .vertical-timeline-element-date{position:absolute;width:100%;left:124%;top:6px;font-size:16px;font-size:1rem}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content{float:right}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content-arrow,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content-arrow{top:24px;left:auto;right:100%;-webkit-transform:rotate(0);transform:rotate(0)}.vertical-timeline--one-column-right .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content-arrow,.vertical-timeline--one-column-right .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content-arrow{top:24px;left:100%;right:auto;-webkit-transform:rotate(0);transform:rotate(0)}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content .vertical-timeline-element-date,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content .vertical-timeline-element-date{left:auto;right:124%;text-align:right}}.vertical-timeline--animate .vertical-timeline-element-content.is-hidden{visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-content.bounce-in{visibility:visible;-webkit-animation:cd-bounce-2 .6s;animation:cd-bounce-2 .6s}@media only screen and (min-width:1170px){.vertical-timeline--two-columns.vertical-timeline--animate .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content.bounce-in,.vertical-timeline--two-columns.vertical-timeline--animate .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content.bounce-in{-webkit-animation:cd-bounce-2-inverse .6s;animation:cd-bounce-2-inverse .6s}}@media only screen and (max-width:1169px){.vertical-timeline--animate .vertical-timeline-element-content.bounce-in{visibility:visible;-webkit-animation:cd-bounce-2-inverse .6s;animation:cd-bounce-2-inverse .6s}}@-webkit-keyframes cd-bounce-2{0%{opacity:0;-webkit-transform:translateX(-100px)}60%{opacity:1;-webkit-transform:translateX(20px)}to{-webkit-transform:translateX(0)}}@keyframes cd-bounce-2{0%{opacity:0;-webkit-transform:translateX(-100px);transform:translate(-100px)}60%{opacity:1;-webkit-transform:translateX(20px);transform:translate(20px)}to{-webkit-transform:translateX(0);transform:translate(0)}}@-webkit-keyframes cd-bounce-2-inverse{0%{opacity:0;-webkit-transform:translateX(100px)}60%{opacity:1;-webkit-transform:translateX(-20px)}to{-webkit-transform:translateX(0)}}@keyframes cd-bounce-2-inverse{0%{opacity:0;-webkit-transform:translateX(100px);transform:translate(100px)}60%{opacity:1;-webkit-transform:translateX(-20px);transform:translate(-20px)}to{-webkit-transform:translateX(0);transform:translate(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: }.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-top-10{top:-2.5rem}.-top-12{top:-3rem}.bottom-32{bottom:8rem}.right-0{right:0}.right-40{right:10rem}.top-0{top:0}.top-20{top:5rem}.top-60{top:15rem}.top-\[120px\]{top:120px}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.-m-5{margin:-1.25rem}.m-3{margin:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.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-20{margin-top:5rem;margin-bottom:5rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.ml-5{margin-left:1.25rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-1\/2{height:50%}.h-10{height:2.5rem}.h-16{height:4rem}.h-3{height:.75rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-\[117px\]{height:117px}.h-\[230px\]{height:230px}.h-\[28px\]{height:28px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[64px\]{height:64px}.h-\[75\%\]{height:75%}.h-full{height:100%}.h-screen{height:100vh}.min-h-\[280px\]{min-height:280px}.w-1{width:.25rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-16{width:4rem}.w-3{width:.75rem}.w-5{width:1.25rem}.w-\[150px\]{width:150px}.w-\[28px\]{width:28px}.w-\[35px\]{width:35px}.w-\[70\%\]{width:70%}.w-\[75\%\]{width:75%}.w-\[90\%\]{width:90%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-\[140px\]{min-width:140px}.max-w-7xl{max-width:80rem}.max-w-full{max-width:100%}.max-w-screen-lg{max-width:1024px}.max-w-screen-xl{max-width:1280px}.flex-1{flex:1 1 0%}.flex-\[0\.75\]{flex:.75}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-evenly{justify-content:space-evenly}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-5{gap:1.25rem}.gap-8{gap:2rem}.space-x-5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2.5rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border-4{border-width:4px}.border-none{border-style:none}.border-\[\#373737\]{--tw-border-opacity: 1;border-color:rgb(55 55 55 / var(--tw-border-opacity))}.bg-\[\#373737\]{--tw-bg-opacity: 1;background-color:rgb(55 55 55 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(246 246 246 / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(55 55 55 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-60{--tw-bg-opacity: .6}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\[\#f6f6f6\]{--tw-gradient-from: #f6f6f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(246 246 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-primary{--tw-gradient-to: #f6f6f6 var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-12{padding-left:3rem;padding-right:3rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-10{padding-bottom:2.5rem}.pl-1{padding-left:.25rem}.text-center{text-align:center}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[24px\]{font-size:24px}.text-\[30px\]{font-size:30px}.text-\[40px\]{font-size:40px}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-\[30px\]{line-height:30px}.tracking-wider{letter-spacing:.05em}.text-\[\#373737\]{--tw-text-opacity: 1;color:rgb(55 55 55 / var(--tw-text-opacity))}.text-\[\#dfd9ff\]{--tw-text-opacity: 1;color:rgb(223 217 255 / var(--tw-text-opacity))}.text-\[\#fcd4d4\]{--tw-text-opacity: 1;color:rgb(252 212 212 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-black-100{--tw-text-opacity: 1;color:rgb(16 13 37 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-secondary{--tw-text-opacity: 1;color:rgb(55 55 55 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-white-100{--tw-text-opacity: 1;color:rgb(243 243 243 / var(--tw-text-opacity))}.underline-offset-8{text-underline-offset:8px}.opacity-0{opacity:0}.shadow-card{--tw-shadow: 0px 35px 120px -15px #211e35;--tw-shadow-colored: 0px 35px 120px -15px 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-\[\#fcd4d4\]{--tw-shadow-color: #fcd4d4;--tw-shadow: var(--tw-shadow-colored)}.shadow-primary{--tw-shadow-color: #f6f6f6;--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}*{margin:0;padding:0;box-sizing:border-box;font-family:Poppins,sans-serif;scroll-behavior:smooth}body{background:linear-gradient(180deg,#e6eaf5 0%,#f6f6f6 80%)}.hash-span{margin-top:-100px;padding-bottom:100px;display:block}.black-gradient{background:#000000;background:linear-gradient(to right,#434343,#000000)}.white-gradient{background:#ffffff;background:linear-gradient(to right,#e6eaf5,#f6f6f6)}.violet-gradient{background:#373737;background:linear-gradient(-90deg,#373737 0%,rgba(60,51,80,0) 100%);background:-webkit-linear-gradient(-90deg,#373737 0%,black 100%)}.green-pink-gradient{background:"#00cea8";background:linear-gradient(90.13deg,#00cea8 1.9%,#bf61ff 97.5%);background:-webkit-linear-gradient(-90.13deg,#00cea8 1.9%,#bf61ff 97.5%)}.orange-text-gradient{background:#f12711;background:linear-gradient(to top,#f12711,#f5af19);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.green-text-gradient{background:#11998e;background:linear-gradient(to top,#11998e,#38ef7d);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.blue-text-gradient{background:#56ccf2;background:linear-gradient(to top,#2f80ed,#56ccf2);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.pink-text-gradient{background:#ec008c;background:linear-gradient(to top,#ec008c,#fc6767);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.canvas-loader{font-size:10px;width:1em;height:1em;border-radius:50%;position:relative;text-indent:-9999em;animation:mulShdSpin 1.1s infinite ease;transform:translateZ(0)}@keyframes mulShdSpin{0%,to{box-shadow:0 -2.6em #fff,1.8em -1.8em #fff3,2.5em 0 #fff3,1.75em 1.75em #fff3,0 2.5em #fff3,-1.8em 1.8em #fff3,-2.6em 0 #ffffff80,-1.8em -1.8em #ffffffb3}12.5%{box-shadow:0 -2.6em #ffffffb3,1.8em -1.8em #fff,2.5em 0 #fff3,1.75em 1.75em #fff3,0 2.5em #fff3,-1.8em 1.8em #fff3,-2.6em 0 #fff3,-1.8em -1.8em #ffffff80}25%{box-shadow:0 -2.6em #ffffff80,1.8em -1.8em #ffffffb3,2.5em 0 #fff,1.75em 1.75em #fff3,0 2.5em #fff3,-1.8em 1.8em #fff3,-2.6em 0 #fff3,-1.8em -1.8em #fff3}37.5%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #ffffff80,2.5em 0 #ffffffb3,1.75em 1.75em #fff,0 2.5em #fff3,-1.8em 1.8em #fff3,-2.6em 0 #fff3,-1.8em -1.8em #fff3}50%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #fff3,2.5em 0 #ffffff80,1.75em 1.75em #ffffffb3,0 2.5em #fff,-1.8em 1.8em #fff3,-2.6em 0 #fff3,-1.8em -1.8em #fff3}62.5%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #fff3,2.5em 0 #fff3,1.75em 1.75em #ffffff80,0 2.5em #ffffffb3,-1.8em 1.8em #fff,-2.6em 0 #fff3,-1.8em -1.8em #fff3}75%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #fff3,2.5em 0 #fff3,1.75em 1.75em #fff3,0 2.5em #ffffff80,-1.8em 1.8em #ffffffb3,-2.6em 0 #fff,-1.8em -1.8em #fff3}87.5%{box-shadow:0 -2.6em #fff3,1.8em -1.8em #fff3,2.5em 0 #fff3,1.75em 1.75em #fff3,0 2.5em #fff3,-1.8em 1.8em #ffffff80,-2.6em 0 #ffffffb3,-1.8em -1.8em #fff}}.funky-text-outline{text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff,2px 2px 0 #fff,-2px -2px 0 #fff,2px -2px 0 #fff,-2px 2px 0 #fff}.funky-text-outline-2{text-shadow:-3px -3px 0 #C0C0C0,3px -3px 0 #C0C0C0,-3px 3px 0 #C0C0C0,3px 3px 0 #C0C0C0}.placeholder\:text-white-100::-moz-placeholder{--tw-text-opacity: 1;color:rgb(243 243 243 / var(--tw-text-opacity))}.placeholder\:text-white-100::placeholder{--tw-text-opacity: 1;color:rgb(243 243 243 / var(--tw-text-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-green-800:hover{--tw-bg-opacity: 1;background-color:rgb(22 101 52 / var(--tw-bg-opacity))}.hover\:bg-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(55 55 55 / var(--tw-bg-opacity))}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity))}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.hover\:text-white-100:hover{--tw-text-opacity: 1;color:rgb(243 243 243 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover,.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 450px){.xs\:w-\[250px\]{width:250px}.xs\:text-\[20px\]{font-size:20px}.xs\:text-\[40px\]{font-size:40px}.xs\:text-\[50px\]{font-size:50px}}@media (min-width: 640px){.sm\:right-5{right:1.25rem}.sm\:top-20{top:5rem}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-80{height:20rem}.sm\:w-\[360px\]{width:360px}.sm\:px-16{padding-left:4rem;padding-right:4rem}.sm\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\:text-\[18px\]{font-size:18px}.sm\:text-\[26px\]{font-size:26px}.sm\:text-\[50px\]{font-size:50px}.sm\:text-\[60px\]{font-size:60px}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:-right-10{right:-2.5rem}.md\:-right-20{right:-5rem}.md\:bottom-0{bottom:0}.md\:top-10{top:2.5rem}.md\:top-2{top:.5rem}.md\:-m-10{margin:-2.5rem}.md\:mb-0{margin-bottom:0}.md\:block{display:block}.md\:flex{display:flex}.md\:h-\[550px\]{height:550px}.md\:w-\[80\%\]{width:80%}.md\:max-w-3xl{max-width:48rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-col{flex-direction:column}.md\:items-center{align-items:center}.md\:justify-center{justify-content:center}.md\:gap-4{gap:1rem}.md\:space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.md\:text-\[60px\]{font-size:60px}}@media (min-width: 1024px){.lg\:top-\[100px\]{top:100px}.lg\:flex{display:flex}.lg\:h-\[400px\]{height:400px}.lg\:w-\[400px\]{width:400px}.lg\:w-\[70\%\]{width:70%}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:text-\[30px\]{font-size:30px}.lg\:text-\[80px\]{font-size:80px}.lg\:leading-\[40px\]{line-height:40px}.lg\:leading-\[98px\]{line-height:98px}}@media (min-width: 1280px){.xl\:mt-6{margin-top:1.5rem}.xl\:h-auto{height:auto}.xl\:flex-1{flex:1 1 0%}.xl\:flex-row{flex-direction:row}} diff --git a/index.html b/index.html index 302db93..bb5a878 100644 --- a/index.html +++ b/index.html @@ -7,8 +7,8 @@ Satyam Mishra | Bedead - - + +