diff --git a/pr-preview/pr-29/404.html b/pr-preview/pr-29/404.html
deleted file mode 100644
index d5cd8dc..0000000
--- a/pr-preview/pr-29/404.html
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Wode "Nimo" Ni
-
-
-
-
-
-
-
-
-
-
diff --git a/pr-preview/pr-29/android-chrome-192x192.png b/pr-preview/pr-29/android-chrome-192x192.png
deleted file mode 100644
index 33dce7c..0000000
Binary files a/pr-preview/pr-29/android-chrome-192x192.png and /dev/null differ
diff --git a/pr-preview/pr-29/android-chrome-512x512.png b/pr-preview/pr-29/android-chrome-512x512.png
deleted file mode 100644
index 35c0f59..0000000
Binary files a/pr-preview/pr-29/android-chrome-512x512.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-114x114.png b/pr-preview/pr-29/apple-touch-icon-114x114.png
deleted file mode 100644
index 88427d8..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-114x114.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-120x120.png b/pr-preview/pr-29/apple-touch-icon-120x120.png
deleted file mode 100644
index 9ce634f..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-120x120.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-144x144.png b/pr-preview/pr-29/apple-touch-icon-144x144.png
deleted file mode 100644
index c2719ea..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-144x144.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-152x152.png b/pr-preview/pr-29/apple-touch-icon-152x152.png
deleted file mode 100644
index 0763f80..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-152x152.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-167x167.png b/pr-preview/pr-29/apple-touch-icon-167x167.png
deleted file mode 100644
index 2d624e0..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-167x167.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-180x180.png b/pr-preview/pr-29/apple-touch-icon-180x180.png
deleted file mode 100644
index d0b295e..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-180x180.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-57x57.png b/pr-preview/pr-29/apple-touch-icon-57x57.png
deleted file mode 100644
index 86d78df..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-57x57.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-60x60.png b/pr-preview/pr-29/apple-touch-icon-60x60.png
deleted file mode 100644
index 34c1d41..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-60x60.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-72x72.png b/pr-preview/pr-29/apple-touch-icon-72x72.png
deleted file mode 100644
index 50cc9e8..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-72x72.png and /dev/null differ
diff --git a/pr-preview/pr-29/apple-touch-icon-76x76.png b/pr-preview/pr-29/apple-touch-icon-76x76.png
deleted file mode 100644
index dfd17da..0000000
Binary files a/pr-preview/pr-29/apple-touch-icon-76x76.png and /dev/null differ
diff --git a/pr-preview/pr-29/assets/chi-20-natural-diagramming.pdf b/pr-preview/pr-29/assets/chi-20-natural-diagramming.pdf
deleted file mode 100644
index dd9cf26..0000000
Binary files a/pr-preview/pr-29/assets/chi-20-natural-diagramming.pdf and /dev/null differ
diff --git a/pr-preview/pr-29/assets/diagrams-24-penrose.pdf b/pr-preview/pr-29/assets/diagrams-24-penrose.pdf
deleted file mode 100644
index 0750918..0000000
Binary files a/pr-preview/pr-29/assets/diagrams-24-penrose.pdf and /dev/null differ
diff --git a/pr-preview/pr-29/assets/edgeworth.svg b/pr-preview/pr-29/assets/edgeworth.svg
deleted file mode 100644
index af97f52..0000000
--- a/pr-preview/pr-29/assets/edgeworth.svg
+++ /dev/null
@@ -1,70 +0,0 @@
-
diff --git a/pr-preview/pr-29/assets/index-7d5d3948.js b/pr-preview/pr-29/assets/index-7d5d3948.js
deleted file mode 100644
index bc3d376..0000000
--- a/pr-preview/pr-29/assets/index-7d5d3948.js
+++ /dev/null
@@ -1,5184 +0,0 @@
-(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();var A5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xb(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zS={exports:{}},ZA={},LS={exports:{}},Yt={};/**
- * @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 zu=Symbol.for("react.element"),p5=Symbol.for("react.portal"),m5=Symbol.for("react.fragment"),f5=Symbol.for("react.strict_mode"),b5=Symbol.for("react.profiler"),y5=Symbol.for("react.provider"),v5=Symbol.for("react.context"),G5=Symbol.for("react.forward_ref"),B5=Symbol.for("react.suspense"),Z5=Symbol.for("react.memo"),w5=Symbol.for("react.lazy"),mB=Symbol.iterator;function S5(n){return n===null||typeof n!="object"?null:(n=mB&&n[mB]||n["@@iterator"],typeof n=="function"?n:null)}var TS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ES=Object.assign,kS={};function pc(n,e,t){this.props=n,this.context=e,this.refs=kS,this.updater=t||TS}pc.prototype.isReactComponent={};pc.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")};pc.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function DS(){}DS.prototype=pc.prototype;function Yb(n,e,t){this.props=n,this.context=e,this.refs=kS,this.updater=t||TS}var Fb=Yb.prototype=new DS;Fb.constructor=Yb;ES(Fb,pc.prototype);Fb.isPureReactComponent=!0;var fB=Array.isArray,US=Object.prototype.hasOwnProperty,Kb={current:null},PS={key:!0,ref:!0,__self:!0,__source:!0};function _S(n,e,t){var i,s={},r=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(r=""+e.key),e)US.call(e,i)&&!PS.hasOwnProperty(i)&&(s[i]=e[i]);var a=arguments.length-2;if(a===1)s.children=t;else if(1>>1,ge=L[ce];if(0>>1;ces(Ze,O))wes(J,Ze)?(L[ce]=J,L[we]=O,ce=we):(L[ce]=Ze,L[re]=O,ce=re);else if(wes(J,O))L[ce]=J,L[we]=O,ce=we;else break e}}return P}function s(L,P){var O=L.sortIndex-P.sortIndex;return O!==0?O:L.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,C=null,d=3,h=!1,m=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(L){for(var P=t(c);P!==null;){if(P.callback===null)i(c);else if(P.startTime<=L)i(c),P.sortIndex=P.expirationTime,e(l,P);else break;P=t(c)}}function B(L){if(y=!1,f(L),!m)if(t(l)!==null)m=!0,ue(S);else{var P=t(c);P!==null&&le(B,P.startTime-L)}}function S(L,P){m=!1,y&&(y=!1,A(V),V=-1),h=!0;var O=d;try{for(f(P),C=t(l);C!==null&&(!(C.expirationTime>P)||L&&!H());){var ce=C.callback;if(typeof ce=="function"){C.callback=null,d=C.priorityLevel;var ge=ce(C.expirationTime<=P);P=n.unstable_now(),typeof ge=="function"?C.callback=ge:C===t(l)&&i(l),f(P)}else i(l);C=t(l)}if(C!==null)var te=!0;else{var re=t(c);re!==null&&le(B,re.startTime-P),te=!1}return te}finally{C=null,d=O,h=!1}}var x=!1,R=null,V=-1,Z=5,M=-1;function H(){return!(n.unstable_now()-ML||125ce?(L.sortIndex=O,e(c,L),t(l)===null&&L===t(c)&&(y?(A(V),V=-1):y=!0,le(B,O-ce))):(L.sortIndex=ge,e(l,L),m||h||(m=!0,ue(S))),L},n.unstable_shouldYield=H,n.unstable_wrapCallback=function(L){var P=d;return function(){var O=d;d=P;try{return L.apply(this,arguments)}finally{d=O}}}})(jS);QS.exports=jS;var K5=QS.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 qS=E,As=K5;function Re(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"),kf=Object.prototype.hasOwnProperty,z5=/^[: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]*$/,yB={},vB={};function L5(n){return kf.call(vB,n)?!0:kf.call(yB,n)?!1:z5.test(n)?vB[n]=!0:(yB[n]=!0,!1)}function T5(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 E5(n,e,t,i){if(e===null||typeof e>"u"||T5(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Xi(n,e,t,i,s,r,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=r,this.removeEmptyString=o}var ci={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){ci[n]=new Xi(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];ci[e]=new Xi(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){ci[n]=new Xi(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){ci[n]=new Xi(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){ci[n]=new Xi(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){ci[n]=new Xi(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){ci[n]=new Xi(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){ci[n]=new Xi(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){ci[n]=new Xi(n,5,!1,n.toLowerCase(),null,!1,!1)});var Lb=/[\-:]([a-z])/g;function Tb(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(Lb,Tb);ci[e]=new Xi(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(Lb,Tb);ci[e]=new Xi(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(Lb,Tb);ci[e]=new Xi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){ci[n]=new Xi(n,1,!1,n.toLowerCase(),null,!1,!1)});ci.xlinkHref=new Xi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){ci[n]=new Xi(n,1,!1,n.toLowerCase(),null,!0,!0)});function Eb(n,e,t,i){var s=ci.hasOwnProperty(e)?ci[e]:null;(s!==null?s.type!==0:i||!(2a||s[o]!==r[a]){var l=`
-`+s[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{fm=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?SI(n):""}function k5(n){switch(n.tag){case 5:return SI(n.type);case 16:return SI("Lazy");case 13:return SI("Suspense");case 19:return SI("SuspenseList");case 0:case 2:case 15:return n=bm(n.type,!1),n;case 11:return n=bm(n.type.render,!1),n;case 1:return n=bm(n.type,!0),n;default:return""}}function _f(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 Sg:return"Fragment";case wg:return"Portal";case Df:return"Profiler";case kb:return"StrictMode";case Uf:return"Suspense";case Pf:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case tx:return(n.displayName||"Context")+".Consumer";case ex:return(n._context.displayName||"Context")+".Provider";case Db:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Ub:return e=n.displayName||null,e!==null?e:_f(n.type)||"Memo";case ko:e=n._payload,n=n._init;try{return _f(n(e))}catch{}}return null}function D5(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 _f(e);case 8:return e===kb?"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 Ia(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ix(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function U5(n){var e=ix(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 s=t.get,r=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,r.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 ad(n){n._valueTracker||(n._valueTracker=U5(n))}function sx(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=ix(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function Uh(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 Jf(n,e){var t=e.checked;return yn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function BB(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Ia(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 rx(n,e){e=e.checked,e!=null&&Eb(n,"checked",e,!1)}function Of(n,e){rx(n,e);var t=Ia(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")?Qf(n,e.type,t):e.hasOwnProperty("defaultValue")&&Qf(n,e.type,Ia(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function ZB(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 Qf(n,e,t){(e!=="number"||Uh(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var xI=Array.isArray;function Pg(n,e,t,i){if(n=n.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=ld.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function tu(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var XI={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},P5=["Webkit","ms","Moz","O"];Object.keys(XI).forEach(function(n){P5.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),XI[e]=XI[n]})});function gx(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||XI.hasOwnProperty(n)&&XI[n]?(""+e).trim():e+"px"}function cx(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,s=gx(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,s):n[t]=s}}var _5=yn({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 $f(n,e){if(e){if(_5[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Re(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Re(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Re(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Re(62))}}function e0(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 t0=null;function Pb(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var n0=null,_g=null,Jg=null;function xB(n){if(n=Eu(n)){if(typeof n0!="function")throw Error(Re(280));var e=n.stateNode;e&&(e=WA(e),n0(n.stateNode,n.type,e))}}function Ix(n){_g?Jg?Jg.push(n):Jg=[n]:_g=n}function ux(){if(_g){var n=_g,e=Jg;if(Jg=_g=null,xB(n),e)for(n=0;n>>=0,n===0?32:31-(sN(n)/rN|0)|0}var gd=64,cd=4194304;function RI(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 Oh(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,s=n.suspendedLanes,r=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~s;a!==0?i=RI(a):(r&=o,r!==0&&(i=RI(r)))}else o=t&~s,o!==0?i=RI(o):r!==0&&(i=RI(r));if(i===0)return 0;if(e!==0&&e!==i&&!(e&s)&&(s=i&-i,r=e&-e,s>=r||s===16&&(r&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 Lu(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-gr(e),n[e]=t}function gN(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=FI),FB=String.fromCharCode(32),KB=!1;function Mx(n,e){switch(n){case"keyup":return FN.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nx(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var xg=!1;function zN(n,e){switch(n){case"compositionend":return Nx(e);case"keypress":return e.which!==32?null:(KB=!0,FB);case"textInput":return n=e.data,n===FB&&KB?null:n;default:return null}}function LN(n,e){if(xg)return n==="compositionend"||!ey&&Mx(n,e)?(n=Wx(),Zh=jb=Oo=null,xg=!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=EB(t)}}function Fx(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Fx(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function Kx(){for(var n=window,e=Uh();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=Uh(n.document)}return e}function ty(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=Kx(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Fx(t.ownerDocument.documentElement,t)){if(i!==null&&ty(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 s=t.textContent.length,r=Math.min(i.start,s);i=i.end===void 0?r:Math.min(i.end,s),!n.extend&&r>i&&(s=i,i=r,r=s),s=kB(t,r);var o=kB(t,i);s&&o&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),r>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,Rg=null,l0=null,zI=null,g0=!1;function DB(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;g0||Rg==null||Rg!==Uh(i)||(i=Rg,"selectionStart"in i&&ty(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}),zI&&au(zI,i)||(zI=i,i=qh(l0,"onSelect"),0Mg||(n.current=h0[Mg],h0[Mg]=null,Mg--)}function an(n,e){Mg++,h0[Mg]=n.current,n.current=e}var ua={},Bi=fa(ua),qi=fa(!1),ml=ua;function sc(n,e){var t=n.type.contextTypes;if(!t)return ua;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var s={},r;for(r in t)s[r]=e[r];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function $i(n){return n=n.childContextTypes,n!=null}function eA(){In(qi),In(Bi)}function jB(n,e,t){if(Bi.current!==ua)throw Error(Re(168));an(Bi,e),an(qi,t)}function _x(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var s in i)if(!(s in e))throw Error(Re(108,D5(n)||"Unknown",s));return yn({},t,i)}function tA(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ua,ml=Bi.current,an(Bi,n),an(qi,qi.current),!0}function qB(n,e,t){var i=n.stateNode;if(!i)throw Error(Re(169));t?(n=_x(n,e,ml),i.__reactInternalMemoizedMergedChildContext=n,In(qi),In(Bi),an(Bi,n)):In(qi),an(qi,t)}var no=null,VA=!1,Hm=!1;function Jx(n){no===null?no=[n]:no.push(n)}function a3(n){VA=!0,Jx(n)}function ba(){if(!Hm&&no!==null){Hm=!0;var n=0,e=jt;try{var t=no;for(jt=1;n>=o,s-=o,ro=1<<32-gr(e)+s|t<V?(Z=R,R=null):Z=R.sibling;var M=d(A,R,f[V],B);if(M===null){R===null&&(R=Z);break}n&&R&&M.alternate===null&&e(A,R),b=r(M,b,V),x===null?S=M:x.sibling=M,x=M,R=Z}if(V===f.length)return t(A,R),dn&&Pa(A,V),S;if(R===null){for(;VV?(Z=R,R=null):Z=R.sibling;var H=d(A,R,M.value,B);if(H===null){R===null&&(R=Z);break}n&&R&&H.alternate===null&&e(A,R),b=r(H,b,V),x===null?S=H:x.sibling=H,x=H,R=Z}if(M.done)return t(A,R),dn&&Pa(A,V),S;if(R===null){for(;!M.done;V++,M=f.next())M=C(A,M.value,B),M!==null&&(b=r(M,b,V),x===null?S=M:x.sibling=M,x=M);return dn&&Pa(A,V),S}for(R=i(A,R);!M.done;V++,M=f.next())M=h(R,A,V,M.value,B),M!==null&&(n&&M.alternate!==null&&R.delete(M.key===null?V:M.key),b=r(M,b,V),x===null?S=M:x.sibling=M,x=M);return n&&R.forEach(function(U){return e(A,U)}),dn&&Pa(A,V),S}function v(A,b,f,B){if(typeof f=="object"&&f!==null&&f.type===Sg&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case od:e:{for(var S=f.key,x=b;x!==null;){if(x.key===S){if(S=f.type,S===Sg){if(x.tag===7){t(A,x.sibling),b=s(x,f.props.children),b.return=A,A=b;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ko&&r2(S)===x.type){t(A,x.sibling),b=s(x,f.props),b.ref=nI(A,x,f),b.return=A,A=b;break e}t(A,x);break}else e(A,x);x=x.sibling}f.type===Sg?(b=ul(f.props.children,A.mode,B,f.key),b.return=A,A=b):(B=Nh(f.type,f.key,f.props,null,A.mode,B),B.ref=nI(A,b,f),B.return=A,A=B)}return o(A);case wg:e:{for(x=f.key;b!==null;){if(b.key===x)if(b.tag===4&&b.stateNode.containerInfo===f.containerInfo&&b.stateNode.implementation===f.implementation){t(A,b.sibling),b=s(b,f.children||[]),b.return=A,A=b;break e}else{t(A,b);break}else e(A,b);b=b.sibling}b=Em(f,A.mode,B),b.return=A,A=b}return o(A);case ko:return x=f._init,v(A,b,x(f._payload),B)}if(xI(f))return m(A,b,f,B);if(jc(f))return y(A,b,f,B);pd(A,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,b!==null&&b.tag===6?(t(A,b.sibling),b=s(b,f),b.return=A,A=b):(t(A,b),b=Tm(f,A.mode,B),b.return=A,A=b),o(A)):t(A,b)}return v}var oc=nR(!0),iR=nR(!1),ku={},Mr=fa(ku),Iu=fa(ku),uu=fa(ku);function rl(n){if(n===ku)throw Error(Re(174));return n}function cy(n,e){switch(an(uu,e),an(Iu,n),an(Mr,ku),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:qf(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=qf(e,n)}In(Mr),an(Mr,e)}function ac(){In(Mr),In(Iu),In(uu)}function sR(n){rl(uu.current);var e=rl(Mr.current),t=qf(e,n.type);e!==t&&(an(Iu,n),an(Mr,t))}function Iy(n){Iu.current===n&&(In(Mr),In(Iu))}var pn=fa(0);function aA(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 Xm=[];function uy(){for(var n=0;nt?t:4,n(!0);var i=Ym.transition;Ym.transition={};try{n(!1),e()}finally{jt=t,Ym.transition=i}}function bR(){return Ts().memoizedState}function I3(n,e,t){var i=ra(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},yR(n))vR(e,t);else if(t=qx(n,e,t,i),t!==null){var s=Ni();cr(t,n,i,s),GR(t,e,i)}}function u3(n,e,t){var i=ra(n),s={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(yR(n))vR(e,s);else{var r=n.alternate;if(n.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var o=e.lastRenderedState,a=r(o,t);if(s.hasEagerState=!0,s.eagerState=a,ur(a,o)){var l=e.interleaved;l===null?(s.next=s,ly(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=qx(n,e,s,i),t!==null&&(s=Ni(),cr(t,n,i,s),GR(t,e,i))}}function yR(n){var e=n.alternate;return n===fn||e!==null&&e===fn}function vR(n,e){LI=lA=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function GR(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Jb(n,t)}}var gA={readContext:Ls,useCallback:pi,useContext:pi,useEffect:pi,useImperativeHandle:pi,useInsertionEffect:pi,useLayoutEffect:pi,useMemo:pi,useReducer:pi,useRef:pi,useState:pi,useDebugValue:pi,useDeferredValue:pi,useTransition:pi,useMutableSource:pi,useSyncExternalStore:pi,useId:pi,unstable_isNewReconciler:!1},C3={readContext:Ls,useCallback:function(n,e){return Rr().memoizedState=[n,e===void 0?null:e],n},useContext:Ls,useEffect:a2,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Rh(4194308,4,hR.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Rh(4194308,4,n,e)},useInsertionEffect:function(n,e){return Rh(4,2,n,e)},useMemo:function(n,e){var t=Rr();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Rr();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=I3.bind(null,fn,n),[i.memoizedState,n]},useRef:function(n){var e=Rr();return n={current:n},e.memoizedState=n},useState:o2,useDebugValue:py,useDeferredValue:function(n){return Rr().memoizedState=n},useTransition:function(){var n=o2(!1),e=n[0];return n=c3.bind(null,n[1]),Rr().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=fn,s=Rr();if(dn){if(t===void 0)throw Error(Re(407));t=t()}else{if(t=e(),ii===null)throw Error(Re(349));bl&30||aR(i,e,t)}s.memoizedState=t;var r={value:t,getSnapshot:e};return s.queue=r,a2(gR.bind(null,i,r,n),[n]),i.flags|=2048,hu(9,lR.bind(null,i,r,t,e),void 0,null),t},useId:function(){var n=Rr(),e=ii.identifierPrefix;if(dn){var t=oo,i=ro;t=(i&~(1<<32-gr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Cu++,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[Wr]=e,n[cu]=i,MR(n,e,!1,!1),e.stateNode=n;e:{switch(o=e0(t,i),t){case"dialog":gn("cancel",n),gn("close",n),s=i;break;case"iframe":case"object":case"embed":gn("load",n),s=i;break;case"video":case"audio":for(s=0;sgc&&(e.flags|=128,i=!0,iI(r,!1),e.lanes=4194304)}else{if(!i)if(n=aA(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),iI(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!dn)return mi(e),null}else 2*Wn()-r.renderingStartTime>gc&&t!==1073741824&&(e.flags|=128,i=!0,iI(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Wn(),e.sibling=null,t=pn.current,an(pn,i?t&1|2:t&1),e):(mi(e),null);case 22:case 23:return Gy(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?gs&1073741824&&(mi(e),e.subtreeFlags&6&&(e.flags|=8192)):mi(e),null;case 24:return null;case 25:return null}throw Error(Re(156,e.tag))}function y3(n,e){switch(iy(e),e.tag){case 1:return $i(e.type)&&eA(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return ac(),In(qi),In(Bi),uy(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return Iy(e),null;case 13:if(In(pn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Re(340));rc()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return In(pn),null;case 4:return ac(),null;case 10:return ay(e.type._context),null;case 22:case 23:return Gy(),null;case 24:return null;default:return null}}var fd=!1,Gi=!1,v3=typeof WeakSet=="function"?WeakSet:Set,De=null;function Yg(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Bn(n,e,i)}else t.current=null}function S0(n,e,t){try{t()}catch(i){Bn(n,e,i)}}var A2=!1;function G3(n,e){if(c0=Qh,n=Kx(),ty(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 s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{t.nodeType,r.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,c=0,u=0,C=n,d=null;t:for(;;){for(var h;C!==t||s!==0&&C.nodeType!==3||(a=o+s),C!==r||i!==0&&C.nodeType!==3||(l=o+i),C.nodeType===3&&(o+=C.nodeValue.length),(h=C.firstChild)!==null;)d=C,C=h;for(;;){if(C===n)break t;if(d===t&&++c===s&&(a=o),d===r&&++u===i&&(l=o),(h=C.nextSibling)!==null)break;C=d,d=C.parentNode}C=h}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(I0={focusedElem:n,selectionRange:t},Qh=!1,De=e;De!==null;)if(e=De,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,De=n;else for(;De!==null;){e=De;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,v=m.memoizedState,A=e.stateNode,b=A.getSnapshotBeforeUpdate(e.elementType===e.type?y:sr(e.type,y),v);A.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var f=e.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(B){Bn(e,e.return,B)}if(n=e.sibling,n!==null){n.return=e.return,De=n;break}De=e.return}return m=A2,A2=!1,m}function TI(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&n)===n){var r=s.destroy;s.destroy=void 0,r!==void 0&&S0(e,t,r)}s=s.next}while(s!==i)}}function HA(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 x0(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 XR(n){var e=n.alternate;e!==null&&(n.alternate=null,XR(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Wr],delete e[cu],delete e[d0],delete e[r3],delete e[o3])),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 YR(n){return n.tag===5||n.tag===3||n.tag===4}function p2(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||YR(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 R0(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=$h));else if(i!==4&&(n=n.child,n!==null))for(R0(n,e,t),n=n.sibling;n!==null;)R0(n,e,t),n=n.sibling}function W0(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(W0(n,e,t),n=n.sibling;n!==null;)W0(n,e,t),n=n.sibling}var li=null,or=!1;function Ho(n,e,t){for(t=t.child;t!==null;)FR(n,e,t),t=t.sibling}function FR(n,e,t){if(Vr&&typeof Vr.onCommitFiberUnmount=="function")try{Vr.onCommitFiberUnmount(wA,t)}catch{}switch(t.tag){case 5:Gi||Yg(t,e);case 6:var i=li,s=or;li=null,Ho(n,e,t),li=i,or=s,li!==null&&(or?(n=li,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):li.removeChild(t.stateNode));break;case 18:li!==null&&(or?(n=li,t=t.stateNode,n.nodeType===8?Nm(n.parentNode,t):n.nodeType===1&&Nm(n,t),ru(n)):Nm(li,t.stateNode));break;case 4:i=li,s=or,li=t.stateNode.containerInfo,or=!0,Ho(n,e,t),li=i,or=s;break;case 0:case 11:case 14:case 15:if(!Gi&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var r=s,o=r.destroy;r=r.tag,o!==void 0&&(r&2||r&4)&&S0(t,e,o),s=s.next}while(s!==i)}Ho(n,e,t);break;case 1:if(!Gi&&(Yg(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Bn(t,e,a)}Ho(n,e,t);break;case 21:Ho(n,e,t);break;case 22:t.mode&1?(Gi=(i=Gi)||t.memoizedState!==null,Ho(n,e,t),Gi=i):Ho(n,e,t);break;default:Ho(n,e,t)}}function m2(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new v3),e.forEach(function(i){var s=M3.bind(null,n,i);t.has(i)||(t.add(i),i.then(s,s))})}}function js(n,e){var t=e.deletions;if(t!==null)for(var i=0;is&&(s=o),i&=~r}if(i=s,i=Wn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Z3(i/1960))-i,10n?16:n,Qo===null)var i=!1;else{if(n=Qo,Qo=null,uA=0,zt&6)throw Error(Re(331));var s=zt;for(zt|=4,De=n.current;De!==null;){var r=De,o=r.child;if(De.flags&16){var a=r.deletions;if(a!==null){for(var l=0;lWn()-yy?Il(n,0):by|=t),es(n,e)}function UR(n,e){e===0&&(n.mode&1?(e=cd,cd<<=1,!(cd&130023424)&&(cd=4194304)):e=1);var t=Ni();n=Ao(n,e),n!==null&&(Lu(n,e,t),es(n,t))}function V3(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),UR(n,t)}function M3(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Re(314))}i!==null&&i.delete(e),UR(n,t)}var PR;PR=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||qi.current)Qi=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Qi=!1,f3(n,e,t);Qi=!!(n.flags&131072)}else Qi=!1,dn&&e.flags&1048576&&Ox(e,iA,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Wh(n,e),n=e.pendingProps;var s=sc(e,Bi.current);Qg(e,t),s=dy(null,e,i,n,s,t);var r=hy();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,$i(i)?(r=!0,tA(e)):r=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,gy(e),s.updater=MA,e.stateNode=s,s._reactInternals=e,b0(e,i,n,t),e=G0(null,e,i,!0,r,t)):(e.tag=0,dn&&r&&ny(e),Wi(null,e,s,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Wh(n,e),n=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=H3(i),n=sr(i,n),s){case 0:e=v0(null,e,i,n,t);break e;case 1:e=C2(null,e,i,n,t);break e;case 11:e=I2(null,e,i,n,t);break e;case 14:e=u2(null,e,i,sr(i.type,n),t);break e}throw Error(Re(306,i,""))}return e;case 0:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:sr(i,s),v0(n,e,i,s,t);case 1:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:sr(i,s),C2(n,e,i,s,t);case 3:e:{if(RR(e),n===null)throw Error(Re(387));i=e.pendingProps,r=e.memoizedState,s=r.element,$x(n,e),oA(e,i,null,t);var o=e.memoizedState;if(i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=r,e.memoizedState=r,e.flags&256){s=lc(Error(Re(423)),e),e=d2(n,e,i,t,s);break e}else if(i!==s){s=lc(Error(Re(424)),e),e=d2(n,e,i,t,s);break e}else for(Is=na(e.stateNode.containerInfo.firstChild),Cs=e,dn=!0,ar=null,t=iR(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(rc(),i===s){e=po(n,e,t);break e}Wi(n,e,i,t)}e=e.child}return e;case 5:return sR(e),n===null&&p0(e),i=e.type,s=e.pendingProps,r=n!==null?n.memoizedProps:null,o=s.children,u0(i,s)?o=null:r!==null&&u0(i,r)&&(e.flags|=32),xR(n,e),Wi(n,e,o,t),e.child;case 6:return n===null&&p0(e),null;case 13:return WR(n,e,t);case 4:return cy(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=oc(e,null,i,t):Wi(n,e,i,t),e.child;case 11:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:sr(i,s),I2(n,e,i,s,t);case 7:return Wi(n,e,e.pendingProps,t),e.child;case 8:return Wi(n,e,e.pendingProps.children,t),e.child;case 12:return Wi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,s=e.pendingProps,r=e.memoizedProps,o=s.value,an(sA,i._currentValue),i._currentValue=o,r!==null)if(ur(r.value,o)){if(r.children===s.children&&!qi.current){e=po(n,e,t);break e}}else for(r=e.child,r!==null&&(r.return=e);r!==null;){var a=r.dependencies;if(a!==null){o=r.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(r.tag===1){l=co(-1,t&-t),l.tag=2;var c=r.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}r.lanes|=t,l=r.alternate,l!==null&&(l.lanes|=t),m0(r.return,t,e),a.lanes|=t;break}l=l.next}}else if(r.tag===10)o=r.type===e.type?null:r.child;else if(r.tag===18){if(o=r.return,o===null)throw Error(Re(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),m0(o,t,e),o=r.sibling}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}Wi(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,i=e.pendingProps.children,Qg(e,t),s=Ls(s),i=i(s),e.flags|=1,Wi(n,e,i,t),e.child;case 14:return i=e.type,s=sr(i,e.pendingProps),s=sr(i.type,s),u2(n,e,i,s,t);case 15:return wR(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:sr(i,s),Wh(n,e),e.tag=1,$i(i)?(n=!0,tA(e)):n=!1,Qg(e,t),tR(e,i,s),b0(e,i,s,t),G0(null,e,i,!0,n,t);case 19:return VR(n,e,t);case 22:return SR(n,e,t)}throw Error(Re(156,e.tag))};function _R(n,e){return fx(n,e)}function N3(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 Fs(n,e,t,i){return new N3(n,e,t,i)}function Zy(n){return n=n.prototype,!(!n||!n.isReactComponent)}function H3(n){if(typeof n=="function")return Zy(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Db)return 11;if(n===Ub)return 14}return 2}function oa(n,e){var t=n.alternate;return t===null?(t=Fs(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 Nh(n,e,t,i,s,r){var o=2;if(i=n,typeof n=="function")Zy(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Sg:return ul(t.children,s,r,e);case kb:o=8,s|=8;break;case Df:return n=Fs(12,t,e,s|2),n.elementType=Df,n.lanes=r,n;case Uf:return n=Fs(13,t,e,s),n.elementType=Uf,n.lanes=r,n;case Pf:return n=Fs(19,t,e,s),n.elementType=Pf,n.lanes=r,n;case nx:return YA(t,s,r,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case ex:o=10;break e;case tx:o=9;break e;case Db:o=11;break e;case Ub:o=14;break e;case ko:o=16,i=null;break e}throw Error(Re(130,n==null?n:typeof n,""))}return e=Fs(o,t,e,s),e.elementType=n,e.type=i,e.lanes=r,e}function ul(n,e,t,i){return n=Fs(7,n,i,e),n.lanes=t,n}function YA(n,e,t,i){return n=Fs(22,n,i,e),n.elementType=nx,n.lanes=t,n.stateNode={isHidden:!1},n}function Tm(n,e,t){return n=Fs(6,n,null,e),n.lanes=t,n}function Em(n,e,t){return e=Fs(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function X3(n,e,t,i,s){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=vm(0),this.expirationTimes=vm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vm(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function wy(n,e,t,i,s,r,o,a,l){return n=new X3(n,e,t,a,l),e===1?(e=1,r===!0&&(e|=8)):e=0,r=Fs(3,null,null,e),n.current=r,r.stateNode=n,r.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},gy(r),n}function Y3(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jR)}catch(n){console.error(n)}}jR(),OS.exports=ms;var T3=OS.exports,w2=T3;Ef.createRoot=w2.createRoot,Ef.hydrateRoot=w2.hydrateRoot;/**
- * @remix-run/router v1.6.2
- *
- * 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 pu(){return pu=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function Wy(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function k3(){return Math.random().toString(36).substr(2,8)}function x2(n,e){return{usr:n.state,key:n.key,idx:e}}function X0(n,e,t,i){return t===void 0&&(t=null),pu({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?bc(e):e,{state:t,key:e&&e.key||i||k3()})}function hA(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 bc(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 D3(n,e,t,i){i===void 0&&(i={});let{window:s=document.defaultView,v5Compat:r=!1}=i,o=s.history,a=jo.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(pu({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function C(){a=jo.Pop;let v=u(),A=v==null?null:v-c;c=v,l&&l({action:a,location:y.location,delta:A})}function d(v,A){a=jo.Push;let b=X0(y.location,v,A);t&&t(b,v),c=u()+1;let f=x2(b,c),B=y.createHref(b);try{o.pushState(f,"",B)}catch{s.location.assign(B)}r&&l&&l({action:a,location:y.location,delta:1})}function h(v,A){a=jo.Replace;let b=X0(y.location,v,A);t&&t(b,v),c=u();let f=x2(b,c),B=y.createHref(b);o.replaceState(f,"",B),r&&l&&l({action:a,location:y.location,delta:0})}function m(v){let A=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof v=="string"?v:hA(v);return Kn(A,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,A)}let y={get action(){return a},get location(){return n(s,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(S2,C),l=v,()=>{s.removeEventListener(S2,C),l=null}},createHref(v){return e(s,v)},createURL:m,encodeLocation(v){let A=m(v);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:d,replace:h,go(v){return o.go(v)}};return y}var R2;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(R2||(R2={}));function U3(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?bc(e):e,s=Vy(i.pathname||"/",t);if(s==null)return null;let r=qR(n);P3(r);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?r.path||"":a,caseSensitive:r.caseSensitive===!0,childrenIndex:o,route:r};l.relativePath.startsWith("/")&&(Kn(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 c=aa([i,l.relativePath]),u=t.concat(l);r.children&&r.children.length>0&&(Kn(r.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),qR(r.children,e,u,c)),!(r.path==null&&!r.index)&&e.push({path:c,score:$3(c,r.index),routesMeta:u})};return n.forEach((r,o)=>{var a;if(r.path===""||!((a=r.path)!=null&&a.includes("?")))s(r,o);else for(let l of $R(r.path))s(r,o,l)}),e}function $R(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,s=t.endsWith("?"),r=t.replace(/\?$/,"");if(i.length===0)return s?[r,""]:[r];let o=$R(i.join("/")),a=[];return a.push(...o.map(l=>l===""?r:[r,l].join("/"))),s&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function P3(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:eH(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const _3=/^:\w+$/,J3=3,O3=2,Q3=1,j3=10,q3=-2,W2=n=>n==="*";function $3(n,e){let t=n.split("/"),i=t.length;return t.some(W2)&&(i+=q3),e&&(i+=O3),t.filter(s=>!W2(s)).reduce((s,r)=>s+(_3.test(r)?J3:r===""?Q3:j3),i)}function eH(n,e){return n.length===e.length&&n.slice(0,-1).every((i,s)=>i===e[s])?n[n.length-1]-e[e.length-1]:0}function tH(n,e){let{routesMeta:t}=n,i={},s="/",r=[];for(let o=0;o{if(u==="*"){let d=a[C]||"";o=r.slice(0,r.length-d.length).replace(/(.)\/+$/,"$1")}return c[u]=rH(a[C]||"",u),c},{}),pathname:r,pathnameBase:o,pattern:n}}function iH(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Wy(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=[],s="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,a)=>(i.push(a),"/([^\\/]+)"));return n.endsWith("*")?(i.push("*"),s+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?s+="\\/*$":n!==""&&n!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),i]}function sH(n){try{return decodeURI(n)}catch(e){return Wy(!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 rH(n,e){try{return decodeURIComponent(n)}catch(t){return Wy(!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 Vy(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 oH(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:s=""}=typeof n=="string"?bc(n):n;return{pathname:t?t.startsWith("/")?t:aH(t,e):e,search:gH(i),hash:cH(s)}}function aH(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(s=>{s===".."?t.length>1&&t.pop():s!=="."&&t.push(s)}),t.length>1?t.join("/"):"/"}function km(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 e1(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function t1(n,e,t,i){i===void 0&&(i=!1);let s;typeof n=="string"?s=bc(n):(s=pu({},n),Kn(!s.pathname||!s.pathname.includes("?"),km("?","pathname","search",s)),Kn(!s.pathname||!s.pathname.includes("#"),km("#","pathname","hash",s)),Kn(!s.search||!s.search.includes("#"),km("#","search","hash",s)));let r=n===""||s.pathname==="",o=r?"/":s.pathname,a;if(i||o==null)a=t;else{let C=e.length-1;if(o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),C-=1;s.pathname=d.join("/")}a=C>=0?e[C]:"/"}let l=oH(s,a),c=o&&o!=="/"&&o.endsWith("/"),u=(r||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const aa=n=>n.join("/").replace(/\/\/+/g,"/"),lH=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),gH=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,cH=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function IH(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const n1=["post","put","patch","delete"];new Set(n1);const uH=["get",...n1];new Set(uH);/**
- * React Router v6.11.2
- *
- * 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 AA(){return AA=Object.assign?Object.assign.bind():function(n){for(var e=1;el.pathnameBase)),o=E.useRef(!1);return r1(()=>{o.current=!0}),E.useCallback(function(l,c){if(c===void 0&&(c={}),!o.current)return;if(typeof l=="number"){t.go(l);return}let u=t1(l,JSON.parse(r),s,c.relative==="path");n==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:aa([e,u.pathname])),(c.replace?t.replace:t.push)(u,c.state,c)},[e,t,r,s,n])}const AH=E.createContext(null);function pH(n){let e=E.useContext(yo).outlet;return e&&E.createElement(AH.Provider,{value:n},e)}function mH(){let{matches:n}=E.useContext(yo),e=n[n.length-1];return e?e.params:{}}function Ny(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=E.useContext(yo),{pathname:s}=Wl(),r=JSON.stringify(e1(i).map(o=>o.pathnameBase));return E.useMemo(()=>t1(n,JSON.parse(r),s,t==="path"),[n,r,s,t])}function fH(n,e){return bH(n,e)}function bH(n,e,t){Du()||Kn(!1);let{navigator:i}=E.useContext(Rl),{matches:s}=E.useContext(yo),r=s[s.length-1],o=r?r.params:{};r&&r.pathname;let a=r?r.pathnameBase:"/";r&&r.route;let l=Wl(),c;if(e){var u;let y=typeof e=="string"?bc(e):e;a==="/"||(u=y.pathname)!=null&&u.startsWith(a)||Kn(!1),c=y}else c=l;let C=c.pathname||"/",d=a==="/"?C:C.slice(a.length)||"/",h=U3(n,{pathname:d}),m=ZH(h&&h.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:aa([a,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?a:aa([a,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,t);return e&&m?E.createElement(TA.Provider,{value:{location:AA({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:jo.Pop}},m):m}function yH(){let n=RH(),e=IH(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},r=null;return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},e),t?E.createElement("pre",{style:s},t):null,r)}const vH=E.createElement(yH,null);class GH extends E.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||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?E.createElement(yo.Provider,{value:this.props.routeContext},E.createElement(s1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function BH(n){let{routeContext:e,match:t,children:i}=n,s=E.useContext(My);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),E.createElement(yo.Provider,{value:e},i)}function ZH(n,e,t){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),n==null){var s;if((s=t)!=null&&s.errors)n=t.matches;else return null}let r=n,o=(i=t)==null?void 0:i.errors;if(o!=null){let a=r.findIndex(l=>l.route.id&&o?.[l.route.id]);a>=0||Kn(!1),r=r.slice(0,Math.min(r.length,a+1))}return r.reduceRight((a,l,c)=>{let u=l.route.id?o?.[l.route.id]:null,C=null;t&&(C=l.route.errorElement||vH);let d=e.concat(r.slice(0,c+1)),h=()=>{let m;return u?m=C:l.route.Component?m=E.createElement(l.route.Component,null):l.route.element?m=l.route.element:m=a,E.createElement(BH,{match:l,routeContext:{outlet:a,matches:d,isDataRoute:t!=null},children:m})};return t&&(l.route.ErrorBoundary||l.route.errorElement||c===0)?E.createElement(GH,{location:t.location,revalidation:t.revalidation,component:C,error:u,children:h(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):h()},null)}var Y0;(function(n){n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate"})(Y0||(Y0={}));var mu;(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",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId"})(mu||(mu={}));function wH(n){let e=E.useContext(My);return e||Kn(!1),e}function SH(n){let e=E.useContext(i1);return e||Kn(!1),e}function xH(n){let e=E.useContext(yo);return e||Kn(!1),e}function o1(n){let e=xH(),t=e.matches[e.matches.length-1];return t.route.id||Kn(!1),t.route.id}function RH(){var n;let e=E.useContext(s1),t=SH(mu.UseRouteError),i=o1(mu.UseRouteError);return e||((n=t.errors)==null?void 0:n[i])}function WH(){let{router:n}=wH(Y0.UseNavigateStable),e=o1(mu.UseNavigateStable),t=E.useRef(!1);return r1(()=>{t.current=!0}),E.useCallback(function(s,r){r===void 0&&(r={}),t.current&&(typeof s=="number"?n.navigate(s):n.navigate(s,AA({fromRouteId:e},r)))},[n,e])}function VH(n){return pH(n.context)}function Eo(n){Kn(!1)}function MH(n){let{basename:e="/",children:t=null,location:i,navigationType:s=jo.Pop,navigator:r,static:o=!1}=n;Du()&&Kn(!1);let a=e.replace(/^\/*/,"/"),l=E.useMemo(()=>({basename:a,navigator:r,static:o}),[a,r,o]);typeof i=="string"&&(i=bc(i));let{pathname:c="/",search:u="",hash:C="",state:d=null,key:h="default"}=i,m=E.useMemo(()=>{let y=Vy(c,a);return y==null?null:{location:{pathname:y,search:u,hash:C,state:d,key:h},navigationType:s}},[a,c,u,C,d,h,s]);return m==null?null:E.createElement(Rl.Provider,{value:l},E.createElement(TA.Provider,{children:t,value:m}))}function NH(n){let{children:e,location:t}=n;return fH(F0(e),t)}var V2;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(V2||(V2={}));new Promise(()=>{});function F0(n,e){e===void 0&&(e=[]);let t=[];return E.Children.forEach(n,(i,s)=>{if(!E.isValidElement(i))return;let r=[...e,s];if(i.type===E.Fragment){t.push.apply(t,F0(i.props.children,r));return}i.type!==Eo&&Kn(!1),!i.props.index||!i.props.children||Kn(!1);let o={id:i.props.id||r.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=F0(i.props.children,r)),t.push(o)}),t}/**
- * React Router DOM v6.11.2
- *
- * 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 pA(){return pA=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(t[s]=n[s]);return t}function HH(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function XH(n,e){return n.button===0&&(!e||e==="_self")&&!HH(n)}const YH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],FH=["aria-current","caseSensitive","className","end","style","to","children"];function KH(n){let{basename:e,children:t,window:i}=n,s=E.useRef();s.current==null&&(s.current=E3({window:i,v5Compat:!0}));let r=s.current,[o,a]=E.useState({action:r.action,location:r.location});return E.useLayoutEffect(()=>r.listen(a),[r]),E.createElement(MH,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r})}const zH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,EA=E.forwardRef(function(e,t){let{onClick:i,relative:s,reloadDocument:r,replace:o,state:a,target:l,to:c,preventScrollReset:u}=e,C=a1(e,YH),{basename:d}=E.useContext(Rl),h,m=!1;if(typeof c=="string"&&LH.test(c)&&(h=c,zH))try{let b=new URL(window.location.href),f=c.startsWith("//")?new URL(b.protocol+c):new URL(c),B=Vy(f.pathname,d);f.origin===b.origin&&B!=null?c=B+f.search+f.hash:m=!0}catch{}let y=CH(c,{relative:s}),v=TH(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:s});function A(b){i&&i(b),b.defaultPrevented||v(b)}return E.createElement("a",pA({},C,{href:h||y,onClick:m||r?i:A,ref:t,target:l}))}),l1=E.forwardRef(function(e,t){let{"aria-current":i="page",caseSensitive:s=!1,className:r="",end:o=!1,style:a,to:l,children:c}=e,u=a1(e,FH),C=Ny(l,{relative:u.relative}),d=Wl(),h=E.useContext(i1),{navigator:m}=E.useContext(Rl),y=m.encodeLocation?m.encodeLocation(C).pathname:C.pathname,v=d.pathname,A=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;s||(v=v.toLowerCase(),A=A?A.toLowerCase():null,y=y.toLowerCase());let b=v===y||!o&&v.startsWith(y)&&v.charAt(y.length)==="/",f=A!=null&&(A===y||!o&&A.startsWith(y)&&A.charAt(y.length)==="/"),B=b?i:void 0,S;typeof r=="function"?S=r({isActive:b,isPending:f}):S=[r,b?"active":null,f?"pending":null].filter(Boolean).join(" ");let x=typeof a=="function"?a({isActive:b,isPending:f}):a;return E.createElement(EA,pA({},u,{"aria-current":B,className:S,ref:t,style:x,to:l}),typeof c=="function"?c({isActive:b,isPending:f}):c)});var M2;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmitImpl="useSubmitImpl",n.UseFetcher="useFetcher"})(M2||(M2={}));var N2;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(N2||(N2={}));function TH(n,e){let{target:t,replace:i,state:s,preventScrollReset:r,relative:o}=e===void 0?{}:e,a=dH(),l=Wl(),c=Ny(n,{relative:o});return E.useCallback(u=>{if(XH(u,t)){u.preventDefault();let C=i!==void 0?i:hA(l)===hA(c);a(n,{replace:C,state:s,preventScrollReset:r,relative:o})}},[l,a,c,i,s,t,n,r,o])}const g1=({className:n})=>N.jsxs("svg",{className:n,width:"100%",height:"100%",viewBox:"0 0 180 180",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[N.jsx("path",{className:"fill-icontext dark:fill-icontext-dark",d:"M76.875 5.3125L65.25 51H54.2188L48.0312 27C47.9062 26.5417 47.7396 25.8438 47.5312 24.9062C47.3229 23.9688 47.1042 22.9479 46.875 21.8438C46.6458 20.7188 46.4375 19.6667 46.25 18.6875C46.0833 17.6875 45.9688 16.8958 45.9062 16.3125C45.8438 16.8958 45.7188 17.6771 45.5312 18.6562C45.3646 19.6354 45.1667 20.6771 44.9375 21.7812C44.7292 22.8854 44.5208 23.9167 44.3125 24.875C44.1042 25.8333 43.9375 26.5625 43.8125 27.0625L37.6562 51H26.6562L15 5.3125H24.5312L30.375 30.25C30.5417 31 30.7292 31.8958 30.9375 32.9375C31.1667 33.9792 31.3854 35.0729 31.5938 36.2188C31.8229 37.3438 32.0208 38.4375 32.1875 39.5C32.375 40.5417 32.5104 41.4479 32.5938 42.2188C32.6979 41.4271 32.8333 40.5104 33 39.4688C33.1667 38.4062 33.3438 37.3333 33.5312 36.25C33.7396 35.1458 33.9479 34.125 34.1562 33.1875C34.3646 32.25 34.5521 31.4896 34.7188 30.9062L41.375 5.3125H50.5312L57.1875 30.9062C57.3333 31.4688 57.5 32.2292 57.6875 33.1875C57.8958 34.125 58.1042 35.1458 58.3125 36.25C58.5208 37.3542 58.7083 38.4375 58.875 39.5C59.0625 40.5417 59.1979 41.4479 59.2812 42.2188C59.4271 41.1771 59.625 39.9167 59.875 38.4375C60.1458 36.9375 60.4271 35.4479 60.7188 33.9688C61.0312 32.4896 61.3021 31.25 61.5312 30.25L67.3438 5.3125H76.875ZM107.225 33.4688C107.225 36.3854 106.829 38.9688 106.037 41.2188C105.267 43.4688 104.131 45.375 102.631 46.9375C101.152 48.4792 99.3604 49.6458 97.2562 50.4375C95.1729 51.2292 92.8187 51.625 90.1937 51.625C87.7354 51.625 85.475 51.2292 83.4125 50.4375C81.3708 49.6458 79.5896 48.4792 78.0687 46.9375C76.5687 45.375 75.4021 43.4688 74.5687 41.2188C73.7562 38.9688 73.35 36.3854 73.35 33.4688C73.35 29.5938 74.0375 26.3125 75.4125 23.625C76.7875 20.9375 78.7458 18.8958 81.2875 17.5C83.8292 16.1042 86.8604 15.4062 90.3812 15.4062C93.6521 15.4062 96.5479 16.1042 99.0687 17.5C101.61 18.8958 103.6 20.9375 105.037 23.625C106.496 26.3125 107.225 29.5938 107.225 33.4688ZM83.0687 33.4688C83.0687 35.7604 83.3187 37.6875 83.8187 39.25C84.3187 40.8125 85.1 41.9896 86.1625 42.7812C87.225 43.5729 88.6104 43.9688 90.3187 43.9688C92.0062 43.9688 93.3708 43.5729 94.4125 42.7812C95.475 41.9896 96.2458 40.8125 96.725 39.25C97.225 37.6875 97.475 35.7604 97.475 33.4688C97.475 31.1562 97.225 29.2396 96.725 27.7188C96.2458 26.1771 95.475 25.0208 94.4125 24.25C93.35 23.4792 91.9646 23.0938 90.2562 23.0938C87.7354 23.0938 85.9021 23.9583 84.7562 25.6875C83.6312 27.4167 83.0687 30.0104 83.0687 33.4688ZM122.003 51.625C118.107 51.625 114.93 50.1042 112.471 47.0625C110.034 44 108.815 39.5104 108.815 33.5938C108.815 27.6146 110.055 23.0938 112.534 20.0312C115.013 16.9479 118.253 15.4062 122.253 15.4062C123.919 15.4062 125.388 15.6354 126.659 16.0938C127.93 16.5521 129.023 17.1667 129.94 17.9375C130.878 18.7083 131.669 19.5729 132.315 20.5312H132.628C132.503 19.8646 132.346 18.8854 132.159 17.5938C131.992 16.2812 131.909 14.9375 131.909 13.5625V2.375H141.471V51H134.159L132.315 46.4688H131.909C131.305 47.4271 130.544 48.3021 129.628 49.0938C128.732 49.8646 127.659 50.4792 126.409 50.9375C125.159 51.3958 123.69 51.625 122.003 51.625ZM125.346 44.0312C127.95 44.0312 129.784 43.2604 130.846 41.7188C131.93 40.1562 132.503 37.8125 132.565 34.6875V33.6562C132.565 30.2604 132.044 27.6667 131.003 25.875C129.961 24.0625 128.023 23.1562 125.19 23.1562C123.086 23.1562 121.44 24.0625 120.253 25.875C119.065 27.6875 118.471 30.3021 118.471 33.7188C118.471 37.1354 119.065 39.7083 120.253 41.4375C121.461 43.1667 123.159 44.0312 125.346 44.0312ZM159.446 15.4062C162.675 15.4062 165.457 16.0312 167.79 17.2812C170.123 18.5104 171.925 20.3021 173.196 22.6562C174.467 25.0104 175.103 27.8854 175.103 31.2812V35.9062H152.571C152.675 38.5938 153.478 40.7083 154.978 42.25C156.498 43.7708 158.603 44.5312 161.29 44.5312C163.519 44.5312 165.561 44.3021 167.415 43.8438C169.269 43.3854 171.175 42.6979 173.134 41.7812V49.1562C171.405 50.0104 169.592 50.6354 167.696 51.0312C165.821 51.4271 163.54 51.625 160.853 51.625C157.353 51.625 154.248 50.9792 151.54 49.6875C148.853 48.3958 146.738 46.4271 145.196 43.7812C143.675 41.1354 142.915 37.8021 142.915 33.7812C142.915 29.6979 143.603 26.3021 144.978 23.5938C146.373 20.8646 148.311 18.8229 150.79 17.4688C153.269 16.0938 156.155 15.4062 159.446 15.4062ZM159.509 22.1875C157.655 22.1875 156.113 22.7812 154.884 23.9688C153.675 25.1562 152.978 27.0208 152.79 29.5625H166.165C166.144 28.1458 165.884 26.8854 165.384 25.7812C164.905 24.6771 164.175 23.8021 163.196 23.1562C162.238 22.5104 161.009 22.1875 159.509 22.1875ZM61.2812 155H48.9688L29.0938 120.438H28.8125C28.8958 121.875 28.9688 123.323 29.0312 124.781C29.0938 126.24 29.1562 127.698 29.2188 129.156C29.2812 130.594 29.3438 132.042 29.4062 133.5V155H20.75V109.312H32.9688L52.8125 143.531H53.0312C52.9896 142.115 52.9375 140.708 52.875 139.312C52.8125 137.917 52.75 136.521 52.6875 135.125C52.6458 133.729 52.6042 132.333 52.5625 130.938V109.312H61.2812V155ZM75.1937 120.062V155H65.6625V120.062H75.1937ZM70.4437 106.375C71.8604 106.375 73.0792 106.708 74.1 107.375C75.1208 108.021 75.6312 109.24 75.6312 111.031C75.6312 112.802 75.1208 114.031 74.1 114.719C73.0792 115.385 71.8604 115.719 70.4437 115.719C69.0062 115.719 67.7771 115.385 66.7562 114.719C65.7562 114.031 65.2562 112.802 65.2562 111.031C65.2562 109.24 65.7562 108.021 66.7562 107.375C67.7771 106.708 69.0062 106.375 70.4437 106.375Z"}),N.jsx("path",{className:"fill-primary",d:"M18.3382 54.625C18.1007 55.7875 17.857 57.0187 17.607 58.3187C17.3695 59.6187 17.1507 60.8937 16.9507 62.1437C16.7632 63.3937 16.6132 64.5312 16.5007 65.5562H10.0882L9.807 65.1437C10.0445 64.2187 10.3382 63.1187 10.6882 61.8437C11.0507 60.5562 11.4382 59.2687 11.8507 57.9812C12.2757 56.6812 12.7007 55.5625 13.1257 54.625H18.3382ZM8.77575 54.625C8.53825 55.7875 8.2945 57.0187 8.0445 58.3187C7.807 59.6187 7.58825 60.8937 7.38825 62.1437C7.20075 63.3937 7.05075 64.5312 6.93825 65.5562H0.525749L0.244499 65.1437C0.481999 64.2187 0.775749 63.1187 1.12575 61.8437C1.48825 60.5562 1.87575 59.2687 2.28825 57.9812C2.71325 56.6812 3.13825 55.5625 3.56325 54.625H8.77575ZM61.2812 103H48.9688L29.0938 68.4375H28.8125C28.8958 69.875 28.9688 71.3229 29.0312 72.7812C29.0938 74.2396 29.1562 75.6979 29.2188 77.1562C29.2812 78.5938 29.3438 80.0417 29.4062 81.5V103H20.75V57.3125H32.9688L52.8125 91.5312H53.0312C52.9896 90.1146 52.9375 88.7083 52.875 87.3125C52.8125 85.9167 52.75 84.5208 52.6875 83.125C52.6458 81.7292 52.6042 80.3333 52.5625 78.9375V57.3125H61.2812V103ZM75.1937 68.0625V103H65.6625V68.0625H75.1937ZM70.4437 54.375C71.8604 54.375 73.0792 54.7083 74.1 55.375C75.1208 56.0208 75.6312 57.2396 75.6312 59.0312C75.6312 60.8021 75.1208 62.0312 74.1 62.7188C73.0792 63.3854 71.8604 63.7188 70.4437 63.7188C69.0062 63.7188 67.7771 63.3854 66.7562 62.7188C65.7562 62.0312 65.2562 60.8021 65.2562 59.0312C65.2562 57.2396 65.7562 56.0208 66.7562 55.375C67.7771 54.7083 69.0062 54.375 70.4437 54.375ZM119.856 67.4062C123.815 67.4062 126.804 68.4271 128.825 70.4688C130.867 72.4896 131.888 75.7396 131.888 80.2188V103H122.325V82.5938C122.325 80.0938 121.898 78.2083 121.044 76.9375C120.19 75.6667 118.867 75.0312 117.075 75.0312C114.554 75.0312 112.763 75.9375 111.7 77.75C110.638 79.5417 110.106 82.1146 110.106 85.4688V103H100.575V82.5938C100.575 80.9271 100.388 79.5312 100.013 78.4062C99.6375 77.2812 99.0646 76.4375 98.2938 75.875C97.5229 75.3125 96.5333 75.0312 95.325 75.0312C93.5542 75.0312 92.1583 75.4792 91.1375 76.375C90.1375 77.25 89.4188 78.5521 88.9813 80.2812C88.5646 81.9896 88.3563 84.0833 88.3563 86.5625V103H78.825V68.0625H86.1063L87.3875 72.5312H87.9188C88.6271 71.3229 89.5125 70.3438 90.575 69.5938C91.6583 68.8438 92.8458 68.2917 94.1375 67.9375C95.4292 67.5833 96.7417 67.4062 98.075 67.4062C100.638 67.4062 102.804 67.8229 104.575 68.6562C106.367 69.4896 107.742 70.7812 108.7 72.5312H109.544C110.585 70.7396 112.054 69.4375 113.95 68.625C115.867 67.8125 117.835 67.4062 119.856 67.4062ZM167.05 85.4688C167.05 88.3854 166.654 90.9688 165.863 93.2188C165.092 95.4688 163.956 97.375 162.456 98.9375C160.977 100.479 159.185 101.646 157.081 102.438C154.998 103.229 152.644 103.625 150.019 103.625C147.56 103.625 145.3 103.229 143.238 102.438C141.196 101.646 139.415 100.479 137.894 98.9375C136.394 97.375 135.227 95.4688 134.394 93.2188C133.581 90.9688 133.175 88.3854 133.175 85.4688C133.175 81.5938 133.863 78.3125 135.238 75.625C136.613 72.9375 138.571 70.8958 141.113 69.5C143.654 68.1042 146.685 67.4062 150.206 67.4062C153.477 67.4062 156.373 68.1042 158.894 69.5C161.435 70.8958 163.425 72.9375 164.863 75.625C166.321 78.3125 167.05 81.5938 167.05 85.4688ZM142.894 85.4688C142.894 87.7604 143.144 89.6875 143.644 91.25C144.144 92.8125 144.925 93.9896 145.988 94.7812C147.05 95.5729 148.435 95.9688 150.144 95.9688C151.831 95.9688 153.196 95.5729 154.238 94.7812C155.3 93.9896 156.071 92.8125 156.55 91.25C157.05 89.6875 157.3 87.7604 157.3 85.4688C157.3 83.1562 157.05 81.2396 156.55 79.7188C156.071 78.1771 155.3 77.0208 154.238 76.25C153.175 75.4792 151.79 75.0938 150.081 75.0938C147.56 75.0938 145.727 75.9583 144.581 77.6875C143.456 79.4167 142.894 82.0104 142.894 85.4688ZM182.031 54.625L182.294 55.0375C182.069 55.9625 181.775 57.0687 181.412 58.3562C181.062 59.6312 180.675 60.9125 180.25 62.2C179.837 63.4875 179.419 64.6062 178.994 65.5562H173.781C174.031 64.3937 174.275 63.1625 174.512 61.8625C174.75 60.5625 174.962 59.2875 175.15 58.0375C175.35 56.7875 175.506 55.65 175.619 54.625H182.031ZM172.469 54.625L172.75 55.0375C172.525 55.9625 172.231 57.0687 171.869 58.3562C171.506 59.6312 171.112 60.9125 170.687 62.2C170.275 63.4875 169.856 64.6062 169.431 65.5562H164.219C164.406 64.6812 164.587 63.7687 164.762 62.8187C164.95 61.8562 165.125 60.8937 165.287 59.9312C165.45 58.9687 165.594 58.0375 165.719 57.1375C165.856 56.225 165.969 55.3875 166.056 54.625H172.469Z"})]}),EH="/pr-preview/pr-29/assets/edgeworth.svg",kH="/pr-preview/pr-29/assets/mathdiagrams.webp";/**
- * @license
- * Copyright 2010-2023 Three.js Authors
- * SPDX-License-Identifier: MIT
- */const ya="152",Ja={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Oa={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},c1=0,K0=1,I1=2,DH=3,u1=0,kA=1,DI=2,rr=3,Xr=0,Dn=1,Oi=2,UH=2,sn=0,Cl=1,z0=2,L0=3,T0=4,C1=5,qa=100,d1=101,h1=102,E0=103,k0=104,A1=200,p1=201,m1=202,f1=203,Hy=204,Xy=205,b1=206,y1=207,v1=208,G1=209,B1=210,Yy=0,Fy=1,mA=2,fu=3,bu=4,Ky=5,zy=6,DA=7,Uu=0,Z1=1,w1=2,Ir=0,S1=1,x1=2,R1=3,Ly=4,W1=5,UA=300,Ca=301,da=302,yu=303,vu=304,yc=306,ps=1e3,En=1001,Gu=1002,ft=1003,fA=1004,PH=1004,UI=1005,_H=1005,et=1006,Ty=1007,JH=1007,ha=1008,OH=1008,ln=1009,V1=1010,M1=1011,Ey=1012,N1=1013,ao=1014,Rn=1015,ds=1016,H1=1017,X1=1018,la=1020,Y1=1021,hn=1023,PA=1024,F1=1025,ga=1026,Aa=1027,ky=1028,K1=1029,Dy=1030,z1=1031,L1=1033,Hh=33776,Xh=33777,Yh=33778,Fh=33779,D0=35840,U0=35841,P0=35842,_0=35843,T1=36196,J0=37492,O0=37496,Q0=37808,j0=37809,q0=37810,$0=37811,eb=37812,tb=37813,nb=37814,ib=37815,sb=37816,rb=37817,ob=37818,ab=37819,lb=37820,gb=37821,Kh=36492,E1=36283,cb=36284,Ib=36285,ub=36286,k1=2200,D1=2201,U1=2202,Bu=2300,Zu=2301,zh=2302,ol=2400,al=2401,wu=2402,_A=2500,Uy=2501,QH=0,jH=1,qH=2,Pu=3e3,zs=3001,zn=3200,Yr=3201,vo=0,P1=1,Io="",yt="srgb",Cr="srgb-linear",Py="display-p3",$H=0,Lh=7680,eX=7681,tX=7682,nX=7683,iX=34055,sX=34056,rX=5386,oX=512,aX=513,lX=514,gX=515,cX=516,IX=517,uX=518,_1=519,Su=35044,J1=35048,CX=35040,dX=35045,hX=35049,AX=35041,pX=35046,mX=35050,fX=35042,bX="100",bA="300 es",yA=1035;class bs{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 s=this._listeners[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+fi[n>>16&255]+fi[n>>24&255]+"-"+fi[e&255]+fi[e>>8&255]+"-"+fi[e>>16&15|64]+fi[e>>24&255]+"-"+fi[t&63|128]+fi[t>>8&255]+"-"+fi[t>>16&255]+fi[t>>24&255]+fi[i&255]+fi[i>>8&255]+fi[i>>16&255]+fi[i>>24&255]).toLowerCase()}function wn(n,e,t){return Math.max(e,Math.min(t,n))}function _y(n,e){return(n%e+e)%e}function yX(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function vX(n,e,t){return n!==e?(t-n)/(e-n):0}function PI(n,e,t){return(1-t)*n+t*e}function GX(n,e,t,i){return PI(n,e,1-Math.exp(-t*i))}function BX(n,e=1){return e-Math.abs(_y(n,e*2)-e)}function ZX(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function wX(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function SX(n,e){return n+Math.floor(Math.random()*(e-n+1))}function xX(n,e){return n+Math.random()*(e-n)}function RX(n){return n*(.5-Math.random())}function WX(n){n!==void 0&&(H2=n);let e=H2+=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 VX(n){return n*dl}function MX(n){return n*cc}function Cb(n){return(n&n-1)===0&&n!==0}function O1(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Q1(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function NX(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),c=r((e+i)/2),u=o((e+i)/2),C=r((e-i)/2),d=o((e-i)/2),h=r((i-e)/2),m=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*C,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*C,a*c);break;case"ZXZ":n.set(l*C,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*m,l*h,a*c);break;case"YXY":n.set(l*h,a*u,l*m,a*c);break;case"ZYZ":n.set(l*m,l*h,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function us(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 Zt(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 j1={DEG2RAD:dl,RAD2DEG:cc,generateUUID:hs,clamp:wn,euclideanModulo:_y,mapLinear:yX,inverseLerp:vX,lerp:PI,damp:GX,pingpong:BX,smoothstep:ZX,smootherstep:wX,randInt:SX,randFloat:xX,randFloatSpread:RX,seededRandom:WX,degToRad:VX,radToDeg:MX,isPowerOfTwo:Cb,ceilPowerOfTwo:O1,floorPowerOfTwo:Q1,setQuaternionFromProperEuler:NX,normalize:Zt,denormalize:us};class ne{constructor(e=0,t=0){ne.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,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[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(wn(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),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+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,s,r,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=c,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,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],C=i[7],d=i[2],h=i[5],m=i[8],y=s[0],v=s[3],A=s[6],b=s[1],f=s[4],B=s[7],S=s[2],x=s[5],R=s[8];return r[0]=o*y+a*b+l*S,r[3]=o*v+a*f+l*x,r[6]=o*A+a*B+l*R,r[1]=c*y+u*b+C*S,r[4]=c*v+u*f+C*x,r[7]=c*A+u*B+C*R,r[2]=d*y+h*b+m*S,r[5]=d*v+h*f+m*x,r[8]=d*A+h*B+m*R,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],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*r*u+i*a*l+s*r*c-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],C=u*o-a*c,d=a*l-u*r,h=c*r-o*l,m=t*C+i*d+s*h;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/m;return e[0]=C*y,e[1]=(s*c-u*i)*y,e[2]=(a*i-s*o)*y,e[3]=d*y,e[4]=(u*t-s*l)*y,e[5]=(s*r-a*t)*y,e[6]=h*y,e[7]=(i*l-c*t)*y,e[8]=(o*t-i*r)*y,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,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-s*c,s*l,-s*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Dm.makeScale(e,t)),this}rotate(e){return this.premultiply(Dm.makeRotation(-e)),this}translate(e,t){return this.premultiply(Dm.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 s=0;s<9;s++)if(t[s]!==i[s])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 Dm=new Mt;function q1(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const HX={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Kg(n,e){return new HX[n](e)}function xu(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const X2={};function _I(n){n in X2||(X2[n]=!0,console.warn(n))}function qg(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Um(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const XX=new Mt().fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),YX=new Mt().fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function FX(n){return n.convertSRGBToLinear().applyMatrix3(YX)}function KX(n){return n.applyMatrix3(XX).convertLinearToSRGB()}const zX={[Cr]:n=>n,[yt]:n=>n.convertSRGBToLinear(),[Py]:FX},LX={[Cr]:n=>n,[yt]:n=>n.convertLinearToSRGB(),[Py]:KX},Ns={enabled:!0,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 Cr},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=zX[e],s=LX[t];if(i===void 0||s===void 0)throw new Error(`Unsupported color space conversion, "${e}" to "${t}".`);return s(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 $l;class Jy{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{$l===void 0&&($l=xu("canvas")),$l.width=e.width,$l.height=e.height;const i=$l.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=$l}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=xu("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.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!==UA)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ps:e.x=e.x-Math.floor(e.x);break;case En:e.x=e.x<0?0:1;break;case Gu: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 ps:e.y=e.y-Math.floor(e.y);break;case En:e.y=e.y<0?0:1;break;case Gu: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 _I("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===yt?zs:Pu}set encoding(e){_I("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===zs?yt:Io}}en.DEFAULT_IMAGE=null;en.DEFAULT_MAPPING=UA;en.DEFAULT_ANISOTROPY=1;class Xt{constructor(e=0,t=0,i=0,s=1){Xt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}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,s){return this.x=e,this.y=t,this.z=i,this.w=s,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,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,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,s,r;const l=e.elements,c=l[0],u=l[4],C=l[8],d=l[1],h=l[5],m=l[9],y=l[2],v=l[6],A=l[10];if(Math.abs(u-d)<.01&&Math.abs(C-y)<.01&&Math.abs(m-v)<.01){if(Math.abs(u+d)<.1&&Math.abs(C+y)<.1&&Math.abs(m+v)<.1&&Math.abs(c+h+A-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const f=(c+1)/2,B=(h+1)/2,S=(A+1)/2,x=(u+d)/4,R=(C+y)/4,V=(m+v)/4;return f>B&&f>S?f<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(f),s=x/i,r=R/i):B>S?B<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(B),i=x/s,r=V/s):S<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(S),i=R/r,s=V/r),this.set(i,s,r,t),this}let b=Math.sqrt((v-m)*(v-m)+(C-y)*(C-y)+(d-u)*(d-u));return Math.abs(b)<.001&&(b=1),this.x=(v-m)/b,this.y=(C-y)/b,this.z=(d-u)/b,this.w=Math.acos((c+h+A-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 Nt extends bs{constructor(e=1,t=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Xt(0,0,e,t),this.scissorTest=!1,this.viewport=new Xt(0,0,e,t);const s={width:e,height:t,depth:1};i.encoding!==void 0&&(_I("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===zs?yt:Io),this.texture=new en(s,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!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:et,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.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 ll(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 JA extends en{constructor(e=null,t=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=ft,this.minFilter=ft,this.wrapR=En,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class EX extends Nt{constructor(e=1,t=1,i=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new JA(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class hl extends en{constructor(e=null,t=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=ft,this.minFilter=ft,this.wrapR=En,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class kX extends Nt{constructor(e=1,t=1,i=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new hl(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class $1 extends Nt{constructor(e=1,t=1,i=1,s={}){super(e,t,s),this.isWebGLMultipleRenderTargets=!0;const r=this.texture;this.texture=[];for(let o=0;o=0?1:-1,f=1-A*A;if(f>Number.EPSILON){const S=Math.sqrt(f),x=Math.atan2(S,A*b);v=Math.sin(v*x)/S,a=Math.sin(a*x)/S}const B=a*b;if(l=l*v+d*B,c=c*v+h*B,u=u*v+m*B,C=C*v+y*B,v===1-a){const S=1/Math.sqrt(l*l+c*c+u*u+C*C);l*=S,c*=S,u*=S,C*=S}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=C}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],C=r[o],d=r[o+1],h=r[o+2],m=r[o+3];return e[t]=a*m+u*C+l*h-c*d,e[t+1]=l*m+u*d+c*C-a*h,e[t+2]=c*m+u*h+a*d-l*C,e[t+3]=u*m-a*C-l*d-c*h,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,s){return this._x=e,this._y=t,this._z=i,this._w=s,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,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(s/2),C=a(r/2),d=l(i/2),h=l(s/2),m=l(r/2);switch(o){case"XYZ":this._x=d*u*C+c*h*m,this._y=c*h*C-d*u*m,this._z=c*u*m+d*h*C,this._w=c*u*C-d*h*m;break;case"YXZ":this._x=d*u*C+c*h*m,this._y=c*h*C-d*u*m,this._z=c*u*m-d*h*C,this._w=c*u*C+d*h*m;break;case"ZXY":this._x=d*u*C-c*h*m,this._y=c*h*C+d*u*m,this._z=c*u*m+d*h*C,this._w=c*u*C-d*h*m;break;case"ZYX":this._x=d*u*C-c*h*m,this._y=c*h*C+d*u*m,this._z=c*u*m-d*h*C,this._w=c*u*C+d*h*m;break;case"YZX":this._x=d*u*C+c*h*m,this._y=c*h*C+d*u*m,this._z=c*u*m-d*h*C,this._w=c*u*C-d*h*m;break;case"XZY":this._x=d*u*C-c*h*m,this._y=c*h*C-d*u*m,this._z=c*u*m+d*h*C,this._w=c*u*C+d*h*m;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,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],C=t[10],d=i+a+C;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(r-c)*h,this._z=(o-s)*h}else if(i>a&&i>C){const h=2*Math.sqrt(1+i-a-C);this._w=(u-l)/h,this._x=.25*h,this._y=(s+o)/h,this._z=(r+c)/h}else if(a>C){const h=2*Math.sqrt(1+a-i-C);this._w=(r-c)/h,this._x=(s+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+C-i-a);this._w=(o-s)/h,this._x=(r+c)/h,this._y=(l+u)/h,this._z=.25*h}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(wn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),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,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+s*c-r*l,this._y=s*u+o*l+r*a-i*c,this._z=r*u+o*c+i*l-s*a,this._w=o*u-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*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=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-t;return this._w=h*o+t*this._w,this._x=h*i+t*this._x,this._y=h*s+t*this._y,this._z=h*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),C=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*C+this._w*d,this._x=i*C+this._x*d,this._y=s*C+this._y*d,this._z=r*C+this._z*d,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),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),i*Math.sin(r),i*Math.cos(r),t*Math.sin(s))}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 X{constructor(e=0,t=0,i=0){X.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(Y2.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Y2.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*s-a*i,u=l*i+a*t-r*s,C=l*s+r*i-o*t,d=-r*t-o*i-a*s;return this.x=c*l+d*-r+u*-a-C*-o,this.y=u*l+d*-o+C*-r-c*-a,this.z=C*l+d*-a+c*-o-u*-r,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,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,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,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*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 _m.copy(this).projectOnVector(e),this.sub(_m)}reflect(e){return this.sub(_m.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(wn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}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 s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*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(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,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 _m=new X,Y2=new bn;class Fr{constructor(e=new X(1/0,1/0,1/0),t=new X(-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,Jr),Jr.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(rI),vd.subVectors(this.max,rI),tg.subVectors(e.a,rI),ng.subVectors(e.b,rI),ig.subVectors(e.c,rI),Xo.subVectors(ng,tg),Yo.subVectors(ig,ng),Fa.subVectors(tg,ig);let t=[0,-Xo.z,Xo.y,0,-Yo.z,Yo.y,0,-Fa.z,Fa.y,Xo.z,0,-Xo.x,Yo.z,0,-Yo.x,Fa.z,0,-Fa.x,-Xo.y,Xo.x,0,-Yo.y,Yo.x,0,-Fa.y,Fa.x,0];return!Jm(t,tg,ng,ig,vd)||(t=[1,0,0,0,1,0,0,0,1],!Jm(t,tg,ng,ig,vd))?!1:(Gd.crossVectors(Xo,Yo),t=[Gd.x,Gd.y,Gd.z],Jm(t,tg,ng,ig,vd))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Jr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Jr).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:(_r[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_r[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_r[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_r[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_r[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_r[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_r[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_r[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_r),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 _r=[new X,new X,new X,new X,new X,new X,new X,new X],Jr=new X,eg=new Fr,tg=new X,ng=new X,ig=new X,Xo=new X,Yo=new X,Fa=new X,rI=new X,vd=new X,Gd=new X,Ka=new X;function Jm(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Ka.fromArray(n,r);const a=s.x*Math.abs(Ka.x)+s.y*Math.abs(Ka.y)+s.z*Math.abs(Ka.z),l=e.dot(Ka),c=t.dot(Ka),u=i.dot(Ka);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const DX=new Fr,oI=new X,Om=new X;class Kr{constructor(e=new X,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):DX.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;oI.subVectors(e,this.center);const t=oI.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(oI,s/i),this.radius+=s}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):(Om.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(oI.copy(e.center).add(Om)),this.expandByPoint(oI.copy(e.center).sub(Om))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Or=new X,Qm=new X,Bd=new X,Fo=new X,jm=new X,Zd=new X,qm=new X;let _u=class{constructor(e=new X,t=new X(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,Or)),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=Or.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Or.copy(this.origin).addScaledVector(this.direction,t),Or.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Qm.copy(e).add(t).multiplyScalar(.5),Bd.copy(t).sub(e).normalize(),Fo.copy(this.origin).sub(Qm);const r=e.distanceTo(t)*.5,o=-this.direction.dot(Bd),a=Fo.dot(this.direction),l=-Fo.dot(Bd),c=Fo.lengthSq(),u=Math.abs(1-o*o);let C,d,h,m;if(u>0)if(C=o*l-a,d=o*a-l,m=r*u,C>=0)if(d>=-m)if(d<=m){const y=1/u;C*=y,d*=y,h=C*(C+o*d+2*a)+d*(o*C+d+2*l)+c}else d=r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+c;else d=-r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+c;else d<=-m?(C=Math.max(0,-(-o*r+a)),d=C>0?-r:Math.min(Math.max(-r,-l),r),h=-C*C+d*(d+2*l)+c):d<=m?(C=0,d=Math.min(Math.max(-r,-l),r),h=d*(d+2*l)+c):(C=Math.max(0,-(o*r+a)),d=C>0?r:Math.min(Math.max(-r,-l),r),h=-C*C+d*(d+2*l)+c);else d=o>0?-r:r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,C),s&&s.copy(Qm).addScaledVector(Bd,d),h}intersectSphere(e,t){Or.subVectors(e.center,this.origin);const i=Or.dot(this.direction),s=Or.dot(Or)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),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,s,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,C=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,s=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,s=(e.min.x-d.x)*c),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-d.z)*C,l=(e.max.z-d.z)*C):(a=(e.max.z-d.z)*C,l=(e.min.z-d.z)*C),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,Or)!==null}intersectTriangle(e,t,i,s,r){jm.subVectors(t,e),Zd.subVectors(i,e),qm.crossVectors(jm,Zd);let o=this.direction.dot(qm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Fo.subVectors(this.origin,e);const l=a*this.direction.dot(Zd.crossVectors(Fo,Zd));if(l<0)return null;const c=a*this.direction.dot(jm.cross(Fo));if(c<0||l+c>o)return null;const u=-a*Fo.dot(qm);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};class Le{constructor(){Le.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,s,r,o,a,l,c,u,C,d,h,m,y,v){const A=this.elements;return A[0]=e,A[4]=t,A[8]=i,A[12]=s,A[1]=r,A[5]=o,A[9]=a,A[13]=l,A[2]=c,A[6]=u,A[10]=C,A[14]=d,A[3]=h,A[7]=m,A[11]=y,A[15]=v,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 Le().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,s=1/sg.setFromMatrixColumn(e,0).length(),r=1/sg.setFromMatrixColumn(e,1).length(),o=1/sg.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*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,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),C=Math.sin(r);if(e.order==="XYZ"){const d=o*u,h=o*C,m=a*u,y=a*C;t[0]=l*u,t[4]=-l*C,t[8]=c,t[1]=h+m*c,t[5]=d-y*c,t[9]=-a*l,t[2]=y-d*c,t[6]=m+h*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,h=l*C,m=c*u,y=c*C;t[0]=d+y*a,t[4]=m*a-h,t[8]=o*c,t[1]=o*C,t[5]=o*u,t[9]=-a,t[2]=h*a-m,t[6]=y+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,h=l*C,m=c*u,y=c*C;t[0]=d-y*a,t[4]=-o*C,t[8]=m+h*a,t[1]=h+m*a,t[5]=o*u,t[9]=y-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,h=o*C,m=a*u,y=a*C;t[0]=l*u,t[4]=m*c-h,t[8]=d*c+y,t[1]=l*C,t[5]=y*c+d,t[9]=h*c-m,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,h=o*c,m=a*l,y=a*c;t[0]=l*u,t[4]=y-d*C,t[8]=m*C+h,t[1]=C,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=h*C+m,t[10]=d-y*C}else if(e.order==="XZY"){const d=o*l,h=o*c,m=a*l,y=a*c;t[0]=l*u,t[4]=-C,t[8]=c*u,t[1]=d*C+y,t[5]=o*u,t[9]=h*C-m,t[2]=m*C-h,t[6]=a*u,t[10]=y*C+d}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(UX,e,PX)}lookAt(e,t,i){const s=this.elements;return as.subVectors(e,t),as.lengthSq()===0&&(as.z=1),as.normalize(),Ko.crossVectors(i,as),Ko.lengthSq()===0&&(Math.abs(i.z)===1?as.x+=1e-4:as.z+=1e-4,as.normalize(),Ko.crossVectors(i,as)),Ko.normalize(),wd.crossVectors(as,Ko),s[0]=Ko.x,s[4]=wd.x,s[8]=as.x,s[1]=Ko.y,s[5]=wd.y,s[9]=as.y,s[2]=Ko.z,s[6]=wd.z,s[10]=as.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],C=i[5],d=i[9],h=i[13],m=i[2],y=i[6],v=i[10],A=i[14],b=i[3],f=i[7],B=i[11],S=i[15],x=s[0],R=s[4],V=s[8],Z=s[12],M=s[1],H=s[5],U=s[9],D=s[13],q=s[2],ie=s[6],ue=s[10],le=s[14],L=s[3],P=s[7],O=s[11],ce=s[15];return r[0]=o*x+a*M+l*q+c*L,r[4]=o*R+a*H+l*ie+c*P,r[8]=o*V+a*U+l*ue+c*O,r[12]=o*Z+a*D+l*le+c*ce,r[1]=u*x+C*M+d*q+h*L,r[5]=u*R+C*H+d*ie+h*P,r[9]=u*V+C*U+d*ue+h*O,r[13]=u*Z+C*D+d*le+h*ce,r[2]=m*x+y*M+v*q+A*L,r[6]=m*R+y*H+v*ie+A*P,r[10]=m*V+y*U+v*ue+A*O,r[14]=m*Z+y*D+v*le+A*ce,r[3]=b*x+f*M+B*q+S*L,r[7]=b*R+f*H+B*ie+S*P,r[11]=b*V+f*U+B*ue+S*O,r[15]=b*Z+f*D+B*le+S*ce,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],C=e[6],d=e[10],h=e[14],m=e[3],y=e[7],v=e[11],A=e[15];return m*(+r*l*C-s*c*C-r*a*d+i*c*d+s*a*h-i*l*h)+y*(+t*l*h-t*c*d+r*o*d-s*o*h+s*c*u-r*l*u)+v*(+t*c*C-t*a*h-r*o*C+i*o*h+r*a*u-i*c*u)+A*(-s*a*u-t*l*C+t*a*d+s*o*C-i*o*d+i*l*u)}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 s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],C=e[9],d=e[10],h=e[11],m=e[12],y=e[13],v=e[14],A=e[15],b=C*v*c-y*d*c+y*l*h-a*v*h-C*l*A+a*d*A,f=m*d*c-u*v*c-m*l*h+o*v*h+u*l*A-o*d*A,B=u*y*c-m*C*c+m*a*h-o*y*h-u*a*A+o*C*A,S=m*C*l-u*y*l-m*a*d+o*y*d+u*a*v-o*C*v,x=t*b+i*f+s*B+r*S;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/x;return e[0]=b*R,e[1]=(y*d*r-C*v*r-y*s*h+i*v*h+C*s*A-i*d*A)*R,e[2]=(a*v*r-y*l*r+y*s*c-i*v*c-a*s*A+i*l*A)*R,e[3]=(C*l*r-a*d*r-C*s*c+i*d*c+a*s*h-i*l*h)*R,e[4]=f*R,e[5]=(u*v*r-m*d*r+m*s*h-t*v*h-u*s*A+t*d*A)*R,e[6]=(m*l*r-o*v*r-m*s*c+t*v*c+o*s*A-t*l*A)*R,e[7]=(o*d*r-u*l*r+u*s*c-t*d*c-o*s*h+t*l*h)*R,e[8]=B*R,e[9]=(m*C*r-u*y*r-m*i*h+t*y*h+u*i*A-t*C*A)*R,e[10]=(o*y*r-m*a*r+m*i*c-t*y*c-o*i*A+t*a*A)*R,e[11]=(u*a*r-o*C*r-u*i*c+t*C*c+o*i*h-t*a*h)*R,e[12]=S*R,e[13]=(u*y*s-m*C*s+m*i*d-t*y*d-u*i*v+t*C*v)*R,e[14]=(m*a*s-o*y*s-m*i*l+t*y*l+o*i*v-t*a*v)*R,e[15]=(o*C*s-u*a*s+u*i*l-t*C*l-o*i*d+t*a*d)*R,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}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),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,c=r*o,u=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,u*a+i,u*l-s*o,0,c*l-s*a,u*l+s*o,r*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,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,c=r+r,u=o+o,C=a+a,d=r*c,h=r*u,m=r*C,y=o*u,v=o*C,A=a*C,b=l*c,f=l*u,B=l*C,S=i.x,x=i.y,R=i.z;return s[0]=(1-(y+A))*S,s[1]=(h+B)*S,s[2]=(m-f)*S,s[3]=0,s[4]=(h-B)*x,s[5]=(1-(d+A))*x,s[6]=(v+b)*x,s[7]=0,s[8]=(m+f)*R,s[9]=(v-b)*R,s[10]=(1-(d+y))*R,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=sg.set(s[0],s[1],s[2]).length();const o=sg.set(s[4],s[5],s[6]).length(),a=sg.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],qs.copy(this);const c=1/r,u=1/o,C=1/a;return qs.elements[0]*=c,qs.elements[1]*=c,qs.elements[2]*=c,qs.elements[4]*=u,qs.elements[5]*=u,qs.elements[6]*=u,qs.elements[8]*=C,qs.elements[9]*=C,qs.elements[10]*=C,t.setFromRotationMatrix(qs),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o){const a=this.elements,l=2*r/(t-e),c=2*r/(i-s),u=(t+e)/(t-e),C=(i+s)/(i-s),d=-(o+r)/(o-r),h=-2*o*r/(o-r);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=C,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,s,r,o){const a=this.elements,l=1/(t-e),c=1/(i-s),u=1/(o-r),C=(t+e)*l,d=(i+s)*c,h=(o+r)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-C,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])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 sg=new X,qs=new Le,UX=new X(0,0,0),PX=new X(1,1,1),Ko=new X,wd=new X,as=new X,F2=new Le,K2=new bn;class Vl{constructor(e=0,t=0,i=0,s=Vl.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}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,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,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 s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],u=s[9],C=s[2],d=s[6],h=s[10];switch(t){case"XYZ":this._y=Math.asin(wn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-wn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-C,r),this._z=0);break;case"ZXY":this._x=Math.asin(wn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-C,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-wn(C,-1,1)),Math.abs(C)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(wn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-C,r)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-wn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,h),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 F2.makeRotationFromQuaternion(e),this.setFromRotationMatrix(F2,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return K2.setFromEuler(this),this.setFromQuaternion(K2,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}}Vl.DEFAULT_ORDER="XYZ";class Al{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(aI,e,JX),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(aI,OX,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,s=t.length;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON()));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(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 c=0,u=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),C.length>0&&(i.shapes=C),d.length>0&&(i.skeletons=d),h.length>0&&(i.animations=h),m.length>0&&(i.nodes=m)}return i.object=s,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}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.animations=e.animations,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){$s.subVectors(s,t),jr.subVectors(i,t),$m.subVectors(e,t);const o=$s.dot($s),a=$s.dot(jr),l=$s.dot($m),c=jr.dot(jr),u=jr.dot($m),C=o*c-a*a;if(C===0)return r.set(-2,-1,-1);const d=1/C,h=(c*l-a*u)*d,m=(o*u-a*l)*d;return r.set(1-h-m,m,h)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,qr),qr.x>=0&&qr.y>=0&&qr.x+qr.y<=1}static getUV(e,t,i,s,r,o,a,l){return xd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),xd=!0),this.getInterpolation(e,t,i,s,r,o,a,l)}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,qr),l.setScalar(0),l.addScaledVector(r,qr.x),l.addScaledVector(o,qr.y),l.addScaledVector(a,qr.z),l}static isFrontFacing(e,t,i,s){return $s.subVectors(i,t),jr.subVectors(e,t),$s.cross(jr).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),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 $s.subVectors(this.c,this.b),jr.subVectors(this.a,this.b),$s.cross(jr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ji.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ji.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,s,r){return xd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),xd=!0),Ji.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}getInterpolation(e,t,i,s,r){return Ji.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return Ji.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ji.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;og.subVectors(s,i),ag.subVectors(r,i),ef.subVectors(e,i);const l=og.dot(ef),c=ag.dot(ef);if(l<=0&&c<=0)return t.copy(i);tf.subVectors(e,s);const u=og.dot(tf),C=ag.dot(tf);if(u>=0&&C<=u)return t.copy(s);const d=l*C-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(og,o);nf.subVectors(e,r);const h=og.dot(nf),m=ag.dot(nf);if(m>=0&&h<=m)return t.copy(r);const y=h*c-l*m;if(y<=0&&c>=0&&m<=0)return a=c/(c-m),t.copy(i).addScaledVector(ag,a);const v=u*m-h*C;if(v<=0&&C-u>=0&&h-m>=0)return D2.subVectors(r,s),a=(C-u)/(C-u+(h-m)),t.copy(s).addScaledVector(D2,a);const A=1/(v+y+d);return o=y*A,a=d*A,t.copy(i).addScaledVector(og,o).addScaledVector(ag,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let jX=0;class Qn extends bs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:jX++}),this.uuid=hs(),this.name="",this.type="Material",this.blending=Cl,this.side=Xr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Hy,this.blendDst=Xy,this.blendEquation=qa,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=fu,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_1,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Lh,this.stencilZFail=Lh,this.stencilZPass=Lh,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 s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.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!==Cl&&(i.blending=this.blending),this.side!==Xr&&(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 s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),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 s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.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 eW={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},Rd={h:0,s:0,l:0};function sf(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 Ne{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=yt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ns.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=Ns.workingColorSpace){return this.r=e,this.g=t,this.b=i,Ns.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=Ns.workingColorSpace){if(e=_y(e,1),t=wn(t,0,1),i=wn(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=sf(o,r,e+1/3),this.g=sf(o,r,e),this.b=sf(o,r,e-1/3)}return Ns.toWorkingColorSpace(this,s),this}setStyle(e,t=yt){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,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=yt){const i=eW[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=qg(e.r),this.g=qg(e.g),this.b=qg(e.b),this}copyLinearToSRGB(e){return this.r=Um(e.r),this.g=Um(e.g),this.b=Um(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=yt){return Ns.fromWorkingColorSpace(bi.copy(this),e),Math.round(wn(bi.r*255,0,255))*65536+Math.round(wn(bi.g*255,0,255))*256+Math.round(wn(bi.b*255,0,255))}getHexString(e=yt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ns.workingColorSpace){Ns.fromWorkingColorSpace(bi.copy(this),t);const i=bi.r,s=bi.g,r=bi.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const C=o-a;switch(c=u<=.5?C/(o+a):C/(2-o-a),o){case i:l=(s-r)/C+(s>-c-14,i[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,r[l]=c|u}for(let l=1024;l<2048;++l)r[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:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function Di(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=wn(n,-65504,65504),io.floatView[0]=n;const e=io.uint32View[0],t=e>>23&511;return io.baseTable[t]+((e&8388607)>>io.shiftTable[t])}function VI(n){const e=n>>10;return io.uint32View[0]=io.mantissaTable[io.offsetTable[e]+(n&1023)]+io.exponentTable[e],io.floatView[0]}const $X={toHalfFloat:Di,fromHalfFloat:VI},Yn=new X,Wd=new ne;class Dt{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=Su,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 s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);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 c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let C=0,d=c.length;C0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,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 s=e.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(t))}const r=e.morphAttributes;for(const c in r){const u=[],C=r[c];for(let d=0,h=C.length;d0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(U2.copy(r).invert(),Br.copy(e.ray).applyMatrix4(U2),!(i.boundingBox!==null&&Br.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t)))}_computeIntersections(e,t){let i;const s=this.geometry,r=this.material,o=s.index,a=s.attributes.position,l=s.attributes.uv,c=s.attributes.uv1,u=s.attributes.normal,C=s.groups,d=s.drawRange;if(o!==null)if(Array.isArray(r))for(let h=0,m=C.length;ht.far?null:{distance:c,point:Fd.clone(),object:n}}function Kd(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,gg),n.getVertexPosition(l,cg),n.getVertexPosition(c,Ig);const u=lY(n,e,t,i,gg,cg,Ig,Yd);if(u){s&&(Nd.fromBufferAttribute(s,a),Hd.fromBufferAttribute(s,l),Xd.fromBufferAttribute(s,c),u.uv=Ji.getInterpolation(Yd,gg,cg,Ig,Nd,Hd,Xd,new ne)),r&&(Nd.fromBufferAttribute(r,a),Hd.fromBufferAttribute(r,l),Xd.fromBufferAttribute(r,c),u.uv1=Ji.getInterpolation(Yd,gg,cg,Ig,Nd,Hd,Xd,new ne),u.uv2=u.uv1),o&&(_2.fromBufferAttribute(o,a),J2.fromBufferAttribute(o,l),O2.fromBufferAttribute(o,c),u.normal=Ji.getInterpolation(Yd,gg,cg,Ig,_2,J2,O2,new X),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const C={a,b:l,c,normal:new X,materialIndex:0};Ji.getNormal(gg,cg,Ig,C.normal),u.face=C}return u}class Ga extends vt{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],C=[];let d=0,h=0;m("z","y","x",-1,-1,i,t,e,o,r,0),m("z","y","x",1,-1,i,t,-e,o,r,1),m("x","z","y",1,1,e,i,t,s,o,2),m("x","z","y",1,-1,e,i,-t,s,o,3),m("x","y","z",1,-1,e,t,i,s,r,4),m("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new _e(c,3)),this.setAttribute("normal",new _e(u,3)),this.setAttribute("uv",new _e(C,2));function m(y,v,A,b,f,B,S,x,R,V,Z){const M=B/R,H=S/V,U=B/2,D=S/2,q=x/2,ie=R+1,ue=V+1;let le=0,L=0;const P=new X;for(let O=0;O0?1:-1,u.push(P.x,P.y,P.z),C.push(ge/R),C.push(1-O/V),le+=1}}for(let O=0;O0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class vc extends Ft{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Le,this.projectionMatrix=new Le,this.projectionMatrixInverse=new Le}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 on extends vc{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,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=cc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(dl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return cc*2*Math.atan(Math.tan(dl*.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,s,r,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=s,this.view.width=r,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(dl*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,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 ug=-90,Cg=1;class jy extends Ft{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i;const s=new on(ug,Cg,e,t);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(1,0,0),this.add(s);const r=new on(ug,Cg,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);const o=new on(ug,Cg,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);const a=new on(ug,Cg,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const l=new on(ug,Cg,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);const c=new on(ug,Cg,e,t);c.layers=this.layers,c.up.set(0,1,0),c.lookAt(0,0,-1),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget,[s,r,o,a,l,c]=this.children,u=e.getRenderTarget(),C=e.toneMapping,d=e.xr.enabled;e.toneMapping=Ir,e.xr.enabled=!1;const h=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,s),e.setRenderTarget(i,1),e.render(t,r),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=h,e.setRenderTarget(i,5),e.render(t,c),e.setRenderTarget(u),e.toneMapping=C,e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}}class Ju extends en{constructor(e,t,i,s,r,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:Ca,super(e,t,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class OA extends Nt{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];t.encoding!==void 0&&(_I("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===zs?yt:Io),this.texture=new Ju(s,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:et}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 );
-
- }
- `},s=new Ga(5,5,5),r=new Rt({name:"CubemapFromEquirect",uniforms:Ic(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Dn,blending:sn});r.uniforms.tEquirect.value=t;const o=new Un(s,r),a=t.minFilter;return t.minFilter===ha&&(t.minFilter=et),new jy(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,s){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}const af=new X,uY=new X,CY=new Mt;class Uo{constructor(e=new X(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,s){return this.normal.set(e,t,i),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const s=af.subVectors(i,t).cross(uY.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,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(af),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||CY.getNormalMatrix(e),s=this.coplanarPoint(af).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const za=new Kr,zd=new X;class QA{constructor(e=new Uo,t=new Uo,i=new Uo,s=new Uo,r=new Uo,o=new Uo){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),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,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=i[6],C=i[7],d=i[8],h=i[9],m=i[10],y=i[11],v=i[12],A=i[13],b=i[14],f=i[15];return t[0].setComponents(a-s,C-l,y-d,f-v).normalize(),t[1].setComponents(a+s,C+l,y+d,f+v).normalize(),t[2].setComponents(a+r,C+c,y+h,f+A).normalize(),t[3].setComponents(a-r,C-c,y-h,f-A).normalize(),t[4].setComponents(a-o,C-u,y-m,f-b).normalize(),t[5].setComponents(a+o,C+u,y+m,f+b).normalize(),this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),za.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),za.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(za)}intersectsSprite(e){return za.center.set(0,0,0),za.radius=.7071067811865476,za.applyMatrix4(e.matrixWorld),this.intersectsSphere(za)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,zd.y=s.normal.y>0?e.max.y:e.min.y,zd.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(zd)<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 iW(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function dY(n,e){const t=e.isWebGL2,i=new WeakMap;function s(c,u){const C=c.array,d=c.usage,h=n.createBuffer();n.bindBuffer(u,h),n.bufferData(u,C,d),c.onUploadCallback();let m;if(C instanceof Float32Array)m=n.FLOAT;else if(C instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(t)m=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else m=n.UNSIGNED_SHORT;else if(C instanceof Int16Array)m=n.SHORT;else if(C instanceof Uint32Array)m=n.UNSIGNED_INT;else if(C instanceof Int32Array)m=n.INT;else if(C instanceof Int8Array)m=n.BYTE;else if(C instanceof Uint8Array)m=n.UNSIGNED_BYTE;else if(C instanceof Uint8ClampedArray)m=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+C);return{buffer:h,type:m,bytesPerElement:C.BYTES_PER_ELEMENT,version:c.version}}function r(c,u,C){const d=u.array,h=u.updateRange;n.bindBuffer(C,c),h.count===-1?n.bufferSubData(C,0,d):(t?n.bufferSubData(C,h.offset*d.BYTES_PER_ELEMENT,d,h.offset,h.count):n.bufferSubData(C,h.offset*d.BYTES_PER_ELEMENT,d.subarray(h.offset,h.offset+h.count)),h.count=-1),u.onUploadCallback()}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),i.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=i.get(c);u&&(n.deleteBuffer(u.buffer),i.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const d=i.get(c);(!d||d.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`,SY=`#if NUM_CLIPPING_PLANES > 0
- varying vec3 vClipPosition;
- uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
-#endif`,xY=`#if NUM_CLIPPING_PLANES > 0
- varying vec3 vClipPosition;
-#endif`,RY=`#if NUM_CLIPPING_PLANES > 0
- vClipPosition = - mvPosition.xyz;
-#endif`,WY=`#if defined( USE_COLOR_ALPHA )
- diffuseColor *= vColor;
-#elif defined( USE_COLOR )
- diffuseColor.rgb *= vColor;
-#endif`,VY=`#if defined( USE_COLOR_ALPHA )
- varying vec4 vColor;
-#elif defined( USE_COLOR )
- varying vec3 vColor;
-#endif`,MY=`#if defined( USE_COLOR_ALPHA )
- varying vec4 vColor;
-#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
- varying vec3 vColor;
-#endif`,NY=`#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`,HY=`#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`,XY=`#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`,YY=`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`,FY=`#ifdef USE_DISPLACEMENTMAP
- uniform sampler2D displacementMap;
- uniform float displacementScale;
- uniform float displacementBias;
-#endif`,KY=`#ifdef USE_DISPLACEMENTMAP
- transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
-#endif`,zY=`#ifdef USE_EMISSIVEMAP
- vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
- totalEmissiveRadiance *= emissiveColor.rgb;
-#endif`,LY=`#ifdef USE_EMISSIVEMAP
- uniform sampler2D emissiveMap;
-#endif`,TY="gl_FragColor = linearToOutputTexel( gl_FragColor );",EY=`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 );
-}`,kY=`#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`,DY=`#ifdef USE_ENVMAP
- uniform float envMapIntensity;
- uniform float flipEnvMap;
- #ifdef ENVMAP_TYPE_CUBE
- uniform samplerCube envMap;
- #else
- uniform sampler2D envMap;
- #endif
-
-#endif`,UY=`#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`,PY=`#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`,_Y=`#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`,JY=`#ifdef USE_FOG
- vFogDepth = - mvPosition.z;
-#endif`,OY=`#ifdef USE_FOG
- varying float vFogDepth;
-#endif`,QY=`#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`,jY=`#ifdef USE_FOG
- uniform vec3 fogColor;
- varying float vFogDepth;
- #ifdef FOG_EXP2
- uniform float fogDensity;
- #else
- uniform float fogNear;
- uniform float fogFar;
- #endif
-#endif`,qY=`#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
-}`,$Y=`#ifdef USE_LIGHTMAP
- vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
- vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
- reflectedLight.indirectDiffuse += lightMapIrradiance;
-#endif`,eF=`#ifdef USE_LIGHTMAP
- uniform sampler2D lightMap;
- uniform float lightMapIntensity;
-#endif`,tF=`LambertMaterial material;
-material.diffuseColor = diffuseColor.rgb;
-material.specularStrength = specularStrength;`,nF=`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`,iF=`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`,sF=`#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`,rF=`ToonMaterial material;
-material.diffuseColor = diffuseColor.rgb;`,oF=`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`,aF=`BlinnPhongMaterial material;
-material.diffuseColor = diffuseColor.rgb;
-material.specularColor = specular;
-material.specularShininess = shininess;
-material.specularStrength = specularStrength;`,lF=`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`,gF=`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`,cF=`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 );
-}`,IF=`
-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`,uF=`#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`,CF=`#if defined( RE_IndirectDiffuse )
- RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
-#endif
-#if defined( RE_IndirectSpecular )
- RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
-#endif`,dF=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
- gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
-#endif`,hF=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
- uniform float logDepthBufFC;
- varying float vFragDepth;
- varying float vIsPerspective;
-#endif`,AF=`#ifdef USE_LOGDEPTHBUF
- #ifdef USE_LOGDEPTHBUF_EXT
- varying float vFragDepth;
- varying float vIsPerspective;
- #else
- uniform float logDepthBufFC;
- #endif
-#endif`,pF=`#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`,mF=`#ifdef USE_MAP
- diffuseColor *= texture2D( map, vMapUv );
-#endif`,fF=`#ifdef USE_MAP
- uniform sampler2D map;
-#endif`,bF=`#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`,yF=`#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`,vF=`float metalnessFactor = metalness;
-#ifdef USE_METALNESSMAP
- vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
- metalnessFactor *= texelMetalness.b;
-#endif`,GF=`#ifdef USE_METALNESSMAP
- uniform sampler2D metalnessMap;
-#endif`,BF=`#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`,ZF=`#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`,wF=`#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`,SF=`#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`,xF=`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;`,RF=`#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`,WF=`#ifndef FLAT_SHADED
- varying vec3 vNormal;
- #ifdef USE_TANGENT
- varying vec3 vTangent;
- varying vec3 vBitangent;
- #endif
-#endif`,VF=`#ifndef FLAT_SHADED
- varying vec3 vNormal;
- #ifdef USE_TANGENT
- varying vec3 vTangent;
- varying vec3 vBitangent;
- #endif
-#endif`,MF=`#ifndef FLAT_SHADED
- vNormal = normalize( transformedNormal );
- #ifdef USE_TANGENT
- vTangent = normalize( transformedTangent );
- vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
- #endif
-#endif`,NF=`#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`,HF=`#ifdef USE_CLEARCOAT
- vec3 clearcoatNormal = geometryNormal;
-#endif`,XF=`#ifdef USE_CLEARCOAT_NORMALMAP
- vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
- clearcoatMapN.xy *= clearcoatNormalScale;
- clearcoatNormal = normalize( tbn2 * clearcoatMapN );
-#endif`,YF=`#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`,FF=`#ifdef USE_IRIDESCENCEMAP
- uniform sampler2D iridescenceMap;
-#endif
-#ifdef USE_IRIDESCENCE_THICKNESSMAP
- uniform sampler2D iridescenceThicknessMap;
-#endif`,KF=`#ifdef OPAQUE
-diffuseColor.a = 1.0;
-#endif
-#ifdef USE_TRANSMISSION
-diffuseColor.a *= material.transmissionAlpha + 0.1;
-#endif
-gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,zF=`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 );
-}`,LF=`#ifdef PREMULTIPLIED_ALPHA
- gl_FragColor.rgb *= gl_FragColor.a;
-#endif`,TF=`vec4 mvPosition = vec4( transformed, 1.0 );
-#ifdef USE_INSTANCING
- mvPosition = instanceMatrix * mvPosition;
-#endif
-mvPosition = modelViewMatrix * mvPosition;
-gl_Position = projectionMatrix * mvPosition;`,EF=`#ifdef DITHERING
- gl_FragColor.rgb = dithering( gl_FragColor.rgb );
-#endif`,kF=`#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`,DF=`float roughnessFactor = roughness;
-#ifdef USE_ROUGHNESSMAP
- vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
- roughnessFactor *= texelRoughness.g;
-#endif`,UF=`#ifdef USE_ROUGHNESSMAP
- uniform sampler2D roughnessMap;
-#endif`,PF=`#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`,_F=`#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`,JF=`#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`,OF=`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;
-}`,QF=`#ifdef USE_SKINNING
- mat4 boneMatX = getBoneMatrix( skinIndex.x );
- mat4 boneMatY = getBoneMatrix( skinIndex.y );
- mat4 boneMatZ = getBoneMatrix( skinIndex.z );
- mat4 boneMatW = getBoneMatrix( skinIndex.w );
-#endif`,jF=`#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`,qF=`#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`,$F=`#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`,e9=`float specularStrength;
-#ifdef USE_SPECULARMAP
- vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
- specularStrength = texelSpecular.r;
-#else
- specularStrength = 1.0;
-#endif`,t9=`#ifdef USE_SPECULARMAP
- uniform sampler2D specularMap;
-#endif`,n9=`#if defined( TONE_MAPPING )
- gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
-#endif`,i9=`#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; }`,s9=`#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`,r9=`#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 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`,o9=`#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`,a9=`#ifdef USE_UV
- 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_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`,l9=`#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`,g9=`#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 c9=`varying vec2 vUv;
-uniform mat3 uvTransform;
-void main() {
- vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
- gl_Position = vec4( position.xy, 1.0, 1.0 );
-}`,I9=`uniform sampler2D t2D;
-uniform float backgroundIntensity;
-varying vec2 vUv;
-void main() {
- vec4 texColor = texture2D( t2D, vUv );
- texColor.rgb *= backgroundIntensity;
- gl_FragColor = texColor;
- #include
- #include
-}`,u9=`varying vec3 vWorldDirection;
-#include
-void main() {
- vWorldDirection = transformDirection( position, modelMatrix );
- #include
- #include
- gl_Position.z = gl_Position.w;
-}`,C9=`#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
-}`,d9=`varying vec3 vWorldDirection;
-#include
-void main() {
- vWorldDirection = transformDirection( position, modelMatrix );
- #include
- #include
- gl_Position.z = gl_Position.w;
-}`,h9=`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
-}`,A9=`#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;
-}`,p9=`#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
-}`,m9=`#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;
-}`,f9=`#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 );
-}`,b9=`varying vec3 vWorldDirection;
-#include
-void main() {
- vWorldDirection = transformDirection( position, modelMatrix );
- #include
- #include
-}`,y9=`uniform sampler2D tEquirect;
-varying vec3 vWorldDirection;
-#include
-void main() {
- vec3 direction = normalize( vWorldDirection );
- vec2 sampleUV = equirectUv( direction );
- gl_FragColor = texture2D( tEquirect, sampleUV );
- #include
- #include
-}`,v9=`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
-}`,G9=`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
-}`,B9=`#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
-}`,Z9=`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
-}`,w9=`#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