vendor: 5,666 bytes, lines 1-9
1function z4(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function f_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bb={exports:{}},d_={},Pb={exports:{}},bt={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Cp=Symbol.for("react.element"),F4=Symbol.for("react.portal"),O4=Symbol.for("react.fragment"),U4=Symbol.for("react.strict_mode"),N4=Symbol.for("react.profiler"),k4=Symbol.for("react.provider"),H4=Symbol.for("react.context"),G4=Symbol.for("react.forward_ref"),V4=Symbol.for("react.suspense"),W4=Symbol.for("react.memo"),j4=Symbol.for("react.lazy"),fC=Symbol.iterator;function X4(n){return n===null||typeof n!="object"?null:(n=fC&&n[fC]||n["@@iterator"],typeof n=="function"?n:null)}var Bb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ib=Object.assign,Lb={};function Jh(n,e,t){this.props=n,this.context=e,this.refs=Lb,this.updater=t||Bb}Jh.prototype.isReactComponent={};Jh.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")};Jh.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Db(){}Db.prototype=Jh.prototype;function vM(n,e,t){this.props=n,this.context=e,this.refs=Lb,this.updater=t||Bb}var AM=vM.prototype=new Db;AM.constructor=vM;Ib(AM,Jh.prototype);AM.isPureReactComponent=!0;var dC=Array.isArray,zb=Object.prototype.hasOwnProperty,SM={current:null},Fb={key:!0,ref:!0,__self:!0,__source:!0};function Ob(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)zb.call(e,i)&&!Fb.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(n&&n.defaultProps)for(i in a=n.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:Cp,type:n,key:s,ref:o,props:r,_owner:SM.current}}function J4(n,e){return{$$typeof:Cp,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function MM(n){return typeof n=="object"&&n!==null&&n.$$typeof===Cp}function Y4(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var pC=/\/+/g;function Mv(n,e){return typeof n=="object"&&n!==null&&n.key!=null?Y4(""+n.key):e.toString(36)}function Pg(n,e,t,i,r){var s=typeof n;(s==="undefined"||s==="boolean")&&(n=null);var o=!1;if(n===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(n.$$typeof){case Cp:case F4:o=!0}}if(o)return o=n,r=r(o),n=i===""?"."+Mv(o,0):i,dC(r)?(t="",n!=null&&(t=n.replace(pC,"$&/")+"/"),Pg(r,e,t,"",function(c){return c})):r!=null&&(MM(r)&&(r=J4(r,t+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(pC,"$&/")+"/")+n)),e.push(r)),1;if(o=0,i=i===""?".":i+":",dC(n))for(var a=0;a<n.length;a++){s=n[a];var l=i+Mv(s,a);o+=Pg(s,e,t,l,r)}else if(l=X4(n),typeof l=="function")for(n=l.call(n),a=0;!(s=n.next()).done;)s=s.value,l=i+Mv(s,a++),o+=Pg(s,e,t,l,r);else if(s==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Km(n,e,t){if(n==null)return n;var i=[],r=0;return Pg(n,i,"","",function(s){return e.call(t,s,r++)}),i}function K4(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var Qi={current:null},Bg={transition:null},Q4={ReactCurrentDispatcher:Qi,ReactCurrentBatchConfig:Bg,ReactCurrentOwner:SM};function Ub(){throw Error("act(...) is not supported in production builds of React.")}bt.Children={map:Km,forEach:function(n,e,t){Km(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return Km(n,function(){e++}),e},toArray:function(n){return Km(n,function(e){return e})||[]},only:function(n){if(!MM(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};bt.Component=Jh;bt.Fragment=O4;bt.Profiler=N4;bt.PureComponent=vM;bt.StrictMode=U4;bt.Suspense=V4;
vendor: 5,094 bytes, lines 9-25
9bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q4;bt.act=Ub;bt.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var i=Ib({},n.props),r=n.key,s=n.ref,o=n._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=SM.current),e.key!==void 0&&(r=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(l in e)zb.call(e,l)&&!Fb.hasOwnProperty(l)&&(i[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)i.children=t;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];i.children=a}return{$$typeof:Cp,type:n.type,key:r,ref:s,props:i,_owner:o}};bt.createContext=function(n){return n={$$typeof:H4,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:k4,_context:n},n.Consumer=n};bt.createElement=Ob;bt.createFactory=function(n){var e=Ob.bind(null,n);return e.type=n,e};bt.createRef=function(){return{current:null}};bt.forwardRef=function(n){return{$$typeof:G4,render:n}};bt.isValidElement=MM;bt.lazy=function(n){return{$$typeof:j4,_payload:{_status:-1,_result:n},_init:K4}};bt.memo=function(n,e){return{$$typeof:W4,type:n,compare:e===void 0?null:e}};bt.startTransition=function(n){var e=Bg.transition;Bg.transition={};try{n()}finally{Bg.transition=e}};bt.unstable_act=Ub;bt.useCallback=function(n,e){return Qi.current.useCallback(n,e)};bt.useContext=function(n){return Qi.current.useContext(n)};bt.useDebugValue=function(){};bt.useDeferredValue=function(n){return Qi.current.useDeferredValue(n)};bt.useEffect=function(n,e){return Qi.current.useEffect(n,e)};bt.useId=function(){return Qi.current.useId()};bt.useImperativeHandle=function(n,e,t){return Qi.current.useImperativeHandle(n,e,t)};bt.useInsertionEffect=function(n,e){return Qi.current.useInsertionEffect(n,e)};bt.useLayoutEffect=function(n,e){return Qi.current.useLayoutEffect(n,e)};bt.useMemo=function(n,e){return Qi.current.useMemo(n,e)};bt.useReducer=function(n,e,t){return Qi.current.useReducer(n,e,t)};bt.useRef=function(n){return Qi.current.useRef(n)};bt.useState=function(n){return Qi.current.useState(n)};bt.useSyncExternalStore=function(n,e,t){return Qi.current.useSyncExternalStore(n,e,t)};bt.useTransition=function(){return Qi.current.useTransition()};bt.version="18.3.1";Pb.exports=bt;var H=Pb.exports;const _c=f_(H),Z4=z4({__proto__:null,default:_c},[H]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var q4=H,$4=Symbol.for("react.element"),eF=Symbol.for("react.fragment"),tF=Object.prototype.hasOwnProperty,nF=q4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,iF={key:!0,ref:!0,__self:!0,__source:!0};function Nb(n,e,t){var i,r={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(i in e)tF.call(e,i)&&!iF.hasOwnProperty(i)&&(r[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:$4,type:n,key:s,ref:o,props:r,_owner:nF.current}}d_.Fragment=eF;d_.jsx=Nb;d_.jsxs=Nb;bb.exports=d_;var F=bb.exports,bA={},kb={exports:{}},Hr={},Hb={exports:{}},Gb={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(n){function e(k,Q){var $=k.length;k.push(Q);e:for(;0<$;){var oe=$-1>>>1,xe=k[oe];if(0<r(xe,Q))k[oe]=Q,k[$]=xe,$=oe;else break e}}function t(k){return k.length===0?null:k[0]}function i(k){if(k.length===0)return null;var Q=k[0],$=k.pop();if($!==Q){k[0]=$;e:for(var oe=0,xe=k.length,De=xe>>>1;oe<De;){var ne=2*(oe+1)-1,fe=k[ne],Te=ne+1,Me=k[Te];if(0>r(fe,$))Te<xe&&0>r(Me,fe)?(k[oe]=Me,k[Te]=$,oe=Te):(k[oe]=fe,k[ne]=$,oe=ne);else if(Te<xe&&0>r(Me,$))k[oe]=Me,k[Te]=$,oe=Te;else break e}}return Q}function r(k,Q){var $=k.sortIndex-Q.sortIndex;return $!==0?$:k.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,p=3,m=!1,y=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(k){for(var Q=t(c);Q!==null;){if(Q.callback===null)i(c);else if(Q.startTime<=k)i(c),Q.sortIndex=Q.expirationTime,e(l,Q);else break;Q=t(c)}}function M(k){if(_=!1,S(k),!y)if(t(l)!==null)y=!0,J(w);else{var Q=t(c);Q!==null&&te(M,Q.startTime-k)}}function w(k,Q){y=!1,_&&(_=!1,g(B),B=-1),m=!0;var $=p;try{for(S(Q),d=t(l);d!==null&&(!(d.expirationTime>Q)||k&&!L());){var oe=d.callback;
vendor: 9,182 bytes, lines 25-34
25if(typeof oe=="function"){d.callback=null,p=d.priorityLevel;var xe=oe(d.expirationTime<=Q);Q=n.unstable_now(),typeof xe=="function"?d.callback=xe:d===t(l)&&i(l),S(Q)}else i(l);d=t(l)}if(d!==null)var De=!0;else{var ne=t(c);ne!==null&&te(M,ne.startTime-Q),De=!1}return De}finally{d=null,p=$,m=!1}}var T=!1,R=null,B=-1,b=5,P=-1;function L(){return!(n.unstable_now()-P<b)}function U(){if(R!==null){var k=n.unstable_now();P=k;var Q=!0;try{Q=R(!0,k)}finally{Q?G():(T=!1,R=null)}}else T=!1}var G;if(typeof v=="function")G=function(){v(U)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,X=j.port2;j.port1.onmessage=U,G=function(){X.postMessage(null)}}else G=function(){x(U,0)};function J(k){R=k,T||(T=!0,G())}function te(k,Q){B=x(function(){k(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_continueExecution=function(){y||m||(y=!0,J(w))},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(k){switch(p){case 1:case 2:case 3:var Q=3;break;default:Q=p}var $=p;p=Q;try{return k()}finally{p=$}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(k,Q){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var $=p;p=k;try{return Q()}finally{p=$}},n.unstable_scheduleCallback=function(k,Q,$){var oe=n.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?oe+$:oe):$=oe,k){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=$+xe,k={id:u++,callback:Q,priorityLevel:k,startTime:$,expirationTime:xe,sortIndex:-1},$>oe?(k.sortIndex=$,e(c,k),t(l)===null&&k===t(c)&&(_?(g(B),B=-1):_=!0,te(M,$-oe))):(k.sortIndex=xe,e(l,k),y||m||(y=!0,J(w))),k},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(k){var Q=p;return function(){var $=p;p=Q;try{return k.apply(this,arguments)}finally{p=$}}}})(Gb);Hb.exports=Gb;var rF=Hb.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var sF=H,Or=rF;function Se(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Vb=new Set,Nd={};function Dc(n,e){Th(n,e),Th(n+"Capture",e)}function Th(n,e){for(Nd[n]=e,n=0;n<e.length;n++)Vb.add(e[n])}var Xo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),PA=Object.prototype.hasOwnProperty,oF=/^[: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]*$/,mC={},gC={};function aF(n){return PA.call(gC,n)?!0:PA.call(mC,n)?!1:oF.test(n)?gC[n]=!0:(mC[n]=!0,!1)}function lF(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 cF(n,e,t,i){if(e===null||typeof e>"u"||lF(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 Zi(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Mi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Mi[n]=new Zi(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Mi[e]=new Zi(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Mi[n]=new Zi(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Mi[n]=new Zi(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){Mi[n]=new Zi(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Mi[n]=new Zi(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Mi[n]=new Zi(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Mi[n]=new Zi(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Mi[n]=new Zi(n,5,!1,n.toLowerCase(),null,!1,!1)});var EM=/[\-:]([a-z])/g;function wM(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(EM,wM);Mi[e]=new Zi(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(EM,wM);Mi[e]=new Zi(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(EM,wM);Mi[e]=new Zi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Mi[n]=new Zi(n,1,!1,n.toLowerCase(),null,!1,!1)});Mi.xlinkHref=new Zi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Mi[n]=new Zi(n,1,!1,n.toLowerCase(),null,!0,!0)});function TM(n,e,t,i){var r=Mi.hasOwnProperty(e)?Mi[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(cF(e,t,r,i)&&(t=null),i||r===null?aF(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):r.mustUseProperty?n[r.propertyName]=t===null?r.type===3?!1:"":t:(e=r.attributeName,i=r.attributeNamespace,t===null?n.removeAttribute(e):(r=r.type,t=r===3||r===4&&t===!0?"":""+t,i?n.setAttributeNS(i,e,t):n.setAttribute(e,t))))}var na=sF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Qm=Symbol.for("react.element"),Yu=Symbol.for("react.portal"),Ku=Symbol.for("react.fragment"),CM=Symbol.for("react.strict_mode"),BA=Symbol.for("react.profiler"),Wb=Symbol.for("react.provider"),jb=Symbol.for("react.context"),RM=Symbol.for("react.forward_ref"),IA=Symbol.for("react.suspense"),LA=Symbol.for("react.suspense_list"),bM=Symbol.for("react.memo"),Ra=Symbol.for("react.lazy"),Xb=Symbol.for("react.offscreen"),yC=Symbol.iterator;function Ef(n){return n===null||typeof n!="object"?null:(n=yC&&n[yC]||n["@@iterator"],typeof n=="function"?n:null)}var wn=Object.assign,Ev;function ad(n){if(Ev===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);Ev=e&&e[1]||""}return` 34`+Ev+n}var wv=!1;function Tv(n,e){if(!n||wv)return"";wv=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var i=c}Reflect.construct(n,[],e)}else{try{e.call()}catch(c){i=c}n.call(e.prototype)}else{try{throw Error()}catch(c){i=c}n()}}
vendor: 18,193 bytes, lines 34-37
34catch(c){if(c&&i&&typeof c.stack=="string"){for(var r=c.stack.split(` 35`),s=i.stack.split(` 36`),o=r.length-1,a=s.length-1;1<=o&&0<=a&&r[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(r[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||r[o]!==s[a]){var l=` 37`+r[o].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{wv=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?ad(n):""}function uF(n){switch(n.tag){case 5:return ad(n.type);case 16:return ad("Lazy");case 13:return ad("Suspense");case 19:return ad("SuspenseList");case 0:case 2:case 15:return n=Tv(n.type,!1),n;case 11:return n=Tv(n.type.render,!1),n;case 1:return n=Tv(n.type,!0),n;default:return""}}function DA(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 Ku:return"Fragment";case Yu:return"Portal";case BA:return"Profiler";case CM:return"StrictMode";case IA:return"Suspense";case LA:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case jb:return(n.displayName||"Context")+".Consumer";case Wb:return(n._context.displayName||"Context")+".Provider";case RM:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case bM:return e=n.displayName||null,e!==null?e:DA(n.type)||"Memo";case Ra:e=n._payload,n=n._init;try{return DA(n(e))}catch{}}return null}function hF(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 DA(e);case 8:return e===CM?"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 $a(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Jb(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function fF(n){var e=Jb(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Zm(n){n._valueTracker||(n._valueTracker=fF(n))}function Yb(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=Jb(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function Kg(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 zA(n,e){var t=e.checked;return wn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function _C(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=$a(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 Kb(n,e){e=e.checked,e!=null&&TM(n,"checked",e,!1)}function FA(n,e){Kb(n,e);var t=$a(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")?OA(n,e.type,t):e.hasOwnProperty("defaultValue")&&OA(n,e.type,$a(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function xC(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 OA(n,e,t){(e!=="number"||Kg(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var ld=Array.isArray;function ph(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r<t.length;r++)e["$"+t[r]]=!0;for(t=0;t<n.length;t++)r=e.hasOwnProperty("$"+n[t].value),n[t].selected!==r&&(n[t].selected=r),r&&i&&(n[t].defaultSelected=!0)}else{for(t=""+$a(t),e=null,r=0;r<n.length;r++){if(n[r].value===t){n[r].selected=!0,i&&(n[r].defaultSelected=!0);return}e!==null||n[r].disabled||(e=n[r])}e!==null&&(e.selected=!0)}}function UA(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Se(91));return wn({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function vC(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Se(92));if(ld(t)){if(1<t.length)throw Error(Se(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:$a(t)}}function Qb(n,e){var t=$a(e.value),i=$a(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),i!=null&&(n.defaultValue=""+i)}function AC(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function Zb(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function NA(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?Zb(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var qm,qb=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,i,r){MSApp.execUnsafeLocalFunction(function(){return n(e,t,i,r)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(qm=qm||document.createElement("div"),qm.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=qm.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function kd(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var gd={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},dF=["Webkit","ms","Moz","O"];Object.keys(gd).forEach(function(n){dF.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),gd[e]=gd[n]})});function $b(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||gd.hasOwnProperty(n)&&gd[n]?(""+e).trim():e+"px"}function eP(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=$b(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var pF=wn({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 kA(n,e){if(e){if(pF[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Se(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Se(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Se(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Se(62))}}function HA(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 GA=null;function PM(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var VA=null,mh=null,gh=null;function SC(n){if(n=Pp(n)){if(typeof VA!="function")throw Error(Se(280));var e=n.stateNode;e&&(e=__(e),VA(n.stateNode,n.type,e))}}function tP(n){mh?gh?gh.push(n):gh=[n]:mh=n}function nP(){if(mh){var n=mh,e=gh;if(gh=mh=null,SC(n),e)for(n=0;n<e.length;n++)SC(e[n])}}function iP(n,e){return n(e)}function rP(){}var Cv=!1;function sP(n,e,t){if(Cv)return n(e,t);Cv=!0;try{return iP(n,e,t)}finally{Cv=!1,(mh!==null||gh!==null)&&(rP(),nP())}}function Hd(n,e){var t=n.stateNode;if(t===null)return null;var i=__(t);if(i===null)return null;t=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(n=n.type,i=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!i;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(Se(231,e,typeof t));return t}var WA=!1;if(Xo)try{var wf={};Object.defineProperty(wf,"passive",{get:function(){WA=!0}}),window.addEventListener("test",wf,wf),window.removeEventListener("test",wf,wf)}catch{WA=!1}function mF(n,e,t,i,r,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(t,c)}catch(u){this.onError(u)}}var yd=!1,Qg=null,Zg=!1,jA=null,gF={onError:function(n){yd=!0,Qg=n}};function yF(n,e,t,i,r,s,o,a,l){yd=!1,Qg=null,mF.apply(gF,arguments)}function _F(n,e,t,i,r,s,o,a,l){if(yF.apply(this,arguments),yd){if(yd){var c=Qg;yd=!1,Qg=null}else throw Error(Se(198));Zg||(Zg=!0,jA=c)}}function zc(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function oP(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function MC(n){if(zc(n)!==n)throw Error(Se(188))}function xF(n){var e=n.alternate;if(!e){if(e=zc(n),e===null)throw Error(Se(188));return e!==n?null:n}for(var t=n,i=e;;){var r=t.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){t=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===t)return MC(r),n;if(s===i)return MC(r),e;s=s.sibling}throw Error(Se(188))}if(t.return!==i.return)t=r,i=s;else{for(var o=!1,a=r.child;a;){if(a===t){o=!0,t=r,i=s;break}if(a===i){o=!0,i=r,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,i=r;break}if(a===i){o=!0,i=s,t=r;break}a=a.sibling}if(!o)throw Error(Se(189))}}if(t.alternate!==i)throw Error(Se(190))}if(t.tag!==3)throw Error(Se(188));return t.stateNode.current===t?n:e}function aP(n){return n=xF(n),n!==null?lP(n):null}function lP(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=lP(n);if(e!==null)return e;n=n.sibling}return null}var cP=Or.unstable_scheduleCallback,EC=Or.unstable_cancelCallback,vF=Or.unstable_shouldYield,AF=Or.unstable_requestPaint,On=Or.unstable_now,SF=Or.unstable_getCurrentPriorityLevel,BM=Or.unstable_ImmediatePriority,uP=Or.unstable_UserBlockingPriority,qg=Or.unstable_NormalPriority,MF=Or.unstable_LowPriority,hP=Or.unstable_IdlePriority,p_=null,lo=null;function EF(n){if(lo&&typeof lo.onCommitFiberRoot=="function")try{lo.onCommitFiberRoot(p_,n,void 0,(n.current.flags&128)===128)}catch{}}var Os=Math.clz32?Math.clz32:CF,wF=Math.log,TF=Math.LN2;function CF(n){return n>>>=0,n===0?32:31-(wF(n)/TF|0)|0}var $m=64,e0=4194304;function cd(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 $g(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=cd(a):(s&=o,s!==0&&(i=cd(s)))}else o=t&~r,o!==0?i=cd(o):s!==0&&(i=cd(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0<e;)t=31-Os(e),r=1<<t,i|=n[t],e&=~r;return i}function RF(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bF(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,r=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-Os(s),a=1<<o,l=r[o];l===-1?(!(a&t)||a&i)&&(r[o]=RF(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function XA(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function fP(){var n=$m;return $m<<=1,!($m&4194240)&&($m=64),n}function Rv(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function Rp(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Os(e),n[e]=t}function PF(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<t;){var r=31-Os(t),s=1<<r;e[r]=0,i[r]=-1,n[r]=-1,t&=~s}}function IM(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var i=31-Os(t),r=1<<i;r&e|n[i]&e&&(n[i]|=e),t&=~r}}var Jt=0;function dP(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var pP,LM,mP,gP,yP,JA=!1,t0=[],Ha=null,Ga=null,Va=null,Gd=new Map,Vd=new Map,Ba=[],BF="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function wC(n,e){switch(n){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Va=null;break;case"pointerover":case"pointerout":Gd.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vd.delete(e.pointerId)}}function Tf(n,e,t,i,r,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=Pp(e),e!==null&&LM(e)),n):(n.eventSystemFlags|=i,e=n.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),n)}function IF(n,e,t,i,r){switch(e){case"focusin":return Ha=Tf(Ha,n,e,t,i,r),!0;case"dragenter":return Ga=Tf(Ga,n,e,t,i,r),!0;case"mouseover":return Va=Tf(Va,n,e,t,i,r),!0;case"pointerover":var s=r.pointerId;return Gd.set(s,Tf(Gd.get(s)||null,n,e,t,i,r)),!0;case"gotpointercapture":return s=r.pointerId,Vd.set(s,Tf(Vd.get(s)||null,n,e,t,i,r)),!0}return!1}function _P(n){var e=Ql(n.target);if(e!==null){var t=zc(e);if(t!==null){if(e=t.tag,e===13){if(e=oP(t),e!==null){n.blockedOn=e,yP(n.priority,function(){mP(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Ig(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=YA(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var i=new t.constructor(t.type,t);GA=i,t.target.dispatchEvent(i),GA=null}else return e=Pp(t),e!==null&&LM(e),n.blockedOn=t,!1;e.shift()}return!0}function TC(n,e,t){Ig(n)&&t.delete(e)}function LF(){JA=!1,Ha!==null&&Ig(Ha)&&(Ha=null),Ga!==null&&Ig(Ga)&&(Ga=null),Va!==null&&Ig(Va)&&(Va=null),Gd.forEach(TC),Vd.forEach(TC)}function Cf(n,e){n.blockedOn===e&&(n.blockedOn=null,JA||(JA=!0,Or.unstable_scheduleCallback(Or.unstable_NormalPriority,LF)))}function Wd(n){function e(r){return Cf(r,n)}if(0<t0.length){Cf(t0[0],n);for(var t=1;t<t0.length;t++){var i=t0[t];i.blockedOn===n&&(i.blockedOn=null)}}for(Ha!==null&&Cf(Ha,n),Ga!==null&&Cf(Ga,n),Va!==null&&Cf(Va,n),Gd.forEach(e),Vd.forEach(e),t=0;t<Ba.length;t++)i=Ba[t],i.blockedOn===n&&(i.blockedOn=null);for(;0<Ba.length&&(t=Ba[0],t.blockedOn===null);)_P(t),t.blockedOn===null&&Ba.shift()}var yh=na.ReactCurrentBatchConfig,ey=!0;function DF(n,e,t,i){var r=Jt,s=yh.transition;yh.transition=null;try{Jt=1,DM(n,e,t,i)}finally{Jt=r,yh.transition=s}}function zF(n,e,t,i){var r=Jt,s=yh.transition;yh.transition=null;try{Jt=4,DM(n,e,t,i)}finally{Jt=r,yh.transition=s}}function DM(n,e,t,i){if(ey){var r=YA(n,e,t,i);if(r===null)Uv(n,e,i,ty,t),wC(n,i);else if(IF(r,n,e,t,i))i.stopPropagation();else if(wC(n,i),e&4&&-1<BF.indexOf(n)){for(;r!==null;){var s=Pp(r);if(s!==null&&pP(s),s=YA(n,e,t,i),s===null&&Uv(n,e,i,ty,t),s===r)break;r=s}r!==null&&i.stopPropagation()}else Uv(n,e,i,null,t)}}var ty=null;function YA(n,e,t,i){if(ty=null,n=PM(i),n=Ql(n),n!==null)if(e=zc(n),e===null)n=null;else if(t=e.tag,t===13){if(n=oP(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return ty=n,null}
vendor: 10,401 bytes, line 37
37function xP(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(SF()){case BM:return 1;case uP:return 4;case qg:case MF:return 16;case hP:return 536870912;default:return 16}default:return 16}}var Da=null,zM=null,Lg=null;function vP(){if(Lg)return Lg;var n,e=zM,t=e.length,i,r="value"in Da?Da.value:Da.textContent,s=r.length;for(n=0;n<t&&e[n]===r[n];n++);var o=t-n;for(i=1;i<=o&&e[t-i]===r[s-i];i++);return Lg=r.slice(n,1<i?1-i:void 0)}function Dg(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function n0(){return!0}function CC(){return!1}function Gr(n){function e(t,i,r,s,o){this._reactName=t,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?n0:CC,this.isPropagationStopped=CC,this}return wn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=n0)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=n0)},persist:function(){},isPersistent:n0}),e}var Yh={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},FM=Gr(Yh),bp=wn({},Yh,{view:0,detail:0}),FF=Gr(bp),bv,Pv,Rf,m_=wn({},bp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:OM,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Rf&&(Rf&&n.type==="mousemove"?(bv=n.screenX-Rf.screenX,Pv=n.screenY-Rf.screenY):Pv=bv=0,Rf=n),bv)},movementY:function(n){return"movementY"in n?n.movementY:Pv}}),RC=Gr(m_),OF=wn({},m_,{dataTransfer:0}),UF=Gr(OF),NF=wn({},bp,{relatedTarget:0}),Bv=Gr(NF),kF=wn({},Yh,{animationName:0,elapsedTime:0,pseudoElement:0}),HF=Gr(kF),GF=wn({},Yh,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),VF=Gr(GF),WF=wn({},Yh,{data:0}),bC=Gr(WF),jF={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XF={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},JF={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YF(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=JF[n])?!!e[n]:!1}function OM(){return YF}var KF=wn({},bp,{key:function(n){if(n.key){var e=jF[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Dg(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?XF[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:OM,charCode:function(n){return n.type==="keypress"?Dg(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Dg(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),QF=Gr(KF),ZF=wn({},m_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),PC=Gr(ZF),qF=wn({},bp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:OM}),$F=Gr(qF),eO=wn({},Yh,{propertyName:0,elapsedTime:0,pseudoElement:0}),tO=Gr(eO),nO=wn({},m_,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),iO=Gr(nO),rO=[9,13,27,32],UM=Xo&&"CompositionEvent"in window,_d=null;Xo&&"documentMode"in document&&(_d=document.documentMode);var sO=Xo&&"TextEvent"in window&&!_d,AP=Xo&&(!UM||_d&&8<_d&&11>=_d),BC=" ",IC=!1;function SP(n,e){switch(n){case"keyup":return rO.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function MP(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Qu=!1;function oO(n,e){switch(n){case"compositionend":return MP(e);case"keypress":return e.which!==32?null:(IC=!0,BC);case"textInput":return n=e.data,n===BC&&IC?null:n;default:return null}}function aO(n,e){if(Qu)return n==="compositionend"||!UM&&SP(n,e)?(n=vP(),Lg=zM=Da=null,Qu=!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.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return AP&&e.locale!=="ko"?null:e.data;default:return null}}var lO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function LC(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!lO[n.type]:e==="textarea"}function EP(n,e,t,i){tP(i),e=ny(e,"onChange"),0<e.length&&(t=new FM("onChange","change",null,t,i),n.push({event:t,listeners:e}))}var xd=null,jd=null;function cO(n){zP(n,0)}function g_(n){var e=$u(n);if(Yb(e))return n}function uO(n,e){if(n==="change")return e}var wP=!1;if(Xo){var Iv;if(Xo){var Lv="oninput"in document;if(!Lv){var DC=document.createElement("div");DC.setAttribute("oninput","return;"),Lv=typeof DC.oninput=="function"}Iv=Lv}else Iv=!1;wP=Iv&&(!document.documentMode||9<document.documentMode)}function zC(){xd&&(xd.detachEvent("onpropertychange",TP),jd=xd=null)}function TP(n){if(n.propertyName==="value"&&g_(jd)){var e=[];EP(e,jd,n,PM(n)),sP(cO,e)}}function hO(n,e,t){n==="focusin"?(zC(),xd=e,jd=t,xd.attachEvent("onpropertychange",TP)):n==="focusout"&&zC()}function fO(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return g_(jd)}function dO(n,e){if(n==="click")return g_(e)}function pO(n,e){if(n==="input"||n==="change")return g_(e)}function mO(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Ns=typeof Object.is=="function"?Object.is:mO;function Xd(n,e){if(Ns(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(i=0;i<t.length;i++){var r=t[i];if(!PA.call(e,r)||!Ns(n[r],e[r]))return!1}return!0}function FC(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function OC(n,e){var t=FC(n);n=0;for(var i;t;){if(t.nodeType===3){if(i=n+t.textContent.length,n<=e&&i>=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=FC(t)}}function CP(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?CP(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function RP(){for(var n=window,e=Kg();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=Kg(n.document)}return e}function NM(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 gO(n){var e=RP(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&CP(t.ownerDocument.documentElement,t)){if(i!==null&&NM(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=OC(t,s);var o=OC(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var yO=Xo&&"documentMode"in document&&11>=document.documentMode,Zu=null,KA=null,vd=null,QA=!1;function UC(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;QA||Zu==null||Zu!==Kg(i)||(i=Zu,"selectionStart"in i&&NM(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:i.focusNode,focusOffset:i.focusOffset}),vd&&Xd(vd,i)||(vd=i,i=ny(KA,"onSelect"),0<i.length&&(e=new FM("onSelect","select",null,e,t),n.push({event:e,listeners:i}),e.target=Zu)))}function i0(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var qu={animationend:i0("Animation","AnimationEnd"),animationiteration:i0("Animation","AnimationIteration"),animationstart:i0("Animation","AnimationStart"),transitionend:i0("Transition","TransitionEnd")},Dv={},bP={};Xo&&(bP=document.createElement("div").style,"AnimationEvent"in window||(delete qu.animationend.animation,delete qu.animationiteration.animation,delete qu.animationstart.animation),"TransitionEvent"in window||delete qu.transitionend.transition);function y_(n){if(Dv[n])return Dv[n];if(!qu[n])return n;var e=qu[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in bP)return Dv[n]=e[t];return n}var PP=y_("animationend"),BP=y_("animationiteration"),IP=y_("animationstart"),LP=y_("transitionend"),DP=new Map,NC="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function al(n,e){DP.set(n,e),Dc(e,[n])}for(var zv=0;zv<NC.length;zv++){var Fv=NC[zv],_O=Fv.toLowerCase(),xO=Fv[0].toUpperCase()+Fv.slice(1);al(_O,"on"+xO)}al(PP,"onAnimationEnd");al(BP,"onAnimationIteration");al(IP,"onAnimationStart");al("dblclick","onDoubleClick");al("focusin","onFocus");al("focusout","onBlur");al(LP,"onTransitionEnd");Th("onMouseEnter",["mouseout","mouseover"]);Th("onMouseLeave",["mouseout","mouseover"]);Th("onPointerEnter",["pointerout","pointerover"]);Th("onPointerLeave",["pointerout","pointerover"]);Dc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Dc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Dc("onBeforeInput",["compositionend","keypress","textInput","paste"]);Dc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Dc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Dc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ud="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vO=new Set("cancel close invalid load scroll toggle".split(" ").concat(ud));function kC(n,e,t){var i=n.type||"unknown-event";n.currentTarget=t,_F(i,e,void 0,n),n.currentTarget=null}function zP(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var i=n[t],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var a=i[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&r.isPropagationStopped())break e;kC(r,a,c),s=l}else for(o=0;o<i.length;o++){if(a=i[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&r.isPropagationStopped())break e;kC(r,a,c),s=l}}}if(Zg)throw n=jA,Zg=!1,jA=null,n}function cn(n,e){var t=e[tS];t===void 0&&(t=e[tS]=new Set);var i=n+"__bubble";t.has(i)||(FP(e,n,2,!1),t.add(i))}function Ov(n,e,t){var i=0;e&&(i|=4),FP(t,n,i,e)}var r0="_reactListening"+Math.random().toString(36).slice(2);function Jd(n){if(!n[r0]){n[r0]=!0,Vb.forEach(function(t){t!=="selectionchange"&&(vO.has(t)||Ov(t,!1,n),Ov(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[r0]||(e[r0]=!0,Ov("selectionchange",!1,e))}}function FP(n,e,t,i){switch(xP(e)){case 1:var r=DF;break;case 4:r=zF;break;default:r=DM}t=r.bind(null,e,t,n),r=void 0,!WA||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?n.addEventListener(e,t,{capture:!0,passive:r}):n.addEventListener(e,t,!0):r!==void 0?n.addEventListener(e,t,{passive:r}):n.addEventListener(e,t,!1)}function Uv(n,e,t,i,r){var s=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var a=i.stateNode.containerInfo;
vendor: 5,427 bytes, lines 37-38
37if(a===r||a.nodeType===8&&a.parentNode===r)break;if(o===4)for(o=i.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;o=o.return}for(;a!==null;){if(o=Ql(a),o===null)return;if(l=o.tag,l===5||l===6){i=s=o;continue e}a=a.parentNode}}i=i.return}sP(function(){var c=s,u=PM(t),d=[];e:{var p=DP.get(n);if(p!==void 0){var m=FM,y=n;switch(n){case"keypress":if(Dg(t)===0)break e;case"keydown":case"keyup":m=QF;break;case"focusin":y="focus",m=Bv;break;case"focusout":y="blur",m=Bv;break;case"beforeblur":case"afterblur":m=Bv;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=RC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=UF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=$F;break;case PP:case BP:case IP:m=HF;break;case LP:m=tO;break;case"scroll":m=FF;break;case"wheel":m=iO;break;case"copy":case"cut":case"paste":m=VF;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=PC}var _=(e&4)!==0,x=!_&&n==="scroll",g=_?p!==null?p+"Capture":null:p;_=[];for(var v=c,S;v!==null;){S=v;var M=S.stateNode;if(S.tag===5&&M!==null&&(S=M,g!==null&&(M=Hd(v,g),M!=null&&_.push(Yd(v,M,S)))),x)break;v=v.return}0<_.length&&(p=new m(p,y,null,t,u),d.push({event:p,listeners:_}))}}if(!(e&7)){e:{if(p=n==="mouseover"||n==="pointerover",m=n==="mouseout"||n==="pointerout",p&&t!==GA&&(y=t.relatedTarget||t.fromElement)&&(Ql(y)||y[Jo]))break e;if((m||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=t.relatedTarget||t.toElement,m=c,y=y?Ql(y):null,y!==null&&(x=zc(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=c),m!==y)){if(_=RC,M="onMouseLeave",g="onMouseEnter",v="mouse",(n==="pointerout"||n==="pointerover")&&(_=PC,M="onPointerLeave",g="onPointerEnter",v="pointer"),x=m==null?p:$u(m),S=y==null?p:$u(y),p=new _(M,v+"leave",m,t,u),p.target=x,p.relatedTarget=S,M=null,Ql(u)===c&&(_=new _(g,v+"enter",y,t,u),_.target=S,_.relatedTarget=x,M=_),x=M,m&&y)t:{for(_=m,g=y,v=0,S=_;S;S=au(S))v++;for(S=0,M=g;M;M=au(M))S++;for(;0<v-S;)_=au(_),v--;for(;0<S-v;)g=au(g),S--;for(;v--;){if(_===g||g!==null&&_===g.alternate)break t;_=au(_),g=au(g)}_=null}else _=null;m!==null&&HC(d,p,m,_,!1),y!==null&&x!==null&&HC(d,x,y,_,!0)}}e:{if(p=c?$u(c):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var w=uO;else if(LC(p))if(wP)w=pO;else{w=fO;var T=hO}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=dO);if(w&&(w=w(n,c))){EP(d,w,t,u);break e}T&&T(n,p,c),n==="focusout"&&(T=p._wrapperState)&&T.controlled&&p.type==="number"&&OA(p,"number",p.value)}switch(T=c?$u(c):window,n){case"focusin":(LC(T)||T.contentEditable==="true")&&(Zu=T,KA=c,vd=null);break;case"focusout":vd=KA=Zu=null;break;case"mousedown":QA=!0;break;case"contextmenu":case"mouseup":case"dragend":QA=!1,UC(d,t,u);break;case"selectionchange":if(yO)break;case"keydown":case"keyup":UC(d,t,u)}var R;if(UM)e:{switch(n){case"compositionstart":var B="onCompositionStart";break e;case"compositionend":B="onCompositionEnd";break e;case"compositionupdate":B="onCompositionUpdate";break e}B=void 0}else Qu?SP(n,t)&&(B="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(B="onCompositionStart");B&&(AP&&t.locale!=="ko"&&(Qu||B!=="onCompositionStart"?B==="onCompositionEnd"&&Qu&&(R=vP()):(Da=u,zM="value"in Da?Da.value:Da.textContent,Qu=!0)),T=ny(c,B),0<T.length&&(B=new bC(B,n,null,t,u),d.push({event:B,listeners:T}),R?B.data=R:(R=MP(t),R!==null&&(B.data=R)))),(R=sO?oO(n,t):aO(n,t))&&(c=ny(c,"onBeforeInput"),0<c.length&&(u=new bC("onBeforeInput","beforeinput",null,t,u),d.push({event:u,listeners:c}),u.data=R))}zP(d,e)})}function Yd(n,e,t){return{instance:n,listener:e,currentTarget:t}}function ny(n,e){for(var t=e+"Capture",i=[];n!==null;){var r=n,s=r.stateNode;r.tag===5&&s!==null&&(r=s,s=Hd(n,t),s!=null&&i.unshift(Yd(n,s,r)),s=Hd(n,e),s!=null&&i.push(Yd(n,s,r))),n=n.return}return i}function au(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function HC(n,e,t,i,r){for(var s=e._reactName,o=[];t!==null&&t!==i;){var a=t,l=a.alternate,c=a.stateNode;if(l!==null&&l===i)break;a.tag===5&&c!==null&&(a=c,r?(l=Hd(t,s),l!=null&&o.unshift(Yd(t,l,a))):r||(l=Hd(t,s),l!=null&&o.push(Yd(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var AO=/\r\n?/g,SO=/\u0000|\uFFFD/g;function GC(n){return(typeof n=="string"?n:""+n).replace(AO,` 38`).replace(SO,"")}function s0(n,e,t){if(e=GC(e),GC(n)!==e&&t)throw Error(Se(425))}function iy(){}var ZA=null,qA=null;function $A(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var eS=typeof setTimeout=="function"?setTimeout:void 0,MO=typeof clearTimeout=="function"?clearTimeout:void 0,VC=typeof Promise=="function"?Promise:void 0,EO=typeof queueMicrotask=="function"?queueMicrotask:typeof VC<"u"?function(n){return VC.resolve(null).then(n).catch(wO)}:eS;function wO(n){setTimeout(function(){throw n})}function Nv(n,e){var t=e,i=0;do{var r=t.nextSibling;
vendor: 4,012 bytes, line 38
38if(n.removeChild(t),r&&r.nodeType===8)if(t=r.data,t==="/$"){if(i===0){n.removeChild(r),Wd(e);return}i--}else t!=="$"&&t!=="$?"&&t!=="$!"||i++;t=r}while(t);Wd(e)}function Wa(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function WC(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var Kh=Math.random().toString(36).slice(2),ro="__reactFiber$"+Kh,Kd="__reactProps$"+Kh,Jo="__reactContainer$"+Kh,tS="__reactEvents$"+Kh,TO="__reactListeners$"+Kh,CO="__reactHandles$"+Kh;function Ql(n){var e=n[ro];if(e)return e;for(var t=n.parentNode;t;){if(e=t[Jo]||t[ro]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=WC(n);n!==null;){if(t=n[ro])return t;n=WC(n)}return e}n=t,t=n.parentNode}return null}function Pp(n){return n=n[ro]||n[Jo],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function $u(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Se(33))}function __(n){return n[Kd]||null}var nS=[],eh=-1;function ll(n){return{current:n}}function un(n){0>eh||(n.current=nS[eh],nS[eh]=null,eh--)}function an(n,e){eh++,nS[eh]=n.current,n.current=e}var el={},Ni=ll(el),cr=ll(!1),xc=el;function Ch(n,e){var t=n.type.contextTypes;if(!t)return el;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function ur(n){return n=n.childContextTypes,n!=null}function ry(){un(cr),un(Ni)}function jC(n,e,t){if(Ni.current!==el)throw Error(Se(168));an(Ni,e),an(cr,t)}function OP(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Se(108,hF(n)||"Unknown",r));return wn({},t,i)}function sy(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||el,xc=Ni.current,an(Ni,n),an(cr,cr.current),!0}function XC(n,e,t){var i=n.stateNode;if(!i)throw Error(Se(169));t?(n=OP(n,e,xc),i.__reactInternalMemoizedMergedChildContext=n,un(cr),un(Ni),an(Ni,n)):un(cr),an(cr,t)}var Fo=null,x_=!1,kv=!1;function UP(n){Fo===null?Fo=[n]:Fo.push(n)}function RO(n){x_=!0,UP(n)}function cl(){if(!kv&&Fo!==null){kv=!0;var n=0,e=Jt;try{var t=Fo;for(Jt=1;n<t.length;n++){var i=t[n];do i=i(!0);while(i!==null)}Fo=null,x_=!1}catch(r){throw Fo!==null&&(Fo=Fo.slice(n+1)),cP(BM,cl),r}finally{Jt=e,kv=!1}}return null}var th=[],nh=0,oy=null,ay=0,ss=[],os=0,vc=null,ko=1,Ho="";function Wl(n,e){th[nh++]=ay,th[nh++]=oy,oy=n,ay=e}function NP(n,e,t){ss[os++]=ko,ss[os++]=Ho,ss[os++]=vc,vc=n;var i=ko;n=Ho;var r=32-Os(i)-1;i&=~(1<<r),t+=1;var s=32-Os(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,ko=1<<32-Os(e)+r|t<<r|i,Ho=s+n}else ko=1<<s|t<<r|i,Ho=n}function kM(n){n.return!==null&&(Wl(n,1),NP(n,1,0))}function HM(n){for(;n===oy;)oy=th[--nh],th[nh]=null,ay=th[--nh],th[nh]=null;for(;n===vc;)vc=ss[--os],ss[os]=null,Ho=ss[--os],ss[os]=null,ko=ss[--os],ss[os]=null}var Dr=null,Pr=null,pn=!1,zs=null;function kP(n,e){var t=as(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function JC(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,Dr=n,Pr=Wa(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Dr=n,Pr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=vc!==null?{id:ko,overflow:Ho}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=as(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Dr=n,Pr=null,!0):!1;default:return!1}}function iS(n){return(n.mode&1)!==0&&(n.flags&128)===0}
vendor: 10,999 bytes, line 38
38function rS(n){if(pn){var e=Pr;if(e){var t=e;if(!JC(n,e)){if(iS(n))throw Error(Se(418));e=Wa(t.nextSibling);var i=Dr;e&&JC(n,e)?kP(i,t):(n.flags=n.flags&-4097|2,pn=!1,Dr=n)}}else{if(iS(n))throw Error(Se(418));n.flags=n.flags&-4097|2,pn=!1,Dr=n}}}function YC(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Dr=n}function o0(n){if(n!==Dr)return!1;if(!pn)return YC(n),pn=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!$A(n.type,n.memoizedProps)),e&&(e=Pr)){if(iS(n))throw HP(),Error(Se(418));for(;e;)kP(n,e),e=Wa(e.nextSibling)}if(YC(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Se(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Pr=Wa(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Pr=null}}else Pr=Dr?Wa(n.stateNode.nextSibling):null;return!0}function HP(){for(var n=Pr;n;)n=Wa(n.nextSibling)}function Rh(){Pr=Dr=null,pn=!1}function GM(n){zs===null?zs=[n]:zs.push(n)}var bO=na.ReactCurrentBatchConfig;function bf(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(Se(309));var i=t.stateNode}if(!i)throw Error(Se(147,n));var r=i,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=r.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(Se(284));if(!t._owner)throw Error(Se(290,n))}return n}function a0(n,e){throw n=Object.prototype.toString.call(e),Error(Se(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function KC(n){var e=n._init;return e(n._payload)}function GP(n){function e(g,v){if(n){var S=g.deletions;S===null?(g.deletions=[v],g.flags|=16):S.push(v)}}function t(g,v){if(!n)return null;for(;v!==null;)e(g,v),v=v.sibling;return null}function i(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function r(g,v){return g=Ya(g,v),g.index=0,g.sibling=null,g}function s(g,v,S){return g.index=S,n?(S=g.alternate,S!==null?(S=S.index,S<v?(g.flags|=2,v):S):(g.flags|=2,v)):(g.flags|=1048576,v)}function o(g){return n&&g.alternate===null&&(g.flags|=2),g}function a(g,v,S,M){return v===null||v.tag!==6?(v=Jv(S,g.mode,M),v.return=g,v):(v=r(v,S),v.return=g,v)}function l(g,v,S,M){var w=S.type;return w===Ku?u(g,v,S.props.children,M,S.key):v!==null&&(v.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ra&&KC(w)===v.type)?(M=r(v,S.props),M.ref=bf(g,v,S),M.return=g,M):(M=Hg(S.type,S.key,S.props,null,g.mode,M),M.ref=bf(g,v,S),M.return=g,M)}function c(g,v,S,M){return v===null||v.tag!==4||v.stateNode.containerInfo!==S.containerInfo||v.stateNode.implementation!==S.implementation?(v=Yv(S,g.mode,M),v.return=g,v):(v=r(v,S.children||[]),v.return=g,v)}function u(g,v,S,M,w){return v===null||v.tag!==7?(v=cc(S,g.mode,M,w),v.return=g,v):(v=r(v,S),v.return=g,v)}function d(g,v,S){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Jv(""+v,g.mode,S),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Qm:return S=Hg(v.type,v.key,v.props,null,g.mode,S),S.ref=bf(g,null,v),S.return=g,S;case Yu:return v=Yv(v,g.mode,S),v.return=g,v;case Ra:var M=v._init;return d(g,M(v._payload),S)}if(ld(v)||Ef(v))return v=cc(v,g.mode,S,null),v.return=g,v;a0(g,v)}return null}function p(g,v,S,M){var w=v!==null?v.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return w!==null?null:a(g,v,""+S,M);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Qm:return S.key===w?l(g,v,S,M):null;case Yu:return S.key===w?c(g,v,S,M):null;case Ra:return w=S._init,p(g,v,w(S._payload),M)}if(ld(S)||Ef(S))return w!==null?null:u(g,v,S,M,null);a0(g,S)}return null}function m(g,v,S,M,w){if(typeof M=="string"&&M!==""||typeof M=="number")return g=g.get(S)||null,a(v,g,""+M,w);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case Qm:return g=g.get(M.key===null?S:M.key)||null,l(v,g,M,w);case Yu:return g=g.get(M.key===null?S:M.key)||null,c(v,g,M,w);case Ra:var T=M._init;return m(g,v,S,T(M._payload),w)}if(ld(M)||Ef(M))return g=g.get(S)||null,u(v,g,M,w,null);a0(v,M)}return null}function y(g,v,S,M){for(var w=null,T=null,R=v,B=v=0,b=null;R!==null&&B<S.length;B++){R.index>B?(b=R,R=null):b=R.sibling;var P=p(g,R,S[B],M);if(P===null){R===null&&(R=b);break}n&&R&&P.alternate===null&&e(g,R),v=s(P,v,B),T===null?w=P:T.sibling=P,T=P,R=b}if(B===S.length)return t(g,R),pn&&Wl(g,B),w;if(R===null){for(;B<S.length;B++)R=d(g,S[B],M),R!==null&&(v=s(R,v,B),T===null?w=R:T.sibling=R,T=R);return pn&&Wl(g,B),w}for(R=i(g,R);B<S.length;B++)b=m(R,g,B,S[B],M),b!==null&&(n&&b.alternate!==null&&R.delete(b.key===null?B:b.key),v=s(b,v,B),T===null?w=b:T.sibling=b,T=b);return n&&R.forEach(function(L){return e(g,L)}),pn&&Wl(g,B),w}function _(g,v,S,M){var w=Ef(S);if(typeof w!="function")throw Error(Se(150));if(S=w.call(S),S==null)throw Error(Se(151));for(var T=w=null,R=v,B=v=0,b=null,P=S.next();R!==null&&!P.done;B++,P=S.next()){R.index>B?(b=R,R=null):b=R.sibling;var L=p(g,R,P.value,M);if(L===null){R===null&&(R=b);break}n&&R&&L.alternate===null&&e(g,R),v=s(L,v,B),T===null?w=L:T.sibling=L,T=L,R=b}if(P.done)return t(g,R),pn&&Wl(g,B),w;if(R===null){for(;!P.done;B++,P=S.next())P=d(g,P.value,M),P!==null&&(v=s(P,v,B),T===null?w=P:T.sibling=P,T=P);return pn&&Wl(g,B),w}for(R=i(g,R);!P.done;B++,P=S.next())P=m(R,g,B,P.value,M),P!==null&&(n&&P.alternate!==null&&R.delete(P.key===null?B:P.key),v=s(P,v,B),T===null?w=P:T.sibling=P,T=P);return n&&R.forEach(function(U){return e(g,U)}),pn&&Wl(g,B),w}function x(g,v,S,M){if(typeof S=="object"&&S!==null&&S.type===Ku&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Qm:e:{for(var w=S.key,T=v;T!==null;){if(T.key===w){if(w=S.type,w===Ku){if(T.tag===7){t(g,T.sibling),v=r(T,S.props.children),v.return=g,g=v;break e}}else if(T.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ra&&KC(w)===T.type){t(g,T.sibling),v=r(T,S.props),v.ref=bf(g,T,S),v.return=g,g=v;break e}t(g,T);break}else e(g,T);T=T.sibling}S.type===Ku?(v=cc(S.props.children,g.mode,M,S.key),v.return=g,g=v):(M=Hg(S.type,S.key,S.props,null,g.mode,M),M.ref=bf(g,v,S),M.return=g,g=M)}return o(g);case Yu:e:{for(T=S.key;v!==null;){if(v.key===T)if(v.tag===4&&v.stateNode.containerInfo===S.containerInfo&&v.stateNode.implementation===S.implementation){t(g,v.sibling),v=r(v,S.children||[]),v.return=g,g=v;break e}else{t(g,v);break}else e(g,v);v=v.sibling}v=Yv(S,g.mode,M),v.return=g,g=v}return o(g);case Ra:return T=S._init,x(g,v,T(S._payload),M)}if(ld(S))return y(g,v,S,M);if(Ef(S))return _(g,v,S,M);a0(g,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,v!==null&&v.tag===6?(t(g,v.sibling),v=r(v,S),v.return=g,g=v):(t(g,v),v=Jv(S,g.mode,M),v.return=g,g=v),o(g)):t(g,v)}return x}var bh=GP(!0),VP=GP(!1),ly=ll(null),cy=null,ih=null,VM=null;function WM(){VM=ih=cy=null}function jM(n){var e=ly.current;un(ly),n._currentValue=e}function sS(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function _h(n,e){cy=n,VM=ih=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(ar=!0),n.firstContext=null)}function gs(n){var e=n._currentValue;if(VM!==n)if(n={context:n,memoizedValue:e,next:null},ih===null){if(cy===null)throw Error(Se(308));ih=n,cy.dependencies={lanes:0,firstContext:n}}else ih=ih.next=n;return e}var Zl=null;function XM(n){Zl===null?Zl=[n]:Zl.push(n)}function WP(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,XM(e)):(t.next=r.next,r.next=t),e.interleaved=t,Yo(n,i)}function Yo(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var ba=!1;function JM(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jP(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Wo(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function ja(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,Ft&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Yo(n,t)}return r=i.interleaved,r===null?(e.next=e,XM(i)):(e.next=r.next,r.next=e),i.interleaved=e,Yo(n,t)}function zg(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,IM(n,t)}}function QC(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function uy(n,e,t,i){var r=n.updateQueue;ba=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=n.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var d=r.baseState;o=0,u=c=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((i&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=n,_=a;switch(p=e,m=t,_.tag){case 1:if(y=_.payload,typeof y=="function"){d=y.call(m,d,p);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=_.payload,p=typeof y=="function"?y.call(m,d,p):y,p==null)break e;d=wn({},d,p);break e;case 2:ba=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=r.effects,p===null?r.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=m,l=d):u=u.next=m,o|=p;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;p=a,a=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);if(u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);Sc|=o,n.lanes=o,n.memoizedState=d}}function ZC(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var i=n[e],r=i.callback;if(r!==null){if(i.callback=null,i=t,typeof r!="function")throw Error(Se(191,r));r.call(i)}}}var Bp={},co=ll(Bp),Qd=ll(Bp),Zd=ll(Bp);function ql(n){if(n===Bp)throw Error(Se(174));return n}function YM(n,e){switch(an(Zd,e),an(Qd,n),an(co,Bp),n=e.nodeType,n){case 9:case 11:e=(e
vendor: 6,432 bytes, line 38
38=e.documentElement)?e.namespaceURI:NA(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=NA(e,n)}un(co),an(co,e)}function Ph(){un(co),un(Qd),un(Zd)}function XP(n){ql(Zd.current);var e=ql(co.current),t=NA(e,n.type);e!==t&&(an(Qd,n),an(co,t))}function KM(n){Qd.current===n&&(un(co),un(Qd))}var vn=ll(0);function hy(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 Hv=[];function QM(){for(var n=0;n<Hv.length;n++)Hv[n]._workInProgressVersionPrimary=null;Hv.length=0}var Fg=na.ReactCurrentDispatcher,Gv=na.ReactCurrentBatchConfig,Ac=0,En=null,Zn=null,ci=null,fy=!1,Ad=!1,qd=0,PO=0;function Ri(){throw Error(Se(321))}function ZM(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Ns(n[t],e[t]))return!1;return!0}function qM(n,e,t,i,r,s){if(Ac=s,En=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Fg.current=n===null||n.memoizedState===null?DO:zO,n=t(i,r),Ad){s=0;do{if(Ad=!1,qd=0,25<=s)throw Error(Se(301));s+=1,ci=Zn=null,e.updateQueue=null,Fg.current=FO,n=t(i,r)}while(Ad)}if(Fg.current=dy,e=Zn!==null&&Zn.next!==null,Ac=0,ci=Zn=En=null,fy=!1,e)throw Error(Se(300));return n}function $M(){var n=qd!==0;return qd=0,n}function to(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ci===null?En.memoizedState=ci=n:ci=ci.next=n,ci}function ys(){if(Zn===null){var n=En.alternate;n=n!==null?n.memoizedState:null}else n=Zn.next;var e=ci===null?En.memoizedState:ci.next;if(e!==null)ci=e,Zn=n;else{if(n===null)throw Error(Se(310));Zn=n,n={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},ci===null?En.memoizedState=ci=n:ci=ci.next=n}return ci}function $d(n,e){return typeof e=="function"?e(n):e}function Vv(n){var e=ys(),t=e.queue;if(t===null)throw Error(Se(311));t.lastRenderedReducer=n;var i=Zn,r=i.baseQueue,s=t.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}i.baseQueue=r=s,t.pending=null}if(r!==null){s=r.next,i=i.baseState;var a=o=null,l=null,c=s;do{var u=c.lane;if((Ac&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),i=c.hasEagerState?c.eagerState:n(i,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,o=i):l=l.next=d,En.lanes|=u,Sc|=u}c=c.next}while(c!==null&&c!==s);l===null?o=i:l.next=a,Ns(i,e.memoizedState)||(ar=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=l,t.lastRenderedState=i}if(n=t.interleaved,n!==null){r=n;do s=r.lane,En.lanes|=s,Sc|=s,r=r.next;while(r!==n)}else r===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function Wv(n){var e=ys(),t=e.queue;if(t===null)throw Error(Se(311));t.lastRenderedReducer=n;var i=t.dispatch,r=t.pending,s=e.memoizedState;if(r!==null){t.pending=null;var o=r=r.next;do s=n(s,o.action),o=o.next;while(o!==r);Ns(s,e.memoizedState)||(ar=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,i]}function JP(){}function YP(n,e){var t=En,i=ys(),r=e(),s=!Ns(i.memoizedState,r);if(s&&(i.memoizedState=r,ar=!0),i=i.queue,eE(ZP.bind(null,t,i,n),[n]),i.getSnapshot!==e||s||ci!==null&&ci.memoizedState.tag&1){if(t.flags|=2048,ep(9,QP.bind(null,t,i,r,e),void 0,null),di===null)throw Error(Se(349));Ac&30||KP(t,e,r)}return r}function KP(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=En.updateQueue,e===null?(e={lastEffect:null,stores:null},En.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function QP(n,e,t,i){e.value=t,e.getSnapshot=i,qP(e)&&$P(n)}function ZP(n,e,t){return t(function(){qP(e)&&$P(n)})}function qP(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Ns(n,t)}catch{return!0}}function $P(n){var e=Yo(n,1);e!==null&&Us(e,n,1,-1)}function qC(n){var e=to();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$d,lastRenderedState:n},e.queue=n,n=n.dispatch=LO.bind(null,En,n),[e.memoizedState,n]}function ep(n,e,t,i){return n={tag:n,create:e,destroy:t,deps:i,next:null},e=En.updateQueue,e===null?(e={lastEffect:null,stores:null},En.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(i=t.next,t.next=n,n.next=i,e.lastEffect=n)),n}function eB(){return ys().memoizedState}function Og(n,e,t,i){var r=to();En.flags|=n,r.memoizedState=ep(1|e,t,void 0,i===void 0?null:i)}function v_(n,e,t,i){var r=ys();i=i===void 0?null:i;var s=void 0;if(Zn!==null){var o=Zn.memoizedState;if(s=o.destroy,i!==null&&ZM(i,o.deps)){r.memoizedState=ep(e,t,s,i);return}}En.flags|=n,r.memoizedState=ep(1|e,t,s,i)}function $C(n,e){return Og(8390656,8,n,e)}function eE(n,e){return v_(2048,8,n,e)}function tB(n,e){return v_(4,2,n,e)}function nB(n,e){return v_(4,4,n,e)}function iB(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function rB(n,e,t){return t=t!=null?t.concat([n]):null,v_(4,4,iB.bind(null,e,n),t)}function tE(){}function sB(n,e){var t=ys();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&ZM(e,i[1])?i[0]:(t.memoizedState=[n,e],n)}function oB(n,e){var t=ys();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&ZM(e,i[1])?i[0]:(n=n(),t.memoizedState=[n,e],n)}function aB(n,e,t){return Ac&21?(Ns(t,e)||(t=fP(),En.lanes|=t,Sc|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,ar=!0),n.memoizedState=t)}function BO(n,e){var t=Jt;Jt=t!==0&&4>t?t:4,n(!0);var i=Gv.transition;Gv.transition={};try{n(!1),e()}finally{Jt=t,Gv.transition=i}}function lB(){return ys().memoizedState}function IO(n,e,t){var i=Ja(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},cB(n))uB(e,t);else if(t=WP(n,e,t,i),t!==null){var r=Ki();Us(t,n,i,r),hB(t,e,i)}}function LO(n,e,t){var i=Ja(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(cB(n))uB(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);
vendor: 7,216 bytes, lines 38-40
38if(r.hasEagerState=!0,r.eagerState=a,Ns(a,o)){var l=e.interleaved;l===null?(r.next=r,XM(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=WP(n,e,r,i),t!==null&&(r=Ki(),Us(t,n,i,r),hB(t,e,i))}}function cB(n){var e=n.alternate;return n===En||e!==null&&e===En}function uB(n,e){Ad=fy=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function hB(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,IM(n,t)}}var dy={readContext:gs,useCallback:Ri,useContext:Ri,useEffect:Ri,useImperativeHandle:Ri,useInsertionEffect:Ri,useLayoutEffect:Ri,useMemo:Ri,useReducer:Ri,useRef:Ri,useState:Ri,useDebugValue:Ri,useDeferredValue:Ri,useTransition:Ri,useMutableSource:Ri,useSyncExternalStore:Ri,useId:Ri,unstable_isNewReconciler:!1},DO={readContext:gs,useCallback:function(n,e){return to().memoizedState=[n,e===void 0?null:e],n},useContext:gs,useEffect:$C,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Og(4194308,4,iB.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Og(4194308,4,n,e)},useInsertionEffect:function(n,e){return Og(4,2,n,e)},useMemo:function(n,e){var t=to();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=to();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=IO.bind(null,En,n),[i.memoizedState,n]},useRef:function(n){var e=to();return n={current:n},e.memoizedState=n},useState:qC,useDebugValue:tE,useDeferredValue:function(n){return to().memoizedState=n},useTransition:function(){var n=qC(!1),e=n[0];return n=BO.bind(null,n[1]),to().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=En,r=to();if(pn){if(t===void 0)throw Error(Se(407));t=t()}else{if(t=e(),di===null)throw Error(Se(349));Ac&30||KP(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,$C(ZP.bind(null,i,s,n),[n]),i.flags|=2048,ep(9,QP.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=to(),e=di.identifierPrefix;if(pn){var t=Ho,i=ko;t=(i&~(1<<32-Os(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=qd++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=PO++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},zO={readContext:gs,useCallback:sB,useContext:gs,useEffect:eE,useImperativeHandle:rB,useInsertionEffect:tB,useLayoutEffect:nB,useMemo:oB,useReducer:Vv,useRef:eB,useState:function(){return Vv($d)},useDebugValue:tE,useDeferredValue:function(n){var e=ys();return aB(e,Zn.memoizedState,n)},useTransition:function(){var n=Vv($d)[0],e=ys().memoizedState;return[n,e]},useMutableSource:JP,useSyncExternalStore:YP,useId:lB,unstable_isNewReconciler:!1},FO={readContext:gs,useCallback:sB,useContext:gs,useEffect:eE,useImperativeHandle:rB,useInsertionEffect:tB,useLayoutEffect:nB,useMemo:oB,useReducer:Wv,useRef:eB,useState:function(){return Wv($d)},useDebugValue:tE,useDeferredValue:function(n){var e=ys();return Zn===null?e.memoizedState=n:aB(e,Zn.memoizedState,n)},useTransition:function(){var n=Wv($d)[0],e=ys().memoizedState;return[n,e]},useMutableSource:JP,useSyncExternalStore:YP,useId:lB,unstable_isNewReconciler:!1};function Is(n,e){if(n&&n.defaultProps){e=wn({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}function oS(n,e,t,i){e=n.memoizedState,t=t(i,e),t=t==null?e:wn({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var A_={isMounted:function(n){return(n=n._reactInternals)?zc(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var i=Ki(),r=Ja(n),s=Wo(i,r);s.payload=e,t!=null&&(s.callback=t),e=ja(n,s,r),e!==null&&(Us(e,n,r,i),zg(e,n,r))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var i=Ki(),r=Ja(n),s=Wo(i,r);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=ja(n,s,r),e!==null&&(Us(e,n,r,i),zg(e,n,r))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=Ki(),i=Ja(n),r=Wo(t,i);r.tag=2,e!=null&&(r.callback=e),e=ja(n,r,i),e!==null&&(Us(e,n,i,t),zg(e,n,i))}};function e2(n,e,t,i,r,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!Xd(t,i)||!Xd(r,s):!0}function fB(n,e,t){var i=!1,r=el,s=e.contextType;return typeof s=="object"&&s!==null?s=gs(s):(r=ur(e)?xc:Ni.current,i=e.contextTypes,s=(i=i!=null)?Ch(n,r):el),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=A_,n.stateNode=e,e._reactInternals=n,i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=r,n.__reactInternalMemoizedMaskedChildContext=s),e}function t2(n,e,t,i){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,i),e.state!==n&&A_.enqueueReplaceState(e,e.state,null)}function aS(n,e,t,i){var r=n.stateNode;r.props=t,r.state=n.memoizedState,r.refs={},JM(n);var s=e.contextType;typeof s=="object"&&s!==null?r.context=gs(s):(s=ur(e)?xc:Ni.current,r.context=Ch(n,s)),r.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(oS(n,e,s,t),r.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&A_.enqueueReplaceState(r,r.state,null),uy(n,t,r,i),r.state=n.memoizedState),typeof r.componentDidMount=="function"&&(n.flags|=4194308)}function Bh(n,e){try{var t="",i=e;do t+=uF(i),i=i.return;while(i);var r=t}catch(s){r=` 39Error generating stack: `+s.message+` 40`+s.stack}return{value:n,source:e,stack:r,digest:null}}function jv(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function lS(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var OO=typeof WeakMap=="function"?WeakMap:Map;function dB(n,e,t){t=Wo(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){my||(my=!0,_S=i),lS(n,e)},t}function pB(n,e,t){t=Wo(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;t.payload=function(){return i(r)},t.callback=function(){lS(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){lS(n,e),typeof i!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function n2(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new OO;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(t)||(r.add(t),n=ZO.bind(null,n,e,t),e.then(n,n))}function i2(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function r2(n,e,t,i,r){return n.mode&1?(n.flags|=65536,n.lanes=r,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=Wo(-1,1),e.tag=2,ja(t,e,1)
vendor: 6,389 bytes, line 40
40)),t.lanes|=1),n)}var UO=na.ReactCurrentOwner,ar=!1;function Xi(n,e,t,i){e.child=n===null?VP(e,null,t,i):bh(e,n.child,t,i)}function s2(n,e,t,i,r){t=t.render;var s=e.ref;return _h(e,r),i=qM(n,e,t,i,s,r),t=$M(),n!==null&&!ar?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,Ko(n,e,r)):(pn&&t&&kM(e),e.flags|=1,Xi(n,e,i,r),e.child)}function o2(n,e,t,i,r){if(n===null){var s=t.type;return typeof s=="function"&&!cE(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,mB(n,e,s,i,r)):(n=Hg(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&r)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:Xd,t(o,i)&&n.ref===e.ref)return Ko(n,e,r)}return e.flags|=1,n=Ya(s,i),n.ref=e.ref,n.return=e,e.child=n}function mB(n,e,t,i,r){if(n!==null){var s=n.memoizedProps;if(Xd(s,i)&&n.ref===e.ref)if(ar=!1,e.pendingProps=i=s,(n.lanes&r)!==0)n.flags&131072&&(ar=!0);else return e.lanes=n.lanes,Ko(n,e,r)}return cS(n,e,t,i,r)}function gB(n,e,t){var i=e.pendingProps,r=i.children,s=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},an(sh,wr),wr|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,an(sh,wr),wr|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:t,an(sh,wr),wr|=i}else s!==null?(i=s.baseLanes|t,e.memoizedState=null):i=t,an(sh,wr),wr|=i;return Xi(n,e,r,t),e.child}function yB(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function cS(n,e,t,i,r){var s=ur(t)?xc:Ni.current;return s=Ch(e,s),_h(e,r),t=qM(n,e,t,i,s,r),i=$M(),n!==null&&!ar?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,Ko(n,e,r)):(pn&&i&&kM(e),e.flags|=1,Xi(n,e,t,r),e.child)}function a2(n,e,t,i,r){if(ur(t)){var s=!0;sy(e)}else s=!1;if(_h(e,r),e.stateNode===null)Ug(n,e),fB(e,t,i),aS(e,t,i,r),i=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=t.contextType;typeof c=="object"&&c!==null?c=gs(c):(c=ur(t)?xc:Ni.current,c=Ch(e,c));var u=t.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==c)&&t2(e,o,i,c),ba=!1;var p=e.memoizedState;o.state=p,uy(e,i,o,r),l=e.memoizedState,a!==i||p!==l||cr.current||ba?(typeof u=="function"&&(oS(e,t,u,i),l=e.memoizedState),(a=ba||e2(e,t,a,i,p,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),o.props=i,o.state=l,o.context=c,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,jP(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:Is(e.type,a),o.props=c,d=e.pendingProps,p=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=gs(l):(l=ur(t)?xc:Ni.current,l=Ch(e,l));var m=t.getDerivedStateFromProps;(u=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||p!==l)&&t2(e,o,i,l),ba=!1,p=e.memoizedState,o.state=p,uy(e,i,o,r);var y=e.memoizedState;a!==d||p!==y||cr.current||ba?(typeof m=="function"&&(oS(e,t,m,i),y=e.memoizedState),(c=ba||e2(e,t,c,i,p,y,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,y,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=y),o.props=i,o.state=y,o.context=l,i=c):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),i=!1)}return uS(n,e,t,i,s,r)}function uS(n,e,t,i,r,s){yB(n,e);var o=(e.flags&128)!==0;if(!i&&!o)return r&&XC(e,t,!1),Ko(n,e,s);i=e.stateNode,UO.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&o?(e.child=bh(e,n.child,null,s),e.child=bh(e,null,a,s)):Xi(n,e,a,s),e.memoizedState=i.state,r&&XC(e,t,!0),e.child}function _B(n){var e=n.stateNode;e.pendingContext?jC(n,e.pendingContext,e.pendingContext!==e.context):e.context&&jC(n,e.context,!1),YM(n,e.containerInfo)}function l2(n,e,t,i,r){return Rh(),GM(r),e.flags|=256,Xi(n,e,t,i),e.child}var hS={dehydrated:null,treeContext:null,retryLane:0};function fS(n){return{baseLanes:n,cachePool:null,transitions:null}}function xB(n,e,t){var i=e.pendingProps,r=vn.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(r&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(r|=1),an(vn,r&1),n===null)return rS(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=i.children,n=i.fallback,s?(i=e.mode,s=e.child,o={mode:"hidden",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=E_(o,i,0,null),n=cc(n,i,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=fS(t),e.memoizedState=hS,n):nE(e,o));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return NO(n,e,o,i,a,r,t);if(s){s=i.fallback,o=e.mode,r=n.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=Ya(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=Ya(a,s):(s=cc(s,o,t,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,o=n.child.memoizedState,o=o===null?fS(t):{base
vendor: 5,066 bytes, line 40
40Lanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=hS,i}return s=n.child,n=s.sibling,i=Ya(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function nE(n,e){return e=E_({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function l0(n,e,t,i){return i!==null&&GM(i),bh(e,n.child,null,t),n=nE(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function NO(n,e,t,i,r,s,o){if(t)return e.flags&256?(e.flags&=-257,i=jv(Error(Se(422))),l0(n,e,o,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=E_({mode:"visible",children:i.children},r,0,null),s=cc(s,r,o,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&bh(e,n.child,null,o),e.child.memoizedState=fS(o),e.memoizedState=hS,s);if(!(e.mode&1))return l0(n,e,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(Se(419)),i=jv(s,i,void 0),l0(n,e,o,i)}if(a=(o&n.childLanes)!==0,ar||a){if(i=di,i!==null){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|o)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,Yo(n,r),Us(i,n,r,-1))}return lE(),i=jv(Error(Se(421))),l0(n,e,o,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=qO.bind(null,n),r._reactRetry=e,null):(n=s.treeContext,Pr=Wa(r.nextSibling),Dr=e,pn=!0,zs=null,n!==null&&(ss[os++]=ko,ss[os++]=Ho,ss[os++]=vc,ko=n.id,Ho=n.overflow,vc=e),e=nE(e,i.children),e.flags|=4096,e)}function c2(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),sS(n.return,e,t)}function Xv(n,e,t,i,r){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=t,s.tailMode=r)}function vB(n,e,t){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(Xi(n,e,i.children,t),i=vn.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&c2(n,t,e);else if(n.tag===19)c2(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(an(vn,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&hy(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),Xv(e,!1,r,t,s);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&hy(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}Xv(e,!0,t,null,s);break;case"together":Xv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Ug(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function Ko(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),Sc|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Se(153));if(e.child!==null){for(n=e.child,t=Ya(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=Ya(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function kO(n,e,t){switch(e.tag){case 3:_B(e),Rh();break;case 5:XP(e);break;case 1:ur(e.type)&&sy(e);break;case 4:YM(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;an(ly,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(an(vn,vn.current&1),e.flags|=128,null):t&e.child.childLanes?xB(n,e,t):(an(vn,vn.current&1),n=Ko(n,e,t),n!==null?n.sibling:null);an(vn,vn.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return vB(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),an(vn,vn.current),i)break;return null;case 22:case 23:return e.lanes=0,gB(n,e,t)}return Ko(n,e,t)}var AB,dS,SB,MB;AB=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};dS=function(){};SB=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,ql(co.current);var s=null;switch(t){case"input":r=zA(n,r),i=zA(n,i),s=[];break;case"select":r=wn({},r,{value:void 0}),i=wn({},i,{value:void 0}),s=[];break;case"textarea":r=UA(n,r),i=UA(n,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=iy)}
vendor: 5,653 bytes, line 40
40kA(t,i);var o;t=null;for(c in r)if(!i.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Nd.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in i){var l=i[c];if(a=r!=null?r[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Nd.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&cn("scroll",n),s||a===l||(s=[])):(s=s||[]).push(c,l))}t&&(s=s||[]).push("style",t);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};MB=function(n,e,t,i){t!==i&&(e.flags|=4)};function Pf(n,e){if(!pn)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function bi(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=n,r=r.sibling;else for(r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=n,r=r.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function HO(n,e,t){var i=e.pendingProps;switch(HM(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bi(e),null;case 1:return ur(e.type)&&ry(),bi(e),null;case 3:return i=e.stateNode,Ph(),un(cr),un(Ni),QM(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(o0(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,zs!==null&&(AS(zs),zs=null))),dS(n,e),bi(e),null;case 5:KM(e);var r=ql(Zd.current);if(t=e.type,n!==null&&e.stateNode!=null)SB(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Se(166));return bi(e),null}if(n=ql(co.current),o0(e)){i=e.stateNode,t=e.type;var s=e.memoizedProps;switch(i[ro]=e,i[Kd]=s,n=(e.mode&1)!==0,t){case"dialog":cn("cancel",i),cn("close",i);break;case"iframe":case"object":case"embed":cn("load",i);break;case"video":case"audio":for(r=0;r<ud.length;r++)cn(ud[r],i);break;case"source":cn("error",i);break;case"img":case"image":case"link":cn("error",i),cn("load",i);break;case"details":cn("toggle",i);break;case"input":_C(i,s),cn("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},cn("invalid",i);break;case"textarea":vC(i,s),cn("invalid",i)}kA(t,s),r=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?i.textContent!==a&&(s.suppressHydrationWarning!==!0&&s0(i.textContent,a,n),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&s0(i.textContent,a,n),r=["children",""+a]):Nd.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&cn("scroll",i)}switch(t){case"input":Zm(i),xC(i,s,!0);break;case"textarea":Zm(i),AC(i);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(i.onclick=iy)}i=r,e.updateQueue=i,i!==null&&(e.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=Zb(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/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[ro]=e,n[Kd]=i,AB(n,e,!1,!1),e.stateNode=n;e:{switch(o=HA(t,i),t){case"dialog":cn("cancel",n),cn("close",n),r=i;break;case"iframe":case"object":case"embed":cn("load",n),r=i;break;case"video":case"audio":for(r=0;r<ud.length;r++)cn(ud[r],n);r=i;break;case"source":cn("error",n),r=i;break;case"img":case"image":case"link":cn("error",n),cn("load",n),r=i;break;case"details":cn("toggle",n),r=i;break;case"input":_C(n,i),r=zA(n,i),cn("invalid",n);break;case"option":r=i;break;case"select":n._wrapperState={wasMultiple:!!i.multiple},r=wn({},i,{value:void 0}),cn("invalid",n);break;case"textarea":vC(n,i),r=UA(n,i),cn("invalid",n);break;default:r=i}kA(t,r),a=r;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?eP(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&qb(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&kd(n,l):typeof l=="number"&&kd(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Nd.hasOwnProperty(s)?l!=null&&s==="onScroll"&&cn("scroll",n):l!=null&&TM(n,s,l,o))}switch(t){case"input":Zm(n),xC(n,i,!1);break;case"textarea":Zm(n),AC(n);break;case"option":i.value!=null&&n.setAttribute("value",""+$a(i.value));break;case"select":n.multiple=!!i.multiple,s=i.value,s!=null?ph(n,!!i.multiple,s,!1):i.defaultValue!=null&&ph(n,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(n.onclick=iy)}switch(t){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}
vendor: 30,081 bytes, line 40
40return bi(e),null;case 6:if(n&&e.stateNode!=null)MB(n,e,n.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Se(166));if(t=ql(Zd.current),ql(co.current),o0(e)){if(i=e.stateNode,t=e.memoizedProps,i[ro]=e,(s=i.nodeValue!==t)&&(n=Dr,n!==null))switch(n.tag){case 3:s0(i.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&s0(i.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else i=(t.nodeType===9?t:t.ownerDocument).createTextNode(i),i[ro]=e,e.stateNode=i}return bi(e),null;case 13:if(un(vn),i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(pn&&Pr!==null&&e.mode&1&&!(e.flags&128))HP(),Rh(),e.flags|=98560,s=!1;else if(s=o0(e),i!==null&&i.dehydrated!==null){if(n===null){if(!s)throw Error(Se(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Se(317));s[ro]=e}else Rh(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;bi(e),s=!1}else zs!==null&&(AS(zs),zs=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(i=i!==null,i!==(n!==null&&n.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(n===null||vn.current&1?qn===0&&(qn=3):lE())),e.updateQueue!==null&&(e.flags|=4),bi(e),null);case 4:return Ph(),dS(n,e),n===null&&Jd(e.stateNode.containerInfo),bi(e),null;case 10:return jM(e.type._context),bi(e),null;case 17:return ur(e.type)&&ry(),bi(e),null;case 19:if(un(vn),s=e.memoizedState,s===null)return bi(e),null;if(i=(e.flags&128)!==0,o=s.rendering,o===null)if(i)Pf(s,!1);else{if(qn!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=hy(n),o!==null){for(e.flags|=128,Pf(s,!1),i=o.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=t,t=e.child;t!==null;)s=t,n=i,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return an(vn,vn.current&1|2),e.child}n=n.sibling}s.tail!==null&&On()>Ih&&(e.flags|=128,i=!0,Pf(s,!1),e.lanes=4194304)}else{if(!i)if(n=hy(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Pf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!pn)return bi(e),null}else 2*On()-s.renderingStartTime>Ih&&t!==1073741824&&(e.flags|=128,i=!0,Pf(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=On(),e.sibling=null,t=vn.current,an(vn,i?t&1|2:t&1),e):(bi(e),null);case 22:case 23:return aE(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?wr&1073741824&&(bi(e),e.subtreeFlags&6&&(e.flags|=8192)):bi(e),null;case 24:return null;case 25:return null}throw Error(Se(156,e.tag))}function GO(n,e){switch(HM(e),e.tag){case 1:return ur(e.type)&&ry(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Ph(),un(cr),un(Ni),QM(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return KM(e),null;case 13:if(un(vn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Se(340));Rh()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return un(vn),null;case 4:return Ph(),null;case 10:return jM(e.type._context),null;case 22:case 23:return aE(),null;case 24:return null;default:return null}}var c0=!1,Li=!1,VO=typeof WeakSet=="function"?WeakSet:Set,We=null;function rh(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 pS(n,e,t){try{t()}catch(i){bn(n,e,i)}}var u2=!1;function WO(n,e){if(ZA=ey,n=RP(),NM(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,c=0,u=0,d=n,p=null;t:for(;;){for(var m;d!==t||r!==0&&d.nodeType!==3||(a=o+r),d!==s||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===n)break t;if(p===t&&++c===r&&(a=o),p===s&&++u===i&&(l=o),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(qA={focusedElem:n,selectionRange:t},ey=!1,We=e;We!==null;)if(e=We,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,We=n;else for(;We!==null;){e=We;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var _=y.memoizedProps,x=y.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?_:Is(e.type,_),x);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Se(163))}}catch(M){bn(e,e.return,M)}if(n=e.sibling,n!==null){n.return=e.return,We=n;break}We=e.return}return y=u2,u2=!1,y}function Sd(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&pS(e,t,s)}r=r.next}while(r!==i)}}function S_(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 mS(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 EB(n){var e=n.alternate;e!==null&&(n.alternate=null,EB(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[ro],delete e[Kd],delete e[tS],delete e[TO],delete e[CO])),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 wB(n){return n.tag===5||n.tag===3||n.tag===4}function h2(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||wB(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 gS(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=iy));else if(i!==4&&(n=n.child,n!==null))for(gS(n,e,t),n=n.sibling;n!==null;)gS(n,e,t),n=n.sibling}function yS(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(yS(n,e,t),n=n.sibling;n!==null;)yS(n,e,t),n=n.sibling}var xi=null,Ds=!1;function ga(n,e,t){for(t=t.child;t!==null;)TB(n,e,t),t=t.sibling}function TB(n,e,t){if(lo&&typeof lo.onCommitFiberUnmount=="function")try{lo.onCommitFiberUnmount(p_,t)}catch{}switch(t.tag){case 5:Li||rh(t,e);case 6:var i=xi,r=Ds;xi=null,ga(n,e,t),xi=i,Ds=r,xi!==null&&(Ds?(n=xi,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):xi.removeChild(t.stateNode));break;case 18:xi!==null&&(Ds?(n=xi,t=t.stateNode,n.nodeType===8?Nv(n.parentNode,t):n.nodeType===1&&Nv(n,t),Wd(n)):Nv(xi,t.stateNode));break;case 4:i=xi,r=Ds,xi=t.stateNode.containerInfo,Ds=!0,ga(n,e,t),xi=i,Ds=r;break;case 0:case 11:case 14:case 15:if(!Li&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&pS(t,e,o),r=r.next}while(r!==i)}ga(n,e,t);break;case 1:if(!Li&&(rh(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)}ga(n,e,t);break;case 21:ga(n,e,t);break;case 22:t.mode&1?(Li=(i=Li)||t.memoizedState!==null,ga(n,e,t),Li=i):ga(n,e,t);break;default:ga(n,e,t)}}function f2(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new VO),e.forEach(function(i){var r=$O.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function Ts(n,e){var t=e.deletions;if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:xi=a.stateNode,Ds=!1;break e;case 3:xi=a.stateNode.containerInfo,Ds=!0;break e;case 4:xi=a.stateNode.containerInfo,Ds=!0;break e}a=a.return}if(xi===null)throw Error(Se(160));TB(s,o,r),xi=null,Ds=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(c){bn(r,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)CB(e,n),e=e.sibling}function CB(n,e){var t=n.alternate,i=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Ts(e,n),Zs(n),i&4){try{Sd(3,n,n.return),S_(3,n)}catch(_){bn(n,n.return,_)}try{Sd(5,n,n.return)}catch(_){bn(n,n.return,_)}}break;case 1:Ts(e,n),Zs(n),i&512&&t!==null&&rh(t,t.return);break;case 5:if(Ts(e,n),Zs(n),i&512&&t!==null&&rh(t,t.return),n.flags&32){var r=n.stateNode;try{kd(r,"")}catch(_){bn(n,n.return,_)}}if(i&4&&(r=n.stateNode,r!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Kb(r,s),HA(a,o);var c=HA(a,s);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?eP(r,d):u==="dangerouslySetInnerHTML"?qb(r,d):u==="children"?kd(r,d):TM(r,u,d,c)}switch(a){case"input":FA(r,s);break;case"textarea":Qb(r,s);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?ph(r,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?ph(r,!!s.multiple,s.defaultValue,!0):ph(r,!!s.multiple,s.multiple?[]:"",!1))}r[Kd]=s}catch(_){bn(n,n.return,_)}}break;case 6:if(Ts(e,n),Zs(n),i&4){if(n.stateNode===null)throw Error(Se(162));r=n.stateNode,s=n.memoizedProps;try{r.nodeValue=s}catch(_){bn(n,n.return,_)}}break;case 3:if(Ts(e,n),Zs(n),i&4&&t!==null&&t.memoizedState.isDehydrated)try{Wd(e.containerInfo)}catch(_){bn(n,n.return,_)}break;case 4:Ts(e,n),Zs(n);break;case 13:Ts(e,n),Zs(n),r=n.child,r.flags&8192&&(s=r.memoizedState!==null,r.stateNode.isHidden=s,!s||r.alternate!==null&&r.alternate.memoizedState!==null||(sE=On())),i&4&&f2(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(Li=(c=Li)||u,Ts(e,n),Li=c):Ts(e,n),Zs(n),i&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(We=n,u=n.child;u!==null;){for(d=We=u;We!==null;){switch(p=We,m=p.child,p.tag){case 0:case 11:case 14:case 15:Sd(4,p,p.return);break;case 1:rh(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){i=p,t=p.return;try{e=i,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(_){bn(i,t,_)}}break;case 5:rh(p,p.return);break;case 22:if(p.memoizedState!==null){p2(d);continue}}m!==null?(m.return=p,We=m):p2(d)}u=u.sibling}e:for(u=null,d=n;;){if(d.tag===5){if(u===null){u=d;try{r=d.stateNode,c?(s=r.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=$b("display",o))}catch(_){bn(n,n.return,_)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(_){bn(n,n.return,_)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===n)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===n)break e;for(;d.sibling===null;){if(d.return===null||d.return===n)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ts(e,n),Zs(n),i&4&&f2(n);break;case 21:break;default:Ts(e,n),Zs(n)}}function Zs(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(wB(t)){var i=t;break e}t=t.return}throw Error(Se(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(kd(r,""),i.flags&=-33);var s=h2(n);yS(n,s,r);break;case 3:case 4:var o=i.stateNode.containerInfo,a=h2(n);gS(n,a,o);break;default:throw Error(Se(161))}}catch(l){bn(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function jO(n,e,t){We=n,RB(n)}function RB(n,e,t){for(var i=(n.mode&1)!==0;We!==null;){var r=We,s=r.child;if(r.tag===22&&i){var o=r.memoizedState!==null||c0;if(!o){var a=r.alternate,l=a!==null&&a.memoizedState!==null||Li;a=c0;var c=Li;if(c0=o,(Li=l)&&!c)for(We=r;We!==null;)o=We,l=o.child,o.tag===22&&o.memoizedState!==null?m2(r):l!==null?(l.return=o,We=l):m2(r);for(;s!==null;)We=s,RB(s),s=s.sibling;We=r,c0=a,Li=c}d2(n)}else r.subtreeFlags&8772&&s!==null?(s.return=r,We=s):d2(n)}}function d2(n){for(;We!==null;){var e=We;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Li||S_(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!Li)if(t===null)i.componentDidMount();else{var r=e.elementType===e.type?t.memoizedProps:Is(e.type,t.memoizedProps);i.componentDidUpdate(r,t.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&ZC(e,s,i);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}ZC(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Wd(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Se(163))}Li||e.flags&512&&mS(e)}catch(p){bn(e,e.return,p)}}if(e===n){We=null;break}if(t=e.sibling,t!==null){t.return=e.return,We=t;break}We=e.return}}function p2(n){for(;We!==null;){var e=We;if(e===n){We=null;break}var t=e.sibling;if(t!==null){t.return=e.return,We=t;break}We=e.return}}function m2(n){for(;We!==null;){var e=We;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{S_(4,e)}catch(l){bn(e,t,l)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(l){bn(e,r,l)}}var s=e.return;try{mS(e)}catch(l){bn(e,s,l)}break;case 5:var o=e.return;try{mS(e)}catch(l){bn(e,o,l)}}}catch(l){bn(e,e.return,l)}if(e===n){We=null;break}var a=e.sibling;if(a!==null){a.return=e.return,We=a;break}We=e.return}}var XO=Math.ceil,py=na.ReactCurrentDispatcher,iE=na.ReactCurrentOwner,ms=na.ReactCurrentBatchConfig,Ft=0,di=null,jn=null,Ai=0,wr=0,sh=ll(0),qn=0,tp=null,Sc=0,M_=0,rE=0,Md=null,sr=null,sE=0,Ih=1/0,Lo=null,my=!1,_S=null,Xa=null,u0=!1,za=null,gy=0,Ed=0,xS=null,Ng=-1,kg=0;function Ki(){return Ft&6?On():Ng!==-1?Ng:Ng=On()}function Ja(n){return n.mode&1?Ft&2&&Ai!==0?Ai&-Ai:bO.transition!==null?(kg===0&&(kg=fP()),kg):(n=Jt,n!==0||(n=window.event,n=n===void 0?16:xP(n.type)),n):1}function Us(n,e,t,i){if(50<Ed)throw Ed=0,xS=null,Error(Se(185));Rp(n,t,i),(!(Ft&2)||n!==di)&&(n===di&&(!(Ft&2)&&(M_|=t),qn===4&&Ia(n,Ai)),hr(n,i),t===1&&Ft===0&&!(e.mode&1)&&(Ih=On()+500,x_&&cl()))}function hr(n,e){var t=n.callbackNode;bF(n,e);var i=$g(n,n===di?Ai:0);if(i===0)t!==null&&EC(t),n.callbackNode=null,n.callbackPriority=0;else if(e=i&-i,n.callbackPriority!==e){if(t!=null&&EC(t),e===1)n.tag===0?RO(g2.bind(null,n)):UP(g2.bind(null,n)),EO(function(){!(Ft&6)&&cl()}),t=null;else{switch(dP(i)){case 1:t=BM;break;case 4:t=uP;break;case 16:t=qg;break;case 536870912:t=hP;break;default:t=qg}t=FB(t,bB.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function bB(n,e){if(Ng=-1,kg=0,Ft&6)throw Error(Se(327));var t=n.callbackNode;if(xh()&&n.callbackNode!==t)return null;var i=$g(n,n===di?Ai:0);if(i===0)return null;if(i&30||i&n.expiredLanes||e)e=yy(n,i);else{e=i;var r=Ft;Ft|=2;var s=BB();(di!==n||Ai!==e)&&(Lo=null,Ih=On()+500,lc(n,e));do try{KO();break}catch(a){PB(n,a)}while(!0);WM(),py.current=s,Ft=r,jn!==null?e=0:(di=null,Ai=0,e=qn)}if(e!==0){if(e===2&&(r=XA(n),r!==0&&(i=r,e=vS(n,r))),e===1)throw t=tp,lc(n,0),Ia(n,i),hr(n,On()),t;if(e===6)Ia(n,i);else{if(r=n.current.alternate,!(i&30)&&!JO(r)&&(e=yy(n,i),e===2&&(s=XA(n),s!==0&&(i=s,e=vS(n,s))),e===1))throw t=tp,lc(n,0),Ia(n,i),hr(n,On()),t;switch(n.finishedWork=r,n.finishedLanes=i,e){case 0:case 1:throw Error(Se(345));case 2:jl(n,sr,Lo);break;case 3:if(Ia(n,i),(i&130023424)===i&&(e=sE+500-On(),10<e)){if($g(n,0)!==0)break;if(r=n.suspendedLanes,(r&i)!==i){Ki(),n.pingedLanes|=n.suspendedLanes&r;break}n.timeoutHandle=eS(jl.bind(null,n,sr,Lo),e);break}jl(n,sr,Lo);break;case 4:if(Ia(n,i),(i&4194240)===i)break;for(e=n.eventTimes,r=-1;0<i;){var o=31-Os(i);s=1<<o,o=e[o],o>r&&(r=o),i&=~s}if(i=r,i=On()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*XO(i/1960))-i,10<i){n.timeoutHandle=eS(jl.bind(null,n,sr,Lo),i);break}jl(n,sr,Lo);break;case 5:jl(n,sr,Lo);break;default:throw Error(Se(329))}}}return hr(n,On()),n.callbackNode===t?bB.bind(null,n):null}function vS(n,e){var t=Md;return n.current.memoizedState.isDehydrated&&(lc(n,e).flags|=256),n=yy(n,e),n!==2&&(e=sr,sr=t,e!==null&&AS(e)),n}function AS(n){sr===null?sr=n:sr.push.apply(sr,n)}function JO(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var i=0;i<t.length;i++){var r=t[i],s=r.getSnapshot;r=r.value;try{if(!Ns(s(),r))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ia(n,e){for(e&=~rE,e&=~M_,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-Os(e),i=1<<t;n[t]=-1,e&=~i}}function g2(n){if(Ft&6)throw Error(Se(327));xh();var e=$g(n,0);if(!(e&1))return hr(n,On()),null;var t=yy(n,e);if(n.tag!==0&&t===2){var i=XA(n);i!==0&&(e=i,t=vS(n,i))}if(t===1)throw t=tp,lc(n,0),Ia(n,e),hr(n,On()),t;if(t===6)throw Error(Se(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,jl(n,sr,Lo),hr(n,On()),null}function oE(n,e){var t=Ft;Ft|=1;try{return n(e)}finally{Ft=t,Ft===0&&(Ih=On()+500,x_&&cl())}}function Mc(n){za!==null&&za.tag===0&&!(Ft&6)&&xh();var e=Ft;Ft|=1;var t=ms.transition,i=Jt;try{if(ms.transition=null,Jt=1,n)return n()}finally{Jt=i,ms.transition=t,Ft=e,!(Ft&6)&&cl()}}function aE(){wr=sh.current,un(sh)}function lc(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,MO(t)),jn!==null)for(t=jn.return;t!==null;){var i=t;switch(HM(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&ry();break;case 3:Ph(),un(cr),un(Ni),QM();break;case 5:KM(i);break;case 4:Ph();break;case 13:un(vn);break;case 19:un(vn);break;case 10:jM(i.type._context);break;case 22:case 23:aE()}t=t.return}if(di=n,jn=n=Ya(n.current,null),Ai=wr=e,qn=0,tp=null,rE=M_=Sc=0,sr=Md=null,Zl!==null){for(e=0;e<Zl.length;e++)if(t=Zl[e],i=t.interleaved,i!==null){t.interleaved=null;var r=i.next,s=t.pending;if(s!==null){var o=s.next;s.next=r,i.next=o}t.pending=i}Zl=null}return n}function PB(n,e){do{var t=jn;try{if(WM(),Fg.current=dy,fy){for(var i=En.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}fy=!1}if(Ac=0,ci=Zn=En=null,Ad=!1,qd=0,iE.current=null,t===null||t.return===null){qn=1,tp=e,jn=null;break}e:{var s=n,o=t.return,a=t,l=e;if(e=Ai,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=i2(o);if(m!==null){m.flags&=-257,r2(m,o,a,s,e),m.mode&1&&n2(s,c,e),e=m,l=c;var y=e.updateQueue;if(y===null){var _=new Set;_.add(l),e.updateQueue=_}else y.add(l);break e}else{if(!(e&1)){n2(s,c,e),lE();break e}l=Error(Se(426))}}else if(pn&&a.mode&1){var x=i2(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),r2(x,o,a,s,e),GM(Bh(l,a));break e}}s=l=Bh(l,a),qn!==4&&(qn=2),Md===null?Md=[s]:Md.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var g=dB(s,l,e);QC(s,g);break e;case 1:a=l;var v=s.type,S=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Xa===null||!Xa.has(S)))){s.flags|=65536,e&=-e,s.lanes|=e;var M=pB(s,a,e);QC(s,M);break e}}s=s.return}while(s!==null)}LB(t)}catch(w){e=w,jn===t&&t!==null&&(jn=t=t.return);continue}break}while(!0)}function BB(){var n=py.current;return py.current=dy,n===null?dy:n}function lE(){(qn===0||qn===3||qn===2)&&(qn=4),di===null||!(Sc&268435455)&&!(M_&268435455)||Ia(di,Ai)}function yy(n,e){var t=Ft;Ft|=2;var i=BB();(di!==n||Ai!==e)&&(Lo=null,lc(n,e));do try{YO();break}catch(r){PB(n,r)}while(!0);if(WM(),Ft=t,py.current=i,jn!==null)throw Error(Se(261));return di=null,Ai=0,qn}function YO(){for(;jn!==null;)IB(jn)}function KO(){for(;jn!==null&&!vF();)IB(jn)}function IB(n){var e=zB(n.alternate,n,wr);n.memoizedProps=n.pendingProps,e===null?LB(n):jn=e,iE.current=null}function LB(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=GO(t,e),t!==null){t.flags&=32767,jn=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{qn=6,jn=null;return}}else if(t=HO(t,e,wr),t!==null){jn=t;return}if(e=e.sibling,e!==null){jn=e;return}jn=e=n}while(e!==null);qn===0&&(qn=5)}function jl(n,e,t){var i=Jt,r=ms.transition;try{ms.transition=null,Jt=1,QO(n,e,t,i)}finally{ms.transition=r,Jt=i}return null}function QO(n,e,t,i){do xh();while(za!==null);if(Ft&6)throw Error(Se(327));t=n.finishedWork;var r=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(Se(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(PF(n,s),n===di&&(jn=di=null,Ai=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||u0||(u0=!0,FB(qg,function(){return xh(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=ms.transition,ms.transition=null;var o=Jt;Jt=1;var a=Ft;Ft|=4,iE.current=null,WO(n,t),CB(t,n),gO(qA),ey=!!ZA,qA=ZA=null,n.current=t,jO(t),AF(),Ft=a,Jt=o,ms.transition=s}else n.current=t;if(u0&&(u0=!1,za=n,gy=r),s=n.pendingLanes,s===0&&(Xa=null),EF(t.stateNode),hr(n,On()),e!==null)for(i=n.onRecoverableError,t=0;t<e.length;t++)r=e[t],i(r.value,{componentStack:r.stack,digest:r.digest});if(my)throw my=!1,n=_S,_S=null,n;return gy&1&&n.tag!==0&&xh(),s=n.pendingLanes,s&1?n===xS?Ed++:(Ed=0,xS=n):Ed=0,cl(),null}function xh(){if(za!==null){var n=dP(gy),e=ms.transition,t=Jt;try{if(ms.transition=null,Jt=16>n?16:n,za===null)var i=!1;else{if(n=za,za=null,gy=0,Ft&6)throw Error(Se(331));var r=Ft;for(Ft|=4,We=n.current;We!==null;){var s=We,o=s.child;if(We.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(We=c;We!==null;){var u=We;switch(u.tag){case 0:case 11:case 15:Sd(8,u,s)}var d=u.child;if(d!==null)d.return=u,We=d;else for(;We!==null;){u=We;var p=u.sibling,m=u.return;if(EB(u),u===c){We=null;break}if(p!==null){p.return=m,We=p;break}We=m}}}var y=s.alternate;if(y!==null){var _=y.child;if(_!==null){y.child=null;do{var x=_.sibling;_.sibling=null,_=x}while(_!==null)}}We=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,We=o;else e:for(;We!==null;){if(s=We,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Sd(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,We=g;break e}We=s.return}}var v=n.current;for(We=v;We!==null;){o=We;var S=o.child;if(o.subtreeFlags&2064&&S!==null)S.return=o,We=S;else e:for(o=v;We!==null;){if(a=We,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:S_(9,a)}}catch(w){bn(a,a.return,w)}if(a===o){We=null;break e}var M=a.sibling;if(M!==null){M.return=a.return,We=M;break e}We=a.return}}if(Ft=r,cl(),lo&&typeof lo.onPostCommitFiberRoot=="function")try{lo.onPostCommitFiberRoot(p_,n)}catch{}i=!0}return i}finally{Jt=t,ms.transition=e}}return!1}function y2(n,e,t){e=Bh(t,e),e=dB(n,e,1),n=ja(n,e,1),e=Ki(),n!==null&&(Rp(n,1,e),hr(n,e))}function bn(n,e,t){if(n.tag===3)y2(n,n,t);else for(;e!==null;){if(e.tag===3){y2(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Xa===null||!Xa.has(i))){n=Bh(t,n),n=pB(e,n,1),e=ja(e,n,1),n=Ki(),e!==null&&(Rp(e,1,n),hr(e,n));break}}e=e.return}}function ZO(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),e=Ki(),n.pingedLanes|=n.suspendedLanes&t,di===n&&(Ai&t)===t&&(qn===4||qn===3&&(Ai&130023424)===Ai&&500>On()-sE?lc(n,0):rE|=t),hr(n,e)}function DB(n,e){e===0&&(n.mode&1?(e=e0,e0<<=1,!(e0&130023424)&&(e0=4194304)):e=1);var t=Ki();n=Yo(n,e),n!==null&&(Rp(n,e,t),hr(n,t))}function qO(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),DB(n,t)}function $O(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Se(314))}i!==null&&i.delete(e),DB(n,t)}var zB;zB=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||cr.current)ar=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return ar=!1,kO(n,e,t);ar=!!(n.flags&131072)}else ar=!1,pn&&e.flags&1048576&&NP(e,ay,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Ug(n,e),n=e.pendingProps;var r=Ch(e,Ni.current);_h(e,t),r=qM(null,e,i,n,r,t);var s=$M();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ur(i)?(s=!0,sy(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,JM(e),r.updater=A_,e.stateNode=r,r._reactInternals=e,aS(e,i,n,t),e=uS(null,e,i,!0,s,t)):(e.tag=0,pn&&s&&kM(e),Xi(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Ug(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=tU(i),n=Is(i,n),r){case 0:e=cS(null,e,i,n,t);break e;case 1:e=a2(null,e,i,n,t);break e;case 11:e=s2(null,e,i,n,t);break e;case 14:e=o2(null,e,i,Is(i.type,n),t);break e}throw Error(Se(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Is(i,r),cS(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Is(i,r),a2(n,e,i,r,t);case 3:e:{if(_B(e),n===null)throw Error(Se(387));i=e.pendingProps,s=e.memoizedState,r=s.element,jP(n,e),uy(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Bh(Error(Se(423)),e),e=l2(n,e,i,t,r);break e}else if(i!==r){r=Bh(Error(Se(424)),e),e=l2(n,e,i,t,r);break e}else for(Pr=Wa(e.stateNode.containerInfo.firstChild),Dr=e,pn=!0,zs=null,t=VP(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Rh(),i===r){e=Ko(n,e,t);break e}Xi(n,e,i,t)}e=e.child}return e;case 5:return XP(e),n===null&&rS(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,$A(i,r)?o=null:s!==null&&$A(i,s)&&(e.flags|=32),yB(n,e),Xi(n,e,o,t),e.child;case 6:return n===null&&rS(e),null;case 13:return xB(n,e,t);case 4:return YM(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=bh(e,null,i,t):Xi(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Is(i,r),s2(n,e,i,r,t);case 7:return Xi(n,e,e.pendingProps,t),e.child;case 8:return Xi(n,e,e.pendingProps.children,t),e.child;case 12:return Xi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,an(ly,i._currentValue),i._currentValue=o,s!==null)if(Ns(s.value,o)){if(s.children===r.children&&!cr.current){e=Ko(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Wo(-1,t&-t),l.tag=2;var c=s.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}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),sS(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Se(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),sS(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Xi(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,_h(e,t),r=gs(r),i=i(r),e.flags|=1,Xi(n,e,i,t),e.child;case 14:return i=e.type,r=Is(i,e.pendingProps),r=Is(i.type,r),o2(n,e,i,r,t);case 15:return mB(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Is(i,r),Ug(n,e),e.tag=1,ur(i)?(n=!0,sy(e)):n=!1,_h(e,t),fB(e,i,r),aS(e,i,r,t),uS(null,e,i,!0,n,t);case 19:return vB(n,e,t);case 22:return gB(n,e,t)}throw Error(Se(156,e.tag))};function FB(n,e){return cP(n,e)}function eU(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 as(n,e,t,i){return new eU(n,e,t,i)}function cE(n){return n=n.prototype,!(!n||!n.isReactComponent)}function tU(n){if(typeof n=="function")return cE(n)?1:0;if(n!=null){if(n=n.$$typeof,n===RM)return 11;if(n===bM)return 14}return 2}function Ya(n,e){var t=n.alternate;return t===null?(t=as(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.
vendor: 74,263 bytes, lines 40-44
40childLanes,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 Hg(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")cE(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Ku:return cc(t.children,r,s,e);case CM:o=8,r|=8;break;case BA:return n=as(12,t,e,r|2),n.elementType=BA,n.lanes=s,n;case IA:return n=as(13,t,e,r),n.elementType=IA,n.lanes=s,n;case LA:return n=as(19,t,e,r),n.elementType=LA,n.lanes=s,n;case Xb:return E_(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Wb:o=10;break e;case jb:o=9;break e;case RM:o=11;break e;case bM:o=14;break e;case Ra:o=16,i=null;break e}throw Error(Se(130,n==null?n:typeof n,""))}return e=as(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function cc(n,e,t,i){return n=as(7,n,i,e),n.lanes=t,n}function E_(n,e,t,i){return n=as(22,n,i,e),n.elementType=Xb,n.lanes=t,n.stateNode={isHidden:!1},n}function Jv(n,e,t){return n=as(6,n,null,e),n.lanes=t,n}function Yv(n,e,t){return e=as(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function nU(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rv(0),this.expirationTimes=Rv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rv(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function uE(n,e,t,i,r,s,o,a,l){return n=new nU(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=as(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},JM(s),n}function iU(n,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yu,key:i==null?null:""+i,children:n,containerInfo:e,implementation:t}}function OB(n){if(!n)return el;n=n._reactInternals;e:{if(zc(n)!==n||n.tag!==1)throw Error(Se(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(ur(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Se(171))}if(n.tag===1){var t=n.type;if(ur(t))return OP(n,t,e)}return e}function UB(n,e,t,i,r,s,o,a,l){return n=uE(t,i,!0,n,r,s,o,a,l),n.context=OB(null),t=n.current,i=Ki(),r=Ja(t),s=Wo(i,r),s.callback=e??null,ja(t,s,r),n.current.lanes=r,Rp(n,r,i),hr(n,i),n}function w_(n,e,t,i){var r=e.current,s=Ki(),o=Ja(r);return t=OB(t),e.context===null?e.context=t:e.pendingContext=t,e=Wo(s,o),e.payload={element:n},i=i===void 0?null:i,i!==null&&(e.callback=i),n=ja(r,e,o),n!==null&&(Us(n,r,o,s),zg(n,r,o)),o}function _y(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function _2(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function hE(n,e){_2(n,e),(n=n.alternate)&&_2(n,e)}function rU(){return null}var NB=typeof reportError=="function"?reportError:function(n){console.error(n)};function fE(n){this._internalRoot=n}T_.prototype.render=fE.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Se(409));w_(n,e,null,null)};T_.prototype.unmount=fE.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;Mc(function(){w_(null,n,null,null)}),e[Jo]=null}};function T_(n){this._internalRoot=n}T_.prototype.unstable_scheduleHydration=function(n){if(n){var e=gP();n={blockedOn:null,target:n,priority:e};for(var t=0;t<Ba.length&&e!==0&&e<Ba[t].priority;t++);Ba.splice(t,0,n),t===0&&_P(n)}};function dE(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function C_(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function x2(){}function sU(n,e,t,i,r){if(r){if(typeof i=="function"){var s=i;i=function(){var c=_y(o);s.call(c)}}var o=UB(e,i,n,0,null,!1,!1,"",x2);return n._reactRootContainer=o,n[Jo]=o.current,Jd(n.nodeType===8?n.parentNode:n),Mc(),o}for(;r=n.lastChild;)n.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var c=_y(l);a.call(c)}}var l=uE(n,0,!1,null,null,!1,!1,"",x2);return n._reactRootContainer=l,n[Jo]=l.current,Jd(n.nodeType===8?n.parentNode:n),Mc(function(){w_(e,l,t,i)}),l}function R_(n,e,t,i,r){var s=t._reactRootContainer;if(s){var o=s;if(typeof r=="function"){var a=r;r=function(){var l=_y(o);a.call(l)}}w_(e,o,n,r)}else o=sU(t,e,n,r,i);return _y(o)}pP=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=cd(e.pendingLanes);t!==0&&(IM(e,t|1),hr(e,On()),!(Ft&6)&&(Ih=On()+500,cl()))}break;case 13:Mc(function(){var i=Yo(n,1);if(i!==null){var r=Ki();Us(i,n,1,r)}}),hE(n,1)}};LM=function(n){if(n.tag===13){var e=Yo(n,134217728);if(e!==null){var t=Ki();Us(e,n,134217728,t)}hE(n,134217728)}};mP=function(n){if(n.tag===13){var e=Ja(n),t=Yo(n,e);if(t!==null){var i=Ki();Us(t,n,e,i)}hE(n,e)}};gP=function(){return Jt};yP=function(n,e){var t=Jt;try{return Jt=n,e()}finally{Jt=t}};VA=function(n,e,t){switch(e){case"input":if(FA(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var i=t[e];if(i!==n&&i.form===n.form){var r=__(i);if(!r)throw Error(Se(90));Yb(i),FA(i,r)}}}break;case"textarea":Qb(n,t);break;case"select":e=t.value,e!=null&&ph(n,!!t.multiple,e,!1)}};iP=oE;rP=Mc;var oU={usingClientEntryPoint:!1,Events:[Pp,$u,__,tP,nP,oE]},Bf={findFiberByHostInstance:Ql,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},aU={bundleType:Bf.bundleType,version:Bf.version,rendererPackageName:Bf.rendererPackageName,rendererConfig:Bf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:na.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=aP(n),n===null?null:n.stateNode},findFiberByHostInstance:Bf.findFiberByHostInstance||rU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var h0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!h0.isDisabled&&h0.supportsFiber)try{p_=h0.inject(aU),lo=h0}catch{}}Hr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oU;Hr.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dE(e))throw Error(Se(200));return iU(n,e,null,t)};Hr.createRoot=function(n,e){if(!dE(n))throw Error(Se(299));var t=!1,i="",r=NB;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=uE(n,1,!1,null,null,t,!1,i,r),n[Jo]=e.current,Jd(n.nodeType===8?n.parentNode:n),new fE(e)};Hr.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(Se(188)):(n=Object.keys(n).join(","),Error(Se(268,n)));return n=aP(e),n=n===null?null:n.stateNode,n};Hr.flushSync=function(n){return Mc(n)};Hr.hydrate=function(n,e,t){if(!C_(e))throw Error(Se(200));return R_(null,n,e,!0,t)};Hr.hydrateRoot=function(n,e,t){if(!dE(n))throw Error(Se(405));var i=t!=null&&t.hydratedSources||null,r=!1,s="",o=NB;if(t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=UB(e,null,n,1,t??null,r,!1,s,o),n[Jo]=e.current,Jd(n),i)for(n=0;n<i.length;n++)t=i[n],r=t._getVersion,r=r(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,r]:e.mutableSourceEagerHydrationData.push(t,r);return new T_(e)};Hr.render=function(n,e,t){if(!C_(e))throw Error(Se(200));return R_(null,n,e,!1,t)};Hr.unmountComponentAtNode=function(n){if(!C_(n))throw Error(Se(40));return n._reactRootContainer?(Mc(function(){R_(null,null,n,!1,function(){n._reactRootContainer=null,n[Jo]=null})}),!0):!1};Hr.unstable_batchedUpdates=oE;Hr.unstable_renderSubtreeIntoContainer=function(n,e,t,i){if(!C_(t))throw Error(Se(200));if(n==null||n._reactInternals===void 0)throw Error(Se(38));return R_(n,e,t,!1,i)};Hr.version="18.3.1-next-f1338f8080-20240426";function kB(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kB)}catch(n){console.error(n)}}kB(),kb.exports=Hr;var lU=kb.exports,HB,v2=lU;HB=bA.createRoot=v2.createRoot,bA.hydrateRoot=v2.hydrateRoot;function Ec(){return Ec=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ec.apply(null,arguments)}/** 41 * @license 42 * Copyright 2010-2024 Three.js Authors 43 * SPDX-License-Identifier: MIT 44 */const Ip="166",cU={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},uU={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},GB=0,SS=1,VB=2,hU=3,WB=0,b_=1,wd=2,Ls=3,_s=0,zi=1,Rr=2,uo=0,ti=1,xy=2,MS=3,ES=4,jB=5,La=100,XB=101,JB=102,YB=103,KB=104,QB=200,ZB=201,qB=202,$B=203,vy=204,Ay=205,eI=206,tI=207,nI=208,iI=209,rI=210,sI=211,oI=212,aI=213,lI=214,cI=0,uI=1,hI=2,np=3,fI=4,dI=5,pI=6,mI=7,Lp=0,gI=1,yI=2,ho=0,_I=1,xI=2,vI=3,pE=4,AI=5,SI=6,MI=7,wS="attached",EI="detached",P_=300,Qo=301,tl=302,ip=303,rp=304,Qh=306,nl=1e3,Br=1001,Lh=1002,$n=1003,B_=1004,fU=1004,$l=1005,dU=1005,gn=1006,vh=1007,pU=1007,ls=1008,mU=1008,xs=1009,mE=1010,gE=1011,Dh=1012,I_=1013,Zo=1014,lr=1015,fo=1016,L_=1017,D_=1018,wc=1020,yE=35902,_E=1021,xE=1022,fi=1023,vE=1024,AE=1025,uc=1026,Tc=1027,z_=1028,Dp=1029,SE=1030,F_=1031,gU=1032,O_=1033,Td=33776,Cd=33777,Rd=33778,bd=33779,Sy=35840,My=35841,Ey=35842,wy=35843,Ty=36196,Cy=37492,Ry=37496,by=37808,Py=37809,By=37810,Iy=37811,Ly=37812,Dy=37813,zy=37814,Fy=37815,Oy=37816,Uy=37817,Ny=37818,ky=37819,Hy=37820,Gy=37821,Pd=36492,Vy=36494,Wy=36495,ME=36283,jy=36284,Xy=36285,Jy=36286,wI=2200,TI=2201,CI=2202,zh=2300,Fh=2301,Gg=2302,ec=2400,tc=2401,sp=2402,U_=2500,EE=2501,RI=0,wE=1,Yy=2,bI=3200,PI=3201,ul=0,BI=1,Uo="",rs="srgb",ia="srgb-linear",N_="display-p3",zp="display-p3-linear",op="linear",rn="srgb",ap="rec709",lp="p3",yU=0,Xl=7680,_U=7681,xU=7682,vU=7683,AU=34055,SU=34056,MU=5386,EU=512,wU=513,TU=514,CU=515,RU=516,bU=517,PU=518,TS=519,II=512,LI=513,DI=514,TE=515,zI=516,FI=517,OI=518,UI=519,cp=35044,BU=35048,IU=35040,LU=35045,DU=35049,zU=35041,FU=35046,OU=35050,UU=35042,NU="100",CS="300 es",oo=2e3,up=2001;let ra=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}};const Pi=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let A2=1234567;const hc=Math.PI/180,Oh=180/Math.PI;function zr(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(Pi[n&255]+Pi[n>>8&255]+Pi[n>>16&255]+Pi[n>>24&255]+"-"+Pi[e&255]+Pi[e>>8&255]+"-"+Pi[e>>16&15|64]+Pi[e>>24&255]+"-"+Pi[t&63|128]+Pi[t>>8&255]+"-"+Pi[t>>16&255]+Pi[t>>24&255]+Pi[i&255]+Pi[i>>8&255]+Pi[i>>16&255]+Pi[i>>24&255]).toLowerCase()}function Bn(n,e,t){return Math.max(e,Math.min(t,n))}function CE(n,e){return(n%e+e)%e}function kU(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function HU(n,e,t){return n!==e?(t-n)/(e-n):0}function Bd(n,e,t){return(1-t)*n+t*e}function GU(n,e,t,i){return Bd(n,e,1-Math.exp(-t*i))}function VU(n,e=1){return e-Math.abs(CE(n,e*2)-e)}function WU(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function jU(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function XU(n,e){return n+Math.floor(Math.random()*(e-n+1))}function JU(n,e){return n+Math.random()*(e-n)}function YU(n){return n*(.5-Math.random())}function KU(n){n!==void 0&&(A2=n);let e=A2+=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 QU(n){return n*hc}function ZU(n){return n*Oh}function qU(n){return(n&n-1)===0&&n!==0}function $U(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function eN(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function tN(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),y=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*d,l*p,a*c);break;case"YZY":n.set(l*p,a*u,l*d,a*c);break;case"ZXZ":n.set(l*d,l*p,a*u,a*c);break;case"XZX":n.set(a*u,l*y,l*m,a*c);break;case"YXY":n.set(l*m,a*u,l*y,a*c);break;case"ZYZ":n.set(l*y,l*m,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ji(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function At(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const pi={DEG2RAD:hc,RAD2DEG:Oh,generateUUID:zr,clamp:Bn,euclideanModulo:CE,mapLinear:kU,inverseLerp:HU,lerp:Bd,damp:GU,pingpong:VU,smoothstep:WU,smootherstep:jU,randInt:XU,randFloat:JU,randFloatSpread:YU,seededRandom:KU,degToRad:QU,radToDeg:ZU,isPowerOfTwo:qU,ceilPowerOfTwo:$U,floorPowerOfTwo:eN,setQuaternionFromProperEuler:tN,normalize:At,denormalize:Ji};class ce{constructor(e=0,t=0){ce.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Bn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class vt{constructor(e,t,i,r,s,o,a,l,c){vt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,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,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],d=i[7],p=i[2],m=i[5],y=i[8],_=r[0],x=r[3],g=r[6],v=r[1],S=r[4],M=r[7],w=r[2],T=r[5],R=r[8];return s[0]=o*_+a*v+l*w,s[3]=o*x+a*S+l*T,s[6]=o*g+a*M+l*R,s[1]=c*_+u*v+d*w,s[4]=c*x+u*S+d*T,s[7]=c*g+u*M+d*R,s[2]=p*_+m*v+y*w,s[5]=p*x+m*S+y*T,s[8]=p*g+m*M+y*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],r=e[2],s=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*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,p=a*l-u*s,m=c*s-o*l,y=t*d+i*p+r*m;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/y;return e[0]=d*_,e[1]=(r*c-u*i)*_,e[2]=(a*i-r*o)*_,e[3]=p*_,e[4]=(u*t-r*l)*_,e[5]=(r*s-a*t)*_,e[6]=m*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Kv.makeScale(e,t)),this}rotate(e){return this.premultiply(Kv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Kv.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Kv=new vt;function NI(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const nN={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oh(n,e){return new nN[n](e)}function hp(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function kI(){const n=hp("canvas");return n.style.display="block",n}const S2={};function RE(n){n in S2||(S2[n]=!0,console.warn(n))}function iN(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const M2=new vt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),E2=new vt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),f0={[ia]:{transfer:op,primaries:ap,toReference:n=>n,fromReference:n=>n},[rs]:{transfer:rn,primaries:ap,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[zp]:{transfer:op,primaries:lp,toReference:n=>n.applyMatrix3(E2),fromReference:n=>n.applyMatrix3(M2)},[N_]:{transfer:rn,primaries:lp,toReference:n=>n.convertSRGBToLinear().applyMatrix3(E2),fromReference:n=>n.applyMatrix3(M2).convertLinearToSRGB()}},rN=new Set([ia,zp]),Vt={enabled:!0,_workingColorSpace:ia,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!rN.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=f0[e].toReference,r=f0[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return f0[n].primaries},getTransfer:function(n){return n===Uo?op:f0[n].transfer}};function Ah(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Qv(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let lu;class HI{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{lu===void 0&&(lu=hp("canvas")),lu.width=e.width,lu.height=e.height;const i=lu.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=lu}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=hp("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Ah(s[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(Ah(t[i]/255)*255):t[i]=Ah(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let sN=0;class nc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:sN++}),this.uuid=zr(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(Zv(r[o].image)):s.push(Zv(r[o]))}else s=Zv(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Zv(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?HI.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let oN=0;class Zt extends ra{constructor(e=Zt.DEFAULT_IMAGE,t=Zt.DEFAULT_MAPPING,i=Br,r=Br,s=gn,o=ls,a=fi,l=xs,c=Zt.DEFAULT_ANISOTROPY,u=Uo){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:oN++}),this.uuid=zr(),this.name="",this.source=new nc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new ce(0,0),this.repeat=new ce(1,1),this.center=new ce(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new vt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==P_)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case nl:e.x=e.x-Math.floor(e.x);break;case Br:e.x=e.x<0?0:1;break;case Lh: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 nl:e.y=e.y-Math.floor(e.y);break;case Br:e.y=e.y<0?0:1;break;case Lh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Zt.DEFAULT_IMAGE=null;Zt.DEFAULT_MAPPING=P_;Zt.DEFAULT_ANISOTROPY=1;class Wt{constructor(e=0,t=0,i=0,r=1){Wt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],d=l[8],p=l[1],m=l[5],y=l[9],_=l[2],x=l[6],g=l[10];if(Math.abs(u-p)<.01&&Math.abs(d-_)<.01&&Math.abs(y-x)<.01){if(Math.abs(u+p)<.1&&Math.abs(d+_)<.1&&Math.abs(y+x)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const S=(c+1)/2,M=(m+1)/2,w=(g+1)/2,T=(u+p)/4,R=(d+_)/4,B=(y+x)/4;return S>M&&S>w?S<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(S),r=T/i,s=R/i):M>w?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=T/r,s=B/r):w<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(w),i=R/s,r=B/s),this.set(i,r,s,t),this}let v=Math.sqrt((x-y)*(x-y)+(d-_)*(d-_)+(p-u)*(p-u));return Math.abs(v)<.001&&(v=1),this.x=(x-y)/v,this.y=(d-_)/v,this.z=(p-u)/v,this.w=Math.acos((c+m+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class GI extends ra{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Wt(0,0,e,t),this.scissorTest=!1,this.viewport=new Wt(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:gn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Zt(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].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.textures.length=0;for(let i=0,r=e.textures.length;i<r;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new nc(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Fi extends GI{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class k_ extends Zt{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=$n,this.minFilter=$n,this.wrapR=Br,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class aN extends Fi{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new k_(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class bE extends Zt{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=$n,this.minFilter=$n,this.wrapR=Br,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class lN extends Fi{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new bE(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class Si{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],d=i[r+3];const p=s[o+0],m=s[o+1],y=s[o+2],_=s[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=u,e[t+3]=d;return}if(a===1){e[t+0]=p,e[t+1]=m,e[t+2]=y,e[t+3]=_;return}if(d!==_||l!==p||c!==m||u!==y){let x=1-a;const g=l*p+c*m+u*y+d*_,v=g>=0?1:-1,S=1-g*g;if(S>Number.EPSILON){const w=Math.sqrt(S),T=Math.atan2(w,g*v);x=Math.sin(x*T)/w,a=Math.sin(a*T)/w}const M=a*v;if(l=l*x+p*M,c=c*x+m*M,u=u*x+y*M,d=d*x+_*M,x===1-a){const w=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=w,c*=w,u*=w,d*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],d=s[o],p=s[o+1],m=s[o+2],y=s[o+3];return e[t]=a*y+u*d+l*m-c*p,e[t+1]=l*y+u*p+c*d-a*m,e[t+2]=c*y+u*m+a*p-l*d,e[t+3]=u*y-a*d-l*p-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),d=a(s/2),p=l(i/2),m=l(r/2),y=l(s/2);switch(o){case"XYZ":this._x=p*u*d+c*m*y,this._y=c*m*d-p*u*y,this._z=c*u*y+p*m*d,this._w=c*u*d-p*m*y;break;case"YXZ":this._x=p*u*d+c*m*y,this._y=c*m*d-p*u*y,this._z=c*u*y-p*m*d,this._w=c*u*d+p*m*y;break;case"ZXY":this._x=p*u*d-c*m*y,this._y=c*m*d+p*u*y,this._z=c*u*y+p*m*d,this._w=c*u*d-p*m*y;break;case"ZYX":this._x=p*u*d-c*m*y,this._y=c*m*d+p*u*y,this._z=c*u*y-p*m*d,this._w=c*u*d+p*m*y;break;case"YZX":this._x=p*u*d+c*m*y,this._y=c*m*d+p*u*y,this._z=c*u*y-p*m*d,this._w=c*u*d-p*m*y;break;case"XZY":this._x=p*u*d-c*m*y,this._y=c*m*d-p*u*y,this._z=c*u*y+p*m*d,this._w=c*u*d+p*m*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],d=t[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(u-l)*m,this._y=(s-c)*m,this._z=(o-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(u-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+c)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(s-c)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+u)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(o-r)/m,this._x=(s+c)/m,this._y=(l+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Bn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),d=Math.sin((1-t)*u)/c,p=Math.sin(t*u)/c;return this._w=o*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class z{constructor(e=0,t=0,i=0){z.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(w2.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(w2.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),d=2*(s*i-o*t);return this.x=t+l*c+o*d-a*u,this.y=i+l*u+a*c-s*d,this.z=r+l*d+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return qv.copy(this).projectOnVector(e),this.sub(qv)}reflect(e){return this.sub(qv.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(Bn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const qv=new z,w2=new Si;class Yt{constructor(e=new z(1/0,1/0,1/0),t=new z(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(Cs.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Cs.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Cs.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,Cs):Cs.fromBufferAttribute(s,o),Cs.applyMatrix4(e.matrixWorld),this.expandByPoint(Cs);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),d0.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),d0.copy(i.boundingBox)),d0.applyMatrix4(e.matrixWorld),this.union(d0)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Cs),Cs.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(If),p0.subVectors(this.max,If),cu.subVectors(e.a,If),uu.subVectors(e.b,If),hu.subVectors(e.c,If),ya.subVectors(uu,cu),_a.subVectors(hu,uu),Tl.subVectors(cu,hu);let t=[0,-ya.z,ya.y,0,-_a.z,_a.y,0,-Tl.z,Tl.y,ya.z,0,-ya.x,_a.z,0,-_a.x,Tl.z,0,-Tl.x,-ya.y,ya.x,0,-_a.y,_a.x,0,-Tl.y,Tl.x,0];return!$v(t,cu,uu,hu,p0)||(t=[1,0,0,0,1,0,0,0,1],!$v(t,cu,uu,hu,p0))?!1:(m0.crossVectors(ya,_a),t=[m0.x,m0.y,m0.z],$v(t,cu,uu,hu,p0))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Cs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Cs).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:(To[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),To[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),To[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),To[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),To[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),To[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),To[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),To[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(To),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 To=[new z,new z,new z,new z,new z,new z,new z,new z],Cs=new z,d0=new Yt,cu=new z,uu=new z,hu=new z,ya=new z,_a=new z,Tl=new z,If=new z,p0=new z,m0=new z,Cl=new z;function $v(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Cl.fromArray(n,s);const a=r.x*Math.abs(Cl.x)+r.y*Math.abs(Cl.y)+r.z*Math.abs(Cl.z),l=e.dot(Cl),c=t.dot(Cl),u=i.dot(Cl);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const cN=new Yt,Lf=new z,e1=new z;class Nn{constructor(e=new z,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):cN.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.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;Lf.subVectors(e,this.center);const t=Lf.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Lf,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(e1.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Lf.copy(e.center).add(e1)),this.expandByPoint(Lf.copy(e.center).sub(e1))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Co=new z,t1=new z,g0=new z,xa=new z,n1=new z,y0=new z,i1=new z;class hl{constructor(e=new z,t=new z(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Co)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Co.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Co.copy(this.origin).addScaledVector(this.direction,t),Co.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){t1.copy(e).add(t).multiplyScalar(.5),g0.copy(t).sub(e).normalize(),xa.copy(this.origin).sub(t1);const s=e.distanceTo(t)*.5,o=-this.direction.dot(g0),a=xa.dot(this.direction),l=-xa.dot(g0),c=xa.lengthSq(),u=Math.abs(1-o*o);let d,p,m,y;if(u>0)if(d=o*l-a,p=o*a-l,y=s*u,d>=0)if(p>=-y)if(p<=y){const _=1/u;d*=_,p*=_,m=d*(d+o*p+2*a)+p*(o*d+p+2*l)+c}else p=s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+c;else p=-s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+c;else p<=-y?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+c):p<=y?(d=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+c);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(t1).addScaledVector(g0,p),m}intersectSphere(e,t){Co.subVectors(e.center,this.origin);const i=Co.dot(this.direction),r=Co.dot(Co)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,p=this.origin;return c>=0?(i=(e.min.x-p.x)*c,r=(e.max.x-p.x)*c):(i=(e.max.x-p.x)*c,r=(e.min.x-p.x)*c),u>=0?(s=(e.min.y-p.y)*u,o=(e.max.y-p.y)*u):(s=(e.max.y-p.y)*u,o=(e.min.y-p.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),d>=0?(a=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Co)!==null}intersectTriangle(e,t,i,r,s){n1.subVectors(t,e),y0.subVectors(i,e),i1.crossVectors(n1,y0);let o=this.direction.dot(i1),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;xa.subVectors(this.origin,e);const l=a*this.direction.dot(y0.crossVectors(xa,y0));if(l<0)return null;const c=a*this.direction.dot(n1.cross(xa));if(c<0||l+c>o)return null;const u=-a*xa.dot(i1);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Ke{constructor(e,t,i,r,s,o,a,l,c,u,d,p,m,y,_,x){Ke.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,d,p,m,y,_,x)}set(e,t,i,r,s,o,a,l,c,u,d,p,m,y,_,x){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=d,g[14]=p,g[3]=m,g[7]=y,g[11]=_,g[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ke().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/fu.setFromMatrixColumn(e,0).length(),s=1/fu.setFromMatrixColumn(e,1).length(),o=1/fu.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=o*u,m=o*d,y=a*u,_=a*d;t[0]=l*u,t[4]=-l*d,t[8]=c,t[1]=m+y*c,t[5]=p-_*c,t[9]=-a*l,t[2]=_-p*c,t[6]=y+m*c,t[10]=o*l}else if(e.order==="YXZ"){const p=l*u,m=l*d,y=c*u,_=c*d;t[0]=p+_*a,t[4]=y*a-m,t[8]=o*c,t[1]=o*d,t[5]=o*u,t[9]=-a,t[2]=m*a-y,t[6]=_+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*u,m=l*d,y=c*u,_=c*d;t[0]=p-_*a,t[4]=-o*d,t[8]=y+m*a,t[1]=m+y*a,t[5]=o*u,t[9]=_-p*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*u,m=o*d,y=a*u,_=a*d;t[0]=l*u,t[4]=y*c-m,t[8]=p*c+_,t[1]=l*d,t[5]=_*c+p,t[9]=m*c-y,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*c,y=a*l,_=a*c;t[0]=l*u,t[4]=_-p*d,t[8]=y*d+m,t[1]=d,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=m*d+y,t[10]=p-_*d}else if(e.order==="XZY"){const p=o*l,m=o*c,y=a*l,_=a*c;t[0]=l*u,t[4]=-d,t[8]=c*u,t[1]=p*d+_,t[5]=o*u,t[9]=m*d-y,t[2]=y*d-m,t[6]=a*u,t[10]=_*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(uN,e,hN)}lookAt(e,t,i){const r=this.elements;return Mr.subVectors(e,t),Mr.lengthSq()===0&&(Mr.z=1),Mr.normalize(),va.crossVectors(i,Mr),va.lengthSq()===0&&(Math.abs(i.z)===1?Mr.x+=1e-4:Mr.z+=1e-4,Mr.normalize(),va.crossVectors(i,Mr)),va.normalize(),_0.crossVectors(Mr,va),r[0]=va.x,r[4]=_0.x,r[8]=Mr.x,r[1]=va.y,r[5]=_0.y,r[9]=Mr.y,r[2]=va.z,r[6]=_0.z,r[10]=Mr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],d=i[5],p=i[9],m=i[13],y=i[2],_=i[6],x=i[10],g=i[14],v=i[3],S=i[7],M=i[11],w=i[15],T=r[0],R=r[4],B=r[8],b=r[12],P=r[1],L=r[5],U=r[9],G=r[13],j=r[2],X=r[6],J=r[10],te=r[14],k=r[3],Q=r[7],$=r[11],oe=r[15];return s[0]=o*T+a*P+l*j+c*k,s[4]=o*R+a*L+l*X+c*Q,s[8]=o*B+a*U+l*J+c*$,s[12]=o*b+a*G+l*te+c*oe,s[1]=u*T+d*P+p*j+m*k,s[5]=u*R+d*L+p*X+m*Q,s[9]=u*B+d*U+p*J+m*$,s[13]=u*b+d*G+p*te+m*oe,s[2]=y*T+_*P+x*j+g*k,s[6]=y*R+_*L+x*X+g*Q,s[10]=y*B+_*U+x*J+g*$,s[14]=y*b+_*G+x*te+g*oe,s[3]=v*T+S*P+M*j+w*k,s[7]=v*R+S*L+M*X+w*Q,s[11]=v*B+S*U+M*J+w*$,s[15]=v*b+S*G+M*te+w*oe,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],p=e[10],m=e[14],y=e[3],_=e[7],x=e[11],g=e[15];return y*(+s*l*d-r*c*d-s*a*p+i*c*p+r*a*m-i*l*m)+_*(+t*l*m-t*c*p+s*o*p-r*o*m+r*c*u-s*l*u)+x*(+t*c*d-t*a*m-s*o*d+i*o*m+s*a*u-i*c*u)+g*(-r*a*u-t*l*d+t*a*p+r*o*d-i*o*p+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 r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],m=e[11],y=e[12],_=e[13],x=e[14],g=e[15],v=d*x*c-_*p*c+_*l*m-a*x*m-d*l*g+a*p*g,S=y*p*c-u*x*c-y*l*m+o*x*m+u*l*g-o*p*g,M=u*_*c-y*d*c+y*a*m-o*_*m-u*a*g+o*d*g,w=y*d*l-u*_*l-y*a*p+o*_*p+u*a*x-o*d*x,T=t*v+i*S+r*M+s*w;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/T;return e[0]=v*R,e[1]=(_*p*s-d*x*s-_*r*m+i*x*m+d*r*g-i*p*g)*R,e[2]=(a*x*s-_*l*s+_*r*c-i*x*c-a*r*g+i*l*g)*R,e[3]=(d*l*s-a*p*s-d*r*c+i*p*c+a*r*m-i*l*m)*R,e[4]=S*R,e[5]=(u*x*s-y*p*s+y*r*m-t*x*m-u*r*g+t*p*g)*R,e[6]=(y*l*s-o*x*s-y*r*c+t*x*c+o*r*g-t*l*g)*R,e[7]=(o*p*s-u*l*s+u*r*c-t*p*c-o*r*m+t*l*m)*R,e[8]=M*R,e[9]=(y*d*s-u*_*s-y*i*m+t*_*m+u*i*g-t*d*g)*R,e[10]=(o*_*s-y*a*s+y*i*c-t*_*c-o*i*g+t*a*g)*R,e[11]=(u*a*s-o*d*s-u*i*c+t*d*c+o*i*m-t*a*m)*R,e[12]=w*R,e[13]=(u*_*r-y*d*r+y*i*p-t*_*p-u*i*x+t*d*x)*R,e[14]=(y*a*r-o*_*r-y*i*l+t*_*l+o*i*x-t*a*x)*R,e[15]=(o*d*r-u*a*r+u*i*l-t*d*l-o*i*p+t*a*p)*R,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,d=a+a,p=s*c,m=s*u,y=s*d,_=o*u,x=o*d,g=a*d,v=l*c,S=l*u,M=l*d,w=i.x,T=i.y,R=i.z;return r[0]=(1-(_+g))*w,r[1]=(m+M)*w,r[2]=(y-S)*w,r[3]=0,r[4]=(m-M)*T,r[5]=(1-(p+g))*T,r[6]=(x+v)*T,r[7]=0,r[8]=(y+S)*R,r[9]=(x-v)*R,r[10]=(1-(p+_))*R,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=fu.set(r[0],r[1],r[2]).length();const o=fu.set(r[4],r[5],r[6]).length(),a=fu.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Rs.copy(this);const c=1/s,u=1/o,d=1/a;return Rs.elements[0]*=c,Rs.elements[1]*=c,Rs.elements[2]*=c,Rs.elements[4]*=u,Rs.elements[5]*=u,Rs.elements[6]*=u,Rs.elements[8]*=d,Rs.elements[9]*=d,Rs.elements[10]*=d,t.setFromRotationMatrix(Rs),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=oo){const l=this.elements,c=2*s/(t-e),u=2*s/(i-r),d=(t+e)/(t-e),p=(i+r)/(i-r);let m,y;if(a===oo)m=-(o+s)/(o-s),y=-2*o*s/(o-s);else if(a===up)m=-o/(o-s),y=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=oo){const l=this.elements,c=1/(t-e),u=1/(i-r),d=1/(o-s),p=(t+e)*c,m=(i+r)*u;let y,_;if(a===oo)y=(o+s)*d,_=-2*d;else if(a===up)y=s*d,_=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=_,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const fu=new z,Rs=new Ke,uN=new z(0,0,0),hN=new z(1,1,1),va=new z,_0=new z,Mr=new z,T2=new Ke,C2=new Si;class Ur{constructor(e=0,t=0,i=0,r=Ur.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(Bn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Bn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(Bn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Bn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Bn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-Bn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return T2.makeRotationFromQuaternion(e),this.setFromRotationMatrix(T2,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return C2.setFromEuler(this),this.setFromQuaternion(C2,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}}Ur.DEFAULT_ORDER="XYZ";class fc{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let fN=0;const R2=new z,du=new Si,Ro=new Ke,x0=new z,Df=new z,dN=new z,pN=new Si,b2=new z(1,0,0),P2=new z(0,1,0),B2=new z(0,0,1),I2={type:"added"},mN={type:"removed"},pu={type:"childadded",child:null},r1={type:"childremoved",child:null};class gt extends ra{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:fN++}),this.uuid=zr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=gt.DEFAULT_UP.clone();
vendor: 9,186 bytes, line 44
44const e=new z,t=new Ur,i=new Si,r=new z(1,1,1);function s(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ke},normalMatrix:{value:new vt}}),this.matrix=new Ke,this.matrixWorld=new Ke,this.matrixAutoUpdate=gt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=gt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new fc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return du.setFromAxisAngle(e,t),this.quaternion.multiply(du),this}rotateOnWorldAxis(e,t){return du.setFromAxisAngle(e,t),this.quaternion.premultiply(du),this}rotateX(e){return this.rotateOnAxis(b2,e)}rotateY(e){return this.rotateOnAxis(P2,e)}rotateZ(e){return this.rotateOnAxis(B2,e)}translateOnAxis(e,t){return R2.copy(e).applyQuaternion(this.quaternion),this.position.add(R2.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(b2,e)}translateY(e){return this.translateOnAxis(P2,e)}translateZ(e){return this.translateOnAxis(B2,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ro.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?x0.copy(e):x0.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Df.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ro.lookAt(Df,x0,this.up):Ro.lookAt(x0,Df,this.up),this.quaternion.setFromRotationMatrix(Ro),r&&(Ro.extractRotation(r.matrixWorld),du.setFromRotationMatrix(Ro),this.quaternion.premultiply(du.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(I2),pu.child=e,this.dispatchEvent(pu),pu.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(mN),r1.child=e,this.dispatchEvent(r1),r1.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ro.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ro.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ro),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(I2),pu.child=e,this.dispatchEvent(pu),pu.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Df,e,dN),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Df,pN,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const d=l[c];s(e.shapes,d)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(e.materials,this.material[l]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),u=o(e.images),d=o(e.shapes),p=o(e.skeletons),m=o(e.animations),y=o(e.nodes);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),d.length>0&&(i.shapes=d),p.length>
vendor: 7,564 bytes, line 44
440&&(i.skeletons=p),m.length>0&&(i.animations=m),y.length>0&&(i.nodes=y)}return i.object=r,i;function o(a){const l=[];for(const 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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}gt.DEFAULT_UP=new z(0,1,0);gt.DEFAULT_MATRIX_AUTO_UPDATE=!0;gt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const bs=new z,bo=new z,s1=new z,Po=new z,mu=new z,gu=new z,L2=new z,o1=new z,a1=new z,l1=new z;class hi{constructor(e=new z,t=new z,i=new z){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),bs.subVectors(e,t),r.cross(bs);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){bs.subVectors(r,t),bo.subVectors(i,t),s1.subVectors(e,t);const o=bs.dot(bs),a=bs.dot(bo),l=bs.dot(s1),c=bo.dot(bo),u=bo.dot(s1),d=o*c-a*a;if(d===0)return s.set(0,0,0),null;const p=1/d,m=(c*l-a*u)*p,y=(o*u-a*l)*p;return s.set(1-m-y,y,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Po)===null?!1:Po.x>=0&&Po.y>=0&&Po.x+Po.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,Po)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Po.x),l.addScaledVector(o,Po.y),l.addScaledVector(a,Po.z),l)}static isFrontFacing(e,t,i,r){return bs.subVectors(i,t),bo.subVectors(e,t),bs.cross(bo).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return bs.subVectors(this.c,this.b),bo.subVectors(this.a,this.b),bs.cross(bo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return hi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return hi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return hi.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return hi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return hi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;mu.subVectors(r,i),gu.subVectors(s,i),o1.subVectors(e,i);const l=mu.dot(o1),c=gu.dot(o1);if(l<=0&&c<=0)return t.copy(i);a1.subVectors(e,r);const u=mu.dot(a1),d=gu.dot(a1);if(u>=0&&d<=u)return t.copy(r);const p=l*d-u*c;if(p<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(mu,o);l1.subVectors(e,s);const m=mu.dot(l1),y=gu.dot(l1);if(y>=0&&m<=y)return t.copy(s);const _=m*c-l*y;if(_<=0&&c>=0&&y<=0)return a=c/(c-y),t.copy(i).addScaledVector(gu,a);const x=u*y-m*d;if(x<=0&&d-u>=0&&m-y>=0)return L2.subVectors(s,r),a=(d-u)/(d-u+(m-y)),t.copy(r).addScaledVector(L2,a);const g=1/(x+_+p);return o=_*g,a=p*g,t.copy(i).addScaledVector(mu,o).addScaledVector(gu,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const VI={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},Aa={h:0,s:0,l:0},v0={h:0,s:0,l:0};function c1(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 Re{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=rs){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Vt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Vt.workingColorSpace){return this.r=e,this.g=t,this.b=i,Vt.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Vt.workingColorSpace){if(e=CE(e,1),t=Bn(t,0,1),i=Bn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;
vendor: 4,735 bytes, line 44
44this.r=c1(o,s,e+1/3),this.g=c1(o,s,e),this.b=c1(o,s,e-1/3)}return Vt.toWorkingColorSpace(this,r),this}setStyle(e,t=rs){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=rs){const i=VI[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=Ah(e.r),this.g=Ah(e.g),this.b=Ah(e.b),this}copyLinearToSRGB(e){return this.r=Qv(e.r),this.g=Qv(e.g),this.b=Qv(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=rs){return Vt.fromWorkingColorSpace(Bi.copy(this),e),Math.round(Bn(Bi.r*255,0,255))*65536+Math.round(Bn(Bi.g*255,0,255))*256+Math.round(Bn(Bi.b*255,0,255))}getHexString(e=rs){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Vt.workingColorSpace){Vt.fromWorkingColorSpace(Bi.copy(this),t);const i=Bi.r,r=Bi.g,s=Bi.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const d=o-a;switch(c=u<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r<s?6:0);break;case r:l=(s-i)/d+2;break;case s:l=(i-r)/d+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=Vt.workingColorSpace){return Vt.fromWorkingColorSpace(Bi.copy(this),t),e.r=Bi.r,e.g=Bi.g,e.b=Bi.b,e}getStyle(e=rs){Vt.fromWorkingColorSpace(Bi.copy(this),e);const t=Bi.r,i=Bi.g,r=Bi.b;return e!==rs?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Aa),this.setHSL(Aa.h+e,Aa.s+t,Aa.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Aa),e.getHSL(v0);const i=Bd(Aa.h,v0.h,t),r=Bd(Aa.s,v0.s,t),s=Bd(Aa.l,v0.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Bi=new Re;Re.NAMES=VI;let gN=0;class Jn extends ra{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:gN++}),this.uuid=zr(),this.name="",this.type="Material",this.blending=ti,this.side=_s,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=vy,this.blendDst=Ay,this.blendEquation=La,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Re(0,0,0),this.blendAlpha=0,this.depthFunc=n
vendor: 55,370 bytes, lines 44-196
44p,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=TS,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Xl,this.stencilZFail=Xl,this.stencilZPass=Xl,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}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==ti&&(i.blending=this.blending),this.side!==_s&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==vy&&(i.blendSrc=this.blendSrc),this.blendDst!==Ay&&(i.blendDst=this.blendDst),this.blendEquation!==La&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==np&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==TS&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Xl&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Xl&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Xl&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class ei extends Jn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Re(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ur,this.combine=Lp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const No=yN();function yN(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function rr(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Bn(n,-65504,65504),No.floatView[0]=n;const e=No.uint32View[0],t=e>>23&511;return No.baseTable[t]+((e&8388607)>>No.shiftTable[t])}function hd(n){const e=n>>10;return No.uint32View[0]=No.mantissaTable[No.offsetTable[e]+(n&1023)]+No.exponentTable[e],No.floatView[0]}const _N={toHalfFloat:rr,fromHalfFloat:hd},Vn=new z,A0=new ce;class Lt{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=cp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=lr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return RE("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)A0.fromBufferAttribute(this,t),A0.applyMatrix3(e),this.setXY(t,A0.x,A0.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)Vn.fromBufferAttribute(this,t),Vn.applyMatrix3(e),this.setXYZ(t,Vn.x,Vn.y,Vn.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)Vn.fromBufferAttribute(this,t),Vn.applyMatrix4(e),this.setXYZ(t,Vn.x,Vn.y,Vn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Vn.fromBufferAttribute(this,t),Vn.applyNormalMatrix(e),this.setXYZ(t,Vn.x,Vn.y,Vn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Vn.fromBufferAttribute(this,t),Vn.transformDirection(e),this.setXYZ(t,Vn.x,Vn.y,Vn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Ji(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=At(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ji(t,this.array)),t}setX(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ji(t,this.array)),t}setY(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Ji(t,this.array)),t}setZ(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Ji(t,this.array)),t}setW(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array),s=At(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==cp&&(e.usage=this.usage),e}}class xN extends Lt{constructor(e,t,i){super(new Int8Array(e),t,i)}}class vN extends Lt{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class AN extends Lt{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class SN extends Lt{constructor(e,t,i){super(new Int16Array(e),t,i)}}class PE extends Lt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class MN extends Lt{constructor(e,t,i){super(new Int32Array(e),t,i)}}class BE extends Lt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class EN extends Lt{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=hd(this.array[e*this.itemSize]);return this.normalized&&(t=Ji(t,this.array)),t}setX(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize]=rr(t),this}getY(e){let t=hd(this.array[e*this.itemSize+1]);return this.normalized&&(t=Ji(t,this.array)),t}setY(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+1]=rr(t),this}getZ(e){let t=hd(this.array[e*this.itemSize+2]);return this.normalized&&(t=Ji(t,this.array)),t}setZ(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+2]=rr(t),this}getW(e){let t=hd(this.array[e*this.itemSize+3]);return this.normalized&&(t=Ji(t,this.array)),t}setW(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+3]=rr(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array)),this.array[e+0]=rr(t),this.array[e+1]=rr(i),this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array)),this.array[e+0]=rr(t),this.array[e+1]=rr(i),this.array[e+2]=rr(r),this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array),s=At(s,this.array)),this.array[e+0]=rr(t),this.array[e+1]=rr(i),this.array[e+2]=rr(r),this.array[e+3]=rr(s),this}}class qe extends Lt{constructor(e,t,i){super(new Float32Array(e),t,i)}}let wN=0;const qr=new Ke,u1=new gt,yu=new z,Er=new Yt,zf=new Yt,li=new z;class xt extends ra{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:wN++}),this.uuid=zr(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(NI(e)?BE:PE)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new vt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return qr.makeRotationFromQuaternion(e),this.applyMatrix4(qr),this}rotateX(e){return qr.makeRotationX(e),this.applyMatrix4(qr),this}rotateY(e){return qr.makeRotationY(e),this.applyMatrix4(qr),this}rotateZ(e){return qr.makeRotationZ(e),this.applyMatrix4(qr),this}translate(e,t,i){return qr.makeTranslation(e,t,i),this.applyMatrix4(qr),this}scale(e,t,i){return qr.makeScale(e,t,i),this.applyMatrix4(qr),this}lookAt(e){return u1.lookAt(e),u1.updateMatrix(),this.applyMatrix4(u1.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(yu).negate(),this.translate(yu.x,yu.y,yu.z),this}setFromPoints(e){const t=[];for(let i=0,r=e.length;i<r;i++){const s=e[i];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new qe(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Yt);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new z(-1/0,-1/0,-1/0),new z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];Er.setFromBufferAttribute(s),this.morphTargetsRelative?(li.addVectors(this.boundingBox.min,Er.min),this.boundingBox.expandByPoint(li),li.addVectors(this.boundingBox.max,Er.max),this.boundingBox.expandByPoint(li)):(this.boundingBox.expandByPoint(Er.min),this.boundingBox.expandByPoint(Er.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Nn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new z,1/0);return}if(e){const i=this.boundingSphere.center;if(Er.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];zf.setFromBufferAttribute(a),this.morphTargetsRelative?(li.addVectors(Er.min,zf.min),Er.expandByPoint(li),li.addVectors(Er.max,zf.max),Er.expandByPoint(li)):(Er.expandByPoint(zf.min),Er.expandByPoint(zf.max))}Er.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)li.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(li));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)li.fromBufferAttribute(a,c),l&&(yu.fromBufferAttribute(e,c),li.add(yu)),r=Math.max(r,i.distanceToSquared(li))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Lt(new Float32Array(4*i.count),4));const o=this.getAttribute("tangent"),a=[],l=[];for(let B=0;B<i.count;B++)a[B]=new z,l[B]=new z;const c=new z,u=new z,d=new z,p=new ce,m=new ce,y=new ce,_=new z,x=new z;function g(B,b,P){c.fromBufferAttribute(i,B),u.fromBufferAttribute(i,b),d.fromBufferAttribute(i,P),p.fromBufferAttribute(s,B),m.fromBufferAttribute(s,b),y.fromBufferAttribute(s,P),u.sub(c),d.sub(c),m.sub(p),y.sub(p);const L=1/(m.x*y.y-y.x*m.y);isFinite(L)&&(_.copy(u).multiplyScalar(y.y).addScaledVector(d,-m.y).multiplyScalar(L),x.copy(d).multiplyScalar(m.x).addScaledVector(u,-y.x).multiplyScalar(L),a[B].add(_),a[b].add(_),a[P].add(_),l[B].add(x),l[b].add(x),l[P].add(x))}let v=this.groups;v.length===0&&(v=[{start:0,count:e.count}]);for(let B=0,b=v.length;B<b;++B){const P=v[B],L=P.start,U=P.count;for(let G=L,j=L+U;G<j;G+=3)g(e.getX(G+0),e.getX(G+1),e.getX(G+2))}const S=new z,M=new z,w=new z,T=new z;function R(B){w.fromBufferAttribute(r,B),T.copy(w);const b=a[B];S.copy(b),S.sub(w.multiplyScalar(w.dot(b))).normalize(),M.crossVectors(T,b);const L=M.dot(l[B])<0?-1:1;o.setXYZW(B,S.x,S.y,S.z,L)}for(let B=0,b=v.length;B<b;++B){const P=v[B],L=P.start,U=P.count;for(let G=L,j=L+U;G<j;G+=3)R(e.getX(G+0)),R(e.getX(G+1)),R(e.getX(G+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Lt(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let p=0,m=i.count;p<m;p++)i.setXYZ(p,0,0,0);const r=new z,s=new z,o=new z,a=new z,l=new z,c=new z,u=new z,d=new z;if(e)for(let p=0,m=e.count;p<m;p+=3){const y=e.getX(p+0),_=e.getX(p+1),x=e.getX(p+2);r.fromBufferAttribute(t,y),s.fromBufferAttribute(t,_),o.fromBufferAttribute(t,x),u.subVectors(o,s),d.subVectors(r,s),u.cross(d),a.fromBufferAttribute(i,y),l.fromBufferAttribute(i,_),c.fromBufferAttribute(i,x),a.add(u),l.add(u),c.add(u),i.setXYZ(y,a.x,a.y,a.z),i.setXYZ(_,l.x,l.y,l.z),i.setXYZ(x,c.x,c.y,c.z)}else for(let p=0,m=t.count;p<m;p+=3)r.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),u.subVectors(o,s),d.subVectors(r,s),u.cross(d),i.setXYZ(p+0,u.x,u.y,u.z),i.setXYZ(p+1,u.x,u.y,u.z),i.setXYZ(p+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)li.fromBufferAttribute(e,t),li.normalize(),e.setXYZ(t,li.x,li.y,li.z)}toNonIndexed(){function e(a,l){const c=a.array,u=a.itemSize,d=a.normalized,p=new c.constructor(l.length*u);let m=0,y=0;for(let _=0,x=l.length;_<x;_++){a.isInterleavedBufferAttribute?m=l[_]*a.data.stride+a.offset:m=l[_]*u;for(let g=0;g<u;g++)p[y++]=c[m++]}return new Lt(p,u,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new xt,i=this.index.array,r=this.attributes;for(const a in r){const l=r[a],c=e(l,i);t.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let u=0,d=c.length;u<d;u++){const p=c[u],m=e(p,i);l.push(m)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(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 r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,p=c.length;d<p;d++){const m=c[d];u.push(m.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],d=s[c];for(let p=0,m=d.length;p<m;p++)u.push(d[p].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let c=0,u=o.length;c<u;c++){const d=o[c];this.addGroup(d.start,d.count,d.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const D2=new Ke,Rl=new hl,S0=new Nn,z2=new z,_u=new z,xu=new z,vu=new z,h1=new z,M0=new z,E0=new ce,w0=new ce,T0=new ce,F2=new z,O2=new z,U2=new z,C0=new z,R0=new z;class hn extends gt{constructor(e=new xt,t=new ei){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(s&&a){M0.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=a[l],d=s[l];u!==0&&(h1.fromBufferAttribute(d,e),o?M0.addScaledVector(h1,u):M0.addScaledVector(h1.sub(t),u))}t.add(M0)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),S0.copy(i.boundingSphere),S0.applyMatrix4(s),Rl.copy(e.ray).recast(e.near),!(S0.containsPoint(Rl.origin)===!1&&(Rl.intersectSphere(S0,z2)===null||Rl.origin.distanceToSquared(z2)>(e.far-e.near)**2))&&(D2.copy(s).invert(),Rl.copy(e.ray).applyMatrix4(D2),!(i.boundingBox!==null&&Rl.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Rl)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,d=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let y=0,_=p.length;y<_;y++){const x=p[y],g=o[x.materialIndex],v=Math.max(x.start,m.start),S=Math.min(a.count,Math.min(x.start+x.count,m.start+m.count));for(let M=v,w=S;M<w;M+=3){const T=a.getX(M),R=a.getX(M+1),B=a.getX(M+2);r=b0(this,g,e,i,c,u,d,T,R,B),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=x.materialIndex,t.push(r))}}else{const y=Math.max(0,m.start),_=Math.min(a.count,m.start+m.count);for(let x=y,g=_;x<g;x+=3){const v=a.getX(x),S=a.getX(x+1),M=a.getX(x+2);r=b0(this,o,e,i,c,u,d,v,S,M),r&&(r.faceIndex=Math.floor(x/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let y=0,_=p.length;y<_;y++){const x=p[y],g=o[x.materialIndex],v=Math.max(x.start,m.start),S=Math.min(l.count,Math.min(x.start+x.count,m.start+m.count));for(let M=v,w=S;M<w;M+=3){const T=M,R=M+1,B=M+2;r=b0(this,g,e,i,c,u,d,T,R,B),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=x.materialIndex,t.push(r))}}else{const y=Math.max(0,m.start),_=Math.min(l.count,m.start+m.count);for(let x=y,g=_;x<g;x+=3){const v=x,S=x+1,M=x+2;r=b0(this,o,e,i,c,u,d,v,S,M),r&&(r.faceIndex=Math.floor(x/3),t.push(r))}}}}function TN(n,e,t,i,r,s,o,a){let l;if(e.side===zi?l=i.intersectTriangle(o,s,r,!0,a):l=i.intersectTriangle(r,s,o,e.side===_s,a),l===null)return null;R0.copy(a),R0.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(R0);return c<t.near||c>t.far?null:{distance:c,point:R0.clone(),object:n}}function b0(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,_u),n.getVertexPosition(l,xu),n.getVertexPosition(c,vu);const u=TN(n,e,t,i,_u,xu,vu,C0);if(u){r&&(E0.fromBufferAttribute(r,a),w0.fromBufferAttribute(r,l),T0.fromBufferAttribute(r,c),u.uv=hi.getInterpolation(C0,_u,xu,vu,E0,w0,T0,new ce)),s&&(E0.fromBufferAttribute(s,a),w0.fromBufferAttribute(s,l),T0.fromBufferAttribute(s,c),u.uv1=hi.getInterpolation(C0,_u,xu,vu,E0,w0,T0,new ce)),o&&(F2.fromBufferAttribute(o,a),O2.fromBufferAttribute(o,l),U2.fromBufferAttribute(o,c),u.normal=hi.getInterpolation(C0,_u,xu,vu,F2,O2,U2,new z),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new z,materialIndex:0};hi.getNormal(_u,xu,vu,d.normal),u.face=d}return u}class Fc extends xt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],d=[];let p=0,m=0;y("z","y","x",-1,-1,i,t,e,o,s,0),y("z","y","x",1,-1,i,t,-e,o,s,1),y("x","z","y",1,1,e,i,t,r,o,2),y("x","z","y",1,-1,e,i,-t,r,o,3),y("x","y","z",1,-1,e,t,i,r,s,4),y("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new qe(c,3)),this.setAttribute("normal",new qe(u,3)),this.setAttribute("uv",new qe(d,2));function y(_,x,g,v,S,M,w,T,R,B,b){const P=M/R,L=w/B,U=M/2,G=w/2,j=T/2,X=R+1,J=B+1;let te=0,k=0;const Q=new z;for(let $=0;$<J;$++){const oe=$*L-G;for(let xe=0;xe<X;xe++){const De=xe*P-U;Q[_]=De*v,Q[x]=oe*S,Q[g]=j,c.push(Q.x,Q.y,Q.z),Q[_]=0,Q[x]=0,Q[g]=T>0?1:-1,u.push(Q.x,Q.y,Q.z),d.push(xe/R),d.push(1-$/B),te+=1}}for(let $=0;$<B;$++)for(let oe=0;oe<R;oe++){const xe=p+oe+X*$,De=p+oe+X*($+1),ne=p+(oe+1)+X*($+1),fe=p+(oe+1)+X*$;l.push(xe,De,fe),l.push(De,ne,fe),k+=6}a.addGroup(m,k,b),m+=k,p+=te}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fc(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Uh(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function ji(n){const e={};for(let t=0;t<n.length;t++){const i=Uh(n[t]);for(const r in i)e[r]=i[r]}return e}function CN(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function WI(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Vt.workingColorSpace}const fp={clone:Uh,merge:ji};var RN=`void main() { 45 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 46}`,bN=`void main() { 47 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 48}`;class vi extends Jn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=RN,this.fragmentShader=bN,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Uh(e.uniforms),this.uniformsGroups=CN(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Fp extends gt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ke,this.projectionMatrix=new Ke,this.projectionMatrixInverse=new Ke,this.coordinateSystem=oo}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Sa=new z,N2=new ce,k2=new ce;class Un extends Fp{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Oh*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(hc*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Oh*2*Math.atan(Math.tan(hc*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Sa.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Sa.x,Sa.y).multiplyScalar(-e/Sa.z),Sa.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Sa.x,Sa.y).multiplyScalar(-e/Sa.z)}getViewSize(e,t){return this.getViewBounds(e,N2,k2),t.subVectors(k2,N2)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(hc*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Au=-90,Su=1;class jI extends gt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Un(Au,Su,e,t);r.layers=this.layers,this.add(r);const s=new Un(Au,Su,e,t);s.layers=this.layers,this.add(s);const o=new Un(Au,Su,e,t);o.layers=this.layers,this.add(o);const a=new Un(Au,Su,e,t);a.layers=this.layers,this.add(a);const l=new Un(Au,Su,e,t);l.layers=this.layers,this.add(l);const c=new Un(Au,Su,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===oo)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===up)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,d=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(d,p,m),e.xr.enabled=y,i.texture.needsPMREMUpdate=!0}}class Op extends Zt{constructor(e,t,i,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:Qo,super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class XI extends Fi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Op(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:gn}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:` 49 50 varying vec3 vWorldDirection; 51 52 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 53 54 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 55 56 } 57 58 void main() { 59 60 vWorldDirection = transformDirection( position, modelMatrix ); 61 62 #include <begin_vertex> 63 #include <project_vertex> 64 65 } 66 `,fragmentShader:` 67 68 uniform sampler2D tEquirect; 69 70 varying vec3 vWorldDirection; 71 72 #include <common> 73 74 void main() { 75 76 vec3 direction = normalize( vWorldDirection ); 77 78 vec2 sampleUV = equirectUv( direction ); 79 80 gl_FragColor = texture2D( tEquirect, sampleUV ); 81 82 } 83 `},r=new Fc(5,5,5),s=new vi({name:"CubemapFromEquirect",uniforms:Uh(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:zi,blending:uo});s.uniforms.tEquirect.value=t;const o=new hn(r,s),a=t.minFilter;return t.minFilter===ls&&(t.minFilter=gn),new jI(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const f1=new z,PN=new z,BN=new vt;class io{constructor(e=new z(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=f1.subVectors(i,t).cross(PN.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(f1),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||BN.getNormalMatrix(e),r=this.coplanarPoint(f1).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const bl=new Nn,P0=new z;class Up{constructor(e=new io,t=new io,i=new io,r=new io,s=new io,o=new io){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=oo){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],d=r[6],p=r[7],m=r[8],y=r[9],_=r[10],x=r[11],g=r[12],v=r[13],S=r[14],M=r[15];if(i[0].setComponents(l-s,p-c,x-m,M-g).normalize(),i[1].setComponents(l+s,p+c,x+m,M+g).normalize(),i[2].setComponents(l+o,p+u,x+y,M+v).normalize(),i[3].setComponents(l-o,p-u,x-y,M-v).normalize(),i[4].setComponents(l-a,p-d,x-_,M-S).normalize(),t===oo)i[5].setComponents(l+a,p+d,x+_,M+S).normalize();else if(t===up)i[5].setComponents(a,d,_,S).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),bl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),bl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(bl)}intersectsSprite(e){return bl.center.set(0,0,0),bl.radius=.7071067811865476,bl.applyMatrix4(e.matrixWorld),this.intersectsSphere(bl)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(P0.x=r.normal.x>0?e.max.x:e.min.x,P0.y=r.normal.y>0?e.max.y:e.min.y,P0.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(P0)<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 JI(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function IN(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,d=c.byteLength,p=n.createBuffer();n.bindBuffer(l,p),n.bufferData(l,c,u),a.onUploadCallback();let m;if(c instanceof Float32Array)m=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?m=n.HALF_FLOAT: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:p,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:d}}function i(a,l,c){const u=l.array,d=l._updateRange,p=l.updateRanges;if(n.bindBuffer(c,a),d.count===-1&&p.length===0&&n.bufferSubData(c,0,u),p.length!==0){for(let m=0,y=p.length;m<y;m++){const _=p[m];n.bufferSubData(c,_.start*u.BYTES_PER_ELEMENT,u,_.start,_.count)}l.clearUpdateRanges()}d.count!==-1&&(n.bufferSubData(c,d.offset*u.BYTES_PER_ELEMENT,u,d.offset,d.count),d.count=-1),l.onUploadCallback()}function r(a){return a.isInterleavedBufferAttribute&&(a=a.data),e.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);const l=e.get(a);l&&(n.deleteBuffer(l.buffer),e.delete(a))}function o(a,l){if(a.isGLBufferAttribute){const u=e.get(a);(!u||u.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}a.isInterleavedBufferAttribute&&(a=a.data);const c=e.get(a);if(c===void 0)e.set(a,t(a,l));else if(c.version<a.version){if(c.size!==a.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");i(c.buffer,a,l),c.version=a.version}}return{get:r,remove:s,update:o}}class Oc extends xt{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,o=t/2,a=Math.floor(i),l=Math.floor(r),c=a+1,u=l+1,d=e/a,p=t/l,m=[],y=[],_=[],x=[];for(let g=0;g<u;g++){const v=g*p-o;for(let S=0;S<c;S++){const M=S*d-s;y.push(M,-v,0),_.push(0,0,1),x.push(S/a),x.push(1-g/l)}}for(let g=0;g<l;g++)for(let v=0;v<a;v++){const S=v+c*g,M=v+c*(g+1),w=v+1+c*(g+1),T=v+1+c*g;m.push(S,M,T),m.push(M,w,T)}this.setIndex(m),this.setAttribute("position",new qe(y,3)),this.setAttribute("normal",new qe(_,3)),this.setAttribute("uv",new qe(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Oc(e.width,e.height,e.widthSegments,e.heightSegments)}}var LN=`#ifdef USE_ALPHAHASH 84 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 85#endif`,DN=`#ifdef USE_ALPHAHASH 86 const float ALPHA_HASH_SCALE = 0.05; 87 float hash2D( vec2 value ) { 88 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 89 } 90 float hash3D( vec3 value ) { 91 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 92 } 93 float getAlphaHashThreshold( vec3 position ) { 94 float maxDeriv = max( 95 length( dFdx( position.xyz ) ), 96 length( dFdy( position.xyz ) ) 97 ); 98 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 99 vec2 pixScales = vec2( 100 exp2( floor( log2( pixScale ) ) ), 101 exp2( ceil( log2( pixScale ) ) ) 102 ); 103 vec2 alpha = vec2( 104 hash3D( floor( pixScales.x * position.xyz ) ), 105 hash3D( floor( pixScales.y * position.xyz ) ) 106 ); 107 float lerpFactor = fract( log2( pixScale ) ); 108 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 109 float a = min( lerpFactor, 1.0 - lerpFactor ); 110 vec3 cases = vec3( 111 x * x / ( 2.0 * a * ( 1.0 - a ) ), 112 ( x - 0.5 * a ) / ( 1.0 - a ), 113 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 114 ); 115 float threshold = ( x < ( 1.0 - a ) ) 116 ? ( ( x < a ) ? cases.x : cases.y ) 117 : cases.z; 118 return clamp( threshold , 1.0e-6, 1.0 ); 119 } 120#endif`,zN=`#ifdef USE_ALPHAMAP 121 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 122#endif`,FN=`#ifdef USE_ALPHAMAP 123 uniform sampler2D alphaMap; 124#endif`,ON=`#ifdef USE_ALPHATEST 125 #ifdef ALPHA_TO_COVERAGE 126 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 127 if ( diffuseColor.a == 0.0 ) discard; 128 #else 129 if ( diffuseColor.a < alphaTest ) discard; 130 #endif 131#endif`,UN=`#ifdef USE_ALPHATEST 132 uniform float alphaTest; 133#endif`,NN=`#ifdef USE_AOMAP 134 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 135 reflectedLight.indirectDiffuse *= ambientOcclusion; 136 #if defined( USE_CLEARCOAT ) 137 clearcoatSpecularIndirect *= ambientOcclusion; 138 #endif 139 #if defined( USE_SHEEN ) 140 sheenSpecularIndirect *= ambientOcclusion; 141 #endif 142 #if defined( USE_ENVMAP ) && defined( STANDARD ) 143 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 144 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 145 #endif 146#endif`,kN=`#ifdef USE_AOMAP 147 uniform sampler2D aoMap; 148 uniform float aoMapIntensity; 149#endif`,HN=`#ifdef USE_BATCHING 150 #if ! defined( GL_ANGLE_multi_draw ) 151 #define gl_DrawID _gl_DrawID 152 uniform int _gl_DrawID; 153 #endif 154 uniform highp sampler2D batchingTexture; 155 uniform highp usampler2D batchingIdTexture; 156 mat4 getBatchingMatrix( const in float i ) { 157 int size = textureSize( batchingTexture, 0 ).x; 158 int j = int( i ) * 4; 159 int x = j % size; 160 int y = j / size; 161 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 162 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 163 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 164 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 165 return mat4( v1, v2, v3, v4 ); 166 } 167 float getIndirectIndex( const in int i ) { 168 int size = textureSize( batchingIdTexture, 0 ).x; 169 int x = i % size; 170 int y = i / size; 171 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 172 } 173#endif 174#ifdef USE_BATCHING_COLOR 175 uniform sampler2D batchingColorTexture; 176 vec3 getBatchingColor( const in float i ) { 177 int size = textureSize( batchingColorTexture, 0 ).x; 178 int j = int( i ); 179 int x = j % size; 180 int y = j / size; 181 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb; 182 } 183#endif`,GN=`#ifdef USE_BATCHING 184 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 185#endif`,VN=`vec3 transformed = vec3( position ); 186#ifdef USE_ALPHAHASH 187 vPosition = vec3( position ); 188#endif`,WN=`vec3 objectNormal = vec3( normal ); 189#ifdef USE_TANGENT 190 vec3 objectTangent = vec3( tangent.xyz ); 191#endif`,jN=`float G_BlinnPhong_Implicit( ) { 192 return 0.25; 193} 194float D_BlinnPhong( const in float shininess, const in float dotNH ) { 195 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 196}
197vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 198 vec3 halfDir = normalize( lightDir + viewDir ); 199 float dotNH = saturate( dot( normal, halfDir ) ); 200 float dotVH = saturate( dot( viewDir, halfDir ) ); 201 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 202 float G = G_BlinnPhong_Implicit( ); 203 float D = D_BlinnPhong( shininess, dotNH ); 204 return F * ( G * D ); 205} // validated`,XN=`#ifdef USE_IRIDESCENCE 206 const mat3 XYZ_TO_REC709 = mat3( 207 3.2404542, -0.9692660, 0.0556434, 208 -1.5371385, 1.8760108, -0.2040259, 209 -0.4985314, 0.0415560, 1.0572252 210 ); 211 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 212 vec3 sqrtF0 = sqrt( fresnel0 ); 213 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 214 } 215 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 216 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 217 } 218 float IorToFresnel0( float transmittedIor, float incidentIor ) { 219 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 220 } 221 vec3 evalSensitivity( float OPD, vec3 shift ) { 222 float phase = 2.0 * PI * OPD * 1.0e-9; 223 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 224 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 225 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 226 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 227 xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); 228 xyz /= 1.0685e-7; 229 vec3 rgb = XYZ_TO_REC709 * xyz; 230 return rgb; 231 } 232 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 233 vec3 I; 234 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 235 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 236 float cosTheta2Sq = 1.0 - sinTheta2Sq; 237 if ( cosTheta2Sq < 0.0 ) { 238 return vec3( 1.0 ); 239 } 240 float cosTheta2 = sqrt( cosTheta2Sq ); 241 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); 242 float R12 = F_Schlick( R0, 1.0, cosTheta1 );
243 float T121 = 1.0 - R12; 244 float phi12 = 0.0; 245 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 246 float phi21 = PI - phi12; 247 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 248 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 249 vec3 phi23 = vec3( 0.0 ); 250 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 251 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 252 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 253 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 254 vec3 phi = vec3( phi21 ) + phi23; 255 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 256 vec3 r123 = sqrt( R123 ); 257 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 258 vec3 C0 = R12 + Rs; 259 I = C0; 260 vec3 Cm = Rs - T121; 261 for ( int m = 1; m <= 2; ++ m ) { 262 Cm *= r123; 263 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 264 I += Cm * Sm; 265 } 266 return max( I, vec3( 0.0 ) ); 267 } 268#endif`,JN=`#ifdef USE_BUMPMAP 269 uniform sampler2D bumpMap; 270 uniform float bumpScale; 271 vec2 dHdxy_fwd() { 272 vec2 dSTdx = dFdx( vBumpMapUv ); 273 vec2 dSTdy = dFdy( vBumpMapUv ); 274 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 275 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 276 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 277 return vec2( dBx, dBy ); 278 } 279 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 280 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 281 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 282 vec3 vN = surf_norm; 283 vec3 R1 = cross( vSigmaY, vN ); 284 vec3 R2 = cross( vN, vSigmaX ); 285 float fDet = dot( vSigmaX, R1 ) * faceDirection; 286 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 287 return normalize( abs( fDet ) * surf_norm - vGrad ); 288 } 289#endif`,YN=`#if NUM_CLIPPING_PLANES > 0 290 vec4 plane; 291 #ifdef ALPHA_TO_COVERAGE 292 float distanceToPlane, distanceGradient; 293 float clipOpacity = 1.0; 294 #pragma unroll_loop_start 295 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 296 plane = clippingPlanes[ i ]; 297 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 298 distanceGradient = fwidth( distanceToPlane ) / 2.0; 299 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 300 if ( clipOpacity == 0.0 ) discard; 301 } 302 #pragma unroll_loop_end 303 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 304 float unionClipOpacity = 1.0; 305 #pragma unroll_loop_start 306 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 307 plane = clippingPlanes[ i ]; 308 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 309 distanceGradient = fwidth( distanceToPlane ) / 2.0; 310 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 311 } 312 #pragma unroll_loop_end 313 clipOpacity *= 1.0 - unionClipOpacity; 314 #endif 315 diffuseColor.a *= clipOpacity; 316 if ( diffuseColor.a == 0.0 ) discard; 317 #else 318 #pragma unroll_loop_start 319 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 320 plane = clippingPlanes[ i ]; 321 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 322 } 323 #pragma unroll_loop_end 324 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 325 bool clipped = true; 326 #pragma unroll_loop_start 327 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 328 plane = clippingPlanes[ i ]; 329 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 330 } 331 #pragma unroll_loop_end 332 if ( clipped ) discard; 333 #endif 334 #endif 335#endif`,KN=`#if NUM_CLIPPING_PLANES > 0 336 varying vec3 vClipPosition; 337 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 338#endif`,QN=`#if NUM_CLIPPING_PLANES > 0 339 varying vec3 vClipPosition; 340#endif`,ZN=`#if NUM_CLIPPING_PLANES > 0 341 vClipPosition = - mvPosition.xyz; 342#endif`,qN=`#if defined( USE_COLOR_ALPHA ) 343 diffuseColor *= vColor; 344#elif defined( USE_COLOR ) 345 diffuseColor.rgb *= vColor; 346#endif`,$N=`#if defined( USE_COLOR_ALPHA ) 347 varying vec4 vColor; 348#elif defined( USE_COLOR ) 349 varying vec3 vColor; 350#endif`,e6=`#if defined( USE_COLOR_ALPHA ) 351 varying vec4 vColor; 352#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 353 varying vec3 vColor; 354#endif`,t6=`#if defined( USE_COLOR_ALPHA ) 355 vColor = vec4( 1.0 ); 356#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 357 vColor = vec3( 1.0 ); 358#endif 359#ifdef USE_COLOR 360 vColor *= color; 361#endif 362#ifdef USE_INSTANCING_COLOR 363 vColor.xyz *= instanceColor.xyz; 364#endif 365#ifdef USE_BATCHING_COLOR 366 vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); 367 vColor.xyz *= batchingColor.xyz; 368#endif`,n6=`#define PI 3.141592653589793 369#define PI2 6.283185307179586 370#define PI_HALF 1.5707963267948966 371#define RECIPROCAL_PI 0.3183098861837907 372#define RECIPROCAL_PI2 0.15915494309189535 373#define EPSILON 1e-6 374#ifndef saturate 375#define saturate( a ) clamp( a, 0.0, 1.0 ) 376#endif 377#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 378float pow2( const in float x ) { return x*x; } 379vec3 pow2( const in vec3 x ) { return x*x; } 380float pow3( const in float x ) { return x*x*x; } 381float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 382float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 383float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 384highp float rand( const in vec2 uv ) { 385 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 386 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 387 return fract( sin( sn ) * c ); 388} 389#ifdef HIGH_PRECISION 390 float precisionSafeLength( vec3 v ) { return length( v ); } 391#else 392 float precisionSafeLength( vec3 v ) { 393 float maxComponent = max3( abs( v ) ); 394 return length( v / maxComponent ) * maxComponent; 395 } 396#endif 397struct IncidentLight { 398 vec3 color; 399 vec3 direction; 400 bool visible; 401}; 402struct ReflectedLight { 403 vec3 directDiffuse; 404 vec3 directSpecular; 405 vec3 indirectDiffuse; 406 vec3 indirectSpecular; 407}; 408#ifdef USE_ALPHAHASH 409 varying vec3 vPosition; 410#endif 411vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 412 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 413} 414vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 415 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 416} 417mat3 transposeMat3( const in mat3 m ) { 418 mat3 tmp; 419 tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); 420 tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); 421 tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); 422 return tmp; 423} 424float luminance( const in vec3 rgb ) { 425 const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); 426 return dot( weights, rgb ); 427} 428bool isPerspectiveMatrix( mat4 m ) { 429 return m[ 2 ][ 3 ] == - 1.0; 430} 431vec2 equirectUv( in vec3 dir ) { 432 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 433 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 434 return vec2( u, v ); 435}
436vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 437 return RECIPROCAL_PI * diffuseColor; 438} 439vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 440 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 441 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 442} 443float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 444 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 445 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 446} // validated`,i6=`#ifdef ENVMAP_TYPE_CUBE_UV 447 #define cubeUV_minMipLevel 4.0 448 #define cubeUV_minTileSize 16.0 449 float getFace( vec3 direction ) { 450 vec3 absDirection = abs( direction ); 451 float face = - 1.0; 452 if ( absDirection.x > absDirection.z ) { 453 if ( absDirection.x > absDirection.y ) 454 face = direction.x > 0.0 ? 0.0 : 3.0; 455 else 456 face = direction.y > 0.0 ? 1.0 : 4.0; 457 } else { 458 if ( absDirection.z > absDirection.y ) 459 face = direction.z > 0.0 ? 2.0 : 5.0; 460 else 461 face = direction.y > 0.0 ? 1.0 : 4.0; 462 } 463 return face; 464 } 465 vec2 getUV( vec3 direction, float face ) { 466 vec2 uv; 467 if ( face == 0.0 ) { 468 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 469 } else if ( face == 1.0 ) { 470 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 471 } else if ( face == 2.0 ) { 472 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 473 } else if ( face == 3.0 ) { 474 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 475 } else if ( face == 4.0 ) { 476 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 477 } else { 478 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 479 } 480 return 0.5 * ( uv + 1.0 ); 481 } 482 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 483 float face = getFace( direction ); 484 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 485 mipInt = max( mipInt, cubeUV_minMipLevel ); 486 float faceSize = exp2( mipInt ); 487 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 488 if ( face > 2.0 ) { 489 uv.y += faceSize; 490 face -= 3.0; 491 } 492 uv.x += face * faceSize; 493 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 494 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 495 uv.x *= CUBEUV_TEXEL_WIDTH; 496 uv.y *= CUBEUV_TEXEL_HEIGHT; 497 #ifdef texture2DGradEXT 498 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 499 #else 500 return texture2D( envMap, uv ).rgb; 501 #endif 502 } 503 #define cubeUV_r0 1.0 504 #define cubeUV_m0 - 2.0 505 #define cubeUV_r1 0.8 506 #define cubeUV_m1 - 1.0 507 #define cubeUV_r4 0.4 508 #define cubeUV_m4 2.0 509 #define cubeUV_r5 0.305 510 #define cubeUV_m5 3.0 511 #define cubeUV_r6 0.21 512 #define cubeUV_m6 4.0 513 float roughnessToMip( float roughness ) { 514 float mip = 0.0; 515 if ( roughness >= cubeUV_r1 ) { 516 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 517 } else if ( roughness >= cubeUV_r4 ) { 518 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 519 } else if ( roughness >= cubeUV_r5 ) { 520 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 521 } else if ( roughness >= cubeUV_r6 ) { 522 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 523 } else { 524 mip = - 2.0 * log2( 1.16 * roughness ); } 525 return mip; 526 } 527 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 528 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 529 float mipF = fract( mip ); 530 float mipInt = floor( mip ); 531 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 532 if ( mipF == 0.0 ) { 533 return vec4( color0, 1.0 ); 534 } else { 535 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 536 return vec4( mix( color0, color1, mipF ), 1.0 ); 537 } 538 } 539#endif`,r6=`vec3 transformedNormal = objectNormal; 540#ifdef USE_TANGENT 541 vec3 transformedTangent = objectTangent; 542#endif 543#ifdef USE_BATCHING 544 mat3 bm = mat3( batchingMatrix ); 545 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 546 transformedNormal = bm * transformedNormal; 547 #ifdef USE_TANGENT 548 transformedTangent = bm * transformedTangent; 549 #endif 550#endif 551#ifdef USE_INSTANCING 552 mat3 im = mat3( instanceMatrix ); 553 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 554 transformedNormal = im * transformedNormal; 555 #ifdef USE_TANGENT 556 transformedTangent = im * transformedTangent; 557 #endif 558#endif 559transformedNormal = normalMatrix * transformedNormal; 560#ifdef FLIP_SIDED 561 transformedNormal = - transformedNormal; 562#endif 563#ifdef USE_TANGENT 564 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 565 #ifdef FLIP_SIDED 566 transformedTangent = - transformedTangent; 567 #endif 568#endif`,s6=`#ifdef USE_DISPLACEMENTMAP 569 uniform sampler2D displacementMap; 570 uniform float displacementScale; 571 uniform float displacementBias; 572#endif`,o6=`#ifdef USE_DISPLACEMENTMAP 573 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
573placementBias ); 574#endif`,a6=`#ifdef USE_EMISSIVEMAP 575 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 576 totalEmissiveRadiance *= emissiveColor.rgb; 577#endif`,l6=`#ifdef USE_EMISSIVEMAP 578 uniform sampler2D emissiveMap; 579#endif`,c6="gl_FragColor = linearToOutputTexel( gl_FragColor );",u6=` 580const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( 581 vec3( 0.8224621, 0.177538, 0.0 ), 582 vec3( 0.0331941, 0.9668058, 0.0 ), 583 vec3( 0.0170827, 0.0723974, 0.9105199 ) 584); 585const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( 586 vec3( 1.2249401, - 0.2249404, 0.0 ), 587 vec3( - 0.0420569, 1.0420571, 0.0 ), 588 vec3( - 0.0196376, - 0.0786361, 1.0982735 ) 589); 590vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { 591 return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); 592} 593vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { 594 return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); 595} 596vec4 LinearTransferOETF( in vec4 value ) { 597 return value; 598} 599vec4 sRGBTransferOETF( in vec4 value ) { 600 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 ); 601} 602vec4 LinearToLinear( in vec4 value ) { 603 return value; 604} 605vec4 LinearTosRGB( in vec4 value ) { 606 return sRGBTransferOETF( value ); 607}`,h6=`#ifdef USE_ENVMAP 608 #ifdef ENV_WORLDPOS 609 vec3 cameraToFrag; 610 if ( isOrthographic ) { 611 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 612 } else { 613 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 614 } 615 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 616 #ifdef ENVMAP_MODE_REFLECTION 617 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 618 #else 619 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 620 #endif 621 #else 622 vec3 reflectVec = vReflect; 623 #endif 624 #ifdef ENVMAP_TYPE_CUBE 625 vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 626 #else 627 vec4 envColor = vec4( 0.0 ); 628 #endif 629 #ifdef ENVMAP_BLENDING_MULTIPLY 630 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 631 #elif defined( ENVMAP_BLENDING_MIX ) 632 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 633 #elif defined( ENVMAP_BLENDING_ADD ) 634 outgoingLight += envColor.xyz * specularStrength * reflectivity; 635 #endif 636#endif`,f6=`#ifdef USE_ENVMAP 637 uniform float envMapIntensity; 638 uniform float flipEnvMap; 639 uniform mat3 envMapRotation; 640 #ifdef ENVMAP_TYPE_CUBE 641 uniform samplerCube envMap; 642 #else 643 uniform sampler2D envMap; 644 #endif 645 646#endif`,d6=`#ifdef USE_ENVMAP 647 uniform float reflectivity; 648 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 649 #define ENV_WORLDPOS 650 #endif 651 #ifdef ENV_WORLDPOS 652 varying vec3 vWorldPosition; 653 uniform float refractionRatio; 654 #else 655 varying vec3 vReflect; 656 #endif 657#endif`,p6=`#ifdef USE_ENVMAP 658 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 659 #define ENV_WORLDPOS 660 #endif 661 #ifdef ENV_WORLDPOS 662 663 varying vec3 vWorldPosition; 664 #else 665 varying vec3 vReflect; 666 uniform float refractionRatio; 667 #endif 668#endif`,m6=`#ifdef USE_ENVMAP 669 #ifdef ENV_WORLDPOS 670 vWorldPosition = worldPosition.xyz; 671 #else 672 vec3 cameraToVertex; 673 if ( isOrthographic ) { 674 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 675 } else {
676 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 677 } 678 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 679 #ifdef ENVMAP_MODE_REFLECTION 680 vReflect = reflect( cameraToVertex, worldNormal ); 681 #else 682 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 683 #endif 684 #endif 685#endif`,g6=`#ifdef USE_FOG 686 vFogDepth = - mvPosition.z; 687#endif`,y6=`#ifdef USE_FOG 688 varying float vFogDepth; 689#endif`,_6=`#ifdef USE_FOG 690 #ifdef FOG_EXP2 691 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 692 #else 693 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 694 #endif 695 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 696#endif`,x6=`#ifdef USE_FOG 697 uniform vec3 fogColor; 698 varying float vFogDepth; 699 #ifdef FOG_EXP2 700 uniform float fogDensity; 701 #else 702 uniform float fogNear; 703 uniform float fogFar; 704 #endif 705#endif`,v6=`#ifdef USE_GRADIENTMAP 706 uniform sampler2D gradientMap; 707#endif 708vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 709 float dotNL = dot( normal, lightDirection ); 710 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 711 #ifdef USE_GRADIENTMAP 712 return vec3( texture2D( gradientMap, coord ).r ); 713 #else 714 vec2 fw = fwidth( coord ) * 0.5; 715 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 716 #endif 717}`,A6=`#ifdef USE_LIGHTMAP 718 uniform sampler2D lightMap; 719 uniform float lightMapIntensity; 720#endif`,S6=`LambertMaterial material; 721material.diffuseColor = diffuseColor.rgb; 722material.specularStrength = specularStrength;`,M6=`varying vec3 vViewPosition; 723struct LambertMaterial { 724 vec3 diffuseColor; 725 float specularStrength; 726}; 727void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 728 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 729 vec3 irradiance = dotNL * directLight.color; 730 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 731} 732void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 733 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 734} 735#define RE_Direct RE_Direct_Lambert 736#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,E6=`uniform bool receiveShadow; 737uniform vec3 ambientLightColor; 738#if defined( USE_LIGHT_PROBES ) 739 uniform vec3 lightProbe[ 9 ]; 740#endif 741vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 742 float x = normal.x, y = normal.y, z = normal.z; 743 vec3 result = shCoefficients[ 0 ] * 0.886227; 744 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 745 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 746 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 747 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 748 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 749 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 750 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 751 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 752 return result; 753} 754vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 755 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 756 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 757 return irradiance; 758} 759vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 760 vec3 irradiance = ambientLightColor; 761 return irradiance; 762} 763float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 764 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 765 if ( cutoffDistance > 0.0 ) { 766 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 767 } 768 return distanceFalloff; 769} 770float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 771 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 772} 773#if NUM_DIR_LIGHTS > 0 774 struct DirectionalLight { 775 vec3 direction; 776 vec3 color; 777 }; 778 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 779 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 780 light.color = directionalLight.color; 781 light.direction = directionalLight.direction; 782 light.visible = true; 783 } 784#endif 785#if NUM_POINT_LIGHTS > 0 786 struct PointLight { 787 vec3 position; 788 vec3 color; 789 float distance; 790 float decay; 791 }; 792 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 793 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 794 vec3 lVector = pointLight.position - geometryPosition; 795 light.direction = normalize( lVector ); 796 float lightDistance = length( lVector ); 797 light.color = pointLight.color; 798 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 799 light.visible = ( light.color != vec3( 0.0 ) ); 800 } 801#endif
802#if NUM_SPOT_LIGHTS > 0 803 struct SpotLight { 804 vec3 position; 805 vec3 direction; 806 vec3 color; 807 float distance; 808 float decay; 809 float coneCos; 810 float penumbraCos; 811 }; 812 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 813 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 814 vec3 lVector = spotLight.position - geometryPosition; 815 light.direction = normalize( lVector ); 816 float angleCos = dot( light.direction, spotLight.direction ); 817 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 818 if ( spotAttenuation > 0.0 ) { 819 float lightDistance = length( lVector ); 820 light.color = spotLight.color * spotAttenuation; 821 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 822 light.visible = ( light.color != vec3( 0.0 ) ); 823 } else { 824 light.color = vec3( 0.0 ); 825 light.visible = false; 826 } 827 } 828#endif 829#if NUM_RECT_AREA_LIGHTS > 0 830 struct RectAreaLight { 831 vec3 color; 832 vec3 position; 833 vec3 halfWidth; 834 vec3 halfHeight; 835 }; 836 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 837 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 838#endif 839#if NUM_HEMI_LIGHTS > 0 840 struct HemisphereLight { 841 vec3 direction; 842 vec3 skyColor; 843 vec3 groundColor; 844 }; 845 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 846 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 847 float dotNL = dot( normal, hemiLight.direction ); 848 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 849 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 850 return irradiance; 851 } 852#endif`,w6=`#ifdef USE_ENVMAP 853 vec3 getIBLIrradiance( const in vec3 normal ) { 854 #ifdef ENVMAP_TYPE_CUBE_UV 855 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 856 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 857 return PI * envMapColor.rgb * envMapIntensity; 858 #else 859 return vec3( 0.0 ); 860 #endif 861 } 862 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 863 #ifdef ENVMAP_TYPE_CUBE_UV 864 vec3 reflectVec = reflect( - viewDir, normal ); 865 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 866 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 867 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 868 return envMapColor.rgb * envMapIntensity; 869 #else 870 return vec3( 0.0 ); 871 #endif 872 } 873 #ifdef USE_ANISOTROPY 874 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 875 #ifdef ENVMAP_TYPE_CUBE_UV 876 vec3 bentNormal = cross( bitangent, viewDir ); 877 bentNormal = normalize( cross( bentNormal, bitangent ) ); 878 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 879 return getIBLRadiance( viewDir, bentNormal, roughness ); 880 #else 881 return vec3( 0.0 ); 882 #endif 883 } 884 #endif 885#endif`,T6=`ToonMaterial material; 886material.diffuseColor = diffuseColor.rgb;`,C6=`varying vec3 vViewPosition; 887struct ToonMaterial { 888 vec3 diffuseColor; 889}; 890void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 891 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 892 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 893} 894void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 895 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 896} 897#define RE_Direct RE_Direct_Toon 898#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,R6=`BlinnPhongMaterial material; 899material.diffuseColor = diffuseColor.rgb; 900material.specularColor = specular; 901material.specularShininess = shininess; 902material.specularStrength = specularStrength;`,b6=`varying vec3 vViewPosition; 903struct BlinnPhongMaterial { 904 vec3 diffuseColor; 905 vec3 specularColor; 906 float specularShininess; 907 float specularStrength; 908}; 909void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
910 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 911 vec3 irradiance = dotNL * directLight.color; 912 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 913 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 914} 915void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 916 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 917} 918#define RE_Direct RE_Direct_BlinnPhong 919#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,P6=`PhysicalMaterial material; 920material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 921vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 922float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 923material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 924material.roughness = min( material.roughness, 1.0 ); 925#ifdef IOR 926 material.ior = ior; 927 #ifdef USE_SPECULAR 928 float specularIntensityFactor = specularIntensity; 929 vec3 specularColorFactor = specularColor; 930 #ifdef USE_SPECULAR_COLORMAP 931 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 932 #endif 933 #ifdef USE_SPECULAR_INTENSITYMAP 934 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 935 #endif 936 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 937 #else 938 float specularIntensityFactor = 1.0; 939 vec3 specularColorFactor = vec3( 1.0 ); 940 material.specularF90 = 1.0; 941 #endif 942 material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 943#else 944 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 945 material.specularF90 = 1.0; 946#endif 947#ifdef USE_CLEARCOAT 948 material.clearcoat = clearcoat; 949 material.clearcoatRoughness = clearcoatRoughness; 950 material.clearcoatF0 = vec3( 0.04 ); 951 material.clearcoatF90 = 1.0; 952 #ifdef USE_CLEARCOATMAP 953 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 954 #endif 955 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 956 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 957 #endif 958 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 959 material.clearcoatRoughness += geometryRoughness; 960 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 961#endif 962#ifdef USE_DISPERSION 963 material.dispersion = dispersion; 964#endif 965#ifdef USE_IRIDESCENCE 966 material.iridescence = iridescence; 967 material.iridescenceIOR = iridescenceIOR; 968 #ifdef USE_IRIDESCENCEMAP 969 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 970 #endif 971 #ifdef USE_IRIDESCENCE_THICKNESSMAP 972 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 973 #else 974 material.iridescenceThickness = iridescenceThicknessMaximum; 975 #endif 976#endif 977#ifdef USE_SHEEN 978 material.sheenColor = sheenColor; 979 #ifdef USE_SHEEN_COLORMAP 980 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 981 #endif 982 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 983 #ifdef USE_SHEEN_ROUGHNESSMAP 984 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 985 #endif 986#endif 987#ifdef USE_ANISOTROPY 988 #ifdef USE_ANISOTROPYMAP 989 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 990 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 991 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 992 #else 993 vec2 anisotropyV = anisotropyVector; 994 #endif 995 material.anisotropy = length( anisotropyV ); 996 if( material.anisotropy == 0.0 ) { 997 anisotropyV = vec2( 1.0, 0.0 ); 998 } else { 999 anisotropyV /= material.anisotropy; 1000 material.anisotropy = saturate( material.anisotropy ); 1001 } 1002 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
1003 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 1004 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 1005#endif`,B6
vendor: 14,687 bytes, lines 1005-1306
1005=`struct PhysicalMaterial { 1006 vec3 diffuseColor; 1007 float roughness; 1008 vec3 specularColor; 1009 float specularF90; 1010 float dispersion; 1011 #ifdef USE_CLEARCOAT 1012 float clearcoat; 1013 float clearcoatRoughness; 1014 vec3 clearcoatF0; 1015 float clearcoatF90; 1016 #endif 1017 #ifdef USE_IRIDESCENCE 1018 float iridescence; 1019 float iridescenceIOR; 1020 float iridescenceThickness; 1021 vec3 iridescenceFresnel; 1022 vec3 iridescenceF0; 1023 #endif 1024 #ifdef USE_SHEEN 1025 vec3 sheenColor; 1026 float sheenRoughness; 1027 #endif 1028 #ifdef IOR 1029 float ior; 1030 #endif 1031 #ifdef USE_TRANSMISSION 1032 float transmission; 1033 float transmissionAlpha; 1034 float thickness; 1035 float attenuationDistance; 1036 vec3 attenuationColor; 1037 #endif 1038 #ifdef USE_ANISOTROPY 1039 float anisotropy; 1040 float alphaT; 1041 vec3 anisotropyT; 1042 vec3 anisotropyB; 1043 #endif 1044}; 1045vec3 clearcoatSpecularDirect = vec3( 0.0 ); 1046vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 1047vec3 sheenSpecularDirect = vec3( 0.0 ); 1048vec3 sheenSpecularIndirect = vec3(0.0 ); 1049vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 1050 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 1051 float x2 = x * x; 1052 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 1053 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 1054} 1055float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 1056 float a2 = pow2( alpha ); 1057 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1058 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1059 return 0.5 / max( gv + gl, EPSILON ); 1060} 1061float D_GGX( const in float alpha, const in float dotNH ) { 1062 float a2 = pow2( alpha ); 1063 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1064 return RECIPROCAL_PI * a2 / pow2( denom ); 1065} 1066#ifdef USE_ANISOTROPY 1067 float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { 1068 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1069 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1070 float v = 0.5 / ( gv + gl ); 1071 return saturate(v); 1072 } 1073 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1074 float a2 = alphaT * alphaB; 1075 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1076 highp float v2 = dot( v, v ); 1077 float w2 = a2 / v2; 1078 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1079 } 1080#endif 1081#ifdef USE_CLEARCOAT 1082 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1083 vec3 f0 = material.clearcoatF0; 1084 float f90 = material.clearcoatF90; 1085 float roughness = material.clearcoatRoughness; 1086 float alpha = pow2( roughness ); 1087 vec3 halfDir = normalize( lightDir + viewDir ); 1088 float dotNL = saturate( dot( normal, lightDir ) ); 1089 float dotNV = saturate( dot( normal, viewDir ) ); 1090 float dotNH = saturate( dot( normal, halfDir ) ); 1091 float dotVH = saturate( dot( viewDir, halfDir ) ); 1092 vec3 F = F_Schlick( f0, f90, dotVH ); 1093 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1094 float D = D_GGX( alpha, dotNH ); 1095 return F * ( V * D ); 1096 } 1097#endif 1098vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1099 vec3 f0 = material.specularColor; 1100 float f90 = material.specularF90; 1101 float roughness = material.roughness; 1102 float alpha = pow2( roughness ); 1103 vec3 halfDir = normalize( lightDir + viewDir ); 1104 float dotNL = saturate( dot( normal, lightDir ) ); 1105 float dotNV = saturate( dot( normal, viewDir ) ); 1106 float dotNH = saturate( dot( normal, halfDir ) ); 1107 float dotVH = saturate( dot( viewDir, halfDir ) ); 1108 vec3 F = F_Schlick( f0, f90, dotVH ); 1109 #ifdef USE_IRIDESCENCE 1110 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1111 #endif 1112 #ifdef USE_ANISOTROPY 1113 float dotTL = dot( material.anisotropyT, lightDir ); 1114 float dotTV = dot( material.anisotropyT, viewDir ); 1115 float dotTH = dot( material.anisotropyT, halfDir ); 1116 float dotBL = dot( material.anisotropyB, lightDir ); 1117 float dotBV = dot( material.anisotropyB, viewDir ); 1118 float dotBH = dot( material.anisotropyB, halfDir ); 1119 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1120 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1121 #else 1122 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1123 float D = D_GGX( alpha, dotNH ); 1124 #endif 1125 return F * ( V * D ); 1126} 1127vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1128 const float LUT_SIZE = 64.0; 1129 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1130 const float LUT_BIAS = 0.5 / LUT_SIZE; 1131 float dotNV = saturate( dot( N, V ) ); 1132 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1133 uv = uv * LUT_SCALE + LUT_BIAS; 1134 return uv; 1135} 1136float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1137 float l = length( f ); 1138 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1139} 1140vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1141 float x = dot( v1, v2 ); 1142 float y = abs( x ); 1143 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1144 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1145 float v = a / b; 1146 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1147 return cross( v1, v2 ) * theta_sintheta; 1148} 1149vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1150 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1151 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1152 vec3 lightNormal = cross( v1, v2 ); 1153 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1154 vec3 T1, T2; 1155 T1 = normalize( V - N * dot( V, N ) ); 1156 T2 = - cross( N, T1 ); 1157 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 1158 vec3 coords[ 4 ]; 1159 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1160 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1161 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1162 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1163 coords[ 0 ] = normalize( coords[ 0 ] ); 1164 coords[ 1 ] = normalize( coords[ 1 ] ); 1165 coords[ 2 ] = normalize( coords[ 2 ] ); 1166 coords[ 3 ] = normalize( coords[ 3 ] ); 1167 vec3 vectorFormFactor = vec3( 0.0 ); 1168 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1169 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1170 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1171 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1172 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1173 return vec3( result ); 1174} 1175#if defined( USE_SHEEN ) 1176float D_Charlie( float roughness, float dotNH ) { 1177 float alpha = pow2( roughness ); 1178 float invAlpha = 1.0 / alpha; 1179 float cos2h = dotNH * dotNH; 1180 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1181 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1182} 1183float V_Neubelt( float dotNV, float dotNL ) { 1184 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1185} 1186vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1187 vec3 halfDir = normalize( lightDir + viewDir ); 1188 float dotNL = saturate( dot( normal, lightDir ) ); 1189 float dotNV = saturate( dot( normal, viewDir ) ); 1190 float dotNH = saturate( dot( normal, halfDir ) ); 1191 float D = D_Charlie( sheenRoughness, dotNH ); 1192 float V = V_Neubelt( dotNV, dotNL ); 1193 return sheenColor * ( D * V ); 1194} 1195#endif 1196float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1197 float dotNV = saturate( dot( normal, viewDir ) ); 1198 float r2 = roughness * roughness; 1199 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 1200 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 1201 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 1202 return saturate( DG * RECIPROCAL_PI ); 1203} 1204vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1205 float dotNV = saturate( dot( normal, viewDir ) ); 1206 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 1207 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 1208 vec4 r = roughness * c0 + c1; 1209 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 1210 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 1211 return fab; 1212} 1213vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1214 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1215 return specularColor * fab.x + specularF90 * fab.y; 1216} 1217#ifdef USE_IRIDESCENCE 1218void 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 ) { 1219#else 1220void 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 ) { 1221#endif 1222 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1223 #ifdef USE_IRIDESCENCE 1224 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1225 #else 1226 vec3 Fr = specularColor; 1227 #endif 1228 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1229 float Ess = fab.x + fab.y; 1230 float Ems = 1.0 - Ess; 1231 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1232 singleScatter += FssEss; 1233 multiScatter += Fms * Ems; 1234} 1235#if NUM_RECT_AREA_LIGHTS > 0 1236 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1237 vec3 normal = geometryNormal; 1238 vec3 viewDir = geometryViewDir; 1239 vec3 position = geometryPosition; 1240 vec3 lightPos = rectAreaLight.position; 1241 vec3 halfWidth = rectAreaLight.halfWidth; 1242 vec3 halfHeight = rectAreaLight.halfHeight; 1243 vec3 lightColor = rectAreaLight.color; 1244 float roughness = material.roughness; 1245 vec3 rectCoords[ 4 ]; 1246 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1247 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1248 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1249 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1250 vec4 t1 = texture2D( ltc_1, uv ); 1251 vec4 t2 = texture2D( ltc_2, uv ); 1252 mat3 mInv = mat3( 1253 vec3( t1.x, 0, t1.y ), 1254 vec3( 0, 1, 0 ), 1255 vec3( t1.z, 0, t1.w ) 1256 ); 1257 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 1258 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1259 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1260 } 1261#endif 1262void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1263 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1264 vec3 irradiance = dotNL * directLight.color; 1265 #ifdef USE_CLEARCOAT 1266 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1267 vec3 ccIrradiance = dotNLcc * directLight.color; 1268 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1269 #endif 1270 #ifdef USE_SHEEN 1271 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1272 #endif 1273 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); 1274 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1275} 1276void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1277 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1278} 1279void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { 1280 #ifdef USE_CLEARCOAT 1281 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1282 #endif 1283 #ifdef USE_SHEEN 1284 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1285 #endif 1286 vec3 singleScattering = vec3( 0.0 ); 1287 vec3 multiScattering = vec3( 0.0 ); 1288 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1289 #ifdef USE_IRIDESCENCE 1290 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); 1291 #else 1292 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 1293 #endif 1294 vec3 totalScattering = singleScattering + multiScattering; 1295 vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); 1296 reflectedLight.indirectSpecular += radiance * singleScattering; 1297 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 1298 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 1299} 1300#define RE_Direct RE_Direct_Physical 1301#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1302#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1303#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1304float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1305 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1306}`,
1306I6=` 1307vec3 geometryPosition = - vViewPosition; 1308vec3 geometryNormal = normal; 1309vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1310vec3 geometryClearcoatNormal = vec3( 0.0 ); 1311#ifdef USE_CLEARCOAT 1312 geometryClearcoatNormal = clearcoatNormal; 1313#endif 1314#ifdef USE_IRIDESCENCE 1315 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1316 if ( material.iridescenceThickness == 0.0 ) { 1317 material.iridescence = 0.0; 1318 } else { 1319 material.iridescence = saturate( material.iridescence ); 1320 } 1321 if ( material.iridescence > 0.0 ) { 1322 material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1323 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1324 } 1325#endif 1326IncidentLight directLight; 1327#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1328 PointLight pointLight; 1329 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1330 PointLightShadow pointLightShadow; 1331 #endif 1332 #pragma unroll_loop_start 1333 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1334 pointLight = pointLights[ i ]; 1335 getPointLightInfo( pointLight, geometryPosition, directLight ); 1336 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 1337 pointLightShadow = pointLightShadows[ i ]; 1338 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1339 #endif 1340 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1341 } 1342 #pragma unroll_loop_end 1343#endif 1344#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1345 SpotLight spotLight; 1346 vec4 spotColor; 1347 vec3 spotLightCoord; 1348 bool inSpotLightMap; 1349 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1350 SpotLightShadow spotLightShadow; 1351 #endif 1352 #pragma unroll_loop_start 1353 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1354 spotLight = spotLights[ i ]; 1355 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1356 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1357 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1358 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1359 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1360 #else 1361 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1362 #endif 1363 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1364 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1365 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1366 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1367 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1368 #endif 1369 #undef SPOT_LIGHT_MAP_INDEX 1370 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1371 spotLightShadow = spotLightShadows[ i ]; 1372 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1373 #endif 1374 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1375 } 1376 #pragma unroll_loop_end 1377#endif 1378#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1379 DirectionalLight directionalLight; 1380 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1381 DirectionalLightShadow directionalLightShadow; 1382 #endif 1383 #pragma unroll_loop_start 1384 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1385 directionalLight = directionalLights[ i ]; 1386 getDirectionalLightInfo( directionalLight, directLight ); 1387 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1388 directionalLightShadow = directionalLightShadows[ i ]; 1389 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1390 #endif 1391 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1392 } 1393 #pragma unroll_loop_end 1394#endif 1395#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1396 RectAreaLight rectAreaLight; 1397 #pragma unroll_loop_start 1398 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1399 rectAreaLight = rectAreaLights[ i ]; 1400 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1401 } 1402 #pragma unroll_loop_end 1403#endif 1404#if defined( RE_IndirectDiffuse ) 1405 vec3 iblIrradiance = vec3( 0.0 ); 1406 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1407 #if defined( USE_LIGHT_PROBES ) 1408 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1409 #endif 1410 #if ( NUM_HEMI_LIGHTS > 0 ) 1411 #pragma unroll_loop_start 1412 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1413 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1414 } 1415 #pragma unroll_loop_end 1416 #endif 1417#endif 1418#if defined( RE_IndirectSpecular ) 1419 vec3 radiance = vec3( 0.0 ); 1420 vec3 clearcoatRadiance = vec3( 0.0 ); 1421#endif`,L6=`#if defined( RE_IndirectDiffuse ) 1422 #ifdef USE_LIGHTMAP 1423 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1424 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1425 irradiance += lightMapIrradiance; 1426 #endif 1427 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 1428 iblIrradiance += getIBLIrradiance( geometryNormal ); 1429 #endif 1430#endif 1431#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1432 #ifdef USE_ANISOTROPY 1433 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1434 #else 1435 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1436 #endif 1437 #ifdef USE_CLEARCOAT 1438 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1439 #endif 1440#endif`,D6=`#if defined( RE_IndirectDiffuse ) 1441 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1442#endif 1443#if defined( RE_IndirectSpecular ) 1444 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1445#endif`,z6=`#if defined( USE_LOGDEPTHBUF ) 1446 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1447#endif`,F6=`#if defined( USE_LOGDEPTHBUF ) 1448 uniform float logDepthBufFC; 1449 varying float vFragDepth; 1450 varying float vIsPerspective; 1451#endif`,O6=`#ifdef USE_LOGDEPTHBUF 1452 varying float vFragDepth; 1453 varying float vIsPerspective; 1454#endif`,U6=`#ifdef USE_LOGDEPTHBUF 1455 vFragDepth = 1.0 + gl_Position.w; 1456 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1457#endif`,N6=`#ifdef USE_MAP 1458 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1459 #ifdef DECODE_VIDEO_TEXTURE 1460 sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); 1461 1462 #endif 1463 diffuseColor *= sampledDiffuseColor; 1464#endif`,k6=`#ifdef USE_MAP 1465 uniform sampler2D map; 1466#endif`,H6=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1467 #if defined( USE_POINTS_UV ) 1468 vec2 uv = vUv; 1469 #else 1470 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1471 #endif 1472#endif 1473#ifdef USE_MAP 1474 diffuseColor *= texture2D( map, uv ); 1475#endif 1476#ifdef USE_ALPHAMAP 1477 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1478#endif`,G6=`#if defined( USE_POINTS_UV ) 1479 varying vec2 vUv; 1480#else 1481 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1482 uniform mat3 uvTransform; 1483 #endif 1484#endif 1485#ifdef USE_MAP 1486 uniform sampler2D map; 1487#endif 1488#ifdef USE_ALPHAMAP 1489 uniform sampler2D alphaMap; 1490#endif`,V6=`float metalnessFactor = metalness; 1491#ifdef USE_METALNESSMAP 1492 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1493 metalnessFactor *= texelMetalness.b; 1494#endif`,W6=`#ifdef USE_METALNESSMAP 1495 uniform sampler2D metalnessMap; 1496#endif`,j6=`#ifdef USE_INSTANCING_MORPH 1497 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1498 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1499 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1500 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1501 } 1502#endif`,X6=`#if defined( USE_MORPHCOLORS ) 1503 vColor *= morphTargetBaseInfluence; 1504 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1505 #if defined( USE_COLOR_ALPHA ) 1506 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1507 #elif defined( USE_COLOR ) 1508 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1509 #endif 1510 } 1511#endif`,J6=`#ifdef USE_MORPHNORMALS 1512 objectNormal *= morphTargetBaseInfluence; 1513 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1514 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1515 } 1516#endif`,Y6=`#ifdef USE_MORPHTARGETS 1517 #ifndef USE_INSTANCING_MORPH 1518 uniform float morphTargetBaseInfluence; 1519 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1520 #endif 1521 uniform sampler2DArray morphTargetsTexture; 1522 uniform ivec2 morphTargetsTextureSize; 1523 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1524 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1525 int y = texelIndex / morphTargetsTextureSize.x; 1526 int x = texelIndex - y * morphTargetsTextureSize.x; 1527 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1528 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1529 } 1530#endif`,K6=`#ifdef USE_MORPHTARGETS 1531 transformed *= morphTargetBaseInfluence; 1532 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1533 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1534 } 1535#endif`,Q6=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1536#ifdef FLAT_SHADED 1537 vec3 fdx = dFdx( vViewPosition ); 1538 vec3 fdy = dFdy( vViewPosition ); 1539 vec3 normal = normalize( cross( fdx, fdy ) ); 1540#else 1541 vec3 normal = normalize( vNormal ); 1542 #ifdef DOUBLE_SIDED 1543 normal *= faceDirection; 1544 #endif 1545#endif 1546#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1547 #ifdef USE_TANGENT 1548 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1549 #else 1550 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1551 #if defined( USE_NORMALMAP ) 1552 vNormalMapUv 1553 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1554 vClearcoatNormalMapUv 1555 #else 1556 vUv 1557 #endif 1558 ); 1559 #endif 1560 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1561 tbn[0] *= faceDirection; 1562 tbn[1] *= faceDirection; 1563 #endif 1564#endif 1565#ifdef USE_CLEARCOAT_NORMALMAP 1566 #ifdef USE_TANGENT 1567 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1568 #else 1569 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1570 #endif 1571 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1572 tbn2[0] *= faceDirection; 1573 tbn2[1] *= faceDirection; 1574 #endif 1575#endif 1576vec3 nonPerturbedNormal = normal;`,Z6=`#ifdef USE_NORMALMAP_OBJECTSPACE 1577 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1578 #ifdef FLIP_SIDED 1579 normal = - normal; 1580 #endif 1581 #ifdef DOUBLE_SIDED 1582 normal = normal * faceDirection; 1583 #endif 1584 normal = normalize( normalMatrix * normal ); 1585#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1586 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1587 mapN.xy *= normalScale; 1588 normal = normalize( tbn * mapN ); 1589#elif defined( USE_BUMPMAP )
1590 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1591#endif`,q6=`#ifndef FLAT_SHADED 1592 varying vec3 vNormal; 1593 #ifdef USE_TANGENT 1594 varying vec3 vTangent; 1595 varying vec3 vBitangent; 1596 #endif 1597#endif`,$6=`#ifndef FLAT_SHADED 1598 varying vec3 vNormal; 1599 #ifdef USE_TANGENT 1600 varying vec3 vTangent; 1601 varying vec3 vBitangent; 1602 #endif 1603#endif`,e5=`#ifndef FLAT_SHADED 1604 vNormal = normalize( transformedNormal ); 1605 #ifdef USE_TANGENT 1606 vTangent = normalize( transformedTangent ); 1607 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1608 #endif 1609#endif`,t5=`#ifdef USE_NORMALMAP 1610 uniform sampler2D normalMap; 1611 uniform vec2 normalScale; 1612#endif 1613#ifdef USE_NORMALMAP_OBJECTSPACE 1614 uniform mat3 normalMatrix; 1615#endif 1616#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1617 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1618 vec3 q0 = dFdx( eye_pos.xyz ); 1619 vec3 q1 = dFdy( eye_pos.xyz ); 1620 vec2 st0 = dFdx( uv.st ); 1621 vec2 st1 = dFdy( uv.st ); 1622 vec3 N = surf_norm; 1623 vec3 q1perp = cross( q1, N ); 1624 vec3 q0perp = cross( N, q0 ); 1625 vec3 T = q1perp * st0.x + q0perp * st1.x; 1626 vec3 B = q1perp * st0.y + q0perp * st1.y; 1627 float det = max( dot( T, T ), dot( B, B ) ); 1628 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1629 return mat3( T * scale, B * scale, N ); 1630 } 1631#endif`,n5=`#ifdef USE_CLEARCOAT 1632 vec3 clearcoatNormal = nonPerturbedNormal; 1633#endif`,i5=`#ifdef USE_CLEARCOAT_NORMALMAP 1634 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1635 clearcoatMapN.xy *= clearcoatNormalScale; 1636 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1637#endif`,r5=`#ifdef USE_CLEARCOATMAP 1638 uniform sampler2D clearcoatMap; 1639#endif 1640#ifdef USE_CLEARCOAT_NORMALMAP 1641 uniform sampler2D clearcoatNormalMap; 1642 uniform vec2 clearcoatNormalScale; 1643#endif 1644#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1645 uniform sampler2D clearcoatRoughnessMap; 1646#endif`,s5=`#ifdef USE_IRIDESCENCEMAP 1647 uniform sampler2D iridescenceMap; 1648#endif 1649#ifdef USE_IRIDESCENCE_THICKNESSMAP 1650 uniform sampler2D iridescenceThicknessMap; 1651#endif`,o5=`#ifdef OPAQUE 1652diffuseColor.a = 1.0; 1653#endif 1654#ifdef USE_TRANSMISSION 1655diffuseColor.a *= material.transmissionAlpha; 1656#endif 1657gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,a5=`vec3 packNormalToRGB( const in vec3 normal ) { 1658 return normalize( normal ) * 0.5 + 0.5; 1659} 1660vec3 unpackRGBToNormal( const in vec3 rgb ) { 1661 return 2.0 * rgb.xyz - 1.0; 1662} 1663const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; 1664const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); 1665const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); 1666const float ShiftRight8 = 1. / 256.; 1667vec4 packDepthToRGBA( const in float v ) { 1668 vec4 r = vec4( fract( v * PackFactors ), v ); 1669 r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; 1670} 1671float unpackRGBAToDepth( const in vec4 v ) { 1672 return dot( v, UnpackFactors ); 1673} 1674vec2 packDepthToRG( in highp float v ) { 1675 return packDepthToRGBA( v ).yx; 1676} 1677float unpackRGToDepth( const in highp vec2 v ) { 1678 return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); 1679} 1680vec4 pack2HalfToRGBA( vec2 v ) { 1681 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1682 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1683} 1684vec2 unpackRGBATo2Half( vec4 v ) { 1685 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1686} 1687float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1688 return ( viewZ + near ) / ( near - far ); 1689} 1690float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1691 return depth * ( near - far ) - near; 1692} 1693float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1694 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1695} 1696float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1697 return ( near * far ) / ( ( far - near ) * depth - far ); 1698}`,l5=`#ifdef PREMULTIPLIED_ALPHA 1699 gl_FragColor.rgb *= gl_FragColor.a; 1700#endif`,c5=`vec4 mvPosition = vec4( transformed, 1.0 ); 1701#ifdef USE_BATCHING 1702 mvPosition = batchingMatrix * mvPosition; 1703#endif 1704#ifdef USE_INSTANCING 1705 mvPosition = instanceMatrix * mvPosition; 1706#endif 1707mvPosition = modelViewMatrix * mvPosition; 1708gl_Position = projectionMatrix * mvPosition;`,u5=`#ifdef DITHERING 1709 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1710#endif`,h5=`#ifdef DITHERING 1711 vec3 dithering( vec3 color ) { 1712 float grid_position = rand( gl_FragCoord.xy ); 1713 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1714 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1715 return color + dither_shift_RGB; 1716 } 1717#endif`,f5=`float roughnessFactor = roughness; 1718#ifdef USE_ROUGHNESSMAP 1719 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1720 roughnessFactor *= texelRoughness.g; 1721#endif`,d5=`#ifdef USE_ROUGHNESSMAP 1722 uniform sampler2D roughnessMap; 1723#endif`,p5=
vendor: 8,887 bytes, lines 1723-1909
1723`#if NUM_SPOT_LIGHT_COORDS > 0 1724 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1725#endif 1726#if NUM_SPOT_LIGHT_MAPS > 0 1727 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1728#endif 1729#ifdef USE_SHADOWMAP 1730 #if NUM_DIR_LIGHT_SHADOWS > 0 1731 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1732 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1733 struct DirectionalLightShadow { 1734 float shadowIntensity; 1735 float shadowBias; 1736 float shadowNormalBias; 1737 float shadowRadius; 1738 vec2 shadowMapSize; 1739 }; 1740 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1741 #endif 1742 #if NUM_SPOT_LIGHT_SHADOWS > 0 1743 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1744 struct SpotLightShadow { 1745 float shadowIntensity; 1746 float shadowBias; 1747 float shadowNormalBias; 1748 float shadowRadius; 1749 vec2 shadowMapSize; 1750 }; 1751 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1752 #endif 1753 #if NUM_POINT_LIGHT_SHADOWS > 0 1754 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1755 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1756 struct PointLightShadow { 1757 float shadowIntensity; 1758 float shadowBias; 1759 float shadowNormalBias; 1760 float shadowRadius; 1761 vec2 shadowMapSize; 1762 float shadowCameraNear; 1763 float shadowCameraFar; 1764 }; 1765 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1766 #endif 1767 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 1768 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 1769 } 1770 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 1771 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 1772 } 1773 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 1774 float occlusion = 1.0; 1775 vec2 distribution = texture2DDistribution( shadow, uv ); 1776 float hard_shadow = step( compare , distribution.x ); 1777 if (hard_shadow != 1.0 ) { 1778 float distance = compare - distribution.x ; 1779 float variance = max( 0.00000, distribution.y * distribution.y ); 1780 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 ); 1781 } 1782 return occlusion; 1783 } 1784 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1785 float shadow = 1.0; 1786 shadowCoord.xyz /= shadowCoord.w; 1787 shadowCoord.z += shadowBias; 1788 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1789 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1790 if ( frustumTest ) { 1791 #if defined( SHADOWMAP_TYPE_PCF ) 1792 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1793 float dx0 = - texelSize.x * shadowRadius; 1794 float dy0 = - texelSize.y * shadowRadius; 1795 float dx1 = + texelSize.x * shadowRadius; 1796 float dy1 = + texelSize.y * shadowRadius; 1797 float dx2 = dx0 / 2.0; 1798 float dy2 = dy0 / 2.0; 1799 float dx3 = dx1 / 2.0; 1800 float dy3 = dy1 / 2.0; 1801 shadow = ( 1802 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 1803 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 1804 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 1805 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 1806 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 1807 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 1808 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 1809 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 1810 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 1811 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 1812 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 1813 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 1814 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 1815 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 1816 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 1817 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 1818 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 1819 ) * ( 1.0 / 17.0 ); 1820 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 1821 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1822 float dx = texelSize.x; 1823 float dy = texelSize.y; 1824 vec2 uv = shadowCoord.xy; 1825 vec2 f = fract( uv * shadowMapSize + 0.5 ); 1826 uv -= f * texelSize; 1827 shadow = ( 1828 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 1829 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 1830 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 1831 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 1832 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 1833 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 1834 f.x ) + 1835 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 1836 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 1837 f.x ) + 1838 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 1839 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 1840 f.y ) + 1841 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 1842 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 1843 f.y ) + 1844 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 1845 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 1846 f.x ), 1847 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 1848 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 1849 f.x ), 1850 f.y ) 1851 ) * ( 1.0 / 9.0 ); 1852 #elif defined( SHADOWMAP_TYPE_VSM ) 1853 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 1854 #else 1855 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 1856 #endif 1857 } 1858 return mix( 1.0, shadow, shadowIntensity ); 1859 } 1860 vec2 cubeToUV( vec3 v, float texelSizeY ) { 1861 vec3 absV = abs( v ); 1862 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 1863 absV *= scaleToCube; 1864 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 1865 vec2 planar = v.xy; 1866 float almostATexel = 1.5 * texelSizeY; 1867 float almostOne = 1.0 - almostATexel; 1868 if ( absV.z >= almostOne ) { 1869 if ( v.z > 0.0 ) 1870 planar.x = 4.0 - v.x; 1871 } else if ( absV.x >= almostOne ) { 1872 float signX = sign( v.x ); 1873 planar.x = v.z * signX + 2.0 * signX; 1874 } else if ( absV.y >= almostOne ) { 1875 float signY = sign( v.y ); 1876 planar.x = v.x + 2.0 * signY + 2.0; 1877 planar.y = v.z * signY - 2.0; 1878 } 1879 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 1880 } 1881 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1882 float shadow = 1.0; 1883 vec3 lightToPosition = shadowCoord.xyz; 1884 1885 float lightToPositionLength = length( lightToPosition ); 1886 if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { 1887 float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 1888 vec3 bd3D = normalize( lightToPosition ); 1889 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 1890 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 1891 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 1892 shadow = ( 1893 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 1894 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 1895 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 1896 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 1897 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 1898 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 1899 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 1900 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 1901 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 1902 ) * ( 1.0 / 9.0 ); 1903 #else 1904 shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 1905 #endif 1906 } 1907 return mix( 1.0, shadow, shadowIntensity ); 1908 } 1909#endif`,
1909m5=`#if NUM_SPOT_LIGHT_COORDS > 0 1910 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 1911 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1912#endif 1913#ifdef USE_SHADOWMAP 1914 #if NUM_DIR_LIGHT_SHADOWS > 0 1915 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 1916 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1917 struct DirectionalLightShadow { 1918 float shadowIntensity; 1919 float shadowBias; 1920 float shadowNormalBias; 1921 float shadowRadius; 1922 vec2 shadowMapSize; 1923 }; 1924 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1925 #endif 1926 #if NUM_SPOT_LIGHT_SHADOWS > 0 1927 struct SpotLightShadow { 1928 float shadowIntensity; 1929 float shadowBias; 1930 float shadowNormalBias; 1931 float shadowRadius; 1932 vec2 shadowMapSize; 1933 }; 1934 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1935 #endif 1936 #if NUM_POINT_LIGHT_SHADOWS > 0 1937 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 1938 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1939 struct PointLightShadow { 1940 float shadowIntensity; 1941 float shadowBias; 1942 float shadowNormalBias; 1943 float shadowRadius; 1944 vec2 shadowMapSize; 1945 float shadowCameraNear; 1946 float shadowCameraFar; 1947 }; 1948 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1949 #endif 1950#endif`,g5=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 1951 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 1952 vec4 shadowWorldPosition; 1953#endif 1954#if defined( USE_SHADOWMAP ) 1955 #if NUM_DIR_LIGHT_SHADOWS > 0 1956 #pragma unroll_loop_start 1957 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1958 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 1959 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 1960 } 1961 #pragma unroll_loop_end 1962 #endif 1963 #if NUM_POINT_LIGHT_SHADOWS > 0 1964 #pragma unroll_loop_start 1965 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1966 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 1967 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 1968 } 1969 #pragma unroll_loop_end 1970 #endif 1971#endif 1972#if NUM_SPOT_LIGHT_COORDS > 0 1973 #pragma unroll_loop_start 1974 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 1975 shadowWorldPosition = worldPosition; 1976 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1977 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 1978 #endif 1979 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 1980 } 1981 #pragma unroll_loop_end 1982#endif`,y5=`float getShadowMask() { 1983 float shadow = 1.0; 1984 #ifdef USE_SHADOWMAP 1985 #if NUM_DIR_LIGHT_SHADOWS > 0 1986 DirectionalLightShadow directionalLight; 1987 #pragma unroll_loop_start 1988 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1989 directionalLight = directionalLightShadows[ i ]; 1990 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1991 } 1992 #pragma unroll_loop_end 1993 #endif 1994 #if NUM_SPOT_LIGHT_SHADOWS > 0 1995 SpotLightShadow spotLight; 1996 #pragma unroll_loop_start 1997 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 1998 spotLight = spotLightShadows[ i ]; 1999 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2000 } 2001 #pragma unroll_loop_end 2002 #endif 2003 #if NUM_POINT_LIGHT_SHADOWS > 0 2004 PointLightShadow pointLight; 2005 #pragma unroll_loop_start 2006 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2007 pointLight = pointLightShadows[ i ]; 2008 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2009 } 2010 #pragma unroll_loop_end 2011 #endif 2012 #endif 2013 return shadow; 2014}`,_5=`#ifdef USE_SKINNING 2015 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2016 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2017 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2018 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2019#endif`,x5=`#ifdef USE_SKINNING 2020 uniform mat4 bindMatrix; 2021 uniform mat4 bindMatrixInverse; 2022 uniform highp sampler2D boneTexture; 2023 mat4 getBoneMatrix( const in float i ) { 2024 int size = textureSize( boneTexture, 0 ).x; 2025 int j = int( i ) * 4; 2026 int x = j % size; 2027 int y = j / size; 2028 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2029 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2030 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2031 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2032 return mat4( v1, v2, v3, v4 ); 2033 } 2034#endif`,v5=`#ifdef USE_SKINNING 2035 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2036 vec4 skinned = vec4( 0.0 ); 2037 skinned += boneMatX * skinVertex * skinWeight.x; 2038 skinned += boneMatY * skinVertex * skinWeight.y; 2039 skinned += boneMatZ * skinVertex * skinWeight.z; 2040 skinned += boneMatW * skinVertex * skinWeight.w; 2041 transformed = ( bindMatrixInverse * skinned ).xyz; 2042#endif`,A5=`#ifdef USE_SKINNING 2043 mat4 skinMatrix = mat4( 0.0 ); 2044 skinMatrix += skinWeight.x * boneMatX; 2045 skinMatrix += skinWeight.y * boneMatY; 2046 skinMatrix += skinWeight.z * boneMatZ; 2047 skinMatrix += skinWeight.w * boneMatW; 2048 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2049 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2050 #ifdef USE_TANGENT 2051 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2052 #endif 2053#endif`,S5=`float specularStrength; 2054#ifdef USE_SPECULARMAP 2055 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2056 specularStrength = texelSpecular.r; 2057#else 2058 specularStrength = 1.0; 2059#endif`,M5=`#ifdef USE_SPECULARMAP 2060 uniform sampler2D specularMap; 2061#endif`,E5=`#if defined( TONE_MAPPING ) 2062 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2063#endif`,w5=`#ifndef saturate 2064#define saturate( a ) clamp( a, 0.0, 1.0 ) 2065#endif 2066uniform float toneMappingExposure; 2067vec3 LinearToneMapping( vec3 color ) { 2068 return saturate( toneMappingExposure * color ); 2069} 2070vec3 ReinhardToneMapping( vec3 color ) { 2071 color *= toneMappingExposure; 2072 return saturate( color / ( vec3( 1.0 ) + color ) ); 2073} 2074vec3 OptimizedCineonToneMapping( vec3 color ) { 2075 color *= toneMappingExposure; 2076 color = max( vec3( 0.0 ), color - 0.004 ); 2077 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2078} 2079vec3 RRTAndODTFit( vec3 v ) { 2080 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2081 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2082 return a / b; 2083} 2084vec3 ACESFilmicToneMapping( vec3 color ) { 2085 const mat3 ACESInputMat = mat3( 2086 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2087 vec3( 0.04823, 0.01566, 0.83777 ) 2088 ); 2089 const mat3 ACESOutputMat = mat3( 2090 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2091 vec3( -0.07367, -0.00605, 1.07602 ) 2092 ); 2093 color *= toneMappingExposure / 0.6; 2094 color = ACESInputMat * color; 2095 color = RRTAndODTFit( color ); 2096 color = ACESOutputMat * color; 2097 return saturate( color ); 2098} 2099const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2100 vec3( 1.6605, - 0.1246, - 0.0182 ), 2101 vec3( - 0.5876, 1.1329, - 0.1006 ), 2102 vec3( - 0.0728, - 0.0083, 1.1187 ) 2103); 2104const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2105 vec3( 0.6274, 0.0691, 0.0164 ), 2106 vec3( 0.3293, 0.9195, 0.0880 ), 2107 vec3( 0.0433, 0.0113, 0.8956 ) 2108); 2109vec3 agxDefaultContrastApprox( vec3 x ) { 2110 vec3 x2 = x * x; 2111 vec3 x4 = x2 * x2; 2112 return + 15.5 * x4 * x2 2113 - 40.14 * x4 * x 2114 + 31.96 * x4 2115 - 6.868 * x2 * x 2116 + 0.4298 * x2 2117 + 0.1191 * x 2118 - 0.00232; 2119} 2120vec3 AgXToneMapping( vec3 color ) { 2121 const mat3 AgXInsetMatrix = mat3( 2122 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2123 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2124 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2125 );
2126 const mat3 AgXOutsetMatrix = mat3( 2127 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2128 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2129 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2130 ); 2131 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2132 color *= toneMappingExposure; 2133 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2134 color = AgXInsetMatrix * color; 2135 color = max( color, 1e-10 ); color = log2( color ); 2136 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2137 color = clamp( color, 0.0, 1.0 ); 2138 color = agxDefaultContrastApprox( color ); 2139 color = AgXOutsetMatrix * color; 2140 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2141 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2142 color = clamp( color, 0.0, 1.0 ); 2143 return color; 2144} 2145vec3 NeutralToneMapping( vec3 color ) { 2146 const float StartCompression = 0.8 - 0.04; 2147 const float Desaturation = 0.15; 2148 color *= toneMappingExposure; 2149 float x = min( color.r, min( color.g, color.b ) ); 2150 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2151 color -= offset; 2152 float peak = max( color.r, max( color.g, color.b ) ); 2153 if ( peak < StartCompression ) return color; 2154 float d = 1. - StartCompression; 2155 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2156 color *= newPeak / peak; 2157 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2158 return mix( color, vec3( newPeak ), g ); 2159} 2160vec3 CustomToneMapping( vec3 color ) { return color; }`,T5=`#ifdef USE_TRANSMISSION 2161 material.transmission = transmission; 2162 material.transmissionAlpha = 1.0; 2163 material.thickness = thickness; 2164 material.attenuationDistance = attenuationDistance; 2165 material.attenuationColor = attenuationColor; 2166 #ifdef USE_TRANSMISSIONMAP 2167 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2168 #endif 2169 #ifdef USE_THICKNESSMAP 2170 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2171 #endif 2172 vec3 pos = vWorldPosition; 2173 vec3 v = normalize( cameraPosition - pos ); 2174 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2175 vec4 transmitted = getIBLVolumeRefraction( 2176 n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, 2177 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2178 material.attenuationColor, material.attenuationDistance ); 2179 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2180 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2181#endif`,C5=`#ifdef USE_TRANSMISSION 2182 uniform float transmission; 2183 uniform float thickness; 2184 uniform float attenuationDistance; 2185 uniform vec3 attenuationColor; 2186 #ifdef USE_TRANSMISSIONMAP 2187 uniform sampler2D transmissionMap; 2188 #endif 2189 #ifdef USE_THICKNESSMAP 2190 uniform sampler2D thicknessMap; 2191 #endif 2192 uniform vec2 transmissionSamplerSize; 2193 uniform sampler2D transmissionSamplerMap; 2194 uniform mat4 modelMatrix; 2195 uniform mat4 projectionMatrix; 2196 varying vec3 vWorldPosition; 2197 float w0( float a ) { 2198 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2199 } 2200 float w1( float a ) { 2201 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2202 } 2203 float w2( float a ){ 2204 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2205 } 2206 float w3( float a ) { 2207 return ( 1.0 / 6.0 ) * ( a * a * a ); 2208 } 2209 float g0( float a ) { 2210 return w0( a ) + w1( a ); 2211 } 2212 float g1( float a ) { 2213 return w2( a ) + w3( a ); 2214 } 2215 float h0( float a ) { 2216 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2217 } 2218 float h1( float a ) { 2219 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2220 } 2221 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2222 uv = uv * texelSize.zw + 0.5; 2223 vec2 iuv = floor( uv ); 2224 vec2 fuv = fract( uv ); 2225 float g0x = g0( fuv.x ); 2226 float g1x = g1( fuv.x ); 2227 float h0x = h0( fuv.x ); 2228 float h1x = h1( fuv.x ); 2229 float h0y = h0( fuv.y ); 2230 float h1y = h1( fuv.y ); 2231 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2232 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2233 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2234 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2235 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2236 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2237 } 2238 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2239 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2240 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2241 vec2 fLodSizeInv = 1.0 / fLodSize; 2242 vec2 cLodSizeInv = 1.0 / cLodSize; 2243 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2244 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2245 return mix( fSample, cSample, fract( lod ) ); 2246 } 2247 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2248 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2249 vec3 modelScale; 2250 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2251 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2252 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2253 return normalize( refractionVector ) * thickness * modelScale; 2254 } 2255 float applyIorToRoughness( const in float roughness, const in float ior ) { 2256 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2257 } 2258 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2259 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2260 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2261 } 2262 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2263 if ( isinf( attenuationDistance ) ) { 2264 return vec3( 1.0 ); 2265 } else { 2266 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2267 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2268 } 2269 } 2270 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2271 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2272 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2273 const in vec3 attenuationColor, const in float attenuationDistance ) { 2274 vec4 transmittedLight; 2275 vec3 transmittance; 2276 #ifdef USE_DISPERSION 2277 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2278 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2279 for ( int i = 0; i < 3; i ++ ) { 2280 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2281 vec3 refractedRayExit = position + transmissionRay; 2282 2283 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2284 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2285 refractionCoords += 1.0; 2286 refractionCoords /= 2.0; 2287 2288 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2289 transmittedLight[ i ] = transmissionSample[ i ]; 2290 transmittedLight.a += transmissionSample.a; 2291 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2292 } 2293 transmittedLight.a /= 3.0; 2294 2295 #else 2296 2297 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2298 vec3 refractedRayExit = position + transmissionRay; 2299 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2300 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2301 refractionCoords += 1.0; 2302 refractionCoords /= 2.0; 2303 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2304 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2305 2306 #endif 2307 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2308 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2309 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2310 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2311 } 2312#endif`,R5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2313 varying vec2 vUv; 2314#endif 2315#ifdef USE_MAP 2316 varying vec2 vMapUv; 2317#endif 2318#ifdef USE_ALPHAMAP
2319 varying vec2 vAlphaMapUv; 2320#endif 2321#ifdef USE_LIGHTMAP 2322 varying vec2 vLightMapUv; 2323#endif 2324#ifdef USE_AOMAP 2325 varying vec2 vAoMapUv; 2326#endif 2327#ifdef USE_BUMPMAP 2328 varying vec2 vBumpMapUv; 2329#endif 2330#ifdef USE_NORMALMAP 2331 varying vec2 vNormalMapUv; 2332#endif 2333#ifdef USE_EMISSIVEMAP 2334 varying vec2 vEmissiveMapUv; 2335#endif 2336#ifdef USE_METALNESSMAP 2337 varying vec2 vMetalnessMapUv; 2338#endif 2339#ifdef USE_ROUGHNESSMAP 2340 varying vec2 vRoughnessMapUv; 2341#endif 2342#ifdef USE_ANISOTROPYMAP 2343 varying vec2 vAnisotropyMapUv; 2344#endif 2345#ifdef USE_CLEARCOATMAP 2346 varying vec2 vClearcoatMapUv; 2347#endif 2348#ifdef USE_CLEARCOAT_NORMALMAP 2349 varying vec2 vClearcoatNormalMapUv; 2350#endif 2351#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2352 varying vec2 vClearcoatRoughnessMapUv; 2353#endif 2354#ifdef USE_IRIDESCENCEMAP 2355 varying vec2 vIridescenceMapUv; 2356#endif 2357#ifdef USE_IRIDESCENCE_THICKNESSMAP 2358 varying vec2 vIridescenceThicknessMapUv; 2359#endif 2360#ifdef USE_SHEEN_COLORMAP 2361 varying vec2 vSheenColorMapUv; 2362#endif 2363#ifdef USE_SHEEN_ROUGHNESSMAP 2364 varying vec2 vSheenRoughnessMapUv; 2365#endif 2366#ifdef USE_SPECULARMAP 2367 varying vec2 vSpecularMapUv; 2368#endif 2369#ifdef USE_SPECULAR_COLORMAP 2370 varying vec2 vSpecularColorMapUv; 2371#endif 2372#ifdef USE_SPECULAR_INTENSITYMAP 2373 varying vec2 vSpecularIntensityMapUv; 2374#endif 2375#ifdef USE_TRANSMISSIONMAP 2376 uniform mat3 transmissionMapTransform; 2377 varying vec2 vTransmissionMapUv; 2378#endif 2379#ifdef USE_THICKNESSMAP 2380 uniform mat3 thicknessMapTransform; 2381 varying vec2 vThicknessMapUv; 2382#endif`,b5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2383 varying vec2 vUv; 2384#endif 2385#ifdef USE_MAP 2386 uniform mat3 mapTransform; 2387 varying vec2 vMapUv; 2388#endif 2389#ifdef USE_ALPHAMAP 2390 uniform mat3 alphaMapTransform; 2391 varying vec2 vAlphaMapUv; 2392#endif 2393#ifdef USE_LIGHTMAP 2394 uniform mat3 lightMapTransform; 2395 varying vec2 vLightMapUv; 2396#endif 2397#ifdef USE_AOMAP 2398 uniform mat3 aoMapTransform; 2399 varying vec2 vAoMapUv; 2400#endif 2401#ifdef USE_BUMPMAP 2402 uniform mat3 bumpMapTransform; 2403 varying vec2 vBumpMapUv; 2404#endif 2405#ifdef USE_NORMALMAP 2406 uniform mat3 normalMapTransform; 2407 varying vec2 vNormalMapUv; 2408#endif 2409#ifdef USE_DISPLACEMENTMAP 2410 uniform mat3 displacementMapTransform; 2411 varying vec2 vDisplacementMapUv; 2412#endif 2413#ifdef USE_EMISSIVEMAP 2414 uniform mat3 emissiveMapTransform; 2415 varying vec2 vEmissiveMapUv; 2416#endif 2417#ifdef USE_METALNESSMAP 2418 uniform mat3 metalnessMapTransform; 2419 varying vec2 vMetalnessMapUv; 2420#endif 2421#ifdef USE_ROUGHNESSMAP 2422 uniform mat3 roughnessMapTransform; 2423 varying vec2 vRoughnessMapUv; 2424#endif 2425#ifdef USE_ANISOTROPYMAP 2426 uniform mat3 anisotropyMapTransform; 2427 varying vec2 vAnisotropyMapUv; 2428#endif 2429#ifdef USE_CLEARCOATMAP 2430 uniform mat3 clearcoatMapTransform; 2431 varying vec2 vClearcoatMapUv; 2432#endif 2433#ifdef USE_CLEARCOAT_NORMALMAP 2434 uniform mat3 clearcoatNormalMapTransform; 2435 varying vec2 vClearcoatNormalMapUv; 2436#endif 2437#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2438 uniform mat3 clearcoatRoughnessMapTransform; 2439 varying vec2 vClearcoatRoughnessMapUv; 2440#endif 2441#ifdef USE_SHEEN_COLORMAP 2442 uniform mat3 sheenColorMapTransform; 2443 varying vec2 vSheenColorMapUv; 2444#endif 2445#ifdef USE_SHEEN_ROUGHNESSMAP 2446 uniform mat3 sheenRoughnessMapTransform; 2447 varying vec2 vSheenRoughnessMapUv; 2448#endif 2449#ifdef USE_IRIDESCENCEMAP 2450 uniform mat3 iridescenceMapTransform; 2451 varying vec2 vIridescenceMapUv; 2452#endif 2453#ifdef USE_IRIDESCENCE_THICKNESSMAP 2454 uniform mat3 iridescenceThicknessMapTransform; 2455 varying vec2 vIridescenceThicknessMapUv; 2456#endif 2457#ifdef USE_SPECULARMAP 2458 uniform mat3 specularMapTransform; 2459 varying vec2 vSpecularMapUv; 2460#endif 2461#ifdef USE_SPECULAR_COLORMAP 2462 uniform mat3 specularColorMapTransform; 2463 varying vec2 vSpecularColorMapUv; 2464#endif 2465#ifdef USE_SPECULAR_INTENSITYMAP 2466 uniform mat3 specularIntensityMapTransform; 2467 varying vec2 vSpecularIntensityMapUv; 2468#endif 2469#ifdef USE_TRANSMISSIONMAP 2470 uniform mat3 transmissionMapTransform; 2471 varying vec2 vTransmissionMapUv; 2472#endif 2473#ifdef USE_THICKNESSMAP 2474 uniform mat3 thicknessMapTransform; 2475 varying vec2 vThicknessMapUv; 2476#endif`,P5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2477 vUv = vec3( uv, 1 ).xy; 2478#endif 2479#ifdef USE_MAP 2480 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2481#endif 2482#ifdef USE_ALPHAMAP 2483 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2484#endif 2485#ifdef USE_LIGHTMAP 2486 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2487#endif 2488#ifdef USE_AOMAP 2489 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2490#endif 2491#ifdef USE_BUMPMAP 2492 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2493#endif 2494#ifdef USE_NORMALMAP 2495 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2496#endif 2497#ifdef USE_DISPLACEMENTMAP 2498 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2499#endif 2500#ifdef USE_EMISSIVEMAP 2501 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2502#endif 2503#ifdef USE_METALNESSMAP 2504 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2505#endif 2506#ifdef USE_ROUGHNESSMAP 2507 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2508#endif 2509#ifdef USE_ANISOTROPYMAP 2510 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2511#endif 2512#ifdef USE_CLEARCOATMAP 2513 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2514#endif 2515#ifdef USE_CLEARCOAT_NORMALMAP 2516 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2517#endif 2518#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2519 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2520#endif
2521#ifdef USE_IRIDESCENCEMAP 2522 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2523#endif 2524#ifdef USE_IRIDESCENCE_THICKNESSMAP 2525 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2526#endif 2527#ifdef USE_SHEEN_COLORMAP 2528 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2529#endif 2530#ifdef USE_SHEEN_ROUGHNESSMAP 2531 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2532#endif 2533#ifdef USE_SPECULARMAP 2534 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2535#endif 2536#ifdef USE_SPECULAR_COLORMAP 2537 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2538#endif 2539#ifdef USE_SPECULAR_INTENSITYMAP 2540 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2541#endif 2542#ifdef USE_TRANSMISSIONMAP 2543 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2544#endif 2545#ifdef USE_THICKNESSMAP 2546 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2547#endif`,B5=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2548 vec4 worldPosition = vec4( transformed, 1.0 ); 2549 #ifdef USE_BATCHING 2550 worldPosition = batchingMatrix * worldPosition; 2551 #endif 2552 #ifdef USE_INSTANCING 2553 worldPosition = instanceMatrix * worldPosition; 2554 #endif 2555 worldPosition = modelMatrix * worldPosition; 2556#endif`;const I5=`varying vec2 vUv; 2557uniform mat3 uvTransform; 2558void main() { 2559 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2560 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2561}`,L5=`uniform sampler2D t2D; 2562uniform float backgroundIntensity; 2563varying vec2 vUv; 2564void main() { 2565 vec4 texColor = texture2D( t2D, vUv ); 2566 #ifdef DECODE_VIDEO_TEXTURE 2567 texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); 2568 #endif 2569 texColor.rgb *= backgroundIntensity; 2570 gl_FragColor = texColor; 2571 #include <tonemapping_fragment> 2572 #include <colorspace_fragment> 2573}`,D5=`varying vec3 vWorldDirection; 2574#include <common> 2575void main() { 2576 vWorldDirection = transformDirection( position, modelMatrix ); 2577 #include <begin_vertex> 2578 #include <project_vertex> 2579 gl_Position.z = gl_Position.w; 2580}`,z5=`#ifdef ENVMAP_TYPE_CUBE 2581 uniform samplerCube envMap; 2582#elif defined( ENVMAP_TYPE_CUBE_UV ) 2583 uniform sampler2D envMap; 2584#endif 2585uniform float flipEnvMap; 2586uniform float backgroundBlurriness; 2587uniform float backgroundIntensity; 2588uniform mat3 backgroundRotation; 2589varying vec3 vWorldDirection; 2590#include <cube_uv_reflection_fragment> 2591void main() { 2592 #ifdef ENVMAP_TYPE_CUBE 2593 vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 2594 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2595 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2596 #else 2597 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2598 #endif 2599 texColor.rgb *= backgroundIntensity; 2600 gl_FragColor = texColor; 2601 #include <tonemapping_fragment> 2602 #include <colorspace_fragment> 2603}`,F5=`varying vec3 vWorldDirection; 2604#include <common> 2605void main() { 2606 vWorldDirection = transformDirection( position, modelMatrix ); 2607 #include <begin_vertex> 2608 #include <project_vertex> 2609 gl_Position.z = gl_Position.w; 2610}`,O5=`uniform samplerCube tCube; 2611uniform float tFlip; 2612uniform float opacity; 2613varying vec3 vWorldDirection; 2614void main() { 2615 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2616 gl_FragColor = texColor; 2617 gl_FragColor.a *= opacity; 2618 #include <tonemapping_fragment> 2619 #include <colorspace_fragment> 2620}`,U5=`#include <common> 2621#include <batching_pars_vertex> 2622#include <uv_pars_vertex> 2623#include <displacementmap_pars_vertex> 2624#include <morphtarget_pars_vertex> 2625#include <skinning_pars_vertex> 2626#include <logdepthbuf_pars_vertex> 2627#include <clipping_planes_pars_vertex> 2628varying vec2 vHighPrecisionZW; 2629void main() { 2630 #include <uv_vertex> 2631 #include <batching_vertex> 2632 #include <skinbase_vertex> 2633 #include <morphinstance_vertex> 2634 #ifdef USE_DISPLACEMENTMAP 2635 #include <beginnormal_vertex> 2636 #include <morphnormal_vertex> 2637 #include <skinnormal_vertex> 2638 #endif 2639 #include <begin_vertex> 2640 #include <morphtarget_vertex> 2641 #include <skinning_vertex> 2642 #include <displacementmap_vertex> 2643 #include <project_vertex> 2644 #include <logdepthbuf_vertex> 2645 #include <clipping_planes_vertex> 2646 vHighPrecisionZW = gl_Position.zw; 2647}`,N5=`#if DEPTH_PACKING == 3200 2648 uniform float opacity; 2649#endif 2650#include <common> 2651#include <packing> 2652#include <uv_pars_fragment> 2653#include <map_pars_fragment> 2654#include <alphamap_pars_fragment> 2655#include <alphatest_pars_fragment> 2656#include <alphahash_pars_fragment> 2657#include <logdepthbuf_pars_fragment> 2658#include <clipping_planes_pars_fragment> 2659varying vec2 vHighPrecisionZW; 2660void main() { 2661 vec4 diffuseColor = vec4( 1.0 ); 2662 #include <clipping_planes_fragment> 2663 #if DEPTH_PACKING == 3200 2664 diffuseColor.a = opacity; 2665 #endif 2666 #include <map_fragment> 2667 #include <alphamap_fragment> 2668 #include <alphatest_fragment> 2669 #include <alphahash_fragment> 2670 #include <logdepthbuf_fragment> 2671 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 2672 #if DEPTH_PACKING == 3200 2673 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2674 #elif DEPTH_PACKING == 3201 2675 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2676 #endif 2677}`,k5=`#define DISTANCE 2678varying vec3 vWorldPosition; 2679#include <common> 2680#include <batching_pars_vertex> 2681#include <uv_pars_vertex> 2682#include <displacementmap_pars_vertex> 2683#include <morphtarget_pars_vertex> 2684#include <skinning_pars_vertex> 2685#include <clipping_planes_pars_vertex> 2686void main() { 2687 #include <uv_vertex> 2688 #include <batching_vertex> 2689 #include <skinbase_vertex> 2690 #include <morphinstance_vertex> 2691 #ifdef USE_DISPLACEMENTMAP 2692 #include <beginnormal_vertex> 2693 #include <morphnormal_vertex> 2694 #include <skinnormal_vertex> 2695 #endif 2696 #include <begin_vertex> 2697 #include <morphtarget_vertex> 2698 #include <skinning_vertex> 2699 #include <displacementmap_vertex> 2700 #include <project_vertex> 2701 #include <worldpos_vertex> 2702 #include <clipping_planes_vertex> 2703 vWorldPosition = worldPosition.xyz; 2704}`,H5=`#define DISTANCE 2705uniform vec3 referencePosition; 2706uniform float nearDistance; 2707uniform float farDistance; 2708varying vec3 vWorldPosition; 2709#include <common> 2710#include <packing> 2711#include <uv_pars_fragment> 2712#include <map_pars_fragment> 2713#include <alphamap_pars_fragment> 2714#include <alphatest_pars_fragment> 2715#include <alphahash_pars_fragment> 2716#include <clipping_planes_pars_fragment> 2717void main () { 2718 vec4 diffuseColor = vec4( 1.0 ); 2719 #include <clipping_planes_fragment> 2720 #include <map_fragment> 2721 #include <alphamap_fragment> 2722 #include <alphatest_fragment> 2723 #include <alphahash_fragment> 2724 float dist = length( vWorldPosition - referencePosition ); 2725 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2726 dist = saturate( dist ); 2727 gl_FragColor = packDepthToRGBA( dist ); 2728}`,G5=`varying vec3 vWorldDirection; 2729#include <common> 2730void main() { 2731 vWorldDirection = transformDirection( position, modelMatrix ); 2732 #include <begin_vertex> 2733 #include <project_vertex> 2734}`,V5=`uniform sampler2D tEquirect; 2735varying vec3 vWorldDirection; 2736#include <common> 2737void main() { 2738 vec3 direction = normalize( vWorldDirection ); 2739 vec2 sampleUV = equirectUv( direction ); 2740 gl_FragColor = texture2D( tEquirect, sampleUV ); 2741 #include <tonemapping_fragment> 2742 #include <colorspace_fragment> 2743}`,W5=`uniform float scale; 2744attribute float lineDistance; 2745varying float vLineDistance; 2746#include <common> 2747#include <uv_pars_vertex> 2748#include <color_pars_vertex> 2749#include <fog_pars_vertex> 2750#include <morphtarget_pars_vertex> 2751#include <logdepthbuf_pars_vertex> 2752#include <clipping_planes_pars_vertex> 2753void main() { 2754 vLineDistance = scale * lineDistance; 2755 #include <uv_vertex> 2756 #include <color_vertex> 2757 #include <morphinstance_vertex> 2758 #include <morphcolor_vertex> 2759 #include <begin_vertex> 2760 #include <morphtarget_vertex> 2761 #include <project_vertex> 2762 #include <logdepthbuf_vertex> 2763 #include <clipping_planes_vertex> 2764 #include <fog_vertex> 2765}`,j5=`uniform vec3 diffuse; 2766uniform float opacity; 2767uniform float dashSize; 2768uniform float totalSize; 2769varying float vLineDistance; 2770#include <common> 2771#include <color_pars_fragment> 2772#include <uv_pars_fragment> 2773#include <map_pars_fragment> 2774#include <fog_pars_fragment> 2775#include <logdepthbuf_pars_fragment> 2776#include <clipping_planes_pars_fragment> 2777void main() { 2778 vec4 diffuseColor = vec4( diffuse, opacity ); 2779 #include <clipping_planes_fragment> 2780 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2781 discard; 2782 } 2783 vec3 outgoingLight = vec3( 0.0 ); 2784 #include <logdepthbuf_fragment> 2785 #include <map_fragment> 2786 #include <color_fragment> 2787 outgoingLight = diffuseColor.rgb; 2788 #include <opaque_fragment> 2789 #include <tonemapping_fragment> 2790 #include <colorspace_fragment> 2791 #include <fog_fragment> 2792 #include <premultiplied_alpha_fragment> 2793}`,X5=`#include <common> 2794#include <batching_pars_vertex> 2795#include <uv_pars_vertex> 2796#include <envmap_pars_vertex> 2797#include <color_pars_vertex> 2798#include <fog_pars_vertex> 2799#include <morphtarget_pars_vertex> 2800#include <skinning_pars_vertex> 2801#include <logdepthbuf_pars_vertex> 2802#include <clipping_planes_pars_vertex> 2803void main() { 2804 #include <uv_vertex> 2805 #include <color_vertex> 2806 #include <morphinstance_vertex> 2807 #include <morphcolor_vertex> 2808 #include <batching_vertex> 2809 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2810 #include <beginnormal_vertex> 2811 #include <morphnormal_vertex> 2812 #include <skinbase_vertex> 2813 #include <skinnormal_vertex> 2814 #include <defaultnormal_vertex> 2815 #endif 2816 #include <begin_vertex> 2817 #include <morphtarget_vertex> 2818 #include <skinning_vertex> 2819 #include <project_vertex> 2820 #include <logdepthbuf_vertex> 2821 #include <clipping_planes_vertex> 2822 #include <worldpos_vertex> 2823 #include <envmap_vertex> 2824 #include <fog_vertex> 2825}`,J5=`uniform vec3 diffuse; 2826uniform float opacity; 2827#ifndef FLAT_SHADED 2828 varying vec3 vNormal; 2829#endif 2830#include <common> 2831#include <dithering_pars_fragment> 2832#include <color_pars_fragment> 2833#include <uv_pars_fragment> 2834#include <map_pars_fragment> 2835#include <alphamap_pars_fragment> 2836#include <alphatest_pars_fragment> 2837#include <alphahash_pars_fragment> 2838#include <aomap_pars_fragment> 2839#include <lightmap_pars_fragment> 2840#include <envmap_common_pars_fragment> 2841#include <envmap_pars_fragment> 2842#include <fog_pars_fragment> 2843#include <specularmap_pars_fragment> 2844#include <logdepthbuf_pars_fragment> 2845#include <clipping_planes_pars_fragment> 2846void main() { 2847 vec4 diffuseColor = vec4( diffuse, opacity ); 2848 #include <clipping_planes_fragment> 2849 #include <logdepthbuf_fragment> 2850 #include <map_fragment> 2851 #include <color_fragment> 2852 #include <alphamap_fragment> 2853 #include <alphatest_fragment> 2854 #include <alphahash_fragment> 2855 #include <specularmap_fragment> 2856 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2857 #ifdef USE_LIGHTMAP 2858 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2859 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 2860 #else 2861 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2862 #endif 2863 #include <aomap_fragment> 2864 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2865 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2866 #include <envmap_fragment> 2867 #include <opaque_fragment> 2868 #include <tonemapping_fragment> 2869 #include <colorspace_fragment> 2870 #include <fog_fragment> 2871 #include <premultiplied_alpha_fragment> 2872 #include <dithering_fragment> 2873}`,Y5=`#define LAMBERT 2874varying vec3 vViewPosition; 2875#include <common> 2876#include <batching_pars_vertex> 2877#include <uv_pars_vertex> 2878#include <displacementmap_pars_vertex> 2879#include <envmap_pars_vertex> 2880#include <color_pars_vertex> 2881#include <fog_pars_vertex> 2882#include <normal_pars_vertex> 2883#include <morphtarget_pars_vertex> 2884#include <skinning_pars_vertex> 2885#include <shadowmap_pars_vertex> 2886#include <logdepthbuf_pars_vertex> 2887#include <clipping_planes_pars_vertex> 2888void main() { 2889 #include <uv_vertex> 2890 #include <color_vertex> 2891 #include <morphinstance_vertex> 2892 #include <morphcolor_vertex> 2893 #include <batching_vertex> 2894 #include <beginnormal_vertex> 2895 #include <morphnormal_vertex> 2896 #include <skinbase_vertex> 2897 #include <skinnormal_vertex> 2898 #include <defaultnormal_vertex> 2899 #include <normal_vertex> 2900 #include <begin_vertex> 2901 #include <morphtarget_vertex> 2902 #include <skinning_vertex> 2903 #include <displacementmap_vertex> 2904 #include <project_vertex> 2905 #include <logdepthbuf_vertex> 2906 #include <clipping_planes_vertex> 2907 vViewPosition = - mvPosition.xyz; 2908 #include <worldpos_vertex> 2909 #include <envmap_vertex> 2910 #include <shadowmap_vertex> 2911 #include <fog_vertex> 2912}`,K5=`#define LAMBERT 2913uniform vec3 diffuse; 2914uniform vec3 emissive; 2915uniform float opacity; 2916#include <common> 2917#include <packing> 2918#include <dithering_pars_fragment> 2919#include <color_pars_fragment> 2920#include <uv_pars_fragment> 2921#include <map_pars_fragment> 2922#include <alphamap_pars_fragment> 2923#include <alphatest_pars_fragment> 2924#include <alphahash_pars_fragment> 2925#include <aomap_pars_fragment> 2926#include <lightmap_pars_fragment> 2927#include <emissivemap_pars_fragment> 2928#include <envmap_common_pars_fragment> 2929#include <envmap_pars_fragment> 2930#include <fog_pars_fragment> 2931#include <bsdfs> 2932#include <lights_pars_begin> 2933#include <normal_pars_fragment> 2934#include <lights_lambert_pars_fragment> 2935#include <shadowmap_pars_fragment> 2936#include <bumpmap_pars_fragment> 2937#include <normalmap_pars_fragment> 2938#include <specularmap_pars_fragment> 2939#include <logdepthbuf_pars_fragment> 2940#include <clipping_planes_pars_fragment> 2941void main() { 2942 vec4 diffuseColor = vec4( diffuse, opacity ); 2943 #include <clipping_planes_fragment> 2944 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2945 vec3 totalEmissiveRadiance = emissive; 2946 #include <logdepthbuf_fragment> 2947 #include <map_fragment> 2948 #include <color_fragment> 2949 #include <alphamap_fragment> 2950 #include <alphatest_fragment> 2951 #include <alphahash_fragment> 2952 #include <specularmap_fragment> 2953 #include <normal_fragment_begin> 2954 #include <normal_fragment_maps> 2955 #include <emissivemap_fragment> 2956 #include <lights_lambert_fragment> 2957 #include <lights_fragment_begin> 2958 #include <lights_fragment_maps> 2959 #include <lights_fragment_end> 2960 #include <aomap_fragment> 2961 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 2962 #include <envmap_fragment> 2963 #include <opaque_fragment> 2964 #include <tonemapping_fragment> 2965 #include <colorspace_fragment> 2966 #include <fog_fragment> 2967 #include <premultiplied_alpha_fragment> 2968 #include <dithering_fragment> 2969}`,Q5=`#define MATCAP 2970varying vec3 vViewPosition; 2971#include <common> 2972#include <batching_pars_vertex> 2973#include <uv_pars_vertex> 2974#include <color_pars_vertex> 2975#include <displacementmap_pars_vertex> 2976#include <fog_pars_vertex> 2977#include <normal_pars_vertex> 2978#include <morphtarget_pars_vertex> 2979#include <skinning_pars_vertex> 2980#include <logdepthbuf_pars_vertex> 2981#include <clipping_planes_pars_vertex> 2982void main() { 2983 #include <uv_vertex> 2984 #include <color_vertex> 2985 #include <morphinstance_vertex> 2986 #include <morphcolor_vertex> 2987 #include <batching_vertex> 2988 #include <beginnormal_vertex> 2989 #include <morphnormal_vertex> 2990 #include <skinbase_vertex> 2991 #include <skinnormal_vertex> 2992 #include <defaultnormal_vertex> 2993 #include <normal_vertex> 2994 #include <begin_vertex> 2995 #include <morphtarget_vertex> 2996 #include <skinning_vertex> 2997 #include <displacementmap_vertex> 2998 #include <project_vertex> 2999 #include <logdepthbuf_vertex> 3000 #include <clipping_planes_vertex> 3001 #include <fog_vertex> 3002 vViewPosition = - mvPosition.xyz; 3003}`,Z5=`#define MATCAP 3004uniform vec3 diffuse; 3005uniform float opacity; 3006uniform sampler2D matcap; 3007varying vec3 vViewPosition; 3008#include <common> 3009#include <dithering_pars_fragment> 3010#include <color_pars_fragment> 3011#include <uv_pars_fragment> 3012#include <map_pars_fragment> 3013#include <alphamap_pars_fragment> 3014#include <alphatest_pars_fragment> 3015#include <alphahash_pars_fragment> 3016#include <fog_pars_fragment> 3017#include <normal_pars_fragment> 3018#include <bumpmap_pars_fragment> 3019#include <normalmap_pars_fragment> 3020#include <logdepthbuf_pars_fragment> 3021#include <clipping_planes_pars_fragment> 3022void main() { 3023 vec4 diffuseColor = vec4( diffuse, opacity ); 3024 #include <clipping_planes_fragment> 3025 #include <logdepthbuf_fragment> 3026 #include <map_fragment> 3027 #include <color_fragment> 3028 #include <alpha
3028map_fragment> 3029 #include <alphatest_fragment> 3030 #include <alphahash_fragment> 3031 #include <normal_fragment_begin> 3032 #include <normal_fragment_maps> 3033 vec3 viewDir = normalize( vViewPosition ); 3034 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3035 vec3 y = cross( viewDir, x ); 3036 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3037 #ifdef USE_MATCAP 3038 vec4 matcapColor = texture2D( matcap, uv ); 3039 #else 3040 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3041 #endif 3042 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3043 #include <opaque_fragment> 3044 #include <tonemapping_fragment> 3045 #include <colorspace_fragment> 3046 #include <fog_fragment> 3047 #include <premultiplied_alpha_fragment> 3048 #include <dithering_fragment> 3049}`,q5=`#define NORMAL 3050#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3051 varying vec3 vViewPosition; 3052#endif 3053#include <common> 3054#include <batching_pars_vertex> 3055#include <uv_pars_vertex> 3056#include <displacementmap_pars_vertex> 3057#include <normal_pars_vertex> 3058#include <morphtarget_pars_vertex> 3059#include <skinning_pars_vertex> 3060#include <logdepthbuf_pars_vertex> 3061#include <clipping_planes_pars_vertex> 3062void main() { 3063 #include <uv_vertex> 3064 #include <batching_vertex> 3065 #include <beginnormal_vertex> 3066 #include <morphinstance_vertex> 3067 #include <morphnormal_vertex> 3068 #include <skinbase_vertex> 3069 #include <skinnormal_vertex> 3070 #include <defaultnormal_vertex> 3071 #include <normal_vertex> 3072 #include <begin_vertex> 3073 #include <morphtarget_vertex> 3074 #include <skinning_vertex> 3075 #include <displacementmap_vertex> 3076 #include <project_vertex> 3077 #include <logdepthbuf_vertex> 3078 #include <clipping_planes_vertex> 3079#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3080 vViewPosition = - mvPosition.xyz; 3081#endif 3082}`,$5=`#define NORMAL 3083uniform float opacity; 3084#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3085 varying vec3 vViewPosition; 3086#endif 3087#include <packing> 3088#include <uv_pars_fragment> 3089#include <normal_pars_fragment> 3090#include <bumpmap_pars_fragment> 3091#include <normalmap_pars_fragment> 3092#include <logdepthbuf_pars_fragment> 3093#include <clipping_planes_pars_fragment> 3094void main() { 3095 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3096 #include <clipping_planes_fragment> 3097 #include <logdepthbuf_fragment> 3098 #include <normal_fragment_begin> 3099 #include <normal_fragment_maps> 3100 gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); 3101 #ifdef OPAQUE 3102 gl_FragColor.a = 1.0; 3103 #endif 3104}`,ek=`#define PHONG 3105varying vec3 vViewPosition; 3106#include <common> 3107#include <batching_pars_vertex> 3108#include <uv_pars_vertex> 3109#include <displacementmap_pars_vertex> 3110#include <envmap_pars_vertex> 3111#include <color_pars_vertex> 3112#include <fog_pars_vertex> 3113#include <normal_pars_vertex> 3114#include <morphtarget_pars_vertex> 3115#include <skinning_pars_vertex> 3116#include <shadowmap_pars_vertex> 3117#include <logdepthbuf_pars_vertex> 3118#include <clipping_planes_pars_vertex> 3119void main() { 3120 #include <uv_vertex> 3121 #include <color_vertex> 3122 #include <morphcolor_vertex> 3123 #include <batching_vertex> 3124 #include <beginnormal_vertex> 3125 #include <morphinstance_vertex> 3126 #include <morphnormal_vertex> 3127 #include <skinbase_vertex> 3128 #include <skinnormal_vertex> 3129 #include <defaultnormal_vertex> 3130 #include <normal_vertex> 3131 #include <begin_vertex> 3132 #include <morphtarget_vertex> 3133 #include <skinning_vertex> 3134 #include <displacementmap_vertex> 3135 #include <project_vertex> 3136 #include <logdepthbuf_vertex> 3137 #include <clipping_planes_vertex> 3138 vViewPosition = - mvPosition.xyz; 3139 #include <worldpos_vertex> 3140 #include <envmap_vertex> 3141 #include <shadowmap_vertex> 3142 #include <fog_vertex> 3143}`,tk=`#define PHONG 3144uniform vec3 diffuse; 3145uniform vec3 emissive; 3146uniform vec3 specular; 3147uniform float shininess; 3148uniform float opacity; 3149#include <common> 3150#include <packing> 3151#include <dithering_pars_fragment> 3152#include <color_pars_fragment> 3153#include <uv_pars_fragment> 3154#include <map_pars_fragment> 3155#include <alphamap_pars_fragment> 3156#include <alphatest_pars_fragment> 3157#include <alphahash_pars_fragment> 3158#include <aomap_pars_fragment> 3159#include <lightmap_pars_fragment> 3160#include <emissivemap_pars_fragment> 3161#include <envmap_common_pars_fragment> 3162#include <envmap_pars_fragment> 3163#include <fog_pars_fragment> 3164#include <bsdfs> 3165#include <lights_pars_begin> 3166#include <normal_pars_fragment> 3167#include <lights_phong_pars_fragment> 3168#include <shadowmap_pars_fragment> 3169#include <bumpmap_pars_fragment> 3170#include <normalmap_pars_fragment> 3171#include <specularmap_pars_fragment> 3172#include <logdepthbuf_pars_fragment> 3173#include <clipping_planes_pars_fragment> 3174void main() { 3175 vec4 diffuseColor = vec4( diffuse, opacity ); 3176 #include <clipping_planes_fragment> 3177 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3178 vec3 totalEmissiveRadiance = emissive; 3179 #include <logdepthbuf_fragment> 3180 #include <map_fragment> 3181 #include <color_fragment> 3182 #include <alphamap_fragment> 3183 #include <alphatest_fragment> 3184 #include <alphahash_fragment> 3185 #include <specularmap_fragment> 3186 #include <normal_fragment_begin> 3187 #include <normal_fragment_maps> 3188 #include <emissivemap_fragment> 3189 #include <lights_phong_fragment> 3190 #include <lights_fragment_begin> 3191 #include <lights_fragment_maps> 3192 #include <lights_fragment_end> 3193 #include <aomap_fragment> 3194 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3195 #include <envmap_fragment> 3196 #include <opaque_fragment> 3197 #include <tonemapping_fragment> 3198 #include <colorspace_fragment> 3199 #include <fog_fragment> 3200 #include <premultiplied_alpha_fragment> 3201 #include <dithering_fragment> 3202}`,nk=`#define STANDARD 3203varying vec3 vViewPosition; 3204#ifdef USE_TRANSMISSION 3205 varying vec3 vWorldPosition; 3206#endif 3207#include <common> 3208#include <batching_pars_vertex> 3209#include <uv_pars_vertex> 3210#include <displacementmap_pars_vertex> 3211#include <color_pars_vertex> 3212#include <fog_pars_vertex> 3213#include <normal_pars_vertex> 3214#include <morphtarget_pars_vertex> 3215#include <skinning_pars_vertex> 3216#include <shadowmap_pars_vertex> 3217#include <logdepthbuf_pars_vertex> 3218#include <clipping_planes_pars_vertex> 3219void main() { 3220 #include <uv_vertex> 3221 #include <color_vertex> 3222 #include <morphinstance_vertex> 3223 #include <morphcolor_vertex> 3224 #include <batching_vertex> 3225 #include <beginnormal_vertex> 3226 #include <morphnormal_vertex> 3227 #include <skinbase_vertex> 3228 #include <skinnormal_vertex> 3229 #include <defaultnormal_vertex> 3230 #include <normal_vertex> 3231 #include <begin_vertex> 3232 #include <morphtarget_vertex> 3233 #include <skinning_vertex> 3234 #include <displacementmap_vertex> 3235 #include <project_vertex> 3236 #include <logdepthbuf_vertex> 3237 #include <clipping_planes_vertex> 3238 vViewPosition = - mvPosition.xyz; 3239 #include <worldpos_vertex> 3240 #include <shadowmap_vertex> 3241 #include <fog_vertex> 3242#ifdef USE_TRANSMISSION 3243 vWorldPosition = worldPosition.xyz; 3244#endif 3245}`,ik=`#define STANDARD 3246#ifdef PHYSICAL 3247 #define IOR 3248 #define USE_SPECULAR 3249#endif 3250uniform vec3 diffuse; 3251uniform vec3 emissive; 3252uniform float roughness; 3253uniform float metalness; 3254uniform float opacity; 3255#ifdef IOR 3256 uniform float ior; 3257#endif 3258#ifdef USE_SPECULAR 3259 uniform float specularIntensity; 3260 uniform vec3 specularColor; 3261 #ifdef USE_SPECULAR_COLORMAP 3262 uniform sampler2D specularColorMap; 3263 #endif 3264 #ifdef USE_SPECULAR_INTENSITYMAP 3265 uniform sampler2D specularIntensityMap; 3266 #endif 3267#endif 3268#ifdef USE_CLEARCOAT 3269 uniform float clearcoat; 3270 uniform float clearcoatRoughness; 3271#endif 3272#ifdef USE_DISPERSION 3273 uniform float dispersion; 3274#endif
3275#ifdef USE_IRIDESCENCE 3276 uniform float iridescence; 3277 uniform float iridescenceIOR; 3278 uniform float iridescenceThicknessMinimum; 3279 uniform float iridescenceThicknessMaximum; 3280#endif 3281#ifdef USE_SHEEN 3282 uniform vec3 sheenColor; 3283 uniform float sheenRoughness; 3284 #ifdef USE_SHEEN_COLORMAP 3285 uniform sampler2D sheenColorMap; 3286 #endif 3287 #ifdef USE_SHEEN_ROUGHNESSMAP 3288 uniform sampler2D sheenRoughnessMap; 3289 #endif 3290#endif 3291#ifdef USE_ANISOTROPY 3292 uniform vec2 anisotropyVector; 3293 #ifdef USE_ANISOTROPYMAP 3294 uniform sampler2D anisotropyMap; 3295 #endif 3296#endif 3297varying vec3 vViewPosition; 3298#include <common> 3299#include <packing> 3300#include <dithering_pars_fragment> 3301#include <color_pars_fragment> 3302#include <uv_pars_fragment> 3303#include <map_pars_fragment> 3304#include <alphamap_pars_fragment> 3305#include <alphatest_pars_fragment> 3306#include <alphahash_pars_fragment> 3307#include <aomap_pars_fragment> 3308#include <lightmap_pars_fragment> 3309#include <emissivemap_pars_fragment> 3310#include <iridescence_fragment> 3311#include <cube_uv_reflection_fragment> 3312#include <envmap_common_pars_fragment> 3313#include <envmap_physical_pars_fragment> 3314#include <fog_pars_fragment> 3315#include <lights_pars_begin> 3316#include <normal_pars_fragment> 3317#include <lights_physical_pars_fragment> 3318#include <transmission_pars_fragment> 3319#include <shadowmap_pars_fragment> 3320#include <bumpmap_pars_fragment> 3321#include <normalmap_pars_fragment> 3322#include <clearcoat_pars_fragment> 3323#include <iridescence_pars_fragment> 3324#include <roughnessmap_pars_fragment> 3325#include <metalnessmap_pars_fragment> 3326#include <logdepthbuf_pars_fragment> 3327#include <clipping_planes_pars_fragment> 3328void main() { 3329 vec4 diffuseColor = vec4( diffuse, opacity ); 3330 #include <clipping_planes_fragment> 3331 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3332 vec3 totalEmissiveRadiance = emissive; 3333 #include <logdepthbuf_fragment> 3334 #include <map_fragment> 3335 #include <color_fragment> 3336 #include <alphamap_fragment> 3337 #include <alphatest_fragment> 3338 #include <alphahash_fragment> 3339 #include <roughnessmap_fragment> 3340 #include <metalnessmap_fragment> 3341 #include <normal_fragment_begin> 3342 #include <normal_fragment_maps> 3343 #include <clearcoat_normal_fragment_begin> 3344 #include <clearcoat_normal_fragment_maps> 3345 #include <emissivemap_fragment> 3346 #include <lights_physical_fragment> 3347 #include <lights_fragment_begin> 3348 #include <lights_fragment_maps> 3349 #include <lights_fragment_end> 3350 #include <aomap_fragment> 3351 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3352 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3353 #include <transmission_fragment> 3354 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3355 #ifdef USE_SHEEN 3356 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 3357 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; 3358 #endif 3359 #ifdef USE_CLEARCOAT 3360 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3361 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3362 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3363 #endif 3364 #include <opaque_fragment> 3365 #include <tonemapping_fragment> 3366 #include <colorspace_fragment> 3367 #include <fog_fragment> 3368 #include <premultiplied_alpha_fragment> 3369 #include <dithering_fragment> 3370}`,rk=`#define TOON 3371varying vec3 vViewPosition; 3372#include <common> 3373#include <batching_pars_vertex> 3374#include <uv_pars_vertex> 3375#include <displacementmap_pars_vertex> 3376#include <color_pars_vertex> 3377#include <fog_pars_vertex> 3378#include <normal_pars_vertex> 3379#include <morphtarget_pars_vertex> 3380#include <skinning_pars_vertex> 3381#include <shadowmap_pars_vertex> 3382#include <logdepthbuf_pars_vertex> 3383#include <clipping_planes_pars_vertex> 3384void main() { 3385 #include <uv_vertex> 3386 #include <color_vertex> 3387 #include <morphinstance_vertex> 3388 #include <morphcolor_vertex> 3389 #include <batching_vertex> 3390 #include <beginnormal_vertex> 3391 #include <morphnormal_vertex> 3392 #include <skinbase_vertex> 3393 #include <skinnormal_vertex> 3394 #include <defaultnormal_vertex> 3395 #include <normal_vertex> 3396 #include <begin_vertex> 3397 #include <morphtarget_vertex> 3398 #include <skinning_vertex> 3399 #include <displacementmap_vertex> 3400 #include <project_vertex> 3401 #include <logdepthbuf_vertex> 3402 #include <clipping_planes_vertex> 3403 vViewPosition = - mvPosition.xyz; 3404 #include <worldpos_vertex> 3405 #include <shadowmap_vertex> 3406 #include <fog_vertex> 3407}`,sk=`#define TOON 3408uniform vec3 diffuse; 3409uniform vec3 emissive; 3410uniform float opacity; 3411#include <common> 3412#include <packing> 3413#include <dithering_pars_fragment> 3414#include <color_pars_fragment> 3415#include <uv_pars_fragment> 3416#include <map_pars_fragment> 3417#include <alphamap_pars_fragment> 3418#include <alphatest_pars_fragment> 3419#include <alphahash_pars_fragment> 3420#include <aomap_pars_fragment> 3421#include <lightmap_pars_fragment> 3422#include <emissivemap_pars_fragment> 3423#include <gradientmap_pars_fragment> 3424#include <fog_pars_fragment> 3425#include <bsdfs> 3426#include <lights_pars_begin> 3427#include <normal_pars_fragment> 3428#include <lights_toon_pars_fragment> 3429#include <shadowmap_pars_fragment> 3430#include <bumpmap_pars_fragment> 3431#include <normalmap_pars_fragment> 3432#include <logdepthbuf_pars_fragment> 3433#include <clipping_planes_pars_fragment> 3434void main() { 3435 vec4 diffuseColor = vec4( diffuse, opacity ); 3436 #include <clipping_planes_fragment> 3437 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3438 vec3 totalEmissiveRadiance = emissive; 3439 #include <logdepthbuf_fragment> 3440 #include <map_fragment> 3441 #include <color_fragment> 3442 #include <alphamap_fragment> 3443 #include <alphatest_fragment> 3444 #include <alphahash_fragment> 3445 #include <normal_fragment_begin> 3446 #include <normal_fragment_maps> 3447 #include <emissivemap_fragment> 3448 #include <lights_toon_fragment> 3449 #include <lights_fragment_begin> 3450 #include <lights_fragment_maps> 3451 #include <lights_fragment_end> 3452 #include <aomap_fragment> 3453 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3454 #include <opaque_fragment> 3455 #include <tonemapping_fragment> 3456 #include <colorspace_fragment> 3457 #include <fog_fragment> 3458 #include <premultiplied_alpha_fragment> 3459 #include <dithering_fragment> 3460}`,ok=`uniform float size; 3461uniform float scale; 3462#include <common> 3463#include <color_pars_vertex> 3464#include <fog_pars_vertex> 3465#include <morphtarget_pars_vertex> 3466#include <logdepthbuf_pars_vertex> 3467#include <clipping_planes_pars_vertex> 3468#ifdef USE_POINTS_UV 3469 varying vec2 vUv; 3470 uniform mat3 uvTransform; 3471#endif 3472void main() { 3473 #ifdef USE_POINTS_UV 3474 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3475 #endif 3476 #include <color_vertex> 3477 #include <morphinstance_vertex> 3478 #include <morphcolor_vertex> 3479 #include <begin_vertex> 3480 #include <morphtarget_vertex> 3481 #include <project_vertex> 3482 gl_PointSize = size; 3483 #ifdef USE_SIZEATTENUATION 3484 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3485 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3486 #endif 3487 #include <logdepthbuf_vertex> 3488 #include <clipping_planes_vertex> 3489 #include <worldpos_vertex> 3490 #include <fog_vertex> 3491}`,ak=`uniform vec3 diffuse; 3492uniform float opacity; 3493#include <common> 3494#include <color_pars_fragment> 3495#include <map_particle_pars_fragment> 3496#include <alphatest_pars_fragment> 3497#include <alphahash_pars_fragment> 3498#include <fog_pars_fragment> 3499#include <logdepthbuf_pars_fragment> 3500#include <clipping_planes_pars_fragment> 3501void main() { 3502 vec4 diffuseColor = vec4( diffuse, opacity ); 3503 #include <clipping_planes_fragment> 3504 vec3 outgoingLight = vec3( 0.0 ); 3505 #include <logdepthbuf_fragment> 3506 #include <map_particle_fragment> 3507 #include <color_fragment> 3508 #include <alphatest_fragment> 3509 #include <alphahash_fragment> 3510 outgoingLight = diffuseColor.rgb; 3511 #include <opaque_fragment> 3512 #include <tonemapping_fragment> 3513 #include <colorspace_fragment> 3514 #include <fog_fragment> 3515 #include <premultiplied_alpha_fragment> 3516}`,lk=`#include <common> 3517#include <batching_pars_vertex> 3518#include <fog_pars_vertex> 3519#include <morphtarget_pars_vertex> 3520#include <skinning_pars_vertex> 3521#include <logdepthbuf_pars_vertex> 3522#include <shadowmap_pars_vertex> 3523void main() { 3524 #include <batching_vertex> 3525 #include <beginnormal_vertex> 3526 #include <morphinstance_vertex> 3527 #include <morphnormal_vertex> 3528 #include <skinbase_vertex> 3529 #include <skinnormal_vertex> 3530 #include <defaultnormal_vertex> 3531 #include <begin_vertex> 3532 #include <morphtarget_vertex> 3533 #include <skinning_vertex> 3534 #include <project_vertex> 3535 #include <logdepthbuf_vertex> 3536 #include <worldpos_vertex> 3537 #include <shadowmap_vertex> 3538 #include <fog_vertex> 3539}`,ck=`uniform vec3 color; 3540uniform float opacity; 3541#include <common> 3542#include <packing> 3543#include <fog_pars_fragment> 3544#include <bsdfs> 3545#include <lights_pars_begin> 3546#include <logdepthbuf_pars_fragment> 3547#include <shadowmap_pars_fragment> 3548#include <shadowmask_pars_fragment> 3549void main() { 3550 #include <logdepthbuf_fragment> 3551 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3552 #include <tonemapping_fragment> 3553 #include <colorspace_fragment> 3554 #include <fog_fragment> 3555}`,uk=`uniform float rotation; 3556uniform vec2 center; 3557#include <common> 3558#include <uv_pars_vertex> 3559#include <fog_pars_vertex> 3560#include <logdepthbuf_pars_vertex> 3561#include <clipping_planes_pars_vertex> 3562void main() { 3563 #include <uv_vertex> 3564 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 3565 vec2 scale; 3566 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 3567 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 3568 #ifndef USE_SIZEATTENUATION 3569 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3570 if ( isPerspective ) scale *= - mvPosition.z; 3571 #endif 3572 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3573 vec2 rotatedPosition; 3574 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3575 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3576 mvPosition.xy += rotatedPosition; 3577 gl_Position = projectionMatrix * mvPosition; 3578 #include <logdepthbuf_vertex> 3579 #include <clipping_planes_vertex> 3580 #include <fog_vertex> 3581}`,hk=`uniform vec3 diffuse; 3582uniform float opacity; 3583#include <common> 3584#include <uv_pars_fragment> 3585#include <map_pars_fragment> 3586#include <alphamap_pars_fragment> 3587#include <alphatest_pars_fragment> 3588#include <alphahash_pars_fragment> 3589#include <fog_pars_fragment> 3590#include <logdepthbuf_pars_fragment> 3591#include <clipping_planes_pars_fragment> 3592void main() { 3593 vec4 diffuseColor = vec4( diffuse, opacity ); 3594 #include <clipping_planes_fragment> 3595 vec3 outgoingLight = vec3( 0.0 ); 3596 #include <logdepthbuf_fragment> 3597 #include <map_fragment> 3598 #include <alphamap_fragment> 3599 #include <alphatest_fragment> 3600 #include <alphahash_fragment> 3601 outgoingLight = diffuseColor.rgb; 3602 #include <opaque_fragment> 3603 #include <tonemapping_fragment> 3604 #include <colorspace_fragment> 3605 #include <fog_fragment> 3606}`,Mt={alphahash_fragment:LN,alphahash_pars_fragment:DN,alphamap_fragment:zN,alph
vendor: 7,325 bytes, line 3606
3606amap_pars_fragment:FN,alphatest_fragment:ON,alphatest_pars_fragment:UN,aomap_fragment:NN,aomap_pars_fragment:kN,batching_pars_vertex:HN,batching_vertex:GN,begin_vertex:VN,beginnormal_vertex:WN,bsdfs:jN,iridescence_fragment:XN,bumpmap_pars_fragment:JN,clipping_planes_fragment:YN,clipping_planes_pars_fragment:KN,clipping_planes_pars_vertex:QN,clipping_planes_vertex:ZN,color_fragment:qN,color_pars_fragment:$N,color_pars_vertex:e6,color_vertex:t6,common:n6,cube_uv_reflection_fragment:i6,defaultnormal_vertex:r6,displacementmap_pars_vertex:s6,displacementmap_vertex:o6,emissivemap_fragment:a6,emissivemap_pars_fragment:l6,colorspace_fragment:c6,colorspace_pars_fragment:u6,envmap_fragment:h6,envmap_common_pars_fragment:f6,envmap_pars_fragment:d6,envmap_pars_vertex:p6,envmap_physical_pars_fragment:w6,envmap_vertex:m6,fog_vertex:g6,fog_pars_vertex:y6,fog_fragment:_6,fog_pars_fragment:x6,gradientmap_pars_fragment:v6,lightmap_pars_fragment:A6,lights_lambert_fragment:S6,lights_lambert_pars_fragment:M6,lights_pars_begin:E6,lights_toon_fragment:T6,lights_toon_pars_fragment:C6,lights_phong_fragment:R6,lights_phong_pars_fragment:b6,lights_physical_fragment:P6,lights_physical_pars_fragment:B6,lights_fragment_begin:I6,lights_fragment_maps:L6,lights_fragment_end:D6,logdepthbuf_fragment:z6,logdepthbuf_pars_fragment:F6,logdepthbuf_pars_vertex:O6,logdepthbuf_vertex:U6,map_fragment:N6,map_pars_fragment:k6,map_particle_fragment:H6,map_particle_pars_fragment:G6,metalnessmap_fragment:V6,metalnessmap_pars_fragment:W6,morphinstance_vertex:j6,morphcolor_vertex:X6,morphnormal_vertex:J6,morphtarget_pars_vertex:Y6,morphtarget_vertex:K6,normal_fragment_begin:Q6,normal_fragment_maps:Z6,normal_pars_fragment:q6,normal_pars_vertex:$6,normal_vertex:e5,normalmap_pars_fragment:t5,clearcoat_normal_fragment_begin:n5,clearcoat_normal_fragment_maps:i5,clearcoat_pars_fragment:r5,iridescence_pars_fragment:s5,opaque_fragment:o5,packing:a5,premultiplied_alpha_fragment:l5,project_vertex:c5,dithering_fragment:u5,dithering_pars_fragment:h5,roughnessmap_fragment:f5,roughnessmap_pars_fragment:d5,shadowmap_pars_fragment:p5,shadowmap_pars_vertex:m5,shadowmap_vertex:g5,shadowmask_pars_fragment:y5,skinbase_vertex:_5,skinning_pars_vertex:x5,skinning_vertex:v5,skinnormal_vertex:A5,specularmap_fragment:S5,specularmap_pars_fragment:M5,tonemapping_fragment:E5,tonemapping_pars_fragment:w5,transmission_fragment:T5,transmission_pars_fragment:C5,uv_pars_fragment:R5,uv_pars_vertex:b5,uv_vertex:P5,worldpos_vertex:B5,background_vert:I5,background_frag:L5,backgroundCube_vert:D5,backgroundCube_frag:z5,cube_vert:F5,cube_frag:O5,depth_vert:U5,depth_frag:N5,distanceRGBA_vert:k5,distanceRGBA_frag:H5,equirect_vert:G5,equirect_frag:V5,linedashed_vert:W5,linedashed_frag:j5,meshbasic_vert:X5,meshbasic_frag:J5,meshlambert_vert:Y5,meshlambert_frag:K5,meshmatcap_vert:Q5,meshmatcap_frag:Z5,meshnormal_vert:q5,meshnormal_frag:$5,meshphong_vert:ek,meshphong_frag:tk,meshphysical_vert:nk,meshphysical_frag:ik,meshtoon_vert:rk,meshtoon_frag:sk,points_vert:ok,points_frag:ak,shadow_vert:lk,shadow_frag:ck,sprite_vert:uk,sprite_frag:hk},Fe={common:{diffuse:{value:new Re(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new vt},alphaMap:{value:null},alphaMapTransform:{value:new vt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new vt}},envmap:{envMap:{value:null},envMapRotation:{value:new vt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new vt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new vt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new vt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new vt},normalScale:{value:new ce(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new vt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new vt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new vt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new vt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Re(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Re(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new vt},alphaTest:{value:0},uvTransform:{value:new vt}},sprite:{diffuse:{value:new Re(16777215)},opacity:{value:1},center:{value:new ce(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new vt},alphaMap:{value:null},alphaMapTransform:{value:new vt},alphaTest:{value:0}}},Fs={basic:{uniforms:ji([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:Mt.meshbasic_vert,fragmentShader:Mt.meshbasic_frag},lambert:{uniforms:ji([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new Re(0)}}]),vertexShader:Mt.meshlambert_vert,fragmentShader:Mt.meshlambert_frag},phong:{uniforms:ji([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new Re(0)},specular:{value:new Re(1118481)},shininess:{value:30}}]),vertexShader:Mt.meshphong_vert,fragmentShader:Mt.meshphong_frag},standard:{uniforms:ji([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new Re(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Mt.meshphysical_vert,fragmentShader:Mt.meshphysical_frag},toon:{uniforms:ji([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new Re(0)}}]),vertexShader:Mt.meshtoon_vert,fragmentShader:Mt.meshtoon_frag},matcap:{uniforms:ji([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matc
vendor: 5,263 bytes, line 3606
3606ap:{value:null}}]),vertexShader:Mt.meshmatcap_vert,fragmentShader:Mt.meshmatcap_frag},points:{uniforms:ji([Fe.points,Fe.fog]),vertexShader:Mt.points_vert,fragmentShader:Mt.points_frag},dashed:{uniforms:ji([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Mt.linedashed_vert,fragmentShader:Mt.linedashed_frag},depth:{uniforms:ji([Fe.common,Fe.displacementmap]),vertexShader:Mt.depth_vert,fragmentShader:Mt.depth_frag},normal:{uniforms:ji([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:Mt.meshnormal_vert,fragmentShader:Mt.meshnormal_frag},sprite:{uniforms:ji([Fe.sprite,Fe.fog]),vertexShader:Mt.sprite_vert,fragmentShader:Mt.sprite_frag},background:{uniforms:{uvTransform:{value:new vt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Mt.background_vert,fragmentShader:Mt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new vt}},vertexShader:Mt.backgroundCube_vert,fragmentShader:Mt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Mt.cube_vert,fragmentShader:Mt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Mt.equirect_vert,fragmentShader:Mt.equirect_frag},distanceRGBA:{uniforms:ji([Fe.common,Fe.displacementmap,{referencePosition:{value:new z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Mt.distanceRGBA_vert,fragmentShader:Mt.distanceRGBA_frag},shadow:{uniforms:ji([Fe.lights,Fe.fog,{color:{value:new Re(0)},opacity:{value:1}}]),vertexShader:Mt.shadow_vert,fragmentShader:Mt.shadow_frag}};Fs.physical={uniforms:ji([Fs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new vt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new vt},clearcoatNormalScale:{value:new ce(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new vt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new vt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new vt},sheen:{value:0},sheenColor:{value:new Re(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new vt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new vt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new vt},transmissionSamplerSize:{value:new ce},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new vt},attenuationDistance:{value:0},attenuationColor:{value:new Re(0)},specularColor:{value:new Re(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new vt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new vt},anisotropyVector:{value:new ce},anisotropyMap:{value:null},anisotropyMapTransform:{value:new vt}}]),vertexShader:Mt.meshphysical_vert,fragmentShader:Mt.meshphysical_frag};const B0={r:0,b:0,g:0},Pl=new Ur,fk=new Ke;function dk(n,e,t,i,r,s,o){const a=new Re(0);let l=s===!0?0:1,c,u,d=null,p=0,m=null;function y(v){let S=v.isScene===!0?v.background:null;return S&&S.isTexture&&(S=(v.backgroundBlurriness>0?t:e).get(S)),S}function _(v){let S=!1;const M=y(v);M===null?g(a,l):M&&M.isColor&&(g(M,1),S=!0);const w=n.xr.getEnvironmentBlendMode();w==="additive"?i.buffers.color.setClear(0,0,0,1,o):w==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function x(v,S){const M=y(S);M&&(M.isCubeTexture||M.mapping===Qh)?(u===void 0&&(u=new hn(new Fc(1,1,1),new vi({name:"BackgroundCubeMaterial",uniforms:Uh(Fs.backgroundCube.uniforms),vertexShader:Fs.backgroundCube.vertexShader,fragmentShader:Fs.backgroundCube.fragmentShader,side:zi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(w,T,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Pl.copy(S.backgroundRotation),Pl.x*=-1,Pl.y*=-1,Pl.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Pl.y*=-1,Pl.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(fk.makeRotationFromEuler(Pl)),u.material.toneMapped=Vt.getTransfer(M.colorSpace)!==rn,(d!==M||p!==M.version||m!==n.toneMapping)&&(u.material.needsUpdate=!0,d=M,p=M.version,m=n.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new hn(new Oc(2,2),new vi({name:"Backgroun
3606dMaterial",uniforms:Uh(Fs.background.uniforms),vertexShader:Fs.background.vertexShader,fragmentShader:Fs.background.fragmentShader,side:_s,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Vt.getTransfer(M.colorSpace)!==rn,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(d!==M||p!==M.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,d=M,p=M.version,m=n.toneMapping),c.layers.enableAll(),v.unshift(c,c.geometry,c.material,0,0,null))}function g(v,S){v.getRGB(B0,WI(n)),i.buffers.color.setClear(B0.r,B0.g,B0.b,S,o)}return{getClearColor:function(){return a},setClearColor:function(v,S=1){a.set(v),l=S,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,g(a,l)},render:_,addToRenderList:x}}function pk(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null);let s=r,o=!1;function a(P,L,U,G,j){let X=!1;const J=d(G,U,L);s!==J&&(s=J,c(s.object)),X=m(P,G,U,j),X&&y(P,G,U,j),j!==null&&e.update(j,n.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,M(P,L,U,G),j!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(j).buffer))}function l(){return n.createVertexArray()}function c(P){return n.bindVertexArray(P)}function u(P){return n.deleteVertexArray(P)}function d(P,L,U){const G=U.wireframe===!0;let j=i[P.id];j===void 0&&(j={},i[P.id]=j);let X=j[L.id];X===void 0&&(X={},j[L.id]=X);let J=X[G];return J===void 0&&(J=p(l()),X[G]=J),J}function p(P){const L=[],U=[],G=[];for(let j=0;j<t;j++)L[j]=0,U[j]=0,G[j]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:U,attributeDivisors:G,object:P,attributes:{},index:null}}function m(P,L,U,G){const j=s.attributes,X=L.attributes;let J=0;const te=U.getAttributes();for(const k in te)if(te[k].location>=0){const $=j[k];let oe=X[k];if(oe===void 0&&(k==="instanceMatrix"&&P.instanceMatrix&&(oe=P.instanceMatrix),k==="instanceColor"&&P.instanceColor&&(oe=P.instanceColor)),$===void 0||$.attribute!==oe||oe&&$.data!==oe.data)return!0;J++}return s.attributesNum!==J||s.index!==G}function y(P,L,U,G){const j={},X=L.attributes;let J=0;const te=U.getAttributes();for(const k in te)if(te[k].location>=0){let $=X[k];$===void 0&&(k==="instanceMatrix"&&P.instanceMatrix&&($=P.instanceMatrix),k==="instanceColor"&&P.instanceColor&&($=P.instanceColor));const oe={};oe.attribute=$,$&&$.data&&(oe.data=$.data),j[k]=oe,J++}s.attributes=j,s.attributesNum=J,s.index=G}function _(){const P=s.newAttributes;for(let L=0,U=P.length;L<U;L++)P[L]=0}function x(P){g(P,0)}function g(P,L){const U=s.newAttributes,G=s.enabledAttributes,j=s.attributeDivisors;U[P]=1,G[P]===0&&(n.enableVertexAttribArray(P),G[P]=1),j[P]!==L&&(n.vertexAttribDivisor(P,L),j[P]=L)}function v(){const P=s.newAttributes,L=s.enabledAttributes;for(let U=0,G=L.length;U<G;U++)L[U]!==P[U]&&(n.disableVertexAttribArray(U),L[U]=0)}function S(P,L,U,G,j,X,J){J===!0?n.vertexAttribIPointer(P,L,U,j,X):n.vertexAttribPointer(P,L,U,G,j,X)}function M(P,L,U,G){_();const j=G.attributes,X=U.getAttributes(),J=L.defaultAttributeValues;for(const te in X){const k=X[te];if(k.location>=0){let Q=j[te];if(Q===void 0&&(te==="instanceMatrix"&&P.instanceMatrix&&(Q=P.instanceMatrix),te==="instanceColor"&&P.instanceColor&&(Q=P.instanceColor)),Q!==void 0){const $=Q.normalized,oe=Q.itemSize,xe=e.get(Q);if(xe===void 0)continue;const De=xe.buffer,ne=xe.type,fe=xe.bytesPerElement,Te=ne===n.INT||ne===n.UNSIGNED_INT||Q.gpuType===I_;if(Q.isInterleavedBufferAttribute){const Me=Q.data,it=Me.stride,ct=Q.offset;if(Me.isInstancedInterleavedBuffer){for(let je=0;je<k.locationSize;je++)g(k.location+je,Me.meshPerAttribute);P.isInstancedMesh!==!0&&G._maxInstanceCount===void 0&&(G._maxInstanceCount=Me.meshPerAttribute*Me.count)}else for(let je=0;je<k.locationSize;je++)x(k.location+je);n.bindBuffer(n.ARRAY_BUFFER,De);for(let je=0;je<k.locationSize;je++)S(k.location+je,oe/k.locationSize,ne,$,it*fe,(ct+oe/k.locationSize*je)*fe,Te)}else{if(Q.isInstancedBufferAttribute){for(let Me=0;Me<k.locationSize;Me++)g(k.location+Me,Q.meshPerAttribute);P.isInstancedMesh!==!0&&G._maxInstanceCount===void 0&&(G._maxInstanceCount=Q.meshPerAttribute*Q.count)}
vendor: 12,537 bytes, line 3606
3606else for(let Me=0;Me<k.locationSize;Me++)x(k.location+Me);n.bindBuffer(n.ARRAY_BUFFER,De);for(let Me=0;Me<k.locationSize;Me++)S(k.location+Me,oe/k.locationSize,ne,$,oe*fe,oe/k.locationSize*Me*fe,Te)}}else if(J!==void 0){const $=J[te];if($!==void 0)switch($.length){case 2:n.vertexAttrib2fv(k.location,$);break;case 3:n.vertexAttrib3fv(k.location,$);break;case 4:n.vertexAttrib4fv(k.location,$);break;default:n.vertexAttrib1fv(k.location,$)}}}}v()}function w(){B();for(const P in i){const L=i[P];for(const U in L){const G=L[U];for(const j in G)u(G[j].object),delete G[j];delete L[U]}delete i[P]}}function T(P){if(i[P.id]===void 0)return;const L=i[P.id];for(const U in L){const G=L[U];for(const j in G)u(G[j].object),delete G[j];delete L[U]}delete i[P.id]}function R(P){for(const L in i){const U=i[L];if(U[P.id]===void 0)continue;const G=U[P.id];for(const j in G)u(G[j].object),delete G[j];delete U[P.id]}}function B(){b(),o=!0,s!==r&&(s=r,c(s.object))}function b(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:a,reset:B,resetDefaultState:b,dispose:w,releaseStatesOfGeometry:T,releaseStatesOfProgram:R,initAttributes:_,enableAttribute:x,disableUnusedAttributes:v}}function mk(n,e,t){let i;function r(c){i=c}function s(c,u){n.drawArrays(i,c,u),t.update(u,i,1)}function o(c,u,d){d!==0&&(n.drawArraysInstanced(i,c,u,d),t.update(u,i,d))}function a(c,u,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,c,0,u,0,d);let m=0;for(let y=0;y<d;y++)m+=u[y];t.update(m,i,1)}function l(c,u,d,p){if(d===0)return;const m=e.get("WEBGL_multi_draw");if(m===null)for(let y=0;y<c.length;y++)o(c[y],u[y],p[y]);else{m.multiDrawArraysInstancedWEBGL(i,c,0,u,0,p,0,d);let y=0;for(let _=0;_<d;_++)y+=u[_];for(let _=0;_<p.length;_++)t.update(y,i,p[_])}}this.setMode=r,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function gk(n,e,t,i){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const T=e.get("EXT_texture_filter_anisotropic");r=n.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(T){return!(T!==fi&&i.convert(T)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(T){const R=T===fo&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(T!==xs&&i.convert(T)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==lr&&!R)}function l(T){if(T==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=t.logarithmicDepthBuffer===!0,p=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),x=n.getParameter(n.MAX_VERTEX_ATTRIBS),g=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),v=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),M=m>0,w=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,maxTextures:p,maxVertexTextures:m,maxTextureSize:y,maxCubemapSize:_,maxAttributes:x,maxVertexUniforms:g,maxVaryings:v,maxFragmentUniforms:S,vertexTextures:M,maxSamples:w}}function yk(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new io,a=new vt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const m=d.length!==0||p||i!==0||r;return r=p,i=d.length,m},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,p){t=u(d,p,0)},this.setState=function(d,p,m){const y=d.clippingPlanes,_=d.clipIntersection,x=d.clipShadows,g=n.get(d);if(!r||y===null||y.length===0||s&&!x)s?u(null):c();else{const v=s?0:i,S=v*4;let M=g.clippingState||null;l.value=M,M=u(y,p,S,m);for(let w=0;w!==S;++w)M[w]=t[w];g.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=v}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(d,p,m,y){const _=d!==null?d.length:0;let x=null;if(_!==0){if(x=l.value,y!==!0||x===null){const g=m+_*4,v=p.matrixWorldInverse;a.getNormalMatrix(v),(x===null||x.length<g)&&(x=new Float32Array(g));for(let S=0,M=m;S!==_;++S,M+=4)o.copy(d[S]).applyMatrix4(v,a),o.normal.toArray(x,M),x[M+3]=o.constant}l.value=x,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,x}}function _k(n){let e=new WeakMap;function t(o,a){return a===ip?o.mapping=Qo:a===rp&&(o.mapping=tl),o}function i(o){if(o&&o.isTexture){const a=o.mapping;if(a===ip||a===rp)if(e.has(o)){const l=e.get(o).texture;return t(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const c=new XI(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class sa extends Fp{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const ah=4,H2=[.125,.215,.35,.446,.526,.582],Kl=20,d1=new sa,G2=new Re;let p1=null,m1=0,g1=0,y1=!1;const Jl=(1+Math.sqrt(5))/2,Mu=1/Jl,V2=[new z(-Jl,Mu,0),new z(Jl,Mu,0),new z(-Mu,0,Jl),new z(Mu,0,Jl),new z(0,Jl,-Mu),new z(0,Jl,Mu),new z(-1,1,-1),new z(1,1,-1),new z(-1,1,1),new z(1,1,1)];class RS{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){p1=this._renderer.getRenderTarget(),m1=this._renderer.getActiveCubeFace(),g1=this._renderer.getActiveMipmapLevel(),y1=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=X2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=j2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(p1,m1,g1),this._renderer.xr.enabled=y1,e.scissorTest=!1,I0(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Qo||e.mapping===tl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),p1=this._renderer.getRenderTarget(),m1=this._renderer.getActiveCubeFace(),g1=this._renderer.getActiveMipmapLevel(),y1=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:gn,minFilter:gn,generateMipmaps:!1,type:fo,format:fi,colorSpace:ia,depthBuffer:!1},r=W2(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=W2(e,t,i);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=xk(s)),this._blurMaterial=vk(s,e,t)}return r}_compileMaterial(e){const t=new hn(this._lodPlanes[0],e);this._renderer.compile(t,d1)}_sceneToCubeUV(e,t,i,r){const a=new Un(90,1,t,i),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,p=u.toneMapping;u.getClearColor(G2),u.toneMapping=ho,u.autoClear=!1;const m=new ei({name:"PMREM.Background",side:zi,depthWrite:!1,depthTest:!1}),y=new hn(new Fc,m);let _=!1;const x=e.background;x?x.isColor&&(m.color.copy(x),e.background=null,_=!0):(m.color.copy(G2),_=!0);for(let g=0;g<6;g++){const v=g%3;v===0?(a.up.set(0,l[g],0),a.lookAt(c[g],0,0)):v===1?(a.up.set(0,0,l[g]),a.lookAt(0,c[g],0)):(a.up.set(0,l[g],0),a.lookAt(0,0,c[g]));const S=this._cubeSize;I0(r,v*S,g>2?S:0,S,S),u.setRenderTarget(r),_&&u.render(y,a),u.render(e,a)}y.geometry.dispose(),y.material.dispose(),u.toneMapping=p,u.autoClear=d,e.background=x}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Qo||e.mapping===tl;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=X2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=j2());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new hn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;I0(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,d1)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;s<r;s++){const o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=V2[(r-s-1)%V2.length];this._blur(e,s-1,s,o,a)}t.autoClear=i}_blur(e,t,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,t,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,d=new hn(this._lodPlanes[r],c),p=c.uniforms,m=this._sizeLods[i]-1,y=isFinite(s)?Math.PI/(2*m):2*Math.PI/(2*Kl-1),_=s/y,x=isFinite(s)?1+Math.floor(u*_):Kl;x>Kl&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Kl}`);const g=[];let v=0;for(let R=0;R<Kl;++R){const B=R/_,b=Math.exp(-B*B/2);g.push(b),R===0?v+=b:R<x&&(v+=2*b)}for(let R=0;R<g.length;R++)g[R]=g[R]/v;p.envMap.value=e.texture,p.samples.value=x,p.weights.value=g,p.latitudinal.value=o==="latitudinal",a&&(p.poleAxis.value=a);const{_lodMax:S}=this;p.dTheta.value=y,p.mipInt.value=S-i;
vendor: 13,387 bytes, lines 3606-3756
3606const M=this._sizeLods[r],w=3*M*(r>S-ah?r-S+ah:0),T=4*(this._cubeSize-M);I0(t,w,T,3*M,2*M),l.setRenderTarget(t),l.render(d,d1)}}function xk(n){const e=[],t=[],i=[];let r=n;const s=n-ah+1+H2.length;for(let o=0;o<s;o++){const a=Math.pow(2,r);t.push(a);let l=1/a;o>n-ah?l=H2[o-n+ah-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,d=1+c,p=[u,u,d,u,d,d,u,u,d,d,u,d],m=6,y=6,_=3,x=2,g=1,v=new Float32Array(_*y*m),S=new Float32Array(x*y*m),M=new Float32Array(g*y*m);for(let T=0;T<m;T++){const R=T%3*2/3-1,B=T>2?0:-1,b=[R,B,0,R+2/3,B,0,R+2/3,B+1,0,R,B,0,R+2/3,B+1,0,R,B+1,0];v.set(b,_*y*T),S.set(p,x*y*T);const P=[T,T,T,T,T,T];M.set(P,g*y*T)}const w=new xt;w.setAttribute("position",new Lt(v,_)),w.setAttribute("uv",new Lt(S,x)),w.setAttribute("faceIndex",new Lt(M,g)),e.push(w),r>ah&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function W2(n,e,t){const i=new Fi(n,e,t);return i.texture.mapping=Qh,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function I0(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function vk(n,e,t){const i=new Float32Array(Kl),r=new z(0,1,0);return new vi({name:"SphericalGaussianBlur",defines:{n:Kl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:IE(),fragmentShader:` 3607 3608 precision mediump float; 3609 precision mediump int; 3610 3611 varying vec3 vOutputDirection; 3612 3613 uniform sampler2D envMap; 3614 uniform int samples; 3615 uniform float weights[ n ]; 3616 uniform bool latitudinal; 3617 uniform float dTheta; 3618 uniform float mipInt; 3619 uniform vec3 poleAxis; 3620 3621 #define ENVMAP_TYPE_CUBE_UV 3622 #include <cube_uv_reflection_fragment> 3623 3624 vec3 getSample( float theta, vec3 axis ) { 3625 3626 float cosTheta = cos( theta ); 3627 // Rodrigues' axis-angle rotation 3628 vec3 sampleDirection = vOutputDirection * cosTheta 3629 + cross( axis, vOutputDirection ) * sin( theta ) 3630 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3631 3632 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3633 3634 } 3635 3636 void main() { 3637 3638 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3639 3640 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3641 3642 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3643 3644 } 3645 3646 axis = normalize( axis ); 3647 3648 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3649 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3650 3651 for ( int i = 1; i < n; i++ ) { 3652 3653 if ( i >= samples ) { 3654 3655 break; 3656 3657 } 3658 3659 float theta = dTheta * float( i ); 3660 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3661 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3662 3663 } 3664 3665 } 3666 `,blending:uo,depthTest:!1,depthWrite:!1})}function j2(){return new vi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:IE(),fragmentShader:` 3667 3668 precision mediump float; 3669 precision mediump int; 3670 3671 varying vec3 vOutputDirection; 3672 3673 uniform sampler2D envMap; 3674 3675 #include <common> 3676 3677 void main() { 3678 3679 vec3 outputDirection = normalize( vOutputDirection ); 3680 vec2 uv = equirectUv( outputDirection ); 3681 3682 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3683 3684 } 3685 `,blending:uo,depthTest:!1,depthWrite:!1})}function X2(){return new vi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:IE(),fragmentShader:` 3686 3687 precision mediump float; 3688 precision mediump int; 3689 3690 uniform float flipEnvMap; 3691 3692 varying vec3 vOutputDirection; 3693 3694 uniform samplerCube envMap; 3695 3696 void main() { 3697 3698 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3699 3700 } 3701 `,blending:uo,depthTest:!1,depthWrite:!1})}function IE(){return` 3702 3703 precision mediump float; 3704 precision mediump int; 3705 3706 attribute float faceIndex; 3707 3708 varying vec3 vOutputDirection; 3709 3710 // RH coordinate system; PMREM face-indexing convention 3711 vec3 getDirection( vec2 uv, float face ) { 3712 3713 uv = 2.0 * uv - 1.0; 3714 3715 vec3 direction = vec3( uv, 1.0 ); 3716 3717 if ( face == 0.0 ) { 3718 3719 direction = direction.zyx; // ( 1, v, u ) pos x 3720 3721 } else if ( face == 1.0 ) { 3722 3723 direction = direction.xzy; 3724 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3725 3726 } else if ( face == 2.0 ) { 3727 3728 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3729 3730 } else if ( face == 3.0 ) { 3731 3732 direction = direction.zyx; 3733 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3734 3735 } else if ( face == 4.0 ) { 3736 3737 direction = direction.xzy; 3738 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3739 3740 } else if ( face == 5.0 ) { 3741 3742 direction.z *= -1.0; // ( u, v, -1 ) neg z 3743 3744 } 3745 3746 return direction; 3747 3748 } 3749 3750 void main() { 3751 3752 vOutputDirection = getDirection( uv, faceIndex ); 3753 gl_Position = vec4( position, 1.0 ); 3754 3755 } 3756 `}function Ak(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===ip||l===rp,u=l===Qo||l===tl;if(c||u){let d=e.get(a);const p=d!==void 0?d.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==p)return t===null&&(t=new RS(n)),d=c?t.fromEquirectangular(a,d):t.fromCubemap(a,d),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),d.texture;if(d!==void 0)return d.texture;{const m=a.image;return c&&m&&m.height>0||u&&m&&r(m)?(t===null&&(t=new RS(n)),d=c?t.fromEquirectangular(a):t.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),a.addEventListener("dispose",s),d.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;u<c;u++)a[u]!==void 0&&l++;return l===c}function s(a){const l=a.target;l.removeEventListener("dispose",s);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function Sk(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(i){const r=t(i);return r===null&&RE("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function Mk(n,e,t,i){const r={},s=new WeakMap;function o(d){const p=d.target;p.index!==null&&e.remove(p.index);for(const y in p.attributes)e.remove(p.attributes[y]);for(const y in p.morphAttributes){const _=p.morphAttributes[y];for(let x=0,g=_.length;x<g;x++)e.remove(_[x])}p.removeEventListener("dispose",o),delete r[p.id];const m=s.get(p);m&&(e.remove(m),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function a(d,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function l(d){const p=d.attributes;for(const y in p)e.update(p[y],n.ARRAY_BUFFER);const m=d.morphAttributes;for(const y in m){const _=m[y];for(let x=0,g=_.length;x<g;x++)e.update(_[x],n.ARRAY_BUFFER)}}function c(d){const p=[],m=d.index,y=d.attributes.position;let _=0;if(m!==null){const v=m.array;_=m.version;for(let S=0,M=v.length;S<M;S+=3){const w=v[S+0],T=v[S+1],R=v[S+2];p.push(w,T,T,R,R,w)}}else if(y!==void 0){const v=y.array;_=y.version;for(let S=0,M=v.length/3-1;S<M;S+=3){const w=S+0,T=S+1,R=S+2;p.push(w,T,T,R,R,w)}}else return;const x=new(NI(p)?BE:PE)(p,1);x.version=_;const g=s.get(d);g&&e.remove(g),s.set(d,x)}function u(d){const p=s.get(d);if(p){const m=d.index;m!==null&&p.version<m.version&&c(d)}else c(d);return s.get(d)}return{get:a,update:l,getWireframeAttribute:u}}function Ek(n,e,t){let i;function r(p){i=p}let s,o;function a(p){s=p.type,o=p.bytesPerElement}function l(p,m){n.drawElements(i,m,s,p*o),t.update(m,i,1)}function c(p,m,y){y!==0&&(n.drawElementsInstanced(i,m,s,p*o,y),t.update(m,i,y))}function u(p,m,y){if(y===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,m,0,s,p,0,y);let x=0;for(let g=0;g<y;g++)x+=m[g];t.update(x,i,1)}function d(p,m,y,_){if(y===0)return;const x=e.get("WEBGL_multi_draw");if(x===null)for(let g=0;g<p.length;g++)c(p[g]/o,m[g],_[g]);else{x.multiDrawElementsInstancedWEBGL(i,m,0,s,p,0,_,0,y);let g=0;for(let v=0;v<y;v++)g+=m[v];for(let v=0;v<_.length;v++)t.update(g,i,_[v])}}this.setMode=r,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=d}function wk(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,a){switch(t.calls++,o){case n.TRIANGLES:t.triangles+=a*(s/3);break;case n.LINES:t.lines+=a*(s/2);break;case n.LINE_STRIP:t.lines+=a*(s-1);break;case n.LINE_LOOP:t.lines+=a*s;break;case n.POINTS:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:i}}function Tk(n,e,t){const i=new WeakMap,r=new Wt;function s(o,a,l){const c=o.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,d=u!==void 0?u.length:0;let p=i.get(a);if(p===void 0||p.count!==d){let P=function(){B.dispose(),i.delete(a),a.removeEventListener("dispose",P)};var m=P;p!==void 0&&p.texture.dispose();const y=a.morphAttributes.position!==void 0,_=a.morphAttributes.normal!==void 0,x=a.morphAttributes.color!==void 0,g=a.morphAttributes.position||[],v=a.morphAttributes.normal||[],S=a.morphAttributes.color||[];let M=0;y===!0&&(M=1),_===!0&&(M=2),x===!0&&(M=3);let w=a.attributes.position.count*M,T=1;w>e.maxTextureSize&&(T=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const R=new Float32Array(w*T*4*d),B=new k_(R,w,T,d);B.type=lr,B.needsUpdate=!0;const b=M*4;for(let L=0;L<d;L++){const U=g[L],G=v[L],j=S[L],X=w*T*4*L;for(let J=0;J<U.count;J++){const te=J*b;y===!0&&(r.fromBufferAttribute(U,J),R[X+te+0]=r.x,R[X+te+1]=r.y,R[X+te+2]=r.z,R[X+te+3]=0),_===!0&&(r.fromBufferAttribute(G,J),R[X+te+4]=r.x,R[X+te+5]=r.y,R[X+te+6]=r.z,R[X+te+7]=0),x===!0&&(r.fromBufferAttribute(j,J),R[X+te+8]=r.x,R[X+te+9]=r.y,R[X+te+10]=r.z,R[X+te+11]=j.itemSize===4?r.w:1)}}p={count:d,texture:B,size:new ce(w,T)},i.set(a,p),a.addEventListener("dispose",P)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(n,"morphTexture",o.morphTexture,t);else{let y=0;for(let x=0;x<c.length;x++)y+=c[x];const _=a.morphTargetsRelative?1:1-y;l.getUniforms().setValue(n,"morphTargetBaseInfluence",_),l.getUniforms().setValue(n,"morphTargetInfluences",c)}l.getUniforms().setValue(n,"morphTargetsTexture",p.texture,t),l.getUniforms().setValue(n,"morphTargetsTextureSize",p.size)}return{update:s}}function Ck(n,e,t,i){let r=new WeakMap;function s(l){const c=i.render.frame,u=l.geometry,d=e.get(l,u);if(r.get(d)!==c&&(e.update(d),r.set(d,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),r.get(l)!==c&&(t.update(l.instanceMatrix,n.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,n.ARRAY_BUFFER),r.set(l,c))),l.isSkinnedMesh){const p=l.skeleton;r.get(p)!==c&&(p.update(),r.set(p,c))}return d}function o(){r=new WeakMap}function a(l){const c=l.target;c.removeEventListener("dispose",a),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}class LE extends Zt{constructor(e,t,i,r,s,o,a,l,c,u=uc){if(u!==uc&&u!==Tc)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===uc&&(i=Zo),i===void 0&&u===Tc&&(i=wc),super(null,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:$n,this.minFilter=l!==void 0?l:$n,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const YI=new Zt,J2=new LE(1,1),KI=new k_,QI=new bE,ZI=new Op,Y2=[],K2=[],Q2=new Float32Array(16),Z2=new Float32Array(9),q2=new Float32Array(4);function Zh(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=Y2[r];if(s===void 0&&(s=new Float32Array(r),Y2[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function ni(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function ii(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function H_(n,e){let t=K2[e];t===void 0&&(t=new Int32Array(e),K2[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function Rk(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function bk(n,e){const t=this.cache;
vendor: 5,820 bytes, line 3756
3756if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ni(t,e))return;n.uniform2fv(this.addr,e),ii(t,e)}}function Pk(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(ni(t,e))return;n.uniform3fv(this.addr,e),ii(t,e)}}function Bk(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ni(t,e))return;n.uniform4fv(this.addr,e),ii(t,e)}}function Ik(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ni(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),ii(t,e)}else{if(ni(t,i))return;q2.set(i),n.uniformMatrix2fv(this.addr,!1,q2),ii(t,i)}}function Lk(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ni(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),ii(t,e)}else{if(ni(t,i))return;Z2.set(i),n.uniformMatrix3fv(this.addr,!1,Z2),ii(t,i)}}function Dk(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ni(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),ii(t,e)}else{if(ni(t,i))return;Q2.set(i),n.uniformMatrix4fv(this.addr,!1,Q2),ii(t,i)}}function zk(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function Fk(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ni(t,e))return;n.uniform2iv(this.addr,e),ii(t,e)}}function Ok(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(ni(t,e))return;n.uniform3iv(this.addr,e),ii(t,e)}}function Uk(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ni(t,e))return;n.uniform4iv(this.addr,e),ii(t,e)}}function Nk(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function kk(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ni(t,e))return;n.uniform2uiv(this.addr,e),ii(t,e)}}function Hk(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(ni(t,e))return;n.uniform3uiv(this.addr,e),ii(t,e)}}function Gk(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ni(t,e))return;n.uniform4uiv(this.addr,e),ii(t,e)}}function Vk(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r);let s;this.type===n.SAMPLER_2D_SHADOW?(J2.compareFunction=TE,s=J2):s=YI,t.setTexture2D(e||s,r)}function Wk(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||QI,r)}function jk(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTextureCube(e||ZI,r)}function Xk(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||KI,r)}function Jk(n){switch(n){case 5126:return Rk;case 35664:return bk;case 35665:return Pk;case 35666:return Bk;case 35674:return Ik;case 35675:return Lk;case 35676:return Dk;case 5124:case 35670:return zk;case 35667:case 35671:return Fk;case 35668:case 35672:return Ok;case 35669:case 35673:return Uk;case 5125:return Nk;case 36294:return kk;case 36295:return Hk;case 36296:return Gk;case 35678:case 36198:case 36298:case 36306:case 35682:return Vk;case 35679:case 36299:case 36307:return Wk;case 35680:case 36300:case 36308:case 36293:return jk;case 36289:case 36303:case 36311:case 36292:return Xk}}function Yk(n,e){n.uniform1fv(this.addr,e)}function Kk(n,e){const t=Zh(e,this.size,2);n.uniform2fv(this.addr,t)}function Qk(n,e){const t=Zh(e,this.size,3);n.uniform3fv(this.addr,t)}function Zk(n,e){const t=Zh(e,this.size,4);n.uniform4fv(this.addr,t)}function qk(n,e){const t=Zh(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function $k(n,e){const t=Zh(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function e8(n,e){const t=Zh(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function t8(n,e){n.uniform1iv(this.addr,e)}function n8(n,e){n.uniform2iv(this.addr,e)}function i8(n,e){n.uniform3iv(this.addr,e)}function r8(n,e){n.uniform4iv(this.addr,e)}function s8(n,e){n.uniform1uiv(this.addr,e)}function o8(n,e){n.uniform2uiv(this.addr,e)}function a8(n,e){n.uniform3uiv(this.addr,e)}function l8(n,e){n.uniform4uiv(this.addr,e)}function c8(n,e,t){const i=this.cache,r=e.length,s=H_(t,r);ni(i,s)||(n.uniform1iv(this.addr,s),ii(i,s));for(let o=0;o!==r;++o)t.setTexture2D(e[o]||YI,s[o])}function u8(n,e,t){const i=this.cache,r=e.length,s=H_(t,r);ni(i,s)||(n.uniform1iv(this.addr,s),ii(i,s));for(let o=0;o!==r;++o)t.setTexture3D(e[o]||QI,s[o])}function h8(n,e,t){const i=this.cache,r=e.length,s=H_(t,r);ni(i,s)||(n.uniform1iv(this.addr,s),ii(i,s));for(let o=0;o!==r;++o)t.setTextureCube(e[o]||ZI,s[o])}function f8(n,e,t){const i=this.cache,r=e.length,s=H_(t,r);ni(i,s)||(n.uniform1iv(this.addr,s),ii(i,s));for(let o=0;o!==r;++o)t.setTexture2DArray(e[o]||KI,s[o])}function d8(n){switch(n){case 5126:return Yk;case 35664:return Kk;case 35665:return Qk;case 35666:return Zk;case 35674:return qk;case 35675:return $k;case 35676:return e8;case 5124:case 35670:return t8;case 35667:case 35671:return n8;case 35668:case 35672:return i8;case 35669:case 35673:return r8;case 5125:return s8;case 36294:return o8;case 36295:return a8;case 36296:return l8;
vendor: 4,124 bytes, lines 3756-3764
3756case 35678:case 36198:case 36298:case 36306:case 35682:return c8;case 35679:case 36299:case 36307:return u8;case 35680:case 36300:case 36308:case 36293:return h8;case 36289:case 36303:case 36311:case 36292:return f8}}class p8{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=Jk(t.type)}}class m8{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=d8(t.type)}}class g8{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){const r=this.seq;for(let s=0,o=r.length;s!==o;++s){const a=r[s];a.setValue(e,t[a.id],i)}}}const _1=/(\w+)(\])?(\[|\.)?/g;function $2(n,e){n.seq.push(e),n.map[e.id]=e}function y8(n,e,t){const i=n.name,r=i.length;for(_1.lastIndex=0;;){const s=_1.exec(i),o=_1.lastIndex;let a=s[1];const l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===r){$2(t,c===void 0?new p8(a,n,e):new m8(a,n,e));break}else{let d=t.map[a];d===void 0&&(d=new g8(a),$2(t,d)),t=d}}}class Vg{constructor(e,t){this.seq=[],this.map={};const i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){const s=e.getActiveUniform(t,r),o=e.getUniformLocation(t,s.name);y8(s,o,this)}}setValue(e,t,i,r){const s=this.map[t];s!==void 0&&s.setValue(e,i,r)}setOptional(e,t,i){const r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let s=0,o=t.length;s!==o;++s){const a=t[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,r)}}static seqWithValue(e,t){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in t&&i.push(o)}return i}}function e3(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}const _8=37297;let x8=0;function v8(n,e){const t=n.split(` 3757`),i=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=r;o<s;o++){const a=o+1;i.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return i.join(` 3758`)}function A8(n){const e=Vt.getPrimaries(Vt.workingColorSpace),t=Vt.getPrimaries(n);let i;switch(e===t?i="":e===lp&&t===ap?i="LinearDisplayP3ToLinearSRGB":e===ap&&t===lp&&(i="LinearSRGBToLinearDisplayP3"),n){case ia:case zp:return[i,"LinearTransferOETF"];case rs:case N_:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function t3(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` 3759 3760`+r+` 3761 3762`+v8(n.getShaderSource(e),o)}else return r}function S8(n,e){const t=A8(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function M8(n,e){let t;switch(e){case _I:t="Linear";break;case xI:t="Reinhard";break;case vI:t="OptimizedCineon";break;case pE:t="ACESFilmic";break;case SI:t="AgX";break;case MI:t="Neutral";break;case AI:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function E8(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(fd).join(` 3763`)}function w8(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` 3764`)}function T8(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const s=n.getActiveAttrib(e,r),o=s.name;let a=1;s.type===n.FLOAT_MAT2&&(a=2),s.type===n.FLOAT_MAT3&&(a=3),s.type===n.FLOAT_MAT4&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function fd(n){return n!==""}function n3(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_L
vendor: 4,433 bytes, lines 3764-3789
3764IGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function i3(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const C8=/^[ \t]*#include +<([\w\d./]+)>/gm;function bS(n){return n.replace(C8,b8)}const R8=new Map;function b8(n,e){let t=Mt[e];if(t===void 0){const i=R8.get(e);if(i!==void 0)t=Mt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return bS(t)}const P8=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function r3(n){return n.replace(P8,B8)}function B8(n,e,t,i){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function s3(n){let e=`precision ${n.precision} float; 3765 precision ${n.precision} int; 3766 precision ${n.precision} sampler2D; 3767 precision ${n.precision} samplerCube; 3768 precision ${n.precision} sampler3D; 3769 precision ${n.precision} sampler2DArray; 3770 precision ${n.precision} sampler2DShadow; 3771 precision ${n.precision} samplerCubeShadow; 3772 precision ${n.precision} sampler2DArrayShadow; 3773 precision ${n.precision} isampler2D; 3774 precision ${n.precision} isampler3D; 3775 precision ${n.precision} isamplerCube; 3776 precision ${n.precision} isampler2DArray; 3777 precision ${n.precision} usampler2D; 3778 precision ${n.precision} usampler3D; 3779 precision ${n.precision} usamplerCube; 3780 precision ${n.precision} usampler2DArray; 3781 `;return n.precision==="highp"?e+=` 3782#define HIGH_PRECISION`:n.precision==="mediump"?e+=` 3783#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=` 3784#define LOW_PRECISION`),e}function I8(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===b_?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===wd?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Ls&&(e="SHADOWMAP_TYPE_VSM"),e}function L8(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Qo:case tl:e="ENVMAP_TYPE_CUBE";break;case Qh:e="ENVMAP_TYPE_CUBE_UV";break}return e}function D8(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case tl:e="ENVMAP_MODE_REFRACTION";break}return e}function z8(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case Lp:e="ENVMAP_BLENDING_MULTIPLY";break;case gI:e="ENVMAP_BLENDING_MIX";break;case yI:e="ENVMAP_BLENDING_ADD";break}return e}function F8(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}}function O8(n,e,t,i){const r=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=I8(t),c=L8(t),u=D8(t),d=z8(t),p=F8(t),m=E8(t),y=w8(s),_=r.createProgram();let x,g,v=t.glslVersion?"#version "+t.glslVersion+` 3785`:"";t.isRawShaderMaterial?(x=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(fd).join(` 3786`),x.length>0&&(x+=` 3787`),g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(fd).join(` 3788`),g.length>0&&(g+=` 3789`)):(x=[s3(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IR
3789IDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` 3790`].filter(fd).join(` 3791`),g=[s3(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
3791IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ho?"#define TONE_MAPPING":"",t.toneMapping!==ho?Mt.tonemapping_pars_fragment:"",t.toneMapping!==ho?M8("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Mt.colorspace_pars_fragment,S8("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 3792`].filter(fd).join(` 3793`)),o=bS(o),o=n3(o,t),o=i3(o,t),a=bS(a),a=n3(a,t),a=i3(a,t),o=r3(o),a=r3(a),t.isRawShaderMaterial!==!0&&(v=`#version 300 es 3794`,x=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` 3795`)+` 3796`+x,g=["#define varying in",t.glslVersion===CS?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===CS?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` 3797`)+` 3798`+g);const S=v+x+o,M=v+g+a,w=e3(r,r.VERTEX_SHADER,S),T=e3(r,r.FRAGMENT_SHADER,M);r.attachShader(_,w),r.attachShader(_,T),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function R(L){if(n.debug.checkShaderErrors){const U=r.getProgramInfoLog(_).trim(),G=r.getShaderInfoLog(w).trim(),j=r.getShaderInfoLog(T).trim();let X=!0,J=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(X=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,w,T);else{const te=t3(r,w,"vertex"),k=t3(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` 3799 3800Material Name: `+L.name+` 3801Material Type: `+L.type+` 3802 3803Program Info Log: `+U+` 3804`+te+` 3805`+k)}else U!==""?console.warn("THREE.WebGLProgram: Program Info Log:",U):(G===""||j==="")&&(J=!1);J&&(L.diagnostics={runnable:X,programLog:U,vertexShader:{log:G,prefix:x},fragmentShader:{log:j,prefix:g}})}r.deleteShader(w),r.deleteShader(T),B=new Vg(r,_),b=T8(r,_)}let B;this.getUniforms=function(){return B===void 0&&R(this),B};let b;this.getAttributes=function(){return b===void 0&&R(this),b};let P=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=r.getProgramParameter(_,_8)),P},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=x8++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=w,this.fragmentShader=T,this}let U8=0;class N8{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new k8(e),t.set(e,i)),i}}class k8{constructor(e){this.id=U8++,this.code=e,this.usedTimes=0}}function H8(n,e,t,i,r,s,o){const a=new fc,l=new N8,c=new Set,u=[],d=r.logarithmicDepthBuffer,p=r.vertexTextures;let m=r.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function x(b,P,L,U,G){const j=U.fog,X=G.geometry,J=b.isMeshStandardMaterial?U.environment:null,te=(b.isMeshStandardMaterial?t:e).get(b.envMap||J),k=te&&te.mapping===Qh?te.image.height:null,Q=y[b.type];b.precision!==null&&(m=r.getMaxPrecision(b.precision),m!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",m,"instead."));const $=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,oe=$!==void 0?$.length:0;let xe=0;X.morphAttributes.position!==void 0&&(xe=1),X.morphAttributes.normal!==void 0&&(xe=2),X.morphAttributes.color!==void 0&&(xe=3);let De,ne,fe,Te;
vendor: 17,233 bytes, line 3805
3805if(Q){const zt=Fs[Q];De=zt.vertexShader,ne=zt.fragmentShader}else De=b.vertexShader,ne=b.fragmentShader,l.update(b),fe=l.getVertexShaderID(b),Te=l.getFragmentShaderID(b);const Me=n.getRenderTarget(),it=G.isInstancedMesh===!0,ct=G.isBatchedMesh===!0,je=!!b.map,ke=!!b.matcap,N=!!te,me=!!b.aoMap,Ae=!!b.lightMap,Le=!!b.bumpMap,de=!!b.normalMap,Ze=!!b.displacementMap,ze=!!b.emissiveMap,He=!!b.metalnessMap,W=!!b.roughnessMap,D=b.anisotropy>0,re=b.clearcoat>0,ve=b.dispersion>0,ge=b.iridescence>0,_e=b.sheen>0,et=b.transmission>0,be=D&&!!b.anisotropyMap,Ve=re&&!!b.clearcoatMap,pt=re&&!!b.clearcoatNormalMap,Ee=re&&!!b.clearcoatRoughnessMap,Ge=ge&&!!b.iridescenceMap,Pt=ge&&!!b.iridescenceThicknessMap,ut=_e&&!!b.sheenColorMap,Xe=_e&&!!b.sheenRoughnessMap,dt=!!b.specularMap,Et=!!b.specularColorMap,qt=!!b.specularIntensityMap,K=et&&!!b.transmissionMap,Ce=et&&!!b.thicknessMap,pe=!!b.gradientMap,ye=!!b.alphaMap,Ie=b.alphaTest>0,lt=!!b.alphaHash,Bt=!!b.extensions;let yn=ho;b.toneMapped&&(Me===null||Me.isXRRenderTarget===!0)&&(yn=n.toneMapping);const Kn={shaderID:Q,shaderType:b.type,shaderName:b.name,vertexShader:De,fragmentShader:ne,defines:b.defines,customVertexShaderID:fe,customFragmentShaderID:Te,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:m,batching:ct,batchingColor:ct&&G._colorsTexture!==null,instancing:it,instancingColor:it&&G.instanceColor!==null,instancingMorph:it&&G.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:Me===null?n.outputColorSpace:Me.isXRRenderTarget===!0?Me.texture.colorSpace:ia,alphaToCoverage:!!b.alphaToCoverage,map:je,matcap:ke,envMap:N,envMapMode:N&&te.mapping,envMapCubeUVHeight:k,aoMap:me,lightMap:Ae,bumpMap:Le,normalMap:de,displacementMap:p&&Ze,emissiveMap:ze,normalMapObjectSpace:de&&b.normalMapType===BI,normalMapTangentSpace:de&&b.normalMapType===ul,metalnessMap:He,roughnessMap:W,anisotropy:D,anisotropyMap:be,clearcoat:re,clearcoatMap:Ve,clearcoatNormalMap:pt,clearcoatRoughnessMap:Ee,dispersion:ve,iridescence:ge,iridescenceMap:Ge,iridescenceThicknessMap:Pt,sheen:_e,sheenColorMap:ut,sheenRoughnessMap:Xe,specularMap:dt,specularColorMap:Et,specularIntensityMap:qt,transmission:et,transmissionMap:K,thicknessMap:Ce,gradientMap:pe,opaque:b.transparent===!1&&b.blending===ti&&b.alphaToCoverage===!1,alphaMap:ye,alphaTest:Ie,alphaHash:lt,combine:b.combine,mapUv:je&&_(b.map.channel),aoMapUv:me&&_(b.aoMap.channel),lightMapUv:Ae&&_(b.lightMap.channel),bumpMapUv:Le&&_(b.bumpMap.channel),normalMapUv:de&&_(b.normalMap.channel),displacementMapUv:Ze&&_(b.displacementMap.channel),emissiveMapUv:ze&&_(b.emissiveMap.channel),metalnessMapUv:He&&_(b.metalnessMap.channel),roughnessMapUv:W&&_(b.roughnessMap.channel),anisotropyMapUv:be&&_(b.anisotropyMap.channel),clearcoatMapUv:Ve&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:pt&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ee&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ge&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:Pt&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:ut&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Xe&&_(b.sheenRoughnessMap.channel),specularMapUv:dt&&_(b.specularMap.channel),specularColorMapUv:Et&&_(b.specularColorMap.channel),specularIntensityMapUv:qt&&_(b.specularIntensityMap.channel),transmissionMapUv:K&&_(b.transmissionMap.channel),thicknessMapUv:Ce&&_(b.thicknessMap.channel),alphaMapUv:ye&&_(b.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(de||D),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:G.isPoints===!0&&!!X.attributes.uv&&(je||ye),fog:!!j,useFog:b.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:G.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:oe,morphTextureStride:xe,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&L.length>0,shadowMapType:n.shadowMap.type,toneMapping:yn,decodeVideoTexture:je&&b.map.isVideoTexture===!0&&Vt.getTransfer(b.map.colorSpace)===rn,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Rr,flipSided:b.side===zi,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Bt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Bt&&b.extensions.multiDraw===!0||ct)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Kn.vertexUv1s=c.has(1),Kn.vertexUv2s=c.has(2),Kn.vertexUv3s=c.has(3),c.clear(),Kn}function g(b){const P=[];if(b.shaderID?P.push(b.shaderID):(P.push(b.customVertexShaderID),P.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)P.push(L),P.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(v(P,b),S(P,b),P.push(n.outputColorSpace)),P.push(b.customProgramCacheKey),P.join()}function v(b,P){b.push(P.precision),b.push(P.outputColorSpace),b.push(P.envMapMode),b.push(P.envMapCubeUVHeight),b.push(P.mapUv),b.push(P.alphaMapUv),b.push(P.lightMapUv),b.push(P.aoMapUv),b.push(P.bumpMapUv),b.push(P.normalMapUv),b.push(P.displacementMapUv),b.push(P.emissiveMapUv),b.push(P.metalnessMapUv),b.push(P.roughnessMapUv),b.push(P.anisotropyMapUv),b.push(P.clearcoatMapUv),b.push(P.clearcoatNormalMapUv),b.push(P.clearcoatRoughnessMapUv),b.push(P.iridescenceMapUv),b.push(P.iridescenceThicknessMapUv),b.push(P.sheenColorMapUv),b.push(P.sheenRoughnessMapUv),b.push(P.specularMapUv),b.push(P.specularColorMapUv),b.push(P.specularIntensityMapUv),b.push(P.transmissionMapUv),b.push(P.thicknessMapUv),b.push(P.combine),b.push(P.fogExp2),b.push(P.sizeAttenuation),b.push(P.morphTargetsCount),b.push(P.morphAttributeCount),b.push(P.numDirLights),b.push(P.numPointLights),b.push(P.numSpotLights),b.push(P.numSpotLightMaps),b.push(P.numHemiLights),b.push(P.numRectAreaLights),b.push(P.numDirLightShadows),b.push(P.numPointLightShadows),b.push(P.numSpotLightShadows),b.push(P.numSpotLightShadowsWithMaps),b.push(P.numLightProbes),b.push(P.shadowMapType),b.push(P.toneMapping),b.push(P.numClippingPlanes),b.push(P.numClipIntersection),b.push(P.depthPacking)}function S(b,P){a.disableAll(),P.supportsVertexTextures&&a.enable(0),P.instancing&&a.enable(1),P.instancingColor&&a.enable(2),P.instancingMorph&&a.enable(3),P.matcap&&a.enable(4),P.envMap&&a.enable(5),P.normalMapObjectSpace&&a.enable(6),P.normalMapTangentSpace&&a.enable(7),P.clearcoat&&a.enable(8),P.iridescence&&a.enable(9),P.alphaTest&&a.enable(10),P.vertexColors&&a.enable(11),P.vertexAlphas&&a.enable(12),P.vertexUv1s&&a.enable(13),P.vertexUv2s&&a.enable(14),P.vertexUv3s&&a.enable(15),P.vertexTangents&&a.enable(16),P.anisotropy&&a.enable(17),P.alphaHash&&a.enable(18),P.batching&&a.enable(19),P.dispersion&&a.enable(20),P.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),P.fog&&a.enable(0),P.useFog&&a.enable(1),P.flatShading&&a.enable(2),P.logarithmicDepthBuffer&&a.enable(3),P.skinning&&a.enable(4),P.morphTargets&&a.enable(5),P.morphNormals&&a.enable(6),P.morphColors&&a.enable(7),P.premultipliedAlpha&&a.enable(8),P.shadowMapEnabled&&a.enable(9),P.doubleSided&&a.enable(10),P.flipSided&&a.enable(11),P.useDepthPacking&&a.enable(12),P.dithering&&a.enable(13),P.transmission&&a.enable(14),P.sheen&&a.enable(15),P.opaque&&a.enable(16),P.pointsUvs&&a.enable(17),P.decodeVideoTexture&&a.enable(18),P.alphaToCoverage&&a.enable(19),b.push(a.mask)}function M(b){const P=y[b.type];let L;if(P){const U=Fs[P];L=fp.clone(U.uniforms)}else L=b.uniforms;return L}function w(b,P){let L;for(let U=0,G=u.length;U<G;U++){const j=u[U];if(j.cacheKey===P){L=j,++L.usedTimes;break}}return L===void 0&&(L=new O8(n,P,b,s),u.push(L)),L}function T(b){if(--b.usedTimes===0){const P=u.indexOf(b);u[P]=u[u.length-1],u.pop(),b.destroy()}}function R(b){l.remove(b)}function B(){l.dispose()}return{getParameters:x,getProgramCacheKey:g,getUniforms:M,acquireProgram:w,releaseProgram:T,releaseShaderCache:R,programs:u,dispose:B}}function G8(){let n=new WeakMap;function e(s){let o=n.get(s);return o===void 0&&(o={},n.set(s,o)),o}function t(s){n.delete(s)}function i(s,o,a){n.get(s)[o]=a}function r(){n=new WeakMap}return{get:e,remove:t,update:i,dispose:r}}function V8(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function o3(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function a3(){const n=[];let e=0;const t=[],i=[],r=[];function s(){e=0,t.length=0,i.length=0,r.length=0}function o(d,p,m,y,_,x){let g=n[e];return g===void 0?(g={id:d.id,object:d,geometry:p,material:m,groupOrder:y,renderOrder:d.renderOrder,z:_,group:x},n[e]=g):(g.id=d.id,g.object=d,g.geometry=p,g.material=m,g.groupOrder=y,g.renderOrder=d.renderOrder,g.z=_,g.group=x),e++,g}function a(d,p,m,y,_,x){const g=o(d,p,m,y,_,x);m.transmission>0?i.push(g):m.transparent===!0?r.push(g):t.push(g)}function l(d,p,m,y,_,x){const g=o(d,p,m,y,_,x);m.transmission>0?i.unshift(g):m.transparent===!0?r.unshift(g):t.unshift(g)}function c(d,p){t.length>1&&t.sort(d||V8),i.length>1&&i.sort(p||o3),r.length>1&&r.sort(p||o3)}function u(){for(let d=e,p=n.length;d<p;d++){const m=n[d];if(m.id===null)break;m.id=null,m.object=null,m.geometry=null,m.material=null,m.group=null}}return{opaque:t,transmissive:i,transparent:r,init:s,push:a,unshift:l,finish:u,sort:c}}function W8(){let n=new WeakMap;function e(i,r){const s=n.get(i);let o;return s===void 0?(o=new a3,n.set(i,[o])):r>=s.length?(o=new a3,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function j8(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new z,color:new Re};break;case"SpotLight":t={position:new z,direction:new z,color:new Re,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new z,color:new Re,distance:0,decay:0};break;case"HemisphereLight":t={direction:new z,skyColor:new Re,groundColor:new Re};break;case"RectAreaLight":t={color:new Re,position:new z,halfWidth:new z,halfHeight:new z};break}return n[e.id]=t,t}}}function X8(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ce};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ce};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ce,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let J8=0;function Y8(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function K8(n){const e=new j8,t=X8(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new z);const r=new z,s=new Ke,o=new Ke;function a(c){let u=0,d=0,p=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let m=0,y=0,_=0,x=0,g=0,v=0,S=0,M=0,w=0,T=0,R=0;c.sort(Y8);for(let b=0,P=c.length;b<P;b++){const L=c[b],U=L.color,G=L.intensity,j=L.distance,X=L.shadow&&L.shadow.map?L.shadow.map.texture:null;if(L.isAmbientLight)u+=U.r*G,d+=U.g*G,p+=U.b*G;else if(L.isLightProbe){for(let J=0;J<9;J++)i.probe[J].addScaledVector(L.sh.coefficients[J],G);R++}else if(L.isDirectionalLight){const J=e.get(L);if(J.color.copy(L.color).multiplyScalar(L.intensity),L.castShadow){const te=L.shadow,k=t.get(L);k.shadowIntensity=te.intensity,k.shadowBias=te.bias,k.shadowNormalBias=te.normalBias,k.shadowRadius=te.radius,k.shadowMapSize=te.mapSize,i.directionalShadow[m]=k,i.directionalShadowMap[m]=X,i.directionalShadowMatrix[m]=L.shadow.matrix,v++}i.directional[m]=J,m++}else if(L.isSpotLight){const J=e.get(L);J.position.setFromMatrixPosition(L.matrixWorld),J.color.copy(U).multiplyScalar(G),J.distance=j,J.coneCos=Math.cos(L.angle),J.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),J.decay=L.decay,i.spot[_]=J;const te=L.shadow;if(L.map&&(i.spotLightMap[w]=L.map,w++,te.updateMatrices(L),L.castShadow&&T++),i.spotLightMatrix[_]=te.matrix,L.castShadow){const k=t.get(L);k.shadowIntensity=te.intensity,k.shadowBias=te.bias,k.shadowNormalBias=te.normalBias,k.shadowRadius=te.radius,k.shadowMapSize=te.mapSize,i.spotShadow[_]=k,i.spotShadowMap[_]=X,M++}_++}else if(L.isRectAreaLight){const J=e.get(L);J.color.copy(U).multiplyScalar(G),J.halfWidth.set(L.width*.5,0,0),J.halfHeight.set(0,L.height*.5,0),i.rectArea[x]=J,x++}else if(L.isPointLight){const J=e.get(L);if(J.color.copy(L.color).multiplyScalar(L.intensity),J.distance=L.distance,J.decay=L.decay,L.castShadow){const te=L.shadow,k=t.get(L);k.shadowIntensity=te.intensity,k.shadowBias=te.bias,k.shadowNormalBias=te.normalBias,k.shadowRadius=te.radius,k.shadowMapSize=te.mapSize,k.shadowCameraNear=te.camera.near,k.shadowCameraFar=te.camera.far,i.pointShadow[y]=k,i.pointShadowMap[y]=X,i.pointShadowMatrix[y]=L.shadow.matrix,S++}i.point[y]=J,y++}else if(L.isHemisphereLight){const J=e.get(L);J.skyColor.copy(L.color).multiplyScalar(G),J.groundColor.copy(L.groundColor).multiplyScalar(G),i.hemi[g]=J,g++}}x>0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Fe.LTC_FLOAT_1,i.rectAreaLTC2=Fe.LTC_FLOAT_2):(i.rectAreaLTC1=Fe.LTC_HALF_1,i.rectAreaLTC2=Fe.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=d,i.ambient[2]=p;const B=i.hash;(B.directionalLength!==m||B.pointLength!==y||B.spotLength!==_||B.rectAreaLength!==x||B.hemiLength!==g||B.numDirectionalShadows!==v||B.numPointShadows!==S||B.numSpotShadows!==M||B.numSpotMaps!==w||B.numLightProbes!==R)&&(i.directional.length=m,i.spot.length=_,i.rectArea.length=x,i.point.length=y,i.hemi.length=g,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=M+w-T,i.spotLightMap.length=w,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=R,B.directionalLength=m,B.pointLength=y,B.spotLength=_,B.rectAreaLength=x,B.hemiLength=g,B.numDirectionalShadows=v,B.numPointShadows=S,B.numSpotShadows=M,B.numSpotMaps=w,B.numLightProbes=R,i.version=J8++)}function l(c,u){let d=0,p=0,m=0,y=0,_=0;const x=u.matrixWorldInverse;for(let g=0,v=c.length;g<v;g++){const S=c[g];if(S.isDirectionalLight){const M=i.directional[d];M.direction.setFromMatrixPosition(S.matrixWorld),r.setFromMatrixPosition(S.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(x),d++}else if(S.isSpotLight){const M=i.spot[m];M.position.setFromMatrixPosition(S.matrixWorld),M.position.applyMatrix4(x),M.direction.setFromMatrixPosition(S.matrixWorld),r.setFromMatrixPosition(S.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(x),m++}else if(S.isRectAreaLight){const M=i.rectArea[y];M.position.setFromMatrixPosition(S.matrixWorld),M.position.applyMatrix4(x),o.identity(),s.copy(S.matrixWorld),s.premultiply(x),o.extractRotation(s),M.halfWidth.set(S.width*.5,0,0),M.halfHeight.set(0,S.height*.5,0),M.halfWidth.applyMatrix4(o),M.halfHeight.applyMatrix4(o),y++}else if(S.isPointLight){const M=i.point[p];M.position.setFromMatrixPosition(S.matrixWorld),M.position.applyMatrix4(x),p++}else if(S.isHemisphereLight){const M=i.hemi[_];M.direction.setFromMatrixPosition(S.matrixWorld),M.direction.transformDirection(x),_++}}}return{setup:a,setupView:l,state:i}}function l3(n){const e=new K8(n),t=[],i=[];function r(u){c.camera=u,t.length=0,i.length=0}function s(u){t.push(u)}function o(u){i.push(u)}function a(){e.setup(t)}function l(u){e.setupView(t,u)}const c={lightsArray:t,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function Q8(n){let e=new WeakMap;function t(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new l3(n),e.set(r,[a])):s>=o.length?(a=new l3(n),o.push(a)):a=o[s],a}
vendor: 15,473 bytes, lines 3805-3833
3805function i(){e=new WeakMap}return{get:t,dispose:i}}class DE extends Jn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=bI,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class zE extends Jn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Z8=`void main() { 3806 gl_Position = vec4( position, 1.0 ); 3807}`,q8=`uniform sampler2D shadow_pass; 3808uniform vec2 resolution; 3809uniform float radius; 3810#include <packing> 3811void main() { 3812 const float samples = float( VSM_SAMPLES ); 3813 float mean = 0.0; 3814 float squared_mean = 0.0; 3815 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 3816 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 3817 for ( float i = 0.0; i < samples; i ++ ) { 3818 float uvOffset = uvStart + i * uvStride; 3819 #ifdef HORIZONTAL_PASS 3820 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 3821 mean += distribution.x; 3822 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 3823 #else 3824 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 3825 mean += depth; 3826 squared_mean += depth * depth; 3827 #endif 3828 } 3829 mean = mean / samples; 3830 squared_mean = squared_mean / samples; 3831 float std_dev = sqrt( squared_mean - mean * mean ); 3832 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 3833}`;function $8(n,e,t){let i=new Up;const r=new ce,s=new ce,o=new Wt,a=new DE({depthPacking:PI}),l=new zE,c={},u=t.maxTextureSize,d={[_s]:zi,[zi]:_s,[Rr]:Rr},p=new vi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ce},radius:{value:4}},vertexShader:Z8,fragmentShader:q8}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const y=new xt;y.setAttribute("position",new Lt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new hn(y,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=b_;let g=this.type;this.render=function(T,R,B){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||T.length===0)return;const b=n.getRenderTarget(),P=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),U=n.state;U.setBlending(uo),U.buffers.color.setClear(1,1,1,1),U.buffers.depth.setTest(!0),U.setScissorTest(!1);const G=g!==Ls&&this.type===Ls,j=g===Ls&&this.type!==Ls;for(let X=0,J=T.length;X<J;X++){const te=T[X],k=te.shadow;if(k===void 0){console.warn("THREE.WebGLShadowMap:",te,"has no shadow.");continue}if(k.autoUpdate===!1&&k.needsUpdate===!1)continue;r.copy(k.mapSize);const Q=k.getFrameExtents();if(r.multiply(Q),s.copy(k.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/Q.x),r.x=s.x*Q.x,k.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/Q.y),r.y=s.y*Q.y,k.mapSize.y=s.y)),k.map===null||G===!0||j===!0){const oe=this.type!==Ls?{minFilter:$n,magFilter:$n}:{};k.map!==null&&k.map.dispose(),k.map=new Fi(r.x,r.y,oe),k.map.texture.name=te.name+".shadowMap",k.camera.updateProjectionMatrix()}n.setRenderTarget(k.map),n.clear();const $=k.getViewportCount();for(let oe=0;oe<$;oe++){const xe=k.getViewport(oe);o.set(s.x*xe.x,s.y*xe.y,s.x*xe.z,s.y*xe.w),U.viewport(o),k.updateMatrices(te,oe),i=k.getFrustum(),M(R,B,k.camera,te,this.type)}k.isPointLightShadow!==!0&&this.type===Ls&&v(k,B),k.needsUpdate=!1}g=this.type,x.needsUpdate=!1,n.setRenderTarget(b,P,L)};function v(T,R){const B=e.update(_);p.defines.VSM_SAMPLES!==T.blurSamples&&(p.defines.VSM_SAMPLES=T.blurSamples,m.defines.VSM_SAMPLES=T.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new Fi(r.x,r.y)),p.uniforms.shadow_pass.value=T.map.texture,p.uniforms.resolution.value=T.mapSize,p.uniforms.radius.value=T.radius,n.setRenderTarget(T.mapPass),n.clear(),n.renderBufferDirect(R,null,B,p,_,null),m.uniforms.shadow_pass.value=T.mapPass.texture,m.uniforms.resolution.value=T.mapSize,m.uniforms.radius.value=T.radius,n.setRenderTarget(T.map),n.clear(),n.renderBufferDirect(R,null,B,m,_,null)}function S(T,R,B,b){let P=null;const L=B.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(L!==void 0)P=L;else if(P=B.isPointLight===!0?l:a,n.localClippingEnabled&&R.clipShadows===!0&&Array.isArray(R.clippingPlanes)&&R.clippingPlanes.length!==0||R.displacementMap&&R.displacementScale!==0||R.alphaMap&&R.alphaTest>0||R.map&&R.alphaTest>0){const U=P.uuid,G=R.uuid;let j=c[U];j===void 0&&(j={},c[U]=j);let X=j[G];X===void 0&&(X=P.clone(),j[G]=X,R.addEventListener("dispose",w)),P=X}if(P.visible=R.visible,P.wireframe=R.wireframe,b===Ls?P.side=R.shadowSide!==null?R.shadowSide:R.side:P.side=R.shadowSide!==null?R.shadowSide:d[R.side],P.alphaMap=R.alphaMap,P.alphaTest=R.alphaTest,P.map=R.map,P.clipShadows=R.clipShadows,P.clippingPlanes=R.clippingPlanes,P.clipIntersection=R.clipIntersection,P.displacementMap=R.displacementMap,P.displacementScale=R.displacementScale,P.displacementBias=R.displacementBias,P.wireframeLinewidth=R.wireframeLinewidth,P.linewidth=R.linewidth,B.isPointLight===!0&&P.isMeshDistanceMaterial===!0){const U=n.properties.get(P);U.light=B}return P}function M(T,R,B,b,P){if(T.visible===!1)return;if(T.layers.test(R.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&P===Ls)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,T.matrixWorld);const G=e.update(T),j=T.material;if(Array.isArray(j)){const X=G.groups;for(let J=0,te=X.length;J<te;J++){const k=X[J],Q=j[k.materialIndex];if(Q&&Q.visible){const $=S(T,Q,b,P);T.onBeforeShadow(n,T,R,B,G,$,k),n.renderBufferDirect(B,null,G,$,T,k),T.onAfterShadow(n,T,R,B,G,$,k)}}}else if(j.visible){const X=S(T,j,b,P);T.onBeforeShadow(n,T,R,B,G,X,null),n.renderBufferDirect(B,null,G,X,T,null),T.onAfterShadow(n,T,R,B,G,X,null)}}const U=T.children;for(let G=0,j=U.length;G<j;G++)M(U[G],R,B,b,P)}function w(T){T.target.removeEventListener("dispose",w);for(const B in c){const b=c[B],P=T.target.uuid;P in b&&(b[P].dispose(),delete b[P])}}}function e9(n){function e(){let K=!1;const Ce=new Wt;let pe=null;const ye=new Wt(0,0,0,0);return{setMask:function(Ie){pe!==Ie&&!K&&(n.colorMask(Ie,Ie,Ie,Ie),pe=Ie)},setLocked:function(Ie){K=Ie},setClear:function(Ie,lt,Bt,yn,Kn){Kn===!0&&(Ie*=yn,lt*=yn,Bt*=yn),Ce.set(Ie,lt,Bt,yn),ye.equals(Ce)===!1&&(n.clearColor(Ie,lt,Bt,yn),ye.copy(Ce))},reset:function(){K=!1,pe=null,ye.set(-1,0,0,0)}}}function t(){let K=!1,Ce=null,pe=null,ye=null;return{setTest:function(Ie){Ie?Te(n.DEPTH_TEST):Me(n.DEPTH_TEST)},setMask:function(Ie){Ce!==Ie&&!K&&(n.depthMask(Ie),Ce=Ie)},setFunc:function(Ie){if(pe!==Ie){switch(Ie){case cI:n.depthFunc(n.NEVER);break;case uI:n.depthFunc(n.ALWAYS);break;case hI:n.depthFunc(n.LESS);break;case np:n.depthFunc(n.LEQUAL);break;case fI:n.depthFunc(n.EQUAL);break;case dI:n.depthFunc(n.GEQUAL);break;case pI:n.depthFunc(n.GREATER);break;case mI:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}pe=Ie}},setLocked:function(Ie){K=Ie},setClear:function(Ie){ye!==Ie&&(n.clearDepth(Ie),ye=Ie)},reset:function(){K=!1,Ce=null,pe=null,ye=null}}}function i(){let K=!1,Ce=null,pe=null,ye=null,Ie=null,lt=null,Bt=null,yn=null,Kn=null;return{setTest:function(zt){K||(zt?Te(n.STENCIL_TEST):Me(n.STENCIL_TEST))},setMask:function(zt){Ce!==zt&&!K&&(n.stencilMask(zt),Ce=zt)},setFunc:function(zt,Vr,yr){(pe!==zt||ye!==Vr||Ie!==yr)&&(n.stencilFunc(zt,Vr,yr),pe=zt,ye=Vr,Ie=yr)},setOp:function(zt,Vr,yr){(lt!==zt||Bt!==Vr||yn!==yr)&&(n.stencilOp(zt,Vr,yr),lt=zt,Bt=Vr,yn=yr)},setLocked:function(zt){K=zt},setClear:function(zt){Kn!==zt&&(n.clearStencil(zt),Kn=zt)},reset:function(){K=!1,Ce=null,pe=null,ye=null,Ie=null,lt=null,Bt=null,yn=null,Kn=null}}}const r=new e,s=new t,o=new i,a=new WeakMap,l=new WeakMap;let c={},u={},d=new WeakMap,p=[],m=null,y=!1,_=null,x=null,g=null,v=null,S=null,M=null,w=null,T=new Re(0,0,0),R=0,B=!1,b=null,P=null,L=null,U=null,G=null;const j=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let X=!1,J=0;const te=n.getParameter(n.VERSION);te.indexOf("WebGL")!==-1?(J=parseFloat(/^WebGL (\d)/.exec(te)[1]),X=J>=1):te.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),X=J>=2);let k=null,Q={};const $=n.getParameter(n.SCISSOR_BOX),oe=n.getParameter(n.VIEWPORT),xe=new Wt().fromArray($),De=new Wt().fromArray(oe);function ne(K,Ce,pe,ye){const Ie=new Uint8Array(4),lt=n.createTexture();n.bindTexture(K,lt),n.texParameteri(K,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(K,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Bt=0;Bt<pe;Bt++)K===n.TEXTURE_3D||K===n.TEXTURE_2D_ARRAY?n.texImage3D(Ce,0,n.RGBA,1,1,ye,0,n.RGBA,n.UNSIGNED_BYTE,Ie):n.texImage2D(Ce+Bt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,Ie);return lt}const fe={};fe[n.TEXTURE_2D]=ne(n.TEXTURE_2D,n.TEXTURE_2D,1),fe[n.TEXTURE_CUBE_MAP]=ne(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),fe[n.TEXTURE_2D_ARRAY]=ne(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),fe[n.TEXTURE_3D]=ne(n.TEXTURE_3D,n.TEXTURE_3D,1,1),r.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Te(n.DEPTH_TEST),s.setFunc(np),Le(!1),de(SS),Te(n.CULL_FACE),me(uo);function Te(K){c[K]!==!0&&(n.enable(K),c[K]=!0)}function Me(K){c[K]!==!1&&(n.disable(K),c[K]=!1)}function it(K,Ce){return u[K]!==Ce?(n.bindFramebuffer(K,Ce),u[K]=Ce,K===n.DRAW_FRAMEBUFFER&&(u[n.FRAMEBUFFER]=Ce),K===n.FRAMEBUFFER&&(u[n.DRAW_FRAMEBUFFER]=Ce),!0):!1}function ct(K,Ce){let pe=p,ye=!1;if(K){pe=d.get(Ce),pe===void 0&&(pe=[],d.set(Ce,pe));const Ie=K.textures;if(pe.length!==Ie.length||pe[0]!==n.COLOR_ATTACHMENT0){for(let lt=0,Bt=Ie.length;lt<Bt;lt++)pe[lt]=n.COLOR_ATTACHMENT0+lt;pe.length=Ie.length,ye=!0}}else pe[0]!==n.BACK&&(pe[0]=n.BACK,ye=!0);ye&&n.drawBuffers(pe)}function je(K){return m!==K?(n.useProgram(K),m=K,!0):!1}const ke={[La]:n.FUNC_ADD,[XB]:n.FUNC_SUBTRACT,[JB]:n.FUNC_REVERSE_SUBTRACT};ke[YB]=n.MIN,ke[KB]=n.MAX;const N={[QB]:n.ZERO,[ZB]:n.ONE,[qB]:n.SRC_COLOR,[vy]:n.SRC_ALPHA,[rI]:n.SRC_ALPHA_SATURATE,[nI]:n.DST_COLOR,[eI]:n.DST_ALPHA,[$B]:n.ONE_MINUS_SRC_COLOR,[Ay]:n.ONE_MINUS_SRC_ALPHA,[iI]:n.ONE_MINUS_DST_COLOR,[tI]:n.ONE_MINUS_DST_ALPHA,[sI]:n.CONSTANT_COLOR,[oI]:n.ONE_MINUS_CONSTANT_COLOR,[aI]:n.CONSTANT_ALPHA,[lI]:n.ONE_MINUS_CONSTANT_ALPHA};function me(K,Ce,pe,ye,Ie,lt,Bt,yn,Kn,zt){if(K===uo){y===!0&&(Me(n.BLEND),y=!1);return}if(y===!1&&(Te(n.BLEND),y=!0),K!==jB){if(K!==_||zt!==B){if((x!==La||S!==La)&&(n.blendEquation(n.FUNC_ADD),x=La,S=La),zt)switch(K){case ti:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case xy:n.blendFunc(n.ONE,n.ONE);break;case MS:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case ES:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",K);break}else switch(K){case ti:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case xy:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case MS:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case ES:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",K);break}g=null,v=null,M=null,w=null,T.set(0,0,0),R=0,_=K,B=zt}return}Ie=Ie||Ce,lt=lt||pe,Bt=Bt||ye,(Ce!==x||Ie!==S)&&(n.blendEquationSeparate(ke[Ce],ke[Ie]),x=Ce,S=Ie),(pe!==g||ye!==v||lt!==M||Bt!==w)&&(n.blendFuncSeparate(N[pe],N[ye],N[lt],N[Bt]),g=pe,v=ye,M=lt,w=Bt),(yn.equals(T)===!1||Kn!==R)&&(n.blendColor(yn.r,yn.g,yn.b,Kn),T.copy(yn),R=Kn),_=K,B=!1}function Ae(K,Ce){K.side===Rr?Me(n.CULL_FACE):Te(n.CULL_FACE);let pe=K.side===zi;Ce&&(pe=!pe),Le(pe),K.blending===ti&&K.transparent===!1?me(uo):me(K.blending,K.blendEquation,K.blendSrc,K.blendDst,K.blendEquationAlpha,K.blendSrcAlpha,K.blendDstAlpha,K.blendColor,K.blendAlpha,K.premultipliedAlpha),s.setFunc(K.depthFunc),s.setTest(K.depthTest),s.setMask(K.depthWrite),r.setMask(K.colorWrite);const ye=K.stencilWrite;o.setTest(ye),ye&&(o.setMask(K.stencilWriteMask),o.setFunc(K.stencilFunc,K.stencilRef,K.stencilFuncMask),o.setOp(K.stencilFail,K.stencilZFail,K.stencilZPass)),ze(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),K.alphaToCoverage===!0?Te(n.SAMPLE_ALPHA_TO_COVERAGE):Me(n.SAMPLE_ALPHA_TO_COVERAGE)}function Le(K){b!==K&&(K?n.frontFace(n.CW):n.frontFace(n.CCW),b=K)}function de(K){K!==GB?(Te(n.CULL_FACE),K!==P&&(K===SS?n.cullFace(n.BACK):K===VB?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Me(n.CULL_FACE),P=K}function Ze(K){K!==L&&(X&&n.lineWidth(K),L=K)}function ze(K,Ce,pe){K?(Te(n.POLYGON_OFFSET_FILL),(U!==Ce||G!==pe)&&(n.polygonOffset(Ce,pe),U=Ce,G=pe)):Me(n.POLYGON_OFFSET_FILL)}function He(K){K?Te(n.SCISSOR_TEST):Me(n.SCISSOR_TEST)}function W(K){K===void 0&&(K=n.TEXTURE0+j-1),k!==K&&(n.activeTexture(K),k=K)}function D(K,Ce,pe){pe===void 0&&(k===null?pe=n.TEXTURE0+j-1:pe=k);let ye=Q[pe];ye===void 0&&(ye={type:void 0,texture:void 0},Q[pe]=ye),(ye.type!==K||ye.texture!==Ce)&&(k!==pe&&(n.activeTexture(pe),k=pe),n.bindTexture(K,Ce||fe[K]),ye.type=K,ye.texture=Ce)}function re(){const K=Q[k];K!==void 0&&K.type!==void 0&&(n.bindTexture(K.type,null),K.type=void 0,K.texture=void 0)}function ve(){try{n.compressedTexImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function ge(){try{n.compressedTexImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function _e(){try{n.texSubImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function et(){try{n.texSubImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function be(){try{n.compressedTexSubImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Ve(){try{n.compressedTexSubImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function pt(){try{n.texStorage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Ee(){try{n.texStorage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Ge(){try{n.texImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Pt(){try{n.texImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function ut(K){xe.equals(K)===!1&&(n.scissor(K.x,K.y,K.z,K.w),xe.copy(K))}function Xe(K){De.equals(K)===!1&&(n.viewport(K.x,K.y,K.z,K.w),De.copy(K))}function dt(K,Ce){let pe=l.get(Ce);pe===void 0&&(pe=new WeakMap,l.set(Ce,pe));let ye=pe.get(K);ye===void 0&&(ye=n.getUniformBlockIndex(Ce,K.name),pe.set(K,ye))}function Et(K,Ce){const ye=l.get(Ce).get(K);a.get(Ce)!==ye&&(n.uniformBlockBinding(Ce,ye,K.__bindingPointIndex),a.set(Ce,ye))}function qt(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor
vendor: 7,243 bytes, line 3833
3833(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),c={},k=null,Q={},u={},d=new WeakMap,p=[],m=null,y=!1,_=null,x=null,g=null,v=null,S=null,M=null,w=null,T=new Re(0,0,0),R=0,B=!1,b=null,P=null,L=null,U=null,G=null,xe.set(0,0,n.canvas.width,n.canvas.height),De.set(0,0,n.canvas.width,n.canvas.height),r.reset(),s.reset(),o.reset()}return{buffers:{color:r,depth:s,stencil:o},enable:Te,disable:Me,bindFramebuffer:it,drawBuffers:ct,useProgram:je,setBlending:me,setMaterial:Ae,setFlipSided:Le,setCullFace:de,setLineWidth:Ze,setPolygonOffset:ze,setScissorTest:He,activeTexture:W,bindTexture:D,unbindTexture:re,compressedTexImage2D:ve,compressedTexImage3D:ge,texImage2D:Ge,texImage3D:Pt,updateUBOMapping:dt,uniformBlockBinding:Et,texStorage2D:pt,texStorage3D:Ee,texSubImage2D:_e,texSubImage3D:et,compressedTexSubImage2D:be,compressedTexSubImage3D:Ve,scissor:ut,viewport:Xe,reset:qt}}function t9(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function n9(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function i9(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function PS(n,e,t,i){const r=r9(i);switch(t){case _E:return n*e;case vE:return n*e;case AE:return n*e*2;case z_:return n*e/r.components*r.byteLength;case Dp:return n*e/r.components*r.byteLength;case SE:return n*e*2/r.components*r.byteLength;case F_:return n*e*2/r.components*r.byteLength;case xE:return n*e*3/r.components*r.byteLength;case fi:return n*e*4/r.components*r.byteLength;case O_:return n*e*4/r.components*r.byteLength;case Td:case Cd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Rd:case bd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case My:case wy:return Math.max(n,16)*Math.max(e,8)/4;case Sy:case Ey:return Math.max(n,8)*Math.max(e,8)/2;case Ty:case Cy:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Ry:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case by:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Py:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case By:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case Iy:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case Ly:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case Dy:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case zy:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case Fy:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Oy:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Uy:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Ny:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case ky:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Hy:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case Gy:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Pd:case Vy:case Wy:return Math.ceil(n/4)*Math.ceil(e/4)*16;case ME:case jy:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Xy:case Jy:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function r9(n){switch(n){case xs:case mE:return{byteLength:1,components:1};case Dh:case gE:case fo:return{byteLength:2,components:1};case L_:case D_:return{byteLength:2,components:4};case Zo:case I_:case lr:return{byteLength:4,components:1};case yE:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const s9={contain:t9,cover:n9,fill:i9,getByteLength:PS};function o9(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new ce,u=new WeakMap;let d;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(W,D){return m?new OffscreenCanvas(W,D):hp("canvas")}function _(W,D,re){let ve=1;const ge=He(W);if((ge.width>re||ge.height>re)&&(ve=re/Math.max(ge.width,ge.height)),ve<1)if(typeof HTMLImageElement<"u"&&W instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&W instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&W instanceof ImageBitmap||typeof VideoFrame<"u"&&W instanceof VideoFrame){const _e=Math.floor(ve*ge.width),et=Math.floor(ve*ge.height);d===void 0&&(d=y(_e,et));const be=D?y(_e,et):d;return be.width=_e,be.height=et,be.getContext("2d").drawImage(W,0,0,_e,et),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ge.width+"x"+ge.height+") to ("+_e+"x"+et+")."),be}else return"data"in W&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ge.width+"x"+ge.height+")."),W;return W}function x(W){return W.generateMipmaps&&W.minFilter!==$n&&W.minFilter!==gn}function g(W){n.generateMipmap(W)}function v(W,D,re,ve,ge=!1){if(W!==null){if(n[W]!==void 0)return n[W];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+W+"'")}let _e=D;if(D===n.RED&&(re===n.FLOAT&&(_e=n.R32F),re===n.HALF_FLOAT&&(_e=n.R16F),re===n.UNSIGNED_BYTE&&(_e=n.R8)),D===n.RED_INTEGER&&(re===n.UNSIGNED_BYTE&&(_e=n.R8UI),re===n.UNSIGNED_SHORT&&(_e=n.R16UI),re===n.UNSIGNED_INT&&(_e=n.R32UI),re===n.BYTE&&(_e=n.R8I),re===n.SHORT&&(_e=n.R16I),re===n.INT&&(_e=n.R32I)),D===n.RG&&(re===n.FLOAT&&(_e=n.RG32F),re===n.HALF_FLOAT&&(_e=n.RG16F),re===n.UNSIGNED_BYTE&&(_e=n.RG8)),D===n.RG_INTEGER&&(re===n.UNSIGNED_BYTE&&(_e=n.RG8UI),re===n.UNSIGNED_SHORT&&(_e=n.RG16UI),re===n.UNSIGNED_INT&&(_e=n.RG32UI),re===n.BYTE&&(_e=n.RG8I),re===n.SHORT&&(_e=n.RG16I),re===n.INT&&(_e=n.RG32I)),D===n.RGB&&re===n.UNSIGNED_INT_5_9_9_9_REV&&(_e=n.RGB9_E5),D===n.RGBA){const et=ge?op:Vt.getTransfer(ve);re===n.FLOAT&&(_e=n.RGBA32F),re===n.HALF_FLOAT&&(_e=n.RGBA16F),re===n.UNSIGNED_BYTE&&(_e=et===rn?n.SRGB8_ALPHA8:n.RGBA8),re===n.UNSIGNED_SHORT_4_4_4_4&&(_e=n.RGBA4),re===n.UNSIGNED_SHORT_5_5_5_1&&(_e=n.RGB5_A1)}return(_e===n.R16F||_e===n.R32F||_e===n.RG16F||_e===n.RG32F||_e===n.RGBA16F||_e===n.RGBA32F)&&e.get("EXT_color_buffer_float"),_e}function S(W,D){let re;return W?D===null||D===Zo||D===wc?re=n.DEPTH24_STENCIL8:D===lr?re=n.DEPTH32F_STENCIL8:D===Dh&&(re=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):D===null||D===Zo||D===wc?re=n.DEPTH_COMPONENT24:D===lr?re=n.DEPTH_COMPONENT32F:D===Dh&&(re=n.DEPTH_COMPONENT16),re}function M(W,D){return x(W)===!0||W.isFramebufferTexture&&W.minFilter!==$n&&W.minFilter!==gn?Math.log2(Math.max(D.width,D.height))+1:W.mipmaps!==void 0&&W.mipmaps.length>
vendor: 5,550 bytes, line 3833
38330?W.mipmaps.length:W.isCompressedTexture&&Array.isArray(W.image)?D.mipmaps.length:1}function w(W){const D=W.target;D.removeEventListener("dispose",w),R(D),D.isVideoTexture&&u.delete(D)}function T(W){const D=W.target;D.removeEventListener("dispose",T),b(D)}function R(W){const D=i.get(W);if(D.__webglInit===void 0)return;const re=W.source,ve=p.get(re);if(ve){const ge=ve[D.__cacheKey];ge.usedTimes--,ge.usedTimes===0&&B(W),Object.keys(ve).length===0&&p.delete(re)}i.remove(W)}function B(W){const D=i.get(W);n.deleteTexture(D.__webglTexture);const re=W.source,ve=p.get(re);delete ve[D.__cacheKey],o.memory.textures--}function b(W){const D=i.get(W);if(W.depthTexture&&W.depthTexture.dispose(),W.isWebGLCubeRenderTarget)for(let ve=0;ve<6;ve++){if(Array.isArray(D.__webglFramebuffer[ve]))for(let ge=0;ge<D.__webglFramebuffer[ve].length;ge++)n.deleteFramebuffer(D.__webglFramebuffer[ve][ge]);else n.deleteFramebuffer(D.__webglFramebuffer[ve]);D.__webglDepthbuffer&&n.deleteRenderbuffer(D.__webglDepthbuffer[ve])}else{if(Array.isArray(D.__webglFramebuffer))for(let ve=0;ve<D.__webglFramebuffer.length;ve++)n.deleteFramebuffer(D.__webglFramebuffer[ve]);else n.deleteFramebuffer(D.__webglFramebuffer);if(D.__webglDepthbuffer&&n.deleteRenderbuffer(D.__webglDepthbuffer),D.__webglMultisampledFramebuffer&&n.deleteFramebuffer(D.__webglMultisampledFramebuffer),D.__webglColorRenderbuffer)for(let ve=0;ve<D.__webglColorRenderbuffer.length;ve++)D.__webglColorRenderbuffer[ve]&&n.deleteRenderbuffer(D.__webglColorRenderbuffer[ve]);D.__webglDepthRenderbuffer&&n.deleteRenderbuffer(D.__webglDepthRenderbuffer)}const re=W.textures;for(let ve=0,ge=re.length;ve<ge;ve++){const _e=i.get(re[ve]);_e.__webglTexture&&(n.deleteTexture(_e.__webglTexture),o.memory.textures--),i.remove(re[ve])}i.remove(W)}let P=0;function L(){P=0}function U(){const W=P;return W>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+W+" texture units while this GPU supports only "+r.maxTextures),P+=1,W}function G(W){const D=[];return D.push(W.wrapS),D.push(W.wrapT),D.push(W.wrapR||0),D.push(W.magFilter),D.push(W.minFilter),D.push(W.anisotropy),D.push(W.internalFormat),D.push(W.format),D.push(W.type),D.push(W.generateMipmaps),D.push(W.premultiplyAlpha),D.push(W.flipY),D.push(W.unpackAlignment),D.push(W.colorSpace),D.join()}function j(W,D){const re=i.get(W);if(W.isVideoTexture&&Ze(W),W.isRenderTargetTexture===!1&&W.version>0&&re.__version!==W.version){const ve=W.image;if(ve===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ve.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{De(re,W,D);return}}t.bindTexture(n.TEXTURE_2D,re.__webglTexture,n.TEXTURE0+D)}function X(W,D){const re=i.get(W);if(W.version>0&&re.__version!==W.version){De(re,W,D);return}t.bindTexture(n.TEXTURE_2D_ARRAY,re.__webglTexture,n.TEXTURE0+D)}function J(W,D){const re=i.get(W);if(W.version>0&&re.__version!==W.version){De(re,W,D);return}t.bindTexture(n.TEXTURE_3D,re.__webglTexture,n.TEXTURE0+D)}function te(W,D){const re=i.get(W);if(W.version>0&&re.__version!==W.version){ne(re,W,D);return}t.bindTexture(n.TEXTURE_CUBE_MAP,re.__webglTexture,n.TEXTURE0+D)}const k={[nl]:n.REPEAT,[Br]:n.CLAMP_TO_EDGE,[Lh]:n.MIRRORED_REPEAT},Q={[$n]:n.NEAREST,[B_]:n.NEAREST_MIPMAP_NEAREST,[$l]:n.NEAREST_MIPMAP_LINEAR,[gn]:n.LINEAR,[vh]:n.LINEAR_MIPMAP_NEAREST,[ls]:n.LINEAR_MIPMAP_LINEAR},$={[II]:n.NEVER,[UI]:n.ALWAYS,[LI]:n.LESS,[TE]:n.LEQUAL,[DI]:n.EQUAL,[OI]:n.GEQUAL,[zI]:n.GREATER,[FI]:n.NOTEQUAL};function oe(W,D){if(D.type===lr&&e.has("OES_texture_float_linear")===!1&&(D.magFilter===gn||D.magFilter===vh||D.magFilter===$l||D.magFilter===ls||D.minFilter===gn||D.minFilter===vh||D.minFilter===$l||D.minFilter===ls)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(W,n.TEXTURE_WRAP_S,k[D.wrapS]),n.texParameteri(W,n.TEXTURE_WRAP_T,k[D.wrapT]),(W===n.TEXTURE_3D||W===n.TEXTURE_2D_ARRAY)&&n.texParameteri(W,n.TEXTURE_WRAP_R,k[D.wrapR]),n.texParameteri(W,n.TEXTURE_MAG_FILTER,Q[D.magFilter]),n.texParameteri(W,n.TEXTURE_MIN_FILTER,Q[D.minFilter]),D.compareFunction&&(n.texParameteri(W,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(W,n.TEXTURE_COMPARE_FUNC,$[D.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(D.magFilter===$n||D.minFilter!==$l&&D.minFilter!==ls||D.type===lr&&e.has("OES_texture_float_linear")===!1)return;if(D.anisotropy>1||i.get(D).__currentAnisotropy){const re=e.get("EXT_texture_filter_anisotropic");n.texParameterf(W,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(D.anisotropy,r.getMaxAnisotropy())),i.get(D).__currentAnisotropy=D.anisotropy}}}function xe(W,D){let re=!1;W.__webglInit===void 0&&(W.__webglInit=!0,D.addEventListener("dispose",w));const ve=D.source;let ge=p.get(ve);ge===void 0&&(ge={},p.set(ve,ge));const _e=G(D);if(_e!==W.__cacheKey){ge[_e]===void 0&&(ge[_e]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,re=!0),ge[_e].usedTimes++;const et=ge[W.__cacheKey];et!==void 0&&(ge[W.__cacheKey].usedTimes--,et.usedTimes===0&&B(D)),W.__cacheKey=_e,W.__webglTexture=ge[_e].texture}return re}function De(W,D,re){let ve=n.TEXTURE_2D;(D.isDataArrayTexture||D.isCompressedArrayTexture)&&(ve=n.TEXTURE_2D_ARRAY),D.isData3DTexture&&(ve=n.TEXTURE_3D);const ge=xe(W,D),_e=D.source;t.bindTexture(ve,W.__webglTexture,n.TEXTURE0+re);const et=i.get(_e);if(_e.version!==et.__version||ge===!0){t.activeTexture(n.TEXTURE0+re);
vendor: 4,808 bytes, line 3833
3833const be=Vt.getPrimaries(Vt.workingColorSpace),Ve=D.colorSpace===Uo?null:Vt.getPrimaries(D.colorSpace),pt=D.colorSpace===Uo||be===Ve?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,D.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,D.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,pt);let Ee=_(D.image,!1,r.maxTextureSize);Ee=ze(D,Ee);const Ge=s.convert(D.format,D.colorSpace),Pt=s.convert(D.type);let ut=v(D.internalFormat,Ge,Pt,D.colorSpace,D.isVideoTexture);oe(ve,D);let Xe;const dt=D.mipmaps,Et=D.isVideoTexture!==!0,qt=et.__version===void 0||ge===!0,K=_e.dataReady,Ce=M(D,Ee);if(D.isDepthTexture)ut=S(D.format===Tc,D.type),qt&&(Et?t.texStorage2D(n.TEXTURE_2D,1,ut,Ee.width,Ee.height):t.texImage2D(n.TEXTURE_2D,0,ut,Ee.width,Ee.height,0,Ge,Pt,null));else if(D.isDataTexture)if(dt.length>0){Et&&qt&&t.texStorage2D(n.TEXTURE_2D,Ce,ut,dt[0].width,dt[0].height);for(let pe=0,ye=dt.length;pe<ye;pe++)Xe=dt[pe],Et?K&&t.texSubImage2D(n.TEXTURE_2D,pe,0,0,Xe.width,Xe.height,Ge,Pt,Xe.data):t.texImage2D(n.TEXTURE_2D,pe,ut,Xe.width,Xe.height,0,Ge,Pt,Xe.data);D.generateMipmaps=!1}else Et?(qt&&t.texStorage2D(n.TEXTURE_2D,Ce,ut,Ee.width,Ee.height),K&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,Ee.width,Ee.height,Ge,Pt,Ee.data)):t.texImage2D(n.TEXTURE_2D,0,ut,Ee.width,Ee.height,0,Ge,Pt,Ee.data);else if(D.isCompressedTexture)if(D.isCompressedArrayTexture){Et&&qt&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Ce,ut,dt[0].width,dt[0].height,Ee.depth);for(let pe=0,ye=dt.length;pe<ye;pe++)if(Xe=dt[pe],D.format!==fi)if(Ge!==null)if(Et){if(K)if(D.layerUpdates.size>0){const Ie=PS(Xe.width,Xe.height,D.format,D.type);for(const lt of D.layerUpdates){const Bt=Xe.data.subarray(lt*Ie/Xe.data.BYTES_PER_ELEMENT,(lt+1)*Ie/Xe.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,pe,0,0,lt,Xe.width,Xe.height,1,Ge,Bt,0,0)}D.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,pe,0,0,0,Xe.width,Xe.height,Ee.depth,Ge,Xe.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,pe,ut,Xe.width,Xe.height,Ee.depth,0,Xe.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Et?K&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,pe,0,0,0,Xe.width,Xe.height,Ee.depth,Ge,Pt,Xe.data):t.texImage3D(n.TEXTURE_2D_ARRAY,pe,ut,Xe.width,Xe.height,Ee.depth,0,Ge,Pt,Xe.data)}else{Et&&qt&&t.texStorage2D(n.TEXTURE_2D,Ce,ut,dt[0].width,dt[0].height);for(let pe=0,ye=dt.length;pe<ye;pe++)Xe=dt[pe],D.format!==fi?Ge!==null?Et?K&&t.compressedTexSubImage2D(n.TEXTURE_2D,pe,0,0,Xe.width,Xe.height,Ge,Xe.data):t.compressedTexImage2D(n.TEXTURE_2D,pe,ut,Xe.width,Xe.height,0,Xe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Et?K&&t.texSubImage2D(n.TEXTURE_2D,pe,0,0,Xe.width,Xe.height,Ge,Pt,Xe.data):t.texImage2D(n.TEXTURE_2D,pe,ut,Xe.width,Xe.height,0,Ge,Pt,Xe.data)}else if(D.isDataArrayTexture)if(Et){if(qt&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Ce,ut,Ee.width,Ee.height,Ee.depth),K)if(D.layerUpdates.size>0){const pe=PS(Ee.width,Ee.height,D.format,D.type);for(const ye of D.layerUpdates){const Ie=Ee.data.subarray(ye*pe/Ee.data.BYTES_PER_ELEMENT,(ye+1)*pe/Ee.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,ye,Ee.width,Ee.height,1,Ge,Pt,Ie)}D.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Ee.width,Ee.height,Ee.depth,Ge,Pt,Ee.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,ut,Ee.width,Ee.height,Ee.depth,0,Ge,Pt,Ee.data);else if(D.isData3DTexture)Et?(qt&&t.texStorage3D(n.TEXTURE_3D,Ce,ut,Ee.width,Ee.height,Ee.depth),K&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Ee.width,Ee.height,Ee.depth,Ge,Pt,Ee.data)):t.texImage3D(n.TEXTURE_3D,0,ut,Ee.width,Ee.height,Ee.depth,0,Ge,Pt,Ee.data);else if(D.isFramebufferTexture){if(qt)if(Et)t.texStorage2D(n.TEXTURE_2D,Ce,ut,Ee.width,Ee.height);else{let pe=Ee.width,ye=Ee.height;for(let Ie=0;Ie<Ce;Ie++)t.texImage2D(n.TEXTURE_2D,Ie,ut,pe,ye,0,Ge,Pt,null),pe>>=1,ye>>=1}}else if(dt.length>0){if(Et&&qt){const pe=He(dt[0]);t.texStorage2D(n.TEXTURE_2D,Ce,ut,pe.width,pe.height)}for(let pe=0,ye=dt.length;pe<ye;pe++)Xe=dt[pe],Et?K&&t.texSubImage2D(n.TEXTURE_2D,pe,0,0,Ge,Pt,Xe):t.texImage2D(n.TEXTURE_2D,pe,ut,Ge,Pt,Xe);D.generateMipmaps=!1}else if(Et){if(qt){const pe=He(Ee);t.texStorage2D(n.TEXTURE_2D,Ce,ut,pe.width,pe.height)}K&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,Ge,Pt,Ee)}else t.texImage2D(n.TEXTURE_2D,0,ut,Ge,Pt,Ee);x(D)&&g(ve),et.__version=_e.version,D.onUpdate&&D.onUpdate(D)}W.__version=D.version}function ne(W,D,re){if(D.image.length!==6)return;const ve=xe(W,D),ge=D.source;t.bindTexture(n.TEXTURE_CUBE_MAP,W.__webglTexture,n.TEXTURE0+re);const _e=i.get(ge);if(ge.version!==_e.__version||ve===!0){t.activeTexture(n.TEXTURE0+re);
vendor: 9,019 bytes, line 3833
3833const et=Vt.getPrimaries(Vt.workingColorSpace),be=D.colorSpace===Uo?null:Vt.getPrimaries(D.colorSpace),Ve=D.colorSpace===Uo||et===be?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,D.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,D.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);const pt=D.isCompressedTexture||D.image[0].isCompressedTexture,Ee=D.image[0]&&D.image[0].isDataTexture,Ge=[];for(let ye=0;ye<6;ye++)!pt&&!Ee?Ge[ye]=_(D.image[ye],!0,r.maxCubemapSize):Ge[ye]=Ee?D.image[ye].image:D.image[ye],Ge[ye]=ze(D,Ge[ye]);const Pt=Ge[0],ut=s.convert(D.format,D.colorSpace),Xe=s.convert(D.type),dt=v(D.internalFormat,ut,Xe,D.colorSpace),Et=D.isVideoTexture!==!0,qt=_e.__version===void 0||ve===!0,K=ge.dataReady;let Ce=M(D,Pt);oe(n.TEXTURE_CUBE_MAP,D);let pe;if(pt){Et&&qt&&t.texStorage2D(n.TEXTURE_CUBE_MAP,Ce,dt,Pt.width,Pt.height);for(let ye=0;ye<6;ye++){pe=Ge[ye].mipmaps;for(let Ie=0;Ie<pe.length;Ie++){const lt=pe[Ie];D.format!==fi?ut!==null?Et?K&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Ie,0,0,lt.width,lt.height,ut,lt.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Ie,dt,lt.width,lt.height,0,lt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Et?K&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Ie,0,0,lt.width,lt.height,ut,Xe,lt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Ie,dt,lt.width,lt.height,0,ut,Xe,lt.data)}}}else{if(pe=D.mipmaps,Et&&qt){pe.length>0&&Ce++;const ye=He(Ge[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Ce,dt,ye.width,ye.height)}for(let ye=0;ye<6;ye++)if(Ee){Et?K&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,0,0,0,Ge[ye].width,Ge[ye].height,ut,Xe,Ge[ye].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,0,dt,Ge[ye].width,Ge[ye].height,0,ut,Xe,Ge[ye].data);for(let Ie=0;Ie<pe.length;Ie++){const Bt=pe[Ie].image[ye].image;Et?K&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Ie+1,0,0,Bt.width,Bt.height,ut,Xe,Bt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Ie+1,dt,Bt.width,Bt.height,0,ut,Xe,Bt.data)}}else{Et?K&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,0,0,0,ut,Xe,Ge[ye]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,0,dt,ut,Xe,Ge[ye]);for(let Ie=0;Ie<pe.length;Ie++){const lt=pe[Ie];Et?K&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Ie+1,0,0,ut,Xe,lt.image[ye]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Ie+1,dt,ut,Xe,lt.image[ye])}}}x(D)&&g(n.TEXTURE_CUBE_MAP),_e.__version=ge.version,D.onUpdate&&D.onUpdate(D)}W.__version=D.version}function fe(W,D,re,ve,ge,_e){const et=s.convert(re.format,re.colorSpace),be=s.convert(re.type),Ve=v(re.internalFormat,et,be,re.colorSpace);if(!i.get(D).__hasExternalTextures){const Ee=Math.max(1,D.width>>_e),Ge=Math.max(1,D.height>>_e);ge===n.TEXTURE_3D||ge===n.TEXTURE_2D_ARRAY?t.texImage3D(ge,_e,Ve,Ee,Ge,D.depth,0,et,be,null):t.texImage2D(ge,_e,Ve,Ee,Ge,0,et,be,null)}t.bindFramebuffer(n.FRAMEBUFFER,W),de(D)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ve,ge,i.get(re).__webglTexture,0,Le(D)):(ge===n.TEXTURE_2D||ge>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ge<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ve,ge,i.get(re).__webglTexture,_e),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Te(W,D,re){if(n.bindRenderbuffer(n.RENDERBUFFER,W),D.depthBuffer){const ve=D.depthTexture,ge=ve&&ve.isDepthTexture?ve.type:null,_e=S(D.stencilBuffer,ge),et=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,be=Le(D);de(D)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,be,_e,D.width,D.height):re?n.renderbufferStorageMultisample(n.RENDERBUFFER,be,_e,D.width,D.height):n.renderbufferStorage(n.RENDERBUFFER,_e,D.width,D.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,et,n.RENDERBUFFER,W)}else{const ve=D.textures;for(let ge=0;ge<ve.length;ge++){const _e=ve[ge],et=s.convert(_e.format,_e.colorSpace),be=s.convert(_e.type),Ve=v(_e.internalFormat,et,be,_e.colorSpace),pt=Le(D);re&&de(D)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,pt,Ve,D.width,D.height):de(D)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,pt,Ve,D.width,D.height):n.renderbufferStorage(n.RENDERBUFFER,Ve,D.width,D.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function Me(W,D){if(D&&D.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,W),!(D.depthTexture&&D.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(D.depthTexture).__webglTexture||D.depthTexture.image.width!==D.width||D.depthTexture.image.height!==D.height)&&(D.depthTexture.image.width=D.width,D.depthTexture.image.height=D.height,D.depthTexture.needsUpdate=!0),j(D.depthTexture,0);const ve=i.get(D.depthTexture).__webglTexture,ge=Le(D);if(D.depthTexture.format===uc)de(D)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,ve,0,ge):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,ve,0);else if(D.depthTexture.format===Tc)de(D)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,ve,0,ge):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,ve,0);else throw new Error("Unknown depthTexture format")}function it(W){const D=i.get(W),re=W.isWebGLCubeRenderTarget===!0;if(W.depthTexture&&!D.__autoAllocateDepthBuffer){if(re)throw new Error("target.depthTexture not supported in Cube render targets");Me(D.__webglFramebuffer,W)}else if(re){D.__webglDepthbuffer=[];for(let ve=0;ve<6;ve++)t.bindFramebuffer(n.FRAMEBUFFER,D.__webglFramebuffer[ve]),D.__webglDepthbuffer[ve]=n.createRenderbuffer(),Te(D.__webglDepthbuffer[ve],W,!1)}else t.bindFramebuffer(n.FRAMEBUFFER,D.__webglFramebuffer),D.__webglDepthbuffer=n.createRenderbuffer(),Te(D.__webglDepthbuffer,W,!1);t.bindFramebuffer(n.FRAMEBUFFER,null)}function ct(W,D,re){const ve=i.get(W);D!==void 0&&fe(ve.__webglFramebuffer,W,W.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),re!==void 0&&it(W)}function je(W){const D=W.texture,re=i.get(W),ve=i.get(D);W.addEventListener("dispose",T);const ge=W.textures,_e=W.isWebGLCubeRenderTarget===!0,et=ge.length>1;if(et||(ve.__webglTexture===void 0&&(ve.__webglTexture=n.createTexture()),ve.__version=D.version,o.memory.textures++),_e){re.__webglFramebuffer=[];for(let be=0;be<6;be++)if(D.mipmaps&&D.mipmaps.length>0){re.__webglFramebuffer[be]=[];for(let Ve=0;Ve<D.mipmaps.length;Ve++)re.__webglFramebuffer[be][Ve]=n.createFramebuffer()}else re.__webglFramebuffer[be]=n.createFramebuffer()}else{if(D.mipmaps&&D.mipmaps.length>0){re.__webglFramebuffer=[];for(let be=0;be<D.mipmaps.length;be++)re.__webglFramebuffer[be]=n.createFramebuffer()}else re.__webglFramebuffer=n.createFramebuffer();if(et)for(let be=0,Ve=ge.length;be<Ve;be++){const pt=i.get(ge[be]);pt.__webglTexture===void 0&&(pt.__webglTexture=n.createTexture(),o.memory.textures++)}if(W.samples>0&&de(W)===!1){re.__webglMultisampledFramebuffer=n.createFramebuffer(),re.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,re.__webglMultisampledFramebuffer);for(let be=0;be<ge.length;be++){const Ve=ge[be];re.__webglColorRenderbuffer[be]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,re.__webglColorRenderbuffer[be]);const pt=s.convert(Ve.format,Ve.colorSpace),Ee=s.convert(Ve.type),Ge=v(Ve.internalFormat,pt,Ee,Ve.colorSpace,W.isXRRenderTarget===!0),Pt=Le(W);n.renderbufferStorageMultisample(n.RENDERBUFFER,Pt,Ge,W.width,W.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+be,n.RENDERBUFFER,re.__webglColorRenderbuffer[be])}n.bindRenderbuffer(n.RENDERBUFFER,null),W.depthBuffer&&(re.__webglDepthRenderbuffer=n.createRenderbuffer(),Te(re.__webglDepthRenderbuffer,W,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(_e){t.bindTexture(n.TEXTURE_CUBE_MAP,ve.__webglTexture),oe(n.TEXTURE_CUBE_MAP,D);for(let be=0;be<6;be++)if(D.mipmaps&&D.mipmaps.length>0)for(let Ve=0;Ve<D.mipmaps.length;Ve++)fe(re.__webglFramebuffer[be][Ve],W,D,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+be,Ve);else fe(re.__webglFramebuffer[be],W,D,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+be,0);x(D)&&g(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(et){for(let be=0,Ve=ge.length;be<Ve;be++){const pt=ge[be],Ee=i.get(pt);t.bindTexture(n.TEXTURE_2D,Ee.__webglTexture),oe(n.TEXTURE_2D,pt),fe(re.__webglFramebuffer,W,pt,n.COLOR_ATTACHMENT0+be,n.TEXTURE_2D,0),x(pt)&&g(n.TEXTURE_2D)}t.unbindTexture()}else{let be=n.TEXTURE_2D;if((W.isWebGL3DRenderTarget||W.isWebGLArrayRenderTarget)&&(be=W.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(be,ve.__webglTexture),oe(be,D),D.mipmaps&&D.mipmaps.length>0)for(let Ve=0;Ve<D.mipmaps.length;Ve++)fe(re.__webglFramebuffer[Ve],W,D,n.COLOR_ATTACHMENT0,be,Ve);else fe(re.__webglFramebuffer,W,D,n.COLOR_ATTACHMENT0,be,0);x(D)&&g(be),t.unbindTexture()}W.depthBuffer&&it(W)}function ke(W){const D=W.textures;for(let re=0,ve=D.length;re<ve;re++){const ge=D[re];
vendor: 7,392 bytes, line 3833
3833if(x(ge)){const _e=W.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,et=i.get(ge).__webglTexture;t.bindTexture(_e,et),g(_e),t.unbindTexture()}}}const N=[],me=[];function Ae(W){if(W.samples>0){if(de(W)===!1){const D=W.textures,re=W.width,ve=W.height;let ge=n.COLOR_BUFFER_BIT;const _e=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,et=i.get(W),be=D.length>1;if(be)for(let Ve=0;Ve<D.length;Ve++)t.bindFramebuffer(n.FRAMEBUFFER,et.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ve,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,et.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ve,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,et.__webglMultisampledFramebuffer),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,et.__webglFramebuffer);for(let Ve=0;Ve<D.length;Ve++){if(W.resolveDepthBuffer&&(W.depthBuffer&&(ge|=n.DEPTH_BUFFER_BIT),W.stencilBuffer&&W.resolveStencilBuffer&&(ge|=n.STENCIL_BUFFER_BIT)),be){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,et.__webglColorRenderbuffer[Ve]);const pt=i.get(D[Ve]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,pt,0)}n.blitFramebuffer(0,0,re,ve,0,0,re,ve,ge,n.NEAREST),l===!0&&(N.length=0,me.length=0,N.push(n.COLOR_ATTACHMENT0+Ve),W.depthBuffer&&W.resolveDepthBuffer===!1&&(N.push(_e),me.push(_e),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,me)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,N))}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),be)for(let Ve=0;Ve<D.length;Ve++){t.bindFramebuffer(n.FRAMEBUFFER,et.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ve,n.RENDERBUFFER,et.__webglColorRenderbuffer[Ve]);const pt=i.get(D[Ve]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,et.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ve,n.TEXTURE_2D,pt,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,et.__webglMultisampledFramebuffer)}else if(W.depthBuffer&&W.resolveDepthBuffer===!1&&l){const D=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[D])}}}function Le(W){return Math.min(r.maxSamples,W.samples)}function de(W){const D=i.get(W);return W.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&D.__useRenderToTexture!==!1}function Ze(W){const D=o.render.frame;u.get(W)!==D&&(u.set(W,D),W.update())}function ze(W,D){const re=W.colorSpace,ve=W.format,ge=W.type;return W.isCompressedTexture===!0||W.isVideoTexture===!0||re!==ia&&re!==Uo&&(Vt.getTransfer(re)===rn?(ve!==fi||ge!==xs)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",re)),D}function He(W){return typeof HTMLImageElement<"u"&&W instanceof HTMLImageElement?(c.width=W.naturalWidth||W.width,c.height=W.naturalHeight||W.height):typeof VideoFrame<"u"&&W instanceof VideoFrame?(c.width=W.displayWidth,c.height=W.displayHeight):(c.width=W.width,c.height=W.height),c}this.allocateTextureUnit=U,this.resetTextureUnits=L,this.setTexture2D=j,this.setTexture2DArray=X,this.setTexture3D=J,this.setTextureCube=te,this.rebindTextures=ct,this.setupRenderTarget=je,this.updateRenderTargetMipmap=ke,this.updateMultisampleRenderTarget=Ae,this.setupDepthRenderbuffer=it,this.setupFrameBufferTexture=fe,this.useMultisampledRTT=de}function qI(n,e){function t(i,r=Uo){let s;const o=Vt.getTransfer(r);if(i===xs)return n.UNSIGNED_BYTE;if(i===L_)return n.UNSIGNED_SHORT_4_4_4_4;if(i===D_)return n.UNSIGNED_SHORT_5_5_5_1;if(i===yE)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===mE)return n.BYTE;if(i===gE)return n.SHORT;if(i===Dh)return n.UNSIGNED_SHORT;if(i===I_)return n.INT;if(i===Zo)return n.UNSIGNED_INT;if(i===lr)return n.FLOAT;if(i===fo)return n.HALF_FLOAT;if(i===_E)return n.ALPHA;if(i===xE)return n.RGB;if(i===fi)return n.RGBA;if(i===vE)return n.LUMINANCE;if(i===AE)return n.LUMINANCE_ALPHA;if(i===uc)return n.DEPTH_COMPONENT;if(i===Tc)return n.DEPTH_STENCIL;if(i===z_)return n.RED;if(i===Dp)return n.RED_INTEGER;if(i===SE)return n.RG;if(i===F_)return n.RG_INTEGER;if(i===O_)return n.RGBA_INTEGER;if(i===Td||i===Cd||i===Rd||i===bd)if(o===rn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Td)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Cd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Rd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===bd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Td)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Cd)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Rd)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===bd)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Sy||i===My||i===Ey||i===wy)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Sy)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===My)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Ey)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===wy)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Ty||i===Cy||i===Ry)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Ty||i===Cy)return o===rn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Ry)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===by||i===Py||i===By||i===Iy||i===Ly||i===Dy||i===zy||i===Fy||i===Oy||i===Uy||i===Ny||i===ky||i===Hy||i===Gy)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===by)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Py)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===By)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Iy)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Ly)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Dy)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===zy)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Fy)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Oy)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Uy)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Ny)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===ky)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Hy)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Gy)return o===rn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Pd||i===Vy||i===Wy)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Pd)return o===rn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Vy)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Wy)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===ME||i===jy||i===Xy||i===Jy)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===Pd)return s.COMPRESSED_RED_RGT
vendor: 12,264 bytes, lines 3833-3857
3833C1_EXT;if(i===jy)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Xy)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Jy)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===wc?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class $I extends Un{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Go extends gt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const a9={type:"move"};class x1{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Go,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Go,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Go,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new z),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const x=t.getJointPose(_,i),g=this._getHandJoint(c,_);x!==null&&(g.matrix.fromArray(x.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=x.radius),g.visible=x!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],p=u.position.distanceTo(d.position),m=.02,y=.005;c.inputState.pinching&&p>m+y?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=m-y&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(a9)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Go;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const l9=` 3834void main() { 3835 3836 gl_Position = vec4( position, 1.0 ); 3837 3838}`,c9=` 3839uniform sampler2DArray depthColor; 3840uniform float depthWidth; 3841uniform float depthHeight; 3842 3843void main() { 3844 3845 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 3846 3847 if ( coord.x >= 1.0 ) { 3848 3849 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 3850 3851 } else { 3852 3853 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 3854 3855 } 3856 3857}`;class u9{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Zt,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new vi({vertexShader:l9,fragmentShader:c9,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new hn(new Oc(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class h9 extends ra{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,p=null,m=null,y=null;const _=new u9,x=t.getContextAttributes();let g=null,v=null;const S=[],M=[],w=new ce;let T=null;const R=new Un;R.layers.enable(1),R.viewport=new Wt;const B=new Un;B.layers.enable(2),B.viewport=new Wt;const b=[R,B],P=new $I;P.layers.enable(1),P.layers.enable(2);let L=null,U=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ne){let fe=S[ne];return fe===void 0&&(fe=new x1,S[ne]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(ne){let fe=S[ne];return fe===void 0&&(fe=new x1,S[ne]=fe),fe.getGripSpace()},this.getHand=function(ne){let fe=S[ne];return fe===void 0&&(fe=new x1,S[ne]=fe),fe.getHandSpace()};function G(ne){const fe=M.indexOf(ne.inputSource);if(fe===-1)return;const Te=S[fe];Te!==void 0&&(Te.update(ne.inputSource,ne.frame,c||o),Te.dispatchEvent({type:ne.type,data:ne.inputSource}))}function j(){r.removeEventListener("select",G),r.removeEventListener("selectstart",G),r.removeEventListener("selectend",G),r.removeEventListener("squeeze",G),r.removeEventListener("squeezestart",G),r.removeEventListener("squeezeend",G),r.removeEventListener("end",j),r.removeEventListener("inputsourceschange",X);for(let ne=0;ne<S.length;ne++){const fe=M[ne];fe!==null&&(M[ne]=null,S[ne].disconnect(fe))}L=null,U=null,_.reset(),e.setRenderTarget(g),m=null,p=null,d=null,r=null,v=null,De.stop(),i.isPresenting=!1,e.setPixelRatio(T),e.setSize(w.width,w.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ne){s=ne,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ne){a=ne,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(ne){c=ne},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return d},this.getFrame=function(){return y},this.getSession=function(){return r},this.setSession=async function(ne){if(r=ne,r!==null){if(g=e.getRenderTarget(),r.addEventListener("select",G),r.addEventListener("selectstart",G),r.addEventListener("selectend",G),r.addEventListener("squeeze",G),r.addEventListener("squeezestart",G),r.addEventListener("squeezeend",G),r.addEventListener("end",j),r.addEventListener("inputsourceschange",X),x.xrCompatible!==!0&&await t.makeXRCompatible(),T=e.getPixelRatio(),e.getSize(w),r.renderState.layers===void 0){const fe={antialias:x.antialias,alpha:!0,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,t,fe),r.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),v=new Fi(m.framebufferWidth,m.framebufferHeight,{format:fi,type:xs,colorSpace:e.outputColorSpace,stencilBuffer:x.stencil})}else{let fe=null,Te=null,Me=null;x.depth&&(Me=x.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,fe=x.stencil?Tc:uc,Te=x.stencil?wc:Zo);const it={colorFormat:t.RGBA8,depthFormat:Me,scaleFactor:s};d=new XRWebGLBinding(r,t),p=d.createProjectionLayer(it),r.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),v=new Fi(p.textureWidth,p.textureHeight,{format:fi,type:xs,depthTexture:new LE(p.textureWidth,p.textureHeight,Te,void 0,void 0,void 0,void 0,void 0,void 0,fe),stencilBuffer:x.stencil,colorSpace:e.outputColorSpace,samples:x.antialias?4:0,resolveDepthBuffer:p.ignoreDepthValues===!1})}v.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await r.requestReferenceSpace(a),De.setContext(r),De.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function X(ne){for(let fe=0;fe<ne.removed.length;fe++){const Te=ne.removed[fe],Me=M.indexOf(Te);Me>=0&&(M[Me]=null,S[Me].disconnect(Te))}for(let fe=0;fe<ne.added.length;fe++){const Te=ne.added[fe];let Me=M.indexOf(Te);if(Me===-1){for(let ct=0;ct<S.length;ct++)if(ct>=M.length){M.push(Te),Me=ct;break}else if(M[ct]===null){M[ct]=Te,Me=ct;break}if(Me===-1)break}const it=S[Me];it&&it.connect(Te)}}const J=new z,te=new z;function k(ne,fe,Te){J.setFromMatrixPosition(fe.matrixWorld),te.setFromMatrixPosition(Te.matrixWorld);const Me=J.distanceTo(te),it=fe.projectionMatrix.elements,ct=Te.projectionMatrix.elements,je=it[14]/(it[10]-1),ke=it[14]/(it[10]+1),N=(it[9]+1)/it[5],me=(it[9]-1)/it[5],Ae=(it[8]-1)/it[0],Le=(ct[8]+1)/ct[0],de=je*Ae,Ze=je*Le,ze=Me/(-Ae+Le),He=ze*-Ae;fe.matrixWorld.decompose(ne.position,ne.quaternion,ne.scale),ne.translateX(He),ne.translateZ(ze),ne.matrixWorld.compose(ne.position,ne.quaternion,ne.scale),ne.matrixWorldInverse.copy(ne.matrixWorld).invert();const W=je+ze,D=ke+ze,re=de-He,ve=Ze+(Me-He),ge=N*ke/D*W,_e=me*ke/D*W;ne.projectionMatrix.makePerspective(re,ve,ge,_e,W,D),ne.projectionMatrixInverse.copy(ne.projectionMatrix).invert()}function Q(ne,fe){fe===null?ne.matrixWorld.copy(ne.matrix):ne.matrixWorld.multiplyMatrices(fe.matrixWorld,ne.matrix),ne.matrixWorldInverse.copy(ne.matrixWorld).invert()}this.updateCamera=function(ne){if(r===null)return;_.texture!==null&&(ne.near=_.depthNear,ne.far=_.depthFar),P.near=B.near=R.near=ne.near,P.far=B.far=R.far=ne.far,(L!==P.near||U!==P.far)&&(r.updateRenderState({depthNear:P.near,depthFar:P.far}),L=P.near,U=P.far,R.near=L,R.far=U,B.near=L,B.far=U,R.updateProjectionMatrix(),B.updateProjectionMatrix(),ne.updateProjectionMatrix());const fe=ne.parent,Te=P.cameras;Q(P,fe);for(let Me=0;Me<Te.length;Me++)Q(Te[Me],fe);Te.length===2?k(P,R,B):P.projectionMatrix.copy(R.projectionMatrix),$(ne,P,fe)};function $(ne,fe,Te){Te===null?ne.matrix.copy(fe.matrixWorld):(ne.matrix.copy(Te.matrixWorld),ne.matrix.invert(),ne.matrix.multiply(fe.matrixWorld)),ne.matrix.decompose(ne.position,ne.quaternion,ne.scale),ne.updateMatrixWorld(!0),ne.projectionMatrix.copy(fe.projectionMatrix),ne.projectionMatrixInverse.copy(fe.projectionMatrixInverse),ne.isPerspectiveCamera&&(ne.fov=Oh*2*Math.atan(1/ne.projectionMatrix.elements[5]),ne.zoom=1)}this.getCamera=function(){return P},this.getFoveation=function(){if(!(p===null&&m===null))return l},this.setFoveation=function(ne){l=ne,p!==null&&(p.fixedFoveation=ne),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=ne)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(P)};let oe=null;function xe(ne,fe){if(u=fe.getViewerPose(c||o),y=fe,u!==null){const Te=u.views;m!==null&&(e.setRenderTargetFramebuffer(v,m.framebuffer),e.setRenderTarget(v));let Me=!1;Te.length!==P.cameras.length&&(P.cameras.length=0,Me=!0);for(let ct=0;ct<Te.length;ct++){const je=Te[ct];let ke=null;if(m!==null)ke=m.getViewport(je);else{const me=d.getViewSubImage(p,je);ke=me.viewport,ct===0&&(e.setRenderTargetTextures(v,me.colorTexture,p.ignoreDepthValues?void 0:me.depthStencilTexture),e.setRenderTarget(v))}let N=b[ct];N===void 0&&(N=new Un,N.layers.enable(ct),N.viewport=new Wt,b[ct]=N),N.matrix.fromArray(je.transform.matrix),N.matrix.decompose(N.position,N.quaternion,N.scale),N.projectionMatrix.fromArray(je.projectionMatrix),N.projectionMatrixInverse.copy(N.projectionMatrix).invert(),N.viewport.set(ke.x,ke.y,ke.width,ke.height),ct===0&&(P.matrix.copy(N.matrix
vendor: 20,436 bytes, line 3857
3857),P.matrix.decompose(P.position,P.quaternion,P.scale)),Me===!0&&P.cameras.push(N)}const it=r.enabledFeatures;if(it&&it.includes("depth-sensing")){const ct=d.getDepthInformation(Te[0]);ct&&ct.isValid&&ct.texture&&_.init(e,ct,r.renderState)}}for(let Te=0;Te<S.length;Te++){const Me=M[Te],it=S[Te];Me!==null&&it!==void 0&&it.update(Me,fe,c||o)}oe&&oe(ne,fe),fe.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:fe}),y=null}const De=new JI;De.setAnimationLoop(xe),this.setAnimationLoop=function(ne){oe=ne},this.dispose=function(){}}}const Bl=new Ur,f9=new Ke;function d9(n,e){function t(x,g){x.matrixAutoUpdate===!0&&x.updateMatrix(),g.value.copy(x.matrix)}function i(x,g){g.color.getRGB(x.fogColor.value,WI(n)),g.isFog?(x.fogNear.value=g.near,x.fogFar.value=g.far):g.isFogExp2&&(x.fogDensity.value=g.density)}function r(x,g,v,S,M){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(x,g):g.isMeshToonMaterial?(s(x,g),d(x,g)):g.isMeshPhongMaterial?(s(x,g),u(x,g)):g.isMeshStandardMaterial?(s(x,g),p(x,g),g.isMeshPhysicalMaterial&&m(x,g,M)):g.isMeshMatcapMaterial?(s(x,g),y(x,g)):g.isMeshDepthMaterial?s(x,g):g.isMeshDistanceMaterial?(s(x,g),_(x,g)):g.isMeshNormalMaterial?s(x,g):g.isLineBasicMaterial?(o(x,g),g.isLineDashedMaterial&&a(x,g)):g.isPointsMaterial?l(x,g,v,S):g.isSpriteMaterial?c(x,g):g.isShadowMaterial?(x.color.value.copy(g.color),x.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(x,g){x.opacity.value=g.opacity,g.color&&x.diffuse.value.copy(g.color),g.emissive&&x.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(x.map.value=g.map,t(g.map,x.mapTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.bumpMap&&(x.bumpMap.value=g.bumpMap,t(g.bumpMap,x.bumpMapTransform),x.bumpScale.value=g.bumpScale,g.side===zi&&(x.bumpScale.value*=-1)),g.normalMap&&(x.normalMap.value=g.normalMap,t(g.normalMap,x.normalMapTransform),x.normalScale.value.copy(g.normalScale),g.side===zi&&x.normalScale.value.negate()),g.displacementMap&&(x.displacementMap.value=g.displacementMap,t(g.displacementMap,x.displacementMapTransform),x.displacementScale.value=g.displacementScale,x.displacementBias.value=g.displacementBias),g.emissiveMap&&(x.emissiveMap.value=g.emissiveMap,t(g.emissiveMap,x.emissiveMapTransform)),g.specularMap&&(x.specularMap.value=g.specularMap,t(g.specularMap,x.specularMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest);const v=e.get(g),S=v.envMap,M=v.envMapRotation;S&&(x.envMap.value=S,Bl.copy(M),Bl.x*=-1,Bl.y*=-1,Bl.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Bl.y*=-1,Bl.z*=-1),x.envMapRotation.value.setFromMatrix4(f9.makeRotationFromEuler(Bl)),x.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=g.reflectivity,x.ior.value=g.ior,x.refractionRatio.value=g.refractionRatio),g.lightMap&&(x.lightMap.value=g.lightMap,x.lightMapIntensity.value=g.lightMapIntensity,t(g.lightMap,x.lightMapTransform)),g.aoMap&&(x.aoMap.value=g.aoMap,x.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,x.aoMapTransform))}function o(x,g){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,g.map&&(x.map.value=g.map,t(g.map,x.mapTransform))}function a(x,g){x.dashSize.value=g.dashSize,x.totalSize.value=g.dashSize+g.gapSize,x.scale.value=g.scale}function l(x,g,v,S){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.size.value=g.size*v,x.scale.value=S*.5,g.map&&(x.map.value=g.map,t(g.map,x.uvTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest)}function c(x,g){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.rotation.value=g.rotation,g.map&&(x.map.value=g.map,t(g.map,x.mapTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest)}function u(x,g){x.specular.value.copy(g.specular),x.shininess.value=Math.max(g.shininess,1e-4)}function d(x,g){g.gradientMap&&(x.gradientMap.value=g.gradientMap)}function p(x,g){x.metalness.value=g.metalness,g.metalnessMap&&(x.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,x.metalnessMapTransform)),x.roughness.value=g.roughness,g.roughnessMap&&(x.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,x.roughnessMapTransform)),g.envMap&&(x.envMapIntensity.value=g.envMapIntensity)}function m(x,g,v){x.ior.value=g.ior,g.sheen>0&&(x.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),x.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(x.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,x.sheenColorMapTransform)),g.sheenRoughnessMap&&(x.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,x.sheenRoughnessMapTransform))),g.clearcoat>0&&(x.clearcoat.value=g.clearcoat,x.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(x.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,x.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(x.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===zi&&x.clearcoatNormalScale.value.negate())),g.dispersion>0&&(x.dispersion.value=g.dispersion),g.iridescence>0&&(x.iridescence.value=g.iridescence,x.iridescenceIOR.value=g.iridescenceIOR,x.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(x.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,x.iridescenceMapTransform)),g.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),g.transmission>0&&(x.transmission.value=g.transmission,x.transmissionSamplerMap.value=v.texture,x.transmissionSamplerSize.value.set(v.width,v.height),g.transmissionMap&&(x.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,x.transmissionMapTransform)),x.thickness.value=g.thickness,g.thicknessMap&&(x.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=g.attenuationDistance,x.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(x.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(x.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=g.specularIntensity,x.specularColor.value.copy(g.specularColor),g.specularColorMap&&(x.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,x.specularColorMapTransform)),g.specularIntensityMap&&(x.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,x.specularIntensityMapTransform))}function y(x,g){g.matcap&&(x.matcap.value=g.matcap)}function _(x,g){const v=e.get(g).light;x.referencePosition.value.setFromMatrixPosition(v.matrixWorld),x.nearDistance.value=v.shadow.camera.near,x.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function p9(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(v,S){const M=S.program;i.uniformBlockBinding(v,M)}function c(v,S){let M=r[v.id];M===void 0&&(y(v),M=u(v),r[v.id]=M,v.addEventListener("dispose",x));const w=S.program;i.updateUBOMapping(v,w);const T=e.render.frame;s[v.id]!==T&&(p(v),s[v.id]=T)}function u(v){const S=d();v.__bindingPointIndex=S;const M=n.createBuffer(),w=v.__size,T=v.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,w,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,M),M}function d(){for(let v=0;v<a;v++)if(o.indexOf(v)===-1)return o.push(v),v;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(v){const S=r[v.id],M=v.uniforms,w=v.__cache;n.bindBuffer(n.UNIFORM_BUFFER,S);for(let T=0,R=M.length;T<R;T++){const B=Array.isArray(M[T])?M[T]:[M[T]];for(let b=0,P=B.length;b<P;b++){const L=B[b];if(m(L,T,b,w)===!0){const U=L.__offset,G=Array.isArray(L.value)?L.value:[L.value];let j=0;for(let X=0;X<G.length;X++){const J=G[X],te=_(J);typeof J=="number"||typeof J=="boolean"?(L.__data[0]=J,n.bufferSubData(n.UNIFORM_BUFFER,U+j,L.__data)):J.isMatrix3?(L.__data[0]=J.elements[0],L.__data[1]=J.elements[1],L.__data[2]=J.elements[2],L.__data[3]=0,L.__data[4]=J.elements[3],L.__data[5]=J.elements[4],L.__data[6]=J.elements[5],L.__data[7]=0,L.__data[8]=J.elements[6],L.__data[9]=J.elements[7],L.__data[10]=J.elements[8],L.__data[11]=0):(J.toArray(L.__data,j),j+=te.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,U,L.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function m(v,S,M,w){const T=v.value,R=S+"_"+M;if(w[R]===void 0)return typeof T=="number"||typeof T=="boolean"?w[R]=T:w[R]=T.clone(),!0;{const B=w[R];if(typeof T=="number"||typeof T=="boolean"){if(B!==T)return w[R]=T,!0}else if(B.equals(T)===!1)return B.copy(T),!0}return!1}function y(v){const S=v.uniforms;let M=0;const w=16;for(let R=0,B=S.length;R<B;R++){const b=Array.isArray(S[R])?S[R]:[S[R]];for(let P=0,L=b.length;P<L;P++){const U=b[P],G=Array.isArray(U.value)?U.value:[U.value];for(let j=0,X=G.length;j<X;j++){const J=G[j],te=_(J),k=M%w;k!==0&&w-k<te.boundary&&(M+=w-k),U.__data=new Float32Array(te.storage/Float32Array.BYTES_PER_ELEMENT),U.__offset=M,M+=te.storage}}}const T=M%w;return T>0&&(M+=w-T),v.__size=M,v.__cache={},this}function _(v){const S={boundary:0,storage:0};return typeof v=="number"||typeof v=="boolean"?(S.boundary=4,S.storage=4):v.isVector2?(S.boundary=8,S.storage=8):v.isVector3||v.isColor?(S.boundary=16,S.storage=12):v.isVector4?(S.boundary=16,S.storage=16):v.isMatrix3?(S.boundary=48,S.storage=48):v.isMatrix4?(S.boundary=64,S.storage=64):v.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",v),S}function x(v){const S=v.target;S.removeEventListener("dispose",x);const M=o.indexOf(S.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(r[S.id]),delete r[S.id],delete s[S.id]}function g(){for(const v in r)n.deleteBuffer(r[v]);o=[],r={},s={}}return{bind:l,update:c,dispose:g}}class eL{constructor(e={}){const{canvas:t=kI(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let p;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=i.getContextAttributes().alpha}else p=o;const m=new Uint32Array(4),y=new Int32Array(4);let _=null,x=null;const g=[],v=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=rs,this.toneMapping=ho,this.toneMappingExposure=1;const S=this;let M=!1,w=0,T=0,R=null,B=-1,b=null;const P=new Wt,L=new Wt;let U=null;const G=new Re(0);let j=0,X=t.width,J=t.height,te=1,k=null,Q=null;const $=new Wt(0,0,X,J),oe=new Wt(0,0,X,J);let xe=!1;const De=new Up;let ne=!1,fe=!1;const Te=new Ke,Me=new z,it=new Wt,ct={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let je=!1;function ke(){return R===null?te:1}let N=i;function me(O,Z){return t.getContext(O,Z)}try{const O={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Ip}`),t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",ye,!1),t.addEventListener("webglcontextcreationerror",Ie,!1),N===null){const Z="webgl2";if(N=me(Z,O),N===null)throw me(Z)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let Ae,Le,de,Ze,ze,He,W,D,re,ve,ge,_e,et,be,Ve,pt,Ee,Ge,Pt,ut,Xe,dt,Et,qt;function K(){Ae=new Sk(N),Ae.init(),dt=new qI(N,Ae),Le=new gk(N,Ae,e,dt),de=new e9(N),Ze=new wk(N),ze=new G8,He=new o9(N,Ae,de,ze,Le,dt,Ze),W=new _k(S),D=new Ak(S),re=new IN(N),Et=new pk(N,re),ve=new Mk(N,re,Ze,Et),ge=new Ck(N,ve,re,Ze),Pt=new Tk(N,Le,He),pt=new yk(ze),_e=new H8(S,W,D,Ae,Le,Et,pt),et=new d9(S,ze),be=new W8,Ve=new Q8(Ae),Ge=new dk(S,W,D,de,ge,p,l),Ee=new $8(S,ge,Le),qt=new p9(N,Ze,Le,de),ut=new mk(N,Ae,Ze),Xe=new Ek(N,Ae,Ze),Ze.programs=_e.programs,S.capabilities=Le,S.extensions=Ae,S.properties=ze,S.renderLists=be,S.shadowMap=Ee,S.state=de,S.info=Ze}K();const Ce=new h9(S,N);this.xr=Ce,this.getContext=function(){return N},this.getContextAttributes=function(){return N.getContextAttributes()},this.forceContextLoss=function(){const O=Ae.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=Ae.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(O){O!==void 0&&(te=O,this.setSize(X,J,!1))},this.getSize=function(O){return O.set(X,J)},this.setSize=function(O,Z,se=!0){if(Ce.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=O,J=Z,t.width=Math.floor(O*te),t.height=Math.floor(Z*te),se===!0&&(t.style.width=O+"px",t.style.height=Z+"px"),this.setViewport(0,0,O,Z)},this.getDrawingBufferSize=function(O){return O.set(X*te,J*te).floor()},this.setDrawingBufferSize=function(O,Z,se){X=O,J=Z,te=se,t.width=Math.floor(O*se),t.height=Math.floor(Z*se),this.setViewport(0,0,O,Z)},this.getCurrentViewport=function(O){return O.copy(P)},this.getViewport=function(O){return O.copy($)},this.setViewport=function(O,Z,se,ae){O.isVector4?$.set(O.x,O.y,O.z,O.w):$.set(O,Z,se,ae),de.viewport(P.copy($).multiplyScalar(te).round())},this.getScissor=function(O){return O.copy(oe)},this.setScissor=function(O,Z,se,ae){O.isVector4?oe.set(O.x,O.y,O.z,O.w):oe.set(O,Z,se,ae),de.scissor(L.copy(oe).multiplyScalar(te).round())},this.getScissorTest=function(){return xe},this.setScissorTest=function(O){de.setScissorTest(xe=O)},this.setOpaqueSort=function(O){k=O},this.setTransparentSort=function(O){Q=O},this.getClearColor=function(O){return O.copy(Ge.getClearColor())},this.setClearColor=function(){Ge.setClearColor.apply(Ge,arguments)},this.getClearAlpha=function(){return Ge.getClearAlpha()},this.setClearAlpha=function(){Ge.setClearAlpha.apply(Ge,arguments)},this.clear=function(O=!0,Z=!0,se=!0){let ae=0;if(O){let ee=!1;if(R!==null){const Pe=R.texture.format;ee=Pe===O_||Pe===F_||Pe===Dp}if(ee){const Pe=R.texture.type,Ne=Pe===xs||Pe===Zo||Pe===Dh||Pe===wc||Pe===L_||Pe===D_,Qe=Ge.getClearColor(),Ye=Ge.getClearAlpha(),st=Qe.r,at=Qe.g,rt=Qe.b;Ne?(m[0]=st,m[1]=at,m[2]=rt,m[3]=Ye,N.clearBufferuiv(N.COLOR,0,m)):(y[0]=st,y[1]=at,y[2]=rt,y[3]=Ye,N.clearBufferiv(N.COLOR,0,y))}else ae|=N.COLOR_BUFFER_BIT}Z&&(ae|=N.DEPTH_BUFFER_BIT),se&&(ae|=N.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),N.clear(ae)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",ye,!1),t.removeEventListener("webglcontextcreationerror",Ie,!1),be.dispose(),Ve.dispose(),ze.dispose(),W.dispose(),D.dispose(),ge.dispose(),Et.dispose(),qt.dispose(),_e.dispose(),Ce.dispose(),Ce.removeEventListener("sessionstart",yr),Ce.removeEventListener("sessionend",$p),xo.stop()};function pe(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function ye(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const O=Ze.autoReset,Z=Ee.enabled,se=Ee.autoUpdate,ae=Ee.needsUpdate,ee=Ee.type;K(),Ze.autoReset=O,Ee.enabled=Z,Ee.autoUpdate=se,Ee.needsUpdate=ae,Ee.type=ee}function Ie(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function lt(O){const Z=O.target;Z.removeEventListener("dispose",lt),Bt(Z)}function Bt(O){yn(O),ze.remove(O)}function yn(O){const Z=ze.get(O).programs;Z!==void 0&&(Z.forEach(function(se){_e.releaseProgram(se)}),O.isShaderMaterial&&_e.releaseShaderCache(O))}this.renderBufferDirect=function(O,Z,se,ae,ee,Pe){Z===null&&(Z=ct);const Ne=ee.isMesh&&ee.matrixWorld.determinant()<0,Qe=gx(O,Z,se,ae,ee);de.setMaterial(ae,Ne);let Ye=se.index,st=1;if(ae.wireframe===!0){if(Ye=ve.getWireframeAttribute(se),Ye===void 0)return;st=2}const at=se.drawRange,rt=se.attributes.position;let Ot=at.start*st,$t=(at.start+at.count)*st;Pe!==null&&(Ot=Math.max(Ot,Pe.start*st),$t=Math.min($t,(Pe.start+Pe.count)*st)),Ye!==null?(Ot=Math.max(Ot,0),$t=Math.min($t,Ye.count)):rt!=null&&(Ot=Math.max(Ot,0),$t=Math.min($t,rt.count));const Xt=$t-Ot;if(Xt<0||Xt===1/0)return;Et.setup(ee,ae,Qe,se,Ye);let Tn,nt=ut;if(Ye!==null&&(Tn=re.get(Ye),nt=Xe,nt.setIndex(Tn)),ee.isMesh)ae.wireframe===!0?(de.setLineWidth(ae.wireframeLinewidth*ke()),nt.setMode(N.LINES)):nt.setMode(N.TRIANGLES);else if(ee.isLine){let Be=ae.linewidth;Be===void 0&&(Be=1),de.setLineWidth(Be*ke()),ee.isLineSegments?nt.setMode(N.LINES):ee.isLineLoop?nt.setMode(N.LINE_LOOP):nt.setMode(N.LINE_STRIP)}else ee.isPoints?nt.setMode(N.POINTS):ee.isSprite&&nt.setMode(N.TRIANGLES);if(ee.isBatchedMesh)if(ee._multiDrawInstances!==null)nt.renderMultiDrawInstances(ee._multiDrawStarts,ee._multiDrawCounts,ee._multiDrawCount,ee._multiDrawInstances);else if(Ae.get("WEBGL_multi_draw"))nt.renderMultiDraw(ee._multiDrawStarts,ee._multiDrawCounts,ee._multiDrawCount);else{const Be=ee._multiDrawStarts,en=ee._multiDrawCounts,ht=ee._multiDrawCount,tn=Ye?re.get(Ye).bytesPerElement:1,$i=ze.get(ae).currentProgram.getUniforms();for(let kn=0;kn<ht;kn++)$i.setValue(N,"_gl_DrawID",kn),nt.render(Be[kn]/tn,en[kn])}else if(ee.isInstancedMesh)nt.renderInstances(Ot,Xt,ee.count);else if(se.isInstancedBufferGeometry){const Be=se._maxInstanceCount!==void 0?se._maxInstanceCount:1/0,en=Math.min(se.instanceCount,Be);nt.renderInstances(Ot,Xt,en)}else nt.render(Ot,Xt)};function Kn(O,Z,se){O.transparent===!0&&O.side===Rr&&O.forceSinglePass===!1?(O.side=zi,O.needsUpdate=!0,Xc(O,Z,se),O.side=_s,O.needsUpdate=!0,Xc(O,Z,se),O.side=Rr):Xc(O,Z,se)}this.compile=function(O,Z,se=null){se===null&&(se=O),x=Ve.get(se),x.init(Z),v.push(x),se.traverseVisible(function(ee){ee.isLight&&ee.layers.test(Z.layers)&&(x.pushLight(ee),ee.castShadow&&x.pushShadow(ee))}),O!==se&&O.traverseVisible(function(ee){ee.isLight&&ee.layers.test(Z.layers)&&(x.pushLight(ee),ee.castShadow&&x.pushShadow(ee))}),x.setupLights();const ae=new Set;return O.traverse(function(ee){const Pe=ee.material;if(Pe)if(Array.isArray(Pe))for(let Ne=0;Ne<Pe.length;Ne++){const Qe=Pe[Ne];Kn(Qe,se,ee),ae.add(Qe)}else Kn(Pe,se,ee),ae.add(Pe)}),v.pop(),x=null,ae},this.compileAsync=function(O,Z,se=null){const ae=this.compile(O,Z,se);return new Promise(ee=>{function Pe(){if(ae.forEach(function(Ne){ze.get(Ne).currentProgram.isReady()&&ae.delete(Ne)}),ae.size===0){ee(O);return}setTimeout(Pe,10)}Ae.get("KHR_parallel_shader_compile")!==null?Pe():setTimeout(Pe,10)})};let zt=null;function Vr(O){zt&&zt(O)}function yr(){xo.stop()}function $p(){xo.start()}const xo=new JI;xo.setAnimationLoop(Vr),typeof self<"u"&&xo.setContext(self),this.setAnimationLoop=function(O){zt=O,Ce.setAnimationLoop(O),O===null?xo.stop():xo.start()},Ce.addEventListener("sessionstart",yr),Ce.addEventListener("sessionend",$p),this.render=function(O,Z){if(Z!==void 0&&Z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),Z.parent===null&&Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),Ce.enabled===!0&&Ce.isPresenting===!0&&(Ce.cameraAutoUpdate===!0&&Ce.updateCamera(Z),Z=Ce.getCamera()),O.isScene===!0&&O.onBeforeRender(S,O,Z,R),x=Ve.get(O,v.length),x.init(Z),v.push(x),Te.multiplyMatrices(Z.projectionMatrix,Z.matrixWorldInverse),De.setFromProjectionMatrix(Te),fe=this.localClippingEnabled,ne=pt.init(this.clippingPlanes,fe),_=be.get(O,g.length),_.init(
vendor: 4,112 bytes, line 3857
3857),g.push(_),Ce.enabled===!0&&Ce.isPresenting===!0){const Pe=S.xr.getDepthSensingMesh();Pe!==null&&nf(Pe,Z,-1/0,S.sortObjects)}nf(O,Z,0,S.sortObjects),_.finish(),S.sortObjects===!0&&_.sort(k,Q),je=Ce.enabled===!1||Ce.isPresenting===!1||Ce.hasDepthSensing()===!1,je&&Ge.addToRenderList(_,O),this.info.render.frame++,ne===!0&&pt.beginShadows();const se=x.state.shadowsArray;Ee.render(se,O,Z),ne===!0&&pt.endShadows(),this.info.autoReset===!0&&this.info.reset();const ae=_.opaque,ee=_.transmissive;if(x.setupLights(),Z.isArrayCamera){const Pe=Z.cameras;if(ee.length>0)for(let Ne=0,Qe=Pe.length;Ne<Qe;Ne++){const Ye=Pe[Ne];Wc(ae,ee,O,Ye)}je&&Ge.render(O);for(let Ne=0,Qe=Pe.length;Ne<Qe;Ne++){const Ye=Pe[Ne];rf(_,O,Ye,Ye.viewport)}}else ee.length>0&&Wc(ae,ee,O,Z),je&&Ge.render(O),rf(_,O,Z);R!==null&&(He.updateMultisampleRenderTarget(R),He.updateRenderTargetMipmap(R)),O.isScene===!0&&O.onAfterRender(S,O,Z),Et.resetDefaultState(),B=-1,b=null,v.pop(),v.length>0?(x=v[v.length-1],ne===!0&&pt.setGlobalState(S.clippingPlanes,x.state.camera)):x=null,g.pop(),g.length>0?_=g[g.length-1]:_=null};function nf(O,Z,se,ae){if(O.visible===!1)return;if(O.layers.test(Z.layers)){if(O.isGroup)se=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(Z);else if(O.isLight)x.pushLight(O),O.castShadow&&x.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||De.intersectsSprite(O)){ae&&it.setFromMatrixPosition(O.matrixWorld).applyMatrix4(Te);const Ne=ge.update(O),Qe=O.material;Qe.visible&&_.push(O,Ne,Qe,se,it.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||De.intersectsObject(O))){const Ne=ge.update(O),Qe=O.material;if(ae&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),it.copy(O.boundingSphere.center)):(Ne.boundingSphere===null&&Ne.computeBoundingSphere(),it.copy(Ne.boundingSphere.center)),it.applyMatrix4(O.matrixWorld).applyMatrix4(Te)),Array.isArray(Qe)){const Ye=Ne.groups;for(let st=0,at=Ye.length;st<at;st++){const rt=Ye[st],Ot=Qe[rt.materialIndex];Ot&&Ot.visible&&_.push(O,Ne,Ot,se,it.z,rt)}}else Qe.visible&&_.push(O,Ne,Qe,se,it.z,null)}}const Pe=O.children;for(let Ne=0,Qe=Pe.length;Ne<Qe;Ne++)nf(Pe[Ne],Z,se,ae)}function rf(O,Z,se,ae){const ee=O.opaque,Pe=O.transmissive,Ne=O.transparent;x.setupLightsView(se),ne===!0&&pt.setGlobalState(S.clippingPlanes,se),ae&&de.viewport(P.copy(ae)),ee.length>0&&jc(ee,Z,se),Pe.length>0&&jc(Pe,Z,se),Ne.length>0&&jc(Ne,Z,se),de.buffers.depth.setTest(!0),de.buffers.depth.setMask(!0),de.buffers.color.setMask(!0),de.setPolygonOffset(!1)}function Wc(O,Z,se,ae){if((se.isScene===!0?se.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[ae.id]===void 0&&(x.state.transmissionRenderTarget[ae.id]=new Fi(1,1,{generateMipmaps:!0,type:Ae.has("EXT_color_buffer_half_float")||Ae.has("EXT_color_buffer_float")?fo:xs,minFilter:ls,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Vt.workingColorSpace}));const Pe=x.state.transmissionRenderTarget[ae.id],Ne=ae.viewport||P;Pe.setSize(Ne.z,Ne.w);const Qe=S.getRenderTarget();S.setRenderTarget(Pe),S.getClearColor(G),j=S.getClearAlpha(),j<1&&S.setClearColor(16777215,.5),je?Ge.render(se):S.clear();const Ye=S.toneMapping;S.toneMapping=ho;const st=ae.viewport;if(ae.viewport!==void 0&&(ae.viewport=void 0),x.setupLightsView(ae),ne===!0&&pt.setGlobalState(S.clippingPlanes,ae),jc(O,se,ae),He.updateMultisampleRenderTarget(Pe),He.updateRenderTargetMipmap(Pe),Ae.has("WEBGL_multisampled_render_to_texture")===!1){let at=!1;for(let rt=0,Ot=Z.length;rt<Ot;rt++){const $t=Z[rt],Xt=$t.object,Tn=$t.geometry,nt=$t.material,Be=$t.group;if(nt.side===Rr&&Xt.layers.test(ae.layers)){const en=nt.side;nt.side=zi,nt.needsUpdate=!0,aa(Xt,se,ae,Tn,nt,Be),nt.side=en,nt.needsUpdate=!0,at=!0}}at===!0&&(He.updateMultisampleRenderTarget(Pe),He.updateRenderTargetMipmap(Pe))}S.setRenderTarget(Qe),S.setClearColor(G,j),st!==void 0&&(ae.viewport=st),S.toneMapping=Ye}function jc(O,Z,se){const ae=Z.isScene===!0?Z.overrideMaterial:null;for(let ee=0,Pe=O.length;ee<Pe;ee++){const Ne=O[ee],Qe=Ne.object,Ye=Ne.geometry,st=ae===null?Ne.material:ae,at=Ne.group;
vendor: 9,226 bytes, line 3857
3857Qe.layers.test(se.layers)&&aa(Qe,Z,se,Ye,st,at)}}function aa(O,Z,se,ae,ee,Pe){O.onBeforeRender(S,Z,se,ae,ee,Pe),O.modelViewMatrix.multiplyMatrices(se.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),ee.transparent===!0&&ee.side===Rr&&ee.forceSinglePass===!1?(ee.side=zi,ee.needsUpdate=!0,S.renderBufferDirect(se,Z,ae,ee,O,Pe),ee.side=_s,ee.needsUpdate=!0,S.renderBufferDirect(se,Z,ae,ee,O,Pe),ee.side=Rr):S.renderBufferDirect(se,Z,ae,ee,O,Pe),O.onAfterRender(S,Z,se,ae,ee,Pe)}function Xc(O,Z,se){Z.isScene!==!0&&(Z=ct);const ae=ze.get(O),ee=x.state.lights,Pe=x.state.shadowsArray,Ne=ee.state.version,Qe=_e.getParameters(O,ee.state,Pe,Z,se),Ye=_e.getProgramCacheKey(Qe);let st=ae.programs;ae.environment=O.isMeshStandardMaterial?Z.environment:null,ae.fog=Z.fog,ae.envMap=(O.isMeshStandardMaterial?D:W).get(O.envMap||ae.environment),ae.envMapRotation=ae.environment!==null&&O.envMap===null?Z.environmentRotation:O.envMapRotation,st===void 0&&(O.addEventListener("dispose",lt),st=new Map,ae.programs=st);let at=st.get(Ye);if(at!==void 0){if(ae.currentProgram===at&&ae.lightsStateVersion===Ne)return tm(O,Qe),at}else Qe.uniforms=_e.getUniforms(O),O.onBeforeCompile(Qe,S),at=_e.acquireProgram(Qe,Ye),st.set(Ye,at),ae.uniforms=Qe.uniforms;const rt=ae.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(rt.clippingPlanes=pt.uniform),tm(O,Qe),ae.needsLights=_x(O),ae.lightsStateVersion=Ne,ae.needsLights&&(rt.ambientLightColor.value=ee.state.ambient,rt.lightProbe.value=ee.state.probe,rt.directionalLights.value=ee.state.directional,rt.directionalLightShadows.value=ee.state.directionalShadow,rt.spotLights.value=ee.state.spot,rt.spotLightShadows.value=ee.state.spotShadow,rt.rectAreaLights.value=ee.state.rectArea,rt.ltc_1.value=ee.state.rectAreaLTC1,rt.ltc_2.value=ee.state.rectAreaLTC2,rt.pointLights.value=ee.state.point,rt.pointLightShadows.value=ee.state.pointShadow,rt.hemisphereLights.value=ee.state.hemi,rt.directionalShadowMap.value=ee.state.directionalShadowMap,rt.directionalShadowMatrix.value=ee.state.directionalShadowMatrix,rt.spotShadowMap.value=ee.state.spotShadowMap,rt.spotLightMatrix.value=ee.state.spotLightMatrix,rt.spotLightMap.value=ee.state.spotLightMap,rt.pointShadowMap.value=ee.state.pointShadowMap,rt.pointShadowMatrix.value=ee.state.pointShadowMatrix),ae.currentProgram=at,ae.uniformsList=null,at}function em(O){if(O.uniformsList===null){const Z=O.currentProgram.getUniforms();O.uniformsList=Vg.seqWithValue(Z.seq,O.uniforms)}return O.uniformsList}function tm(O,Z){const se=ze.get(O);se.outputColorSpace=Z.outputColorSpace,se.batching=Z.batching,se.batchingColor=Z.batchingColor,se.instancing=Z.instancing,se.instancingColor=Z.instancingColor,se.instancingMorph=Z.instancingMorph,se.skinning=Z.skinning,se.morphTargets=Z.morphTargets,se.morphNormals=Z.morphNormals,se.morphColors=Z.morphColors,se.morphTargetsCount=Z.morphTargetsCount,se.numClippingPlanes=Z.numClippingPlanes,se.numIntersection=Z.numClipIntersection,se.vertexAlphas=Z.vertexAlphas,se.vertexTangents=Z.vertexTangents,se.toneMapping=Z.toneMapping}function gx(O,Z,se,ae,ee){Z.isScene!==!0&&(Z=ct),He.resetTextureUnits();const Pe=Z.fog,Ne=ae.isMeshStandardMaterial?Z.environment:null,Qe=R===null?S.outputColorSpace:R.isXRRenderTarget===!0?R.texture.colorSpace:ia,Ye=(ae.isMeshStandardMaterial?D:W).get(ae.envMap||Ne),st=ae.vertexColors===!0&&!!se.attributes.color&&se.attributes.color.itemSize===4,at=!!se.attributes.tangent&&(!!ae.normalMap||ae.anisotropy>0),rt=!!se.morphAttributes.position,Ot=!!se.morphAttributes.normal,$t=!!se.morphAttributes.color;let Xt=ho;ae.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(Xt=S.toneMapping);const Tn=se.morphAttributes.position||se.morphAttributes.normal||se.morphAttributes.color,nt=Tn!==void 0?Tn.length:0,Be=ze.get(ae),en=x.state.lights;if(ne===!0&&(fe===!0||O!==b)){const yi=O===b&&ae.id===B;pt.setState(ae,O,yi)}let ht=!1;ae.version===Be.__version?(Be.needsLights&&Be.lightsStateVersion!==en.state.version||Be.outputColorSpace!==Qe||ee.isBatchedMesh&&Be.batching===!1||!ee.isBatchedMesh&&Be.batching===!0||ee.isBatchedMesh&&Be.batchingColor===!0&&ee.colorTexture===null||ee.isBatchedMesh&&Be.batchingColor===!1&&ee.colorTexture!==null||ee.isInstancedMesh&&Be.instancing===!1||!ee.isInstancedMesh&&Be.instancing===!0||ee.isSkinnedMesh&&Be.skinning===!1||!ee.isSkinnedMesh&&Be.skinning===!0||ee.isInstancedMesh&&Be.instancingColor===!0&&ee.instanceColor===null||ee.isInstancedMesh&&Be.instancingColor===!1&&ee.instanceColor!==null||ee.isInstancedMesh&&Be.instancingMorph===!0&&ee.morphTexture===null||ee.isInstancedMesh&&Be.instancingMorph===!1&&ee.morphTexture!==null||Be.envMap!==Ye||ae.fog===!0&&Be.fog!==Pe||Be.numClippingPlanes!==void 0&&(Be.numClippingPlanes!==pt.numPlanes||Be.numIntersection!==pt.numIntersection)||Be.vertexAlphas!==st||Be.vertexTangents!==at||Be.morphTargets!==rt||Be.morphNormals!==Ot||Be.morphColors!==$t||Be.toneMapping!==Xt||Be.morphTargetsCount!==nt)&&(ht=!0):(ht=!0,Be.__version=ae.version);let tn=Be.currentProgram;ht===!0&&(tn=Xc(ae,Z,ee));let $i=!1,kn=!1,ri=!1;const ln=tn.getUniforms(),Ms=Be.uniforms;if(de.useProgram(tn.program)&&($i=!0,kn=!0,ri=!0),ae.id!==B&&(B=ae.id,kn=!0),$i||b!==O){ln.setValue(N,"projectionMatrix",O.projectionMatrix),ln.setValue(N,"viewMatrix",O.matrixWorldInverse);const yi=ln.map.cameraPosition;yi!==void 0&&yi.setValue(N,Me.setFromMatrixPosition(O.matrixWorld)),Le.logarithmicDepthBuffer&&ln.setValue(N,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ae.isMeshPhongMaterial||ae.isMeshToonMaterial||ae.isMeshLambertMaterial||ae.isMeshBasicMaterial||ae.isMeshStandardMaterial||ae.isShaderMaterial)&&ln.setValue(N,"isOrthographic",O.isOrthographicCamera===!0),b!==O&&(b=O,kn=!0,ri=!0)}if(ee.isSkinnedMesh){ln.setOptional(N,ee,"bindMatrix"),ln.setOptional(N,ee,"bindMatrixInverse");const yi=ee.skeleton;yi&&(yi.boneTexture===null&&yi.computeBoneTexture(),ln.setValue(N,"boneTexture",yi.boneTexture,He))}ee.isBatchedMesh&&(ln.setOptional(N,ee,"batchingTexture"),ln.setValue(N,"batchingTexture",ee._matricesTexture,He),ln.setOptional(N,ee,"batchingIdTexture"),ln.setValue(N,"batchingIdTexture",ee._indirectTexture,He),ln.setOptional(N,ee,"batchingColorTexture"),ee._colorsTexture!==null&&ln.setValue(N,"batchingColorTexture",ee._colorsTexture,He));const Jc=se.morphAttributes;if((Jc.position!==void 0||Jc.normal!==void 0||Jc.color!==void 0)&&Pt.update(ee,se,tn),(kn||Be.receiveShadow!==ee.receiveShadow)&&(Be.receiveShadow=ee.receiveShadow,ln.setValue(N,"receiveShadow",ee.receiveShadow)),ae.isMeshGouraudMaterial&&ae.envMap!==null&&(Ms.envMap.value=Ye,Ms.flipEnvMap.value=Ye.isCubeTexture&&Ye.isRenderTargetTexture===!1?-1:1),ae.isMeshStandardMaterial&&ae.envMap===null&&Z.environment!==null&&(Ms.envMapIntensity.value=Z.environmentIntensity),kn&&(ln.setValue(N,"toneMappingExposure",S.toneMappingExposure),Be.needsLights&&yx(Ms,ri),Pe&&ae.fog===!0&&et.refreshFogUniforms(Ms,Pe),et.refreshMaterialUniforms(Ms,ae,te,J,x.state.transmissionRenderTarget[O.id]),Vg.upload(N,em(Be),Ms,He)),ae.isShaderMaterial&&ae.uniformsNeedUpdate===!0&&(Vg.upload(N,em(Be),Ms,He),ae.uniformsNeedUpdate=!1),ae.isSpriteMaterial&&ln.setValue(N,"center",ee.center),ln.setValue(N,"modelViewMatrix",ee.modelViewMatrix),ln.setValue(N,"normalMatrix",ee.normalMatrix),ln.setValue(N,"modelMatrix",ee.matrixWorld),ae.isShaderMaterial||ae.isRawShaderMaterial){const yi=ae.uniformsGroups;for(let Yc=0,_r=yi.length;Yc<_r;Yc++){const nm=yi[Yc];qt.update(nm,tn),qt.bind(nm,tn)}}return tn}function yx(O,Z){O.ambientLightColor.needsUpdate=Z,O.lightProbe.needsUpdate=Z,O.directionalLights.needsUpdate=Z,O.directionalLightShadows.needsUpdate=Z,O.pointLights.needsUpdate=Z,O.pointLightShadows.needsUpdate=Z,O.spotLights.needsUpdate=Z,O.spotLightShadows.needsUpdate=Z,O.rectAreaLights.needsUpdate=Z,O.hemisphereLights.needsUpdate=Z}function _x(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return R},this.setRenderTargetTextures=function(O,Z,se){ze.get(O.texture).__webglTexture=Z,ze.get(O.depthTexture).__webglTexture=se;const ae=ze.get(O);ae.__hasExternalTextures=!0,ae.__autoAllocateDepthBuffer=se===void 0,ae.__autoAllocateDepthBuffer||Ae.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ae.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(O,Z){const se=ze.get(O);se.__webglFramebuffer=Z,se.__useDefaultFramebuffer=Z===void 0},this.setRenderTarget=function(O,Z=0,se=0){R=O,w=Z,T=se;let ae=!0,ee=null,Pe=!1,Ne=!1;if(O){const Ye=ze.get(O);Ye.__useDefaultFramebuffer!==void 0?(de.bindFramebuffer(N.FRAMEBUFFER,null),ae=!1):Ye.__webglFramebuffer===void 0?He.setupRenderTarget(O):Ye.__hasExternalTextures&&He.rebindTextures(O,ze.get(O.texture).__webglTexture,ze.get(O.depthTexture).__webglTexture);const st=O.texture;(st.isData3DTexture||st.isDataArrayTexture||st.isCompressedArrayTexture)&&(Ne=!0);const at=ze.get(O).__webglFramebuffer;
3857O.isWebGLCubeRenderTarget?(Array.isArray(at[Z])?ee=at[Z][se]:ee=at[Z],Pe=!0):O.samples>0&&He.useMultisampledRTT(O)===!1?ee=ze.get(O).__webglMultisampledFramebuffer:Array.isArray(at)?ee=at[se]:ee=at,P.copy(O.viewport),L.copy(O.scissor),U=O.scissorTest}else P.copy($).multiplyScalar(te).floor(),L.copy(oe).multiplyScalar(te).floor(),U=xe;if(de.bindFramebuffer(N.FRAMEBUFFER,ee)&&ae&&de.drawBuffers(O,ee),de.viewport(P),de.scissor(L),de.setScissorTest(U),Pe){const Ye=ze.get(O.texture);N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_CUBE_MAP_POSITIVE_X+Z,Ye.__webglTexture,se)}else if(Ne){const Ye=ze.get(O.texture),st=Z||0;N.framebufferTextureLayer(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,Ye.__webglTexture,se||0,st)}B=-1},this.readRenderTargetPixels=function(O,Z,se,ae,ee,Pe,Ne){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Qe=ze.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Ne!==void 0&&(Qe=Qe[Ne]),Qe){de.bindFramebuffer(N.FRAMEBUFFER,Qe);try{const Ye=O.texture,st=Ye.format,at=Ye.type;if(!Le.textureFormatReadable(st)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Le.textureTypeReadable(at)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Z>=0&&Z<=O.width-ae&&se>=0&&se<=O.height-ee&&N.readPixels(Z,se,ae,ee,dt.convert(st),dt.convert(at),Pe)}finally{const Ye=R!==null?ze.get(R).__webglFramebuffer:null;de.bindFramebuffer(N.FRAMEBUFFER,Ye)}}},this.readRenderTargetPixelsAsync=async function(O,Z,se,ae,ee,Pe,Ne){if(!(O&&O.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Qe=ze.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Ne!==void 0&&(Qe=Qe[Ne]),Qe){de.bindFramebuffer(N.FRAMEBUFFER,Qe);try{const Ye=O.texture,st=Ye.format,at=Ye.type;if(!Le.textureFormatReadable(st))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Le.textureTypeReadable(at))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(Z>=0&&Z<=O.width-ae&&se>=0&&se<=O.height-ee){const rt=N.createBuffer();N.bindBuffer(N.PIXEL_PACK_BUFFER,rt),N.bufferData(N.PIXEL_PACK_BUFFER,Pe.byteLength,N.STREAM_READ),N.readPixels(Z,se,ae,ee,dt.convert(st),dt.convert(at),0),N.flush();const Ot=N.fenceSync(N.SYNC_GPU_COMMANDS_COMPLETE,0);await iN(N,Ot,4);try{N.bindBuffer(N.PIXEL_PACK_BUFFER,rt),N.getBufferSubData(N.PIXEL_PACK_BUFFER,0,Pe)}finally{N.deleteBuffer(rt),N.deleteSync(Ot)}return Pe}}finally{const Ye=R!==null?ze.get(R).__webglFramebuffer:null;de.bindFramebuffer(N.FRAMEBUFFER,Ye)}}},this.copyFramebufferToTexture=function(O,Z=null,se=0){O.isTexture!==!0&&(console.warn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),Z=arguments[0]||null,O=arguments[1]);const ae=Math.pow(2,-se),ee=Math.floor(O.image.width*ae),Pe=Math.floor(O.image.height*ae),Ne=Z!==null?Z.x:0,Qe=Z!==null?Z.y:0;He.setTexture2D(O,0),N.copyTexSubImage2D(N.TEXTURE_2D,se,0,0,Ne,Qe,ee,Pe),de.unbindTexture()},this.copyTextureToTexture=function(O,Z,se=null,ae=null,ee=0){O.isTexture!==!0&&(console.warn("WebGLRenderer: copyTextureToTexture function signature has changed."),ae=arguments[0]||null,O=arguments[1],Z=arguments[2],ee=arguments[3]||0,se=null);let Pe,Ne,Qe,Ye,st,at;se!==null?(Pe=se.max.x-se.min.x,Ne=se.max.y-se.min.y,Qe=se.min.x,Ye=se.min.y):(Pe=O.image.width,Ne=O.image.height,Qe=0,Ye=0),ae!==null?(st=ae.x,at=ae.y):(st=0,at=0);const rt=dt.convert(Z.format),Ot=dt.convert(Z.type);He.setTexture2D(Z,0),N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,Z.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,Z.unpackAlignment);const $t=N.getParameter(N.UNPACK_ROW_LENGTH),Xt=N.getParameter(N.UNPACK_IMAGE_HEIGHT),Tn=N.getParameter(N.UNPACK_SKIP_PIXELS),nt=N.getParameter(N.UNPACK_SKIP_ROWS),Be=N.getParameter(N.UNPACK_SKIP_IMAGES),en=O.isCompressedTexture?O.mipmaps[ee]:O.image;N.pixelStorei(N.UNPACK_ROW_LENGTH,en.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,en.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,Qe),N.pixelStorei(N.UNPACK_SKIP_ROWS,Ye),O.isDataTexture?N.texSubImage2D(N.TEXTURE_2D,ee,st,at,Pe,Ne,rt,Ot,en.data):O.isCompressedTexture?N.compressedTexSubImage2D(N.TEXTURE_2D,ee,st,at,en.width,en.height,rt,en.data):N.texSubImage2D(N.TEXTURE_2D,ee,st,at,Pe,Ne,rt,Ot,en),N.pixelStorei(N.UNPACK_ROW_LENGTH,$t),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,Xt),N.pixelStorei(N.UNPACK_SKIP_PIXELS,Tn),N.pixelStorei(N.UNPACK_SKIP_ROWS,nt),N.pixelStorei(N.UNPACK_SKIP_IMAGES,Be),ee===0&&Z.generateMipmaps&&N.generateMipmap(N.TEXTURE_2D),de.unbindTexture()},this.copyTextureToTexture3D=function(O,Z,se=null,ae=null,ee=0){O.isTexture!==!0&&(console.warn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),se=arguments[0]||null,ae=arguments[1]||null,O=arguments[2],Z=arguments[3],ee=arguments[4]||0);let Pe,Ne,Qe,Ye,st,at,rt,Ot,$t;const Xt=O.isCompressedTexture?O.mipmaps[ee]:O.image;se!==null?(Pe=se.max.x-se.min.x,Ne=se.max.y-se.min.y,Qe=se.max.z-se.min.z,Ye=se.min.x,st=se.min.y,at=se.min.z):(Pe=Xt.width,Ne=Xt.height,Qe=Xt.depth,Ye=0,st=0,at=0),ae!==null?(rt=ae.x,Ot=ae.y,$t=ae.z):(rt=0,Ot=0,$t=0);const Tn=dt.convert(Z.format),nt=dt.convert(Z.type);let Be;if(Z.isData3DTexture)He.setTexture3D(Z,0),Be=N.TEXTURE_3D;else if(Z.isDataArrayTexture||Z.isCompressedArrayTexture)He.setTexture2DArray(Z,0),Be=N.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,Z.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,Z.unpackAlignment);const en=N.getParameter(N.UNPACK_ROW_LENGTH),ht=N.getParameter(N.UNPACK_IMAGE_HEIGHT),tn=N.getParameter(N.UNPACK_SKIP_PIXELS),$i=N.getParameter(N.UNPACK_SKIP_ROWS),kn=N.getParameter(N.UNPACK_SKIP_IMAGES);N.pixelStorei(N.UNPACK_ROW_LENGTH,Xt.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,Xt.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,Ye),N.pixelStorei(N.UNPACK_SKIP_ROWS,st),N.pixelStorei(N.UNPACK_SKIP_IMAGES,at),O.isDataTexture||O.isData3DTexture?N.texSubImage3D(Be,ee,rt,Ot,$t,Pe,Ne,Qe,Tn,nt,Xt.data):Z.isCompressedArrayTexture?N.compressedTexSubImage3D(Be,ee,rt,Ot,$t,Pe,Ne,Qe,Tn,Xt.data):N.texSubImage3D(Be,ee,rt,Ot,$t,Pe,Ne,Qe,Tn,nt,Xt),N.pixelStorei(N.UNPACK_ROW_LENGTH,en),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,ht),N.pixelStorei(N.UNPACK_SKIP_PIXELS,tn),N.pixelStorei(N.UNPACK_SKIP_ROWS,$i),N.pixelStorei(N.UNPACK_SKIP_IMAGES,kn),ee===0&&Z.generateMipmaps&&N.generateMipmap(Be),de.unbindTexture()},this.initRenderTarget=function(O){ze.get(O).__webglFramebuffer===void 0&&He.setupRenderTarget(O)},this.initTexture=function(O){O.isCubeTexture?He.setTextureCube(O,0):O.isData3DTexture?He.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?He.setTexture2DArray(O,0):He.setTexture2D(O,0),de.unbindTexture()},this.resetState=function(){w=0,T=0,R=null,de.reset(),Et.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return oo}get outputColorSpace(){return this._outputColorSpace}
vendor: 20,535 bytes, line 3857
3857set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===N_?"display-p3":"srgb",t.unpackColorSpace=Vt.workingColorSpace===zp?"display-p3":"srgb"}}class G_{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Re(e),this.density=t}clone(){return new G_(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}let FE=class tL{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Re(e),this.near=t,this.far=i}clone(){return new tL(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}};class Ky extends gt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ur,this.environmentIntensity=1,this.environmentRotation=new Ur,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Np{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=cp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=zr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return RE("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=zr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=zr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Wi=new z;class il{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Wi.fromBufferAttribute(this,t),Wi.applyMatrix4(e),this.setXYZ(t,Wi.x,Wi.y,Wi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Wi.fromBufferAttribute(this,t),Wi.applyNormalMatrix(e),this.setXYZ(t,Wi.x,Wi.y,Wi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Wi.fromBufferAttribute(this,t),Wi.transformDirection(e),this.setXYZ(t,Wi.x,Wi.y,Wi.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=Ji(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=At(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=At(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=At(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=At(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=At(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Ji(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ji(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ji(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ji(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=At(t,this.array),i=At(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array),s=At(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Lt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new il(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class OE extends Jn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Re(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Eu;const Ff=new z,wu=new z,Tu=new z,Cu=new ce,Of=new ce,nL=new Ke,L0=new z,Uf=new z,D0=new z,c3=new ce,v1=new ce,u3=new ce;class iL extends gt{constructor(e=new OE){if(super(),this.isSprite=!0,this.type="Sprite",Eu===void 0){Eu=new xt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new Np(t,5);Eu.setIndex([0,1,2,0,2,3]),Eu.setAttribute("position",new il(i,3,0,!1)),Eu.setAttribute("uv",new il(i,2,3,!1))}this.geometry=Eu,this.material=e,this.center=new ce(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),wu.setFromMatrixScale(this.matrixWorld),nL.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Tu.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&wu.multiplyScalar(-Tu.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;z0(L0.set(-.5,-.5,0),Tu,o,wu,r,s),z0(Uf.set(.5,-.5,0),Tu,o,wu,r,s),z0(D0.set(.5,.5,0),Tu,o,wu,r,s),c3.set(0,0),v1.set(1,0),u3.set(1,1);let a=e.ray.intersectTriangle(L0,Uf,D0,!1,Ff);if(a===null&&(z0(Uf.set(-.5,.5,0),Tu,o,wu,r,s),v1.set(0,1),a=e.ray.intersectTriangle(L0,D0,Uf,!1,Ff),a===null))return;const l=e.ray.origin.distanceTo(Ff);l<e.near||l>e.far||t.push({distance:l,point:Ff.clone(),uv:hi.getInterpolation(Ff,L0,Uf,D0,c3,v1,u3,new ce),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function z0(n,e,t,i,r,s){Cu.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Of.x=s*Cu.x-r*Cu.y,Of.y=r*Cu.x+s*Cu.y):Of.copy(Cu),n.copy(e),n.x+=Of.x,n.y+=Of.y,n.applyMatrix4(nL)}const F0=new z,h3=new z;class rL extends gt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=0){t=Math.abs(t);const r=this.levels;let s;for(s=0;s<r.length&&!(t<r[s].distance);s++);return r.splice(s,0,{distance:t,hysteresis:i,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r;i++){let s=t[i].distance;if(t[i].object.visible&&(s-=s*t[i].hysteresis),e<s)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){F0.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(F0);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){F0.setFromMatrixPosition(e.matrixWorld),h3.setFromMatrixPosition(this.matrixWorld);const i=F0.distanceTo(h3)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s;r++){let o=t[r].distance;if(t[r].object.visible&&(o-=o*t[r].hysteresis),i>=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}}const f3=new z,d3=new Wt,p3=new Wt,m9=new z,m3=new Ke,O0=new z,A1=new Nn,g3=new Ke,S1=new hl;class UE extends hn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=wS,this.bindMatrix=new Ke,this.bindMatrixInverse=new Ke,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Yt),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,O0),this.boundingBox.expandByPoint(O0)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Nn),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,O0),this.boundingSphere.expandByPoint(O0)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),A1.copy(this.boundingSphere),A1.applyMatrix4(r),e.ray.intersectsSphere(A1)!==!1&&(g3.copy(r).invert(),S1.copy(e.ray).applyMatrix4(g3),!(this.boundingBox!==null&&S1.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,S1)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Wt,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===wS?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===EI?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,r=this.geometry;d3.fromBufferAttribute(r.attributes.skinIndex,e),p3.fromBufferAttribute(r.attributes.skinWeight,e),f3.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=p3.getComponent(s);if(o!==0){const a=d3.getComponent(s);m3.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),t.addScaledVector(m9.copy(f3).applyMatrix4(m3),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class V_ extends gt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class po extends Zt{constructor(e=null,t=1,i=1,r,s,o,a,l,c=$n,u=$n,d,p){super(null,o,a,l,c,u,r,s,d,p),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const y3=new Ke,g9=new Ke;class kp{constructor(e=[],t=[]){this.uuid=zr(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Ke)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Ke;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:g9;y3.multiplyMatrices(a,t[s]),y3.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new kp(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new po(t,e,e,fi,lr);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new V_),this.bones.push(o),this.boneInverses.push(new Ke().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const a=i[r];e.boneInverses.push(a.toArray())}return e}}class Cc extends Lt{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ru=new Ke,_3=new Ke,U0=[],x3=new Yt,y9=new Ke,Nf=new hn,kf=new Nn;class NE extends hn{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Cc(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,y9)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Yt),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Ru),x3.copy(e.boundingBox).applyMatrix4(Ru),this.boundingBox.union(x3)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Nn),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Ru),kf.copy(e.boundingSphere).applyMatrix4(Ru),this.boundingSphere.union(kf)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const i=t.morphTargetInfluences,r=this.morphTexture.source.data.data,s=i.length+1,o=e*s+1;for(let a=0;a<i.length;a++)i[a]=r[o+a]}raycast(e,t){const i=this.matrixWorld,r=this.count;if(Nf.geometry=this.geometry,Nf.material=this.material,Nf.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),kf.copy(this.boundingSphere),kf.applyMatrix4(i),e.ray.intersectsSphere(kf)!==!1))for(let s=0;s<r;s++){this.getMatrixAt(s,Ru),_3.multiplyMatrices(i,Ru),Nf.matrixWorld=_3,Nf.raycast(e,U0);for(let o=0,a=U0.length;o<a;o++){const l=U0[o];l.instanceId=s,l.object=this,t.push(l)}U0.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Cc(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const i=t.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new po(new Float32Array(r*this.count),r,this.count,z_,lr));const s=this.morphTexture.source.data.data;let o=0;for(let c=0;c<i.length;c++)o+=i[c];const a=this.geometry.morphTargetsRelative?1:1-o,l=r*e;s[l]=a,s.set(i,l+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}function _9(n,e){return n.z-e.z}function x9(n,e){return e.z-n.z}class v9{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i){const r=this.pool,s=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}}const Ma=new Ke,M1=new Ke,A9=new Ke,S9=new Re(1,1,1),v3=new Ke,E1=new Up,N0=new Yt,Il=new Nn,Hf=new z,A3=new z,M9=new z,w1=new v9,Ii=new hn,k0=[];function E9(n,e,t=0){const i=e.itemSize;
3857if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s<r;s++)for(let o=0;o<i;o++)e.setComponent(s+t,o,n.getComponent(s,o))}else e.array.set(n.array,t*i);e.needsUpdate=!0}class sL extends hn{get maxInstanceCount(){return this._maxInstanceCount}constructor(e,t,i=t*2,r){super(new xt,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawInfo=[],this._drawRanges=[],this._reservedRanges=[],this._bounds=[],this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=i,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._visibilityChanged=!0,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),i=new po(t,e,e,fi,lr);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),i=new po(t,e,e,Dp,Zo);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxIndexCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),i=new po(t,e,e,fi,lr);
3857i.colorSpace=Vt.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){const t=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const s in e.attributes){const o=e.getAttribute(s),{array:a,itemSize:l,normalized:c}=o,u=new a.constructor(i*l),d=new Lt(u,l,c);t.setAttribute(s,d)}if(e.getIndex()!==null){const s=i>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Lt(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Yt);const e=this._geometryCount,t=this.boundingBox,i=this._drawInfo;t.makeEmpty();for(let r=0;r<e;r++){if(i[r].active===!1)continue;const s=i[r].geometryIndex;this.getMatrixAt(r,Ma),this.getBoundingBoxAt(s,N0).applyMatrix4(Ma),t.union(N0)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Nn);const e=this.boundingSphere,t=this._drawInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;const s=t[i].geometryIndex;this.getMatrixAt(i,Ma),this.getBoundingSphereAt(s,Il).applyMatrix4(Ma),e.union(Il)}}addInstance(e){if(this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:e});const t=this._drawInfo.length-1,i=this._matricesTexture,r=i.image.data;A9.toArray(r,t*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(S9.toArray(s.image.data,t*4),s.needsUpdate=!0),t}addGeometry(e,t=-1,i=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=e.getIndex(),u=c!==null;if(u&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const d=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:u?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Yt,sphereInitialized:!1,sphere:new Nn}),this.setGeometryAt(d,e),d}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const m in i.attributes){const y=t.getAttribute(m),_=i.getAttribute(m);E9(y,_,l);const x=y.itemSize;for(let g=y.count,v=c;g<v;g++){const S=l+g;for(let M=0;M<x;M++)_.setComponent(S,M,0)}_.needsUpdate=!0,_.addUpdateRange(l*x,c*x)}if(r){const m=a.indexStart;for(let y=0;y<o.count;y++)s.setX(m+y,l+o.getX(y));for(let y=o.count,_=a.indexCount;y<_;y++)s.setX(m+y,l);s.needsUpdate=!0,s.addUpdateRange(m,a.indexCount)}const u=this._bounds[e];t.boundingBox!==null?(u.box.copy(t.boundingBox),u.boxInitialized=!0):u.boxInitialized=!1,t.boundingSphere!==null?(u.sphere.copy(t.boundingSphere),u.sphereInitialized=!0):u.sphereInitialized=!1;const d=this._drawRanges[e],p=t.getAttribute("position");return d.count=r?o.count:p.count,this._visibilityChanged=!0,e}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let c=l.start,u=l.start+l.count;c<u;c++){let d=c;o&&(d=o.getX(d)),r.expandByPoint(Hf.fromBufferAttribute(a,d))}i.boxInitialized=!0}return t.copy(r),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,N0),N0.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let c=0;for(let u=l.start,d=l.start+l.count;u<d;u++){let p=u;o&&(p=o.getX(p)),Hf.fromBufferAttribute(a,p),c=Math.max(c,r.center.distanceToSquared(Hf))}r.radius=Math.sqrt(c),i.sphereInitialized=!0}return t.copy(r),t}setMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture,s=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;Ii.material=this.material,Ii.geometry.index=o.index,Ii.geometry.attributes=o.attributes,Ii.geometry.boundingBox===null&&(Ii.geometry.boundingBox=new Yt),Ii.geometry.boundingSphere===null&&(Ii.geometry.boundingSphere=new Nn);for(let a=0,l=i.length;a<l;a++){if(!i[a].visible||!i[a].active)continue;const c=i[a].geometryIndex,u=r[c];Ii.geometry.setDrawRange(u.start,u.count),this.getMatrixAt(a,Ii.matrixWorld).premultiply(s),this.getBoundingBoxAt(c,Ii.geometry.boundingBox),this.getBoundingSphereAt(c,Ii.geometry.boundingSphere),Ii.raycast(e,k0);for(let d=0,p=k0.length;d<p;d++){const m=k0[d];m.object=this,m.batchId=a,t.push(m)}k0.length=0}Ii.material=null,Ii.geometry.index=null,Ii.geometry.attributes={},Ii.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._drawRanges=e._drawRanges.map(t=>({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._drawInfo=e._drawInfo.map(t=>({...t})),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,d=this._drawRanges,p=this.perObjectFrustumCulled,m=this._indirectTexture,y=m.image.data;p&&(v3.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),E1.setFromProjectionMatrix(v3,e.coordinateSystem));let _=0;if(this.sortObjects){M1.copy(this.matrixWorld).invert(),Hf.setFromMatrixPosition(i.matrixWorld).applyMatrix4(M1),A3.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(M1);for(let v=0,S=l.length;v<S;v++)if(l[v].visible&&l[v].active){const M=l[v].geometryIndex;this.getMatrixAt(v,Ma),this.getBoundingSphereAt(M,Il).applyMatrix4(Ma);let w=!1;if(p&&(w=!E1.intersectsSphere(Il)),!w){const T=M9.subVectors(Il.center,Hf).dot(A3);w1.push(d[M],T,v)}}const x=w1.list,g=this.customSort;g===null?x.sort(s.transparent?x9:_9):g.call(this,x,i);for(let v=0,S=x.length;v<S;v++){const M=x[v];c[_]=M.start*a,u[_]=M.count,y[_]=M.index,_++}w1.reset()}else for(let x=0,g=l.length;x<g;x++)if(l[x].visible&&l[x].active){const v=l[x].geometryIndex;let S=!1;
vendor: 5,454 bytes, line 3857
3857if(p&&(this.getMatrixAt(x,Ma),this.getBoundingSphereAt(v,Il).applyMatrix4(Ma),S=!E1.intersectsSphere(Il)),!S){const M=d[v];c[_]=M.start*a,u[_]=M.count,y[_]=x,_++}}m.needsUpdate=!0,this._multiDrawCount=_,this._visibilityChanged=!1}onBeforeShadow(e,t,i,r,s,o){this.onBeforeRender(e,null,r,s,o)}}class ki extends Jn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Re(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Qy=new z,Zy=new z,S3=new Ke,Gf=new hl,H0=new Nn,T1=new z,M3=new z;class qo extends gt{constructor(e=new xt,t=new ki){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)Qy.fromBufferAttribute(t,r-1),Zy.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Qy.distanceTo(Zy);e.setAttribute("lineDistance",new qe(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),H0.copy(i.boundingSphere),H0.applyMatrix4(r),H0.radius+=s,e.ray.intersectsSphere(H0)===!1)return;S3.copy(r).invert(),Gf.copy(e.ray).applyMatrix4(S3);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=this.isLineSegments?2:1,u=i.index,p=i.attributes.position;if(u!==null){const m=Math.max(0,o.start),y=Math.min(u.count,o.start+o.count);for(let _=m,x=y-1;_<x;_+=c){const g=u.getX(_),v=u.getX(_+1),S=G0(this,e,Gf,l,g,v);S&&t.push(S)}if(this.isLineLoop){const _=u.getX(y-1),x=u.getX(m),g=G0(this,e,Gf,l,_,x);g&&t.push(g)}}else{const m=Math.max(0,o.start),y=Math.min(p.count,o.start+o.count);for(let _=m,x=y-1;_<x;_+=c){const g=G0(this,e,Gf,l,_,_+1);g&&t.push(g)}if(this.isLineLoop){const _=G0(this,e,Gf,l,y-1,m);_&&t.push(_)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function G0(n,e,t,i,r,s){const o=n.geometry.attributes.position;if(Qy.fromBufferAttribute(o,r),Zy.fromBufferAttribute(o,s),t.distanceSqToSegment(Qy,Zy,T1,M3)>i)return;T1.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(T1);if(!(l<e.near||l>e.far))return{distance:l,point:M3.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const E3=new z,w3=new z;class Hs extends qo{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)E3.fromBufferAttribute(t,r),w3.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+E3.distanceTo(w3);e.setAttribute("lineDistance",new qe(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class kE extends qo{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class W_ extends Jn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Re(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const T3=new Ke,BS=new hl,V0=new Nn,W0=new z;class HE extends gt{constructor(e=new xt,t=new W_){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),V0.copy(i.boundingSphere),V0.applyMatrix4(r),V0.radius+=s,e.ray.intersectsSphere(V0)===!1)return;T3.copy(r).invert(),BS.copy(e.ray).applyMatrix4(T3);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=i.index,d=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),m=Math.min(c.count,o.start+o.count);for(let y=p,_=m;y<_;y++){const x=c.getX(y);W0.fromBufferAttribute(d,x),C3(W0,x,l,r,e,t,this)}}else{const p=Math.max(0,o.start),m=Math.min(d.count,o.start+o.count);for(let y=p,_=m;y<_;y++)W0.fromBufferAttribute(d,y),C3(W0,y,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function C3(n,e,t,i,r,s,o){const a=BS.distanceSqToPoint(n);if(a<t){const l=new z;
vendor: 10,135 bytes, line 3857
3857BS.closestPointToPoint(n,l),l.applyMatrix4(i);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class w9 extends Zt{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:gn,this.magFilter=s!==void 0?s:gn,this.generateMipmaps=!1;const u=this;function d(){u.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class T9 extends Zt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=$n,this.minFilter=$n,this.generateMipmaps=!1,this.needsUpdate=!0}}class j_ extends Zt{constructor(e,t,i,r,s,o,a,l,c,u,d,p){super(null,o,a,l,c,u,r,s,d,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class C9 extends j_{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Br,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class R9 extends j_{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Qo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class b9 extends Zt{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Gs{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],p=i[r+1]-u,m=(o-u)/p;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new ce:new z);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new z,r=[],s=[],o=[],a=new z,l=new Ke;for(let m=0;m<=e;m++){const y=m/e;r[m]=this.getTangentAt(y,new z)}s[0]=new z,o[0]=new z;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),d<=c&&(c=d,i.set(0,1,0)),p<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const y=Math.acos(Bn(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,y))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos(Bn(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let y=1;y<=e;y++)s[y].applyMatrix4(l.makeRotationAxis(r[y],m*y)),o[y].crossVectors(r[y],s[y])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class X_ extends Gs{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new ce){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const a=this.aStartAngle+e*s;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const u=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=l-this.aX,m=c-this.aY;l=p*u-m*d+this.aX,c=p*d+m*u+this.aY}return i.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class oL extends X_{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function GE(){let n=0,e=0,t=0,i=0;function r(s,o,a,l){n=s,e=a,t=-3*s+3*o-2*a-l,i=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,c){r(o,a,c*(a-s),c*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,c,u,d){let p=(o-s)/c-(a-s)/(c+u)+(a-o)/u,m=(a-o)/u-(l-o)/(u+d)+(l-a)/d;p*=u,m*=u,r(o,a,p,m)},calc:function(s){const o=s*s,a=o*s;return n+e*s+t*o+i*a}}}const j0=new z,C1=new GE,R1=new GE,b1=new GE;class Hp extends Gs{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new z){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(j0.subVectors(r[0],r[1]).add(r[0]),c=j0);const d=r[a%s],p=r[(a+1)%s];if(this.closed||a+2<s?u=r[(a+2)%s]:(j0.subVectors(r[s-1],r[s-2]).add(r[s-1]),u=j0),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let y=Math.pow(c.distanceToSquared(d),m),_=Math.pow(d.distanceToSquared(p),m),x=Math.pow(p.distanceToSquared(u),m);_<1e-4&&(_=1),y<1e-4&&(y=_),x<1e-4&&(x=_),C1.initNonuniformCatmullRom(c.x,d.x,p.x,u.x,y,_,x),R1.initNonuniformCatmullRom(c.y,d.y,p.y,u.y,y,_,x),b1.initNonuniformCatmullRom(c.z,d.z,p.z,u.z,y,_,x)}else this.curveType==="catmullrom"&&(C1.initCatmullRom(c.x,d.x,p.x,u.x,this.tension),R1.initCatmullRom(c.y,d.y,p.y,u.y,this.tension),b1.initCatmullRom(c.z,d.z,p.z,u.z,this.tension));return i.set(C1.calc(l),R1.calc(l),b1.calc(l)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new z().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function R3(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,a=n*n,l=n*a;return(2*t-2*i+s+o)*l+(-3*t+3*i-2*s-o)*a+s*n+t}function P9(n,e){const t=1-n;return t*t*e}function B9(n,e){return 2*(1-n)*n*e}function I9(n,e){return n*n*e}function Id(n,e,t,i){return P9(n,e)+B9(n,t)+I9(n,i)}function L9(n,e){const t=1-n;return t*t*t*e}function D9(n,e){const t=1-n;return 3*t*t*n*e}function z9(n,e){return 3*(1-n)*n*n*e}function F9(n,e){return n*n*n*e}function Ld(n,e,t,i,r){return L9(n,e)+D9(n,t)+z9(n,i)+F9(n,r)}class VE extends Gs{constructor(e=new ce,t=new ce,i=new ce,r=new ce){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new ce){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(Ld(e,r.x,s.x,o.x,a.x),Ld(e,r.y,s.y,o.y,a.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class aL extends Gs{constructor(e=new z,t=new z,i=new z,r=new z){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new z){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(Ld(e,r.x,s.x,o.x,a.x),Ld(e,r.y,s.y,o.y,a.y),Ld(e,r.z,s.z,o.z,a.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class WE extends Gs{constructor(e=new ce,t=new ce){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new ce){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 4,414 bytes, line 3857
3857getTangent(e,t=new ce){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class lL extends Gs{constructor(e=new z,t=new z){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new z){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new z){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class jE extends Gs{constructor(e=new ce,t=new ce,i=new ce){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new ce){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(Id(e,r.x,s.x,o.x),Id(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class XE extends Gs{constructor(e=new z,t=new z,i=new z){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new z){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(Id(e,r.x,s.x,o.x),Id(e,r.y,s.y,o.y),Id(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class JE extends Gs{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new ce){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],c=r[o],u=r[o>r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(R3(a,l.x,c.x,u.x,d.x),R3(a,l.y,c.y,u.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new ce().fromArray(r))}return this}}var qy=Object.freeze({__proto__:null,ArcCurve:oL,CatmullRomCurve3:Hp,CubicBezierCurve:VE,CubicBezierCurve3:aL,EllipseCurve:X_,LineCurve:WE,LineCurve3:lL,QuadraticBezierCurve:jE,QuadraticBezierCurve3:XE,SplineCurve:JE});class cL extends Gs{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new qy[i](t,e))}return this}getPoint(e,t){const i=e*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isS
vendor: 6,555 bytes, line 3857
3857plineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){const u=l[c];i&&i.equals(u)||(t.push(u),i=u)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new qy[r.type]().fromJSON(r))}return this}}class dp extends cL{constructor(e){super(),this.type="Path",this.currentPoint=new ce,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new WE(this.currentPoint.clone(),new ce(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new jE(this.currentPoint.clone(),new ce(e,t),new ce(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const a=new VE(this.currentPoint.clone(),new ce(e,t),new ce(i,r),new ce(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new JE(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,a,l){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+c,t+u,i,r,s,o,a,l),this}absellipse(e,t,i,r,s,o,a,l){const c=new X_(e,t,i,r,s,o,a,l);if(this.curves.length>0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Gp extends xt{constructor(e=[new ce(0,-.5),new ce(.5,0),new ce(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=Bn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,d=new z,p=new ce,m=new z,y=new z,_=new z;let x=0,g=0;for(let v=0;v<=e.length-1;v++)switch(v){case 0:x=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,m.x=g*1,m.y=-x,m.z=g*0,_.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:x=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,m.x=g*1,m.y=-x,m.z=g*0,y.copy(m),m.x+=_.x,m.y+=_.y,m.z+=_.z,m.normalize(),l.push(m.x,m.y,m.z),_.copy(y)}for(let v=0;v<=t;v++){const S=i+v*u*r,M=Math.sin(S),w=Math.cos(S);for(let T=0;T<=e.length-1;T++){d.x=e[T].x*M,d.y=e[T].y,d.z=e[T].x*w,o.push(d.x,d.y,d.z),p.x=v/t,p.y=T/(e.length-1),a.push(p.x,p.y);const R=l[3*T+0]*M,B=l[3*T+1],b=l[3*T+0]*w;c.push(R,B,b)}}for(let v=0;v<t;v++)for(let S=0;S<e.length-1;S++){const M=S+v*e.length,w=M,T=M+e.length,R=M+e.length+1,B=M+1;s.push(w,T,B),s.push(R,B,T)}this.setIndex(s),this.setAttribute("position",new qe(o,3)),this.setAttribute("uv",new qe(a,2)),this.setAttribute("normal",new qe(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Gp(e.points,e.segments,e.phiStart,e.phiLength)}}class J_ extends Gp{constructor(e=1,t=1,i=4,r=8){const s=new dp;s.absarc(0,-t/2,e,Math.PI*1.5,0),s.absarc(0,t/2,e,0,Math.PI*.5),super(s.getPoints(i),r),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:i,radialSegments:r}}static fromJSON(e){return new J_(e.radius,e.length,e.capSegments,e.radialSegments)}}class Y_ extends xt{constructor(e=1,t=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],a=[],l=[],c=new z,u=new ce;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const m=i+d/t*r;c.x=e*Math.cos(m),c.y=e*Math.sin(m),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[p]/e+1)/2,u.y=(o[p+1]/e+1)/2,l.push(u.x,u.y)}for(let d=1;d<=t;d++)s.push(d,d+1,0);this.setIndex(s),this.setAttribute("position",new qe(o,3)),this.setAttribute("normal",new qe(a,3)),this.setAttribute("uv",new qe(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Y_(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class qh extends xt{constructor(e=1,t=1,i=1,r=32,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};const c=this;r=Math.floor(r),s=Math.floor(s);const u=[],d=[],p=[],m=[];let y=0;const _=[],x=i/2;let g=0;v(),o===!1&&(e>0&&S(!0),t>0&&S(!1)),this.setIndex(u),this.setAttribute("position",new qe(d,3)),this.setAttribute("normal",new qe(p,3)),this.setAttribute("uv",new qe(m,2));function v(){const M=new z,w=new z;let T=0;const R=(t-e)/i;for(let B=0;B<=s;B++){const b=[],P=B/s,L=P*(t-e)+e;for(let U=0;U<=r;U++){const G=U/r,j=G*l+a,X=Math.sin(j),J=Math.cos(j);w.x=L*X,w.y=-P*i+x,w.z=L*J,d.push(w.x,w.y,w.z),M.set(X,R,J).normalize(),p.push(M.x,M.y,M.z),m.push(G,1-P),b.push(y++)}_.push(b)}for(let B=0;B<r;B++)for(let b=0;b<s;b++){const P=_[b][B],L=_[b+1][B],U=_[b+1][B+1],G=_[b][B+1];u.push(P,L,G),u.push(L,U,G),T+=6}c.addGroup(g,T,0),g+=T}function S(M){const w=y,T=new ce,R=new z;let B=0;const b=M===!0?e:t,P=M===!0?1:-1;for(let U=1;U<=r;U++)d.push(0,x*P,0),p.push(0,P,0),m.push(.5,.5),y++;const L=y;for(let U=0;U<=r;U++){const j=U/r*l+a,X=Math.cos(j),J=Math.sin(j);R.x=b*J,R.y=x*P,R.z=b*X,d.push(R.x,R.y,R.z),p.push(0,P,0),T.x=X*.5+.5,T.y=J*.5*P+.5,m.push(T.x,T.y),y++}for(let U=0;U<r;U++){const G=w+U,j=L+U;M===!0?u.push(j,j+1,G):u.push(j+1,j,G),B+=3}c.addGroup(g,B,M===!0?1:2),g+=B}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qh(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class K_ extends qh{constructor(e=1,t=1,i=32,r=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,i,r,s,o,a),this.type="C
3857oneGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new K_(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class fl extends xt{constructor(e=[],t=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];a(r),c(i),u(),this.setAttribute("position",new qe(s,3)),this.setAttribute("normal",new qe(s.slice(),3)),this.setAttribute("uv",new qe(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function a(v){const S=new z,M=new z,w=new z;for(let T=0;T<t.length;T+=3)m(t[T+0],S),m(t[T+1],M),m(t[T+2],w),l(S,M,w,v)}function l(v,S,M,w){const T=w+1,R=[];for(let B=0;B<=T;B++){R[B]=[];const b=v.clone().lerp(M,B/T),P=S.clone().lerp(M,B/T),L=T-B;for(let U=0;U<=L;U++)U===0&&B===T?R[B][U]=b:R[B][U]=b.clone().lerp(P,U/L)}for(let B=0;B<T;B++)for(let b=0;b<2*(T-B)-1;b++){const P=Math.floor(b/2);b%2===0?(p(R[B][P+1]),p(R[B+1][P]),p(R[B][P])):(p(R[B][P+1]),p(R[B+1][P+1]),p(R[B+1][P]))}}function c(v){const S=new z;for(let M=0;M<s.length;M+=3)S.x=s[M+0],S.y=s[M+1],S.z=s[M+2],S.normalize().multiplyScalar(v),s[M+0]=S.x,s[M+1]=S.y,s[M+2]=S.z}function u(){const v=new z;for(let S=0;S<s.length;S+=3){v.x=s[S+0],v.y=s[S+1],v.z=s[S+2];const M=x(v)/2/Math.PI+.5,w=g(v)/Math.PI+.5;o.push(M,1-w)}y(),d()}function d(){for(let v=0;v<o.length;v+=6){const S=o[v+0],M=o[v+2],w=o[v+4],T=Math.max(S,M,w),R=Math.min(S,M,w);T>.9&&R<.1&&(S<.2&&(o[v+0]+=1),M<.2&&(o[v+2]+=1),w<.2&&(o[v+4]+=1))}}function p(v){s.push(v.x,v.y,v.z)}function m(v,S){const M=v*3;S.x=e[M+0],S.y=e[M+1],S.z=e[M+2]}function y(){const v=new z,S=new z,M=new z,w=new z,T=new ce,R=new ce,B=new ce;for(let b=0,P=0;b<s.length;b+=9,P+=6){v.set(s[b+0],s[b+1],s[b+2]),S.set(s[b+3],s[b+4],s[b+5]),M.set(s[b+6],s[b+7],s[b+8]),T.set(o[P+0],o[P+1]),R.set(o[P+2],o[P+3]),B.set(o[P+4],o[P+5]),w.copy(v).add(S).add(M).divideScalar(3);const L=x(w);_(T,P+0,v,L),_(R,P+2,S,L),_(B,P+4,M,L)}}function _(v,S,M,w){w<0&&v.x===1&&(o[S]=v.x-1),M.x===0&&M.z===0&&(o[S]=w/2/Math.PI+.5)}function x(v){return Math.atan2(v.z,-v.x)}function g(v){return Math.atan2(-v.y,Math.sqrt(v.x*v.x+v.z*v.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fl(e.vertices,e.indices,e.radius,e.details)}}class Q_ extends fl{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 48,435 bytes, line 3857
385719,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Q_(e.radius,e.detail)}}const X0=new z,J0=new z,P1=new z,Y0=new hi;class uL extends xt{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),s=Math.cos(hc*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,c=[0,0,0],u=["a","b","c"],d=new Array(3),p={},m=[];for(let y=0;y<l;y+=3){o?(c[0]=o.getX(y),c[1]=o.getX(y+1),c[2]=o.getX(y+2)):(c[0]=y,c[1]=y+1,c[2]=y+2);const{a:_,b:x,c:g}=Y0;if(_.fromBufferAttribute(a,c[0]),x.fromBufferAttribute(a,c[1]),g.fromBufferAttribute(a,c[2]),Y0.getNormal(P1),d[0]=`${Math.round(_.x*r)},${Math.round(_.y*r)},${Math.round(_.z*r)}`,d[1]=`${Math.round(x.x*r)},${Math.round(x.y*r)},${Math.round(x.z*r)}`,d[2]=`${Math.round(g.x*r)},${Math.round(g.y*r)},${Math.round(g.z*r)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let v=0;v<3;v++){const S=(v+1)%3,M=d[v],w=d[S],T=Y0[u[v]],R=Y0[u[S]],B=`${M}_${w}`,b=`${w}_${M}`;b in p&&p[b]?(P1.dot(p[b].normal)<=s&&(m.push(T.x,T.y,T.z),m.push(R.x,R.y,R.z)),p[b]=null):B in p||(p[B]={index0:c[v],index1:c[S],normal:P1.clone()})}}for(const y in p)if(p[y]){const{index0:_,index1:x}=p[y];X0.fromBufferAttribute(a,_),J0.fromBufferAttribute(a,x),m.push(X0.x,X0.y,X0.z),m.push(J0.x,J0.y,J0.z)}this.setAttribute("position",new qe(m,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class dc extends dp{constructor(e){super(e),this.uuid=zr(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new dp().fromJSON(r))}return this}}const O9={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=hL(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c,u,d,p,m;if(i&&(s=G9(n,e,s,t)),n.length>80*t){a=c=n[0],l=u=n[1];for(let y=t;y<r;y+=t)d=n[y],p=n[y+1],d<a&&(a=d),p<l&&(l=p),d>c&&(c=d),p>u&&(u=p);m=Math.max(c-a,u-l),m=m!==0?32767/m:0}return pp(s,o,t,a,l,m,0),o}};function hL(n,e,t,i,r){let s,o;if(r===$9(n,e,t,i)>0)for(s=e;s<t;s+=i)o=b3(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=b3(s,n[s],n[s+1],o);return o&&Z_(o,o.next)&&(gp(o),o=o.next),o}function Rc(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Z_(t,t.next)||Sn(t.prev,t,t.next)===0)){if(gp(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function pp(n,e,t,i,r,s,o){if(!n)return;!o&&s&&J9(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?N9(n,i,r,s):U9(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),gp(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=k9(Rc(n),e,t),pp(n,e,t,i,r,s,2)):o===2&&H9(n,e,t,i,r,s):pp(Rc(n),e,t,i,r,s,1);break}}}function U9(n){const e=n.prev,t=n,i=n.next;if(Sn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=r<s?r<o?r:o:s<o?s:o,d=a<l?a<c?a:c:l<c?l:c,p=r>s?r>o?r:o:s>o?s:o,m=a>l?a>c?a:c:l>c?l:c;let y=i.next;for(;y!==e;){if(y.x>=u&&y.x<=p&&y.y>=d&&y.y<=m&&lh(r,a,s,l,o,c,y.x,y.y)&&Sn(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function N9(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Sn(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,d=s.y,p=o.y,m=a<l?a<c?a:c:l<c?l:c,y=u<d?u<p?u:p:d<p?d:p,_=a>l?a>c?a:c:l>c?l:c,x=u>d?u>p?u:p:d>p?d:p,g=IS(m,y,e,t,i),v=IS(_,x,e,t,i);let S=n.prevZ,M=n.nextZ;for(;S&&S.z>=g&&M&&M.z<=v;){if(S.x>=m&&S.x<=_&&S.y>=y&&S.y<=x&&S!==r&&S!==o&&lh(a,u,l,d,c,p,S.x,S.y)&&Sn(S.prev,S,S.next)>=0||(S=S.prevZ,M.x>=m&&M.x<=_&&M.y>=y&&M.y<=x&&M!==r&&M!==o&&lh(a,u,l,d,c,p,M.x,M.y)&&Sn(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;S&&S.z>=g;){if(S.x>=m&&S.x<=_&&S.y>=y&&S.y<=x&&S!==r&&S!==o&&lh(a,u,l,d,c,p,S.x,S.y)&&Sn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;M&&M.z<=v;){if(M.x>=m&&M.x<=_&&M.y>=y&&M.y<=x&&M!==r&&M!==o&&lh(a,u,l,d,c,p,M.x,M.y)&&Sn(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function k9(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Z_(r,s)&&fL(r,i,i.next,s)&&mp(r,s)&&mp(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),gp(i),gp(i.next),i=n=s),i=i.next}while(i!==n);return Rc(i)}function H9(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Q9(o,a)){let l=dL(o,a);o=Rc(o,o.next),l=Rc(l,l.next),pp(o,e,t,i,r,s,0),pp(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function G9(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s<o;s++)a=e[s]*i,l=s<o-1?e[s+1]*i:n.length,c=hL(n,a,l,i,!1),c===c.next&&(c.steiner=!0),r.push(K9(c));for(r.sort(V9),s=0;s<r.length;s++)t=W9(r[s],t);return t}function V9(n,e){return n.x-e.x}function W9(n,e){const t=j9(n,e);if(!t)return e;const i=dL(t,n);return Rc(i,i.next),Rc(t,t.next)}function j9(n,e){let t=e,i=-1/0,r;const s=n.x,o=n.y;do{if(o<=t.y&&o>=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x<t.next.x?t:t.next,p===s))return r}t=t.next}while(t!==e);if(!r)return null;const a=r,l=r.x,c=r.y;let u=1/0,d;t=r;do s>=t.x&&t.x>=l&&s!==t.x&&lh(o<c?s:i,o,l,c,o<c?i:s,o,t.x,t.y)&&(d=Math.abs(o-t.y)/(s-t.x),mp(t,n)&&(d<u||d===u&&(t.x>r.x||t.x===r.x&&X9(r,t)))&&(r=t,u=d)),t=t.next;while(t!==a);return r}function X9(n,e){return Sn(n.prev,n,e.prev)<0&&Sn(e.next,n,n.next)<0}function J9(n,e,t,i){let r=n;do r.z===0&&(r.z=IS(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,Y9(r)}function Y9(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e<c&&(a++,i=i.nextZ,!!i);e++);for(l=c;a>0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function IS(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function K9(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function lh(n,e,t,i,r,s,o,a){return(r-o)*(e-a)>=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function Q9(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!Z9(n,e)&&(mp(n,e)&&mp(e,n)&&q9(n,e)&&(Sn(n.prev,n,e.prev)||Sn(n,e.prev,e))||Z_(n,e)&&Sn(n.prev,n,n.next)>0&&Sn(e.prev,e,e.next)>0)}function Sn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Z_(n,e){return n.x===e.x&&n.y===e.y}function fL(n,e,t,i){const r=Q0(Sn(n,e,t)),s=Q0(Sn(n,e,i)),o=Q0(Sn(t,i,n)),a=Q0(Sn(t,i,e));return!!(r!==s&&o!==a||r===0&&K0(n,t,e)||s===0&&K0(n,i,e)||o===0&&K0(t,n,i)||a===0&&K0(t,e,i))}function K0(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Q0(n){return n>0?1:n<0?-1:0}function Z9(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&fL(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function mp(n,e){return Sn(n.prev,n,n.next)<0?Sn(n,e,n.next)>=0&&Sn(n,n.prev,e)>=0:Sn(n,e,n.prev)<0||Sn(n,n.next,e)<0}function q9(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function dL(n,e){const t=new LS(n.i,n.x,n.y),i=new LS(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function b3(n,e,t,i){const r=new LS(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function gp(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function LS(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function $9(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class mo{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return mo.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];P3(e),B3(i,e);let o=e.length;t.forEach(P3);for(let l=0;l<t.length;l++)r.push(o),o+=t[l].length,B3(i,t[l]);const a=O9.triangulate(i,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function P3(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function B3(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class q_ extends xt{constructor(e=new dc([new ce(.5,.5),new ce(-.5,.5),new ce(-.5,-.5),new ce(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let a=0,l=e.length;a<l;a++){const c=e[a];o(c)}this.setAttribute("position",new qe(r,3)),this.setAttribute("uv",new qe(s,2)),this.computeVertexNormals();function o(a){const l=[],c=t.curveSegments!==void 0?t.curveSegments:12,u=t.steps!==void 0?t.steps:1,d=t.depth!==void 0?t.depth:1;let p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,m=t.bevelThickness!==void 0?t.bevelThickness:.2,y=t.bevelSize!==void 0?t.bevelSize:m-.1,_=t.bevelOffset!==void 0?t.bevelOffset:0,x=t.bevelSegments!==void 0?t.bevelSegments:3;const g=t.extrudePath,v=t.UVGenerator!==void 0?t.UVGenerator:eH;let S,M=!1,w,T,R,B;g&&(S=g.getSpacedPoints(u),M=!0,p=!1,w=g.computeFrenetFrames(u,!1),T=new z,R=new z,B=new z),p||(x=0,m=0,y=0,_=0);const b=a.extractPoints(c);let P=b.shape;const L=b.holes;if(!mo.isClockWise(P)){P=P.reverse();for(let N=0,me=L.length;N<me;N++){const Ae=L[N];mo.isClockWise(Ae)&&(L[N]=Ae.reverse())}}const G=mo.triangulateShape(P,L),j=P;for(let N=0,me=L.length;N<me;N++){const Ae=L[N];P=P.concat(Ae)}function X(N,me,Ae){return me||console.error("THREE.ExtrudeGeometry: vec does not exist"),N.clone().addScaledVector(me,Ae)}const J=P.length,te=G.length;function k(N,me,Ae){let Le,de,Ze;const ze=N.x-me.x,He=N.y-me.y,W=Ae.x-N.x,D=Ae.y-N.y,re=ze*ze+He*He,ve=ze*D-He*W;if(Math.abs(ve)>Number.EPSILON){const ge=Math.sqrt(re),_e=Math.sqrt(W*W+D*D),et=me.x-He/ge,be=me.y+ze/ge,Ve=Ae.x-D/_e,pt=Ae.y+W/_e,Ee=((Ve-et)*D-(pt-be)*W)/(ze*D-He*W);Le=et+ze*Ee-N.x,de=be+He*Ee-N.y;const Ge=Le*Le+de*de;if(Ge<=2)return new ce(Le,de);Ze=Math.sqrt(Ge/2)}else{let ge=!1;ze>Number.EPSILON?W>Number.EPSILON&&(ge=!0):ze<-Number.EPSILON?W<-Number.EPSILON&&(ge=!0):Math.sign(He)===Math.sign(D)&&(ge=!0),ge?(Le=-He,de=ze,Ze=Math.sqrt(re)):(Le=ze,de=He,Ze=Math.sqrt(re/2))}return new ce(Le/Ze,de/Ze)}const Q=[];for(let N=0,me=j.length,Ae=me-1,Le=N+1;N<me;N++,Ae++,Le++)Ae===me&&(Ae=0),Le===me&&(Le=0),Q[N]=k(j[N],j[Ae],j[Le]);const $=[];let oe,xe=Q.concat();for(let N=0,me=L.length;N<me;N++){const Ae=L[N];oe=[];for(let Le=0,de=Ae.length,Ze=de-1,ze=Le+1;Le<de;Le++,Ze++,ze++)Ze===de&&(Ze=0),ze===de&&(ze=0),oe[Le]=k(Ae[Le],Ae[Ze],Ae[ze]);$.push(oe),xe=xe.concat(oe)}for(let N=0;N<x;N++){const me=N/x,Ae=m*Math.cos(me*Math.PI/2),Le=y*Math.sin(me*Math.PI/2)+_;for(let de=0,Ze=j.length;de<Ze;de++){const ze=X(j[de],Q[de],Le);Me(ze.x,ze.y,-Ae)}for(let de=0,Ze=L.length;de<Ze;de++){const ze=L[de];oe=$[de];for(let He=0,W=ze.length;He<W;He++){const D=X(ze[He],oe[He],Le);Me(D.x,D.y,-Ae)}}}const De=y+_;for(let N=0;N<J;N++){const me=p?X(P[N],xe[N],De):P[N];M?(R.copy(w.normals[0]).multiplyScalar(me.x),T.copy(w.binormals[0]).multiplyScalar(me.y),B.copy(S[0]).add(R).add(T),Me(B.x,B.y,B.z)):Me(me.x,me.y,0)}for(let N=1;N<=u;N++)for(let me=0;me<J;me++){const Ae=p?X(P[me],xe[me],De):P[me];M?(R.copy(w.normals[N]).multiplyScalar(Ae.x),T.copy(w.binormals[N]).multiplyScalar(Ae.y),B.copy(S[N]).add(R).add(T),Me(B.x,B.y,B.z)):Me(Ae.x,Ae.y,d/u*N)}for(let N=x-1;N>=0;N--){const me=N/x,Ae=m*Math.cos(me*Math.PI/2),Le=y*Math.sin(me*Math.PI/2)+_;for(let de=0,Ze=j.length;de<Ze;de++){const ze=X(j[de],Q[de],Le);Me(ze.x,ze.y,d+Ae)}for(let de=0,Ze=L.length;de<Ze;de++){const ze=L[de];oe=$[de];for(let He=0,W=ze.length;He<W;He++){const D=X(ze[He],oe[He],Le);M?Me(D.x,D.y+S[u-1].y,S[u-1].x+Ae):Me(D.x,D.y,d+Ae)}}}ne(),fe();function ne(){const N=r.length/3;if(p){let me=0,Ae=J*me;for(let Le=0;Le<te;Le++){const de=G[Le];it(de[2]+Ae,de[1]+Ae,de[0]+Ae)}me=u+x*2,Ae=J*me;for(let Le=0;Le<te;Le++){const de=G[Le];it(de[0]+Ae,de[1]+Ae,de[2]+Ae)}}else{for(let me=0;me<te;me++){const Ae=G[me];it(Ae[2],Ae[1],Ae[0])}for(let me=0;me<te;me++){const Ae=G[me];it(Ae[0]+J*u,Ae[1]+J*u,Ae[2]+J*u)}}i.addGroup(N,r.length/3-N,0)}function fe(){const N=r.length/3;let me=0;Te(j,me),me+=j.length;for(let Ae=0,Le=L.length;Ae<Le;Ae++){const de=L[Ae];Te(de,me),me+=de.length}i.addGroup(N,r.length/3-N,1)}function Te(N,me){let Ae=N.length;for(;--Ae>=0;){const Le=Ae;let de=Ae-1;de<0&&(de=N.length-1);for(let Ze=0,ze=u+x*2;Ze<ze;Ze++){const He=J*Ze,W=J*(Ze+1),D=me+Le+He,re=me+de+He,ve=me+de+W,ge=me+Le+W;ct(D,re,ve,ge)}}}function Me(N,me,Ae){l.push(N),l.push(me),l.push(Ae)}function it(N,me,Ae){je(N),je(me),je(Ae);const Le=r.length/3,de=v.generateTopUV(i,r,Le-3,Le-2,Le-1);ke(de[0]),ke(de[1]),ke(de[2])}function ct(N,me,Ae,Le){je(N),je(me),je(Le),je(me),je(Ae),je(Le);const de=r.length/3,Ze=v.generateSideWallUV(i,r,de-6,de-3,de-2,de-1);ke(Ze[0]),ke(Ze[1]),ke(Ze[3]),ke(Ze[1]),ke(Ze[2]),ke(Ze[3])}function je(N){r.push(l[N*3+0]),r.push(l[N*3+1]),r.push(l[N*3+2])}function ke(N){s.push(N.x),s.push(N.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return tH(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];i.push(a)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new qy[r.type]().fromJSON(r)),new q_(i,e.options)}}const eH={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],a=e[i*3],l=e[i*3+1],c=e[r*3],u=e[r*3+1];return[new ce(s,o),new ce(a,l),new ce(c,u)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[i*3],u=e[i*3+1],d=e[i*3+2],p=e[r*3],m=e[r*3+1],y=e[r*3+2],_=e[s*3],x=e[s*3+1],g=e[s*3+2];return Math.abs(a-u)<Math.abs(o-c)?[new ce(o,1-l),new ce(c,1-d),new ce(p,1-y),new ce(_,1-g)]:[new ce(a,1-l),new ce(u,1-d),new ce(m,1-y),new ce(x,1-g)]}};function tH(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class $_ extends fl{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new $_(e.radius,e.detail)}}class Vp extends fl{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Vp(e.radius,e.detail)}}class ex extends xt{constructor(e=.5,t=1,i=32,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const a=[],l=[],c=[],u=[];let d=e;const p=(t-e)/r,m=new z,y=new ce;for(let _=0;_<=r;_++){for(let x=0;x<=i;x++){const g=s+x/i*o;m.x=d*Math.cos(g),m.y=d*Math.sin(g),l.push(m.x,m.y,m.z),c.push(0,0,1),y.x=(m.x/t+1)/2,y.y=(m.y/t+1)/2,u.push(y.x,y.y)}d+=p}for(let _=0;_<r;_++){const x=_*(i+1);for(let g=0;g<i;g++){const v=g+x,S=v,M=v+i+1,w=v+i+2,T=v+1;a.push(S,M,T),a.push(M,w,T)}}this.setIndex(a),this.setAttribute("position",new qe(l,3)),this.setAttribute("normal",new qe(c,3)),this.setAttribute("uv",new qe(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ex(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class tx extends xt{constructor(e=new dc([new ce(0,.5),new ce(-.5,-.5),new ce(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let u=0;u<e.length;u++)c(e[u]),this.addGroup(a,l,u),a+=l,l=0;this.setIndex(i),this.setAttribute("position",new qe(r,3)),this.setAttribute("normal",new qe(s,3)),this.setAttribute("uv",new qe(o,2));function c(u){const d=r.length/3,p=u.extractPoints(t);let m=p.shape;const y=p.holes;mo.isClockWise(m)===!1&&(m=m.reverse());for(let x=0,g=y.length;x<g;x++){const v=y[x];mo.isClockWise(v)===!0&&(y[x]=v.reverse())}const _=mo.triangulateShape(m,y);for(let x=0,g=y.length;x<g;x++){const v=y[x];m=m.concat(v)}for(let x=0,g=m.length;x<g;x++){const v=m[x];r.push(v.x,v.y,0),s.push(0,0,1),o.push(v.x,v.y)}for(let x=0,g=_.length;x<g;x++){const v=_[x],S=v[0]+d,M=v[1]+d,w=v[2]+d;i.push(S,M,w),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return nH(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new tx(i,e.curveSegments)}}function nH(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Wp extends xt{constructor(e=1,t=32,i=16,r=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const l=Math.min(o+a,Math.PI);let c=0;const u=[],d=new z,p=new z,m=[],y=[],_=[],x=[];for(let g=0;g<=i;g++){const v=[],S=g/i;let M=0;g===0&&o===0?M=.5/t:g===i&&l===Math.PI&&(M=-.5/t);for(let w=0;w<=t;w++){const T=w/t;d.x=-e*Math.cos(r+T*s)*Math.sin(o+S*a),d.y=e*Math.cos(o+S*a),d.z=e*Math.sin(r+T*s)*Math.sin(o+S*a),y.push(d.x,d.y,d.z),p.copy(d).normalize(),_.push(p.x,p.y,p.z),x.push(T+M,1-S),v.push(c++)}u.push(v)}for(let g=0;g<i;g++)for(let v=0;v<t;v++){const S=u[g][v+1],M=u[g][v],w=u[g+1][v],T=u[g+1][v+1];(g!==0||o>0)&&m.push(S,M,T),(g!==i-1||l<Math.PI)&&m.push(M,w,T)}this.setIndex(m),this.setAttribute("position",new qe(y,3)),this.setAttribute("normal",new qe(_,3)),this.setAttribute("uv",new qe(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wp(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class nx extends fl{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new nx(e.radius,e.detail)}}class ix extends xt{constructor(e=1,t=.4,i=12,r=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],a=[],l=[],c=[],u=new z,d=new z,p=new z;for(let m=0;m<=i;m++)for(let y=0;y<=r;y++){const _=y/r*s,x=m/i*Math.PI*2;d.x=(e+t*Math.cos(x))*Math.cos(_),d.y=(e+t*Math.cos(x))*Math.sin(_),d.z=t*Math.sin(x),a.push(d.x,d.y,d.z),u.x=e*Math.cos(_),u.y=e*Math.sin(_),p.subVectors(d,u).normalize(),l.push(p.x,p.y,p.z),c.push(y/r),c.push(m/i)}for(let m=1;m<=i;m++)for(let y=1;y<=r;y++){const _=(r+1)*m+y-1,x=(r+1)*(m-1)+y-1,g=(r+1)*(m-1)+y,v=(r+1)*m+y;o.push(_,x,v),o.push(x,g,v)}this.setIndex(o),this.setAttribute("position",new qe(a,3)),this.setAttribute("normal",new qe(l,3)),this.setAttribute("uv",new qe(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ix(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class rx extends xt{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const a=[],l=[],c=[],u=[],d=new z,p=new z,m=new z,y=new z,_=new z,x=new z,g=new z;for(let S=0;S<=i;++S){const M=S/i*s*Math.PI*2;v(M,s,o,e,m),v(M+.01,s,o,e,y),x.subVectors(y,m),g.addVectors(y,m),_.crossVectors(x,g),g.crossVectors(_,x),_.normalize(),g.normalize();for(let w=0;w<=r;++w){const T=w/r*Math.PI*2,R=-t*Math.cos(T),B=t*Math.sin(T);d.x=m.x+(R*g.x+B*_.x),d.y=m.y+(R*g.y+B*_.y),d.z=m.z+(R*g.z+B*_.z),l.push(d.x,d.y,d.z),p.subVectors(d,m).normalize(),c.push(p.x,p.y,p.z),u.push(S/i),u.push(w/r)}}for(let S=1;S<=i;S++)for(let M=1;M<=r;M++){const w=(r+1)*(S-1)+(M-1),T=(r+1)*S+(M-1),R=(r+1)*S+M,B=(r+1)*(S-1)+M;a.push(w,T,B),a.push(T,R,B)}this.setIndex(a),this.setAttribute("position",new qe(l,3)),this.setAttribute("normal",new qe(c,3)),this.setAttribute("uv",new qe(u,2));function v(S,M,w,T,R){const B=Math.cos(S),b=Math.sin(S),P=w/M*S,L=Math.cos(P);R.x=T*(2+L)*.5*B,R.y=T*(2+L)*b*.5,R.z=T*Math.sin(P)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rx(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class sx extends xt{constructor(e=new XE(new z(-1,-1,0),new z(-1,1,0),new z(1,1,0)),t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new z,l=new z,c=new ce;let u=new z;const d=[],p=[],m=[],y=[];_(),this.setIndex(y),this.setAttribute("position",new qe(d,3)),this.setAttribute("normal",new qe(p,3)),this.setAttribute("uv",new qe(m,2));function _(){for(let S=0;S<t;S++)x(S);x(s===!1?t:0),v(),g()}function x(S){u=e.getPointAt(S/t,u);const M=o.normals[S],w=o.binormals[S];for(let T=0;T<=r;T++){const R=T/r*Math.PI*2,B=Math.sin(R),b=-Math.cos(R);l.x=b*M.x+B*w.x,l.y=b*M.y+B*w.y,l.z=b*M.z+B*w.z,l.normalize(),p.push(l.x,l.y,l.z),a.x=u.x+i*l.x,a.y=u.y+i*l.y,a.z=u.z+i*l.z,d.push(a.x,a.y,a.z)}}function g(){for(let S=1;S<=t;S++)for(let M=1;M<=r;M++){const w=(r+1)*(S-1)+(M-1),T=(r+1)*S+(M-1),R=(r+1)*S+M,B=(r+1)*(S-1)+M;y.push(w,T,B),y.push(T,R,B)}}function v(){for(let S=0;S<=t;S++)for(let M=0;M<=r;M++)c.x=S/t,c.y=M/r,m.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new sx(new qy[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class pL extends xt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new z,s=new z;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let c=0,u=l.length;c<u;++c){const d=l[c],p=d.start,m=d.count;for(let y=p,_=p+m;y<_;y+=3)for(let x=0;x<3;x++){const g=a.getX(y+x),v=a.getX(y+(x+1)%3);r.fromBufferAttribute(o,g),s.fromBufferAttribute(o,v),I3(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let c=0;c<3;c++){const u=3*a+c,d=3*a+(c+1)%3;r.fromBufferAttribute(o,u),s.fromBufferAttribute(o,d),I3(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new qe(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function I3(n,e,t){const i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}var L3=Object.freeze({__proto__:null,BoxGeometry:Fc,CapsuleGeometry:J_,CircleGeometry:Y_,ConeGeometry:K_,CylinderGeometry:qh,DodecahedronGeometry:Q_,EdgesGeometry:uL,ExtrudeGeometry:q_,IcosahedronGeometry:$_,LatheGeometry:Gp,OctahedronGeometry:Vp,PlaneGeometry:Oc,PolyhedronGeometry:fl,RingGeometry:ex,ShapeGeometry:tx,SphereGeometry:Wp,TetrahedronGeometry:nx,TorusGeometry:ix,TorusKnotGeometry:rx,TubeGeometry:sx,WireframeGeometry:pL});class mL extends Jn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Re(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class gL extends vi{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class jp extends Jn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Re(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ul,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ur,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class As extends jp{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ce(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Bn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Re(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Re(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Re(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class yL extends Jn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Re(16777215),this.specular=new Re(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ul,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ur,this.combine=Lp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class _L extends Jn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Re(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ul,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class xL extends Jn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ul,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class vL extends Jn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Re(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ul,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ur,this.combine=Lp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class AL extends Jn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Re(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ul,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class SL extends ki{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function ic(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function ML(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function EL(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function DS(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function YE(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function iH(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l<s.tracks.length;++l){const c=s.tracks[l],u=c.getValueSize(),d=[],p=[];for(let m=0;m<c.times.length;++m){const y=c.times[m]*r;if(!(y<t||y>=i)){d.push(c.times[m]);for(let _=0;_<u;++_)p.push(c.values[m*u+_])}}d.length!==0&&(c.times=ic(d,c.times.constructor),c.values=ic(p,c.values.constructor),o.push(c))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s}function rH(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const c=n.tracks.find(function(g){return g.name===a.name&&g.ValueTypeName===l});if(c===void 0)continue;let u=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=d/3);let p=0;const m=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const y=a.times.length-1;let _;if(s<=a.times[0]){const g=u,v=d-u;_=a.values.slice(g,v)}else if(s>=a.times[y]){const g=y*d+u,v=g+d-u;_=a.values.slice(g,v)}else{const g=a.createInterpolant(),v=u,S=d-u;g.evaluate(s),_=g.resultBuffer.slice(v,S)}l==="quaternion"&&new Si().fromArray(_).normalize().conjugate().toArray(_);const x=c.times.length;for(let g=0;g<x;++g){const v=g*m+p;if(l==="quaternion")Si.multiplyQuaternionsFlat(c.values,v,_,0,c.values,v);else{const S=m-p*2;for(let M=0;M<S;++M)c.values[v+M]-=_[M]}}}return n.blendMode=EE,n}const sH={convertArray:ic,isTypedArray:ML,getKeyframeOrder:EL,sortedArray:DS,flattenJSON:YE,subclip:iH,makeClipAdditive:rH};class $h{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let a=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(i=2,s=a);for(let l=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const a=i+o>>>1;e<t[a]?o=a:i=a+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class wL extends $h{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ec,endingEnd:ec}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,a=r[s],l=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case tc:s=e,a=2*t-i;break;case sp:s=r.length-2,a=t+r[s]-r[s+1];break;default:s=e,a=i}if(l===void 0)switch(this.getSettings_().endingEnd){case tc:o=e,l=2*i-t;break;case sp:o=1,l=i+r[1]-r[0];break;default:o=e-1,l=t}const c=(i-t)*.5,u=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(l-i),this._offsetPrev=s*u,this._offsetNext=o*u}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,u=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,m=this._weightNext,y=(i-t)/(r-t),_=y*y,x=_*y,g=-p*x+2*p*_-p*y,v=(1+p)*x+(-1.5-2*p)*_+(-.5+p)*y+1,S=(-1-m)*x+(1.5+m)*_+.5*y,M=m*x-m*_;for(let w=0;w!==a;++w)s[w]=g*o[u+w]+v*o[c+w]+S*o[l+w]+M*o[d+w];return s}}class KE extends $h{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,u=(i-t)/(r-t),d=1-u;for(let p=0;p!==a;++p)s[p]=o[c+p]*d+o[l+p]*u;return s}}class TL extends $h{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Vs{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ic(t,this.TimeBufferType),this.values=ic(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:ic(e.times,Array),values:ic(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new TL(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new KE(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new wL(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case zh:t=this.InterpolantFactoryMethodDiscrete;break;case Fh:t=this.InterpolantFactoryMethodLinear;break;case Gg:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return zh;case this.InterpolantFactoryMethodLinear:return Fh;case this.InterpolantFactoryMethodSmooth:return Gg}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&ML(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Gg,s=e.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const c=e[a],u=e[a+1];if(c!==u&&(a!==1||c!==e[0]))if(r)l=!0;else{const d=a*i,p=d-i,m=d+i;for(let y=0;y!==i;++y){const _=t[d+y];if(_!==t[p+y]||_!==t[m+y]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const d=a*i,p=o*i;for(let m=0;m!==i;++m)t[p+m]=t[d+m]}++o}}if(s>0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Vs.prototype.TimeBufferType=Float32Array;Vs.prototype.ValueBufferType=Float32Array;Vs.prototype.DefaultInterpolation=Fh;class Uc extends Vs{constructor(e,t,i){super(e,t,i)}}Uc.prototype.ValueTypeName="bool";Uc.prototype.ValueBufferType=Array;Uc.prototype.DefaultInterpolation=zh;Uc.prototype.InterpolantFactoryMethodLinear=void 0;Uc.prototype.InterpolantFactoryMethodSmooth=void 0;class QE extends Vs{}QE.prototype.ValueTypeName="color";class bc extends Vs{}bc.prototype.ValueTypeName="number";class CL extends $h{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)Si.slerpFlat(s,0,o,c-a,o,c,l);return s}}class Pc extends Vs{InterpolantFactoryMethodLinear(e){return new CL(this.times,this.values,this.getValueSize(),e)}}Pc.prototype.ValueTypeName="quaternion";Pc.prototype.InterpolantFactoryMethodSmooth=void 0;class Nc extends Vs{constructor(e,t,i){super(e,t,i)}}Nc.prototype.ValueTypeName="string";Nc.prototype.ValueBufferType=Array;Nc.prototype.DefaultInterpolation=zh;Nc.prototype.InterpolantFactoryMethodLinear=void 0;Nc.prototype.InterpolantFactoryMethodSmooth=void 0;class Bc extends Vs{}Bc.prototype.ValueTypeName="vector";class Nh{constructor(e="",t=-1,i=[],r=U_){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=zr(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(aH(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Vs.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a<s;a++){let l=[],c=[];l.push((a+s-1)%s,a,(a+1)%s),c.push(0,1,0);const u=EL(l);l=DS(l,1,u),c=DS(c,1,u),!r&&l[0]===0&&(l.push(s),c.push(c[0])),o.push(new bc(".morphTargetInfluences["+t[a].name+"]",l,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const c=e[a],u=c.name.match(s);if(u&&u.length>1){const d=u[1];let p=r[d];p||(r[d]=p=[]),p.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,m,y,_){if(m.length!==0){const x=[],g=[];
vendor: 5,106 bytes, line 3857
3857YE(m,x,g,y),x.length!==0&&_.push(new d(p,x,g))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d<c.length;d++){const p=c[d].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const m={};let y;for(y=0;y<p.length;y++)if(p[y].morphTargets)for(let _=0;_<p[y].morphTargets.length;_++)m[p[y].morphTargets[_]]=-1;for(const _ in m){const x=[],g=[];for(let v=0;v!==p[y].morphTargets.length;++v){const S=p[y];x.push(S.time),g.push(S.morphTarget===_?1:0)}r.push(new bc(".morphTargetInfluence["+_+"]",x,g))}l=m.length*o}else{const m=".bones["+t[d].name+"]";i(Bc,m+".position",p,"pos",r),i(Pc,m+".quaternion",p,"rot",r),i(Bc,m+".scale",p,"scl",r)}}return r.length===0?null:new this(s,l,r,a)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function oH(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return bc;case"vector":case"vector2":case"vector3":case"vector4":return Bc;case"color":return QE;case"quaternion":return Pc;case"bool":case"boolean":return Uc;case"string":return Nc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function aH(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=oH(n.type);if(n.times===void 0){const t=[],i=[];YE(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Vo={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class ZE{constructor(e,t,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,d){return c.push(u,d),this},this.removeHandler=function(u){const d=c.indexOf(u);return d!==-1&&c.splice(d,2),this},this.getHandler=function(u){for(let d=0,p=c.length;d<p;d+=2){const m=c[d],y=c[d+1];if(m.global&&(m.lastIndex=0),m.test(u))return y}return null}}}const ch=new ZE;let Hi=class{constructor(e){this.manager=e!==void 0?e:ch,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};Hi.DEFAULT_MATERIAL_NAME="__DEFAULT";const Bo={};class lH extends Error{constructor(e,t){super(e),this.response=t}}class Nr extends Hi{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=Vo.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Bo[e]!==void 0){Bo[e].push({onLoad:t,onProgress:i,onError:r});return}Bo[e]=[],Bo[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Bo[e],d=c.body.getReader(),p=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),m=p?parseInt(p):0,y=m!==0;let _=0;const x=new ReadableStream({start(g){v();function v(){d.read().then(({done:S,value:M})=>{if(S)g.close();else{_+=M.byteLength;const w=new ProgressEvent("progress",{lengthComputable:y,loaded:_,total:m});for(let T=0,R=u.length;T<R;T++){const B=u[T];B.onProgress&&B.onProgress(w)}g.enqueue(M),v()}},S=>{g.error(S)})}}});return new Response(x)}else throw new lH(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>
vendor: 74,691 bytes, line 3857
3857new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),p=d&&d[1]?d[1].toLowerCase():void 0,m=new TextDecoder(p);return c.arrayBuffer().then(y=>m.decode(y))}}}).then(c=>{Vo.add(e,c);const u=Bo[e];delete Bo[e];for(let d=0,p=u.length;d<p;d++){const m=u[d];m.onLoad&&m.onLoad(c)}}).catch(c=>{const u=Bo[e];if(u===void 0)throw this.manager.itemError(e),c;delete Bo[e];for(let d=0,p=u.length;d<p;d++){const m=u[d];m.onError&&m.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class cH extends Hi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Nr(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=Nh.parse(e[i]);t.push(r)}return t}}class uH extends Hi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],a=new j_,l=new Nr(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(s.withCredentials);let c=0;function u(d){l.load(e[d],function(p){const m=s.parse(p,!0);o[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},c+=1,c===6&&(m.mipmapCount===1&&(a.minFilter=gn),a.image=o,a.format=m.format,a.needsUpdate=!0,t&&t(a))},i,r)}if(Array.isArray(e))for(let d=0,p=e.length;d<p;++d)u(d);else l.load(e,function(d){const p=s.parse(d,!0);if(p.isCubemap){const m=p.mipmaps.length/p.mipmapCount;for(let y=0;y<m;y++){o[y]={mipmaps:[]};for(let _=0;_<p.mipmapCount;_++)o[y].mipmaps.push(p.mipmaps[y*p.mipmapCount+_]),o[y].format=p.format,o[y].width=p.width,o[y].height=p.height}a.image=o}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=gn),a.format=p.format,a.needsUpdate=!0,t&&t(a)},i,r);return a}}class yp extends Hi{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Vo.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=hp("img");function l(){u(),Vo.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(d){u(),r&&r(d),s.manager.itemError(e),s.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class hH extends Hi{constructor(e){super(e)}load(e,t,i,r){const s=new Op;s.colorSpace=rs;const o=new yp(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(u){s.images[c]=u,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)l(c);return s}}class fH extends Hi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new po,a=new Nr(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(l){let c;try{c=s.parse(l)}catch(u){if(r!==void 0)r(u);else{console.error(u);return}}c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:Br,o.wrapT=c.wrapT!==void 0?c.wrapT:Br,o.magFilter=c.magFilter!==void 0?c.magFilter:gn,o.minFilter=c.minFilter!==void 0?c.minFilter:gn,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(o.colorSpace=c.colorSpace),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=ls),c.mipmapCount===1&&(o.minFilter=gn),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c)},i,r),o}}class Xp extends Hi{constructor(e){super(e)}load(e,t,i,r){const s=new Zt,o=new yp(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class dl extends gt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Re(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class RL extends dl{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(gt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Re(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const B1=new Ke,D3=new z,z3=new z;class qE{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ce(512,512),this.map=null,this.mapPass=null,this.matrix=new Ke,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Up,this._frameExtents=new ce(1,1),this._viewportCount=1,this._viewports=[new Wt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;D3.setFromMatrixPosition(e.matrixWorld),t.position.copy(D3),z3.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(z3),t.updateMatrixWorld(),B1.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(B1),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(B1)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class dH extends qE{constructor(){super(new Un(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=Oh*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class $E extends dl{constructor(e,t,i=0,r=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(gt.DEFAULT_UP),this.updateMatrix(),this.target=new gt,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new dH}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const F3=new Ke,Vf=new z,I1=new z;class pH extends qE{constructor(){super(new Un(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new ce(4,2),this._viewportCount=6,this._viewports=[new Wt(2,1,1,1),new Wt(0,1,1,1),new Wt(3,1,1,1),new Wt(1,1,1,1),new Wt(3,0,1,1),new Wt(1,0,1,1)],this._cubeDirections=[new z(1,0,0),new z(-1,0,0),new z(0,0,1),new z(0,0,-1),new z(0,1,0),new z(0,-1,0)],this._cubeUps=[new z(0,1,0),new z(0,1,0),new z(0,1,0),new z(0,1,0),new z(0,0,1),new z(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Vf.setFromMatrixPosition(e.matrixWorld),i.position.copy(Vf),I1.copy(i.position),I1.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(I1),i.updateMatrixWorld(),r.makeTranslation(-Vf.x,-Vf.y,-Vf.z),F3.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(F3)}}class ew extends dl{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new pH}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class mH extends qE{constructor(){super(new sa(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class tw extends dl{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(gt.DEFAULT_UP),this.updateMatrix(),this.target=new gt,this.shadow=new mH}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class bL extends dl{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class PL extends dl{constructor(e,t,i=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class BL{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new z)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}class IL extends dl{constructor(e=new BL,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class ox extends Hi{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new Nr(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=ox.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new Re().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Re().setHex(o.value);break;case"v2":r.uniforms[s].value=new ce().fromArray(o.value);break;case"v3":r.uniforms[s].value=new z().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Wt().fromArray(o.value);break;case"m3":r.uniforms[s].value=new vt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Ke().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new ce().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new ce().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:mL,SpriteMaterial:OE,RawShaderMaterial:gL,ShaderMaterial:vi,PointsMaterial:W_,MeshPhysicalMaterial:As,MeshStandardMaterial:jp,MeshPhongMaterial:yL,MeshToonMaterial:_L,MeshNormalMaterial:xL,MeshLambertMaterial:vL,MeshDepthMaterial:DE,MeshDistanceMaterial:zE,MeshBasicMaterial:ei,MeshMatcapMaterial:AL,LineDashedMaterial:SL,LineBasicMaterial:ki,Material:Jn};return new t[e]}}class Ka{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class LL extends xt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class DL extends Hi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Nr(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(m,y){if(t[y]!==void 0)return t[y];const x=m.interleavedBuffers[y],g=s(m,x.buffer),v=oh(x.type,g),S=new Np(v,x.stride);return S.uuid=x.uuid,t[y]=S,S}function s(m,y){if(i[y]!==void 0)return i[y];const x=m.arrayBuffers[y],g=new Uint32Array(x).buffer;return i[y]=g,g}const o=e.isInstancedBufferGeometry?new LL:new xt,a=e.data.index;if(a!==void 0){const m=oh(a.type,a.array);o.setIndex(new Lt(m,1))}const l=e.data.attributes;for(const m in l){const y=l[m];let _;if(y.isInterleavedBufferAttribute){const x=r(e.data,y.data);_=new il(x,y.itemSize,y.offset,y.normalized)}else{const x=oh(y.type,y.array),g=y.isInstancedBufferAttribute?Cc:Lt;_=new g(x,y.itemSize,y.normalized)}y.name!==void 0&&(_.name=y.name),y.usage!==void 0&&_.setUsage(y.usage),o.setAttribute(m,_)}const c=e.data.morphAttributes;if(c)for(const m in c){const y=c[m],_=[];for(let x=0,g=y.length;x<g;x++){const v=y[x];let S;if(v.isInterleavedBufferAttribute){const M=r(e.data,v.data);S=new il(M,v.itemSize,v.offset,v.normalized)}else{const M=oh(v.type,v.array);S=new Lt(M,v.itemSize,v.normalized)}v.name!==void 0&&(S.name=v.name),_.push(S)}o.morphAttributes[m]=_}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const d=e.data.groups||e.data.drawcalls||e.data.offsets;if(d!==void 0)for(let m=0,y=d.length;m!==y;++m){const _=d[m];o.addGroup(_.start,_.count,_.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const m=new z;p.center!==void 0&&m.fromArray(p.center),o.boundingSphere=new Nn(m,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class gH extends Hi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Ka.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new Nr(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let c=null;try{c=JSON.parse(l)}catch(d){r!==void 0&&r(d),console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message);return}const u=c.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Ka.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new Nr(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),a=JSON.parse(o),l=a.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(a)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),a=this.parseTextures(e.textures,o),l=this.parseMaterials(e.materials,a),c=this.parseObject(e.object,s,l,a,i),u=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,u),this.bindLightTargets(c),t!==void 0){let d=!1;for(const p in o)if(o[p].data instanceof HTMLImageElement){d=!0;break}d===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,r,a,o,t),c=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,c),this.bindLightTargets(l),l}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new dc().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=new kp().fromJSON(e[s],r);i[a.uuid]=a}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new DL;for(let s=0,o=e.length;s<o;s++){let a;const l=e[s];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(l);break;default:l.type in L3?a=L3[l.type].fromJSON(l,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),l.userData!==void 0&&(a.userData=l.userData),i[l.uuid]=a}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new ox;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const l=e[o];i[l.uuid]===void 0&&(i[l.uuid]=s.parse(l)),r[l.uuid]=i[l.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=Nh.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(l){return i.manager.itemStart(l),s.load(l,function(){i.manager.itemEnd(l)},void 0,function(){i.manager.itemError(l),i.manager.itemEnd(l)})}function a(l){if(typeof l=="string"){const c=l,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(u)}else return l.data?{data:oh(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new ZE(t);s=new yp(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c<u;c++){const d=e[c],p=d.url;if(Array.isArray(p)){const m=[];for(let y=0,_=p.length;y<_;y++){const x=p[y],g=a(x);g!==null&&(g instanceof HTMLImageElement?m.push(g):m.push(new po(g.data,g.width,g.height)))}r[d.uuid]=new nc(m)}else{const m=a(d.url);r[d.uuid]=new nc(m)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const a=o,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await r.loadAsync(l)}else return o.data?{data:oh(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new yp(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const l=e[o],c=l.url;if(Array.isArray(c)){const u=[];for(let d=0,p=c.length;d<p;d++){const m=c[d],y=await s(m);y!==null&&(y instanceof HTMLImageElement?u.push(y):u.push(new po(y.data,y.width,y.height)))}i[l.uuid]=new nc(u)}else{const u=await s(l.url);i[l.uuid]=new nc(u)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=e[s];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const l=t[a.image],c=l.data;let u;Array.isArray(c)?(u=new Op,c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new po:u=new Zt,c&&(u.needsUpdate=!0)),u.source=l,u.uuid=a.uuid,a.name!==void 0&&(u.name=a.name),a.mapping!==void 0&&(u.mapping=i(a.mapping,yH)),a.channel!==void 0&&(u.channel=a.channel),a.offset!==void 0&&u.offset.fromArray(a.offset),a.repeat!==void 0&&u.repeat.fromArray(a.repeat),a.center!==void 0&&u.center.fromArray(a.center),a.rotation!==void 0&&(u.rotation=a.rotation),a.wrap!==void 0&&(u.wrapS=i(a.wrap[0],O3),u.wrapT=i(a.wrap[1],O3)),a.format!==void 0&&(u.format=a.format),a.internalFormat!==void 0&&(u.internalFormat=a.internalFormat),a.type!==void 0&&(u.type=a.type),a.colorSpace!==void 0&&(u.colorSpace=a.colorSpace),a.minFilter!==void 0&&(u.minFilter=i(a.minFilter,U3)),a.magFilter!==void 0&&(u.magFilter=i(a.magFilter,U3)),a.anisotropy!==void 0&&(u.anisotropy=a.anisotropy),a.flipY!==void 0&&(u.flipY=a.flipY),a.generateMipmaps!==void 0&&(u.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(u.unpackAlignment=a.unpackAlignment),a.compareFunction!==void 0&&(u.compareFunction=a.compareFunction),a.userData!==void 0&&(u.userData=a.userData),r[a.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function a(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function l(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let y=0,_=p.length;y<_;y++){const x=p[y];i[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",x),m.push(i[x])}return m}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let u,d;switch(e.type){case"Scene":o=new Ky,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Re(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new FE(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new G_(e.fog.color,e.fog.density)),e.fog.name!==""&&(o.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(o.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(o.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&o.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(o.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&o.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":o=new Un(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new sa(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new bL(e.color,e.intensity);break;case"DirectionalLight":o=new tw(e.color,e.intensity),o.target=e.target||"";break;case"PointLight":o=new ew(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new PL(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new $E(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),o.target=e.target||"";break;case"HemisphereLight":o=new RL(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new IL().fromJSON(e);break;case"SkinnedMesh":u=a(e.geometry),d=l(e.material),o=new UE(u,d),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":u=a(e.geometry),d=l(e.material),o=new hn(u,d);break;case"InstancedMesh":u=a(e.geometry),d=l(e.material);const p=e.count,m=e.instanceMatrix,y=e.instanceColor;o=new NE(u,d,p),o.instanceMatrix=new Cc(new Float32Array(m.array),16),y!==void 0&&(o.instanceColor=new Cc(new Float32Array(y.array),y.itemSize));break;case"BatchedMesh":u=a(e.geometry),d=l(e.material),o=new sL(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,d),o.geometry=u,o.perObjectFrustumCulled=e.perObjectFrustumCulled,o.sortObjects=e.sortObjects,o._drawRanges=e.drawRanges,o._reservedRanges=e.reservedRanges,o._visibility=e.visibility,o._active=e.active,o._bounds=e.bounds.map(_=>{const x=new Yt;x.min.fromArray(_.boxMin),x.max.fromArray(_.boxMax);const g=new Nn;return g.radius=_.sphereRadius,g.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:x,sphereInitialized:_.sphereInitialized,sphere:g}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new rL;break;case"Line":o=new qo(a(e.geometry),l(e.material));break;case"LineLoop":o=new kE(a(e.geometry),l(e.material));break;case"LineSegments":o=new Hs(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new HE(a(e.geometry),l(e.material));break;case"Sprite":o=new iL(l(e.material));break;case"Group":o=new Go;break;case"Bone":o=new V_;break;default:o=new gt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m<p.length;m++)o.add(this.parseObject(p[m],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let m=0;m<p.length;m++){const y=p[m];o.animations.push(s[y])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let m=0;m<p.length;m++){const y=p[m],_=o.getObjectByProperty("uuid",y.object);_!==void 0&&o.addLevel(_,y.distance,y.hysteresis)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const i=t.target,r=e.getObjectByProperty("uuid",i);r!==void 0?t.target=r:t.target=new gt}})}}const yH={UVMapping:P_,CubeReflectionMapping:Qo,CubeRefractionMapping:tl,EquirectangularReflectionMapping:ip,EquirectangularRefractionMapping:rp,CubeUVReflectionMapping:Qh},O3={RepeatWrapping:nl,ClampToEdgeWrapping:Br,MirroredRepeatWrapping:Lh},U3={NearestFilter:$n,NearestMipmapNearestFilter:B_,NearestMipmapLinearFilter:$l,LinearFilter:gn,LinearMipmapNearestFilter:vh,LinearMipmapLinearFilter:ls};class zL extends Hi{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Vo.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return Vo.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Vo.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Vo.add(e,l),s.manager.itemStart(e)}}let Z0,nw=class{static getContext(){return Z0===void 0&&(Z0=new(window.AudioContext||window.webkitAudioContext)),Z0}static setContext(e){Z0=e}};class _H extends Hi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Nr(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);nw.getContext().decodeAudioData(c,function(d){t(d)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const N3=new Ke,k3=new Ke,Ll=new Ke;class xH{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Un,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Un,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Ll.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(hc*t.fov*.5)/t.zoom;let a,l;k3.elements[12]=-r,N3.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Ll.elements[0]=2*t.near/(l-a),Ll.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Ll),a=-o*t.aspect-s,l=o*t.aspect-s,Ll.elements[0]=2*t.near/(l-a),Ll.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Ll)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(k3),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(N3)}}class ax{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=H3(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=H3();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function H3(){return(typeof performance>"u"?Date:performance).now()}const Dl=new z,G3=new Si,vH=new z,zl=new z;class AH extends gt{constructor(){super(),this.type="AudioListener",this.context=nw.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ax}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Dl,G3,vH),zl.set(0,0,-1).applyQuaternion(G3),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Dl.x,r),t.positionY.linearRampToValueAtTime(Dl.y,r),t.positionZ.linearRampToValueAtTime(Dl.z,r),t.forwardX.linearRampToValueAtTime(zl.x,r),t.forwardY.linearRampToValueAtTime(zl.y,r),t.forwardZ.linearRampToValueAtTime(zl.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Dl.x,Dl.y,Dl.z),t.setOrientation(zl.x,zl.y,zl.z,i.x,i.y,i.z)}}let FL=class extends gt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}};const Fl=new z,V3=new Si,SH=new z,Ol=new z;class MH extends FL{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Fl,V3,SH),Ol.set(0,0,1).applyQuaternion(V3);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Fl.x,i),t.positionY.linearRampToValueAtTime(Fl.y,i),t.positionZ.linearRampToValueAtTime(Fl.z,i),t.orientationX.linearRampToValueAtTime(Ol.x,i),t.orientationY.linearRampToValueAtTime(Ol.y,i),t.orientationZ.linearRampToValueAtTime(Ol.z,i)}else t.setPosition(Fl.x,Fl.y,Fl.z),t.setOrientation(Ol.x,Ol.y,Ol.z)}}class EH{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class OL{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==r;++a)i[s+a]=i[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(i,s,0,a,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=t*this._origIndex;this._mixBufferRegion(i,r,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Si.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Si.multiplyQuaternionsFlat(e,o,e,t,e,i),Si.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const iw="\\[\\]\\.:\\/",wH=new RegExp("["+iw+"]","g"),rw="[^"+iw+"]",TH="[^"+iw.replace("\\.","")+"]",CH=/((?:WC+[\/:])*)/.source.replace("WC",rw),RH=/(WCOD+)?/.source.replace("WCOD",TH),bH=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",rw),PH=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",rw),BH=new RegExp("^"+CH+RH+bH+PH+"$"),IH=["material","materials","bones","map"];class LH{constructor(e,t,i){const r=i||Dt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Dt{constructor(e,t,i){this.path=t,this.parsedPath=i||Dt.parseTrackName(t),this.node=Dt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Dt.Composite(e,t,i):new Dt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(wH,"")}static parseTrackName(e){const t=BH.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);IH.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const l=i(a.children);if(l)return l}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=Dt.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let c=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let u=0;u<e.length;u++)if(e[u].name===c){c=u;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[r];if(o===void 0){const c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Dt.Composite=LH;Dt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Dt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Dt.prototype.GetterByBindingType=[Dt.prototype._getValue_direct,Dt.prototype._getValue_array,Dt.prototype._getValue_arrayElement,Dt.prototype._getValue_toArray];Dt.prototype.SetterByBindingTypeAndVersioning=[[Dt.prototype._setValue_direct,Dt.prototype._setValue_direct_setNeedsUpdate,Dt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_array,Dt.prototype._setValue_array_setNeedsUpdate,Dt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_arrayElement,Dt.prototype._setValue_arrayElement_setNeedsUpdate,Dt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_fromArray,Dt.prototype._setValue_fromArray_setNeedsUpdate,Dt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class DH{constructor(){this.isAnimationObjectGroup=!0,this.uuid=zr(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length;let a,l=e.length,c=this.nCachedObjects_;for(let u=0,d=arguments.length;u!==d;++u){const p=arguments[u],m=p.uuid;let y=t[m];if(y===void 0){y=l++,t[m]=y,e.push(p);for(let _=0,x=o;_!==x;++_)s[_].push(new Dt(p,i[_],r[_]))}else if(y<c){a=e[y];const _=--c,x=e[_];t[x.uuid]=y,e[y]=x,t[m]=_,e[_]=p;for(let g=0,v=o;g!==v;++g){const S=s[g],M=S[_];let w=S[y];S[y]=M,w===void 0&&(w=new Dt(p,i[g],r[g])),S[_]=w}}else e[y]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const l=arguments[o],c=l.uuid,u=t[c];if(u!==void 0&&u>=s){const d=s++,p=e[d];t[p.uuid]=u,e[u]=p,t[c]=d,e[d]=l;for(let m=0,y=r;m!==y;++m){const _=i[m],x=_[d],g=_[u];_[u]=x,_[d]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,d=t[u];if(d!==void 0)if(delete t[u],d<s){const p=--s,m=e[p],y=--o,_=e[y];t[m.uuid]=d,e[d]=m,t[_.uuid]=p,e[p]=_,e.pop();for(let x=0,g=r;x!==g;++x){const v=i[x],S=v[p],M=v[y];v[d]=S,v[p]=M,v.pop()}}else{const p=--o,m=e[p];p>0&&(t[m.uuid]=d),e[d]=m,e.pop();for(let y=0,_=r;y!==_;++y){const x=i[y];x[d]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,d=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(d);for(let p=u,m=l.length;p!==m;++p){const y=l[p];d[p]=new Dt(y,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class UL{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:ec,endingEnd:ec};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=TI,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case EE:for(let u=0,d=l.length;u!==d;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case U_:default:for(let u=0,d=l.length;u!==d;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===CI;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===wI){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=tc,r.endingEnd=tc):(e?r.endingStart=this.zeroSlopeAtStart?tc:ec:r.endingStart=sp,t?r.endingEnd=this.zeroSlopeAtEnd?tc:ec:r.endingEnd=sp)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const zH=new Float32Array(1);class FH extends ra{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let d=0;d!==s;++d){const p=r[d],m=p.name;let y=u[m];if(y!==void 0)++y.referenceCount,o[d]=y;else{if(y=o[d],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,l,m));continue}const _=t&&t._propertyBindings[d].binding.parsedPath;y=new OL(Dt.create(i,m,_),p.ValueTypeName,p.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,l,m),o[d]=y}a[d].resultBuffer=y.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const r=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,c=l[l.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,l[u]=c,l.pop(),e._byClipCacheIndex=null;const d=a.actionByRoot,p=(e._localRoot||this._root).uuid;delete d[p],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,s=i.path,o=this._bindingsByRootAndName,a=o[r],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new KE(new Float32Array(2),new Float32Array(2),1,zH),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=i,t[i]=s}clipAction(e,t,i){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?Nh.findByName(r,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let c=null;if(i===void 0&&(o!==null?i=o.blendMode:i=U_),l!==void 0){const d=l.actionByRoot[s];if(d!==void 0&&d.blendMode===i)return d;c=l.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const u=new UL(this,o,t,i);return this._bindAction(u,c),this._addInactiveAction(u,a,s),u}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?Nh.findByName(i,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,s=r[i];if(s!==void 0){const o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){const c=o[a];this._deactivateAction(c);const u=c._cacheIndex,d=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,d._cacheIndex=u,t[u]=d,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const a=i[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class sw{constructor(e){this.value=e}clone(){return new sw(this.value.clone===void 0?this.value:this.value.clone())}}let OH=0;class UH extends ra{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:OH++}),this.name="",this.usage=cp,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let i=0,r=t.length;i<r;i++){const s=Array.isArray(t[i])?t[i]:[t[i]];for(let o=0;o<s.length;o++)this.uniforms.push(s[o].clone())}return this}clone(){return new this.constructor().copy(this)}}class NH extends Np{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class kH{constructor(e,t,i,r,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const W3=new Ke;class ow{constructor(e,t,i=0,r=1/0){this.ray=new hl(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new fc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster:
3857Unsupported camera type: "+t.type)}setFromXRController(e){return W3.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(W3),this}intersectObject(e,t=!0,i=[]){return zS(e,this,i,t),i.sort(j3),i}intersectObjects(e,t=!0,i=[]){for(let r=0,s=e.length;r<s;r++)zS(e[r],this,i,t);return i.sort(j3),i}}function j3(n,e){return n.distance-e.distance}function zS(n,e,t,i){let r=!0;if(n.layers.test(e.layers)&&n.raycast(e,t)===!1&&(r=!1),r===!0&&i===!0){const s=n.children;for(let o=0,a=s.length;o<a;o++)zS(s[o],e,t,!0)}}class NL{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(Bn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class HH{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}const X3=new ce;class GH{constructor(e=new ce(1/0,1/0),t=new ce(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=X3.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,X3).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const J3=new z,q0=new z;class go{constructor(e=new z,t=new z){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){J3.subVectors(e,this.start),q0.subVectors(this.end,this.start);const i=q0.dot(q0);let s=q0.dot(J3)/i;return t&&(s=Bn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}
vendor: 19,533 bytes, line 3857
3857applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const Y3=new z;class VH extends gt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new xt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o<l;o++,a++){const c=o/l*Math.PI*2,u=a/l*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(u),Math.sin(u),1)}i.setAttribute("position",new qe(r,3));const s=new ki({fog:!1,toneMapped:!1});this.cone=new Hs(i,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Y3.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Y3),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ea=new z,$0=new Ke,L1=new Ke;class WH extends Hs{constructor(e){const t=kL(e),i=new xt,r=[],s=[],o=new Re(0,0,1),a=new Re(0,1,0);for(let c=0;c<t.length;c++){const u=t[c];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}i.setAttribute("position",new qe(r,3)),i.setAttribute("color",new qe(s,3));const l=new ki({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");L1.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&($0.multiplyMatrices(L1,a.matrixWorld),Ea.setFromMatrixPosition($0),r.setXYZ(o,Ea.x,Ea.y,Ea.z),$0.multiplyMatrices(L1,a.parent.matrixWorld),Ea.setFromMatrixPosition($0),r.setXYZ(o+1,Ea.x,Ea.y,Ea.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function kL(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,kL(n.children[t]));return e}class jH extends hn{constructor(e,t,i){const r=new Wp(t,4,2),s=new ei({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const XH=new z,K3=new Re,Q3=new Re;class JH extends gt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new Vp(t);r.rotateY(Math.PI*.5),this.material=new ei({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),o=new Float32Array(s.count*3);r.setAttribute("color",new Lt(o,3)),this.add(new hn(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");K3.copy(this.light.color),Q3.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?K3:Q3;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(XH.setFromMatrixPosition(this.light.matrixWorld).negate())}}class YH extends Hs{constructor(e=10,t=10,i=4473924,r=8947848){i=new Re(i),r=new Re(r);const s=t/2,o=e/t,a=e/2,l=[],c=[];for(let p=0,m=0,y=-a;p<=t;p++,y+=o){l.push(-a,0,y,a,0,y),l.push(y,0,-a,y,0,a);const _=p===s?i:r;_.toArray(c,m),m+=3,_.toArray(c,m),m+=3,_.toArray(c,m),m+=3,_.toArray(c,m),m+=3}const u=new xt;u.setAttribute("position",new qe(l,3)),u.setAttribute("color",new qe(c,3));const d=new ki({vertexColors:!0,toneMapped:!1});super(u,d),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class KH extends Hs{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new Re(s),o=new Re(o);const a=[],l=[];if(t>1)for(let d=0;d<t;d++){const p=d/t*(Math.PI*2),m=Math.sin(p)*e,y=Math.cos(p)*e;a.push(0,0,0),a.push(m,0,y);const _=d&1?s:o;l.push(_.r,_.g,_.b),l.push(_.r,_.g,_.b)}for(let d=0;d<i;d++){const p=d&1?s:o,m=e-e/i*d;for(let y=0;y<r;y++){let _=y/r*(Math.PI*2),x=Math.sin(_)*m,g=Math.cos(_)*m;a.push(x,0,g),l.push(p.r,p.g,p.b),_=(y+1)/r*(Math.PI*2),x=Math.sin(_)*m,g=Math.cos(_)*m,a.push(x,0,g),l.push(p.r,p.g,p.b)}}const c=new xt;c.setAttribute("position",new qe(a,3)),c.setAttribute("color",new qe(l,3));const u=new ki({vertexColors:!0,toneMapped:!1});super(c,u),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Z3=new z,eg=new z,q3=new z;class QH extends gt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new xt;r.setAttribute("position",new qe([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new ki({fog:!1,toneMapped:!1});this.lightPlane=new qo(r,s),this.add(this.lightPlane),r=new xt,r.setAttribute("position",new qe([0,0,0,0,0,1],3)),this.targetLine=new qo(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Z3.setFromMatrixPosition(this.light.matrixWorld),eg.setFromMatrixPosition(this.light.target.matrixWorld),q3.subVectors(eg,Z3),this.lightPlane.lookAt(eg),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(eg),this.targetLine.scale.z=q3.length()}}const tg=new z,Rn=new Fp;class ZH extends Hs{constructor(e){const t=new xt,i=new ki({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],o={};a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4");function a(y,_){l(y),l(_)}function l(y){r.push(0,0,0),s.push(0,0,0),o[y]===void 0&&(o[y]=[]),o[y].push(r.length/3-1)}t.setAttribute("position",new qe(r,3)),t.setAttribute("color",new qe(s,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const c=new Re(16755200),u=new Re(16711680),d=new Re(43775),p=new Re(16777215),m=new Re(3355443);this.setColors(c,u,d,p,m)}setColors(e,t,i,r,s){const a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,i.r,i.g,i.b),a.setXYZ(33,i.r,i.g,i.b),a.setXYZ(34,i.r,i.g,i.b),a.setXYZ(35,i.r,i.g,i.b),a.setXYZ(36,i.r,i.g,i.b),a.setXYZ(37,i.r,i.g,i.b),a.setXYZ(38,r.r,r.g,r.b),a.setXYZ(39,r.r,r.g,r.b),a.setXYZ(40,s.r,s.g,s.b),a.setXYZ(41,s.r,s.g,s.b),a.setXYZ(42,s.r,s.g,s.b),a.setXYZ(43,s.r,s.g,s.b),a.setXYZ(44,s.r,s.g,s.b),a.setXYZ(45,s.r,s.g,s.b),a.setXYZ(46,s.r,s.g,s.b),a.setXYZ(47,s.r,s.g,s.b),a.setXYZ(48,s.r,s.g,s.b),a.setXYZ(49,s.r,s.g,s.b),a.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;Rn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Dn("c",t,e,Rn,0,0,-1),Dn("t",t,e,Rn,0,0,1),Dn("n1",t,e,Rn,-i,-r,-1),Dn("n2",t,e,Rn,i,-r,-1),Dn("n3",t,e,Rn,-i,r,-1),Dn("n4",t,e,Rn,i,r,-1),Dn("f1",t,e,Rn,-i,-r,1),Dn("f2",t,e,Rn,i,-r,1),Dn("f3",t,e,Rn,-i,r,1),Dn("f4",t,e,Rn,i,r,1),Dn("u1",t,e,Rn,i*.7,r*1.1,-1),Dn("u2",t,e,Rn,-i*.7,r*1.1,-1),Dn("u3",t,e,Rn,0,r*2,-1),Dn("cf1",t,e,Rn,-i,0,1),Dn("cf2",t,e,Rn,i,0,1),Dn("cf3",t,e,Rn,0,-r,1),Dn("cf4",t,e,Rn,0,r,1),Dn("cn1",t,e,Rn,-i,0,-1),Dn("cn2",t,e,Rn,i,0,-1),Dn("cn3",t,e,Rn,0,-r,-1),Dn("cn4",t,e,Rn,0,r,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Dn(n,e,t,i,r,s,o){tg.set(r,s,o).unproject(i);const a=e[n];if(a!==void 0){const l=t.getAttribute("position");for(let c=0,u=a.length;c<u;c++)l.setXYZ(a[c],tg.x,tg.y,tg.z)}}const ng=new Yt;class qH extends Hs{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),s=new xt;s.setIndex(new Lt(i,1)),s.setAttribute("position",new Lt(r,3)),super(s,new ki({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&ng.setFromObject(this.object),ng.isEmpty())return;const t=ng.min,i=ng.max,r=this.geometry.attributes.position,s=r.array;s[0]=i.x,s[1]=i.y,s[2]=i.z,s[3]=t.x,s[4]=i.y,s[5]=i.z,s[6]=t.x,s[7]=t.y,s[8]=i.z,s[9]=i.x,s[10]=t.y,s[11]=i.z,s[12]=i.x,s[13]=i.y,s[14]=t.z,s[15]=t.x,s[16]=i.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=i.x,s[22]=t.y,s[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class $H extends Hs{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new xt;s.setIndex(new Lt(i,1)),s.setAttribute("position",new qe(r,3)),super(s,new ki({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class eG extends qo{constructor(e,t=1,i=16776960){const r=i,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o=new xt;o.setAttribute("position",new qe(s,3)),o.computeBoundingSphere(),super(o,new ki({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new xt;l.setAttribute("position",new qe(a,3)),l.computeBoundingSphere(),this.add(new hn(l,new ei({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const $3=new z;let ig,D1;class tG extends gt{constructor(e=new z(0,0,1),t=new z(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",ig===void 0&&(ig=new xt,ig.setAttribute("position",new qe([0,0,0,0,1,0],3)),D1=new qh(0,.5,1,5,1),D1.translate(0,-.5,0)),this.position.copy(t),this.line=new qo(ig,new ki({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new hn(D1,new ei({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{$3.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle($3,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class nG extends Hs{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new xt;r.setAttribute("position",new qe(t,3)),r.setAttribute("color",new qe(i,3));const s=new ki({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Re,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class iG{constructor(){this.type="ShapePath",this.color=new Re,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new dp,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const v=[];for(let S=0,M=g.length;S<M;S++){const w=g[S],T=new dc;T.curves=w.curves,v.push(T)}return v}function i(g,v){const S=v.length;let M=!1;for(let w=S-1,T=0;T<S;w=T++){let R=v[w],B=v[T],b=B.x-R.x,P=B.y-R.y;if(Math.abs(P)>Number.EPSILON){if(P<0&&(R=v[T],b=-b,B=v[w],P=-P),g.y<R.y||g.y>B.y)continue;if(g.y===R.y){if(g.x===R.x)return!0}else{const L=P*(g.x-R.x)-b*(g.y-R.y);if(L===0)return!0;if(L<0)continue;M=!M}}else{if(g.y!==R.y)continue;if(B.x<=g.x&&g.x<=R.x||R.x<=g.x&&g.x<=B.x)return!0}}return M}const r=mo.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new dc,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const d=[],p=[];let m=[],y=0,_;p[y]=void 0,m[y]=[];for(let g=0,v=s.length;g<v;g++)a=s[g],_=a.getPoints(),o=r(_),o=e?!o:o,o?(!u&&p[y]&&y++,p[y]={s:new dc,p:_},p[y].s.curves=a.curves,u&&y++,m[y]=[]):m[y].push({h:a,p:_[0]});if(!p[0])return t(s);if(p.length>1){let g=!1,v=0;for(let S=0,M=p.length;S<M;S++)d[S]=[];for(let S=0,M=p.length;S<M;S++){const w=m[S];for(let T=0;T<w.length;T++){const R=w[T];let B=!0;for(let b=0;b<p.length;b++)i(R.p,p[b].p)&&(S!==b&&v++,B?(B=!1,d[b].push(R)):g=!0);B&&d[S].push(R)}}v>0&&g===!1&&(m=d)}let x;for(let g=0,v=p.length;g<v;g++){l=p[g].s,c.push(l),x=m[g];for(let S=0,M=x.length;S<M;S++)l.holes.push(x[S].h)}return c}}class rG extends Fi{constructor(e=1,t=1,i=1,r={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(e,t,{...r,count:i}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ip}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Ip);const sG=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:pE,AddEquation:La,AddOperation:yI,AdditiveAnimationBlendMode:EE,AdditiveBlending:xy,AgXToneMapping:SI,AlphaFormat:_E,AlwaysCompare:UI,AlwaysDepth:uI,AlwaysStencilFunc:TS,AmbientLight:bL,AnimationAction:UL,AnimationClip:Nh,AnimationLoader:cH,AnimationMixer:FH,AnimationObjectGroup:DH,AnimationUtils:sH,ArcCurve:oL,ArrayCamera:$I,ArrowHelper:tG,AttachedBindMode:wS,Audio:FL,AudioAnalyser:EH,AudioContext:nw,AudioListener:AH,AudioLoader:_H,AxesHelper:nG,BackSide:zi,BasicDepthPacking:bI,BasicShadowMap:WB,BatchedMesh:sL,Bone:V_,BooleanKeyframeTrack:Uc,Box2:GH,Box3:Yt,Box3Helper:$H,BoxGeometry:Fc,BoxHelper:qH,BufferAttribute:Lt,BufferGeometry:xt,BufferGeometryLoader:DL,ByteType:mE,Cache:Vo,Camera:Fp,CameraHelper:ZH,CanvasTexture:b9,CapsuleGeometry:J_,CatmullRomCurve3:Hp,CineonToneMapping:vI,CircleGeometry:Y_,ClampToEdgeWrapping:Br,Clock:ax,Color:Re,ColorKeyframeTrack:QE,ColorManagement:Vt,CompressedArrayTexture:C9,CompressedCubeTexture:R9,CompressedTexture:j_,CompressedTextureLoader:uH,ConeGeometry:K_,ConstantAlphaFactor:aI,ConstantColorFactor:sI,CubeCamera:jI,CubeReflectionMapping:Qo,CubeRefractionMapping:tl,CubeTexture:Op,CubeTextureLoader:hH,CubeUVReflectionMapping:Qh,CubicBezierCurve:VE,CubicBezierCurve3:aL,CubicInterpolant:wL,CullFaceBack:SS,CullFaceFront:VB,CullFaceFrontBack:hU,CullFaceNone:GB,Curve:Gs,CurvePath:cL,CustomBlending:jB,CustomToneMapping:AI,CylinderGeometry:qh,Cylindrical:HH,Data3DTexture:bE,DataArrayTexture:k_,DataTexture:po,DataTextureLoader:fH,DataUtils:_N,DecrementStencilOp:vU,DecrementWrapStencilOp:SU,DefaultLoadingManager:ch,DepthFormat:uc,DepthStencilFormat:Tc,DepthTexture:LE,DetachedBindMode:EI,DirectionalLight:tw,DirectionalLightHelper:QH,DiscreteInterpolant:TL,DisplayP3ColorSpace:N_,DodecahedronGeometry:Q_,DoubleSide:Rr,DstAlphaFactor:eI,DstColorFactor:nI,DynamicCopyUsage:OU,DynamicDrawUsage:BU,DynamicReadUsage:DU,EdgesGeometry:uL,EllipseCurve:X_,EqualCompare:DI,EqualDepth:fI,EqualStencilFunc:TU,EquirectangularReflectionMapping:ip,EquirectangularRefractionMapping:rp,Euler:Ur,EventDispatcher:ra,ExtrudeGeometry:q_,FileLoader:Nr,Float16BufferAttribute:EN,Float32BufferAttribute:qe,FloatType:lr,Fog:FE,FogExp2:G_,FramebufferTexture:T9,FrontSide:_s,Frustum:Up,GLBufferAttribute:kH,GLSL1:NU,GLSL3:CS,GreaterCompare:zI,GreaterDepth:pI,GreaterEqualCompare:OI,GreaterEqualDepth:dI,GreaterEqualStencilFunc:PU,GreaterStencilFunc:RU,GridHelper:YH,Group:Go,HalfFloatType:fo,HemisphereLight:RL,HemisphereLightHelper:JH,IcosahedronGeometry:$_,ImageBitmapLoader:zL,ImageLoader:yp,ImageUtils:HI,IncrementStencilOp:xU,IncrementWrapStencilOp:AU,InstancedBufferAttribute:Cc,InstancedBufferGeometry:LL,InstancedInterleavedBuffer:NH,InstancedMesh:NE,Int16BufferAttribute:SN,Int32BufferAttribute:MN,Int8BufferAttribute:xN,IntType:I_,InterleavedBuffer:Np,InterleavedBufferAttribute:il,Interpolant:$h,InterpolateDiscrete:zh,InterpolateLinear:Fh,InterpolateSmooth:Gg,InvertStencilOp:MU,KeepStencilOp:Xl,KeyframeTrack:Vs,LOD:rL,LatheGeometry:Gp,Layers:fc,LessCompare:LI,LessDepth:hI,LessEqualCompare:TE,LessEqualDepth:n
3857p,LessEqualStencilFunc:CU,LessStencilFunc:wU,Light:dl,LightProbe:IL,Line:qo,Line3:go,LineBasicMaterial:ki,LineCurve:WE,LineCurve3:lL,LineDashedMaterial:SL,LineLoop:kE,LineSegments:Hs,LinearDisplayP3ColorSpace:zp,LinearFilter:gn,LinearInterpolant:KE,LinearMipMapLinearFilter:mU,LinearMipMapNearestFilter:pU,LinearMipmapLinearFilter:ls,LinearMipmapNearestFilter:vh,LinearSRGBColorSpace:ia,LinearToneMapping:_I,LinearTransfer:op,Loader:Hi,LoaderUtils:Ka,LoadingManager:ZE,LoopOnce:wI,LoopPingPong:CI,LoopRepeat:TI,LuminanceAlphaFormat:AE,LuminanceFormat:vE,MOUSE:cU,Material:Jn,MaterialLoader:ox,MathUtils:pi,Matrix3:vt,Matrix4:Ke,MaxEquation:KB,Mesh:hn,MeshBasicMaterial:ei,MeshDepthMaterial:DE,MeshDistanceMaterial:zE,MeshLambertMaterial:vL,MeshMatcapMaterial:AL,MeshNormalMaterial:xL,MeshPhongMaterial:yL,MeshPhysicalMaterial:As,MeshStandardMaterial:jp,MeshToonMaterial:_L,MinEquation:YB,MirroredRepeatWrapping:Lh,MixOperation:gI,MultiplyBlending:ES,MultiplyOperation:Lp,NearestFilter:$n,NearestMipMapLinearFilter:dU,NearestMipMapNearestFilter:fU,NearestMipmapLinearFilter:$l,NearestMipmapNearestFilter:B_,NeutralToneMapping:MI,NeverCompare:II,NeverDepth:cI,NeverStencilFunc:EU,NoBlending:uo,NoColorSpace:Uo,NoToneMapping:ho,NormalAnimationBlendMode:U_,NormalBlending:ti,NotEqualCompare:FI,NotEqualDepth:mI,NotEqualStencilFunc:bU,NumberKeyframeTrack:bc,Object3D:gt,ObjectLoader:gH,ObjectSpaceNormalMap:BI,OctahedronGeometry:Vp,OneFactor:ZB,OneMinusConstantAlphaFactor:lI,OneMinusConstantColorFactor:oI,OneMinusDstAlphaFactor:tI,OneMinusDstColorFactor:iI,OneMinusSrcAlphaFactor:Ay,OneMinusSrcColorFactor:$B,OrthographicCamera:sa,P3Primaries:lp,PCFShadowMap:b_,PCFSoftShadowMap:wd,PMREMGenerator:RS,Path:dp,PerspectiveCamera:Un,Plane:io,PlaneGeometry:Oc,PlaneHelper:eG,PointLight:ew,PointLightHelper:jH,Points:HE,PointsMaterial:W_,PolarGridHelper:KH,PolyhedronGeometry:fl,PositionalAudio:MH,PropertyBinding:Dt,PropertyMixer:OL,QuadraticBezierCurve:jE,QuadraticBezierCurve3:XE,Quaternion:Si,QuaternionKeyframeTrack:Pc,QuaternionLinearInterpolant:CL,RED_GREEN_RGTC2_Format:Xy,RED_RGTC1_Format:ME,REVISION:Ip,RGBADepthPacking:PI,RGBAFormat:fi,RGBAIntegerFormat:O_,RGBA_ASTC_10x10_Format:ky,RGBA_ASTC_10x5_Format:Oy,RGBA_ASTC_10x6_Format:Uy,RGBA_ASTC_10x8_Format:Ny,RGBA_ASTC_12x10_Format:Hy,RGBA_ASTC_12x12_Format:Gy,RGBA_ASTC_4x4_Format:by,RGBA_ASTC_5x4_Format:Py,RGBA_ASTC_5x5_Format:By,RGBA_ASTC_6x5_Format:Iy,RGBA_ASTC_6x6_Format:Ly,RGBA_ASTC_8x5_Format:Dy,RGBA_ASTC_8x6_Format:zy,RGBA_ASTC_8x8_Format:Fy,RGBA_BPTC_Format:Pd,RGBA_ETC2_EAC_Format:Ry,RGBA_PVRTC_2BPPV1_Format:wy,RGBA_PVRTC_4BPPV1_Format:Ey,RGBA_S3TC_DXT1_Format:Cd,RGBA_S3TC_DXT3_Format:Rd,RGBA_S3TC_DXT5_Format:bd,RGBFormat:xE,RGBIntegerFormat:gU,RGB_BPTC_SIGNED_Format:Vy,RGB_BPTC_UNSIGNED_Format:Wy,RGB_ETC1_Format:Ty,RGB_ETC2_Format:Cy,RGB_PVRTC_2BPPV1_Format:My,RGB_PVRTC_4BPPV1_Format:Sy,RGB_S3TC_DXT1_Format:Td,RGFormat:SE,RGIntegerFormat:F_,RawShaderMaterial:gL,Ray:hl,Raycaster:ow,Rec709Primaries:ap,RectAreaLight:PL,RedFormat:z_,RedIntegerFormat:Dp,ReinhardToneMapping:xI,RenderTarget:GI,RepeatWrapping:nl,ReplaceStencilOp:_U,ReverseSubtractEquation:JB,RingGeometry:ex,SIGNED_RED_GREEN_RGTC2_Format:Jy,SIGNED_RED_RGTC1_Format:jy,SRGBColorSpace:rs,SRGBTransfer:rn,Scene:Ky,ShaderChunk:Mt,ShaderLib:Fs,ShaderMaterial:vi,ShadowMaterial:mL,Shape:dc,ShapeGeometry:tx,ShapePath:iG,ShapeUtils:mo,ShortType:gE,Skeleton:kp,SkeletonHelper:WH,SkinnedMesh:UE,Source:nc,Sphere:Nn,SphereGeometry:Wp,Spherical:NL,SphericalHarmonics3:BL,SplineCurve:JE,SpotLight:$E,SpotLightHelper:VH,Sprite:iL,SpriteMaterial:OE,SrcAlphaFactor:vy,SrcAlphaSaturateFactor:rI,SrcColorFactor:qB,StaticCopyUsage:FU,StaticDrawUsage:cp,StaticReadUsage:LU,StereoCamera:xH,StreamCopyUsage:UU,StreamDrawUsage:IU,StreamReadUsage:zU,StringKeyframeTrack:Nc,SubtractEquation:XB,SubtractiveBlending:MS,TOUCH:uU,TangentSpaceNormalMap:ul,TetrahedronGeometry:nx,Texture:Zt,TextureLoader:Xp,TextureUtils:s9,TorusGeometry:ix,TorusKnotGeometry:rx,Triangle:hi,TriangleFanDrawMode:Yy,TriangleStripDrawMode:wE,TrianglesDrawMode:RI,TubeGeometry:sx,UVMapping:P_,Uint16BufferAttribute:PE,Uint32BufferAttribute:BE,Uint8BufferAttribute:vN,Uint8ClampedBufferAttribute:AN,Uniform:sw,UniformsGroup:UH,UniformsLib:Fe,UniformsUtils:fp,UnsignedByteType:xs,UnsignedInt248Type:wc,UnsignedInt5999Type:yE,UnsignedIntType:Zo,UnsignedShort4444Type:L_,UnsignedShort5551Type:D_,UnsignedShortType:Dh,VSMShadowMap:Ls,Vector2:ce,Vector3:z,Vector4:Wt,VectorKeyframeTrack:Bc,VideoTexture:w9,WebGL3DRenderTarget:lN,WebGLArrayRenderTarget:aN,WebGLCoordinateSystem:oo,WebGLCubeRen
vendor: 79,892 bytes, lines 3857-3887
3857derTarget:XI,WebGLMultipleRenderTargets:rG,WebGLRenderTarget:Fi,WebGLRenderer:eL,WebGLUtils:qI,WebGPUCoordinateSystem:up,WireframeGeometry:pL,WrapAroundEnding:sp,ZeroCurvatureEnding:ec,ZeroFactor:QB,ZeroSlopeEnding:tc,ZeroStencilOp:yU,createCanvasElement:kI},Symbol.toStringTag,{value:"Module"}));var HL={exports:{}},kc={};/** 3858 * @license React 3859 * react-reconciler-constants.production.min.js 3860 * 3861 * Copyright (c) Facebook, Inc. and its affiliates. 3862 * 3863 * This source code is licensed under the MIT license found in the 3864 * LICENSE file in the root directory of this source tree. 3865 */kc.ConcurrentRoot=1;kc.ContinuousEventPriority=4;kc.DefaultEventPriority=16;kc.DiscreteEventPriority=1;kc.IdleEventPriority=536870912;kc.LegacyRoot=0;HL.exports=kc;var uh=HL.exports;function oG(n){let e;const t=new Set,i=(c,u)=>{const d=typeof c=="function"?c(e):c;if(d!==e){const p=e;e=u?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,s=(c,u=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=u(e);function m(){const y=u(e);if(!d(p,y)){const _=p;c(p=y,_)}}return t.add(m),()=>t.delete(m)},l={setState:i,getState:r,subscribe:(c,u,d)=>u||d?s(c,u,d):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return e=n(i,r,l),l}const aG=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),eR=aG?H.useEffect:H.useLayoutEffect;function GL(n){const e=typeof n=="function"?oG(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=H.useReducer(x=>x+1,0),o=e.getState(),a=H.useRef(o),l=H.useRef(i),c=H.useRef(r),u=H.useRef(!1),d=H.useRef();d.current===void 0&&(d.current=i(o));let p,m=!1;(a.current!==o||l.current!==i||c.current!==r||u.current)&&(p=i(o),m=!r(d.current,p)),eR(()=>{m&&(d.current=p),a.current=o,l.current=i,c.current=r,u.current=!1});const y=H.useRef(o);eR(()=>{const x=()=>{try{const v=e.getState(),S=l.current(v);c.current(d.current,S)||(a.current=v,d.current=S,s())}catch{u.current=!0,s()}},g=e.subscribe(x);return e.getState()!==y.current&&x(),g},[]);const _=m?p:d.current;return H.useDebugValue(_),_};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}const lG=n=>typeof n=="object"&&typeof n.then=="function",rc=[];function VL(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r<i;r++)if(!t(n[r],e[r]))return!1;return!0}function WL(n,e=null,t=!1,i={}){e===null&&(e=[n]);for(const s of rc)if(VL(e,s.keys,s.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(s,"error"))throw s.error;if(Object.prototype.hasOwnProperty.call(s,"response"))return i.lifespan&&i.lifespan>0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=rc.indexOf(r);s!==-1&&rc.splice(s,1)},promise:(lG(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(rc.push(r),!t)throw r.promise}const cG=(n,e,t)=>WL(n,e,!1,t),uG=(n,e,t)=>void WL(n,e,!0,t),hG=n=>{if(n===void 0||n.length===0)rc.splice(0,rc.length);else{const e=rc.find(t=>VL(n,t.keys,t.equal));e&&e.remove()}};var jL={exports:{}},XL={exports:{}},JL={};/** 3866 * @license React 3867 * scheduler.production.min.js 3868 * 3869 * Copyright (c) Facebook, Inc. and its affiliates. 3870 * 3871 * This source code is licensed under the MIT license found in the 3872 * LICENSE file in the root directory of this source tree. 3873 */(function(n){function e(k,Q){var $=k.length;k.push(Q);e:for(;0<$;){var oe=$-1>>>1,xe=k[oe];if(0<r(xe,Q))k[oe]=Q,k[$]=xe,$=oe;else break e}}function t(k){return k.length===0?null:k[0]}function i(k){if(k.length===0)return null;var Q=k[0],$=k.pop();if($!==Q){k[0]=$;e:for(var oe=0,xe=k.length,De=xe>>>1;oe<De;){var ne=2*(oe+1)-1,fe=k[ne],Te=ne+1,Me=k[Te];if(0>r(fe,$))Te<xe&&0>r(Me,fe)?(k[oe]=Me,k[Te]=$,oe=Te):(k[oe]=fe,k[ne]=$,oe=ne);else if(Te<xe&&0>r(Me,$))k[oe]=Me,k[Te]=$,oe=Te;else break e}}return Q}function r(k,Q){var $=k.sortIndex-Q.sortIndex;return $!==0?$:k.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,p=3,m=!1,y=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(k){for(var Q=t(c);Q!==null;){if(Q.callback===null)i(c);else if(Q.startTime<=k)i(c),Q.sortIndex=Q.expirationTime,e(l,Q);else break;Q=t(c)}}function M(k){if(_=!1,S(k),!y)if(t(l)!==null)y=!0,J(w);else{var Q=t(c);Q!==null&&te(M,Q.startTime-k)}}function w(k,Q){y=!1,_&&(_=!1,g(B),B=-1),m=!0;var $=p;try{for(S(Q),d=t(l);d!==null&&(!(d.expirationTime>Q)||k&&!L());){var oe=d.callback;if(typeof oe=="function"){d.callback=null,p=d.priorityLevel;var xe=oe(d.expirationTime<=Q);Q=n.unstable_now(),typeof xe=="function"?d.callback=xe:d===t(l)&&i(l),S(Q)}else i(l);d=t(l)}if(d!==null)var De=!0;else{var ne=t(c);ne!==null&&te(M,ne.startTime-Q),De=!1}return De}finally{d=null,p=$,m=!1}}var T=!1,R=null,B=-1,b=5,P=-1;function L(){return!(n.unstable_now()-P<b)}function U(){if(R!==null){var k=n.unstable_now();P=k;var Q=!0;try{Q=R(!0,k)}finally{Q?G():(T=!1,R=null)}}else T=!1}var G;if(typeof v=="function")G=function(){v(U)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,X=j.port2;j.port1.onmessage=U,G=function(){X.postMessage(null)}}else G=function(){x(U,0)};function J(k){R=k,T||(T=!0,G())}function te(k,Q){B=x(function(){k(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_continueExecution=function(){y||m||(y=!0,J(w))},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(k){switch(p){case 1:case 2:case 3:var Q=3;break;default:Q=p}var $=p;p=Q;try{return k()}finally{p=$}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(k,Q){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var $=p;p=k;try{return Q()}finally{p=$}},n.unstable_scheduleCallback=function(k,Q,$){var oe=n.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?oe+$:oe):$=oe,k){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=$+xe,k={id:u++,callback:Q,priorityLevel:k,startTime:$,expirationTime:xe,sortIndex:-1},$>oe?(k.sortIndex=$,e(c,k),t(l)===null&&k===t(c)&&(_?(g(B),B=-1):_=!0,te(M,$-oe))):(k.sortIndex=xe,e(l,k),y||m||(y=!0,J(w))),k},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(k){var Q=p;return function(){var $=p;p=Q;try{return k.apply(this,arguments)}finally{p=$}}}})(JL);XL.exports=JL;var FS=XL.exports;/** 3874 * @license React 3875 * react-reconciler.production.min.js 3876 * 3877 * Copyright (c) Facebook, Inc. and its affiliates. 3878 * 3879 * This source code is licensed under the MIT license found in the 3880 * LICENSE file in the root directory of this source tree. 3881 */var fG=function(e){var t={},i=H,r=FS,s=Object.assign;function o(h){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+h,A=1;A<arguments.length;A++)f+="&args[]="+encodeURIComponent(arguments[A]);return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),y=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),w=Symbol.iterator;function T(h){return h===null||typeof h!="object"?null:(h=w&&h[w]||h["@@iterator"],typeof h=="function"?h:null)}function R(h){if(h==null)return null;if(typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case u:return"Fragment";case c:return"Portal";case p:return"Profiler";case d:return"StrictMode";case x:return"Suspense";case g:return"SuspenseList"}if(typeof h=="object")switch(h.$$typeof){case y:return(h.displayName||"Context")+".Consumer";case m:return(h._context.displayName||"Context")+".Provider";case _:var f=h.render;return h=h.displayName,h||(h=f.displayName||f.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case v:return f=h.displayName||null,f!==null?f:R(h.type)||"Memo";case S:f=h._payload,h=h._init;try{return R(h(f))}catch{}}return null}function B(h){var f=h.type;switch(h.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return h=f.render,h=h.displayName||h.name||"",f.displayName||(h!==""?"ForwardRef("+h+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(f);case 8:return f===d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function b(h){var f=h,A=h;if(h.alternate)for(;f.return;)f=f.return;else{h=f;do f=h,f.flags&4098&&(A=f.return),h=f.return;while(h)}return f.tag===3?A:null}function P(h){if(b(h)!==h)throw Error(o(188))}function L(h){var f=h.alternate;if(!f){if(f=b(h),f===null)throw Error(o(188));return f!==h?null:h}for(var A=h,E=f;;){var C=A.return;if(C===null)break;var I=C.alternate;if(I===null){if(E=C.return,E!==null){A=E;continue}break}if(C.child===I.child){for(I=C.child;I;){if(I===A)return P(C),h;if(I===E)return P(C),f;I=I.sibling}throw Error(o(188))}if(A.return!==E.return)A=C,E=I;else{for(var V=!1,Y=C.child;Y;){if(Y===A){V=!0,A=C,E=I;break}if(Y===E){V=!0,E=C,A=I;break}Y=Y.sibling}if(!V){for(Y=I.child;Y;){if(Y===A){V=!0,A=I,E=C;break}if(Y===E){V=!0,E=I,A=C;break}Y=Y.sibling}if(!V)throw Error(o(189))}}if(A.alternate!==E)throw Error(o(190))}if(A.tag!==3)throw Error(o(188));return A.stateNode.current===A?h:f}function U(h){return h=L(h),h!==null?G(h):null}function G(h){if(h.tag===5||h.tag===6)return h;for(h=h.child;h!==null;){var f=G(h);if(f!==null)return f;h=h.sibling}return null}function j(h){if(h.tag===5||h.tag===6)return h;for(h=h.child;h!==null;){if(h.tag!==4){var f=j(h);if(f!==null)return f}h=h.sibling}return null}var X=Array.isArray,J=e.getPublicInstance,te=e.getRootHostContext,k=e.getChildHostContext,Q=e.prepareForCommit,$=e.resetAfterCommit,oe=e.createInstance,xe=e.appendInitialChild,De=e.finalizeInitialChildren,ne=e.prepareUpdate,fe=e.shouldSetTextContent,Te=e.createTextInstance,Me=e.scheduleTimeout,it=e.cancelTimeout,ct=e.noTimeout,je=e.isPrimaryRenderer,ke=e.supportsMutation,N=e.supportsPersistence,me=e.supportsHydration,Ae=e.getInstanceFromNode,Le=e.preparePortalMount,de=e.getCurrentEventPriority,Ze=e.detachDeletedInstance,ze=e.supportsMicrotasks,He=e.scheduleMicrotask,W=e.supportsTestSelectors,D=e.findFiberRoot,re=e.getBoundingRect,ve=e.getTextContent,ge=e.isHiddenSubtree,_e=e.matchAccessibilityRole,et=e.setFocusIfFocusable,be=e.setupIntersectionObserver,Ve=e.appendChild,pt=e.appendChildToContainer,Ee=e.commitTextUpdate,Ge=e.commitMount,Pt=e.commitUpdate,ut=e.insertBefore,Xe=e.insertInContainerBefore,dt=e.removeChild,Et=e.removeChildFromContainer,qt=e.resetTextContent,K=e.hideInstance,Ce=e.hideTextInstance,pe=e.unhideInstance,ye=e.unhideTextInstance,Ie=e.clearContainer,lt=e.cloneInstance,Bt=e.createContainerChildSet,yn=e.appendChildToContainerChildSet,Kn=e.finalizeContainerChildren,zt=e.replaceContainerChildren,Vr=e.cloneHiddenInstance,yr=e.cloneHiddenTextInstance,$p=e.canHydrateInstance,xo=e.canHydrateTextInstance,nf=e.canHydrateSuspenseInstance,rf=e.isSuspenseInstancePending,Wc=e.isSuspenseInstanceFallback,jc=e.registerSuspenseInstanceRetry,aa=e.getNextHydratableSibling,Xc=e.getFirstHydratableChild,em=e.getFirstHydratableChildWithinContainer,tm=e.getFirstHydratableChildWithinSuspenseInstance,gx=e.hydrateInstance,yx=e.hydrateTextInstance,_x=e.hydrateSuspenseInstance,O=e.getNextHydratableInstanceAfterSuspenseInstance,Z=e.commitHydratedContainer,se=e.commitHydratedSuspenseInstance,ae=e.clearSuspenseBoundary,ee=e.clearSuspenseBoundaryFromContainer,Pe=e.shouldDeleteUnhydratedTailInstances,Ne=e.didNotMatchHydratedContainerTextInstance,Qe=e.didNotMatchHydratedTextInstance,Ye;function st(h){if(Ye===void 0)try{throw Error()}catch(A){var f=A.stack.trim().match(/\n( *(at )?)/);Ye=f&&f[1]||""}return` 3882`+Ye+h}var at=!1;function rt(h,f){if(!h||at)return"";at=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(we){var E=we}Reflect.construct(h,[],f)}else{try{f.call()}catch(we){E=we}h.call(f.prototype)}else{try{throw Error()}catch(we){E=we}h()}}catch(we){if(we&&E&&typeof we.stack=="string"){for(var C=we.stack.split(` 3883`),I=E.stack.split(` 3884`),V=C.length-1,Y=I.length-1;1<=V&&0<=Y&&C[V]!==I[Y];)Y--;for(;1<=V&&0<=Y;V--,Y--)if(C[V]!==I[Y]){if(V!==1||Y!==1)do if(V--,Y--,0>Y||C[V]!==I[Y]){var ue=` 3885`+C[V].replace(" at new "," at ");return h.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",h.displayName)),ue}while(1<=V&&0<=Y);break}}}finally{at=!1,Error.prepareStackTrace=A}return(h=h?h.displayName||h.name:"")?st(h):""}var Ot=Object.prototype.hasOwnProperty,$t=[],Xt=-1;function Tn(h){return{current:h}}function nt(h){0>Xt||(h.current=$t[Xt],$t[Xt]=null,Xt--)}function Be(h,f){Xt++,$t[Xt]=h.current,h.current=f}var en={},ht=Tn(en),tn=Tn(!1),$i=en;function kn(h,f){var A=h.type.contextTypes;if(!A)return en;var E=h.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===f)return E.__reactInternalMemoizedMaskedChildContext;var C={},I;for(I in A)C[I]=f[I];return E&&(h=h.stateNode,h.__reactInternalMemoizedUnmaskedChildContext=f,h.__reactInternalMemoizedMaskedChildContext=C),C}function ri(h){return h=h.childContextTypes,h!=null}function ln(){nt(tn),nt(ht)}function Ms(h,f,A){if(ht.current!==en)throw Error(o(168));Be(ht,f),Be(tn,A)}function Jc(h,f,A){var E=h.stateNode;if(f=f.childContextTypes,typeof E.getChildContext!="function")return A;E=E.getChildContext();for(var C in E)if(!(C in f))throw Error(o(108,B(h)||"Unknown",C));return s({},A,E)}function yi(h){return h=(h=h.stateNode)&&h.__reactInternalMemoizedMergedChildContext||en,$i=ht.current,Be(ht,h),Be(tn,tn.current),!0}function Yc(h,f,A){var E=h.stateNode;if(!E)throw Error(o(169));A?(h=Jc(h,f,$i),E.__reactInternalMemoizedMergedChildContext=h,nt(tn),nt(ht),Be(ht,h)):nt(tn),Be(tn,A)}var _r=Math.clz32?Math.clz32:Xz,nm=Math.log,jz=Math.LN2;function Xz(h){return h>>>=0,h===0?32:31-(nm(h)/jz|0)|0}var im=64,rm=4194304;function sf(h){switch(h&-h){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 h&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return h&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return h}}function sm(h,f){var A=h.pendingLanes;if(A===0)return 0;var E=0,C=h.suspendedLanes,I=h.pingedLanes,V=A&268435455;if(V!==0){var Y=V&~C;Y!==0?E=sf(Y):(I&=V,I!==0&&(E=sf(I)))}else V=A&~C,V!==0?E=sf(V):I!==0&&(E=sf(I));if(E===0)return 0;if(f!==0&&f!==E&&!(f&C)&&(C=E&-E,I=f&-f,C>=I||C===16&&(I&4194240)!==0))return f;if(E&4&&(E|=A&16),f=h.entangledLanes,f!==0)for(h=h.entanglements,f&=E;0<f;)A=31-_r(f),C=1<<A,E|=h[A],f&=~C;return E}function Jz(h,f){switch(h){case 1:case 2:case 4:return f+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Yz(h,f){for(var A=h.suspendedLanes,E=h.pingedLanes,C=h.expirationTimes,I=h.pendingLanes;0<I;){var V=31-_r(I),Y=1<<V,ue=C[V];ue===-1?(!(Y&A)||Y&E)&&(C[V]=Jz(Y,f)):ue<=f&&(h.expiredLanes|=Y),I&=~Y}}function xx(h){return h=h.pendingLanes&-1073741825,h!==0?h:h&1073741824?1073741824:0}function vx(h){for(var f=[],A=0;31>A;A++)f.push(h);return f}function of(h,f,A){h.pendingLanes|=f,f!==536870912&&(h.suspendedLanes=0,h.pingedLanes=0),h=h.eventTimes,f=31-_r(f),h[f]=A}function Kz(h,f){var A=h.pendingLanes&~f;h.pendingLanes=f,h.suspendedLanes=0,h.pingedLanes=0,h.expiredLanes&=f,h.mutableReadLanes&=f,h.entangledLanes&=f,f=h.entanglements;var E=h.eventTimes;for(h=h.expirationTimes;0<A;){var C=31-_r(A),I=1<<C;f[C]=0,E[C]=-1,h[C]=-1,A&=~I}}function Ax(h,f){var A=h.entangledLanes|=f;for(h=h.entanglements;A;){var E=31-_r(A),C=1<<E;C&f|h[E]&f&&(h[E]|=f),A&=~C}}var Ut=0;function zw(h){return h&=-h,1<h?4<h?h&268435455?16:536870912:4:1}var Sx=r.unstable_scheduleCallback,Fw=r.unstable_cancelCallback,Qz=r.unstable_shouldYield,Zz=r.unstable_requestPaint,si=r.unstable_now,Mx=r.unstable_ImmediatePriority,qz=r.unstable_UserBlockingPriority,Ex=r.unstable_NormalPriority,$z=r.unstable_IdlePriority,om=null,Ws=null;function e4(h){if(Ws&&typeof Ws.onCommitFiberRoot=="function")try{Ws.onCommitFiberRoot(om,h,void 0,(h.current.flags&128)===128)}catch{}}function t4(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var js=typeof Object.is=="function"?Object.is:t4,vo=null,am=!1,wx=!1;function Ow(h){vo===null?vo=[h]:vo.push(h)}function n4(h){am=!0,Ow(h)}function Xs(){if(!wx&&vo!==null){wx=!0;var h=0,f=Ut;try{var A=vo;for(Ut=1;h<A.length;h++){var E=A[h];do E=E(!0);while(E!==null)}vo=null,am=!1}catch(C){throw vo!==null&&(vo=vo.slice(h+1)),Sx(Mx,Xs),C}finally{Ut=f,wx=!1}}return null}var i4=a.ReactCurrentBatchConfig;function lm(h,f){if(js(h,f))return!0;if(typeof h!="object"||h===null||typeof f!="object"||f===null)return!1;var A=Object.keys(h),E=Object.keys(f);if(A.length!==E.length)return!1;for(E=0;E<A.length;E++){var C=A[E];if(!Ot.call(f,C)||!js(h[C],f[C]))return!1}return!0}function r4(h){switch(h.tag){case 5:return st(h.type);case 16:return st("Lazy");case 13:return st("Suspense");case 19:return st("SuspenseList");case 0:case 2:case 15:return h=rt(h.type,!1),h;case 11:return h=rt(h.type.render,!1),h;case 1:return h=rt(h.type,!0),h;default:return""}}function Es(h,f){if(h&&h.defaultProps){f=s({},f),h=h.defaultProps;for(var A in h)f[A]===void 0&&(f[A]=h[A]);return f}return f}var cm=Tn(null),um=null,Kc=null,Tx=null;function Cx(){Tx=Kc=um=null}function Uw(h,f,A){je?(Be(cm,f._currentValue),f._currentValue=A):(Be(cm,f._currentValue2),f._currentValue2=A)}function Rx(h){var f=cm.current;nt(cm),je?h._currentValue=f:h._currentValue2=f}function bx(h,f,A){for(;h!==null;){var E=h.alternate;if((h.childLanes&f)!==f?(h.childLanes|=f,E!==null&&(E.childLanes|=f)):E!==null&&(E.childLanes&f)!==f&&(E.childLanes|=f),h===A)break;h=h.return}}function Qc(h,f){um=h,Tx=Kc=null,h=h.dependencies,h!==null&&h.firstContext!==null&&(h.lanes&f&&(Ar=!0),h.firstContext=null)}function Wr(h){var f=je?h._currentValue:h._currentValue2;if(Tx!==h)if(h={context:h,memoizedValue:f,next:null},Kc===null){if(um===null)throw Error(o(308));Kc=h,um.dependencies={lanes:0,firstContext:h}}else Kc=Kc.next=h;return f}var Js=null,la=!1;function Px(h){h.updateQueue={baseState:h.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nw(h,f){h=h.updateQueue,f.updateQueue===h&&(f.updateQueue={baseState:h.baseState,firstBaseUpdate:h.firstBaseUpdate,lastBaseUpdate:h.lastBaseUpdate,shared:h.shared,effects:h.effects})}function Ao(h,f){return{eventTime:h,lane:f,tag:0,payload:null,callback:null,next:null}}function ca(h,f){var A=h.updateQueue;A!==null&&(A=A.shared,Hn!==null&&h.mode&1&&!(Tt&2)?(h=A.interleaved,h===null?(f.next=f,Js===null?Js=[A]:Js.push(A)):(f.next=h.next,h.next=f),A.interleaved=f):(h=A.pending,h===null?f.next=f:(f.next=h.next,h.next=f),A.pending=f))}function hm(h,f,A){if(f=f.updateQueue,f!==null&&(f=f.shared,(A&4194240)!==0)){var E=f.lanes;E&=h.pendingLanes,A|=E,f.lanes=A,Ax(h,A)}}function kw(h,f){var A=h.updateQueue,E=h.alternate;if(E!==null&&(E=E.updateQueue,A===E)){var C=null,I=null;if(A=A.firstBaseUpdate,A!==null){do{var V={eventTime:A.eventTime,lane:A.lane,tag:A.tag,payload:A.payload,callback:A.callback,next:null};I===null?C=I=V:I=I.next=V,A=A.next}while(A!==null);I===null?C=I=f:I=I.next=f}else C=I=f;A={baseState:E.baseState,firstBaseUpdate:C,lastBaseUpdate:I,shared:E.shared,effects:E.effects},h.updateQueue=A;return}h=A.lastBaseUpdate,h===null?A.firstBaseUpdate=f:h.next=f,A.lastBaseUpdate=f}function fm(h,f,A,E){var C=h.updateQueue;la=!1;var I=C.firstBaseUpdate,V=C.lastBaseUpdate,Y=C.shared.pending;if(Y!==null){C.shared.pending=null;var ue=Y,we=ue.next;ue.next=null,V===null?I=we:V.next=we,V=ue;var Je=h.alternate;Je!==null&&(Je=Je.updateQueue,Y=Je.lastBaseUpdate,Y!==V&&(Y===null?Je.firstBaseUpdate=we:Y.next=we,Je.lastBaseUpdate=ue))}if(I!==null){var yt=C.baseState;V=0,Je=we=ue=null,Y=I;do{var ot=Y.lane,Kt=Y.eventTime;if((E&ot)===ot){Je!==null&&(Je=Je.next={eventTime:Kt,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var tt=h,Ci=Y;switch(ot=f,Kt=A,Ci.tag){case 1:if(tt=Ci.payload,typeof tt=="function"){yt=tt.call(Kt,yt,ot);break e}yt=tt;break e;case 3:tt.flags=tt.flags&-65537|128;case 0:if(tt=Ci.payload,ot=typeof tt=="function"?tt.call(Kt,yt,ot):tt,ot==null)break e;yt=s({},yt,ot);break e;case 2:la=!0}}Y.callback!==null&&Y.lane!==0&&(h.flags|=64,ot=C.effects,ot===null?C.effects=[Y]:ot.push(Y))}else Kt={eventTime:Kt,lane:ot,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Je===null?(we=Je=Kt,ue=yt):Je=Je.next=Kt,V|=ot;if(Y=Y.next,Y===null){if(Y=C.shared.pending,Y===null)break;ot=Y,Y=ot.next,ot.next=null,C.lastBaseUpdate=ot,C.shared.pending=null}}while(!0);if(Je===null&&(ue=yt),C.baseState=ue,C.firstBaseUpdate=we,C.lastBaseUpdate=Je,f=C.shared.interleaved,f!==null){C=f;do V|=C.lane,C=C.next;while(C!==f)}else I===null&&(C.shared.lanes=0);su|=V,h.lanes=V,h.memoizedState=yt}}function Hw(h,f,A){if(h=f.effects,f.effects=null,h!==null)for(f=0;f<h.length;f++){var E=h[f],C=E.callback;if(C!==null){if(E.callback=null,E=A,typeof C!="function")throw Error(o(191,C));C.call(E)}}}var Gw=new i.Component().refs;function Bx(h,f,A,E){f=h.memoizedState,A=A(E,f),A=A==null?f:s({},f,A),h.memoizedState=A,h.lanes===0&&(h.updateQueue.baseState=A)}var dm={isMounted:function(h){return(h=h._reactInternals)?b(h)===h:!1},enqueueSetState:function(h,f,A){h=h._reactInternals;var E=Vi(),C=fa(h),I=Ao(E,C);I.payload=f,A!=null&&(I.callback=A),ca(h,I),f=Kr(h,C,E),f!==null&&hm(f,h,C)},enqueueReplaceState:function(h,f,A){h=h._reactInternals;var E=Vi(),C=fa(h),I=Ao(E,C);I.tag=1,I.payload=f,A!=null&&(I.callback=A),ca(h,I),f=Kr(h,C,E),f!==null&&hm(f,h,C)},enqueueForceUpdate:function(h,f){h=h._reactInternals;var A=Vi(),E=fa(h),C=Ao(A,E);C.tag=2,f!=null&&(C.callback=f),ca(h,C),f=Kr(h,E,A),f!==null&&hm(f,h,E)}};function Vw(h,f,A,E,C,I,V){return h=h.stateNode,typeof h.shouldComponentUpdate=="function"?h.shouldComponentUpdate(E,I,V):f.prototype&&f.prototype.isPureReactComponent?!lm(A,E)||!lm(C,I):!0}function Ww(h,f,A){var E=!1,C=en,I=f.contextType;return typeof I=="object"&&I!==null?I=Wr(I):(C=ri(f)?$i:ht.current,E=f.contextTypes,I=(E=E!=null)?kn(h,C):en),f=new f(A,I),h.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=dm,h.stateNode=f,f._reactInternals=h,E&&(h=h.stateNode,h.__reactInternalMemoizedUnmaskedChildContext=C,h.__reactInternalMemoizedMaskedChildContext=I),f}function jw(h,f,A,E){h=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(A,E),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(A,E),f.state!==h&&dm.enqueueReplaceState(f,f.state,null)}function Ix(h,f,A,E){var C=h.stateNode;C.props=A,C.state=h.memoizedState,C.refs=Gw,Px(h);var I=f.contextType;typeof I=="object"&&I!==null?C.context=Wr(I):(I=ri(f)?$i:ht.current,C.context=kn(h,I)),C.state=h.memoizedState,I=f.getDerivedStateFromProps,typeof I=="function"&&(Bx(h,f,I,A),C.state=h.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(f=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),f!==C.state&&dm.enqueueReplaceState(C,C.state,null),fm(h,A,C,E),C.state=h.memoizedState),typeof C.componentDidMount=="function"&&(h.flags|=4194308)}var Zc=[],qc=0,pm=null,mm=0,jr=[],Xr=0,yl=null,So=1,Mo="";function _l(h,f){Zc[qc++]=mm,Zc[qc++]=pm,pm=h,mm=f}function Xw(h,f,A){jr[Xr++]=So,jr[Xr++]=Mo,jr[Xr++]=yl,yl=h;var E=So;h=Mo;var C=32-_r(E)-1;E&=~(1<<C),A+=1;var I=32-_r(f)+C;if(30<I){var V=C-C%5;I=(E&(1<<V)-1).toString(32),E>>=V,C-=V,So=1<<32-_r(f)+C|A<<C|E,Mo=I+h}else So=1<<I|A<<C|E,Mo=h}function Lx(h){h.return!==null&&(_l(h,1),Xw(h,1,0))}function Dx(h){for(;h===pm;)pm=Zc[--qc],Zc[qc]=null,mm=Zc[--qc],Zc[qc]=null;for(;h===yl;)yl=jr[--Xr],jr[Xr]=null,Mo=jr[--Xr],jr[Xr]=null,So=jr[--Xr],jr[Xr]=null}var xr=null,vr=null,dn=!1,af=!1,ws=null;function Jw(h,f){var A=Qr(5,null,null,0);A.elementType="DELETED",A.stateNode=f,A.return=h,f=h.deletions,f===null?(h.deletions=[A],h.flags|=16):f.push(A)}function Yw(h,f){switch(h.tag){case 5:return f=$p(f,h.type,h.pendingProps),f!==null?(h.stateNode=f,xr=h,vr=Xc(f),!0):!1;case 6:return f=xo(f,h.pendingProps),f!==null?(h.stateNode=f,xr=h,vr=null,!0):!1;case 13:if(f=nf(f),f!==null){var A=yl!==null?{id:So,overflow:Mo}:null;return h.memoizedState={dehydrated:f,treeContext:A,retryLane:1073741824},A=Qr(18,null,null,0),A.stateNode=f,A.return=h,h.child=A,xr=h,vr=null,!0}return!1;default:return!1}}function zx(h){return(h.mode&1)!==0&&(h.flags&128)===0}function Fx(h){if(dn){var f=vr;if(f){var A=f;if(!Yw(h,f)){if(zx(h))throw Error(o(418));f=aa(A);var E=xr;f&&Yw(h,f)?Jw(E,A):(h.flags=h.flags&-4097|2,dn=!1,xr=h)}}else{if(zx(h))throw Error(o(418));h.flags=h.flags&-4097|2,dn=!1,xr=h}}}function Kw(h){for(h=h.return;h!==null&&h.tag!==5&&h.tag!==3&&h.tag!==13;)h=h.return;xr=h}function lf(h){if(!me||h!==xr)return!1;if(!dn)return Kw(h),dn=!0,!1;if(h.tag!==3&&(h.tag!==5||Pe(h.type)&&!fe(h.type,h.memoizedProps))){var f=vr;if(f){if(zx(h)){for(h=vr;h;)h=aa(h);throw Error(o(418))}for(;f;)Jw(h,f),f=aa(f)}}if(Kw(h),h.tag===13){if(!me)throw Error(o(316));if(h=h.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(o(317));vr=O(h)}else vr=xr?aa(h.stateNode):null;return!0}function $c(){me&&(vr=xr=null,af=dn=!1)}function Ox(h){ws===null?ws=[h]:ws.push(h)}function cf(h,f,A){if(h=A.ref,h!==null&&typeof h!="function"&&typeof h!="object"){if(A._owner){if(A=A._owner,A){if(A.tag!==1)throw Error(o(309));var E=A.stateNode}if(!E)throw Error(o(147,h));var C=E,I=""+h;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===I?f.ref:(f=function(V){var Y=C.refs;Y===Gw&&(Y=C.refs={}),V===null?delete Y[I]:Y[I]=V},f._stringRef=I,f)}if(typeof h!="string")throw Error(o(284));if(!A._owner)throw Error(o(290,h))}return h}function gm(h,f){throw h=Object.prototype.toString.call(f),Error(o(31,h==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":h))}function Qw(h){var f=h._init;return f(h._payload)}function Zw(h){function f(ie,q){if(h){var le=ie.deletions;le===null?(ie.deletions=[q],ie.flags|=16):le.push(q)}}function A(ie,q){if(!h)return null;for(;q!==null;)f(ie,q),q=q.sibling;return null}function E(ie,q){for(ie=new Map;q!==null;)q.key!==null?ie.set(q.key,q):ie.set(q.index,q),q=q.sibling;return ie}function C(ie,q){return ie=pa(ie,q),ie.index=0,ie.sibling=null,ie}function I(ie,q,le){return ie.index=le,h?(le=ie.alternate,le!==null?(le=le.index,le<q?(ie.flags|=2,q):le):(ie.flags|=2,q)):(ie.flags|=1048576,q)}function V(ie){return h&&ie.alternate===null&&(ie.flags|=2),ie}function Y(ie,q,le,Ue){return q===null||q.tag!==6?(q=vv(le,ie.mode,Ue),q.return=ie,q):(q=C(q,le),q.return=ie,q)}function ue(ie,q,le,Ue){var $e=le.type;return $e===u?Je(ie,q,le.props.children,Ue,le.key):q!==null&&(q.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===S&&Qw($e)===q.type)?(Ue=C(q,le.props),Ue.ref=cf(ie,q,le),Ue.return=ie,Ue):(Ue=Jm(le.type,le.key,le.props,null,ie.mode,Ue),Ue.ref=cf(ie,q,le),Ue.return=ie,Ue)}function we(ie,q,le,Ue){return q===null||q.tag!==4||q.stateNode.containerInfo!==le.containerInfo||q.stateNode.implementation!==le.implementation?(q=Av(le,ie.mode,Ue),q.return=ie,q):(q=C(q,le.children||[]),q.return=ie,q)}function Je(ie,q,le,Ue,$e){return q===null||q.tag!==7?(q=wl(le,ie.mode,Ue,$e),q.return=ie,q):(q=C(q,le),q.return=ie,q)}function yt(ie,q,le){if(typeof q=="string"&&q!==""||typeof q=="number")return q=vv(""+q,ie.mode,le),q.return=ie,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case l:return le=Jm(q.type,q.key,q.props,null,ie.mode,le),le.ref=cf(ie,null,q),le.return=ie,le;case c:return q=Av(q,ie.mode,le),q.return=ie,q;case S:var Ue=q._init;return yt(ie,Ue(q._payload),le)}if(X(q)||T(q))return q=wl(q,ie.mode,le,null),q.return=ie,q;gm(ie,q)}return null}function ot(ie,q,le,Ue){var $e=q!==null?q.key:null;if(typeof le=="string"&&le!==""||typeof le=="number")return $e!==null?null:Y(ie,q,""+le,Ue);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case l:return le.key===$e?ue(ie,q,le,Ue):null;case c:return le.key===$e?we(ie,q,le,Ue):null;case S:return $e=le._init,ot(ie,q,$e(le._payload),Ue)}if(X(le)||T(le))return $e!==null?null:Je(ie,q,le,Ue,null);gm(ie,le)}return null}function Kt(ie,q,le,Ue,$e){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number")return ie=ie.get(le)||null,Y(q,ie,""+Ue,$e);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case l:return ie=ie.get(Ue.key===null?le:Ue.key)||null,ue(q,ie,Ue,$e);case c:return ie=ie.get(Ue.key===null?le:Ue.key)||null,we(q,ie,Ue,$e);case S:var wt=Ue._init;return Kt(ie,q,le,wt(Ue._payload),$e)}if(X(Ue)||T(Ue))return ie=ie.get(le)||null,Je(q,ie,Ue,$e,null);gm(q,Ue)}return null}function tt(ie,q,le,Ue){for(var $e=null,wt=null,_t=q,Nt=q=0,ai=null;_t!==null&&Nt<le.length;Nt++){_t.index>Nt?(ai=_t,_t=null):ai=_t.sibling;var kt=ot(ie,_t,le[Nt],Ue);if(kt===null){_t===null&&(_t=ai);break}h&&_t&&kt.alternate===null&&f(ie,_t),q=I(kt,q,Nt),wt===null?$e=kt:wt.sibling=kt,wt=kt,_t=ai}if(Nt===le.length)return A(ie,_t),dn&&_l(ie,Nt),$e;if(_t===null){for(;Nt<le.length;Nt++)_t=yt(ie,le[Nt],Ue),_t!==null&&(q=I(_t,q,Nt),wt===null?$e=_t:wt.sibling=_t,wt=_t);return dn&&_l(ie,Nt),$e}for(_t=E(ie,_t);Nt<le.length;Nt++)ai=Kt(_t,ie,Nt,le[Nt],Ue),ai!==null&&(h&&ai.alternate!==null&&_t.delete(ai.key===null?Nt:ai.key),q=I(ai,q,Nt),wt===null?$e=ai:wt.sibling=ai,wt=ai);return h&&_t.forEach(function(ma){return f(ie,ma)}),dn&&_l(ie,Nt),$e}function Ci(ie,q,le,Ue){var $e=T(le);if(typeof $e!="function")throw Error(o(150));if(le=$e.call(le),le==null)throw Error(o(151));for(var wt=$e=null,_t=q,Nt=q=0,ai=null,kt=le.next();_t!==null&&!kt.done;Nt++,kt=le.next()){_t.index>Nt?(ai=_t,_t=null):ai=_t.sibling;var ma=ot(ie,_t,kt.value,Ue);if(ma===null){_t===null&&(_t=ai);break}h&&_t&&ma.alternate===null&&f(ie,_t),q=I(ma,q,Nt),wt===null?$e=ma:wt.sibling=ma,wt=ma,_t=ai}if(kt.done)return A(ie,_t),dn&&_l(ie,Nt),$e;if(_t===null){for(;!kt.done;Nt++,kt=le.next())kt=yt(ie,kt.value,Ue),kt!==null&&(q=I(kt,q,Nt),wt===null?$e=kt:wt.sibling=kt,wt=kt);return dn&&_l(ie,Nt),$e}for(_t=E(ie,_t);!kt.done;Nt++,kt=le.next())kt=Kt(_t,ie,Nt,kt.value,Ue),kt!==null&&(h&&kt.alternate!==null&&_t.delete(kt.key===null?Nt:kt.key),q=I(kt,q,Nt),wt===null?$e=kt:wt.sibling=kt,wt=kt);return h&&_t.forEach(function(D4){return f(ie,D4)}),dn&&_l(ie,Nt),$e}function Zr(ie,q,le,Ue){if(typeof le=="object"&&le!==null&&le.type===u&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case l:e:{for(var $e=le.key,wt=q;wt!==null;){if(wt.key===$e){if($e=le.type,$e===u){if(wt.tag===7){A(ie,wt.sibling),q=C(wt,le.props.children),q.return=ie,ie=q;break e}}else if(wt.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===S&&Qw($e)===wt.type){A(ie,wt.sibling),q=C(wt,le.props),q.ref=cf(ie,wt,le),q.return=ie,ie=q;break e}A(ie,wt);break}else f(ie,wt);wt=wt.sibling}le.type===u?(q=wl(le.props.children,ie.mode,Ue,le.key),q.return=ie,ie=q):(Ue=Jm(le.type,le.key,le.props,null,ie.mode,Ue),Ue.ref=cf(ie,q,le),Ue.return=ie,ie=Ue)}return V(ie);case c:e:{for(wt=le.key;q!==null;){if(q.key===wt)if(q.tag===4&&q.stateNode.containerInfo===le.containerInfo&&q.stateNode.implementation===le.implementation){A(ie,q.sibling),q=C(q,le.children||[]),q.return=ie,ie=q;break e}else{A(ie,q);break}else f(ie,q);q=q.sibling}q=Av(le,ie.mode,Ue),q.return=ie,ie=q}return V(ie);case S:return wt=le._init,Zr(ie,q,wt(le._payload),Ue)}if(X(le))return tt(ie,q,le,Ue);if(T(le))return Ci(ie,q,le,Ue);gm(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,q!==null&&q.tag===6?(A(ie,q.sibling),q=C(q,le),q.return=ie,ie=q):(A(ie,q),q=vv(le,ie.mode,Ue),q.return=ie,ie=q),V(ie)):A(ie,q)}return Zr}var eu=Zw(!0),qw=Zw(!1),uf={},Jr=Tn(uf),hf=Tn(uf),tu=Tn(uf);function Ys(h){if(h===uf)throw Error(o(174));return h}function Ux(h,f){Be(tu,f),Be(hf,h),Be(Jr,uf),h=te(f),nt(Jr),Be(Jr,h)}function nu(){nt(Jr),nt(hf),nt(tu)}function $w(h){var f=Ys(tu.current),A=Ys(Jr.current);f=k(A,h.type,f),A!==f&&(Be(hf,h),Be(Jr,f))}function Nx(h){hf.current===h&&(nt(Jr),nt(hf))}var _n=Tn(0);function ym(h){for(var f=h;f!==null;){if(f.tag===13){var A=f.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||rf(A)||Wc(A)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===h)break;for(;f.sibling===null;){if(f.return===null||f.return===h)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var kx=[];function Hx(){for(var h=0;h<kx.length;h++){var f=kx[h];je?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}kx.length=0}var _m=a.ReactCurrentDispatcher,Yr=a.ReactCurrentBatchConfig,iu=0,Cn=null,Ei=null,oi=null,xm=!1,ff=!1,df=0,s4=0;function wi(){throw Error(o(321))}function Gx(h,f){if(f===null)return!1;for(var A=0;A<f.length&&A<h.length;A++)if(!js(h[A],f[A]))return!1;return!0}function Vx(h,f,A,E,C,I){if(iu=I,Cn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,_m.current=h===null||h.memoizedState===null?c4:u4,h=A(E,C),ff){I=0;do{if(ff=!1,df=0,25<=I)throw Error(o(301));I+=1,oi=Ei=null,f.updateQueue=null,_m.current=h4,h=A(E,C)}while(ff)}if(_m.current=Em,f=Ei!==null&&Ei.next!==null,iu=0,oi=Ei=Cn=null,xm=!1,f)throw Error(o(300));return h}function Wx(){var h=df!==0;return df=0,h}function Eo(){var h={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oi===null?Cn.memoizedState=oi=h:oi=oi.next=h,oi}function Ks(){if(Ei===null){var h=Cn.alternate;h=h!==null?h.memoizedState:null}else h=Ei.next;var f=oi===null?Cn.memoizedState:oi.next;if(f!==null)oi=f,Ei=h;else{if(h===null)throw Error(o(310));Ei=h,h={memoizedState:Ei.memoizedState,baseState:Ei.baseState,baseQueue:Ei.baseQueue,queue:Ei.queue,next:null},oi===null?Cn.memoizedState=oi=h:oi=oi.next=h}return oi}function xl(h,f){return typeof f=="function"?f(h):f}function vm(h){var f=Ks(),A=f.queue;if(A===null)throw Error(o(311));A.lastRenderedReducer=h;var E=Ei,C=E.baseQueue,I=A.pending;if(I!==null){if(C!==null){var V=C.next;C.next=I.next,I.next=V}E.baseQueue=C=I,A.pending=null}if(C!==null){I=C.next,E=E.baseState;var Y=V=null,ue=null,we=I;do{var Je=we.lane;if((iu&Je)===Je)ue!==null&&(ue=ue.next={lane:0,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null}),E=we.hasEagerState?we.eagerState:h(E,we.action);else{var yt={lane:Je,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null};ue===null?(Y=ue=yt,V=E):ue=ue.next=yt,Cn.lanes|=Je,su|=Je}we=we.next}while(we!==null&&we!==I);ue===null?V=E:ue.next=Y,js(E,f.memoizedState)||(Ar=!0),f.memoizedState=E,f.baseState=V,f.baseQueue=ue,A.lastRenderedState=E}if(h=A.interleaved,h!==null){C=h;do I=C.lane,Cn.lanes|=I,su|=I,C=C.next;while(C!==h)}else C===null&&(A.lanes=0);return[f.memoizedState,A.dispatch]}function Am(h){var f=Ks(),A=f.queue;if(A===null)throw Error(o(311));A.lastRenderedReducer=h;var E=A.dispatch,C=A.pending,I=f.memoizedState;if(C!==null){A.pending=null;var V=C=C.next;do I=h(I,V.action),V=V.next;while(V!==C);js(I,f.memoizedState)||(Ar=!0),f.memoizedState=I,f.baseQueue===null&&(f.baseState=I),A.lastRenderedState=I}return[I,E]}function eT(){}function tT(h,f){var A=Cn,E=Ks(),C=f(),I=!js(E.memoizedState,C);if(I&&(E.memoizedState=C,Ar=!0),E=E.queue,mf(rT.bind(null,A,E,h),[h]),E.getSnapshot!==f||I||oi!==null&&oi.memoizedState.tag&1){if(A.flags|=2048,pf(9,iT.bind(null,A,E,C,f),void 0,null),Hn===null)throw Error(o(349));iu&30||nT(A,f,C)}return C}function nT(h,f,A){h.flags|=16384,h={getSnapshot:f,value:A},f=Cn.updateQueue,f===null?(f={lastEffect:null,stores:null},Cn.updateQueue=f,f.stores=[h]):(A=f.stores,A===null?f.stores=[h]:A.push(h))}function iT(h,f,A,E){f.value=A,f.getSnapshot=E,sT(f)&&Kr(h,1,-1)}function rT(h,f,A){return A(function(){sT(f)&&Kr(h,1,-1)})}function sT(h){var f=h.getSnapshot;h=h.value;try{var A=f();return!js(h,A)}catch{return!0}}function jx(h){var f=Eo();return typeof h=="function"&&(h=h()),f.memoizedState=f.baseState=h,h={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:h},f.queue=h,h=h.dispatch=l4.bind(null,Cn,h),[f.memoizedState,h]}function pf(h,f,A,E){return h={tag:h,create:f,destroy:A,deps:E,next:null},f=Cn.updateQueue,f===null?(f={lastEffect:null,stores:null},Cn.updateQueue=f,f.lastEffect=h.next=h):(A=f.lastEffect,A===null?f.lastEffect=h.next=h:(E=A.next,A.next=h,h.next=E,f.lastEffect=h)),h}function oT(){return Ks().memoizedState}function Sm(h,f,A,E){var C=Eo();Cn.flags|=h,C.memoizedState=pf(1|f,A,void 0,E===void 0?null:E)}function Mm(h,f,A,E){var C=Ks();E=E===void 0?null:E;var I=void 0;if(Ei!==null){var V=Ei.memoizedState;if(I=V.destroy,E!==null&&Gx(E,V.deps)){C.memoizedState=pf(f,A,I,E);return}}Cn.flags|=h,C.memoizedState=pf(1|f,A,I,E)}function Xx(h,f){return Sm(8390656,8,h,f)}function mf(h,f){return Mm(2048,8,h,f)}function aT(h,f){return Mm(4,2,h,f)}function lT(h,f){return Mm(4,4,h,f)}function cT(h,f){if(typeof f=="function")return h=h(),f(h),function(){f(null)};if(f!=null)return h=h(),f.current=h,function(){f.current=null}}function uT(h,f,A){return A=A!=null?A.concat([h]):null,Mm(4,4,cT.bind(null,f,h),A)}function Jx(){}function hT(h,f){var A=Ks();f=f===void 0?null:f;var E=A.memoizedState;return E!==null&&f!==null&&Gx(f,E[1])?E[0]:(A.memoizedState=[h,f],h)}function fT(h,f){var A=Ks();f=f===void 0?null:f;var E=A.memoizedState;return E!==null&&f!==null&&Gx(f,E[1])?E[0]:(h=h(),A.memoizedState=[h,f],h)}function o4(h,f){var A=Ut;Ut=A!==0&&4>A?A:4,h(!0);var E=Yr.transition;Yr.transition={};try{h(!1),f()}finally{Ut=A,Yr.transition=E}}function dT(){return Ks().memoizedState}function a4(h,f,A){var E=fa(h);A={lane:E,action:A,hasEagerState:!1,eagerState:null,next:null},pT(h)?mT(f,A):(gT(h,f,A),A=Vi(),h=Kr(h,E,A),h!==null&&yT(h,f,E))}function l4(h,f,A){var E=fa(h),C={lane:E,action:A,hasEagerState:!1,eagerState:null,next:null};if(pT(h))mT(f,C);else{gT(h,f,C);var I=h.alternate;if(h.lanes===0&&(I===null||I.lanes===0)&&(I=f.lastRenderedReducer,I!==null))try{var V=f.lastRenderedState,Y=I(V,A);if(C.hasEagerState=!0,C.eagerState=Y,js(Y,V))return}catch{}finally{}A=Vi(),h=Kr(h,E,A),h!==null&&yT(h,f,E)}}function pT(h){var f=h.alternate;return h===Cn||f!==null&&f===Cn}function mT(h,f){ff=xm=!0;var A=h.pending;A===null?f.next=f:(f.next=A.next,A.next=f),h.pending=f}function gT(h,f,A){Hn!==null&&h.mode&1&&!(Tt&2)?(h=f.interleaved,h===null?(A.next=A,Js===null?Js=[f]:Js.push(f)):(A.next=h.next,h.next=A),f.interleaved=A):(h=f.pending,h===null?A.next=A:(A.next=h.next,h.next=A),f.pending=A)}function yT(h,f,A){if(A&4194240){var E=f.lanes;E&=h.pendingLanes,A|=E,f.lanes=A,Ax(h,A)}}var Em={readContext:Wr,useCallback:wi,useContext:wi,useEffect:wi,useImperativeHandle:wi,useInsertionEffect:wi,useLayoutEffect:wi,useMemo:wi,useReducer:wi,useRef:wi,useState:wi,useDebugValue:wi,useDeferredValue:wi,useTransition:wi,useMutableSource:wi,useSyncExternalStore:wi,useId:wi,unstable_isNewReconciler:!1},c4={readContext:Wr,useCallback:function(h,f){return Eo().memoizedState=[h,f===void 0?null:f],h},useContext:Wr,useEffect:Xx,useImperativeHandle:function(h,f,A){return A=A!=null?A.concat([h]):null,Sm(4194308,4,cT.bind(null,f,h),A)},useLayoutEffect:function(h,f){return Sm(4194308,4,h,f)},useInsertionEffect:function(h,f){return Sm(4,2,h,f)},useMemo:function(h,f){var A=Eo();return f=f===void 0?null:f,h=h(),A.memoizedState=[h,f],h},useReducer:function(h,f,A){var E=Eo();return f=A!==void 0?A(f):f,E.memoizedState=E.baseState=f,h={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:h,lastRenderedState:f},E.queue=h,h=h.dispatch=a4.bind(null,Cn,h),[E.memoizedState,h]},useRef:function(h){var f=Eo();return h={current:h},f.memoizedState=h},useState:jx,useDebugValue:Jx,useDeferredValue:function(h){var f=jx(h),A=f[0],E=f[1];return Xx(function(){var C=Yr.transition;Yr.transition={};try{E(h)}finally{Yr.transition=C}},[h]),A},useTransition:function(){var h=jx(!1),f=h[0];return h=o4.bind(null,h[1]),Eo().memoizedState=h,[f,h]},useMutableSource:function(){},useSyncExternalStore:function(h,f,A){var E=Cn,C=Eo();if(dn){if(A===void 0)throw Error(o(407));A=A()}else{if(A=f(),Hn===null)throw Error(o(349));iu&30||nT(E,f,A)}C.memoizedState=A;var I={value:A,getSnapshot:f};return C.queue=I,Xx(rT.bind(null,E,I,h),[h]),E.flags|=2048,pf(9,iT.bind(null,E,I,A,f),void 0,null),A},useId:function(){var h=Eo(),f=Hn.identifierPrefix;if(dn){var A=Mo,E=So;A=(E&~(1<<32-_r(E)-1)).toString(32)+A,f=":"+f+"R"+A,A=df++,0<A&&(f+="H"+A.toString(32)),f+=":"}else A=s4++,f=":"+f+"r"+A.toString(32)+":";return h.memoizedState=f},unstable_isNewReconciler:!1},u4={readContext:Wr,useCallback:hT,useContext:Wr,useEffect:mf,useImperativeHandle:uT,useInsertionEffect:aT,useLayoutEffect:lT,useMemo:fT,useReducer:vm,useRef:oT,useState:function(){return vm(xl)},useDebugValue:Jx,useDeferredValue:function(h){var f=vm(xl),A=f[0],E=f[1];return mf(function(){var C=Yr.transition;Yr.transition={};try{E(h)}finally{Yr.transition=C}},[h]),A},useTransition:function(){var h=vm(xl)[0],f=Ks().memoizedState;return[h,f]},useMutableSource:eT,useSyncExternalStore:tT,useId:dT,unstable_isNewReconciler:!1},h4={readContext:Wr,useCallback:hT,useContext:Wr,useEffect:mf,useImperativeHandle:uT,useInsertionEffect:aT,useLayoutEffect:lT,useMemo:fT,useReducer:Am,useRef:oT,useState:function(){return Am(xl)},useDebugValue:Jx,useDeferredValue:function(h){var f=Am(xl),A=f[0],E=f[1];return mf(function(){var C=Yr.transition;Yr.transition={};try{E(h)}finally{Yr.transition=C}},[h]),A},useTransition:function(){var h=Am(xl)[0],f=Ks().memoizedState;return[h,f]},useMutableSource:eT,useSyncExternalStore:tT,useId:dT,unstable_isNewReconciler:!1};function Yx(h,f){try{var A="",E=f;do A+=r4(E),E=E.return;while(E);var C=A}catch(I){C=` 3886Error generating stack: `+I.message+` 3887`+I.stack}return{value:h,source:f,stack:C}}function Kx(h,f){try{console.error(f.value)}catch(A){setTimeout(function(){throw A})}}var f4=typeof WeakMap=="function"?WeakMap:Map;function _T(h,f,A){A=Ao(-1,A),A.tag=3,A.payload={element:null};var E=f.value;return A.callback=function(){km||(km=!0,dv=E),Kx(h,f)},A}function xT(h,f,A){A=Ao(-1,A),A.tag=3;var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var C=f.value;A.payload=function(){return E(C)},A.callback=function(){Kx(h,f)}}var I=h.stateNode;return I!==null&&typeof I.componentDidCatch=="function"&&(A.callback=function(){Kx(h,f),typeof E!="function"&&(ua===null?ua=new Set([this]):ua.add(this));var V=f.stack;this.componentDidCatch(f.value,{componentStack:V!==null?V:""})}),A}function vT(h,f,A){var E=h.pingCache;if(E===null){E=h.pingCache=new f4;var C=new Set;E.set(f,C)}else C=E.get(f),C===void 0&&(C=new Set,E.set(f,C));C.has(A)||(C.add(A),h=T4.bind(null,h,f,A),f.then(h,h))}function AT(h){do{var f;if((f=h.tag===13)&&(f=h.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return h;h=h.return}while(h!==null);return null}function ST(h,f,A,E,C){return h.mode&1?(h.flags|=65536,h.lanes=C,h):(h===f?h.flags|=65536:(h.flags|=128,A.flags|=131072,A.flags&=-52805,A.tag===1&&(A.alternate===null?A.tag=17:(f=Ao(-1,1),f.tag=2,ca(A,f))),A.lanes|=1),h)}function Qs(h){h.flags|=4}function MT(h,f){if(h!==null&&h.child===f.child)return!0;if(f.flags&16)return!1;for(h=f.child;h!==null;){if(h.flags&12854||h.subtreeFlags&12854)return!1;h=h.sibling}return!0}var gf,yf,wm,Tm;if(ke)gf=function(h,f){for(var A=f.child;A!==null;){if(A.tag===5||A.tag===6)xe(h,A.stateNode);else if(A.tag!==4&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===f)break;for(;A.sibling===null;){if(A.return===null||A.return===f)return;A=A.return}A.sibling.return=A.return,A=A.sibling}},yf=function(){},wm=function(h,f,A,E,C){if(h=h.memoizedProps,h!==E){var I=f.stateNode,V=Ys(Jr.current);A=ne(I,A,h,E,C,V),(f.updateQueue=A)&&Qs(f)}},Tm=function(h,f,A,E){A!==E&&Qs(f)};else if(N){gf=function(h,f,A,E){for(var C=f.child;C!==null;){if(C.tag===5){var I=C.stateNode;A&&E&&(I=Vr(I,C.type,C.memoizedProps,C)),xe(h,I)}else if(C.tag===6)I=C.stateNode,A&&E&&(I=yr(I,C.memoizedProps,C)),xe(h,I);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)I=C.child,I!==null&&(I.return=C),gf(h,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===f)break;for(;C.sibling===null;){if(C.return===null||C.return===f)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};var ET=function(h,f,A,E){for(var C=f.child;C!==null;){if(C.tag===5){var I=C.stateNode;A&&E&&(I=Vr(I,C.type,C.memoizedProps,C)),yn(h,I)}else if(C.tag===6)I=C.stateNode,A&&E&&(I=yr(I,C.memoizedProps,C)),yn(h,I);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)I=C.child,I!==null&&(I.return=C),ET(h,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===f)break;for(;C.sibling===null;){if(C.return===null||C.return===f)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};yf=function(h,f){var A=f.stateNode;if(!MT(h,f)){h=A.containerInfo;var E=Bt(h);ET(E,f,!1,!1),A.pendingChildren=E,Qs(f),Kn(h,E)}},wm=function(h,f,A,E,C){var I=h.stateNode,V=h.memoizedProps;if((h=MT(h,f))&&V===E)f.stateNode=I;else{var Y=f.stateNode,ue=Ys(Jr.current),we=null;V!==E&&(we=ne(Y,A,V,E,C,ue)),h&&we===null?f.stateNode=I:(I=lt(I,we,A,V,E,f,h,Y),De(I,A,E,C,ue)&&Qs(f),f.stateNode=I,h?Qs(f):gf(I,f,!1,!1))}},Tm=function(h,f,A,E){A!==E?(h=Ys(tu.current),A=Ys(Jr.current),f.stateNode=Te(E,h,A,f),Qs(f)):f.stateNode=h.stateNode}}else yf=function(){},wm=function(){},Tm=function(){};function _f(h,f){if(!dn)switch(h.tailMode){case"hidden":f=h.tail;for(var A=null;f!==null;)f.alternate!==null&&(A=f),f=f.sibling;A===null?h.tail=null:A.sibling=null;break;case"collapsed":A=h.tail;for(var E=null;A!==null;)A.alternate!==null&&(E=A),A=A.sibling;E===null?f||h.tail===null?h.tail=null:h.tail.sibling=null:E.sibling=null}}function Ti(h){var f=h.alternate!==null&&h.alternate.child===h.child,A=0,E=0;if(f)for(var C=h.child;C!==null;)A|=C.lanes|C.childLanes,E|=C.subtreeFlags&14680064,E|=C.flags&14680064,C.return=h,C=C.sibling;else for(C=h.child;C!==null;)A|=C.lanes|C.childLanes,E|=C.subtreeFlags,E|=C.flags,C.return=h,C=C.sibling;return h.subtreeFlags|=E,h.childLanes=A,f}function d4(h,f,A){var E=f.pendingProps;switch(Dx(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ti(f),null;case 1:return ri(f.type)&&ln(),Ti(f),null;case 3:return E=f.stateNode,nu(),nt(tn),nt(ht),Hx(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(h===null||h.child===null)&&(lf(f)?Qs(f):h===null||h.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,ws!==null&&(gv(ws),ws=null))),yf(h,f),Ti(f),null;case 5:Nx(f),A=Ys(tu.current);var C=f.type;if(h!==null&&f.stateNode!=null)wm(h,f,C,E,A),h.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!E){if(f.stateNode===null)throw Error(o(166));return Ti(f),null}if(h=Ys(Jr.current),lf(f)){if(!me)throw Error(o(175));h=gx(f.stateNode,f.type,f.memoizedProps,A,h,f,!af),f.updateQueue=h,h!==null&&Qs(f)}else{var I=oe(C,E,A,h,f);gf(I,f,!1,!1),f.stateNode=I,De(I,C,E,A,h)&&Qs(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Ti(f),null;case 6:if(h&&f.stateNode!=null)Tm(h,f,h.memoizedProps,E);else{if(typeof E!="string"&&f.stateNode===null)throw Error(o(166));if(h=Ys(tu.current),A=Ys(Jr.current),lf(f)){if(!me)throw Error(o(176));if(h=f.stateNode,E=f.memoizedProps,(A=yx(h,E,f,!af))&&(C=xr,C!==null))switch(I=(C.mode&1)!==0,C.tag){case 3:Ne(C.stateNode.containerInfo,h,E,I);break;case 5:Qe(C.type,C.memoizedProps,C.stateNode,h,E,I)}A&&Qs(f)}else f.stateNode=Te(E,h,A,f)}return Ti(f),null;case 13:if(nt(_n),E=f.memoizedState,dn&&vr!==null&&f.mode&1&&!(f.flags&128)){for(h=vr;h;)h=aa(h);return $c(),f.flags|=98560,f}if(E!==null&&E.dehydrated!==null){if(E=lf(f),h===null){if(!E)throw Error(o(318));if(!me)throw Error(o(344));if(h=f.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(o(317));_x(h,f)}else $c(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;return Ti(f),null}return ws!==null&&(gv(ws),ws=null),f.flags&128?(f.lanes=A,f):(E=E!==null,A=!1,h===null?lf(f):A=h.memoizedState!==null,E&&!A&&(f.child.flags|=8192,f.mode&1&&(h===null||_n.current&1?Qn===0&&(Qn=3):_v())),f.updateQueue!==null&&(f.flags|=4),Ti(f),null);case 4:return nu(),yf(h,f),h===null&&Le(f.stateNode.containerInfo),Ti(f),null;case 10:return Rx(f.type._context),Ti(f),null;case 17:return ri(f.type)&&ln(),Ti(f),null;case 19:if(nt(_n),C=f.memoizedState,C===null)return Ti(f),null;if(E=(f.flags&128)!==0,I=C.rendering,I===null)if(E)_f(C,!1);else{if(Qn!==0||h!==null&&h.flags&128)for(h=f.child;h!==null;){if(I=ym(h),I!==null){for(f.flags|=128,_f(C,!1),h=I.updateQueue,h!==null&&(f.updateQueue=h,f.flags|=4),f.subtreeFlags=0,h=A,E=f.child;E!==null;)A=E,C=h,A.flags&=14680066,I=A.alternate,I===null?(A.childLanes=0,A.lanes=C,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=I.childLanes,A.lanes=I.lanes,A.child=I.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=I.memoizedProps,A.memoizedState=I.memoizedState,A.updateQueue=I.updateQueue,A.type=I.type,C=I.dependencies,A.dependencies=C===null?null:{lanes:C.lanes,firstContext:C.firstContext}),E=E.sibling;return Be(_n,_n.current&1|2),f.child}h=h.sibling}C.tail!==null&&si()>fv&&(f.flags|=128,E=!0,_f(C,!1),f.lanes=4194304)}else{if(!E)if(h=ym(I),h!==null){if(f.flags|=128,E=!0,h=h.updateQueue,h!==null&&(f.updateQueue=h,f.flags|=4),_f(C,!0),C.tail===null&&C.tailMode==="hidden"&&!I.alternate&&!dn)return Ti(f),null}else 2*si()-C.renderingStartTime>fv&&A!==1073741824&&(f.flags|=128,E=!0,_f(C,!1),f.lanes=4194304);C.isBackwards?(I.sibling=f.child,f.child=I):(h=C.last,h!==null?h.sibling=I:f.child=I,C.last=I)}return C.tail!==null?(f=C.tail,C.rendering=f,C.tail=f.sibling,C.renderingStartTime=si(),f.sibling=null,h=_n.current,Be(_n,E?h&1|2:h&1),f):(Ti(f),null);case 22:case 23:return yv(),E=f.memoizedState!==null,h!==null&&h.memoizedState!==null!==E&&(f.flags|=8192),E&&f.mode&1?Sr&1073741824&&(Ti(f),ke&&f.subtreeFlags&6&&(f.flags|=8192)):Ti(f),null;case 24:return null;case 25:return null}throw Error(o(156,f.tag))}var p4=a.ReactCurrentOwner,Ar=!1;function Gi(h,f,A,E){f.child=h===null?qw(f,null,A,E):eu(f,h.child,A,E)}function wT(h,f,A,E,C){A=A.render;var I=f.ref;return Qc(f,C),E=Vx(h,f,A,E,I,C),A=Wx(),h!==null&&!Ar?(f.updateQueue=h.updateQueue,f.flags&=-2053,h.lanes&=~C,wo(h,f,C)):(dn&&A&&Lx(f),f.flags|=1,Gi(h,f,E,C),f.child)}function TT(h,f,A,E,C){if(h===null){var I=A.type;return typeof I=="function"&&!xv(I)&&I.defaultProps===void 0&&A.compare===null&&A.defaultProps===void 0?(f.tag=15,f.type=I,CT(h,f,I,E,C)):(h=Jm(A.type,null,E,f,f.mode,C),h.ref=f.ref,h.return=f,f.child=h)}if(I=h.child,!(h.lanes&C)){var V=I.memoizedProps;if(A=A.compare,A=A!==null?A:lm,A(V,E)&&h.ref===f.ref)return wo(h,f,C)}return f.flags|=1,h=pa(I,E),h.ref=f.ref,h.return=f,f.child=h}function CT(h,f,A,E,C){if(h!==null&&lm(h.memoizedProps,E)&&h.ref===f.ref)if(Ar=!1,(h.lanes&C)!==0)h.flags&131072&&(Ar=!0);else return f.lanes=h.lanes,wo(h,f,C);return Qx(h,f,A,E,C)}function RT(h,f,A){var E=f.pendingProps,C=E.children,I=h!==null?h.memoizedState:null;if(E.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null},Be(ru,Sr),Sr|=A;else if(A&1073741824)f.memoizedState={baseLanes:0,cachePool:null},E=I!==null?I.baseLanes:A,Be(ru,Sr),Sr|=E;else return h=I!==null?I.baseLanes|A:A,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:h,cachePool:null},f.updateQueue=null,Be(ru,Sr),Sr|=h,null;else I!==null?(E=I.baseLanes|A,f.memoizedState=null):E=A,Be(ru,Sr),Sr|=E;return Gi(h,f,C,A),f.child}function bT(h,f){var A=f.ref;(h===null&&A!==null||h!==null&&h.ref!==A)&&(f.flags|=512,f.flags|=2097152)}function Qx(h,f,A,E,C){var I=ri(A)?$i:ht.current;return I=kn(f,I),Qc(f,C),A=Vx(h,f,A,E,I,C),E=Wx(),h!==null&&!Ar?(f.updateQueue=h.updateQueue,f.flags&=-2053,h.lanes&=~C,wo(h,f,C)):(dn&&E&&Lx(f),f.flags|=1,Gi(h,f,A,C),f.child)}function PT(h,f,A,E,C){if(ri(A)){var I=!0;yi(f)}else I=!1;if(Qc(f,C),f.stateNode===null)h!==null&&(h.alternate=null,f.alternate=null,f.flags|=2),Ww(f,A,E),Ix(f,A,E,C),E=!0;else if(h===null){var V=f.stateNode,Y=f.memoizedProps;V.props=Y;var ue=V.context,we=A.contextType;typeof we=="object"&&we!==null?we=Wr(we):(we=ri(A)?$i:ht.current,we=kn(f,we));var Je=A.getDerivedStateFromProps,yt=typeof Je=="function"||typeof V.getSnapshotBeforeUpdate=="function";yt||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Y!==E||ue!==we)&&jw(f,V,E,we),la=!1;var ot=f.memoizedState;V.state=ot,fm(f,E,V,C),ue=f.memoizedState,Y!==E||ot!==ue||tn.current||la?(typeof Je=="function"&&(Bx(f,A,Je,E),ue=f.memoizedState),(Y=la||Vw(f,A,Y,E,ot,ue,we))?(yt||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(f.flags|=4194308)):(typeof V.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=E,f.memoizedState=ue),V.props=E,V.state=ue,V.context=we,E=Y):(typeof V.componentDidMount=="function"&&(f.flags|=4194308),E=!1)}else{V=f.stateNode,Nw(h,f),Y=f.memoizedProps,we=f.type===f.elementType?Y:Es(f.type,Y),V.props=we,yt=f.pendingProps,ot=V.context,ue=A.contextType,typeof ue=="object"&&ue!==null?ue=Wr(ue):(ue=ri(A)?$i:ht.current,ue=kn(f,ue));var Kt=A.getDerivedStateFromProps;(Je=typeof Kt=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Y!==yt||ot!==ue)&&jw(f,V,E,ue),la=!1,ot=f.memoizedState,V.state=ot,fm(f,E,V,C);var tt=f.memoizedState;Y!==yt||ot!==tt||tn.current||la?(typeof Kt=="function"&&(Bx(f,A,Kt,E),tt=f.memoizedState),(we=la||Vw(f,A,we,E,ot,tt,ue)||!1)?(Je||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(E,tt,ue),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(E,tt,ue)),typeof V.componentDidUpdate=="function"&&(f.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof V.componentDidUpdate!="function"||Y===h.memoizedProps&&ot===h.memoizedState||(f.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Y===h.memoizedProps&&ot===h.memoizedState||(f.flags|=1024),f.memoizedProps=E,f.memoizedState=tt),V.props=E,V.state=tt,V.context=ue,E=we):(typeof V.componentDidUpdate!="function"||Y===h.memoizedProps&&ot===h.memoizedState||(f.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Y===h.memoizedProps&&ot===h.memoizedState||(f.flags|=1024),E=!1)}return Zx(h,f,A,E,I,C)}function Zx(h,f,A,E,C,I){bT(h,f);var V=(f.flags&128)!==0;if(!E&&!V)return C&&Yc(f,A,!1),wo(h,f,I);E=f.stateNode,p4.current=f;var Y=V&&typeof A.getDerivedStateFromError!="function"?null:E.render();return f.flags|=1,h!==null&&V?(f.child=eu(f,h.child,null,I),f.child=eu(f,null,Y,I)):Gi(h,f,Y,I),f.memoizedState=E.state,C&&Yc(f,A,!0),f.child}function BT(h){var f=h.stateNode;f.pendingContext?Ms(h,f.pendingContext,f.pendingContext!==f.context):f.context&&Ms(h,f.context,!1),Ux(h,f.containerInfo)}function IT(h,f,A,E,C){return $c(),Ox(C),f.flags|=256,Gi(h,f,A,E),f.child}var Cm={dehydrated:null,treeContext:null,retryLane:0};function Rm(h){return{baseLanes:h,cachePool:null}}function LT(h,f,A){var E=f.pendingProps,C=_n.current,I=!1,V=(f.flags&128)!==0,Y;if((Y=V)||(Y=h!==null&&h.memoizedState===null?!1:(C&2)!==0),Y?(I=!0,f.flags&=-129):(h===null||h.memoizedState!==null)&&(C|=1),Be(_n,C&1),h===null)return Fx(f),h=f.memoizedState,h!==null&&(h=h.dehydrated,h!==null)?(f.mode&1?Wc(h)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(C=E.children,h=E.fallback,I?(E=f.mode,I=f.child,C={mode:"hidden",children:C},!(E&1)&&I!==null?(I.childLanes=0,I.pendingProps=C):I=Ym(C,E,0,null),h=wl(h,E,A,null),I.return=f,h.return=f,I.sibling=h,f.child=I,f.child.memoizedState=Rm(A),f.memoizedState=Cm,h):qx(f,C));if(C=h.memoizedState,C!==null){if(Y=C.dehydrated,Y!==null){if(V)return f.flags&256?(f.flags&=-257,bm(h,f,A,Error(o(422)))):f.memoizedState!==null?(f.child=h.child,f.flags|=128,null):(I=E.fallback,C=f.mode,E=Ym({mode:"visible",children:E.children},C,0,null),I=wl(I,C,A,null),I.flags|=2,E.return=f,I.return=f,E.sibling=I,f.child=E,f.mode&1&&eu(f,h.child,null,A),f.child.memoizedState=Rm(A),f.memoizedState=Cm,I);if(!(f.mode&1))f=bm(h,f,A,null);else if(Wc(Y))f=bm(h,f,A,Error(o(419)));else if(E=(A&h.childLanes)!==0,Ar||E){if(E=Hn,E!==null){switch(A&-A){case 4:I=2;break;case 16:I=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:I=32;break;case 536870912:I=268435456;break;default:I=0}E=I&(E.suspendedLanes|A)?0:I,E!==0&&E!==C.retryLane&&(C.retryLane=E,Kr(h,E,-1))}_v(),f=bm(h,f,A,Error(o(421)))}else rf(Y)?(f.flags|=128,f.child=h.child,f=C4.bind(null,h),jc(Y,f),f=null):(A=C.treeContext,me&&(vr=tm(Y),xr=f,dn=!0,ws=null,af=!1,A!==null&&(jr[Xr++]=So,jr[Xr++]=Mo,jr[Xr++]=yl,So=A.id,Mo=A.overflow,yl=f)),f=qx(f,f.pendingProps.children),f.flags|=4096);return f}return I?(E=zT(h,f,E.children,E.fallback,A),I=f.child,C=h.child.memoizedState,I.memoizedState=C===null?Rm(A):{baseLanes:C.baseLanes|A,cachePool:null},I.childLanes=h.childLanes&~A,f.memoizedState=Cm,E):(A=DT(h,f,E.children,A),f.memoizedState=null,A)}return I?(E=zT(h,f,E.children,E.fallback,A),I=f.child,C=h.child.memoizedState,I.memoizedState=C===null?Rm(A):{baseLanes:C.baseLanes|A,cachePool:null},I.childLanes=h.childLanes&~A,f.memoizedState=Cm,E):(A=DT(h,f,E.children,A),f.memoizedState=null,A)}function qx(h,f){return f=Ym({mode:"visible",children:f},h.mode,0,null),f.return=h,h.child=f}function DT(h,f,A,E){var C=h.child;return h=C.sibling,A=pa(C,{mode:"visible",children:A}),!(f.mode&1)&&(A.lanes=E),A.return=f,A.sibling=null,h!==null&&(E=f.deletions,E===null?(f.deletions=[h],f.flags|=16):E.push(h)),f.child=A}function zT(h,f,A,E,C){var I=f.mode;h=h.child;var V=h.sibling,Y={mode:"hidden",children:A};return!(I&1)&&f.child!==h?(A=f.child,A.childLanes=0,A.pendingProps=Y,f.deletions=null):(A=pa(h,Y),A.subtreeFlags=h.subtreeFlags&14680064),V!==null?E=pa(V,E):(E=wl(E,I,C,null),E.flags|=2),E.return=f,A.return=f,A.sibling=E,f.child=A,E}function bm(h,f,A,E){return E!==null&&Ox(E),eu(f,h.child,null,A),h=qx(f,f.pendingProps.children),h.flags|=2,f.memoizedState=null,h}function FT(h,f,A){h.lanes|=f;var E=h.alternate;E!==null&&(E.lanes|=f),bx(h.return,f,A)}function $x(h,f,A,E,C){var I=h.memoizedState;I===null?h.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:E,tail:A,tailMode:C}:(I.isBackwards=f,I.rendering=null,I.renderingStartTime=0,I.last=E,I.tail=A,I.tailMode=C)}function OT(h,f,A){var E=f.pendingProps,C=E.revealOrder,I=E.tail;if(Gi(h,f,E.children,A),E=_n.current,E&2)E=E&1|2,f.flags|=128;else{if(h!==null&&h.flags&128)e:for(h=f.child;h!==null;){if(h.tag===13)h.memoizedState!==null&&FT(h,A,f);else if(h.tag===19)FT(h,A,f);else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===f)break e;for(;h.sibling===null;){if(h.return===null||h.return===f)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}E&=1}if(Be(_n,E),!(f.mode&1))f.memoizedState=null;else switch(C){case"forwards":for(A=f.child,C=null;A!==null;)h=A.alternate,h!==null&&ym(h)===null&&(C=A),A=A.sibling;A=C,A===null?(C=f.child,f.child=null):(C=A.sibling,A.sibling=null),$x(f,!1,C,A,I);break;case"backwards":for(A=null,C=f.child,f.child=null;C!==null;){if(h=C.alternate,h!==null&&ym(h)===null){f.child=C;break}h=C.sibling,C.sibling=A,A=C,C=h}$x(f,!0,A,null,I);break;case"together":$x(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function wo(h,f,A){if(h!==null&&(f.dependencies=h.dependencies),su|=f.lanes,!(A&f.childLanes))return null;if(h!==null&&f.child!==h.child)throw Error(o(153));if(f.child!==null){for(h=f.child,A=pa(h,h.pendingProps),f.child=A,A.return=f;h.sibling!==null;)h=h.sibling,A=A.sibling=pa(h,h.pendingProps),A.return=f;A.sibling=null}return f.child}function m4(h,f,A){switch(f.tag){case 3:BT(f),$c();break;case 5:$w(f);break;case 1:ri(f.type)&&yi(f);break;case 4:Ux(f,f.stateNode.containerInfo);break;case 10:Uw(f,f.type._context,f.memoizedProps.value);break;case 13:var E=f.memoizedState;if(E!==null)return E.dehydrated!==null?(Be(_n,_n.current&1),f.flags|=128,null):A&f.child.childLanes?LT(h,f,A):(Be(_n,_n.current&1),h=wo(h,f,A),h!==null?h.sibling:null);Be(_n,_n.current&1);break;case 19:if(E=(A&f.childLanes)!==0,h.flags&128){if(E)return OT(h,f,A);f.flags|=128}var C=f.memoizedState;if(C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Be(_n,_n.current),E)break;return null;case 22:case 23:return f.lanes=0,RT(h,f,A)}return wo(h,f,A)}function g4(h,f){switch(Dx(f),f.tag){case 1:return ri(f.type)&&ln(),h=f.flags,h&65536?(f.flags=h&-65537|128,f):null;case 3:return nu(),nt(tn),nt(ht),Hx(),h=f.flags,h&65536&&!(h&128)?(f.flags=h&-65537|128,f):null;case 5:return Nx(f),null;case 13:if(nt(_n),h=f.memoizedState,h!==null&&h.dehydrated!==null){if(f.alternate===null)throw Error(o(340));$c()}return h=f.flags,h&65536?(f.flags=h&-65537|128,f):null;case 19:return nt(_n),null;case 4:return nu(),null;case 10:return Rx(f.type._context),null;case 22:case 23:return yv(),null;case 24:return null;default:return null}}var Pm=!1,vl=!1,y4=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function Bm(h,f){var A=h.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(E){nr(h,f,E)}else A.current=null}function ev(h,f,A){try{A()}catch(E){nr(h,f,E)}}var UT=!1;function _4(h,f){for(Q(h.containerInfo),Oe=f;Oe!==null;)if(h=Oe,f=h.child,(h.subtreeFlags&1028)!==0&&f!==null)f.return=h,Oe=f;else for(;Oe!==null;){h=Oe;try{var A=h.alternate;if(h.flags&1024)switch(h.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var E=A.memoizedProps,C=A.memoizedState,I=h.stateNode,V=I.getSnapshotBeforeUpdate(h.elementType===h.type?E:Es(h.type,E),C);I.__reactInternalSnapshotBeforeUpdate=V}break;case 3:ke&&Ie(h.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Y){nr(h,h.return,Y)}if(f=h.sibling,f!==null){f.return=h.return,Oe=f;break}Oe=h.return}return A=UT,UT=!1,A}function Al(h,f,A){var E=f.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var C=E=E.next;do{if((C.tag&h)===h){var I=C.destroy;C.destroy=void 0,I!==void 0&&ev(f,A,I)}C=C.next}while(C!==E)}}function xf(h,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var A=f=f.next;do{if((A.tag&h)===h){var E=A.create;A.destroy=E()}A=A.next}while(A!==f)}}function tv(h){var f=h.ref;if(f!==null){var A=h.stateNode;switch(h.tag){case 5:h=J(A);break;default:h=A}typeof f=="function"?f(h):f.current=h}}function NT(h,f,A){if(Ws&&typeof Ws.onCommitFiberUnmount=="function")try{Ws.onCommitFiberUnmount(om,f)}catch{}switch(f.tag){case 0:case 11:case 14:case 15:if(h=f.updateQueue,h!==null&&(h=h.lastEffect,h!==null)){var E=h=h.next;do{var C=E,I=C.destroy;C=C.tag,I!==void 0&&(C&2||C&4)&&ev(f,A,I),E=E.next}while(E!==h)}break;case 1:if(Bm(f,A),h=f.stateNode,typeof h.componentWillUnmount=="function")try{h.props=f.memoizedProps,h.state=f.memoizedState,h.componentWillUnmount()}catch(V){nr(f,A,V)}break;case 5:Bm(f,A);break;case 4:ke?jT(h,f,A):N&&N&&(f=f.stateNode.containerInfo,A=Bt(f),zt(f,A))}}function kT(h,f,A){for(var E=f;;)if(NT(h,E,A),E.child===null||ke&&E.tag===4){if(E===f)break;for(;E.sibling===null;){if(E.return===null||E.return===f)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function HT(h){var f=h.alternate;f!==null&&(h.alternate=null,HT(f)),h.child=null,h.deletions=null,h.sibling=null,h.tag===5&&(f=h.stateNode,f!==null&&Ze(f)),h.stateNode=null,h.return=null,h.dependencies=null,h.memoizedProps=null,h.memoizedState=null,h.pendingProps=null,h.stateNode=null,h.updateQueue=null}function GT(h){return h.tag===5||h.tag===3||h.tag===4}function VT(h){e:for(;;){for(;h.sibling===null;){if(h.return===null||GT(h.return))return null;h=h.return}for(h.sibling.return=h.return,h=h.sibling;h.tag!==5&&h.tag!==6&&h.tag!==18;){if(h.flags&2||h.child===null||h.tag===4)continue e;h.child.return=h,h=h.child}if(!(h.flags&2))return h.stateNode}}function WT(h){if(ke){e:{for(var f=h.return;f!==null;){if(GT(f))break e;f=f.return}throw Error(o(160))}var A=f;switch(A.tag){case 5:f=A.stateNode,A.flags&32&&(qt(f),A.flags&=-33),A=VT(h),iv(h,A,f);break;case 3:case 4:f=A.stateNode.containerInfo,A=VT(h),nv(h,A,f);break;default:throw Error(o(161))}}}function nv(h,f,A){var E=h.tag;if(E===5||E===6)h=h.stateNode,f?Xe(A,h,f):pt(A,h);else if(E!==4&&(h=h.child,h!==null))for(nv(h,f,A),h=h.sibling;h!==null;)nv(h,f,A),h=h.sibling}function iv(h,f,A){var E=h.tag;if(E===5||E===6)h=h.stateNode,f?ut(A,h,f):Ve(A,h);else if(E!==4&&(h=h.child,h!==null))for(iv(h,f,A),h=h.sibling;h!==null;)iv(h,f,A),h=h.sibling}function jT(h,f,A){for(var E=f,C=!1,I,V;;){if(!C){C=E.return;e:for(;;){if(C===null)throw Error(o(160));switch(I=C.stateNode,C.tag){case 5:V=!1;break e;case 3:I=I.containerInfo,V=!0;break e;case 4:I=I.containerInfo,V=!0;break e}C=C.return}C=!0}if(E.tag===5||E.tag===6)kT(h,E,A),V?Et(I,E.stateNode):dt(I,E.stateNode);else if(E.tag===18)V?ee(I,E.stateNode):ae(I,E.stateNode);else if(E.tag===4){if(E.child!==null){I=E.stateNode.containerInfo,V=!0,E.child.return=E,E=E.child;continue}}else if(NT(h,E,A),E.child!==null){E.child.return=E,E=E.child;continue}if(E===f)break;for(;E.sibling===null;){if(E.return===null||E.return===f)return;E=E.return,E.tag===4&&(C=!1)}E.sibling.return=E.return,E=E.sibling}}function rv(h,f){if(ke){switch(f.tag){case 0:case 11:case 14:case 15:Al(3,f,f.return),xf(3,f),Al(5,f,f.return);return;case 1:return;case 5:var A=f.stateNode;if(A!=null){var E=f.memoizedProps;h=h!==null?h.memoizedProps:E;var C=f.type,I=f.updateQueue;f.updateQueue=null,I!==null&&Pt(A,I,C,h,E,f)}return;case 6:if(f.stateNode===null)throw Error(o(162));A=f.memoizedProps,Ee(f.stateNode,h!==null?h.memoizedProps:A,A);return;case 3:me&&h!==null&&h.memoizedState.isDehydrated&&Z(f.stateNode.containerInfo);return;case 12:return;case 13:Im(f);return;case 19:Im(f);return;case 17:return}throw Error(o(163))}switch(f.tag){case 0:case 11:case 14:case 15:Al(3,f,f.return),xf(3,f),Al(5,f,f.return);return;case 12:return;case 13:Im(f);return;case 19:Im(f);return;case 3:me&&h!==null&&h.memoizedState.isDehydrated&&Z(f.stateNode.containerInfo);break;case 22:case 23:return}e:if(N){switch(f.tag){case 1:case 5:case 6:break e;case 3:case 4:f=f.stateNode,zt(f.containerInfo,f.pendingChildren);break e}throw Error(o(163))}}function Im(h){var f=h.updateQueue;if(f!==null){h.updateQueue=null;var A=h.stateNode;A===null&&(A=h.stateNode=new y4),f.forEach(function(E){var C=R4.bind(null,h,E);A.has(E)||(A.add(E),E.then(C,C))})}}function x4(h,f){for(Oe=f;Oe!==null;){f=Oe;var A=f.deletions;if(A!==null)for(var E=0;E<A.length;E++){var C=A[E];try{var I=h;ke?jT(I,C,f):kT(I,C,f);var V=C.alternate;V!==null&&(V.return=null),C.return=null}catch($e){nr(C,f,$e)}}if(A=f.child,f.subtreeFlags&12854&&A!==null)A.return=f,Oe=A;else for(;Oe!==null;){f=Oe;try{var Y=f.flags;if(Y&32&&ke&&qt(f.stateNode),Y&512){var ue=f.alternate;if(ue!==null){var we=ue.ref;we!==null&&(typeof we=="function"?we(null):we.current=null)}}if(Y&8192)switch(f.tag){case 13:if(f.memoizedState!==null){var Je=f.alternate;(Je===null||Je.memoizedState===null)&&(hv=si())}break;case 22:var yt=f.memoizedState!==null,ot=f.alternate,Kt=ot!==null&&ot.memoizedState!==null;if(A=f,ke){e:if(E=A,C=yt,I=null,ke)for(var tt=E;;){if(tt.tag===5){if(I===null){I=tt;var Ci=tt.stateNode;C?K(Ci):pe(tt.stateNode,tt.memoizedProps)}}else if(tt.tag===6){if(I===null){var Zr=tt.stateNode;C?Ce(Zr):ye(Zr,tt.memoizedProps)}}else if((tt.tag!==22&&tt.tag!==23||tt.memoizedState===null||tt===E)&&tt.child!==null){tt.child.return=tt,tt=tt.child;continue}if(tt===E)break;for(;tt.sibling===null;){if(tt.return===null||tt.return===E)break e;I===tt&&(I=null),tt=tt.return}I===tt&&(I=null),tt.sibling.return=tt.return,tt=tt.sibling}}if(yt&&!Kt&&A.mode&1){Oe=A;for(var ie=A.child;ie!==null;){for(A=Oe=ie;Oe!==null;){E=Oe;var q=E.child;switch(E.tag){case 0:case 11:case 14:case 15:Al(4,E,E.return);break;case 1:Bm(E,E.return);var le=E.stateNode;if(typeof le.componentWillUnmount=="function"){var Ue=E.return;try{le.props=E.memoizedProps,le.state=E.memoizedState,le.componentWillUnmount()}catch($e){nr(E,Ue,$e)}}break;case 5:Bm(E,E.return);break;case 22:if(E.memoizedState!==null){YT(A);continue}}q!==null?(q.return=E,Oe=q):YT(A)}ie=ie.sibling}}}switch(Y&4102){case 2:WT(f),f.flags&=-3;break;case 6:WT(f),f.flags&=-3,rv(f.alternate,f);break;case 4096:f.flags&=-4097;break;case 4100:f.flags&=-4097,rv(f.alternate,f);break;case 4:rv(f.alternate,f)}}catch($e){nr(f,f.return,$e)}if(A=f.sibling,A!==null){A.return=f.return,Oe=A;break}Oe=f.return}}}function v4(h,f,A){Oe=h,XT(h)}function XT(h,f,A){for(var E=(h.mode&1)!==0;Oe!==null;){var C=Oe,I=C.child;if(C.tag===22&&E){var V=C.memoizedState!==null||Pm;if(!V){var Y=C.alternate,ue=Y!==null&&Y.memoizedState!==null||vl;Y=Pm;var we=vl;if(Pm=V,(vl=ue)&&!we)for(Oe=C;Oe!==null;)V=Oe,ue=V.child,V.tag===22&&V.memoizedState!==null?KT(C):ue!==null?(ue.return=V,Oe=ue):KT(C);for(;I!==null;)Oe=I,XT(I),I=I.sibling;Oe=C,Pm=Y,vl=we}JT(h)}else C.subtreeFlags&8772&&I!==null?(I.return=C,Oe=I):JT(h)}}function JT(h){for(;Oe!==null;){var f=Oe;if(f.flags&8772){var A=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:vl||xf(5,f);break;case 1:var E=f.stateNode;if(f.flags&4&&!vl)if(A===null)E.componentDidMount();else{var C=f.elementType===f.type?A.memoizedProps:Es(f.type,A.memoizedProps);E.componentDidUpdate(C,A.memoizedState,E.__reactInternalSnapshotBeforeUpdate)}var I=f.updateQueue;I!==null&&Hw(f,I,E);break;case 3:var V=f.updateQueue;if(V!==null){if(A=null,f.child!==null)switch(f.child.tag){case 5:A=J(f.child.stateNode);break;case 1:A=f.child.stateNode}Hw(f,V,A)}break;case 5:var Y=f.stateNode;A===null&&f.flags&4&&Ge(Y,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(me&&f.memoizedState===null){var ue=f.alternate;if(ue!==null){var we=ue.memoizedState;if(we!==null){var Je=we.dehydrated;Je!==null&&se(Je)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}vl||f.flags&512&&tv(f)}catch(yt){nr(f,f.return,yt)}}if(f===h){Oe=null;break}if(A=f.sibling,A!==null){A.return=f.return,Oe=A;break}Oe=f.return}}function YT(h){for(;Oe!==null;){var f=Oe;if(f===h){Oe=null;break}var A=f.sibling;if(A!==null){A.return=f.return,Oe=A;break}Oe=f.return}}function KT(h){for(;Oe!==null;){var f=Oe;try{switch(f.tag){case 0:case 11:case 15:var A=f.return;try{xf(4,f)}catch(ue){nr(f,A,ue)}break;case 1:var E=f.stateNode;if(typeof E.componentDidMount=="function"){var C=f.return;try{E.componentDidMount()}catch(ue){nr(f,C,ue)}}var I=f.return;try{tv(f)}catch(ue){nr(f,I,ue)}break;case 5:var V=f.return;try{tv(f)}catch(ue){nr(f,V,ue)}}}catch(ue){nr(f,f.return,ue)}if(f===h){Oe=null;break}var Y=f.sibling;if(Y!==null){Y.return=f.return,Oe=Y;break}Oe=f.return}}var Lm=0,Dm=1,zm=2,Fm=3,Om=4;if(typeof Symbol=="function"&&Symbol.for){var vf=Symbol.for;Lm=vf("selector.component"),Dm=vf("selector.has_pseudo_class"),zm=vf("selector.role"),Fm=vf("selector.test_id"),Om=vf("selector.text")}function sv(h){var f=Ae(h);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(o(364));return f}if(h=D(h),h===null)throw Error(o(362));return h.stateNode.current}function ov(h,f){switch(f.$$typeof){case Lm:if(h.type===f.value)return!0;break;case Dm:e:{f=f.value,h=[h,0];for(var A=0;A<h.length;){var E=h[A++],C=h[A++],I=f[C];if(E.tag!==5||!ge(E)){for(;I!=null&&ov(E,I);)C++,I=f[C];if(C===f.length){f=!0;break e}else for(E=E.child;E!==null;)h.push(E,C),E=E.sibling}}f=!1}return f;case zm:if(h.tag===5&&_e(h.stateNode,f.value))return!0;break;case Om:if((h.tag===5||h.tag===6)&&(h=ve(h),h!==null&&0<=h.indexOf(f.value)))return!0;break;case Fm:if(h.tag===5&&(h=h.memoizedProps["data-testname"],typeof h=="string"&&h.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function av(h){switch(h.$$typeof){case Lm:return"<"+(R(h.value)||"Unknown")+">";case Dm:return":has("+(av(h)||"")+")";case zm:return'[role="'+h.value+'"]';case Om:return'"'+h.value+'"';case Fm:return'[data-testname="'+h.value+'"]';default:throw Error(o(365))}}function QT(h,f){var A=[];h=[h,0];for(var E=0;E<h.length;){var C=h[E++],I=h[E++],V=f[I];if(C.tag!==5||!ge(C)){for(;V!=null&&ov(C,V);)I++,V=f[I];if(I===f.length)A.push(C);else for(C=C.child;C!==null;)h.push(C,I),C=C.sibling}}return A}function lv(h,f){if(!W)throw Error(o(363));h=sv(h),h=QT(h,f),f=[],h=Array.from(h);for(var A=0;A<h.length;){var E=h[A++];if(E.tag===5)ge(E)||f.push(E.stateNode);else for(E=E.child;E!==null;)h.push(E),E=E.sibling}return f}var A4=Math.ceil,Um=a.ReactCurrentDispatcher,cv=a.ReactCurrentOwner,Ln=a.ReactCurrentBatchConfig,Tt=0,Hn=null,Gn=null,_i=0,Sr=0,ru=Tn(0),Qn=0,Af=null,su=0,Nm=0,uv=0,Sf=null,er=null,hv=0,fv=1/0;function ou(){fv=si()+500}var km=!1,dv=null,ua=null,Hm=!1,ha=null,Gm=0,Mf=0,pv=null,Vm=-1,Wm=0;function Vi(){return Tt&6?si():Vm!==-1?Vm:Vm=si()}function fa(h){return h.mode&1?Tt&2&&_i!==0?_i&-_i:i4.transition!==null?(Wm===0&&(h=im,im<<=1,!(im&4194240)&&(im=64),Wm=h),Wm):(h=Ut,h!==0?h:de()):1}function Kr(h,f,A){if(50<Mf)throw Mf=0,pv=null,Error(o(185));var E=jm(h,f);return E===null?null:(of(E,f,A),(!(Tt&2)||E!==Hn)&&(E===Hn&&(!(Tt&2)&&(Nm|=f),Qn===4&&da(E,_i)),tr(E,A),f===1&&Tt===0&&!(h.mode&1)&&(ou(),am&&Xs())),E)}function jm(h,f){h.lanes|=f;var A=h.alternate;for(A!==null&&(A.lanes|=f),A=h,h=h.return;h!==null;)h.childLanes|=f,A=h.alternate,A!==null&&(A.childLanes|=f),A=h,h=h.return;return A.tag===3?A.stateNode:null}function tr(h,f){var A=h.callbackNode;Yz(h,f);var E=sm(h,h===Hn?_i:0);if(E===0)A!==null&&Fw(A),h.callbackNode=null,h.callbackPriority=0;else if(f=E&-E,h.callbackPriority!==f){if(A!=null&&Fw(A),f===1)h.tag===0?n4(qT.bind(null,h)):Ow(qT.bind(null,h)),ze?He(function(){Tt===0&&Xs()}):Sx(Mx,Xs),A=null;else{switch(zw(E)){case 1:A=Mx;break;case 4:A=qz;break;case 16:A=Ex;break;case 536870912:A=$z;break;default:A=Ex}A=aC(A,ZT.bind(null,h))}h.callbackPriority=f,h.callbackNode=A}}function ZT(h,f){if(Vm=-1,Wm=0,Tt&6)throw Error(o(327));var A=h.callbackNode;if(El()&&h.callbackNode!==A)return null;var E=sm(h,h===Hn?_i:0);if(E===0)return null;if(E&30||E&h.expiredLanes||f)f=Xm(h,E);else{f=E;var C=Tt;Tt|=2;var I=tC();(Hn!==h||_i!==f)&&(ou(),Sl(h,f));do try{E4();break}catch(Y){eC(h,Y)}while(!0);Cx(),Um.current=I,Tt=C,Gn!==null?f=0:(Hn=null,_i=0,f=Qn)}if(f!==0){if(f===2&&(C=xx(h),C!==0&&(E=C,f=mv(h,C))),f===1)throw A=Af,Sl(h,0),da(h,E),tr(h,si()),A;if(f===6)da(h,E);else{if(C=h.current.alternate,!(E&30)&&!S4(C)&&(f=Xm(h,E),f===2&&(I=xx(h),I!==0&&(E=I,f=mv(h,I))),f===1))throw A=Af,Sl(h,0),da(h,E),tr(h,si()),A;switch(h.finishedWork=C,h.finishedLanes=E,f){case 0:case 1:throw Error(o(345));case 2:Ml(h,er);break;case 3:if(da(h,E),(E&130023424)===E&&(f=hv+500-si(),10<f)){if(sm(h,0)!==0)break;if(C=h.suspendedLanes,(C&E)!==E){Vi(),h.pingedLanes|=h.suspendedLanes&C;break}h.timeoutHandle=Me(Ml.bind(null,h,er),f);break}Ml(h,er);break;case 4:if(da(h,E),(E&4194240)===E)break;for(f=h.eventTimes,C=-1;0<E;){var V=31-_r(E);I=1<<V,V=f[V],V>C&&(C=V),E&=~I}if(E=C,E=si()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*A4(E/1960))-E,10<E){h.timeoutHandle=Me(Ml.bind(null,h,er),E);break}Ml(h,er);break;case 5:Ml(h,er);break;default:throw Error(o(329))}}}return tr(h,si()),h.callbackNode===A?ZT.bind(null,h):null}function mv(h,f){var A=Sf;return h.current.memoizedState.isDehydrated&&(Sl(h,f).flags|=256),h=Xm(h,f),h!==2&&(f=er,er=A,f!==null&&gv(f)),h}function gv(h){er===null?er=h:er.push.apply(er,h)}function S4(h){for(var f=h;;){if(f.flags&16384){var A=f.updateQueue;if(A!==null&&(A=A.stores,A!==null))for(var E=0;E<A.length;E++){var C=A[E],I=C.getSnapshot;C=C.value;try{if(!js(I(),C))return!1}catch{return!1}}}if(A=f.child,f.subtreeFlags&16384&&A!==null)A.return=f,f=A;else{if(f===h)break;for(;f.sibling===null;){if(f.return===null||f.return===h)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function da(h,f){for(f&=~uv,f&=~Nm,h.suspendedLanes|=f,h.pingedLanes&=~f,h=h.expirationTimes;0<f;){var A=31-_r(f),E=1<<A;h[A]=-1,f&=~E}}function qT(h){if(Tt&6)throw Error(o(327));El();var f=sm(h,0);if(!(f&1))return tr(h,si()),null;var A=Xm(h,f);if(h.tag!==0&&A===2){var E=xx(h);E!==0&&(f=E,A=mv(h,E))}if(A===1)throw A=Af,Sl(h,0),da(h,f),tr(h,si()),A;if(A===6)throw Error(o(345));return h.finishedWork=h.current.alternate,h.finishedLanes=f,Ml(h,er),tr(h,si()),null}function $T(h){ha!==null&&ha.tag===0&&!(Tt&6)&&El();var f=Tt;Tt|=1;var A=Ln.transition,E=Ut;try{if(Ln.transition=null,Ut=1,h)return h()}finally{Ut=E,Ln.transition=A,Tt=f,!(Tt&6)&&Xs()}}function yv(){Sr=ru.current,nt(ru)}function Sl(h,f){h.finishedWork=null,h.finishedLanes=0;var A=h.timeoutHandle;if(A!==ct&&(h.timeoutHandle=ct,it(A)),Gn!==null)for(A=Gn.return;A!==null;){var E=A;switch(Dx(E),E.tag){case 1:E=E.type.childContextTypes,E!=null&&ln();break;case 3:nu(),nt(tn),nt(ht),Hx();break;case 5:Nx(E);break;case 4:nu();break;case 13:nt(_n);break;case 19:nt(_n);break;case 10:Rx(E.type._context);break;case 22:case 23:yv()}A=A.return}
vendor: 1,893 bytes, line 3887
3887if(Hn=h,Gn=h=pa(h.current,null),_i=Sr=f,Qn=0,Af=null,uv=Nm=su=0,er=Sf=null,Js!==null){for(f=0;f<Js.length;f++)if(A=Js[f],E=A.interleaved,E!==null){A.interleaved=null;var C=E.next,I=A.pending;if(I!==null){var V=I.next;I.next=C,E.next=V}A.pending=E}Js=null}return h}function eC(h,f){do{var A=Gn;try{if(Cx(),_m.current=Em,xm){for(var E=Cn.memoizedState;E!==null;){var C=E.queue;C!==null&&(C.pending=null),E=E.next}xm=!1}if(iu=0,oi=Ei=Cn=null,ff=!1,df=0,cv.current=null,A===null||A.return===null){Qn=1,Af=f,Gn=null;break}e:{var I=h,V=A.return,Y=A,ue=f;if(f=_i,Y.flags|=32768,ue!==null&&typeof ue=="object"&&typeof ue.then=="function"){var we=ue,Je=Y,yt=Je.tag;if(!(Je.mode&1)&&(yt===0||yt===11||yt===15)){var ot=Je.alternate;ot?(Je.updateQueue=ot.updateQueue,Je.memoizedState=ot.memoizedState,Je.lanes=ot.lanes):(Je.updateQueue=null,Je.memoizedState=null)}var Kt=AT(V);if(Kt!==null){Kt.flags&=-257,ST(Kt,V,Y,I,f),Kt.mode&1&&vT(I,we,f),f=Kt,ue=we;var tt=f.updateQueue;if(tt===null){var Ci=new Set;Ci.add(ue),f.updateQueue=Ci}else tt.add(ue);break e}else{if(!(f&1)){vT(I,we,f),_v();break e}ue=Error(o(426))}}else if(dn&&Y.mode&1){var Zr=AT(V);if(Zr!==null){!(Zr.flags&65536)&&(Zr.flags|=256),ST(Zr,V,Y,I,f),Ox(ue);break e}}I=ue,Qn!==4&&(Qn=2),Sf===null?Sf=[I]:Sf.push(I),ue=Yx(ue,Y),Y=V;do{switch(Y.tag){case 3:Y.flags|=65536,f&=-f,Y.lanes|=f;var ie=_T(Y,ue,f);kw(Y,ie);break e;case 1:I=ue;var q=Y.type,le=Y.stateNode;if(!(Y.flags&128)&&(typeof q.getDerivedStateFromError=="function"||le!==null&&typeof le.componentDidCatch=="function"&&(ua===null||!ua.has(le)))){Y.flags|=65536,f&=-f,Y.lanes|=f;var Ue=xT(Y,I,f);kw(Y,Ue);break e}}Y=Y.return}while(Y!==null)}iC(A)}catch($e){f=$e,Gn===A&&A!==null&&(Gn=A=A.return);continue}break}while(!0)}function tC(){var h=Um.current;return Um.current=Em,h===null?Em:h}function _v(){(Qn===0||Qn===3||Qn===2)&&(Qn=4),Hn===null||!(su&268435455)&&!(Nm&268435455)||da(
vendor: 53,471 bytes, lines 3887-3891
3887Hn,_i)}function Xm(h,f){var A=Tt;Tt|=2;var E=tC();Hn===h&&_i===f||Sl(h,f);do try{M4();break}catch(C){eC(h,C)}while(!0);if(Cx(),Tt=A,Um.current=E,Gn!==null)throw Error(o(261));return Hn=null,_i=0,Qn}function M4(){for(;Gn!==null;)nC(Gn)}function E4(){for(;Gn!==null&&!Qz();)nC(Gn)}function nC(h){var f=oC(h.alternate,h,Sr);h.memoizedProps=h.pendingProps,f===null?iC(h):Gn=f,cv.current=null}function iC(h){var f=h;do{var A=f.alternate;if(h=f.return,f.flags&32768){if(A=g4(A,f),A!==null){A.flags&=32767,Gn=A;return}if(h!==null)h.flags|=32768,h.subtreeFlags=0,h.deletions=null;else{Qn=6,Gn=null;return}}else if(A=d4(A,f,Sr),A!==null){Gn=A;return}if(f=f.sibling,f!==null){Gn=f;return}Gn=f=h}while(f!==null);Qn===0&&(Qn=5)}function Ml(h,f){var A=Ut,E=Ln.transition;try{Ln.transition=null,Ut=1,w4(h,f,A)}finally{Ln.transition=E,Ut=A}return null}function w4(h,f,A){do El();while(ha!==null);if(Tt&6)throw Error(o(327));var E=h.finishedWork,C=h.finishedLanes;if(E===null)return null;if(h.finishedWork=null,h.finishedLanes=0,E===h.current)throw Error(o(177));h.callbackNode=null,h.callbackPriority=0;var I=E.lanes|E.childLanes;if(Kz(h,I),h===Hn&&(Gn=Hn=null,_i=0),!(E.subtreeFlags&2064)&&!(E.flags&2064)||Hm||(Hm=!0,aC(Ex,function(){return El(),null})),I=(E.flags&15990)!==0,E.subtreeFlags&15990||I){I=Ln.transition,Ln.transition=null;var V=Ut;Ut=1;var Y=Tt;Tt|=4,cv.current=null,_4(h,E),x4(h,E),$(h.containerInfo),h.current=E,v4(E),Zz(),Tt=Y,Ut=V,Ln.transition=I}else h.current=E;if(Hm&&(Hm=!1,ha=h,Gm=C),I=h.pendingLanes,I===0&&(ua=null),e4(E.stateNode),tr(h,si()),f!==null)for(A=h.onRecoverableError,E=0;E<f.length;E++)A(f[E]);if(km)throw km=!1,h=dv,dv=null,h;return Gm&1&&h.tag!==0&&El(),I=h.pendingLanes,I&1?h===pv?Mf++:(Mf=0,pv=h):Mf=0,Xs(),null}function El(){if(ha!==null){var h=zw(Gm),f=Ln.transition,A=Ut;try{if(Ln.transition=null,Ut=16>h?16:h,ha===null)var E=!1;else{if(h=ha,ha=null,Gm=0,Tt&6)throw Error(o(331));var C=Tt;for(Tt|=4,Oe=h.current;Oe!==null;){var I=Oe,V=I.child;if(Oe.flags&16){var Y=I.deletions;if(Y!==null){for(var ue=0;ue<Y.length;ue++){var we=Y[ue];for(Oe=we;Oe!==null;){var Je=Oe;switch(Je.tag){case 0:case 11:case 15:Al(8,Je,I)}var yt=Je.child;if(yt!==null)yt.return=Je,Oe=yt;else for(;Oe!==null;){Je=Oe;var ot=Je.sibling,Kt=Je.return;if(HT(Je),Je===we){Oe=null;break}if(ot!==null){ot.return=Kt,Oe=ot;break}Oe=Kt}}}var tt=I.alternate;if(tt!==null){var Ci=tt.child;if(Ci!==null){tt.child=null;do{var Zr=Ci.sibling;Ci.sibling=null,Ci=Zr}while(Ci!==null)}}Oe=I}}if(I.subtreeFlags&2064&&V!==null)V.return=I,Oe=V;else e:for(;Oe!==null;){if(I=Oe,I.flags&2048)switch(I.tag){case 0:case 11:case 15:Al(9,I,I.return)}var ie=I.sibling;if(ie!==null){ie.return=I.return,Oe=ie;break e}Oe=I.return}}var q=h.current;for(Oe=q;Oe!==null;){V=Oe;var le=V.child;if(V.subtreeFlags&2064&&le!==null)le.return=V,Oe=le;else e:for(V=q;Oe!==null;){if(Y=Oe,Y.flags&2048)try{switch(Y.tag){case 0:case 11:case 15:xf(9,Y)}}catch($e){nr(Y,Y.return,$e)}if(Y===V){Oe=null;break e}var Ue=Y.sibling;if(Ue!==null){Ue.return=Y.return,Oe=Ue;break e}Oe=Y.return}}if(Tt=C,Xs(),Ws&&typeof Ws.onPostCommitFiberRoot=="function")try{Ws.onPostCommitFiberRoot(om,h)}catch{}E=!0}return E}finally{Ut=A,Ln.transition=f}}return!1}function rC(h,f,A){f=Yx(A,f),f=_T(h,f,1),ca(h,f),f=Vi(),h=jm(h,1),h!==null&&(of(h,1,f),tr(h,f))}function nr(h,f,A){if(h.tag===3)rC(h,h,A);else for(;f!==null;){if(f.tag===3){rC(f,h,A);break}else if(f.tag===1){var E=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(ua===null||!ua.has(E))){h=Yx(A,h),h=xT(f,h,1),ca(f,h),h=Vi(),f=jm(f,1),f!==null&&(of(f,1,h),tr(f,h));break}}f=f.return}}function T4(h,f,A){var E=h.pingCache;E!==null&&E.delete(f),f=Vi(),h.pingedLanes|=h.suspendedLanes&A,Hn===h&&(_i&A)===A&&(Qn===4||Qn===3&&(_i&130023424)===_i&&500>si()-hv?Sl(h,0):uv|=A),tr(h,f)}function sC(h,f){f===0&&(h.mode&1?(f=rm,rm<<=1,!(rm&130023424)&&(rm=4194304)):f=1);var A=Vi();h=jm(h,f),h!==null&&(of(h,f,A),tr(h,A))}function C4(h){var f=h.memoizedState,A=0;f!==null&&(A=f.retryLane),sC(h,A)}function R4(h,f){var A=0;switch(h.tag){case 13:var E=h.stateNode,C=h.memoizedState;C!==null&&(A=C.retryLane);break;case 19:E=h.stateNode;break;default:throw Error(o(314))}E!==null&&E.delete(f),sC(h,A)}var oC;oC=function(h,f,A){if(h!==null)if(h.memoizedProps!==f.pendingProps||tn.current)Ar=!0;else{if(!(h.lanes&A)&&!(f.flags&128))return Ar=!1,m4(h,f,A);Ar=!!(h.flags&131072)}else Ar=!1,dn&&f.flags&1048576&&Xw(f,mm,f.index);switch(f.lanes=0,f.tag){case 2:var E=f.type;h!==null&&(h.alternate=null,f.alternate=null,f.flags|=2),h=f.pendingProps;var C=kn(f,ht.current);Qc(f,A),C=Vx(null,f,E,h,C,A);var I=Wx();return f.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,ri(E)?(I=!0,yi(f)):I=!1,f.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Px(f),C.updater=dm,f.stateNode=C,C._reactInternals=f,Ix(f,E,h,A),f=Zx(null,f,E,!0,I,A)):(f.tag=0,dn&&I&&Lx(f),Gi(null,f,C,A),f=f.child),f;case 16:E=f.elementType;e:{switch(h!==null&&(h.alternate=null,f.alternate=null,f.flags|=2),h=f.pendingProps,C=E._init,E=C(E._payload),f.type=E,C=f.tag=P4(E),h=Es(E,h),C){case 0:f=Qx(null,f,E,h,A);break e;case 1:f=PT(null,f,E,h,A);break e;case 11:f=wT(null,f,E,h,A);break e;case 14:f=TT(null,f,E,Es(E.type,h),A);break e}throw Error(o(306,E,""))}return f;case 0:return E=f.type,C=f.pendingProps,C=f.elementType===E?C:Es(E,C),Qx(h,f,E,C,A);case 1:return E=f.type,C=f.pendingProps,C=f.elementType===E?C:Es(E,C),PT(h,f,E,C,A);case 3:e:{if(BT(f),h===null)throw Error(o(387));E=f.pendingProps,I=f.memoizedState,C=I.element,Nw(h,f),fm(f,E,null,A);var V=f.memoizedState;if(E=V.element,me&&I.isDehydrated)if(I={element:E,isDehydrated:!1,cache:V.cache,transitions:V.transitions},f.updateQueue.baseState=I,f.memoizedState=I,f.flags&256){C=Error(o(423)),f=IT(h,f,E,A,C);break e}else if(E!==C){C=Error(o(424)),f=IT(h,f,E,A,C);break e}else for(me&&(vr=em(f.stateNode.containerInfo),xr=f,dn=!0,ws=null,af=!1),A=qw(f,null,E,A),f.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if($c(),E===C){f=wo(h,f,A);break e}Gi(h,f,E,A)}f=f.child}return f;case 5:return $w(f),h===null&&Fx(f),E=f.type,C=f.pendingProps,I=h!==null?h.memoizedProps:null,V=C.children,fe(E,C)?V=null:I!==null&&fe(E,I)&&(f.flags|=32),bT(h,f),Gi(h,f,V,A),f.child;case 6:return h===null&&Fx(f),null;case 13:return LT(h,f,A);case 4:return Ux(f,f.stateNode.containerInfo),E=f.pendingProps,h===null?f.child=eu(f,null,E,A):Gi(h,f,E,A),f.child;case 11:return E=f.type,C=f.pendingProps,C=f.elementType===E?C:Es(E,C),wT(h,f,E,C,A);case 7:return Gi(h,f,f.pendingProps,A),f.child;case 8:return Gi(h,f,f.pendingProps.children,A),f.child;case 12:return Gi(h,f,f.pendingProps.children,A),f.child;case 10:e:{if(E=f.type._context,C=f.pendingProps,I=f.memoizedProps,V=C.value,Uw(f,E,V),I!==null)if(js(I.value,V)){if(I.children===C.children&&!tn.current){f=wo(h,f,A);break e}}else for(I=f.child,I!==null&&(I.return=f);I!==null;){var Y=I.dependencies;if(Y!==null){V=I.child;for(var ue=Y.firstContext;ue!==null;){if(ue.context===E){if(I.tag===1){ue=Ao(-1,A&-A),ue.tag=2;var we=I.updateQueue;if(we!==null){we=we.shared;var Je=we.pending;Je===null?ue.next=ue:(ue.next=Je.next,Je.next=ue),we.pending=ue}}I.lanes|=A,ue=I.alternate,ue!==null&&(ue.lanes|=A),bx(I.return,A,f),Y.lanes|=A;break}ue=ue.next}}else if(I.tag===10)V=I.type===f.type?null:I.child;else if(I.tag===18){if(V=I.return,V===null)throw Error(o(341));V.lanes|=A,Y=V.alternate,Y!==null&&(Y.lanes|=A),bx(V,A,f),V=I.sibling}else V=I.child;if(V!==null)V.return=I;else for(V=I;V!==null;){if(V===f){V=null;break}if(I=V.sibling,I!==null){I.return=V.return,V=I;break}V=V.return}I=V}Gi(h,f,C.children,A),f=f.child}return f;case 9:return C=f.type,E=f.pendingProps.children,Qc(f,A),C=Wr(C),E=E(C),f.flags|=1,Gi(h,f,E,A),f.child;case 14:return E=f.type,C=Es(E,f.pendingProps),C=Es(E.type,C),TT(h,f,E,C,A);case 15:return CT(h,f,f.type,f.pendingProps,A);case 17:return E=f.type,C=f.pendingProps,C=f.elementType===E?C:Es(E,C),h!==null&&(h.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,ri(E)?(h=!0,yi(f)):h=!1,Qc(f,A),Ww(f,E,C),Ix(f,E,C,A),Zx(null,f,E,!0,h,A);case 19:return OT(h,f,A);case 22:return RT(h,f,A)}throw Error(o(156,f.tag))};function aC(h,f){return Sx(h,f)}function b4(h,f,A,E){this.tag=h,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qr(h,f,A,E){return new b4(h,f,A,E)}function xv(h){return h=h.prototype,!(!h||!h.isReactComponent)}function P4(h){if(typeof h=="function")return xv(h)?1:0;if(h!=null){if(h=h.$$typeof,h===_)return 11;if(h===v)return 14}return 2}function pa(h,f){var A=h.alternate;return A===null?(A=Qr(h.tag,f,h.key,h.mode),A.elementType=h.elementType,A.type=h.type,A.stateNode=h.stateNode,A.alternate=h,h.alternate=A):(A.pendingProps=f,A.type=h.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=h.flags&14680064,A.childLanes=h.childLanes,A.lanes=h.lanes,A.child=h.child,A.memoizedProps=h.memoizedProps,A.memoizedState=h.memoizedState,A.updateQueue=h.updateQueue,f=h.dependencies,A.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},A.sibling=h.sibling,A.index=h.index,A.ref=h.ref,A}function Jm(h,f,A,E,C,I){var V=2;if(E=h,typeof h=="function")xv(h)&&(V=1);else if(typeof h=="string")V=5;else e:switch(h){case u:return wl(A.children,C,I,f);case d:V=8,C|=8;break;case p:return h=Qr(12,A,f,C|2),h.elementType=p,h.lanes=I,h;case x:return h=Qr(13,A,f,C),h.elementType=x,h.lanes=I,h;case g:return h=Qr(19,A,f,C),h.elementType=g,h.lanes=I,h;case M:return Ym(A,C,I,f);default:if(typeof h=="object"&&h!==null)switch(h.$$typeof){case m:V=10;break e;case y:V=9;break e;case _:V=11;break e;case v:V=14;break e;case S:V=16,E=null;break e}throw Error(o(130,h==null?h:typeof h,""))}return f=Qr(V,A,f,C),f.elementType=h,f.type=E,f.lanes=I,f}function wl(h,f,A,E){return h=Qr(7,h,E,f),h.lanes=A,h}function Ym(h,f,A,E){return h=Qr(22,h,E,f),h.elementType=M,h.lanes=A,h.stateNode={},h}function vv(h,f,A){return h=Qr(6,h,null,f),h.lanes=A,h}function Av(h,f,A){return f=Qr(4,h.children!==null?h.children:[],h.key,f),f.lanes=A,f.stateNode={containerInfo:h.containerInfo,pendingChildren:null,implementation:h.implementation},f}function B4(h,f,A,E,C){this.tag=f,this.containerInfo=h,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ct,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vx(0),this.expirationTimes=vx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vx(0),this.identifierPrefix=E,this.onRecoverableError=C,me&&(this.mutableSourceEagerHydrationData=null)}function lC(h,f,A,E,C,I,V,Y,ue){return h=new B4(h,f,A,Y,ue),f===1?(f=1,I===!0&&(f|=8)):f=0,I=Qr(3,null,null,f),h.current=I,I.stateNode=h,I.memoizedState={element:E,isDehydrated:A,cache:null,transitions:null},Px(I),h}function cC(h){if(!h)return en;h=h._reactInternals;e:{if(b(h)!==h||h.tag!==1)throw Error(o(170));var f=h;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(ri(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(o(171))}if(h.tag===1){var A=h.type;if(ri(A))return Jc(h,A,f)}return f}function uC(h){var f=h._reactInternals;if(f===void 0)throw typeof h.render=="function"?Error(o(188)):(h=Object.keys(h).join(","),Error(o(268,h)));return h=U(f),h===null?null:h.stateNode}function hC(h,f){if(h=h.memoizedState,h!==null&&h.dehydrated!==null){var A=h.retryLane;h.retryLane=A!==0&&A<f?A:f}}function Sv(h,f){hC(h,f),(h=h.alternate)&&hC(h,f)}function I4(h){return h=U(h),h===null?null:h.stateNode}function L4(){return null}return t.attemptContinuousHydration=function(h){if(h.tag===13){var f=Vi();Kr(h,134217728,f),Sv(h,134217728)}},t.attemptHydrationAtCurrentPriority=function(h){if(h.tag===13){var f=Vi(),A=fa(h);Kr(h,A,f),Sv(h,A)}},t.attemptSynchronousHydration=function(h){switch(h.tag){case 3:var f=h.stateNode;if(f.current.memoizedState.isDehydrated){var A=sf(f.pendingLanes);A!==0&&(Ax(f,A|1),tr(f,si()),!(Tt&6)&&(ou(),Xs()))}break;case 13:var E=Vi();$T(function(){return Kr(h,1,E)}),Sv(h,1)}},t.batchedUpdates=function(h,f){var A=Tt;Tt|=1;try{return h(f)}finally{Tt=A,Tt===0&&(ou(),am&&Xs())}},t.createComponentSelector=function(h){return{$$typeof:Lm,value:h}},t.createContainer=function(h,f,A,E,C,I,V){return lC(h,f,!1,null,A,E,C,I,V)},t.createHasPseudoClassSelector=function(h){return{$$typeof:Dm,value:h}},t.createHydrationContainer=function(h,f,A,E,C,I,V,Y,ue){return h=lC(A,E,!0,h,C,I,V,Y,ue),h.context=cC(null),A=h.current,E=Vi(),C=fa(A),I=Ao(E,C),I.callback=f??null,ca(A,I),h.current.lanes=C,of(h,C,E),tr(h,E),h},t.createPortal=function(h,f,A){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:E==null?null:""+E,children:h,containerInfo:f,implementation:A}},t.createRoleSelector=function(h){return{$$typeof:zm,value:h}},t.createTestNameSelector=function(h){return{$$typeof:Fm,value:h}},t.createTextSelector=function(h){return{$$typeof:Om,value:h}},t.deferredUpdates=function(h){var f=Ut,A=Ln.transition;try{return Ln.transition=null,Ut=16,h()}finally{Ut=f,Ln.transition=A}},t.discreteUpdates=function(h,f,A,E,C){var I=Ut,V=Ln.transition;try{return Ln.transition=null,Ut=1,h(f,A,E,C)}finally{Ut=I,Ln.transition=V,Tt===0&&ou()}},t.findAllNodes=lv,t.findBoundingRects=function(h,f){if(!W)throw Error(o(363));f=lv(h,f),h=[];for(var A=0;A<f.length;A++)h.push(re(f[A]));for(f=h.length-1;0<f;f--){A=h[f];for(var E=A.x,C=E+A.width,I=A.y,V=I+A.height,Y=f-1;0<=Y;Y--)if(f!==Y){var ue=h[Y],we=ue.x,Je=we+ue.width,yt=ue.y,ot=yt+ue.height;if(E>=we&&I>=yt&&C<=Je&&V<=ot){h.splice(f,1);break}else if(E!==we||A.width!==ue.width||ot<I||yt>V){if(!(I!==yt||A.height!==ue.height||Je<E||we>C)){we>E&&(ue.width+=we-E,ue.x=E),Je<C&&(ue.width=C-we),h.splice(f,1);break}}else{yt>I&&(ue.height+=yt-I,ue.y=I),ot<V&&(ue.height=V-yt),h.splice(f,1);break}}}return h},t.findHostInstance=uC,t.findHostInstanceWithNoPortals=function(h){return h=L(h),h=h!==null?j(h):null,h===null?null:h.stateNode},t.findHostInstanceWithWarning=function(h){return uC(h)},t.flushControlled=function(h){var f=Tt;Tt|=1;var A=Ln.transition,E=Ut;try{Ln.transition=null,Ut=1,h()}finally{Ut=E,Ln.transition=A,Tt=f,Tt===0&&(ou(),Xs())}},t.flushPassiveEffects=El,t.flushSync=$T,t.focusWithin=function(h,f){if(!W)throw Error(o(363));for(h=sv(h),f=QT(h,f),f=Array.from(f),h=0;h<f.length;){var A=f[h++];if(!ge(A)){if(A.tag===5&&et(A.stateNode))return!0;for(A=A.child;A!==null;)f.push(A),A=A.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Ut},t.getFindAllNodesFailureDescription=function(h,f){if(!W)throw Error(o(363));var A=0,E=[];h=[sv(h),0];for(var C=0;C<h.length;){var I=h[C++],V=h[C++],Y=f[V];if((I.tag!==5||!ge(I))&&(ov(I,Y)&&(E.push(av(Y)),V++,V>A&&(A=V)),V<f.length))for(I=I.child;I!==null;)h.push(I,V),I=I.sibling}if(A<f.length){for(h=[];A<f.length;A++)h.push(av(f[A]));return`findAllNodes was able to match part of the selector: 3888 `+(E.join(" > ")+` 3889 3890No matching component was found for: 3891 `)+h.join(" > ")}return null},t.getPublicRootInstance=function(h){if(h=h.current,!h.child)return null;switch(h.child.tag){case 5:return J(h.child.stateNode);default:return h.child.stateNode}},t.injectIntoDevTools=function(h){if(h={bundleType:h.bundleType,version:h.version,rendererPackageName:h.rendererPackageName,rendererConfig:h.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:I4,findFiberByHostInstance:h.findFiberByHostInstance||L4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")h=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)h=!0;else{try{om=f.inject(h),Ws=f}catch{}h=!!f.checkDCE}}return h},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(h,f,A,E){if(!W)throw Error(o(363));h=lv(h,f);var C=be(h,A,E).disconnect;return{disconnect:function(){C()}}},t.registerMutableSourceForHydration=function(h,f){var A=f._getVersion;A=A(f._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[f,A]:h.mutableSourceEagerHydrationData.push(f,A)},t.runWithPriority=function(h,f){var A=Ut;try{return Ut=h,f()}finally{Ut=A}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(h,f,A,E){var C=f.current,I=Vi(),V=fa(C);return A=cC(A),f.context===null?f.context=A:f.pendingContext=A,f=Ao(I,V),f.payload={element:h},E=E===void 0?null:E,E!==null&&(f.callback=E),ca(C,f),h=Kr(C,V,I),h!==null&&hm(h,C,V),V},t};jL.exports=fG;var dG=jL.exports;const pG=f_(dG),aw={},lx=n=>void Object.assign(aw,n);function mG(n,e){function t(u,{args:d=[],attach:p,...m},y){let _=`${u[0].toUpperCase()}${u.slice(1)}`,x;if(u==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;x=Xu(g,{type:u,root:y,attach:p,primitive:!0})}else{const g=aw[_];if(!g)throw new Error(`R3F: ${_} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");x=Xu(new g(...d),{type:u,root:y,attach:p,memoizedProps:{args:d}})}return x.__r3f.attach===void 0&&(x instanceof xt?x.__r3f.attach="geometry":x instanceof Jn&&(x.__r3f.attach="material")),_!=="inject"&&O1(x,m),x}function i(u,d){let p=!1;if(d){var m,y;(m=d.__r3f)!=null&&m.attach?F1(u,d,d.__r3f.attach):d.isObject3D&&u.isObject3D&&(u.add(d),p=!0),p||(y=u.__r3f)==null||y.objects.push(d),d.__r3f||Xu(d,{}),d.__r3f.parent=u,US(d),Ju(d)}}function r(u,d,p){let m=!1;if(d){var y,_;if((y=d.__r3f)!=null&&y.attach)F1(u,d,d.__r3f.attach);else if(d.isObject3D&&u.isObject3D){d.parent=u,d.dispatchEvent({type:"added"}),u.dispatchEvent({type:"childadded",child:d});const x=u.children.filter(v=>v!==d),g=x.indexOf(p);u.children=[...x.slice(0,g),d,...x.slice(g)],m=!0}m||(_=u.__r3f)==null||_.objects.push(d),d.__r3f||Xu(d,{}),d.__r3f.parent=u,US(d),Ju(d)}}function s(u,d,p=!1){u&&[...u].forEach(m=>o(d,m,p))}function o(u,d,p){if(d){var m,y,_;if(d.__r3f&&(d.__r3f.parent=null),(m=u.__r3f)!=null&&m.objects&&(u.__r3f.objects=u.__r3f.objects.filter(M=>M!==d)),(y=d.__r3f)!=null&&y.attach)sR(u,d,d.__r3f.attach);else if(d.isObject3D&&u.isObject3D){var x;u.remove(d),(x=d.__r3f)!=null&&x.root&&EG(Wg(d),d)}const v=(_=d.__r3f)==null?void 0:_.primitive,S=!v&&(p===void 0?d.dispose!==null:p);if(!v){var g;s((g=d.__r3f)==null?void 0:g.objects,d,S),s(d.children,d,S)}if(delete d.__r3f,S&&d.dispose&&d.type!=="Scene"){const M=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?FS.unstable_scheduleCallback(FS.unstable_IdlePriority,M):M()}Ju(u)}}function a(u,d,p,m){var y;const _=(y=u.__r3f)==null?void 0:y.parent;if(!_)return;const x=t(d,p,u.__r3f.root);if(u.children){for(const g of u.children)g.__r3f&&i(x,g);u.children=u.children.filter(g=>!g.__r3f)}u.__r3f.objects.forEach(g=>i(x,g)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||o(_,u),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),i(_,x),x.raycast&&x.__r3f.eventCount&&Wg(x).getState().internal.interaction.push(x),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=x,g.ref&&(typeof g.ref=="function"?g.ref(x):g.ref.current=x))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:pG({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,d)=>{if(!d)return;const p=u.getState().scene;p.__r3f&&(p.__r3f.root=u,i(p,d))},removeChildFromContainer:(u,d)=>{d&&o(u.getState().scene,d)},insertInContainerBefore:(u,d,p)=>{if(!d||!p)return;const m=u.getState().scene;m.__r3f&&r(m,d,p)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var d;return!!((d=u==null?void 0:u.__r3f)!=null?d:{}).handlers},prepareUpdate(u,d,p,m){var y;if(((y=u==null?void 0:u.__r3f)!=null?y:{}).primitive&&m.object&&m.object!==u)return[!0];{const{args:x=[],children:g,...v}=m,{args:S=[],children:M,...w}=p;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((R,B)=>R!==S[B]))return[!0];const T=eD(u,v,w,!0);return T.changes.length?[!1,T]:null}},commitUpdate(u,[d,p],m,y,_,x){d?a(u,m,_,x):O1(u,p)},commitMount(u,d,p,m){var y;const _=(y=u.__r3f)!=null?y:{};u.raycast&&_.handlers&&_.eventCount&&Wg(u).getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>Xu(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var d;const{attach:p,parent:m}=(d=u.__r3f)!=null?d:{};p&&m&&sR(m,u,p),u.isObject3D&&(u.visible=!1),Ju(u)},unhideInstance(u,d){var p;const{attach:m,parent:y}=(p=u.__r3f)!=null?p:{};m&&y&&F1(y,u,m),(u.isObject3D&&d.visible==null||d.visible)&&(u.visible=!0),Ju(u)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():uh.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&sn.fun(performance.now)?performance.now:sn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:sn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:sn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:O1}}var tR,nR;const z1=n=>"colorSpace"in n||"outputColorSpace"in n,YL=()=>{var n;return(n=aw.ColorManagement)!=null?n:null},KL=n=>n&&n.isOrthographicCamera,gG=n=>n&&n.hasOwnProperty("current"),Jp=typeof window<"u"&&((tR=window.document)!=null&&tR.createElement||((nR=window.navigator)==null?void 0:nR.product)==="ReactNative")?H.useLayoutEffect:H.useEffect;function QL(n){const e=H.useRef(n);return Jp(()=>void(e.current=n),[n]),e}function yG({set:n}){return Jp(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class ZL extends H.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}ZL.getDerivedStateFromError=()=>({error:!0});const qL="__default",iR=new Map,_G=n=>n&&!!n.memoized&&!!n.changes;function $L(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Wf=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Wg(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const sn={obj:n=>n===Object(n)&&!sn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(sn.str(n)||sn.num(n)||sn.boo(n))return n===e;const s=sn.obj(n);if(s&&i==="reference")return n===e;const o=sn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!sn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(sn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function xG(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function vG(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Xu(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function OS(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const rR=/-\d+$/;function F1(n,e,t){if(sn.str(t)){if(rR.test(t)){const s=t.replace(rR,""),{target:o,key:a}=OS(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=OS(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function sR(n,e,t){var i,r;if(sn.str(t)){const{target:s,key:o}=OS(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function eD(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},c=!1){const u=n.__r3f,d=Object.entries(r),p=[];if(c){const y=Object.keys(l);for(let _=0;_<y.length;_++)r.hasOwnProperty(y[_])||d.unshift([y[_],qL+"remove"])}d.forEach(([y,_])=>{var x;if((x=n.__r3f)!=null&&x.primitive&&y==="object"||sn.equ(_,l[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return p.push([y,_,!0,[]]);let g=[];y.includes("-")&&(g=y.split("-")),p.push([y,_,!1,g]);for(const v in r){const S=r[v];v.startsWith(`${y}-`)&&p.push([v,S,!1,v.split("-")])}});const m={...r};return u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.args&&(m.args=u.memoizedProps.args),u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.attach&&(m.attach=u.memoizedProps.attach),{memoized:m,changes:p}}const AG=typeof process<"u"&&!1;function O1(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=_G(e)?e:eD(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let u=0;u<a.length;u++){let[d,p,m,y]=a[u];if(z1(n)){const v="srgb",S="srgb-linear";d==="encoding"?(d="colorSpace",p=p===3001?v:S):d==="outputEncoding"&&(d="outputColorSpace",p=p===3001?v:S)}let _=n,x=_[d];if(y.length&&(x=y.reduce((g,v)=>g[v],n),!(x&&x.set))){const[g,...v]=y.reverse();_=v.reverse().reduce((S,M)=>S[M],n),d=g}if(p===qL+"remove")if(_.constructor){let g=iR.get(_.constructor);g||(g=new _.constructor,iR.set(_.constructor,g)),p=g[d]}else p=0;if(m&&i)p?i.handlers[d]=p:delete i.handlers[d],i.eventCount=Object.keys(i.handlers).length;else if(x&&x.set&&(x.copy||x instanceof fc)){if(Array.isArray(p))x.fromArray?x.fromArray(p):x.set(...p);else if(x.copy&&p&&p.constructor&&(AG?x.constructor.name===p.constructor.name:x.constructor===p.constructor))x.copy(p);else if(p!==void 0){const g=x instanceof Re;!g&&x.setScalar?x.setScalar(p):x instanceof fc&&p instanceof fc?x.mask=p.mask:x.set(p),!YL()&&s&&!s.linear&&g&&x.convertSRGBToLinear()}}else if(_[d]=p,_[d]instanceof Zt&&_[d].format===fi&&_[d].type===xs&&s){const g=_[d];z1(g)&&z1(s.gl)?g.colorSpace=s.gl.outputColorSpace:g.encoding=s.gl.outputEncoding}Ju(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const u=Wg(n).getState().internal,d=u.interaction.indexOf(n);d>-1&&u.interaction.splice(d,1),i.eventCount&&u.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&US(n),n}function Ju(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function US(n){n.onUpdate==null||n.onUpdate(n)}function SG(n,e){n.manual||(KL(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function rg(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function MG(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return uh.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return uh.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return uh.ContinuousEventPriority;default:return uh.DefaultEventPriority}}function tD(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function EG(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{tD(t.capturedMap,e,i,r)})}function wG(n){function e(l){const{internal:c}=n.getState(),u=l.offsetX-c.initialClick[0],d=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+d*d))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var d;return(d=c.__r3f)==null?void 0:d.handlers["onPointer"+u]}))}function i(l,c){const u=n.getState(),d=new Set,p=[],m=c?c(u.internal.interaction):u.internal.interaction;for(let g=0;g<m.length;g++){const v=Wf(m[g]);v&&(v.raycaster.camera=void 0)}u.previousRoot||u.events.compute==null||u.events.compute(l,u);function y(g){const v=Wf(g);if(!v||!v.events.enabled||v.raycaster.camera===null)return[];if(v.raycaster.camera===void 0){var S;v.events.compute==null||v.events.compute(l,v,(S=v.previousRoot)==null?void 0:S.getState()),v.raycaster.camera===void 0&&(v.raycaster.camera=null)}return v.raycaster.camera?v.raycaster.intersectObject(g,!0):[]}let _=m.flatMap(y).sort((g,v)=>{const S=Wf(g.object),M=Wf(v.object);return!S||!M?g.distance-v.distance:M.events.priority-S.events.priority||g.distance-v.distance}).filter(g=>{const v=rg(g);return d.has(v)?!1:(d.add(v),!0)});u.events.filter&&(_=u.events.filter(_,u));for(const g of _){let v=g.object;for(;v;){var x;(x=v.__r3f)!=null&&x.eventCount&&p.push({...g,eventObject:v}),v=v.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let g of u.internal.capturedMap.get(l.pointerId).values())d.has(rg(g.intersection))||p.push(g.intersection);return p}function r(l,c,u,d){const p=n.getState();if(l.length){const m={stopped:!1};for(const y of l){const _=Wf(y.object)||p,{raycaster:x,pointer:g,camera:v,internal:S}=_,M=new z(g.x,g.y,0).unproject(v),w=P=>{var L,U;return(L=(U=S.capturedMap.get(P))==null?void 0:U.has(y.eventObject))!=null?L:!1},T=P=>{const L={intersection:y,target:c.target};S.capturedMap.has(P)?S.capturedMap.get(P).set(y.eventObject,L):S.capturedMap.set(P,new Map([[y.eventObject,L]])),c.target.setPointerCapture(P)},R=P=>{const L=S.capturedMap.get(P);L&&tD(S.capturedMap,y.eventObject,L,P)};let B={};for(let P in c){let L=c[P];typeof L!="function"&&(B[P]=L)}let b={...y,...B,pointer:g,intersections:l,stopped:m.stopped,delta:u,unprojectedPoint:M,ray:x.ray,camera:v,stopPropagation(){const P="pointerId"in c&&S.capturedMap.get(c.pointerId);if((!P||P.has(y.eventObject))&&(b.stopped=m.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(L=>L.eventObject===y.eventObject))){const L=l.slice(0,l.indexOf(y));s([...L,y])}},target:{hasPointerCapture:w,setPointerCapture:T,releasePointerCapture:R},currentTarget:{hasPointerCapture:w,setPointerCapture:T,releasePointerCapture:R},nativeEvent:c};if(d(b),m.stopped===!0)break}}return l}function s(l){const{internal:c}=n.getState();for(const u of c.hovered.values())if(!l.length||!l.find(d=>d.object===u.object&&d.index===u.index&&d.instanceId===u.instanceId)){const p=u.eventObject.__r3f,m=p==null?void 0:p.handlers;if(c.hovered.delete(rg(u)),p!=null&&p.eventCount){const y={...u,intersections:l};m.onPointerOut==null||m.onPointerOut(y),m.onPointerLeave==null||m.onPointerLeave(y)}}}function o(l,c){for(let u=0;u<c.length;u++){const d=c[u].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(l)}}function a(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return c=>{const{internal:u}=n.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),s([]))})}}return function(u){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=u;const m=l==="onPointerMove",y=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=i(u,m?t:void 0),g=y?e(u):0;l==="onPointerDown"&&(p.initialClick=[u.offsetX,u.offsetY],p.initialHits=x.map(S=>S.eventObject)),y&&!x.length&&g<=2&&(o(u,p.interaction),d&&d(u)),m&&s(x);function v(S){const M=S.eventObject,w=M.__r3f,T=w==null?void 0:w.handlers;if(w!=null&&w.eventCount)if(m){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const R=rg(S),B=p.hovered.get(R);B?B.stopped&&S.stopPropagation():(p.hovered.set(R,S),T.onPointerOver==null||T.onPointerOver(S),T.onPointerEnter==null||T.onPointerEnter(S))}T.onPointerMove==null||T.onPointerMove(S)}else{const R=T[l];R?(!y||p.initialHits.includes(M))&&(o(u,p.interaction.filter(B=>!p.initialHits.includes(B))),R(S)):y&&p.initialHits.includes(M)&&o(u,p.interaction.filter(B=>!p.initialHits.includes(B)))}}r(x,u,g,v)}}return{handlePointer:a}}const nD=n=>!!(n!=null&&n.render),iD=H.createContext(null),TG=(n,e)=>{const t=GL((a,l)=>{const c=new z,u=new z,d=new z;function p(g=l().camera,v=u,S=l().size){const{width:M,height:w,top:T,left:R}=S,B=M/w;v instanceof z?d.copy(v):d.set(...v);const b=g.getWorldPosition(c).distanceTo(d);if(KL(g))return{width:M/g.zoom,height:w/g.zoom,top:T,left:R,factor:1,distance:b,aspect:B};{const P=g.fov*Math.PI/180,L=2*Math.tan(P/2)*b,U=L*(M/w);return{width:U,height:L,top:T,left:R,factor:M/U,distance:b,aspect:B}}}let m;const y=g=>a(v=>({performance:{...v.performance,current:g}})),_=new ce;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(l(),g),advance:(g,v)=>e(g,v,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new ax,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&y(g.performance.min),m=setTimeout(()=>y(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(v=>({...v,events:{...v.events,...g}})),setSize:(g,v,S,M,w)=>{const T=l().camera,R={width:g,height:v,top:M||0,left:w||0,updateStyle:S};a(B=>({size:R,viewport:{...B.viewport,...p(T,u,R)}}))},setDpr:g=>a(v=>{const S=$L(g);return{viewport:{...v.viewport,dpr:S,initialDpr:v.viewport.initialDpr||S}}}),setFrameloop:(g="always")=>{const v=l().clock;v.stop(),v.elapsedTime=0,g!=="never"&&(v.start(),v.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:H.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,v,S)=>{const M=l().internal;return M.priority=M.priority+(v>0?1:0),M.subscribers.push({ref:g,priority:v,store:S}),M.subscribers=M.subscribers.sort((w,T)=>w.priority-T.priority),()=>{const w=l().internal;w!=null&&w.subscribers&&(w.priority=w.priority-(v>0?1:0),w.subscribers=w.subscribers.filter(T=>T.ref!==g))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:u,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){var p;r=l,s=c.dpr,SG(a,l),u.setPixelRatio(c.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,m)}a!==o&&(o=a,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let sg,CG=new Set,RG=new Set,bG=new Set;function U1(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function jf(n,e){switch(n){case"before":return U1(CG,e);case"after":return U1(RG,e);case"tail":return U1(bG,e)}}let N1,k1;function H1(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),N1=e.internal.subscribers,sg=0;sg<N1.length;sg++)k1=N1[sg],k1.ref.current(k1.store.getState(),i,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}function PG(n){let e=!1,t=!1,i,r,s;function o(c){r=requestAnimationFrame(o),e=!0,i=0,jf("before",c),t=!0;for(const d of n.values()){var u;s=d.store.getState(),s.internal.active&&(s.frameloop==="always"||s.internal.frames>0)&&!((u=s.gl.xr)!=null&&u.isPresenting)&&(i+=H1(c,s))}if(t=!1,jf("after",c),i===0)return jf("tail",c),e=!1,cancelAnimationFrame(r)}function a(c,u=1){var d;if(!c)return n.forEach(p=>a(p.store.getState(),u));(d=c.gl.xr)!=null&&d.isPresenting||!c.internal.active||c.frameloop==="never"||(u>1?c.internal.frames=Math.min(60,c.internal.frames+u):t?c.internal.frames=2:c.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(c,u=!0,d,p){if(u&&jf("before",c),d)H1(c,d,p);else for(const m of n.values())H1(c,m.store.getState());u&&jf("after",c)}return{loop:o,invalidate:a,advance:l}}function rD(){const n=H.useContext(iD);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Tr(n=t=>t,e){return rD()(n,e)}function pl(n,e=0){const t=rD(),i=t.getState().internal.subscribe,r=QL(n);return Jp(()=>i(r,e,t),[e,i,t]),null}const oR=new WeakMap;function sD(n,e){return function(t,...i){let r=oR.get(t);return r||(r=new t,oR.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,xG(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function ml(n,e,t,i){const r=Array.isArray(e)?e:[e],s=cG(sD(t,i),[n,...r],{equal:sn.equ});return Array.isArray(e)?s:s[0]}ml.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return uG(sD(t),[n,...i])};ml.clear=function(n,e){const t=Array.isArray(e)?e:[e];return hG([n,...t])};const kh=new Map,{invalidate:aR,advance:lR}=PG(kh),{reconciler:$y,applyProps:bu}=mG(kh,MG),Pu={objects:"shallow",strict:!1},BG=(n,e)=>{const t=typeof n=="function"?n(e):n;return nD(t)?t:new eL({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function IG(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function LG(n){const e=kh.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||TG(aR,lR),o=t||$y.createContainer(s,uh.ConcurrentRoot,null,!1,null,"",r,null);e||kh.set(n,{fiber:o,store:s});let a,l=!1,c;return{configure(u={}){let{gl:d,size:p,scene:m,events:y,onCreated:_,shadows:x=!1,linear:g=!1,flat:v=!1,legacy:S=!1,orthographic:M=!1,frameloop:w="always",dpr:T=[1,2],performance:R,raycaster:B,camera:b,onPointerMissed:P}=u,L=s.getState(),U=L.gl;L.gl||L.set({gl:U=BG(d,n)});let G=L.raycaster;G||L.set({raycaster:G=new ow});const{params:j,...X}=B||{};if(sn.equ(X,G,Pu)||bu(G,{...X}),sn.equ(j,G.params,Pu)||bu(G,{params:{...G.params,...j}}),!L.camera||L.camera===c&&!sn.equ(c,b,Pu)){c=b;const $=b instanceof Fp,oe=$?b:M?new sa(0,0,0,0,.1,1e3):new Un(75,0,.1,1e3);$||(oe.position.z=5,b&&(bu(oe,b),("aspect"in b||"left"in b||"right"in b||"bottom"in b||"top"in b)&&(oe.manual=!0,oe.updateProjectionMatrix())),!L.camera&&!(b!=null&&b.rotation)&&oe.lookAt(0,0,0)),L.set({camera:oe}),G.camera=oe}if(!L.scene){let $;m instanceof Ky?$=m:($=new Ky,m&&bu($,m)),L.set({scene:Xu($)})}if(!L.xr){var J;const $=(De,ne)=>{const fe=s.getState();fe.frameloop!=="never"&&lR(De,!0,fe,ne)},oe=()=>{const De=s.getState();De.gl.xr.enabled=De.gl.xr.isPresenting,De.gl.xr.setAnimationLoop(De.gl.xr.isPresenting?$:null),De.gl.xr.isPresenting||aR(De)},xe={connect(){const De=s.getState().gl;De.xr.addEventListener("sessionstart",oe),De.xr.addEventListener("sessionend",oe)},disconnect(){const De=s.getState().gl;De.xr.removeEventListener("sessionstart",oe),De.xr.removeEventListener("sessionend",oe)}};typeof((J=U.xr)==null?void 0:J.addEventListener)=="function"&&xe.connect(),L.set({xr:xe})}if(U.shadowMap){const $=U.shadowMap.enabled,oe=U.shadowMap.type;if(U.shadowMap.enabled=!!x,sn.boo(x))U.shadowMap.type=wd;else if(sn.str(x)){var te;const xe={basic:WB,percentage:b_,soft:wd,variance:Ls};U.shadowMap.type=(te=xe[x])!=null?te:wd}else sn.obj(x)&&Object.assign(U.shadowMap,x);($!==U.shadowMap.enabled||oe!==U.shadowMap.type)&&(U.shadowMap.needsUpdate=!0)}const k=YL();k&&("enabled"in k?k.enabled=!S:"legacyMode"in k&&(k.legacyMode=S)),l||bu(U,{outputEncoding:g?3e3:3001,toneMapping:v?ho:pE}),L.legacy!==S&&L.set(()=>({legacy:S})),L.linear!==g&&L.set(()=>({linear:g})),L.flat!==v&&L.set(()=>({flat:v})),d&&!sn.fun(d)&&!nD(d)&&!sn.equ(d,U,Pu)&&bu(U,d),y&&!L.events.handlers&&L.set({events:y(s)});const Q=IG(n,p);return sn.equ(Q,L.size,Pu)||L.setSize(Q.width,Q.height,Q.updateStyle,Q.top,Q.left),T&&L.viewport.dpr!==$L(T)&&L.setDpr(T),L.frameloop!==w&&L.setFrameloop(w),L.onPointerMissed||L.set({onPointerMissed:P}),R&&!sn.equ(R,L.performance,Pu)&&L.set($=>({performance:{...$.performance,...R}})),a=_,l=!0,this},render(u){return l||this.configure(),$y.updateContainer(F.jsx(DG,{store:s,children:u,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){oD(n)}}}function DG({store:n,children:e,onCreated:t,rootElement:i}){return Jp(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),F.jsx(iD.Provider,{value:n,children:e})}function oD(n,e){const t=kh.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),$y.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),vG(r),kh.delete(n)}catch{}},500)})}}$y.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:H.version});const G1={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function zG(n){const{handlePointer:e}=wG(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(G1).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,c]=G1[o];t.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=G1[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function NS(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var u=Date.now()-o;u<e&&u>=0?i=setTimeout(l,e-u):(i=null,t||(a=n.apply(s,r),s=r=null))}var c=function(){s=this,r=arguments,o=Date.now();var u=t&&!i;return i||(i=setTimeout(l,e)),u&&(a=n.apply(s,r),s=r=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},c}NS.debounce=NS;var FG=NS;const cR=f_(FG);var OG=Object.defineProperty,UG=Object.defineProperties,NG=Object.getOwnPropertyDescriptors,uR=Object.getOwnPropertySymbols,kG=Object.prototype.hasOwnProperty,HG=Object.prototype.propertyIsEnumerable,hR=(n,e,t)=>e in n?OG(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,fR=(n,e)=>{for(var t in e||(e={}))kG.call(e,t)&&hR(n,t,e[t]);if(uR)for(var t of uR(e))HG.call(e,t)&&hR(n,t,e[t]);return n},GG=(n,e)=>UG(n,NG(e)),dR,pR;typeof window<"u"&&((dR=window.document)!=null&&dR.createElement||((pR=window.navigator)==null?void 0:pR.product)==="ReactNative")?H.useLayoutEffect:H.useEffect;function aD(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=aD(i,e,t);if(r)return r;i=i.sibling}}function lD(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const mR=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=mR;return}return mR.apply(this,arguments)};const lw=lD(H.createContext(null));class cD extends H.Component{render(){return H.createElement(lw.Provider,{value:this._reactInternals},this.props.children)}}function VG(){const n=H.useContext(lw);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=H.useId();return H.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=aD(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function WG(){const n=VG(),[e]=H.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==lw&&!e.has(r)&&e.set(r,H.useContext(lD(r)))}t=t.return}return e}function jG(){const n=WG();return H.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>H.createElement(e,null,H.createElement(t.Provider,GG(fR({},i),{value:n.get(t)}))),e=>H.createElement(cD,fR({},e))),[n])}function XG({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||typeof window<"u"&&window.ResizeObserver,[s,o]=H.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const a=H.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,u=H.useRef(!1);H.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[d,p,m]=H.useMemo(()=>{const g=()=>{if(!a.current.element)return;const{left:v,top:S,width:M,height:w,bottom:T,right:R,x:B,y:b}=a.current.element.getBoundingClientRect(),P={left:v,top:S,width:M,height:w,bottom:T,right:R,x:B,y:b};a.current.element instanceof HTMLElement&&i&&(P.height=a.current.element.offsetHeight,P.width=a.current.element.offsetWidth),Object.freeze(P),u.current&&!QG(a.current.lastBounds,P)&&o(a.current.lastBounds=P)};return[g,c?cR(g,c):g,l?cR(g,l):g]},[o,i,l,c]);function y(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null)}function _(){a.current.element&&(a.current.resizeObserver=new r(m),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(g=>g.addEventListener("scroll",m,{capture:!0,passive:!0})))}const x=g=>{!g||g===a.current.element||(y(),a.current.element=g,a.current.scrollContainers=uD(g),_())};return YG(m,!!e),JG(p),H.useEffect(()=>{y(),_()},[e,m,p]),H.useEffect(()=>y,[]),[x,s,d]}function JG(n){H.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function YG(n,e){H.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function uD(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...uD(n.parentElement)]}const KG=["x","y","top","bottom","left","right","width","height"],QG=(n,e)=>KG.every(t=>n[t]===e[t]),ZG=H.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=zG,eventSource:a,eventPrefix:l,shadows:c,linear:u,flat:d,legacy:p,orthographic:m,frameloop:y,dpr:_,performance:x,raycaster:g,camera:v,scene:S,onPointerMissed:M,onCreated:w,...T},R){H.useMemo(()=>lx(sG),[]);const B=jG(),[b,P]=XG({scroll:!0,debounce:{scroll:50,resize:0},...i}),L=H.useRef(null),U=H.useRef(null);H.useImperativeHandle(R,()=>L.current);const G=QL(M),[j,X]=H.useState(!1),[J,te]=H.useState(!1);if(j)throw j;if(J)throw J;const k=H.useRef(null);Jp(()=>{const $=L.current;P.width>0&&P.height>0&&$&&(k.current||(k.current=LG($)),k.current.configure({gl:s,events:o,shadows:c,linear:u,flat:d,legacy:p,orthographic:m,frameloop:y,dpr:_,performance:x,raycaster:g,camera:v,scene:S,size:P,onPointerMissed:(...oe)=>G.current==null?void 0:G.current(...oe),onCreated:oe=>{oe.events.connect==null||oe.events.connect(a?gG(a)?a.current:a:U.current),l&&oe.setEvents({compute:(xe,De)=>{const ne=xe[l+"X"],fe=xe[l+"Y"];De.pointer.set(ne/De.size.width*2-1,-(fe/De.size.height)*2+1),De.raycaster.setFromCamera(De.pointer,De.camera)}}),w==null||w(oe)}}),k.current.render(F.jsx(B,{children:F.jsx(ZL,{set:te,children:F.jsx(H.Suspense,{fallback:F.jsx(yG,{set:X}),children:e})})})))}),H.useEffect(()=>{const $=L.current;if($)return()=>oD($)},[]);const Q=a?"none":"auto";return F.jsx("div",{ref:U,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Q,...r},...T,children:F.jsx("div",{ref:b,style:{width:"100%",height:"100%"},children:F.jsx("canvas",{ref:L,style:{display:"block"},children:t})})})}),qG=H.forwardRef(function(e,t){return F.jsx(cD,{children:F.jsx(ZG,{...e,ref:t})})}),Yp=new z,cw=new z,$G=new z,gR=new ce;function e7(n,e,t){const i=Yp.setFromMatrixPosition(n.matrixWorld);i.project(e);const r=t.width/2,s=t.height/2;return[i.x*r+r,-(i.y*s)+s]}function t7(n,e){const t=Yp.setFromMatrixPosition(n.matrixWorld),i=cw.setFromMatrixPosition(e.matrixWorld),r=t.sub(i),s=e.getWorldDirection($G);return r.angleTo(s)>Math.PI/2}function n7(n,e,t,i){const r=Yp.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),gR.set(s.x,s.y),t.setFromCamera(gR,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)<a}return!0}function i7(n,e){if(e instanceof sa)return e.zoom;if(e instanceof Un){const t=Yp.setFromMatrixPosition(n.matrixWorld),i=cw.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(i);return 1/(2*Math.tan(r/2)*s)}else return 1}function r7(n,e,t){if(e instanceof Un||e instanceof sa){const i=Yp.setFromMatrixPosition(n.matrixWorld),r=cw.setFromMatrixPosition(e.matrixWorld),s=i.distanceTo(r),o=(t[1]-t[0])/(e.far-e.near),a=t[1]-o*e.far;return Math.round(o*s+a)}}const kS=n=>Math.abs(n)<1e-10?0:n;function hD(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=kS(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const s7=(n=>e=>hD(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),o7=(n=>(e,t)=>hD(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function a7(n){return n&&typeof n=="object"&&"current"in n}const l7=H.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:c=!1,transform:u=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:y,material:_,geometry:x,zIndexRange:g=[16777271,0],calculatePosition:v=e7,as:S="div",wrapperClass:M,pointerEvents:w="auto",...T},R)=>{const{gl:B,camera:b,scene:P,size:L,raycaster:U,events:G,viewport:j}=Tr(),[X]=H.useState(()=>document.createElement(S)),J=H.useRef(),te=H.useRef(null),k=H.useRef(0),Q=H.useRef([0,0]),$=H.useRef(null),oe=H.useRef(null),xe=(a==null?void 0:a.current)||G.connected||B.domElement.parentNode,De=H.useRef(null),ne=H.useRef(!1),fe=H.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&a7(d[0]),[d]);H.useLayoutEffect(()=>{const je=B.domElement;d&&d==="blending"?(je.style.zIndex=`${Math.floor(g[0]/2)}`,je.style.position="absolute",je.style.pointerEvents="none"):(je.style.zIndex=null,je.style.position=null,je.style.pointerEvents=null)},[d]),H.useLayoutEffect(()=>{if(te.current){const je=J.current=HB(X);if(P.updateMatrixWorld(),u)X.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";
3891else{const ke=v(te.current,b,L);X.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ke[0]}px,${ke[1]}px,0);transform-origin:0 0;`}return xe&&(r?xe.prepend(X):xe.appendChild(X)),()=>{xe&&xe.removeChild(X),je.unmount()}}},[xe,u]),H.useLayoutEffect(()=>{M&&(X.className=M)},[M]);const Te=H.useMemo(()=>u?{position:"absolute",top:0,left:0,width:L.width,height:L.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-L.height/2,left:-L.width/2,width:L.width,height:L.height},...t},[t,s,o,L,u]),Me=H.useMemo(()=>({position:"absolute",pointerEvents:w}),[w]);H.useLayoutEffect(()=>{if(ne.current=!1,u){var je;(je=J.current)==null||je.render(H.createElement("div",{ref:$,style:Te},H.createElement("div",{ref:oe,style:Me},H.createElement("div",{ref:R,className:i,style:t,children:n}))))}else{var ke;(ke=J.current)==null||ke.render(H.createElement("div",{ref:R,style:Te,className:i,children:n}))}});const it=H.useRef(!0);pl(je=>{if(te.current){b.updateMatrixWorld(),te.current.updateWorldMatrix(!0,!1);const ke=u?Q.current:v(te.current,b,L);if(u||Math.abs(k.current-b.zoom)>e||Math.abs(Q.current[0]-ke[0])>e||Math.abs(Q.current[1]-ke[1])>e){const N=t7(te.current,b);let me=!1;fe&&(Array.isArray(d)?me=d.map(Ze=>Ze.current):d!=="blending"&&(me=[P]));const Ae=it.current;if(me){const Ze=n7(te.current,b,U,me);it.current=Ze&&!N}else it.current=!N;Ae!==it.current&&(p?p(!it.current):X.style.display=it.current?"block":"none");const Le=Math.floor(g[0]/2),de=d?fe?[g[0],Le]:[Le-1,0]:g;if(X.style.zIndex=`${r7(te.current,b,de)}`,u){const[Ze,ze]=[L.width/2,L.height/2],He=b.projectionMatrix.elements[5]*ze,{isOrthographicCamera:W,top:D,left:re,bottom:ve,right:ge}=b,_e=s7(b.matrixWorldInverse),et=W?`scale(${He})translate(${kS(-(ge+re)/2)}px,${kS((D+ve)/2)}px)`:`translateZ(${He}px)`;let be=te.current.matrixWorld;c&&(be=b.matrixWorldInverse.clone().transpose().copyPosition(be).scale(te.current.scale),be.elements[3]=be.elements[7]=be.elements[11]=0,be.elements[15]=1),X.style.width=L.width+"px",X.style.height=L.height+"px",X.style.perspective=W?"":`${He}px`,$.current&&oe.current&&($.current.style.transform=`${et}${_e}translate(${Ze}px,${ze}px)`,oe.current.style.transform=o7(be,1/((l||10)/400)))}else{const Ze=l===void 0?1:i7(te.current,b)*l;X.style.transform=`translate3d(${ke[0]}px,${ke[1]}px,0) scale(${Ze})`}Q.current=ke,k.current=b.zoom}}if(!fe&&De.current&&!ne.current)if(u){if($.current){const ke=$.current.children[0];if(ke!=null&&ke.clientWidth&&ke!=null&&ke.clientHeight){const{isOrthographicCamera:N}=b;if(N||x)T.scale&&(Array.isArray(T.scale)?T.scale instanceof z?De.current.scale.copy(T.scale.clone().divideScalar(1)):De.current.scale.set(1/T.scale[0],1/T.scale[1],1/T.scale[2]):De.current.scale.setScalar(1/T.scale));else{const me=(l||10)/400,Ae=ke.clientWidth*me,Le=ke.clientHeight*me;De.current.scale.set(Ae,Le,1)}ne.current=!0}}}else{const ke=X.children[0];if(ke!=null&&ke.clientWidth&&ke!=null&&ke.clientHeight){const N=1/j.factor,me=ke.clientWidth*N,Ae=ke.clientHeight*N;De.current.scale.set(me,Ae,1),ne.current=!0}De.current.lookAt(je.camera.position)}});const ct=H.useMemo(()=>({vertexShader:u?void 0:` 3892 /* 3893 This shader is from the THREE's SpriteMaterial. 3894 We need to turn the backing plane into a Sprite 3895 (make it always face the camera) if "transfrom" 3896 is false. 3897 */ 3898 #include <common> 3899 3900 void main() { 3901 vec2 center = vec2(0., 1.); 3902 float rotation = 0.0; 3903 3904 // This is somewhat arbitrary, but it seems to work well 3905 // Need to figure out how to derive this dynamically if it even matters 3906 float size = 0.03; 3907 3908 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 3909 vec2 scale; 3910 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 3911 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 3912 3913 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3914 if ( isPerspective ) scale *= - mvPosition.z; 3915 3916 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; 3917 vec2 rotatedPosition; 3918 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3919 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3920 mvPosition.xy += rotatedPosition; 3921 3922 gl_Position = projectionMatrix * mvPosition; 3923 } 3924 `,fragmentShader:` 3925 void main() { 3926 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 3927 } 3928 `}),[u]);return H.createElement("group",Ec({},T,{ref:te}),d&&!fe&&H.createElement("mesh",{castShadow:m,receiveShadow:y,ref:De},x||H.createElement("planeGeometry",null),_||H.createElement("shaderMaterial",{side:Rr,vertexShader:ct.vertexShader,fragmentShader:ct.fragmentShader})))});let Xf=0;const c7=GL(n=>(ch.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-Xf)/(i-Xf)*100})},ch.onLoad=()=>{n({active:!1})},ch.onError=e=>n(t=>({errors:[...t.errors,e]})),ch.onProgress=(e,t,i)=>{t===i&&(Xf=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-Xf)/(i-Xf)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),u7=parseInt(Ip.replace(/\D+/g,""));function yR(n,e){if(e===RI)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Yy||e===wE){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l<a.count;l++)o.push(l);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(t)if(e===Yy)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),n}var h7=Object.defineProperty,f7=(n,e,t)=>e in n?h7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,sc=(n,e,t)=>(f7(n,typeof e!="symbol"?e+"":e,t),t);class Kp{constructor(){sc(this,"enabled",!0),sc(this,"needsSwap",!0),sc(this,"clear",!1),sc(this,"renderToScreen",!1)}setSize(e,t){}render(e,t,i,r,s){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}class fD{constructor(e){sc(this,"camera",new sa(-1,1,1,-1,0,1)),sc(this,"geometry",new Oc(2,2)),sc(this,"mesh"),this.mesh=new hn(this.geometry,e)}get material(){return this.mesh.material}set material(e){this.mesh.material=e}dispose(){this.mesh.geometry.dispose()}render(e){e.render(this.mesh,this.camera)}}var d7=Object.defineProperty,p7=(n,e,t)=>e in n?d7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,og=(n,e,t)=>(p7(n,typeof e!="symbol"?e+"":e,t),t);class HS extends Kp{constructor(e,t="tDiffuse"){super(),og(this,"textureID"),og(this,"uniforms"),og(this,"material"),og(this,"fsQuad"),this.textureID=t,e instanceof vi?(this.uniforms=e.uniforms,this.material=e):(this.uniforms=fp.clone(e.uniforms),this.material=new vi({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new fD(this.material)}render(e,t,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}}const GS={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join(` 3929`),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {"," vec4 texel = texture2D( tDiffuse, vUv );"," gl_FragColor = opacity * texel;","}"].join(` 3930`)},m7={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Re(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join(` 3931`),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {"," vec4 texel = texture2D( tDiffuse, vUv );"," vec3 luma = vec3( 0.299, 0.587, 0.114 );"," float v = dot( texel.xyz, luma );"," vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );"," float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );"," gl_FragColor = mix( outputColor, texel, alpha );","}"].join(` 3932`)};var g7=Object.defineProperty,y7=(n,e,t)=>e in n?g7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,dD=(n,e,t)=>(y7(n,typeof e!="symbol"?e+"":e,t),t);const VS=class extends Kp{constructor(n,e,t,i){super(),this.strength=e!==void 0?e:1,this.radius=t,this.threshold=i,this.resolution=n!==void 0?new ce(n.x,n.y):new ce(256,256),this.clearColor=new Re(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let r=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);this.renderTargetBright=new Fi(r,s,{type:fo}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let u=0;u<this.nMips;u++){const d=new Fi(r,s,{type:fo});d.texture.name="UnrealBloomPass.h"+u,d.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(d);const p=new Fi(r,s,{type:fo});p.texture.name="UnrealBloomPass.v"+u,p.texture.generateMipmaps=!1,this.renderTargetsVertical.push(p),r=Math.round(r/2),s=Math.round(s/2)}const o=m7;this.highPassUniforms=fp.clone(o.uniforms),this.highPassUniforms.luminosityThreshold.value=i,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new vi({uniforms:this.highPassUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const a=[3,5,7,9,11];r=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);for(let u=0;u<this.nMips;u++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(a[u])),this.separableBlurMaterials[u].uniforms.texSize.value=new ce(r,s),r=Math.round(r/2),s=Math.round(s/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=e,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0;const l=[1,.8,.6,.4,.2];this.compositeMaterial.uniforms.bloomFactors.value=l,this.bloomTintColors=[new z(1,1,1),new z(1,1,1),new z(1,1,1),new z(1,1,1),new z(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors;const c=GS;this.copyUniforms=fp.clone(c.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new vi({uniforms:this.copyUniforms,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,blending:xy,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new Re,this.oldClearAlpha=1,this.basic=new ei,this.fsQuad=new fD(null)}dispose(){for(let n=0;n<this.renderTargetsHorizontal.length;n++)this.renderTargetsHorizontal[n].dispose();for(let n=0;n<this.renderTargetsVertical.length;n++)this.renderTargetsVertical[n].dispose();this.renderTargetBright.dispose();for(let n=0;n<this.separableBlurMaterials.length;n++)this.separableBlurMaterials[n].dispose();this.compositeMaterial.dispose(),this.materialCopy.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(n,e){let t=Math.round(n/2),i=Math.round(e/2);this.renderTargetBright.setSize(t,i);for(let r=0;r<this.nMips;r++)this.renderTargetsHorizontal[r].setSize(t,i),this.renderTargetsVertical[r].setSize(t,i),this.separableBlurMaterials[r].uniforms.texSize.value=new ce(t,i),t=Math.round(t/2),i=Math.round(i/2)}render(n,e,t,i,r){n.getClearColor(this._oldClearColor),this.oldClearAlpha=n.getClearAlpha();const s=n.autoClear;n.autoClear=!1,n.setClearColor(this.clearColor,0),r&&n.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=t.texture,n.setRenderTarget(null),n.clear(),this.fsQuad.render(n)),this.highPassUniforms.tDiffuse.value=t.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,n.setRenderTarget(this.renderTargetBright),n.clear(),this.fsQuad.render(n);let o=this.renderTargetBright;for(let a=0;a<this.nMips;a++)this.fsQuad.material=this.separableBlurMaterials[a],this.separableBlurMaterials[a].uniforms.colorTexture.value=o.texture,this.separableBlurMaterials[a].uniforms.direction.value=VS.BlurDirectionX,n.setRenderTarget(this.renderTargetsHorizontal[a]),n.clear(),this.fsQuad.render(n),this.separableBlurMaterials[a].uniforms.colorTexture.value=this.renderTargetsHorizontal[a].texture,this.separableBlurMaterials[a].uniforms.direction.value=VS.BlurDirectionY,n.setRenderTarget(this.renderTargetsVertical[a]),n.clear(),this.fsQuad.render(n),o=this.renderTargetsVertical[a];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,n.setRenderTarget(this.renderTargetsHorizontal[0]),n.clear(),this.fsQuad.render(n),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,r&&n.state.buffers.stencil.setTest(!0),this.renderToScreen?(n.setRenderTarget(null),this.fsQuad.render(n)):(n.setRenderTarget(t),this.fsQuad.render(n)),n.setClearColor(this._oldClearColor,this.oldClearAlpha),n.autoClear=s}getSeperableBlurMaterial(n){return new vi({defines:{KERNEL_RADIUS:n,SIGMA:n},uniforms:{colorTexture:{value:null},texSize:{value:new ce(.5,.5)},direction:{value:new ce(.5,.5)}},vertexShader:`varying vec2 vUv; 3933 void main() { 3934 vUv = uv; 3935 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 3936 }`,fragmentShader:`#include <common> 3937 varying vec2 vUv; 3938 uniform sampler2D colorTexture; 3939 uniform vec2 texSize; 3940 uniform vec2 direction; 3941 3942 float gaussianPdf(in float x, in float sigma) { 3943 return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma; 3944 } 3945 void main() { 3946 vec2 invSize = 1.0 / texSize; 3947 float fSigma = float(SIGMA); 3948 float weightSum = gaussianPdf(0.0, fSigma); 3949 vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; 3950 for( int i = 1; i < KERNEL_RADIUS; i ++ ) { 3951 float x = float(i); 3952 float w = gaussianPdf(x, fSigma); 3953 vec2 uvOffset = direction * invSize * x; 3954 vec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb; 3955 vec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb; 3956 diffuseSum += (sample1 + sample2) * w; 3957 weightSum += 2.0 * w; 3958 } 3959 gl_FragColor = vec4(diffuseSum/weightSum, 1.0); 3960 }`})}getCompositeMaterial(n){return new vi({defines:{NUM_MIPS:n},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`
3960varying vec2 vUv; 3961 void main() { 3962 vUv = uv; 3963 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 3964 }`,fragmentShader:`varying vec2 vUv; 3965 uniform sampler2D blurTexture1; 3966 uniform sampler2D blurTexture2; 3967 uniform sampler2D blurTexture3; 3968 uniform sampler2D blurTexture4; 3969 uniform sampler2D blurTexture5; 3970 uniform float bloomStrength; 3971 uniform float bloomRadius; 3972 uniform float bloomFactors[NUM_MIPS]; 3973 uniform vec3 bloomTintColors[NUM_MIPS]; 3974 3975 float lerpBloomFactor(const in float factor) { 3976 float mirrorFactor = 1.2 - factor; 3977 return mix(factor, mirrorFactor, bloomRadius); 3978 } 3979 3980 void main() { 3981 gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + 3982 lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + 3983 lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + 3984 lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + 3985 lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) ); 3986 }`})}};let uw=VS;dD(uw,"BlurDirectionX",new ce(1,0));dD(uw,"BlurDirectionY",new ce(0,1));var _7=Object.defineProperty,x7=(n,e,t)=>e in n?_7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,V1=(n,e,t)=>(x7(n,typeof e!="symbol"?e+"":e,t),t);class _R extends Kp{constructor(e,t){super(),V1(this,"scene"),V1(this,"camera"),V1(this,"inverse"),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,i){const r=e.getContext(),s=e.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0);let o,a;this.inverse?(o=0,a=1):(o=1,a=0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),s.buffers.stencil.setFunc(r.ALWAYS,o,4294967295),s.buffers.stencil.setClear(a),s.buffers.stencil.setLocked(!0),e.setRenderTarget(i),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.stencil.setLocked(!1),s.buffers.stencil.setFunc(r.EQUAL,1,4294967295),s.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),s.buffers.stencil.setLocked(!0)}}class v7 extends Kp{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}var A7=Object.defineProperty,S7=(n,e,t)=>e in n?A7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,$r=(n,e,t)=>(S7(n,typeof e!="symbol"?e+"":e,t),t);class M7{constructor(e,t){if($r(this,"renderer"),$r(this,"_pixelRatio"),$r(this,"_width"),$r(this,"_height"),$r(this,"renderTarget1"),$r(this,"renderTarget2"),$r(this,"writeBuffer"),$r(this,"readBuffer"),$r(this,"renderToScreen"),$r(this,"passes",[]),$r(this,"copyPass"),$r(this,"clock"),this.renderer=e,t===void 0){const i={minFilter:gn,magFilter:gn,format:fi},r=e.getSize(new ce);this._pixelRatio=e.getPixelRatio(),this._width=r.width,this._height=r.height,t=new Fi(this._width*this._pixelRatio,this._height*this._pixelRatio,i),t.texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,GS===void 0&&console.error("THREE.EffectComposer relies on CopyShader"),HS===void 0&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new HS(GS),this.copyPass.material.blending=uo,this.clock=new ax}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let i=!1;const r=this.passes.length;for(let s=0;s<r;s++){const o=this.passes[s];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(s),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,i),o.needsSwap){if(i){const a=this.renderer.getContext(),l=this.renderer.state.buffers.stencil;
vendor: 18,397 bytes, line 3986
3986l.setFunc(a.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),l.setFunc(a.EQUAL,1,4294967295)}this.swapBuffers()}_R!==void 0&&(o instanceof _R?i=!0:o instanceof v7&&(i=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new ce);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const i=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(i,r),this.renderTarget2.setSize(i,r);for(let s=0;s<this.passes.length;s++)this.passes[s].setSize(i,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}}var E7=Object.defineProperty,w7=(n,e,t)=>e in n?E7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ul=(n,e,t)=>(w7(n,typeof e!="symbol"?e+"":e,t),t);class T7 extends Kp{constructor(e,t,i,r,s=0){super(),Ul(this,"scene"),Ul(this,"camera"),Ul(this,"overrideMaterial"),Ul(this,"clearColor"),Ul(this,"clearAlpha"),Ul(this,"clearDepth",!1),Ul(this,"_oldClearColor",new Re),this.scene=e,this.camera=t,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=s,this.clear=!0,this.needsSwap=!1}render(e,t,i){let r=e.autoClear;e.autoClear=!1;let s,o=null;this.overrideMaterial!==void 0&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(e.getClearColor(this._oldClearColor),s=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:i),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(this._oldClearColor,s),this.overrideMaterial!==void 0&&(this.scene.overrideMaterial=o),e.autoClear=r}}function e_(n){if(typeof TextDecoder<"u")return new TextDecoder().decode(n);let e="";for(let t=0,i=n.length;t<i;t++)e+=String.fromCharCode(n[t]);try{return decodeURIComponent(escape(e))}catch{return e}}const oc="srgb",jo="srgb-linear",xR=3001,C7=3e3;class hw extends Hi{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new I7(t)}),this.register(function(t){return new L7(t)}),this.register(function(t){return new G7(t)}),this.register(function(t){return new V7(t)}),this.register(function(t){return new W7(t)}),this.register(function(t){return new z7(t)}),this.register(function(t){return new F7(t)}),this.register(function(t){return new O7(t)}),this.register(function(t){return new U7(t)}),this.register(function(t){return new B7(t)}),this.register(function(t){return new N7(t)}),this.register(function(t){return new D7(t)}),this.register(function(t){return new H7(t)}),this.register(function(t){return new k7(t)}),this.register(function(t){return new b7(t)}),this.register(function(t){return new j7(t)}),this.register(function(t){return new X7(t)})}load(e,t,i,r){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const c=Ka.extractUrlBase(e);o=Ka.resolveURL(c,this.path)}else o=Ka.extractUrlBase(e);this.manager.itemStart(e);const a=function(c){r?r(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Nr(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},i,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,r){let s;const o={},a={};if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(e_(new Uint8Array(e.slice(0,4)))===pD){try{o[Rt.KHR_BINARY_GLTF]=new J7(e)}catch(u){r&&r(u);return}s=JSON.parse(o[Rt.KHR_BINARY_GLTF].content)}else s=JSON.parse(e_(new Uint8Array(e)));else s=e;if(s.asset===void 0||s.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new oV(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c<this.pluginCallbacks.length;c++){const u=this.pluginCallbacks[c](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,o[u.name]=!0}if(s.extensionsUsed)for(let c=0;c<s.extensionsUsed.length;++c){const u=s.extensionsUsed[c],d=s.extensionsRequired||[];switch(u){case Rt.KHR_MATERIALS_UNLIT:o[u]=new P7;break;case Rt.KHR_DRACO_MESH_COMPRESSION:o[u]=new Y7(s,this.dracoLoader);break;case Rt.KHR_TEXTURE_TRANSFORM:o[u]=new K7;break;case Rt.KHR_MESH_QUANTIZATION:o[u]=new Q7;break;default:d.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function R7(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const Rt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class b7{constructor(e){this.parser=e,this.name=Rt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i<r;i++){const s=t[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let r=t.cache.get(i);if(r)return r;const s=t.json,l=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const u=new Re(16777215);l.color!==void 0&&u.setRGB(l.color[0],l.color[1],l.color[2],jo);const d=l.range!==void 0?l.range:0;switch(l.type){case"directional":c=new tw(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new ew(u),c.distance=d;break;case"spot":c=new $E(u),c.distance=d,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,c.angle=l.spot.outerConeAngle,c.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return c.position.set(0,0,0),c.decay=2,Do(c,l),l.intensity!==void 0&&(c.intensity=l.intensity),c.name=t.createUniqueName(l.name||"light_"+e),r=Promise.resolve(c),t.cache.add(i,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(l){return i._getNodeRef(t.cache,a,l)})}}class P7{constructor(){this.name=Rt.KHR_MATERIALS_UNLIT}getMaterialType(){return ei}extendParams(e,t,i){const r=[];e.color=new Re(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],jo),e.opacity=o[3]}s.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",s.baseColorTexture,oc))}return Promise.all(r)}}class B7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class I7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(i.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new ce(a,a)}return Promise.all(s)}}class L7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_DISPERSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class D7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(i.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class z7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new Re(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=r.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],jo)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(i.assignTexture(t,"sheenColorMap",o.sheenColorTexture,oc)),o.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class F7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(i.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class O7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(i.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new Re().setRGB(a[0],a[1],a[2],jo),Promise.all(s)}}class U7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class N7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(i.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new Re().setRGB(a[0],a[1],a[2],jo),o.specularColorTexture!==void 0&&s.push(i.assignTexture(t,"specularColorMap",o.specularColorTexture,oc)),Promise.all(s)}}class k7{constructor(e){this.parser=e,this.name=Rt.EXT_MATERIALS_BUMP}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(i.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class H7{constructor(e){this.parser=e,this.name=Rt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:As}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(i.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class G7{constructor(e){this.parser=e,this.name=Rt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const s=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class V7{constructor(e){this.parser=e,this.name=Rt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class W7{constructor(e){this.parser=e,this.name=Rt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdj
3986FDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class j7{constructor(e){this.name=Rt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,c=r.byteLength||0,u=r.count,d=r.byteStride,p=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,d,p,r.mode,r.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(u*d);return o.decodeGltfBuffer(new Uint8Array(m),u,d,p,r.mode,r.filter),m})})}else return null}}class X7{constructor(e){this.name=Rt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==is.TRIANGLES&&c.mode!==is.TRIANGLE_STRIP&&c.mode!==is.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(u=>(l[c]=u,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],p=c[0].count,m=[];for(const y of d){const _=new Ke,x=new z,g=new Si,v=new z(1,1,1),S=new NE(y.geometry,y.material,p);for(let M=0;M<p;M++)l.TRANSLATION&&x.fromBufferAttribute(l.TRANSLATION,M),l.ROTATION&&g.fromBufferAttribute(l.ROTATION,M),l.SCALE&&v.fromBufferAttribute(l.SCALE,M),S.setMatrixAt(M,_.compose(x,g,v));for(const M in l)if(M==="_COLOR_0"){const w=l[M];S.instanceColor=new Cc(w.array,w.itemSize,w.normalized)}else M!=="TRANSLATION"&&M!=="ROTATION"&&M!=="SCALE"&&y.geometry.setAttribute(M,l[M]);gt.prototype.copy.call(S,y),this.parser.assignFinalMaterial(S),m.push(S)}return u.isGroup?(u.clear(),u.add(...m),u):m[0]}))}}const pD="glTF",Jf=12,vR={JSON:1313821514,BIN:5130562};class J7{constructor(e){this.name=Rt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Jf);if(this.header={magic:e_(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==pD)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Jf,r=new DataView(e,Jf);let s=0;for(;s<i;){const o=r.getUint32(s,!0);s+=4;const a=r.getUint32(s,!0);if(s+=4,a===vR.JSON){const l=new Uint8Array(e,Jf+s,o);this.content=e_(l)}else if(a===vR.BIN){const l=Jf+s;this.body=e.slice(l,l+o)}s+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Y7{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Rt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,r=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},l={},c={};for(const u in o){const d=WS[u]||u.toLowerCase();a[d]=o[u]}for(const u in e.attributes){const d=WS[u]||u.toLowerCase();if(o[u]!==void 0){const p=i.accessors[e.attributes[u]],m=Sh[p.componentType];c[d]=m.name,l[d]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(u){return new Promise(function(d,p){r.decodeDracoFile(u,function(m){for(const y in m.attributes){const _=m.attributes[y],x=l[y];x!==void 0&&(_.normalized=x)}d(m)},a,c,jo,p)})})}}class K7{constructor(){this.name=Rt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Q7{constructor(){this.name=Rt.KHR_MESH_QUANTIZATION}}class mD extends $h{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=a*2,c=a*3,u=r-t,d=(i-t)/u,p=d*d,m=p*d,y=e*c,_=y-c,x=-2*m+3*p,g=m-p,v=1-x,S=g-p+d;for(let M=0;M!==a;M++){const w=o[_+M+a],T=o[_+M+l]*u,R=o[y+M+a],B=o[y+M]*u;s[M]=v*w+S*T+x*R+g*B}return s}}const Z7=new Si;class q7 extends mD{interpolate_(e,t,i,r){const s=super.interpolate_(e,t,i,r);return Z7.fromArray(s).normalize().toArray(s),s}}const is={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Sh={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},AR={9728:$n,9729:gn,9984:B_,9985:vh,9986:$l,9987:ls},SR={33071:Br,33648:Lh,10497:nl},W1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},WS={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...u7>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},wa={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},$7={CUBICSPLINE:void 0,LINEAR:Fh,STEP:zh},j1={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function eV(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new jp({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:_s})),n.DefaultMaterial}function Nl(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Do(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function tV(n,e,t){let i=!1,r=!1,s=!1;for(let c=0,u=e.length;c<u;c++){const d=e[c];if(d.POSITION!==void 0&&(i=!0),d.NORMAL!==void 0&&(r=!0),d.COLOR_0!==void 0&&(s=!0),i&&r&&s)break}if(!i&&!r&&!s)return Promise.resolve(n);const o=[],a=[],l=[];for(let c=0,u=e.length;c<u;c++){const d=e[c];if(i){const p=d.POSITION!==void 0?t.getDependency("accessor",d.POSITION):n.attributes.position;o.push(p)}if(r){const p=d.NORMAL!==void 0?t.getDependency("accessor",d.NORMAL):n.attributes.normal;a.push(p)}if(s){const p=d.COLOR_0!==void 0?t.getDependency("accessor",d.COLOR_0):n.attributes.color;l.push(p)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(c){const u=c[0],d=c[1],p=c[2];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=d),s&&(n.morphAttributes.color=p),n.morphTargetsRelative=!0,n})}function nV(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function iV(n){let e;const t=n.extensions&&n.extensions[Rt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+X1(t.attributes):e=n.indices+":"+X1(n.attributes)+":"+n.mode,n.targets!==void 0)for(let i=0,r=n.targets.length;i<r;i++)e+=":"+X1(n.targets[i]);return e}function X1(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function jS(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function rV(n){return n.search(/\.jpe?g($|\?)/i)>0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const sV=new Ke;
vendor: 29,621 bytes, lines 3986-3989
3986class oV{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new R7,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&s<98?this.textureLoader=new Xp(this.options.manager):this.textureLoader=new zL(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Nr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return Nl(s,a,r),Do(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let a=0,l=o.length;a<l;a++)e[o[a]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone(),s=(o,a)=>{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,u]of o.children.entries())s(u,a.children[c])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Rt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(Ka.resolveURL(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const o=W1[r.type],a=Sh[r.componentType],l=r.normalized===!0,c=new a(r.count*o);return Promise.resolve(new Lt(c,o,l))}const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const a=o[0],l=W1[r.type],c=Sh[r.componentType],u=c.BYTES_PER_ELEMENT,d=u*l,p=r.byteOffset||0,m=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,y=r.normalized===!0;let _,x;if(m&&m!==d){const g=Math.floor(p/m),v="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+g+":"+r.count;let S=t.cache.get(v);S||(_=new c(a,g*m,r.count*m/u),S=new Np(_,m/u),t.cache.add(v,S)),x=new il(S,l,p%m/u,y)}else a===null?_=new c(r.count*l):_=new c(a,p,r.count*l),x=new Lt(_,l,y);if(r.sparse!==void 0){const g=W1.SCALAR,v=Sh[r.sparse.indices.componentType],S=r.sparse.indices.byteOffset||0,M=r.sparse.values.byteOffset||0,w=new v(o[1],S,r.sparse.count*g),T=new c(o[2],M,r.sparse.count*l);a!==null&&(x=new Lt(x.array.slice(),x.itemSize,x.normalized));for(let R=0,B=w.length;R<B;R++){const b=w[R];if(x.setX(b,T[R*l]),l>=2&&x.setY(b,T[R*l+1]),l>=3&&x.setZ(b,T[R*l+2]),l>=4&&x.setW(b,T[R*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return x})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,i).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const p=(s.samplers||{})[o.sampler]||{};return u.magFilter=AR[p.magFilter]||gn,u.minFilter=AR[p.minFilter]||ls,u.wrapS=SR[p.wrapS]||nl,u.wrapT=SR[p.wrapT]||nl,r.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(d){c=!0;const p=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(p,m){let y=p;t.isImageBitmapLoader===!0&&(y=function(_){const x=new Zt(_);x.needsUpdate=!0,p(x)}),t.load(Ka.resolveURL(d,s.path),y,void 0,m)})}).then(function(d){return c===!0&&a.revokeObjectURL(l),Do(d,o),d.userData.mimeType=o.mimeType||rV(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[Rt.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Rt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[Rt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&(typeof r=="number"&&(r=r===xR?oc:jo),"colorSpace"in o?o.colorSpace=r:o.encoding=r===oc?xR:C7),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new W_,Jn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new ki,Jn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return jp}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},c=[];if(l[Rt.KHR_MATERIALS_UNLIT]){const d=r[Rt.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),c.push(d.extendParams(a,s,t))}else{const d=s.pbrMetallicRoughness||{};if(a.color=new Re(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;a.color.setRGB(p[0],p[1],p[2],jo),a.opacity=p[3]}d.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",d.baseColorTexture,oc)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Rr);const u=s.alphaMode||j1.OPAQUE;if(u===j1.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===j1.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==ei&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new ce(1,1),s.normalTexture.scale!==void 0)){const d=s.normalTexture.scale;a.normalScale.set(d,d)}if(s.occlusionTexture!==void 0&&o!==ei&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==ei){const d=s.emissiveFactor;a.emissive=new Re().setRGB(d[0],d[1],d[2],jo)}return s.emissiveTexture!==void 0&&o!==ei&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,oc)),Promise.all(c).then(function(){const d=new o(a);return s.name&&(d.name=s.name),Do(d,s),t.associations.set(d,{materials:e}),s.extensions&&Nl(r,d,s),d})}createUniqueName(e){const t=Dt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[Rt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return MR(l,a,t)})}const o=[];for(let a=0,l=e.length;a<l;a++){const c=e[a],u=iV(c),d=r[u];if(d)o.push(d.promise);else{let p;c.extensions&&c.extensions[Rt.KHR_DRACO_MESH_COMPRESSION]?p=s(c):p=MR(new xt,c,t),r[u]={primitive:c,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,a=[];for(let l=0,c=o.length;l<c;l++){const u=o[l].material===void 0?eV(this.cache):this.getDependency("material",o[l].material);a.push(u)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(l){const c=l.slice(0,l.length-1),u=l[l.length-1],d=[];for(let m=0,y=u.length;m<y;m++){const _=u[m],x=o[m];let g;const v=c[m];if(x.mode===is.TRIANGLES||x.mode===is.TRIANGLE_STRIP||x.mode===is.TRIANGLE_FAN||x.mode===void 0)g=s.isSkinnedMesh===!0?new UE(_,v):new hn(_,v),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),x.mode===is.TRIANGLE_STRIP?g.geometry=yR(g.geometry,wE):x.mode===is.TRIANGLE_FAN&&(g.geometry=yR(g.geometry,Yy));else if(x.mode===is.LINES)g=new Hs(_,v);else if(x.mode===is.LINE_STRIP)g=new qo(_,v);else if(x.mode===is.LINE_LOOP)g=new kE(_,v);else if(x.mode===is.POINTS)g=new HE(_,v);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+x.mode);Object.keys(g.geometry.morphAttributes).length>0&&nV(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Do(g,s),x.extensions&&Nl(r,g,x),t.assignFinalMaterial(g),d.push(g)}for(let m=0,y=d.length;m<y;m++)t.associations.set(d[m],{meshes:e,primitives:m});if(d.length===1)return s.extensions&&Nl(r,d[0],s),d[0];const p=new Go;s.extensions&&Nl(r,p,s),t.associations.set(p,{meshes:e});for(let m=0,y=d.length;m<y;m++)p.add(d[m]);return p})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Un(pi.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new sa(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),Do(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let r=0,s=t.joints.length;r<s;r++)i.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(r){const s=r.pop(),o=r,a=[],l=[];for(let c=0,u=o.length;c<u;c++){const d=o[c];if(d){a.push(d);const p=new Ke;s!==null&&p.fromArray(s.array,c*16),l.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new kp(a,l)})}loadAnimation(e){const t=this.json,i=this,r=t.animations[e],s=r.name?r.name:"animation_"+e,o=[],a=[],l=[],c=[],u=[];for(let d=0,p=r.channels.length;d<p;d++){const m=r.channels[d],y=r.samplers[m.sampler],_=m.target,x=_.node,g=r.parameters!==void 0?r.parameters[y.input]:y.input,v=r.parameters!==void 0?r.parameters[y.output]:y.output;_.node!==void 0&&(o.push(this.getDependency("node",x)),a.push(this.getDependency("accessor",g)),l.push(this.getDependency("accessor",v)),c.push(y),u.push(_))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l),Promise.all(c),Promise.all(u)]).then(function(d){const p=d[0],m=d[1],y=d[2],_=d[3],x=d[4],g=[];for(let v=0,S=p.length;v<S;v++){const M=p[v],w=m[v],T=y[v],R=_[v],B=x[v];if(M===void 0)continue;M.updateMatrix&&M.updateMatrix();const b=i._createAnimationTracks(M,w,T,R,B);if(b)for(let P=0;P<b.length;P++)g.push(b[P])}return new Nh(s,void 0,g)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let l=0,c=r.weights.length;l<c;l++)a.morphTargetInfluences[l]=r.weights[l]}),o})}loadNode(e){const t=this.json,i=this,r=t.nodes[e],s=i._loadNodeShallow(e),o=[],a=r.children||[];for(let c=0,u=a.length;c<u;c++)o.push(i.getDependency("node",a[c]));const l=r.skin===void 0?Promise.resolve(null):i.getDependency("skin",r.skin);return Promise.all([s,Promise.all(o),l]).then(function(c){const u=c[0],d=c[1],p=c[2];p!==null&&u.traverse(function(m){m.isSkinnedMesh&&m.bind(p,sV)});for(let m=0,y=d.length;m<y;m++)u.add(d[m]);return u})}_loadNodeShallow(e){const t=this.json,i=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"",a=[],l=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return l&&a.push(l),s.camera!==void 0&&a.push(r.getDependency("camera",s.camera).then(function(c){return r._getNodeRef(r.cameraCache,s.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){a.push(c)}),this.nodeCache[e]=Promise.all(a).then(function(c){let u;if(s.isBone===!0?u=new V_:c.length>1?u=new Go:c.length===1?u=c[0]:u=new gt,u!==c[0])for(let d=0,p=c.length;d<p;d++)u.add(c[d]);if(s.name&&(u.userData.name=s.name,u.name=o),Do(u,s),s.extensions&&Nl(i,u,s),s.matrix!==void 0){const d=new Ke;d.fromArray(s.matrix),u.applyMatrix4(d)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);return r.associations.has(u)||r.associations.set(u,{}),r.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],r=this,s=new Go;i.name&&(s.name=r.createUniqueName(i.name)),Do(s,i),i.extensions&&Nl(t,s,i);const o=i.nodes||[],a=[];for(let l=0,c=o.length;l<c;l++)a.push(r.getDependency("node",o[l]));return Promise.all(a).then(function(l){for(let u=0,d=l.length;u<d;u++)s.add(l[u]);const c=u=>{const d=new Map;for(const[p,m]of r.associations)(p instanceof Jn||p instanceof Zt)&&d.set(p,m);return u.traverse(p=>{const m=r.associations.get(p);m!=null&&d.set(p,m)}),d};return r.associations=c(s),s})}_createAnimationTracks(e,t,i,r,s){const o=[],a=e.name?e.name:e.uuid,l=[];wa[s.path]===wa.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(a);let c;switch(wa[s.path]){case wa.weights:c=bc;break;case wa.rotation:c=Pc;break;case wa.position:case wa.scale:c=Bc;break;default:switch(i.itemSize){case 1:c=bc;break;case 2:case 3:default:c=Bc;break}break}const u=r.interpolation!==void 0?$7[r.interpolation]:Fh,d=this._getArrayFromAccessor(i);for(let p=0,m=l.length;p<m;p++){const y=new c(l[p]+"."+wa[s.path],t.array,d,u);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(y),o.push(y)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const i=jS(t.constructor),r=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)r[s]=t[s]*i;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(i){const r=this instanceof Pc?q7:mD;return new r(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function aV(n,e,t){const i=e.attributes,r=new Yt;if(i.POSITION!==void 0){const a=t.json.accessors[i.POSITION],l=a.min,c=a.max;if(l!==void 0&&c!==void 0){if(r.set(new z(l[0],l[1],l[2]),new z(c[0],c[1],c[2])),a.normalized){const u=jS(Sh[a.componentType]);r.min.multiplyScalar(u),r.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new z,l=new z;for(let c=0,u=s.length;c<u;c++){const d=s[c];if(d.POSITION!==void 0){const p=t.json.accessors[d.POSITION],m=p.min,y=p.max;if(m!==void 0&&y!==void 0){if(l.setX(Math.max(Math.abs(m[0]),Math.abs(y[0]))),l.setY(Math.max(Math.abs(m[1]),Math.abs(y[1]))),l.setZ(Math.max(Math.abs(m[2]),Math.abs(y[2]))),p.normalized){const _=jS(Sh[p.componentType]);l.multiplyScalar(_)}a.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(a)}n.boundingBox=r;const o=new Nn;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function MR(n,e,t){const i=e.attributes,r=[];function s(o,a){return t.getDependency("accessor",o).then(function(l){n.setAttribute(a,l)})}for(const o in i){const a=WS[o]||o.toLowerCase();a in n.attributes||r.push(s(i[o],a))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(a){n.setIndex(a)});r.push(o)}return Do(n,e),aV(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?tV(n,e.targets,t):n})}const lV={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join(` 3987`),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {"," vec4 tex = texture2D( tDiffuse, vUv );"," gl_FragColor = LinearTosRGB( tex );","}"].join(` 3988`)},J1=new WeakMap;class cV extends Hi{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,r){const s=new Nr(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}const i=JSON.stringify(t);if(J1.has(e)){const l=J1.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((c,u)=>{r._callbacks[s]={resolve:c,reject:u},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),J1.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new xt;e.index&&t.setIndex(new Lt(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const r=e.attributes[i],s=r.name,o=r.array,a=r.itemSize;t.setAttribute(s,new Lt(o,a))}return t}_loadLibrary(e,t){const i=new Nr(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((r,s)=>{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=uV.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` 3989`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(s){const o=s.data;switch(o.type){case"decode":r._callbacks[o.id].resolve(o);break;case"error":r._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,s){return r._taskLoad>s._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function uV(){let n,e;onmessage=function(o){const a=o.data;switch(a.type){case"init":n=a.decoderConfig,e=new Promise(function(u){n.onModuleLoaded=function(d){u({draco:d})},DracoDecoderModule(n)});break;case"decode":const l=a.buffer,c=a.taskConfig;e.then(u=>{const d=u.draco,p=new d.Decoder,m=new d.DecoderBuffer;m.Init(new Int8Array(l),l.byteLength);try{const y=t(d,p,m,c),_=y.attributes.map(x=>x.array.buffer);y.index&&_.push(y.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:y},_)}catch(y){console.error(y),self.postMessage({type:"error",id:a.id,error:y.message})}finally{d.destroy(m),d.destroy(p)}});break}};function t(o,a,l,c){const u=c.attributeIDs,d=c.attributeTypes;let p,m;const y=a.GetEncodedGeometryType(l);if(y===o.TRIANGULAR_MESH)p=new o.Mesh,m=a.DecodeBufferToMesh(l,p);else if(y===o.POINT_CLOUD)p=new o.PointCloud,m=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const _={index:null,attributes:[]};for(const x in u){const g=self[d[x]];let v,S;if(c.useUniqueIDs)S=u[x],v=a.GetAttributeByUniqueId(p,S);else{if(S=a.GetAttributeId(p,o[u[x]]),S===-1)continue;v=a.GetAttribute(p,S)}_.attributes.push(r(o,a,p,x,g,v))}return y===o.TRIANGULAR_MESH&&(_.index=i(o,a,p)),o.destroy(p),_}function i(o,a,l){const u=l.num_faces()*3,d=u*4,p=o._malloc(d);a.GetTrianglesUInt32Array(l,d,p);const m=new Uint32Array(o.HEAPF32.buffer,p,u).slice();return o._free(p),{array:m,itemSize:1}}function r(o,a,l,c,u,d){const p=d.num_components(),y=l.num_points()*p,_=y*u.BYTES_PER_ELEMENT,x=s(o,u),g=o._malloc(_);a.GetAttributeDataArrayForAllPoints(l,d,x,_,g);const v=new u(o.HEAPF32.buffer,g,y).slice();return o._free(g),{name:c,array:v,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let ag;const Y1=()=>{if(ag)return ag;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9
3989LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFB
3989BBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMG
3989XAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(d=>{s=d.instance,s.exports.__wasm_call_ctors()});function a(d){const p=new Uint8Array(d.length);for(let y=0;y<d.length;
3989++y){const _=d.charCodeAt(y);p[y]=_>96?_-71:_>64?_-65:_>47?_+4:_>46?63:62}let m=0;for(let y=0;y<d.length;++y)p[m++]=p[y]<60?i[p[y]]:(p[y]-60)*64+p[++y];return p.buffer.slice(0,m)}function l(d,p,m,y,_,x){const g=s.exports.sbrk,v=m+3&-4,S=g(v*y),M=g(_.length),w=new Uint8Array(s.exports.memory.buffer);w.set(_,M);const T=d(S,m,y,M,_.length);if(T===0&&x&&x(S,v,y),p.set(w.subarray(S,S+m*y)),g(S-g(0)),T!==0)throw new Error(`Malformed buffer data: ${T}`)}const c={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},u={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return ag={ready:o,supported:!0,decodeVertexBuffer(d,p,m,y,_){l(s.exports.meshopt_decodeVertexBuffer,d,p,m,y,s.exports[c[_]])},decodeIndexBuffer(d,p,m,y){l(s.exports.meshopt_decodeIndexBuffer,d,p,m,y)},decodeIndexSequence(d,p,m,y){l(s.exports.meshopt_decodeIndexSequence,d,p,m,y)},decodeGltfBuffer(d,p,m,y,_,x){l(s.exports[u[_]],d,p,m,y,s.exports[c[x]])}},ag},hV=H.forwardRef(({children:n,multisamping:e=8,renderIndex:t=1,disableRender:i,disableGamma:r,disableRenderPass:s,depthBuffer:o=!0,stencilBuffer:a=!1,anisotropy:l=1,encoding:c,type:u,...d},p)=>{H.useMemo(()=>lx({EffectComposer:M7,RenderPass:T7,ShaderPass:HS}),[]);const m=H.useRef(null);H.useImperativeHandle(p,()=>m.current,[]);const{scene:y,camera:_,gl:x,size:g,viewport:v}=Tr(),[S]=H.useState(()=>{const w=new Fi(g.width,g.height,{type:u||fo,format:fi,depthBuffer:o,stencilBuffer:a,anisotropy:l});return u===xs&&c!=null&&("colorSpace"in w?w.texture.colorSpace=c:w.texture.encoding=c),w.samples=e,w});H.useEffect(()=>{var w,T;(w=m.current)==null||w.setSize(g.width,g.height),(T=m.current)==null||T.setPixelRatio(v.dpr)},[x,g,v.dpr]),pl(()=>{var w;i||(w=m.current)==null||w.render()},t);const M=[];return s||M.push(H.createElement("renderPass",{key:"renderpass",attach:`passes-${M.length}`,args:[y,_]})),r||M.push(H.createElement("shaderPass",{attach:`passes-${M.length}`,key:"gammapass",args:[lV]})),H.Children.forEach(n,w=>{w&&M.push(H.cloneElement(w,{key:M.length,attach:`passes-${M.length}`}))}),H.createElement("effectComposer",Ec({ref:m,args:[x,S]},d),M)}),K1=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function Gt(n,e){const t=Tr(s=>s.gl),i=ml(Xp,K1(n)?Object.values(n):n);return H.useLayoutEffect(()=>{e==null||e(i)},[e]),H.useEffect(()=>{if("initTexture"in t){let s=[];Array.isArray(i)?s=i:i instanceof Zt?s=[i]:K1(i)&&(s=Object.values(i)),s.forEach(o=>{o instanceof Zt&&t.initTexture(o)})}},[t,i]),H.useMemo(()=>{if(K1(n)){const s={};let o=0;for(const a in n)s[a]=i[o++];return s}else return i},[n,i])}Gt.preload=n=>ml.preload(Xp,n);Gt.clear=n=>ml.clear(Xp,n);let lg=null,gD="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function yD(n,e,t){return i=>{t&&t(i),n&&(lg||(lg=new cV),lg.setDecoderPath(typeof n=="string"?n:gD),i.setDRACOLoader(lg)),e&&i.setMeshoptDecoder(typeof Y1=="function"?Y1():Y1)}}function Ct(n,e=!0,t=!0,i){return ml(hw,n,yD(e,t,i))}Ct.preload=(n,e=!0,t=!0,i)=>ml.preload(hw,n,yD(e,t,i));Ct.clear=n=>ml.clear(hw,n);Ct.setDecoderPath=n=>{gD=n};/*! 3990 * camera-controls 3991 * https://github.com/yomotsu/camera-controls 3992 * (c) 2017 @yomotsu 3993 * Released under the MIT License. 3994 */const xn={LEFT:1,RIGHT:2,MIDDLE:4},he=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Bu={NONE:0,IN:1,OUT:-1};function kl(n){return n.isPerspectiveCamera}function Ca(n){return n.isOrthographicCamera}const Iu=Math.PI*2,ER=Math.PI/2,_D=1e-5,Yf=Math.PI/180;function Ps(n,e,t){return Math.max(e,Math.min(t,n))}function nn(n,e=_D){return Math.abs(n)<e}function jt(n,e,t=_D){return nn(n-e,t)}function wR(n,e){return Math.round(n/e)*e}function Kf(n){return isFinite(n)?n:n<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Qf(n){return Math.abs(n)<Number.MAX_VALUE?n:n*(1/0)}function cg(n,e,t,i,r=1/0,s){i=Math.max(1e-4,i);const o=2/i,a=o*s,l=1/(1+a+.48*a*a+.235*a*a*a);let c=n-e;const u=e,d=r*i;c=Ps(c,-d,d),e=n-c;const p=(t.value+o*c)*s;t.value=(t.value-o*p)*l;let m=e+(c+p)*l;return u-n>0==m>u&&(m=u,t.value=(m-u)/s),m}function TR(n,e,t,i,r=1/0,s,o){i=Math.max(1e-4,i);const a=2/i,l=a*s,c=1/(1+l+.48*l*l+.235*l*l*l);let u=e.x,d=e.y,p=e.z,m=n.x-u,y=n.y-d,_=n.z-p;const x=u,g=d,v=p,S=r*i,M=S*S,w=m*m+y*y+_*_;if(w>M){const X=Math.sqrt(w);m=m/X*S,y=y/X*S,_=_/X*S}u=n.x-m,d=n.y-y,p=n.z-_;const T=(t.x+a*m)*s,R=(t.y+a*y)*s,B=(t.z+a*_)*s;t.x=(t.x-a*T)*c,t.y=(t.y-a*R)*c,t.z=(t.z-a*B)*c,o.x=u+(m+T)*c,o.y=d+(y+R)*c,o.z=p+(_+B)*c;const b=x-n.x,P=g-n.y,L=v-n.z,U=o.x-x,G=o.y-g,j=o.z-v;return b*U+P*G+L*j>0&&(o.x=x,o.y=g,o.z=v,t.x=(o.x-x)/s,t.y=(o.y-g)/s,t.z=(o.z-v)/s),o}
vendor: 42,738 bytes, line 3994
3994function Q1(n,e){e.set(0,0),n.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=n.length,e.y/=n.length}function Z1(n,e){return Ca(n)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class fV{constructor(){this._listeners={}}addEventListener(e,t){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e)}}}var q1;const dV="2.9.0",ug=1/8,pV=/Mac/.test((q1=globalThis==null?void 0:globalThis.navigator)===null||q1===void 0?void 0:q1.platform);let ft,CR,hg,$1,ir,St,Ht,Lu,Zf,qs,$s,Hl,RR,bR,es,qf,Du,PR,eA,BR,tA,nA,fg,iA=class XS extends fV{static install(e){ft=e.THREE,CR=Object.freeze(new ft.Vector3(0,0,0)),hg=Object.freeze(new ft.Vector3(0,1,0)),$1=Object.freeze(new ft.Vector3(0,0,1)),ir=new ft.Vector2,St=new ft.Vector3,Ht=new ft.Vector3,Lu=new ft.Vector3,Zf=new ft.Vector3,qs=new ft.Vector3,$s=new ft.Vector3,Hl=new ft.Vector3,RR=new ft.Vector3,bR=new ft.Vector3,es=new ft.Spherical,qf=new ft.Spherical,Du=new ft.Box3,PR=new ft.Box3,eA=new ft.Sphere,BR=new ft.Quaternion,tA=new ft.Quaternion,nA=new ft.Matrix4,fg=new ft.Raycaster}static get ACTION(){return he}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=he.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Bu.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new ft.Vector3,this._focalOffsetVelocity=new ft.Vector3,this._zoomVelocity={value:0},this._truckInternal=(g,v,S)=>{let M,w;if(kl(this._camera)){const T=St.copy(this._camera.position).sub(this._target),R=this._camera.getEffectiveFOV()*Yf,B=T.length()*Math.tan(R*.5);M=this.truckSpeed*g*B/this._elementRect.height,w=this.truckSpeed*v*B/this._elementRect.height}else if(Ca(this._camera)){const T=this._camera;M=g*(T.right-T.left)/T.zoom/this._elementRect.width,w=v*(T.top-T.bottom)/T.zoom/this._elementRect.height}else return;this.verticalDragToForward?(S?this.setFocalOffset(this._focalOffsetEnd.x+M,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(M,0,!0),this.forward(-w,!0)):S?this.setFocalOffset(this._focalOffsetEnd.x+M,this._focalOffsetEnd.y+w,this._focalOffsetEnd.z,!0):this.truck(M,w,!0)},this._rotateInternal=(g,v)=>{const S=Iu*this.azimuthRotateSpeed*g/this._elementRect.height,M=Iu*this.polarRotateSpeed*v/this._elementRect.height;this.rotate(S,M,!0)},this._dollyInternal=(g,v,S)=>{const M=Math.pow(.95,-g*this.dollySpeed),w=this._sphericalEnd.radius,T=this._sphericalEnd.radius*M,R=Ps(T,this.minDistance,this.maxDistance),B=R-T;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(T,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(B,!0),this._dollyToNoClamp(R,!0)):this._dollyToNoClamp(R,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?T:R)-w,this._dollyControlCoord.set(v,S)),this._lastDollyDirection=Math.sign(-g)},this._zoomInternal=(g,v,S)=>{const M=Math.pow(.95,g*this.dollySpeed),w=this._zoom,T=this._zoom*M;this.zoomTo(T,!0),this.dollyToCursor&&(this._changedZoom+=T-w,this._dollyControlCoord.set(v,S))},typeof ft>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new ft.Quaternion().setFromUnitVectors(this._camera.up,hg),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=he.NONE,this._target=new ft.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new ft.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new ft.Spherical().setFromVector3(St.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new ft.Vector3,new ft.Vector3,new ft.Vector3,new ft.Vector3],this._updateNearPlaneCorners(),this._boundary=new ft.Box3(new ft.Vector3(-1/0,-1/0,-1/0),new ft.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new ft.Vector2,this.mouseButtons={left:he.ROTATE,middle:he.DOLLY,right:he.TRUCK,wheel:kl(this._camera)?he.DOLLY:Ca(this._camera)?he.ZOOM:he.NONE},this.touches={one:he.TOUCH_ROTATE,two:kl(this._camera)?he.TOUCH_DOLLY_TRUCK:Ca(this._camera)?he.TOUCH_ZOOM_TRUCK:he.NONE,three:he.TOUCH_TRUCK};const i=new ft.Vector2,r=new ft.Vector2,s=new ft.Vector2,o=g=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const M=this._domElement.getBoundingClientRect(),w=g.clientX/M.width,T=g.clientY/M.height;if(w<this._interactiveArea.left||w>this._interactiveArea.right||T<this._interactiveArea.top||T>this._interactiveArea.bottom)return}const v=g.pointerType!=="mouse"?null:(g.buttons&xn.LEFT)===xn.LEFT?xn.LEFT:(g.buttons&xn.MIDDLE)===xn.MIDDLE?xn.MIDDLE:(g.buttons&xn.RIGHT)===xn.RIGHT?xn.RIGHT:null;if(v!==null){const M=this._findPointerByMouseButton(v);M&&this._disposePointer(M)}if((g.buttons&xn.LEFT)===xn.LEFT&&this._lockedPointer)return;const S={pointerId:g.pointerId,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:v};this._activePointers.push(S),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),this._isDragging=!0,p(g)},a=g=>{g.cancelable&&g.preventDefault();const v=g.pointerId,S=this._lockedPointer||this._findPointerById(v);if(S){if(S.clientX=g.clientX,S.clientY=g.clientY,S.deltaX=g.movementX,S.deltaY=g.movementY,this._state=0,g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(g.buttons&xn.LEFT)===xn.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(g.buttons&xn.MIDDLE)===xn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(g.buttons&xn.RIGHT)===xn.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=g=>{const v=this._findPointerById(g.pointerId);if(!(v&&v===this._lockedPointer)){if(v&&this._disposePointer(v),g.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=he.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=he.NONE;y()}};let c=-1;const u=g=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===he.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const T=this._domElement.getBoundingClientRect(),R=g.clientX/T.width,B=g.clientY/T.height;if(R<this._interactiveArea.left||R>this._interactiveArea.right||B<this._interactiveArea.top||B>this._interactiveArea.bottom)return}if(g.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===he.ROTATE||this.mouseButtons.wheel===he.TRUCK){const T=performance.now();c-T<1e3&&this._getClientRect(this._elementRect),c=T}const v=pV?-1:-3,S=g.deltaMode===1?g.deltaY/v:g.deltaY/(v*10),M=this.dollyToCursor?(g.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(g.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case he.ROTATE:{this._rotateInternal(g.deltaX,g.deltaY),this._isUserControllingRotate=!0;break}case he.TRUCK:{this._truckInternal(g.deltaX,g.deltaY,!1),this._isUserControllingTruck=!0;break}case he.OFFSET:{this._truckInternal(g.deltaX,g.deltaY,!0),this._isUserControllingOffset=!0;break}case he.DOLLY:{this._dollyInternal(-S,M,w),this._isUserControllingDolly=!0;break}case he.ZOOM:{this._zoomInternal(-S,M,w),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},d=g=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===XS.ACTION.NONE){const v=g instanceof PointerEvent?g.pointerId:0,S=this._findPointerById(v);S&&this._disposePointer(S),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}g.preventDefault()}},p=g=>{if(!this._enabled)return;if(Q1(this._activePointers,ir),this._getClientRect(this._elementRect),i.copy(ir),r.copy(ir),this._activePointers.length>=2){const S=ir.x-this._activePointers[1].clientX,M=ir.y-this._activePointers[1].clientY,w=Math.sqrt(S*S+M*M);s.set(0,w);const T=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,R=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;r.set(T,R)}if(this._state=0,!g)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in g&&g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(g.buttons&xn.LEFT)===xn.LEFT&&(this._state=this._state|this.mouseButtons.left),(g.buttons&xn.MIDDLE)===xn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&xn.RIGHT)===xn.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&he.ROTATE)===he.ROTATE||(this._state&he.TOUCH_ROTATE)===he.TOUCH_ROTATE||(this._state&he.TOUCH_DOLLY_ROTATE)===he.TOUCH_DOLLY_ROTATE||(this._state&he.TOUCH_ZOOM_ROTATE)===he.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&he.TRUCK)===he.TRUCK||(this._state&he.TOUCH_TRUCK)===he.TOUCH_TRUCK||(this._state&he.TOUCH_DOLLY_TRUCK)===he.TOUCH_DOLLY_TRUCK||(this._state&he.TOUCH_ZOOM_TRUCK)===he.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&he.DOLLY)===he.DOLLY||(this._state&he.TOUCH_DOLLY)===he.TOUCH_DOLLY||(this._state&he.TOUCH_DOLLY_TRUCK)===he.TOUCH_DOLLY_TRUCK||(this._state&he.TOUCH_DOLLY_OFFSET)===he.TOUCH_DOLLY_OFFSET||(this._state&he.TOUCH_DOLLY_ROTATE)===he.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&he.ZOOM)===he.ZOOM||(this._state&he.TOUCH_ZOOM)===he.TOUCH_ZOOM||(this._state&he.TOUCH_ZOOM_TRUCK)===he.TOUCH_ZOOM_TRUCK||(this._state&he.TOUCH_ZOOM_OFFSET)===he.TOUCH_ZOOM_OFFSET||(this._state&he.TOUCH_ZOOM_ROTATE)===he.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&he.OFFSET)===he.OFFSET||(this._state&he.TOUCH_OFFSET)===he.TOUCH_OFFSET||(this._state&he.TOUCH_DOLLY_OFFSET)===he.TOUCH_DOLLY_OFFSET||(this._state&he.TOUCH_ZOOM_OFFSET)===he.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Q1(this._activePointers,ir);const v=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,S=v?-v.deltaX:r.x-ir.x,M=v?-v.deltaY:r.y-ir.y;if(r.copy(ir),((this._state&he.ROTATE)===he.ROTATE||(this._state&he.TOUCH_ROTATE)===he.TOUCH_ROTATE||(this._state&he.TOUCH_DOLLY_ROTATE)===he.TOUCH_DOLLY_ROTATE||(this._state&he.TOUCH_ZOOM_ROTATE)===he.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(S,M),this._isUserControllingRotate=!0),(this._state&he.DOLLY)===he.DOLLY||(this._state&he.ZOOM)===he.ZOOM){const w=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,T=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,R=this.dollyDragInverted?-1:1;(this._state&he.DOLLY)===he.DOLLY?(this._dollyInternal(R*M*ug,w,T),this._isUserControllingDolly=!0):(this._zoomInternal(R*M*ug,w,T),this._isUserControllingZoom=!0)}if((this._state&he.TOUCH_DOLLY)===he.TOUCH_DOLLY||(this._state&he.TOUCH_ZOOM)===he.TOUCH_ZOOM||(this._state&he.TOUCH_DOLLY_TRUCK)===he.TOUCH_DOLLY_TRUCK||(this._state&he.TOUCH_ZOOM_TRUCK)===he.TOUCH_ZOOM_TRUCK||(this._state&he.TOUCH_DOLLY_OFFSET)===he.TOUCH_DOLLY_OFFSET||(this._state&he.TOUCH_ZOOM_OFFSET)===he.TOUCH_ZOOM_OFFSET||(this._state&he.TOUCH_DOLLY_ROTATE)===he.TOUCH_DOLLY_ROTATE||(this._state&he.TOUCH_ZOOM_ROTATE)===he.TOUCH_ZOOM_ROTATE){const w=ir.x-this._activePointers[1].clientX,T=ir.y-this._activePointers[1].clientY,R=Math.sqrt(w*w+T*T),B=s.y-R;s.set(0,R);const b=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,P=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&he.TOUCH_DOLLY)===he.TOUCH_DOLLY||(this._state&he.TOUCH_DOLLY_ROTATE)===he.TOUCH_DOLLY_ROTATE||(this._state&he.TOUCH_DOLLY_TRUCK)===he.TOUCH_DOLLY_TRUCK||(this._state&he.TOUCH_DOLLY_OFFSET)===he.TOUCH_DOLLY_OFFSET?(this._dollyInternal(B*ug,b,P),this._isUserControllingDolly=!0):(this._zoomInternal(B*ug,b,P),this._isUserControllingZoom=!0)}((this._state&he.TRUCK)===he.TRUCK||(this._state&he.TOUCH_TRUCK)===he.TOUCH_TRUCK||(this._state&he.TOUCH_DOLLY_TRUCK)===he.TOUCH_DOLLY_TRUCK||(this._state&he.TOUCH_ZOOM_TRUCK)===he.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(S,M,!1),this._isUserControllingTruck=!0),((this._state&he.OFFSET)===he.OFFSET||(this._state&he.TOUCH_OFFSET)===he.TOUCH_OFFSET||(this._state&he.TOUCH_DOLLY_OFFSET)===he.TOUCH_DOLLY_OFFSET||(this._state&he.TOUCH_ZOOM_OFFSET)===he.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(S,M,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},y=()=>{Q1(this._activePointers,ir),r.copy(ir),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",_),this._domElement.ownerDocument.addEventListener("pointerlockerror",x),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),p())},this.unlockPointer=()=>{var g,v,S;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(g=this._domElement)===null||g===void 0||g.ownerDocument.exitPointerLock(),(v=this._domElement)===null||v===void 0||v.ownerDocument.removeEventListener("pointerlockchange",_),(S=this._domElement)===null||S===void 0||S.ownerDocument.removeEventListener("pointerlockerror",x),this.cancel()};const _=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},x=()=>{this.unlockPointer()};this._addAllEventListeners=g=>{this._domElement=g,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),this._domElement.addEventListener("pointercancel",l),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("pointercancel",l),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",d),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.removeEventListener("pointerlockchange",_),this._domElement.ownerDocument.removeEventListener("pointerlockerror",x))},this.cancel=()=>{this._state!==he.NONE&&(this._state=he.NONE,this._activePointers.length=0,y())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=Ps(e.width,0,1),this._interactiveArea.height=Ps(e.height,0,1),this._interactiveArea.x=Ps(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Ps(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,i)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,i=!1){this._isUserControllingRotate=!1;const r=Ps(e,this.minAzimuthAngle,this.maxAzimuthAngle),s=Ps(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=s,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!i||jt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&jt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Bu.NONE,this._changedDolly=0,this._dollyToNoClamp(Ps(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=jt(o,this._spherical.radius);if(!(i>e)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,o)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const s=!t||jt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(s)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Zf).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const i=!t||jt(this._target.x,this._targetEnd.x,this.restThreshold)&&jt(this._target.y,this._targetEnd.y,this.restThreshold)&&jt(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=Ps(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const i=!t||jt(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,t,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,i)}truck(e,t,i=!1){this._camera.updateMatrix(),qs.setFromMatrixColumn(this._camera.matrix,0),$s.setFromMatrixColumn(this._camera.matrix,1),qs.multiplyScalar(e),$s.multiplyScalar(-t);const r=St.copy(qs).add($s),s=Ht.copy(this._targetEnd).add(r);return this.moveTo(s.x,s.y,s.z,i)}forward(e,t=!1){St.setFromMatrixColumn(this._camera.matrix,0),St.crossVectors(this._camera.up,St),St.multiplyScalar(e);const i=Ht.copy(this._targetEnd).add(St);return this.moveTo(i.x,i.y,i.z,t)}elevate(e,t=!1){return St.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+St.x,this._targetEnd.y+St.y,this._targetEnd.z+St.z,t)}moveTo(e,t,i,r=!1){this._isUserControllingTruck=!1;const s=St.set(e,t,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,s,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const o=!r||jt(this._target.x,this._targetEnd.x,this.restThreshold)&&jt(this._target.y,this._targetEnd.y,this.restThreshold)&&jt(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,i,r=!1){const a=St.set(e,t,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(a.x,a.y,a.z,r)}fitToBox(e,t,{cover:i=!1,paddingLeft:r=0,paddingRight:s=0,paddingBottom:o=0,paddingTop:a=0}={}){const l=[],c=e.isBox3?Du.copy(e):Du.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=wR(this._sphericalEnd.theta,ER),d=wR(this._sphericalEnd.phi,ER);l.push(this.rotateTo(u,d,t));const p=St.setFromSpherical(this._sphericalEnd).normalize(),m=BR.setFromUnitVectors(p,$1),y=jt(Math.abs(p.y),1);y&&m.multiply(tA.setFromAxisAngle(hg,u)),m.multiply(this._yAxisUpSpaceInverse);const _=PR.makeEmpty();Ht.copy(c.min).applyQuaternion(m),_.expandByPoint(Ht),Ht.copy(c.min).setX(c.max.x).applyQuaternion(m),_.expandByPoint(Ht),Ht.copy(c.min).setY(c.max.y).applyQuaternion(m),_.expandByPoint(Ht),Ht.copy(c.max).setZ(c.min.z).applyQuaternion(m),_.expandByPoint(Ht),Ht.copy(c.min).setZ(c.max.z).applyQuaternion(m),_.expandByPoint(Ht),Ht.copy(c.max).setY(c.min.y).applyQuaternion(m),_.expandByPoint(Ht),Ht.copy(c.max).setX(c.min.x).applyQuaternion(m),_.expandByPoint(Ht),Ht.copy(c.max).applyQuaternion(m),_.expandByPoint(Ht),_.min.x-=r,_.min.y-=o,_.max.x+=s,_.max.y+=a,m.setFromUnitVectors($1,p),y&&m.premultiply(tA.invert()),m.premultiply(this._yAxisUpSpace);const x=_.getSize(St),g=_.getCenter(Ht).applyQuaternion(m);if(kl(this._camera)){const v=this.getDistanceToFitBox(x.x,x.y,x.z,i);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.dollyTo(v,t)),l.push(this.setFocalOffset(0,0,0,t))}else if(Ca(this._camera)){const v=this._camera,S=v.right-v.left,M=v.top-v.bottom,w=i?Math.max(S/x.x,M/x.y):Math.min(S/x.x,M/x.y);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.zoomTo(w,t)),l.push(this.setFocalOffset(0,0,0,t))}return Promise.all(l)}fitToSphere(e,t){const i=[],s="isObject3D"in e?XS.createBoundingSphere(e,eA):eA.copy(e);if(i.push(this.moveTo(s.center.x,s.center.y,s.center.z,t)),kl(this._camera)){const o=this.getDistanceToFitSphere(s.radius);i.push(this.dollyTo(o,t))}else if(Ca(this._camera)){const o=this._camera.right-this._camera.left,a=this._camera.top-this._camera.bottom,l=2*s.radius,c=Math.min(o/l,a/l);i.push(this.zoomTo(c,t))}return i.push(this.setFocalOffset(0,0,0,t)),Promise.all(i)}setLookAt(e,t,i,r,s,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Bu.NONE,this._changedDolly=0;const l=Ht.set(r,s,o),c=St.set(e,t,i);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!a||jt(this._target.x,this._targetEnd.x,this.restThreshold)&&jt(this._target.y,this._targetEnd.y,this.restThreshold)&&jt(this._target.z,this._targetEnd.z,this.restThreshold)&&jt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&jt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&jt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(e,t,i,r,s,o,a,l,c,u,d,p,m,y=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Bu.NONE,this._changedDolly=0;const _=St.set(r,s,o),x=Ht.set(e,t,i);es.setFromVector3(x.sub(_).applyQuaternion(this._yAxisUpSpace));const g=Lu.set(u,d,p),v=Ht.set(a,l,c);qf.setFromVector3(v.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(_.lerp(g,m));const S=qf.theta-es.theta,M=qf.phi-es.phi,w=qf.radius-es.radius;this._sphericalEnd.set(es.radius+w*m,es.phi+M*m,es.theta+S*m),this.normalizeRotations(),this._needsUpdate=!0,y||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const T=!y||jt(this._target.x,this._targetEnd.x,this.restThreshold)&&jt(this._target.y,this._targetEnd.y,this.restThreshold)&&jt(this._target.z,this._targetEnd.z,this.restThreshold)&&jt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&jt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&jt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(T)}setPosition(e,t,i,r=!1){return this.setLookAt(e,t,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,i,r=!1){const s=this.getPosition(St),o=this.setLookAt(s.x,s.y,s.z,e,t,i,r);return this._sphericalEnd.phi=Ps(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,i,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,i),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const s=!r||jt(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&jt(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&jt(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}setOrbitPoint(e,t,i){this._camera.updateMatrixWorld(),qs.setFromMatrixColumn(this._camera.matrixWorldInverse,0),$s.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Hl.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=St.set(e,t,i),s=r.distanceTo(this._camera.position),o=r.sub(this._camera.position);qs.multiplyScalar(o.x),$s.multiplyScalar(o.y),Hl.multiplyScalar(o.z),St.copy(qs).add($s).add(Hl),St.z=St.z+s,this.dollyTo(s,!1),this.setFocalOffset(-St.x,St.y,-St.z,!1),this.moveTo(e,t,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,i,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new ft.Vector4,typeof e=="number"?this._viewport.set(e,t,i,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,i,r=!1){if(Z1(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const s=e/t,o=this._camera.getEffectiveFOV()*Yf,a=this._camera.aspect;return((r?s>a:s<a)?t:e/a)*.5/Math.tan(o*.5)+i*.5}getDistanceToFitSphere(e){if(Z1(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*Yf,i=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,r=1<this._camera.aspect?t:i;return e/Math.sin(r*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new ft.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new ft.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new ft.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new ft.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%Iu,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=Iu),this._spherical.theta+=Iu*Math.round((this._sphericalEnd.theta-this._spherical.theta)/Iu)}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!jt(this._camera.up.x,this._cameraUp0.x)||!jt(this._camera.up.y,this._cameraUp0.y)||!jt(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const i=this.getPosition(St);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,hg),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=St.subVectors(this._target,this._camera.position).normalize(),t=Ht.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const i=this.getPosition(St);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,i=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,s=RR.subVectors(this._targetEnd,this._target),o=bR.subVectors(this._focalOffsetEnd,this._focalOffset),a=this._zoomEnd-this._zoom;if(nn(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=cg(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,d,1/0,e),this._needsUpdate=!0}if(nn(i))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=cg(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,d,1/0,e),this._needsUpdate=!0}if(nn(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const d=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=cg(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,d,this.maxSpeed,e),this._needsUpdate=!0}if(nn(s.x)&&nn(s.y)&&nn(s.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const d=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;TR(this._target,this._targetEnd,this._targetVelocity,d,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(nn(o.x)&&nn(o.y)&&nn(o.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const d=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;TR(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,d,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(nn(a))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const d=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=cg(this._zoom,this._zoomEnd,this._zoomVelocity,d,1/0,e)}if(this.dollyToCursor){if(kl(this._camera)&&this._changedDolly!==0){const d=this._spherical.radius-this._lastDistance,p=this._camera,m=this._getCameraDirection(Zf),y=St.copy(m).cross(p.up).normalize();y.lengthSq()===0&&(y.x=1);const _=Ht.crossVectors(y,m),x=this._sphericalEnd.radius*Math.tan(p.getEffectiveFOV()*Yf*.5),v=(this._sphericalEnd.radius-d-this._sphericalEnd.radius)/this._sphericalEnd.radius,S=Lu.copy(this._targetEnd).add(y.multiplyScalar(this._dollyControlCoord.x*x*p.aspect)).add(_.multiplyScalar(this._dollyControlCoord.y*x)),M=St.copy(this._targetEnd).lerp(S,v),w=this._lastDollyDirection===Bu.IN&&this._spherical.radius<=this.minDistance,T=this._lastDollyDirection===Bu.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(w||T)){this._sphericalEnd.radius-=d,this._spherical.radius-=d;const B=Ht.copy(m).multiplyScalar(-d);M.add(B)}this._boundary.clampPoint(M,M);const R=Ht.subVectors(M,this._targetEnd);this._targetEnd.copy(M),this._target.add(R),this._changedDolly-=d,nn(this._changedDolly)&&(this._changedDolly=0)}else if(Ca(this._camera)&&this._changedZoom!==0){const d=this._zoom-this._lastZoom,p=this._camera,m=St.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(p.near+p.far)/(p.near-p.far)).unproject(p),y=Ht.set(0,0,-1).applyQuaternion(p.quaternion),_=Lu.copy(m).add(y.multiplyScalar(-m.dot(p.up))),g=-(this._zoom-d-this._zoom)/this._zoom,v=this._getCameraDirection(Zf),S=this._targetEnd.dot(v),M=St.copy(this._targetEnd).lerp(_,g),w=M.dot(v),T=v.multiplyScalar(w-S);M.sub(T),this._boundary.clampPoint(M,M);const R=Ht.subVectors(M,this._targetEnd);this._targetEnd.copy(M),this._target.add(R),this._changedZoom-=d,nn(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const l=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,l),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!nn(this._focalOffset.x)||!nn(this._focalOffset.y)||!nn(this._focalOffset.z))&&(this._camera.updateMatrixWorld(),qs.setFromMatrixColumn(this._camera.matrix,0),$s.setFromMatrixColumn(this._camera.matrix,1),Hl.setFromMatrixColumn(this._camera.matrix,2),qs.multiplyScalar(this._focalOffset.x),$s.multiplyScalar(-this._focalOffset.y),Hl.multiplyScalar(this._focalOffset.z),St.copy(qs).add($s).add(Hl),this._camera.position.add(St)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),St.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const u=this._needsUpdate;return u&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):u?(this.dispatchEvent({type:"update"}),nn(t,this.restThreshold)&&nn(i,this.restThreshold)&&nn(r,this.restThreshold)&&nn(s.x,this.restThreshold)&&nn(s.y,this.restThreshold)&&nn(s.z,this.restThreshold)&&nn(o.x,this.restThreshold)&&nn(o.y,this.restThreshold)&&nn(o.z,this.restThreshold)&&nn(a,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!u&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=u,this._needsUpdate=!1,u}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:Kf(this.maxDistance),minZoom:this.minZoom,maxZoom:Kf(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Kf(this.maxPolarAngle),minAzimuthAngle:Kf(this.minAzimuthAngle),maxAzimuthAngle:Kf(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:St.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const i=JSON.parse(e);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=Qf(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=Qf(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=Qf(i.maxPolarAngle),this.minAzimuthAngle=Qf(i.minAzimuthAngle),this.maxAzimuthAngle=Qf(i.maxAzimuthAngle),this.smoothTime=i.smoothTime,this.draggingSmoothTime=i.draggingSmoothTime,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this.verticalDragToForward=i.verticalDragToForward,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],t),es.setFromVector3(St.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(es.theta,es.phi,t),this.dollyTo(es.radius,t),this.zoomTo(i.zoom,t),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",dV),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,i){const r=t.lengthSq();if(r===0)return e;const s=Ht.copy(t).add(e),a=this._boundary.clampPoint(s,Lu).sub(s),l=a.lengthSq();if(l===0)return e.add(t);if(l===r)return e;if(i===0)return e.add(t).add(a);{const c=1+i*l/t.dot(a);return e.add(Ht.copy(t).multiplyScalar(c)).add(a.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(kl(this._camera)){const e=this._camera,t=e.near,i=e.getEffectiveFOV()*Yf,r=Math.tan(i*.5)*t,s=r*e.aspect;this._nearPlaneCorners[0].set(-s,-r,0),this._nearPlaneCorners[1].set(s,-r,0),this._nearPlaneCorners[2].set(s,r,0),this._nearPlaneCorners[3].set(-s,r,0)}else if(Ca(this._camera)){const e=this._camera,t=1/e.zoom,i=e.left*t,r=e.right*t,s=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(i,s,0),this._nearPlaneCorners[1].set(r,s,0),this._nearPlaneCorners[2].set(r,o,0),this._nearPlaneCorners[3].set(i,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Z1(this._camera,"_collisionTest"))return e;const i=this._getTargetDirection(Zf);nA.lookAt(CR,i,this._camera.up);for(let r=0;r<4;r++){const s=Ht.copy(this._nearPlaneCorners[r]);s.applyMatrix4(nA);const o=Lu.addVectors(this._target,s);fg.set(o,i),fg.far=this._spherical.radius+1;const a=fg.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance<e&&(e=a[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const i=()=>{this.removeEventListener("rest",i),t()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new ft.Sphere){const i=t,r=i.center;Du.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Du.expandByObject(o)}),Du.getCenter(r);let s=0;return e.traverseVisible(o=>{if(!o.isMesh)return;const a=o,l=a.geometry.clone();l.applyMatrix4(a.matrixWorld);const u=l.attributes.position;for(let d=0,p=u.count;d<p;d++)St.fromBufferAttribute(u,d),s=Math.max(s,r.distanceToSquared(St))}),i.radius=Math.sqrt(s),i}};const mV=H.forwardRef((n,e)=>{H.useMemo(()=>{const w={Box3:Yt,MathUtils:{clamp:pi.clamp}
3994,Matrix4:Ke,Quaternion:Si,Raycaster:ow,Sphere:Nn,Spherical:NL,Vector2:ce,Vector3:z,Vector4:Wt};iA.install({THREE:w}),lx({CameraControlsImpl:iA})},[]);const{camera:t,domElement:i,makeDefault:r,onStart:s,onEnd:o,onChange:a,regress:l,...c}=n,u=Tr(w=>w.camera),d=Tr(w=>w.gl),p=Tr(w=>w.invalidate),m=Tr(w=>w.events),y=Tr(w=>w.setEvents),_=Tr(w=>w.set),x=Tr(w=>w.get),g=Tr(w=>w.performance),v=t||u,S=i||m.connected||d.domElement,M=H.useMemo(()=>new iA(v),[v]);return pl((w,T)=>{M.enabled&&M.update(T)},-1),H.useEffect(()=>(M.connect(S),()=>void M.disconnect()),[S,M]),H.useEffect(()=>{const w=B=>{p(),l&&g.regress(),a&&a(B)},T=B=>{s&&s(B)},R=B=>{o&&o(B)};return M.addEventListener("update",w),M.addEventListener("controlstart",T),M.addEventListener("controlend",R),M.addEventListener("control",w),M.addEventListener("transitionstart",w),M.addEventListener("wake",w),()=>{M.removeEventListener("update",w),M.removeEventListener("controlstart",T),M.removeEventListener("controlend",R),M.removeEventListener("control",w),M.removeEventListener("transitionstart",w),M.removeEventListener("wake",w)}},[M,s,o,p,y,l,a]),H.useEffect(()=>{if(r){const w=x().controls;return _({controls:M}),()=>_({controls:w})}},[r,M]),H.createElement("primitive",Ec({ref:e,object:M},c))}),xD=0,gV=1,vD=2,IR=2,rA=1.25,LR=1,Dd=6*4+4+4,cx=65535,yV=Math.pow(2,-24),sA=Symbol("SKIP_GENERATION");function _V(n){return n.index?n.index.count:n.attributes.position.count}function ef(n){return _V(n)/3}function xV(n,e=ArrayBuffer){return n>65535?new Uint32Array(new e(4*n)):new Uint16Array(new e(2*n))}function vV(n,e){if(!n.index){const t=n.attributes.position.count,i=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,r=xV(t,i);n.setIndex(new Lt(r,1));for(let s=0;s<t;s++)r[s]=s}}function AD(n){const e=ef(n),t=n.drawRange,i=t.start/3,r=(t.start+t.count)/3,s=Math.max(0,i),o=Math.min(e,r)-s;return[{offset:Math.floor(s),count:Math.floor(o)}]}function SD(n){if(!n.groups||!n.groups.length)return AD(n);const e=[],t=new Set,i=n.drawRange,r=i.start/3,s=(i.start+i.count)/3;for(const a of n.groups){const l=a.start/3,c=(a.start+a.count)/3;t.add(Math.max(r,l)),t.add(Math.min(s,c))}const o=Array.from(t.values()).sort((a,l)=>a-l);for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1];e.push({offset:Math.floor(l),count:Math.floor(c-l)})}return e}function AV(n){if(n.groups.length===0)return!1;const e=ef(n),t=SD(n).sort((s,o)=>s.offset-o.offset),i=t[t.length-1];i.count=Math.min(e-i.offset,i.count);let r=0;return t.forEach(({count:s})=>r+=s),e!==r}function oA(n,e,t,i,r){let s=1/0,o=1/0,a=1/0,l=-1/0,c=-1/0,u=-1/0,d=1/0,p=1/0,m=1/0,y=-1/0,_=-1/0,x=-1/0;for(let g=e*6,v=(e+t)*6;g<v;g+=6){const S=n[g+0],M=n[g+1],w=S-M,T=S+M;w<s&&(s=w),T>l&&(l=T),S<d&&(d=S),S>y&&(y=S);const R=n[g+2],B=n[g+3],b=R-B,P=R+B;b<o&&(o=b),P>c&&(c=P),R<p&&(p=R),R>_&&(_=R);const L=n[g+4],U=n[g+5],G=L-U,j=L+U;G<a&&(a=G),j>u&&(u=j),L<m&&(m=L),L>x&&(x=L)}i[0]=s,i[1]=o,i[2]=a,i[3]=l,i[4]=c,i[5]=u,r[0]=d,r[1]=p,r[2]=m,r[3]=y,r[4]=_,r[5]=x}function SV(n,e=null,t=null,i=null){const r=n.attributes.position,s=n.index?n.index.array:null,o=ef(n),a=r.normalized;let l;e===null?(l=new Float32Array(o*6*4),t=0,i=o):(l=e,t=t||0,i=i||o);const c=r.array,u=r.offset||0;let d=3;r.isInterleavedBufferAttribute&&(d=r.data.stride);const p=["getX","getY","getZ"];for(let m=t;m<t+i;m++){const y=m*3,_=m*6;let x=y+0,g=y+1,v=y+2;s&&(x=s[x],g=s[g],v=s[v]),a||(x=x*d+u,g=g*d+u,v=v*d+u);for(let S=0;S<3;S++){let M,w,T;a?(M=r[p[S]](x),w=r[p[S]](g),T=r[p[S]](v)):(M=c[x+S],w=c[g+S],T=c[v+S]);let R=M;w<R&&(R=w),T<R&&(R=T);let B=M;w>B&&(B=w),T>B&&(B=T);const b=(B-R)/2,P=S*2;l[_+P+0]=R+b,l[_+P+1]=b+(Math.abs(R)+b)*yV}}return l}function Pn(n,e,t){return t.min.x=e[n],t.min.y=e[n+1],t.min.z=e[n+2],t.max.x=e[n+3],t.max.y=e[n+4],t.max.z=e[n+5],t}function DR(n){let e=-1,t=-1/0;for(let i=0;i<3;i++){const r=n[i+3]-n[i];r>t&&(t=r,e=i)}return e}function zR(n,e){e.set(n)}function FR(n,e,t){let i,r;for(let s=0;s<3;s++){const o=s+3;i=n[s],r=e[s],t[s]=i<r?i:r,i=n[o],r=e[o],t[o]=i>r?i:r}}function dg(n,e,t){for(let i=0;i<3;i++){const r=e[n+2*i],s=e[n+2*i+1],o=r-s,a=r+s;o<t[i]&&(t[i]=o),a>t[i+3]&&(t[i+3]=a)}}function $f(n){const e=n[3]-n[0],t=n[4]-n[1],i=n[5]-n[2];return 2*(e*t+t*i+i*e)}const Io=32,MV=(n,e)=>n.candidate-e.candidate,Ta=new Array(Io).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),pg=new Float32Array(6);function EV(n,e,t,i,r,s){let o=-1,a=0;if(s===xD)o=DR(e),o!==-1&&(a=(e[o]+e[o+3])/2);else if(s===gV)o=DR(n),o!==-1&&(a=wV(t,i,r,o));else if(s===vD){const l=$f(n);let c=rA*r;const u=i*6,d=(i+r)*6;for(let p=0;p<3;p++){const m=e[p],x=(e[p+3]-m)/Io;if(r<Io/4){const g=[...Ta];g.length=r;let v=0;for(let M=u;M<d;M+=6,v++){const w=g[v];w.candidate=t[M+2*p],w.count=0;const{bounds:T,leftCacheBounds:R,rightCacheBounds:B}=w;for(let b=0;b<3;
3994b++)B[b]=1/0,B[b+3]=-1/0,R[b]=1/0,R[b+3]=-1/0,T[b]=1/0,T[b+3]=-1/0;dg(M,t,T)}g.sort(MV);let S=r;for(let M=0;M<S;M++){const w=g[M];for(;M+1<S&&g[M+1].candidate===w.candidate;)g.splice(M+1,1),S--}for(let M=u;M<d;M+=6){const w=t[M+2*p];for(let T=0;T<S;T++){const R=g[T];w>=R.candidate?dg(M,t,R.rightCacheBounds):(dg(M,t,R.leftCacheBounds),R.count++)}}for(let M=0;M<S;M++){const w=g[M],T=w.count,R=r-w.count,B=w.leftCacheBounds,b=w.rightCacheBounds;let P=0;T!==0&&(P=$f(B)/l);let L=0;R!==0&&(L=$f(b)/l);const U=LR+rA*(P*T+L*R);U<c&&(o=p,c=U,a=w.candidate)}}else{for(let S=0;S<Io;S++){const M=Ta[S];M.count=0,M.candidate=m+x+S*x;const w=M.bounds;for(let T=0;T<3;T++)w[T]=1/0,w[T+3]=-1/0}for(let S=u;S<d;S+=6){let T=~~((t[S+2*p]-m)/x);T>=Io&&(T=Io-1);const R=Ta[T];R.count++,dg(S,t,R.bounds)}const g=Ta[Io-1];zR(g.bounds,g.rightCacheBounds);for(let S=Io-2;S>=0;S--){const M=Ta[S],w=Ta[S+1];FR(M.bounds,w.rightCacheBounds,M.rightCacheBounds)}let v=0;for(let S=0;S<Io-1;S++){const M=Ta[S],w=M.count,T=M.bounds,B=Ta[S+1].rightCacheBounds;w!==0&&(v===0?zR(T,pg):FR(T,pg,pg)),v+=w;let b=0,P=0;v!==0&&(b=$f(pg)/l);const L=r-v;L!==0&&(P=$f(B)/l);const U=LR+rA*(b*v+P*L);U<c&&(o=p,c=U,a=M.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:a}}function wV(n,e,t,i){let r=0;for(let s=e,o=e+t;s<o;s++)r+=n[s*6+i*2];return r/t}class aA{constructor(){this.boundingData=new Float32Array(6)}}function TV(n,e,t,i,r,s){let o=i,a=i+r-1;const l=s.pos,c=s.axis*2;for(;;){for(;o<=a&&t[o*6+c]<l;)o++;for(;o<=a&&t[a*6+c]>=l;)a--;if(o<a){for(let u=0;u<3;u++){let d=e[o*3+u];e[o*3+u]=e[a*3+u],e[a*3+u]=d}for(let u=0;u<6;u++){let d=t[o*6+u];t[o*6+u]=t[a*6+u],t[a*6+u]=d}o++,a--}else return o}}function CV(n,e,t,i,r,s){let o=i,a=i+r-1;const l=s.pos,c=s.axis*2;for(;;){for(;o<=a&&t[o*6+c]<l;)o++;for(;o<=a&&t[a*6+c]>=l;)a--;if(o<a){let u=n[o];n[o]=n[a],n[a]=u;for(let d=0;d<6;d++){let p=t[o*6+d];t[o*6+d]=t[a*6+d],t[a*6+d]=p}o++,a--}else return o}}function or(n,e){return e[n+15]===65535}function Ir(n,e){return e[n+6]}function cs(n,e){return e[n+14]}function us(n){return n+8}function hs(n,e){return e[n+6]}function MD(n,e){return e[n+7]}let ED,dd,jg,wD;const RV=Math.pow(2,32);function JS(n){return"count"in n?1:1+JS(n.left)+JS(n.right)}function bV(n,e,t){return ED=new Float32Array(t),dd=new Uint32Array(t),jg=new Uint16Array(t),wD=new Uint8Array(t),YS(n,e)}function YS(n,e){const t=n/4,i=n/2,r="count"in e,s=e.boundingData;for(let o=0;o<6;o++)ED[t+o]=s[o];if(r)if(e.buffer){const o=e.buffer;wD.set(new Uint8Array(o),n);for(let a=n,l=n+o.byteLength;a<l;a+=Dd){const c=a/2;or(c,jg)||(dd[a/4+6]+=t)}return n+o.byteLength}else{const o=e.offset,a=e.count;return dd[t+6]=o,jg[i+14]=a,jg[i+15]=cx,n+Dd}else{const o=e.left,a=e.right,l=e.splitAxis;let c;if(c=YS(n+Dd,o),c/4>RV)throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return dd[t+6]=c/4,c=YS(c,a),dd[t+7]=l,c}}function PV(n,e){const t=(n.index?n.index.count:n.attributes.position.count)/3,i=t>2**16,r=i?4:2,s=e?new SharedArrayBuffer(t*r):new ArrayBuffer(t*r),o=i?new Uint32Array(s):new Uint16Array(s);for(let a=0,l=o.length;a<l;a++)o[a]=a;return o}function BV(n,e,t,i,r){const{maxDepth:s,verbose:o,maxLeafTris:a,strategy:l,onProgress:c,indirect:u}=r,d=n._indirectBuffer,p=n.geometry,m=p.index?p.index.array:null,y=u?CV:TV,_=ef(p),x=new Float32Array(6);let g=!1;const v=new aA;return oA(e,t,i,v.boundingData,x),M(v,t,i,x),v;function S(w){c&&c(w/_)}function M(w,T,R,B=null,b=0){if(!g&&b>=s&&(g=!0,o&&(console.warn(`MeshBVH: Max depth of ${s} reached when generating BVH. Consider increasing maxDepth.`),console.warn(p))),R<=a||b>=s)return S(T+R),w.offset=T,w.count=R,w;const P=EV(w.boundingData,B,e,T,R,l);if(P.axis===-1)return S(T+R),w.offset=T,w.count=R,w;const L=y(d,m,e,T,R,P);if(L===T||L===T+R)S(T+R),w.offset=T,w.count=R;else{w.splitAxis=P.axis;const U=new aA,G=T,j=L-T;w.left=U,oA(e,G,j,U.boundingData,x),M(U,G,j,x,b+1);const X=new aA,J=L,te=R-j;w.right=X,oA(e,J,te,X.boundingData,x),M(X,J,te,x,b+1)}return w}}function IV(n,e){const t=n.geometry;e.indirect&&(n._indirectBuffer=PV(t,e.useSharedArrayBuffer),AV(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),n._indirectBuffer||vV(t,e);const i=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,r=SV(t),s=e.indirect?AD(t):SD(t);n._roots=s.map(o=>{const a=BV(n,r,o.offset,o.count,e),l=JS(a),c=new i(Dd*l);return bV(0,a,c),c})}class $o{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let i=1/0,r=-1/0;for(let s=0,o=e.length;s<o;s++){const l=e[s][t];i=l<i?l:i,r=l>r?l:r}this.min=i,this.max=r}setFromPoints(e,t){let i=1/0,r=-1/0;for(let s=0,o=t.length;s<o;
3994s++){const a=t[s],l=e.dot(a);i=l<i?l:i,r=l>r?l:r}this.min=i,this.max=r}isSeparated(e){return this.min>e.max||e.min>this.max}}$o.prototype.setFromBox=function(){const n=new z;return function(t,i){const r=i.min,s=i.max;let o=1/0,a=-1/0;for(let l=0;l<=1;l++)for(let c=0;c<=1;c++)for(let u=0;u<=1;u++){n.x=r.x*l+s.x*(1-l),n.y=r.y*c+s.y*(1-c),n.z=r.z*u+s.z*(1-u);const d=t.dot(n);o=Math.min(d,o),a=Math.max(d,a)}this.min=o,this.max=a}}();const LV=function(){const n=new z,e=new z,t=new z;return function(r,s,o){const a=r.start,l=n,c=s.start,u=e;t.subVectors(a,c),n.subVectors(r.end,r.start),e.subVectors(s.end,s.start);const d=t.dot(u),p=u.dot(l),m=u.dot(u),y=t.dot(l),x=l.dot(l)*m-p*p;let g,v;x!==0?g=(d*p-y*m)/x:g=0,v=(d+g*p)/m,o.x=g,o.y=v}}(),fw=function(){const n=new ce,e=new z,t=new z;return function(r,s,o,a){LV(r,s,n);let l=n.x,c=n.y;if(l>=0&&l<=1&&c>=0&&c<=1){r.at(l,o),s.at(c,a);return}else if(l>=0&&l<=1){c<0?s.at(0,a):s.at(1,a),r.closestPointToPoint(a,!0,o);return}else if(c>=0&&c<=1){l<0?r.at(0,o):r.at(1,o),s.closestPointToPoint(o,!0,a);return}else{let u;l<0?u=r.start:u=r.end;let d;c<0?d=s.start:d=s.end;const p=e,m=t;if(r.closestPointToPoint(d,!0,e),s.closestPointToPoint(u,!0,t),p.distanceToSquared(d)<=m.distanceToSquared(u)){o.copy(p),a.copy(d);return}else{o.copy(u),a.copy(m);return}}}}(),DV=function(){const n=new z,e=new z,t=new io,i=new go;return function(s,o){const{radius:a,center:l}=s,{a:c,b:u,c:d}=o;if(i.start=c,i.end=u,i.closestPointToPoint(l,!0,n).distanceTo(l)<=a||(i.start=c,i.end=d,i.closestPointToPoint(l,!0,n).distanceTo(l)<=a)||(i.start=u,i.end=d,i.closestPointToPoint(l,!0,n).distanceTo(l)<=a))return!0;const _=o.getPlane(t);if(Math.abs(_.distanceToPoint(l))<=a){const g=_.projectPoint(l,e);if(o.containsPoint(g))return!0}return!1}}(),zV=1e-15;function lA(n){return Math.abs(n)<zV}class ks extends hi{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new z),this.satBounds=new Array(4).fill().map(()=>new $o),this.points=[this.a,this.b,this.c],this.sphere=new Nn,this.plane=new io,this.needsUpdate=!0}intersectsSphere(e){return DV(e,this)}update(){const e=this.a,t=this.b,i=this.c,r=this.points,s=this.satAxes,o=this.satBounds,a=s[0],l=o[0];this.getNormal(a),l.setFromPoints(a,r);const c=s[1],u=o[1];c.subVectors(e,t),u.setFromPoints(c,r);const d=s[2],p=o[2];d.subVectors(t,i),p.setFromPoints(d,r);const m=s[3],y=o[3];m.subVectors(i,e),y.setFromPoints(m,r),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}}ks.prototype.closestPointToSegment=function(){const n=new z,e=new z,t=new go;return function(r,s=null,o=null){const{start:a,end:l}=r,c=this.points;let u,d=1/0;for(let p=0;p<3;p++){const m=(p+1)%3;t.start.copy(c[p]),t.end.copy(c[m]),fw(t,r,n,e),u=n.distanceToSquared(e),u<d&&(d=u,s&&s.copy(n),o&&o.copy(e))}return this.closestPointToPoint(a,n),u=a.distanceToSquared(n),u<d&&(d=u,s&&s.copy(n),o&&o.copy(a)),this.closestPointToPoint(l,n),u=l.distanceToSquared(n),u<d&&(d=u,s&&s.copy(n),o&&o.copy(l)),Math.sqrt(d)}}();ks.prototype.intersectsTriangle=function(){const n=new ks,e=new Array(3),t=new Array(3),i=new $o,r=new $o,s=new z,o=new z,a=new z,l=new z,c=new z,u=new go,d=new go,p=new go,m=new z;function y(_,x,g){const v=_.points;let S=0,M=-1;for(let w=0;w<3;w++){const{start:T,end:R}=u;T.copy(v[w]),R.copy(v[(w+1)%3]),u.delta(o);const B=lA(x.distanceToPoint(T));if(lA(x.normal.dot(o))&&B){g.copy(u),S=2;break}const b=x.intersectLine(u,m);if(!b&&B&&m.copy(T),(b||B)&&!lA(m.distanceTo(R))){if(S<=1)(S===1?g.start:g.end).copy(m),B&&(M=S);else if(S>=2){(M===1?g.start:g.end).copy(m),S=2;break}if(S++,S===2&&M===-1)break}}return S}return function(x,g=null,v=!1){this.needsUpdate&&this.update(),x.isExtendedTriangle?x.needsUpdate&&x.update():(n.copy(x),n.update(),x=n);const S=this.plane,M=x.plane;if(Math.abs(S.normal.dot(M.normal))>1-1e-10){const w=this.satBounds,T=this.satAxes;t[0]=x.a,t[1]=x.b,t[2]=x.c;for(let b=0;b<4;b++){const P=w[b],L=T[b];if(i.setFromPoints(L,t),P.isSeparated(i))return!1}const R=x.satBounds,B=x.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let b=0;b<4;b++){const P=R[b],L=B[b];if(i.setFromPoints(L,e),P.isSeparated(i))return!1}for(let b=0;b<4;b++){const P=T[b];for(let L=0;L<4;L++){const U=B[L];if(s.crossVectors(P,U),i.setFromPoints(s,e),r.setFromPoints(s,t),i.isSeparated(r))return!1}}return g&&(v||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),g.start.set(0,0,0),g.end.set(0,0,0)),!0}else{const w=y(this,M,d);if(w===1&&x.containsPoint(d.end))return g&&(g.start.copy(d.end),g.end.copy(d.end)),!0;if(w!==2)return!1;const T=y(x,S,p);if(T===1&&this.containsPoint(p.end))return g&&(g.start.copy(p.end),g.end.copy(p.end)),!0;if(T!==2)return!1;if(d.delta(a),p.delta(l),a.dot(l)<0){let G=p.start;p.start=p.end,p.end=G}
vendor: 23,246 bytes, line 3994
3994const R=d.start.dot(a),B=d.end.dot(a),b=p.start.dot(a),P=p.end.dot(a),L=B<b,U=R<P;return R!==P&&b!==B&&L===U?!1:(g&&(c.subVectors(d.start,p.start),c.dot(a)>0?g.start.copy(d.start):g.start.copy(p.start),c.subVectors(d.end,p.end),c.dot(a)<0?g.end.copy(d.end):g.end.copy(p.end)),!0)}}}();ks.prototype.distanceToPoint=function(){const n=new z;return function(t){return this.closestPointToPoint(t,n),t.distanceTo(n)}}();ks.prototype.distanceToTriangle=function(){const n=new z,e=new z,t=["a","b","c"],i=new go,r=new go;return function(o,a=null,l=null){const c=a||l?i:null;if(this.intersectsTriangle(o,c))return(a||l)&&(a&&c.getCenter(a),l&&c.getCenter(l)),0;let u=1/0;for(let d=0;d<3;d++){let p;const m=t[d],y=o[m];this.closestPointToPoint(y,n),p=y.distanceToSquared(n),p<u&&(u=p,a&&a.copy(n),l&&l.copy(y));const _=this[m];o.closestPointToPoint(_,n),p=_.distanceToSquared(n),p<u&&(u=p,a&&a.copy(_),l&&l.copy(n))}for(let d=0;d<3;d++){const p=t[d],m=t[(d+1)%3];i.set(this[p],this[m]);for(let y=0;y<3;y++){const _=t[y],x=t[(y+1)%3];r.set(o[_],o[x]),fw(i,r,n,e);const g=n.distanceToSquared(e);g<u&&(u=g,a&&a.copy(n),l&&l.copy(e))}}return Math.sqrt(u)}}();class qi{constructor(e,t,i){this.isOrientedBox=!0,this.min=new z,this.max=new z,this.matrix=new Ke,this.invMatrix=new Ke,this.points=new Array(8).fill().map(()=>new z),this.satAxes=new Array(3).fill().map(()=>new z),this.satBounds=new Array(3).fill().map(()=>new $o),this.alignedSatBounds=new Array(3).fill().map(()=>new $o),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),i&&this.matrix.copy(i)}set(e,t,i){this.min.copy(e),this.max.copy(t),this.matrix.copy(i),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}qi.prototype.update=function(){return function(){const e=this.matrix,t=this.min,i=this.max,r=this.points;for(let c=0;c<=1;c++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const p=1*c|2*u|4*d,m=r[p];m.x=c?i.x:t.x,m.y=u?i.y:t.y,m.z=d?i.z:t.z,m.applyMatrix4(e)}const s=this.satBounds,o=this.satAxes,a=r[0];for(let c=0;c<3;c++){const u=o[c],d=s[c],p=1<<c,m=r[p];u.subVectors(a,m),d.setFromPoints(u,r)}const l=this.alignedSatBounds;l[0].setFromPointsField(r,"x"),l[1].setFromPointsField(r,"y"),l[2].setFromPointsField(r,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}();qi.prototype.intersectsBox=function(){const n=new $o;return function(t){this.needsUpdate&&this.update();const i=t.min,r=t.max,s=this.satBounds,o=this.satAxes,a=this.alignedSatBounds;if(n.min=i.x,n.max=r.x,a[0].isSeparated(n)||(n.min=i.y,n.max=r.y,a[1].isSeparated(n))||(n.min=i.z,n.max=r.z,a[2].isSeparated(n)))return!1;for(let l=0;l<3;l++){const c=o[l],u=s[l];if(n.setFromBox(c,t),u.isSeparated(n))return!1}return!0}}();qi.prototype.intersectsTriangle=function(){const n=new ks,e=new Array(3),t=new $o,i=new $o,r=new z;return function(o){this.needsUpdate&&this.update(),o.isExtendedTriangle?o.needsUpdate&&o.update():(n.copy(o),n.update(),o=n);const a=this.satBounds,l=this.satAxes;e[0]=o.a,e[1]=o.b,e[2]=o.c;for(let p=0;p<3;p++){const m=a[p],y=l[p];if(t.setFromPoints(y,e),m.isSeparated(t))return!1}const c=o.satBounds,u=o.satAxes,d=this.points;for(let p=0;p<3;p++){const m=c[p],y=u[p];if(t.setFromPoints(y,d),m.isSeparated(t))return!1}for(let p=0;p<3;p++){const m=l[p];for(let y=0;y<4;y++){const _=u[y];if(r.crossVectors(m,_),t.setFromPoints(r,e),i.setFromPoints(r,d),t.isSeparated(i))return!1}}return!0}}();qi.prototype.closestPointToPoint=function(){return function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t}}();qi.prototype.distanceToPoint=function(){const n=new z;return function(t){return this.closestPointToPoint(t,n),t.distanceTo(n)}}();qi.prototype.distanceToBox=function(){const n=["x","y","z"],e=new Array(12).fill().map(()=>new go),t=new Array(12).fill().map(()=>new go),i=new z,r=new z;return function(o,a=0,l=null,c=null){if(this.needsUpdate&&this.update(),this.intersectsBox(o))return(l||c)&&(o.getCenter(r),this.closestPointToPoint(r,i),o.closestPointToPoint(i,r),l&&l.copy(i),c&&c.copy(r)),0;const u=a*a,d=o.min,p=o.max,m=this.points;let y=1/0;for(let x=0;x<8;x++){const g=m[x];r.copy(g).clamp(d,p);const v=g.distanceToSquared(r);if(v<y&&(y=v,l&&l.copy(g),c&&c.copy(r),v<u))return Math.sqrt(v)}let _=0;for(let x=0;x<3;x++)for(let g=0;g<=1;g++)for(let v=0;v<=1;v++){const S=(x+1)%3,M=(x+2)%3,w=g<<S|v<<M,T=1<<x|g<<S|v<<M,R=m[w],B=m[T];e[_].set(R,B);const P=n[x],L=n[S],U=n[M],G=t[_],j=G.start,X=G.end;j[P]=d[P],j[L]=g?d[L]:p[L],j[U]=v?d[U]:p[L],X[P]=p[P],X[L]=g?d[L]:p[L],X[U]=v?d[U]:p[L],_++}for(let x=0;x<=1;x++)for(let g=0;g<=1;g++)for(let v=0;v<=1;v++){r.x=x?p.x:d.x,r.y=g?p.y:d.y,r.z=v?p.z:d.z,this.closestPointToPoint(r,i);const S=r.distanceToSquared(i);if(S<y&&(y=S,l&&l.copy(i),c&&c.copy(r),S<u))return Math.sqrt(S)}for(let x=0;x<12;x++){const g=e[x];for(let v=0;v<12;v++){const S=t[v];fw(g,S,i,r);const M=i.distanceToSquared(r);if(M<y&&(y=M,l&&l.copy(i),c&&c.copy(r),M<u))return Math.sqrt(M)}}return Math.sqrt(y)}}();class dw{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class FV extends dw{constructor(){super(()=>new ks)}}const fs=new FV;class OV{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=i=>{t&&e.push(t),t=i,this.float32Array=new Float32Array(i),this.uint16Array=new Uint16Array(i),this.uint32Array=new Uint32Array(i)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const fn=new OV;let Fa,hh;const zu=[],mg=new dw(()=>new Yt);function UV(n,e,t,i,r,s){Fa=mg.getPrimitive(),hh=mg.getPrimitive(),zu.push(Fa,hh),fn.setBuffer(n._roots[e]);const o=KS(0,n.geometry,t,i,r,s);fn.clearBuffer(),mg.releasePrimitive(Fa),mg.releasePrimitive(hh),zu.pop(),zu.pop();const a=zu.length;return a>0&&(hh=zu[a-1],Fa=zu[a-2]),o}function KS(n,e,t,i,r=null,s=0,o=0){const{float32Array:a,uint16Array:l,uint32Array:c}=fn;let u=n*2;if(or(u,l)){const p=Ir(n,c),m=cs(u,l);return Pn(n,a,Fa),i(p,m,!1,o,s+n,Fa)}else{let p=function(U){const{uint16Array:G,uint32Array:j}=fn;let X=U*2;for(;!or(X,G);)U=us(U),X=U*2;return Ir(U,j)},m=function(U){const{uint16Array:G,uint32Array:j}=fn;let X=U*2;for(;!or(X,G);)U=hs(U,j),X=U*2;return Ir(U,j)+cs(X,G)};const y=us(n),_=hs(n,c);let x=y,g=_,v,S,M,w;if(r&&(M=Fa,w=hh,Pn(x,a,M),Pn(g,a,w),v=r(M),S=r(w),S<v)){x=_,g=y;const U=v;v=S,S=U,M=w}M||(M=Fa,Pn(x,a,M));const T=or(x*2,l),R=t(M,T,v,o+1,s+x);let B;if(R===IR){const U=p(x),j=m(x)-U;B=i(U,j,!0,o+1,s+x,M)}else B=R&&KS(x,e,t,i,r,s,o+1);if(B)return!0;w=hh,Pn(g,a,w);const b=or(g*2,l),P=t(w,b,S,o+1,s+g);let L;if(P===IR){const U=p(g),j=m(g)-U;L=i(U,j,!0,o+1,s+g,w)}else L=P&&KS(g,e,t,i,r,s,o+1);return!!L}}const ed=new z,cA=new z;function NV(n,e,t={},i=0,r=1/0){const s=i*i,o=r*r;let a=1/0,l=null;if(n.shapecast({boundsTraverseOrder:u=>(ed.copy(e).clamp(u.min,u.max),ed.distanceToSquared(e)),intersectsBounds:(u,d,p)=>p<a&&p<o,intersectsTriangle:(u,d)=>{u.closestPointToPoint(e,ed);const p=e.distanceToSquared(ed);return p<a&&(cA.copy(ed),a=p,l=d),p<s}}),a===1/0)return null;const c=Math.sqrt(a);return t.point?t.point.copy(cA):t.point=cA.clone(),t.distance=c,t.faceIndex=l,t}const Fu=new z,Ou=new z,Uu=new z,gg=new ce,yg=new ce,_g=new ce,OR=new z,UR=new z,NR=new z,xg=new z;function kV(n,e,t,i,r,s,o,a){let l;if(s===zi?l=n.intersectTriangle(i,t,e,!0,r):l=n.intersectTriangle(e,t,i,s!==Rr,r),l===null)return null;const c=n.origin.distanceTo(r);return c<o||c>a?null:{distance:c,point:r.clone()}}function HV(n,e,t,i,r,s,o,a,l,c,u){Fu.fromBufferAttribute(e,s),Ou.fromBufferAttribute(e,o),Uu.fromBufferAttribute(e,a);const d=kV(n,Fu,Ou,Uu,xg,l,c,u);if(d){i&&(gg.fromBufferAttribute(i,s),yg.fromBufferAttribute(i,o),_g.fromBufferAttribute(i,a),d.uv=hi.getInterpolation(xg,Fu,Ou,Uu,gg,yg,_g,new ce)),r&&(gg.fromBufferAttribute(r,s),yg.fromBufferAttribute(r,o),_g.fromBufferAttribute(r,a),d.uv1=hi.getInterpolation(xg,Fu,Ou,Uu,gg,yg,_g,new ce)),t&&(OR.fromBufferAttribute(t,s),UR.fromBufferAttribute(t,o),NR.fromBufferAttribute(t,a),d.normal=hi.getInterpolation(xg,Fu,Ou,Uu,OR,UR,NR,new z),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const p={a:s,b:o,c:a,normal:new z,materialIndex:0};hi.getNormal(Fu,Ou,Uu,p.normal),d.face=p,d.faceIndex=s}return d}function ux(n,e,t,i,r,s,o){const a=i*3;let l=a+0,c=a+1,u=a+2;const d=n.index;n.index&&(l=d.getX(l),c=d.getX(c),u=d.getX(u));const{position:p,normal:m,uv:y,uv1:_}=n.attributes,x=HV(t,p,m,y,_,l,c,u,e,s,o);return x?(x.faceIndex=i,r&&r.push(x),x):null}function Xn(n,e,t,i){const r=n.a,s=n.b,o=n.c;let a=e,l=e+1,c=e+2;t&&(a=t.getX(a),l=t.getX(l),c=t.getX(c)),r.x=i.getX(a),r.y=i.getY(a),r.z=i.getZ(a),s.x=i.getX(l),s.y=i.getY(l),s.z=i.getZ(l),o.x=i.getX(c),o.y=i.getY(c),o.z=i.getZ(c)}function GV(n,e,t,i,r,s,o,a){const{geometry:l,_indirectBuffer:c}=n;for(let u=i,d=i+r;u<d;u++)ux(l,e,t,u,s,o,a)}function VV(n,e,t,i,r,s,o){const{geometry:a,_indirectBuffer:l}=n;let c=1/0,u=null;for(let d=i,p=i+r;d<p;d++){let m;m=ux(a,e,t,d,null,s,o),m&&m.distance<c&&(u=m,c=m.distance)}return u}function WV(n,e,t,i,r,s,o){const{geometry:a}=t,{index:l}=a,c=a.attributes.position;for(let u=n,d=e+n;u<d;u++){let p;if(p=u,Xn(o,p*3,l,c),o.needsUpdate=!0,i(o,p,r,s))return!0}return!1}function jV(n,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=n.geometry,i=t.index?t.index.array:null,r=t.attributes.position;let s,o,a,l,c=0;const u=n._roots;for(let p=0,m=u.length;p<m;p++)s=u[p],o=new Uint32Array(s),a=new Uint16Array(s),l=new Float32Array(s),d(0,c),c+=s.byteLength;function d(p,m,y=!1){const _=p*2;if(a[_+15]===cx){const g=o[p+6],v=a[_+14];let S=1/0,M=1/0,w=1/0,T=-1/0,R=-1/0,B=-1/0;for(let b=3*g,P=3*(g+v);b<P;b++){let L=i[b];const U=r.getX(L),G=r.getY(L),j=r.getZ(L);U<S&&(S=U),U>T&&(T=U),G<M&&(M=G),G>R&&(R=G),j<w&&(w=j),j>B&&(B=j)}return l[p+0]!==S||l[p+1]!==M||l[p+2]!==w||l[p+3]!==T||l[p+4]!==R||l[p+5]!==B?(l[p+0]=S,l[p+1]=M,l[p+2]=w,l[p+3]=T,l[p+4]=R,l[p+5]=B,!0):!1}else{const g=p+8,v=o[p+6],S=g+m,M=v+m;let w=y,T=!1,R=!1;e?w||(T=e.has(S),R=e.has(M),w=!T&&!R):(T=!0,R=!0);const B=w||T,b=w||R;let P=!1;B&&(P=d(g,m,w));let L=!1;b&&(L=d(v,m,w));const U=P||L;if(U)for(let G=0;G<3;G++){const j=g+G,X=v+G,J=l[j],te=l[j+3],k=l[X],Q=l[X+3];l[p+G]=J<k?J:k,l[p+G+3]=te>Q?te:Q}return U}}}function rl(n,e,t,i,r){let s,o,a,l,c,u;const d=1/t.direction.x,p=1/t.direction.y,m=1/t.direction.z,y=t.origin.x,_=t.origin.y,x=t.origin.z;let g=e[n],v=e[n+3],S=e[n+1],M=e[n+3+1],w=e[n+2],T=e[n+3+2];return d>=0?(s=(g-y)*d,o=(v-y)*d):(s=(v-y)*d,o=(g-y)*d),p>=0?(a=(S-_)*p,l=(M-_)*p):(a=(M-_)*p,l=(S-_)*p),s>l||a>o||((a>s||isNaN(s))&&(s=a),(l<o||isNaN(o))&&(o=l),m>=0?(c=(w-x)*m,u=(T-x)*m):(c=(T-x)*m,u=(w-x)*m),s>u||c>o)?!1:((c>s||s!==s)&&(s=c),(u<o||o!==o)&&(o=u),s<=r&&o>=i)}function XV(n,e,t,i,r,s,o,a){const{geometry:l,_indirectBuffer:c}=n;for(let u=i,d=i+r;u<d;u++){let p=c?c[u]:u;ux(l,e,t,p,s,o,a)}}function JV(n,e,t,i,r,s,o){const{geometry:a,_indirectBuffer:l}=n;let c=1/0,u=null;for(let d=i,p=i+r;d<p;d++){let m;m=ux(a,e,t,l?l[d]:d,null,s,o),m&&m.distance<c&&(u=m,c=m.distance)}return u}function YV(n,e,t,i,r,s,o){const{geometry:a}=t,{index:l}=a,c=a.attributes.position;for(let u=n,d=e+n;u<d;u++){let p;if(p=t.resolveTriangleIndex(u),Xn(o,p*3,l,c),o.needsUpdate=!0,i(o,p,r,s))return!0}return!1}function KV(n,e,t,i,r,s,o){fn.setBuffer(n._roots[e]),QS(0,n,t,i,r,s,o),fn.clearBuffer()}function QS(n,e,t,i,r,s,o){const{float32Array:a,uint16Array:l,uint32Array:c}=fn,u=n*2;if(or(u,l)){const p=Ir(n,c),m=cs(u,l);GV(e,t,i,p,m,r,s,o)}else{const p=us(n);rl(p,a,i,s,o)&&QS(p,e,t,i,r,s,o);const m=hs(n,c);rl(m,a,i,s,o)&&QS(m,e,t,i,r,s,o)}}const QV=["x","y","z"];function ZV(n,e,t,i,r,s){fn.setBuffer(n._roots[e]);const o=ZS(0,n,t,i,r,s);return fn.clearBuffer(),o}function ZS(n,e,t,i,r,s){const{float32Array:o,uint16Array:a,uint32Array:l}=fn;let c=n*2;if(or(c,a)){const d=Ir(n,l),p=cs(c,a);return VV(e,t,i,d,p,r,s)}else{const d=MD(n,l),p=QV[d],y=i.direction[p]>=0;let _,x;y?(_=us(n),x=hs(n,l)):(_=hs(n,l),x=us(n));const v=rl(_,o,i,r,s)?ZS(_,e,t,i,r,s):null;if(v){const w=v.point[p];if(y?w<=o[x+d]:w>=o[x+d+3])return v}const M=rl(x,o,i,r,s)?ZS(x,e,t,i,r,s):null;return v&&M?v.distance<=M.distance?v:M:v||M||null}}const vg=new Yt,Nu=new ks,ku=new ks,td=new Ke,kR=new qi,Ag=new qi;function qV(n,e,t,i){fn.setBuffer(n._roots[e]);const r=qS(0,n,t,i);return fn.clearBuffer(),r}function qS(n,e,t,i,r=null){const{float32Array:s,uint16Array:o,uint32Array:a}=fn;let l=n*2;if(r===null&&(t.boundingBox||t.computeBoundingBox(),kR.set(t.boundingBox.min,t.boundingBox.max,i),r=kR),or(l,o)){const u=e.geometry,d=u.index,p=u.attributes.position,m=t.index,y=t.attributes.position,_=Ir(n,a),x=cs(l,o);if(td.copy(i).invert(),t.boundsTree)return Pn(n,s,Ag),Ag.matrix.copy(td),Ag.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:v=>Ag.intersectsBox(v),intersectsTriangle:v=>{v.a.applyMatrix4(i),v.b.applyMatrix4(i),v.c.applyMatrix4(i),v.needsUpdate=!0;for(let S=_*3,M=(x+_)*3;S<M;S+=3)if(Xn(ku,S,d,p),ku.needsUpdate=!0,v.intersectsTriangle(ku))return!0;return!1}});for(let g=_*3,v=(x+_)*3;g<v;g+=3){Xn(Nu,g,d,p),Nu.a.applyMatrix4(td),Nu.b.applyMatrix4(td),Nu.c.applyMatrix4(td),Nu.needsUpdate=!0;for(let S=0,M=m.count;S<M;S+=3)if(Xn(ku,S,m,y),ku.needsUpdate=!0,Nu.intersectsTriangle(ku))return!0}}else{const u=n+8,d=a[n+6];return Pn(u,s,vg),!!(r.intersectsBox(vg)&&qS(u,e,t,i,r)||(Pn(d,s,vg),r.intersectsBox(vg)&&qS(d,e,t,i,r)))}}const Sg=new Ke,uA=new qi,nd=new qi,$V=new z,eW=new z,tW=new z,nW=new z;function iW(n,e,t,i={},r={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),uA.set(e.boundingBox.min,e.boundingBox.max,t),uA.needsUpdate=!0;const a=n.geometry,l=a.attributes.position,c=a.index,u=e.attributes.position,d=e.index,p=fs.getPrimitive(),m=fs.getPrimitive();let y=$V,_=eW,x=null,g=null;r&&(x=tW,g=nW);let v=1/0,S=null,M=null;return Sg.copy(t).invert(),nd.matrix.copy(Sg),n.shapecast({boundsTraverseOrder:w=>uA.distanceToBox(w),intersectsBounds:(w,T,R)=>R<v&&R<o?(T&&(nd.min.copy(w.min),nd.max.copy(w.max),nd.needsUpdate=!0),!0):!1,intersectsRange:(w,T)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:B=>nd.distanceToBox(B),intersectsBounds:(B,b,P)=>P<v&&P<o,intersectsRange:(B,b)=>{for(let P=B,L=B+b;P<L;P++){Xn(m,3*P,d,u),m.a.applyMatrix4(t),m.b.applyMatrix4(t),m.c.applyMatrix4(t),m.needsUpdate=!0;for(let U=w,G=w+T;U<G;U++){Xn(p,3*U,c,l),p.needsUpdate=!0;const j=p.distanceToTriangle(m,y,x);if(j<v&&(_.copy(y),g&&g.copy(x),v=j,S=U,M=P),j<s)return!0}}}});{const R=ef(e);for(let B=0,b=R;B<b;B++){Xn(m,3*B,d,u),m.a.applyMatrix4(t),m.b.applyMatrix4(t),m.c.applyMatrix4(t),m.needsUpdate=!0;for(let P=w,L=w+T;P<L;P++){Xn(p,3*P,c,l),p.needsUpdate=!0;const U=p.distanceToTriangle(m,y,x);if(U<v&&(_.copy(y),g&&g.copy(x),v=U,S=P,M=B),U<s)return!0}}}}}),fs.releasePrimitive(p),fs.releasePrimitive(m),v===1/0?null:(i.point?i.point.copy(_):i.point=_.clone(),i.distance=v,i.faceIndex=S,r&&(r.point?r.point.copy(g):r.point=g.clone(),r.point.applyMatrix4(Sg),_.applyMatrix4(Sg),r.distance=_.sub(r.point).length(),r.faceIndex=M),i)}function rW(n,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=n.geometry,i=t.index?t.index.array:null,r=t.attributes.position;let s,o,a,l,c=0;const u=n._roots;for(let p=0,m=u.length;p<m;p++)s=u[p],o=new Uint32Array(s),a=new Uint16Array(s),l=new Float32Array(s),d(0,c),c+=s.byteLength;function d(p,m,y=!1){const _=p*2;if(a[_+15]===cx){const g=o[p+6],v=a[_+14];let S=1/0,M=1/0,w=1/0,T=-1/0,R=-1/0,B=-1/0;for(let b=g,P=g+v;b<P;b++){const L=3*n.resolveTriangleIndex(b);for(let U=0;U<3;U++){let G=L+U;G=i?i[G]:G;const j=r.getX(G),X=r.getY(G),J=r.getZ(G);j<S&&(S=j),j>T&&(T=j),X<M&&(M=X),X>R&&(R=X),J<w&&(w=J),J>B&&(B=J)}}return l[p+0]!==S||l[p+1]!==M||l[p+2]!==w||l[p+3]!==T||l[p+4]!==R||l[p+5]!==B?(l[p+0]=S,l[p+1]=M,l[p+2]=w,l[p+3]=T,l[p+4]=R,l[p+5]=B,!0):!1}else{const g=p+8,v=o[p+6],S=g+m,M=v+m;let w=y,T=!1,R=!1;e?w||(T=e.has(S),R=e.has(M),w=!T&&!R):(T=!0,R=!0);const B=w||T,b=w||R;let P=!1;B&&(P=d(g,m,w));let L=!1;b&&(L=d(v,m,w));const U=P||L;if(U)for(let G=0;G<3;G++){const j=g+G,X=v+G,J=l[j],te=l[j+3],k=l[X],Q=l[X+3];l[p+G]=J<k?J:k,l[p+G+3]=te>Q?te:Q}return U}}}function sW(n,e,t,i,r,s,o){fn.setBuffer(n._roots[e]),$S(0,n,t,i,r,s,o),fn.clearBuffer()}function $S(n,e,t,i,r,s,o){const{float32Array:a,uint16Array:l,uint32Array:c}=fn,u=n*2;if(or(u,l)){const p=Ir(n,c),m=cs(u,l);XV(e,t,i,p,m,r,s,o)}else{const p=us(n);rl(p,a,i,s,o)&&$S(p,e,t,i,r,s,o);const m=hs(n,c);rl(m,a,i,s,o)&&$S(m,e,t,i,r,s,o)}}const oW=["x","y","z"];function aW(n,e,t,i,r,s){fn.setBuffer(n._roots[e]);const o=eM(0,n,t,i,r,s);return fn.clearBuffer(),o}function eM(n,e,t,i,r,s){const{float32Array:o,uint16Array:a,uint32Array:l}=fn;let c=n*2;if(or(c,a)){const d=Ir(n,l),p=cs(c,a);return JV(e,t,i,d,p,r,s)}else{const d=MD(n,l),p=oW[d],y=i.direction[p]>=0;let _,x;y?(_=us(n),x=hs(n,l)):(_=hs(n,l),x=us(n));const v=rl(_,o,i,r,s)?eM(_,e,t,i,r,s):null;if(v){const w=v.point[p];if(y?w<=o[x+d]:w>=o[x+d+3])return v}const M=rl(x,o,i,r,s)?eM(x,e,t,i,r,s):null;return v&&M?v.distance<=M.distance?v:M:v||M||null}}const Mg=new Yt,Hu=new ks,Gu=new ks,id=new Ke,HR=new qi,Eg=new qi;function lW(n,e,t,i){fn.setBuffer(n._roots[e]);const r=tM(0,n,t,i);return fn.clearBuffer(),r}function tM(n,e,t,i,r=null){const{float32Array:s,uint16Array:o,uint32Array:a}=fn;let l=n*2;if(r===null&&(t.boundingBox||t.computeBoundingBox(),HR.set(t.boundingBox.min,t.boundingBox.max,i),r=HR),or(l,o)){const u=e.geometry,d=u.index,p=u.attributes.position,m=t.index,y=t.attributes.position,_=Ir(n,a),x=cs(l,o);if(id.copy(i).invert(),t.boundsTree)return Pn(n,s,Eg),Eg.matrix.copy(id),Eg.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:v=>Eg.intersectsBox(v),intersectsTriangle:v=>{v.a.applyMatrix4(i),v.b.applyMatrix4(i),v.c.applyMatrix4(i),v.needsUpdate=!0;for(let S=_,M=x+_;S<M;S++)if(Xn(Gu,3*e.resolveTriangleIndex(S),d,p),Gu.needsUpdate=!0,v.intersectsTriangle(Gu))return!0;return!1}});for(let g=_,v=x+_;g<v;g++){const S=e.resolveTriangleIndex(g);Xn(Hu,3*S,d,p),Hu.a.applyMatrix4(id),Hu.b.applyMatrix4(id),Hu.c.applyMatrix4(id),Hu.needsUpdate=!0;for(let M=0,w=m.count;M<w;M+=3)if(Xn(Gu,M,m,y),Gu.needsUpdate=!0,Hu.intersectsTriangle(Gu))return!0}}else{const u=n+8,d=a[n+6];return Pn(u,s,Mg),!!(r.intersectsBox(Mg)&&tM(u,e,t,i,r)||(Pn(d,s,Mg),r.intersectsBox(Mg)&&tM(d,e,t,i,r)))}}const wg=new Ke,hA=new qi,rd=new qi,cW=new z,uW=new z,hW=new z,fW=new z;function dW(n,e,t,i={},r={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),hA.set(e.boundingBox.min,e.boundingBox.max,t),hA.needsUpdate=!0;const a=n.geometry,l=a.attributes.position,c=a.index,u=e.attributes.position,d=e.index,p=fs.getPrimitive(),m=fs.getPrimitive();let y=cW,_=uW,x=null,g=null;r&&(x=hW,g=fW);let v=1/0,S=null,M=null;return wg.copy(t).invert(),rd.matrix.copy(wg),n.shapecast({boundsTraverseOrder:w=>hA.distanceToBox(w),intersectsBounds:(w,T,R)=>R<v&&R<o?(T&&(rd.min.copy(w.min),rd.max.copy(w.max),rd.needsUpdate=!0),!0):!1,intersectsRange:(w,T)=>{if(e.boundsTree){const R=e.boundsTree;return R.shapecast({boundsTraverseOrder:B=>rd.distanceToBox(B),intersectsBounds:(B,b,P)=>P<v&&P<o,intersectsRange:(B,b)=>{for(let P=B,L=B+b;P<L;P++){const U=R.resolveTriangleIndex(P);Xn(m,3*U,d,u),m.a.applyMatrix4(t),m.b.applyMatrix4(t),m.c.applyMatrix4(t),m.needsUpdate=!0;for(let G=w,j=w+T;G<j;G++){const X=n.resolveTriangleIndex(G);Xn(p,3*X,c,l),p.needsUpdate=!0;const J=p.distanceToTriangle(m,y,x);if(J<v&&(_.copy(y),g&&g.copy(x),v=J,S=G,M=P),J<s)return!0}}}})}else{const R=ef(e);for(let B=0,b=R;B<b;B++){Xn(m,3*B,d,u),m.a.applyMatrix4(t),m.b.applyMatrix4(t),m.c.applyMatrix4(t),m.needsUpdate=!0;for(let P=w,L=w+T;P<L;P++){const U=n.resolveTriangleIndex(P);Xn(p,3*U,c,l),p.needsUpdate=!0;const G=p.distanceToTriangle(m,y,x);if(G<v&&(_.copy(y),g&&g.copy(x),v=G,S=P,M=B),G<s)return!0}}}}}),fs.releasePrimitive(p),fs.releasePrimitive(m),v===1/0?null:(i.point?i.point.copy(_):i.point=_.clone(),i.distance=v,i.faceIndex=S,r&&(r.point?r.point.copy(g):r.point=g.clone(),r.point.applyMatrix4(wg),_.applyMatrix4(wg),r.distance=_.sub(r.point).length(),r.faceIndex=M),i)}function pW(){return typeof SharedArrayBuffer<"u"}const zd=new fn.constructor,t_=new fn.constructor,Pa=new dw(()=>new Yt),Vu=new Yt,Wu=new Yt,fA=new Yt,dA=new Yt;let pA=!1;function mW(n,e,t,i){if(pA)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");pA=!0;const r=n._roots,s=e._roots;let o,a=0,l=0;const c=new Ke().copy(t).invert();for(let u=0,d=r.length;u<d;u++){zd.setBuffer(r[u]),l=0;const p=Pa.getPrimitive();Pn(0,zd.float32Array,p),p.applyMatrix4(c);for(let m=0,y=s.length;m<y&&(t_.setBuffer(s[u]),o=Bs(0,0,t,c,i,a,l,0,0,p),t_.clearBuffer(),l+=s[m].length,!o);m++);if(Pa.releasePrimitive(p),zd.clearBuffer(),a+=r[u].length,o)break}return pA=!1,o}function Bs(n,e,t,i,r,s=0,o=0,a=0,l=0,c=null,u=!1){let d,p;u?(d=t_,p=zd):(d=zd,p=t_);const m=d.float32Array,y=d.uint32Array,_=d.uint16Array,x=p.float32Array,g=p.uint32Array,v=p.uint16Array,S=n*2,M=e*2,w=or(S,_),T=or(M,v);let R=!1;if(T&&w)u?R=r(Ir(e,g),cs(e*2,v),Ir(n,y),cs(n*2,_),l,o+e,a,s+n):R=r(Ir(n,y),cs(n*2,_),Ir(e,g),cs(e*2,v),a,s+n,l,o+e);else if(T){const B=Pa.getPrimitive();Pn(e,x,B),B.applyMatrix4(t);const b=us(n),P=hs(n,y);Pn(b,m,Vu),Pn(P,m,Wu);const L=B.intersectsBox(Vu),U=B.intersectsBox(Wu);R=L&&Bs(e,b,i,t,r,o,s,l,a+1,B,!u)||U&&Bs(e,P,i,t,r,o,s,l,a+1,B,!u),Pa.releasePrimitive(B)}else{const B=us(e),b=hs(e,g);Pn(B,x,fA),Pn(b,x,dA);const P=c.intersectsBox(fA),L=c.intersectsBox(dA);if(P&&L)R=Bs(n,B,t,i,r,s,o,a,l+1,c,u)||Bs(n,b,t,i,r,s,o,a,l+1,c,u);else if(P)if(w)R=Bs(n,B,t,i,r,s,o,a,l+1,c,u);else{const U=Pa.getPrimitive();U.copy(fA).applyMatrix4(t);const G=us(n),j=hs(n,y);Pn(G,m,Vu),Pn(j,m,Wu);const X=U.intersectsBox(Vu),J=U.intersectsBox(Wu);R=X&&Bs(B,G,i,t,r,o,s,l,a+1,U,!u)||J&&Bs(B,j,i,t,r,o,s,l,a+1,U,!u),Pa.releasePrimitive(U)}else if(L)if(w)R=Bs(n,b,t,i,r,s,o,a,l+1,c,u);else{const U=Pa.getPrimitive();U.copy(dA).applyMatrix4(t);const G=us(n),j=hs(n,y);Pn(G,m,Vu),Pn(j,m,Wu);const X=U.intersectsBox(Vu),J=U.intersectsBox(Wu);R=X&&Bs(b,G,i,t,r,o,s,l,a+1,U,!u)||J&&Bs(b,j,i,t,r,o,s,l,a+1,U,!u),Pa.releasePrimitive(U)}}return R}const Tg=new qi,GR=new Yt,gW={strategy:xD,maxDepth:40,maxLeafTris:10,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,verbose:!0};class pw{static serialize(e,t={}){t={cloneBuffers:!0,...t};const i=e.geometry,r=e._roots,s=e._indirectBuffer,o=i.getIndex();let a;return t.cloneBuffers?a={roots:r.map(l=>l.slice()),index:o?o.array.slice():null,indirectBuffer:s?s.slice():null}:a={roots:r,index:o?o.array:null,indirectBuffer:s},a}static deserialize(e,t,i={}){i={setIndex:!0,indirect:!!e.indirectBuffer,...i};const{index:r,roots:s,indirectBuffer:o}=e,a=new pw(t,{...i,[sA]:!0});if(a._roots=s,a._indirectBuffer=o||null,i.setIndex){const l=t.getIndex();if(l===null){const c=new Lt(e.index,1,!1);t.setIndex(c)}else l.array!==r&&(l.array.set(r),l.needsUpdate=!0)}return a}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");
3994if(t=Object.assign({...gW,[sA]:!1},t),t.useSharedArrayBuffer&&!pW())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[sA]||(IV(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Yt))),this.resolveTriangleIndex=t.indirect?i=>this._indirectBuffer[i]:i=>i}refit(e=null){return(this.indirect?rW:jV)(this,e)}traverse(e,t=0){const i=this._roots[t],r=new Uint32Array(i),s=new Uint16Array(i);o(0);function o(a,l=0){const c=a*2,u=s[c+15]===cx;if(u){const d=r[a+6],p=s[c+14];e(l,u,new Float32Array(i,a*4,6),d,p)}else{const d=a+Dd/4,p=r[a+6],m=r[a+7];e(l,u,new Float32Array(i,a*4,6),m)||(o(d,l+1),o(p,l+1))}}}raycast(e,t=_s,i=0,r=1/0){const s=this._roots,o=this.geometry,a=[],l=t.isMaterial,c=Array.isArray(t),u=o.groups,d=l?t.side:t,p=this.indirect?sW:KV;for(let m=0,y=s.length;m<y;m++){const _=c?t[u[m].materialIndex].side:d,x=a.length;if(p(this,m,_,e,a,i,r),c){const g=u[m].materialIndex;for(let v=x,S=a.length;v<S;v++)a[v].face.materialIndex=g}}return a}raycastFirst(e,t=_s,i=0,r=1/0){const s=this._roots,o=this.geometry,a=t.isMaterial,l=Array.isArray(t);let c=null;const u=o.groups,d=a?t.side:t,p=this.indirect?aW:ZV;for(let m=0,y=s.length;m<y;m++){const _=l?t[u[m].materialIndex].side:d,x=p(this,m,_,e,i,r);x!=null&&(c==null||x.distance<c.distance)&&(c=x,l&&(x.face.materialIndex=u[m].materialIndex))}return c}intersectsGeometry(e,t){let i=!1;const r=this._roots,s=this.indirect?lW:qV;for(let o=0,a=r.length;o<a&&(i=s(this,o,e,t),!i);o++);return i}shapecast(e){const t=fs.getPrimitive(),i=this.indirect?YV:WV;let{boundsTraverseOrder:r,intersectsBounds:s,intersectsRange:o,intersectsTriangle:a}=e;if(o&&a){const d=o;o=(p,m,y,_,x)=>d(p,m,y,_,x)?!0:i(p,m,this,a,y,_,t)}else o||(a?o=(d,p,m,y)=>i(d,p,this,a,m,y,t):o=(d,p,m)=>m);let l=!1,c=0;const u=this._roots;for(let d=0,p=u.length;d<p;d++){const m=u[d];if(l=UV(this,d,s,o,r,c),l)break;c+=m.byteLength}return fs.releasePrimitive(t),l}bvhcast(e,t,i){let{intersectsRanges:r,intersectsTriangles:s}=i;const o=fs.getPrimitive(),a=this.geometry.index,l=this.geometry.attributes.position,c=this.indirect?y=>{const _=this.resolveTriangleIndex(y);Xn(o,_*3,a,l)}:y=>{Xn(o,y*3,a,l)},u=fs.getPrimitive(),d=e.geometry.index,p=e.geometry.attributes.position,m=e.indirect?y=>{const _=e.resolveTriangleIndex(y);Xn(u,_*3,d,p)}:y=>{Xn(u,y*3,d,p)};if(s){const y=(_,x,g,v,S,M,w,T)=>{for(let R=g,B=g+v;R<B;R++){m(R),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let b=_,P=_+x;b<P;b++)if(c(b),o.needsUpdate=!0,s(o,u,b,R,S,M,w,T))return!0}return!1};if(r){const _=r;r=function(x,g,v,S,M,w,T,R){return _(x,g,v,S,M,w,T,R)?!0:y(x,g,v,S,M,w,T,R)}}else r=y}return mW(this,e,t,r)}intersectsBox(e,t){return Tg.set(e.min,e.max,t),Tg.needsUpdate=!0,this.shapecast({intersectsBounds:i=>Tg.intersectsBox(i),intersectsTriangle:i=>Tg.intersectsTriangle(i)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,i={},r={},s=0,o=1/0){return(this.indirect?dW:iW)(this,e,t,i,r,s,o)}closestPointToPoint(e,t={},i=0,r=1/0){return NV(this,e,t,i,r)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(i=>{Pn(0,new Float32Array(i),GR),e.union(GR)}),e}}function VR(n,e,t){return n===null?null:(n.point.applyMatrix4(e.matrixWorld),n.distance=n.point.distanceTo(t.ray.origin),n.object=e,n)}const Cg=new hl,WR=new z,jR=new Ke,yW=hn.prototype.raycast,XR=new z;function _W(n,e){if(this.geometry.boundsTree){if(this.material===void 0)return;jR.copy(this.matrixWorld).invert(),Cg.copy(n.ray).applyMatrix4(jR),AW(this.matrixWorld,XR),WR.copy(Cg.direction).multiply(XR);const t=WR.length(),i=n.near/t,r=n.far/t,s=this.geometry.boundsTree;if(n.firstHitOnly===!0){const o=VR(s.raycastFirst(Cg,this.material,i,r),this,n);o&&e.push(o)}else{const o=s.raycast(Cg,this.material,i,r);for(let a=0,l=o.length;a<l;a++){const c=VR(o[a],this,n);c&&e.push(c)}}}else yW.call(this,n,e)}function xW(n){return this.boundsTree=new pw(this,n),this.boundsTree}function vW(){this.boundsTree=null}function AW(n,e){const t=n.elements,i=e.set(t[0],t[1],t[2]).length(),r=e.set(t[4],t[5],t[6]).length(),s=e.set(t[8],t[9],t[10]).length();return e.set(i,r,s)}const JR=n=>n.isMesh,SW=H.forwardRef(({enabled:n=!0,firstHitOnly:e=!1,children:t,strategy:i=vD,verbose
3994:r=!1,setBoundingBox:s=!0,maxDepth:o=40,maxLeafTris:a=10,indirect:l=!1,...c},u)=>{const d=H.useRef(null),p=Tr(m=>m.raycaster);return H.useImperativeHandle(u,()=>d.current,[]),H.useEffect(()=>{if(n){const m={strategy:i,verbose:r,setBoundingBox:s,maxDepth:o,maxLeafTris:a,indirect:l},y=d.current;return p.firstHitOnly=e,y.traverse(_=>{JR(_)&&!_.geometry.boundsTree&&_.raycast===hn.prototype.raycast&&(_.raycast=_W,_.geometry.computeBoundsTree=xW,_.geometry.disposeBoundsTree=vW,_.geometry.computeBoundsTree(m))}),()=>{delete p.firstHitOnly,y.traverse(_=>{JR(_)&&_.geometry.boundsTree&&(_.geometry.disposeBoundsTree(),_.raycast=hn.prototype.raycast)})}}},[]),H.createElement("group",Ec({ref:d},c),t)}),TD=H.forwardRef(function({children:e,disable:t,disableX:i,disableY:r,disableZ:s,left:o,right:a,top:l,bottom:c,front:u,back:d,onCentered:p,precise:m=!0,cacheKey:y=0,..._},x){const g=H.useRef(null),v=H.useRef(null),S=H.useRef(null);return H.useLayoutEffect(()=>{v.current.matrixWorld.identity();const M=new Yt().setFromObject(S.current,m),w=new z,T=new Nn,R=M.max.x-M.min.x,B=M.max.y-M.min.y,b=M.max.z-M.min.z;M.getCenter(w),M.getBoundingSphere(T);const P=l?B/2:c?-B/2:0,L=o?-R/2:a?R/2:0,U=u?b/2:d?-b/2:0;v.current.position.set(t||i?0:-w.x+L,t||r?0:-w.y+P,t||s?0:-w.z+U),typeof p<"u"&&p({parent:g.current.parent,container:g.current,width:R,height:B,depth:b,boundingBox:M,boundingSphere:T,center:w,verticalAlignment:P,horizontalAlignment:L,depthAlignment:U})},[y,p,l,o,u,t,i,r,s,m,a,c,d]),H.useImperativeHandle(x,()=>g.current,[]),H.createElement("group",Ec({ref:g},_),H.createElement("group",{ref:v},H.createElement("group",{ref:S},e)))}),YR=new Ke,KR=new hl,mA=new Nn,gA=new z;function MW(n,e){const t=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(t.boundingSphere===null&&t.computeBoundingSphere(),mA.copy(t.boundingSphere),mA.applyMatrix4(r),n.ray.intersectsSphere(mA)!==!1&&(YR.copy(r).invert(),KR.copy(n.ray).applyMatrix4(YR),!(t.boundingBox!==null&&KR.intersectBox(t.boundingBox,gA)===null)&&e.push({distance:gA.distanceTo(n.ray.origin),point:gA.clone(),object:this})))}const EW={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},QR=n=>{let e;const t=new Set,i=(u,d)=>{const p=typeof u=="function"?u(e):u;if(!Object.is(p,e)){const m=e;e=d??(typeof p!="object"||p===null)?p:Object.assign({},e,p),t.forEach(y=>y(e,m))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>c,subscribe:u=>(t.add(u),()=>t.delete(u)),destroy:()=>{(EW?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},c=e=n(i,r,l);return l},wW=n=>n?QR(n):QR;var CD={exports:{}},RD={},bD={exports:{}},PD={};/** 3995 * @license React 3996 * use-sync-external-store-shim.production.min.js 3997 * 3998 * Copyright (c) Facebook, Inc. and its affiliates. 3999 * 4000 * This source code is licensed under the MIT license found in the 4001 * LICENSE file in the root directory of this source tree. 4002 */var Hh=H;function TW(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var CW=typeof Object.is=="function"?Object.is:TW,RW=Hh.useState,bW=Hh.useEffect,PW=Hh.useLayoutEffect,BW=Hh.useDebugValue;function IW(n,e){var t=e(),i=RW({inst:{value:t,getSnapshot:e}}),r=i[0].inst,s=i[1];return PW(function(){r.value=t,r.getSnapshot=e,yA(r)&&s({inst:r})},[n,t,e]),bW(function(){return yA(r)&&s({inst:r}),n(function(){yA(r)&&s({inst:r})})},[n]),BW(t),t}function yA(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!CW(n,t)}catch{return!0}}function LW(n,e){return e()}var DW=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?LW:IW;PD.useSyncExternalStore=Hh.useSyncExternalStore!==void 0?Hh.useSyncExternalStore:DW;bD.exports=PD;var zW=bD.exports;/** 4003 * @license React 4004 * use-sync-external-store-shim/with-selector.production.min.js 4005 * 4006 * Copyright (c) Facebook, Inc. and its affiliates. 4007 * 4008 * This source code is licensed under the MIT license found in the 4009 * LICENSE file in the root directory of this source tree. 4010 */var hx=H,FW=zW;function OW(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var UW=typeof Object.is=="function"?Object.is:OW,NW=FW.useSyncExternalStore,kW=hx.useRef,HW=hx.useEffect,GW=hx.useMemo,VW=hx.useDebugValue;RD.useSyncExternalStoreWithSelector=function(n,e,t,i,r){var s=kW(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=GW(function(){function l(m){if(!c){if(c=!0,u=m,m=i(m),r!==void 0&&o.hasValue){var y=o.value;if(r(y,m))return d=y}return d=m}if(y=d,UW(u,m))return y;var _=i(m);return r!==void 0&&r(y,_)?y:(u=m,d=_)}var c=!1,u,d,p=t===void 0?null:t;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,t,i,r]);var a=NW(n,s[0],s[1]);return HW(function(){o.hasValue=!0,o.value=a},[a]),VW(a),a};CD.exports=RD;var WW=CD.exports;const jW=f_(WW),BD={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:XW}=_c,{useSyncExternalStoreWithSelector:JW}=jW;let ZR=!1;const YW=n=>n;function KW(n,e=YW,t){(BD?"production":void 0)!=="production"&&t&&!ZR&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),ZR=!0);const i=JW(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return XW(i),i}const qR=n=>
4010{(BD?"production":void 0)!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?wW(n):n,t=(i,r)=>KW(e,i,r);return Object.assign(t,e),t},QW=n=>n?qR(n):qR;var $R,eb;const tb=typeof window<"u"&&(($R=window.document)!=null&&$R.createElement||((eb=window.navigator)==null?void 0:eb.product)==="ReactNative")?_c.useLayoutEffect:_c.useEffect;function ZW(){const n=QW(e=>({current:new Array,version:0,set:e}));return{In:({children:e})=>{const t=n(r=>r.set),i=n(r=>r.version);return tb(()=>{t(r=>({version:r.version+1}))},[]),tb(()=>(t(({current:r})=>({current:[...r,e]})),()=>t(({current:r})=>({current:r.filter(s=>s!==e)}))),[e,i]),null},Out:()=>{const e=n(t=>t.current);return _c.createElement(_c.Fragment,null,e)}}}/** 4011 * @remix-run/router v1.19.1 4012 * 4013 * Copyright (c) Remix Software Inc. 4014 * 4015 * This source code is licensed under the MIT license found in the 4016 * LICENSE.md file in the root directory of this source tree. 4017 * 4018 * @license MIT 4019 */function _p(){return _p=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},_p.apply(this,arguments)}var Oa;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(Oa||(Oa={}));const nb="popstate";function qW(n){n===void 0&&(n={});function e(i,r){let{pathname:s,search:o,hash:a}=i.location;return nM("",{pathname:s,search:o,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function t(i,r){return typeof r=="string"?r:n_(r)}return ej(e,t,null,n)}function Yn(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function ID(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function $W(){return Math.random().toString(36).substr(2,8)}function ib(n,e){return{usr:n.state,key:n.key,idx:e}}function nM(n,e,t,i){return t===void 0&&(t=null),_p({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?tf(e):e,{state:t,key:e&&e.key||i||$W()})}function n_(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 tf(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 ej(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=Oa.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(_p({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=Oa.Pop;let x=u(),g=x==null?null:x-c;c=x,l&&l({action:a,location:_.location,delta:g})}function p(x,g){a=Oa.Push;let v=nM(_.location,x,g);c=u()+1;let S=ib(v,c),M=_.createHref(v);try{o.pushState(S,"",M)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;r.location.assign(M)}s&&l&&l({action:a,location:_.location,delta:1})}function m(x,g){a=Oa.Replace;let v=nM(_.location,x,g);c=u();let S=ib(v,c),M=_.createHref(v);o.replaceState(S,"",M),s&&l&&l({action:a,location:_.location,delta:0})}function y(x){let g=r.location.origin!=="null"?r.location.origin:r.location.href,v=typeof x=="string"?x:n_(x);return v=v.replace(/ $/,"%20"),Yn(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let _={get action(){return a},get location(){return n(r,o)}
vendor: 2,728 bytes, line 4019
4019,listen(x){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(nb,d),l=x,()=>{r.removeEventListener(nb,d),l=null}},createHref(x){return e(r,x)},createURL:y,encodeLocation(x){let g=y(x);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:m,go(x){return o.go(x)}};return _}var rb;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(rb||(rb={}));function tj(n,e,t){return t===void 0&&(t="/"),nj(n,e,t,!1)}function nj(n,e,t,i){let r=typeof e=="string"?tf(e):e,s=mw(r.pathname||"/",t);if(s==null)return null;let o=LD(n);ij(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=pj(s);a=fj(o[l],c,i)}return a}function LD(n,e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i="");let r=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Yn(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=Qa([i,l.relativePath]),u=t.concat(l);s.children&&s.children.length>0&&(Yn(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),LD(s.children,e,u,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:uj(c,s.index),routesMeta:u})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))r(s,o);else for(let l of DD(s.path))r(s,o,l)}),e}function DD(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=DD(i.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),r&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function ij(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:hj(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const rj=/^:[\w-]+$/,sj=3,oj=2,aj=1,lj=10,cj=-2,sb=n=>n==="*";function uj(n,e){let t=n.split("/"),i=t.length;return t.some(sb)&&(i+=cj),e&&(i+=oj),t.filter(r=>!sb(r)).reduce((r,s)=>r+(rj.test(s)?sj:s===""?aj:lj),i)}function hj(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function fj(n,e,t){let{routesMeta:i}=n,r={},s="/",o=[];for(let a=0;a<i.length;++a){let l=i[a],c=a===i.length-1,u=s==="/"?e:e.slice(s.length)||"/",d=ob({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),p=l.route;if(!d&&c&&t&&!i[i.length-1].route.index&&(d=ob({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;
vendor: 6,834 bytes, lines 4019-4028
4019Object.assign(r,d.params),o.push({params:r,pathname:Qa([s,d.pathname]),pathnameBase:_j(Qa([s,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(s=Qa([s,d.pathnameBase]))}return o}function ob(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=dj(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let s=r[0],o=s.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:i.reduce((c,u,d)=>{let{paramName:p,isOptional:m}=u;if(p==="*"){let _=a[d]||"";o=s.slice(0,s.length-_.length).replace(/(.)\/+$/,"$1")}const y=a[d];return m&&!y?c[p]=void 0:c[p]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:n}}function dj(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),ID(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(i.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function pj(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ID(!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 mw(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 mj(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?tf(n):n;return{pathname:t?t.startsWith("/")?t:gj(t,e):e,search:xj(i),hash:vj(r)}}function gj(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function _A(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 <Link to="..."> and the router will parse it for you.'}function yj(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function zD(n,e){let t=yj(n);return e?t.map((i,r)=>r===t.length-1?i.pathname:i.pathnameBase):t.map(i=>i.pathnameBase)}function FD(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=tf(n):(r=_p({},n),Yn(!r.pathname||!r.pathname.includes("?"),_A("?","pathname","search",r)),Yn(!r.pathname||!r.pathname.includes("#"),_A("#","pathname","hash",r)),Yn(!r.search||!r.search.includes("#"),_A("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(o==null)a=t;else{let d=e.length-1;if(!i&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;r.pathname=p.join("/")}a=d>=0?e[d]:"/"}let l=mj(r,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Qa=n=>n.join("/").replace(/\/\/+/g,"/"),_j=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),xj=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,vj=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function Aj(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const OD=["post","put","patch","delete"];new Set(OD);const Sj=["get",...OD];new Set(Sj);/** 4020 * React Router v6.26.1 4021 * 4022 * Copyright (c) Remix Software Inc. 4023 * 4024 * This source code is licensed under the MIT license found in the 4025 * LICENSE.md file in the root directory of this source tree. 4026 * 4027 * @license MIT 4028 */function xp(){return xp=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},xp.apply(this,arguments)}const gw=H.createContext(null),Mj=H.createContext(null),Hc=H.createContext(null),fx=H.createContext(null),Gc=H.createContext({outlet:null,matches:[],isDataRoute:!1}),UD=H.createContext(null);function Ej(n,e){let{relative:t}=e===void 0?{}:e;Qp()||Yn(!1);let{basename:i,navigator:r}=H.useContext(Hc),{hash:s,pathname:o,search:a}=kD(n,{relative:t}),l=o;return i!=="/"&&(l=o==="/"?i:Qa([i,o])),r.createHref({pathname:l,search:a,hash:s})}function Qp(){return H.useContext(fx)!=null}function Ss(){return Qp()||Yn(!1),H.useContext(fx).location}function ND(n){H.useContext(Hc).static||H.useLayoutEffect(n)}function yw(){let{isDataRoute:n}=H.useContext(Gc);return n?Oj():wj()}function wj(){Qp()||Yn(!1);let n=H.useContext(gw),{basename:e,future:t,navigator:i}=H.useContext(Hc),{matches:r}=H.useContext(Gc),{pathname:s}=Ss(),o=JSON.stringify(zD(r,t.v7_relativeSplatPath)),a=H.useRef(!1);return ND(()=>{a.current=!0}),H.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){i.go(c);return}let d=FD(c,JSON.parse(o),s,u.relative==="path");n==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Qa([e,d.pathname])),(u.replace?i.replace:i.push)(d,u.state,u)},[e,i,o,s,n])}function kD(n,e){let{relative:t}=e===void 0?{}:e,{future:i}=H.useContext(Hc),{matches:r}=H.useContext(Gc),{pathname:s}=Ss(),o=JSON.stringify(zD(r,i.v7_relativeSplatPath));return H.useMemo(()=>FD(n,JSON.parse(o),s,t==="path"),[n,o,s,t])}function Tj(n,e){return Cj(n,e)}function Cj(n,e,t,i){Qp()||Yn(!1);let{navigator:r}=H.useContext(Hc),{matches:s}=H.useContext(Gc),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Ss(),u;if(e){var d;let x=typeof e=="string"?tf(e):e;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||Yn(!1),u=x}else u=c;let p=u.pathname||"/",m=p;if(l!=="/"){let x=l.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let y=tj(n,{pathname:m}),_=Ij(y&&y.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:Qa([l,r.encodeLocation?r.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:Qa([l,r.encodeLocation?r.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,t,i);return e&&_?H.createElement(fx.Provider,{value:{location:xp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Oa.Pop}},_):_}function Rj(){let n=Fj(),e=Aj(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return H.createElement(H.Fragment,null,H.createElement("h2",null,"Unexpected Application
4028Error!"),H.createElement("h3",{style:{fontStyle:"italic"}},e),t?H.createElement("pre",{style:r},t):null,null)}const bj=H.createElement(Rj,null);class Pj extends H.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?H.createElement(Gc.Provider,{value:this.props.routeContext},H.createElement(UD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bj(n){let{routeContext:e,match:t,children:i}=n,r=H.useContext(gw);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),H.createElement(Gc.Provider,{value:e},i)}function Ij(n,e,t,i){var r;if(e===void 0&&(e=[]),t===void 0&&(t=null),i===void 0&&(i=null),n==null){var s;if(!t)return null;if(t.errors)n=t.matches;else if((s=i)!=null&&s.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let o=n,a=(r=t)==null?void 0:r.errors;if(a!=null){let u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||Yn(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(t&&i&&i.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:p,errors:m}=t,y=d.route.loader&&p[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||y){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,d,p)=>{let m,y=!1,_=null,x=null;t&&(m=a&&d.route.id?a[d.route.id]:void 0,_=d.route.errorElement||bj,l&&(c<0&&p===0?(y=!0,x=null):c===p&&(y=!0,x=d.route.hydrateFallbackElement||null)));let g=e.concat(o.slice(0,p+1)),v=()=>{let S;return m?S=_:y?S=x:d.route.Component?S=H.createElement(d.route.Component,null):d.route.element?S=d.route.element:S=u,H.createElement(Bj,{match:d,routeContext:{outlet:u,matches:g,isDataRoute:t!=null},children:S})};return t&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?H.createElement(Pj,{location:t.location,revalidation:t.revalidation,component:_,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var HD=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(HD||{}),i_=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(i_||{});function Lj(n){let e=H.useContext(gw);return e||Yn(!1),e}function Dj(n){let e=H.useContext(Mj);return e||Yn(!1),e}function zj(n){let e=H.useContext(Gc);return e||Yn(!1),e}function GD(n){let e=zj(),t=e.matches[e.matches.length-1];return t.route.id||Yn(!1),t.route.id}function Fj(){var n;let e=H.useContext(UD),t=Dj(i_.UseRouteError),i=GD(i_.UseRouteError);return e!==void 0?e:(n=t.errors)==null?void 0:n[i]}function Oj(){let{router:n}=Lj(HD.UseNavigateStable),e=GD(i_.UseNavigateStable),t=H.useRef(!1);return ND(()=>{t.current=!0}),H.useCallback(function(r,s){s===void 0&&(s={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,xp({fromRouteId:e},s)))},[n,e])}function ts(n){Yn(!1)}function Uj(n){let{basename:e="/",children:t=null,location:i,navigationType:r=Oa.Pop,navigator:s,static:o=!1,future:a}=n;Qp()&&Yn(!1);let l=e.replace(/^\/*/,"/"),c=H.useMemo(()=>({basename:l,navigator:s,static:o,future:xp({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof i=="string"&&(i=tf(i));
4028let{pathname:u="/",search:d="",hash:p="",state:m=null,key:y="default"}=i,_=H.useMemo(()=>{let x=mw(u,l);return x==null?null:{location:{pathname:x,search:d,hash:p,state:m,key:y},navigationType:r}},[l,u,d,p,m,y,r]);return _==null?null:H.createElement(Hc.Provider,{value:c},H.createElement(fx.Provider,{children:t,value:_}))}function Nj(n){let{children:e,location:t}=n;return Tj(iM(e),t)}new Promise(()=>{});function iM(n,e){e===void 0&&(e=[]);let t=[];return H.Children.forEach(n,(i,r)=>{if(!H.isValidElement(i))return;let s=[...e,r];if(i.type===H.Fragment){t.push.apply(t,iM(i.props.children,s));return}i.type!==ts&&Yn(!1),!i.props.index||!i.props.children||Yn(!1);let o={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=iM(i.props.children,s)),t.push(o)}),t}/** 4029 * React Router DOM v6.26.1 4030 * 4031 * Copyright (c) Remix Software Inc. 4032 * 4033 * This source code is licensed under the MIT license found in the 4034 * LICENSE.md file in the root directory of this source tree. 4035 * 4036 * @license MIT 4037 */function rM(){return rM=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},rM.apply(this,arguments)}function kj(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function Hj(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Gj(n,e){return n.button===0&&(!e||e==="_self")&&!Hj(n)}const Vj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Wj="6";try{window.__reactRouterVersion=Wj}catch{}const jj="startTransition",ab=Z4[jj];function Xj(n){let{basename:e,children:t,future:i,window:r}=n,s=H.useRef();s.current==null&&(s.current=qW({window:r,v5Compat:!0}));let o=s.current,[a,l]=H.useState({action:o.action,location:o.location}),{v7_startTransition:c}=i||{},u=H.useCallback(d=>{c&&ab?ab(()=>l(d)):l(d)},[l,c]);return H.useLayoutEffect(()=>o.listen(u),[o,u]),H.createElement(Uj,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,future:i})}const Jj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,r_=H.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:u,unstable_viewTransition:d}=e,p=kj(e,Vj),{basename:m}=H.useContext(Hc),y,_=!1;if(typeof c=="string"&&Yj.test(c)&&(y=c,Jj))try{let S=new URL(window.location.href),M=c.startsWith("//")?new URL(S.protocol+c):new URL(c),w=mw(M.pathname,m);M.origin===S.origin&&w!=null?c=w+M.search+M.hash:_=!0}catch{}let x=Ej(c,{relative:r}),g=Kj(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:r,unstable_viewTransition:d});function v(S){i&&i(S),S.defaultPrevented||g(S)}return H.createElement("a",rM({},p,{href:y||x,onClick:_||s?i:v,ref:t,target:l}))});var lb;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(lb||(lb={}));var cb;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(cb||(cb={}));function Kj(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,l=yw(),c=Ss(),u=kD(n,{relative:o});return H.useCallback(d=>{if(Gj(d,t)){d.preventDefault();let p=i!==void 0?i:n_(c)===n_(u);l(n,{replace:p,state:r,preventScrollReset:s,relative:o,unstable_viewTransition:a})}},[c,l,u,i,r,t,n,s,o,a])}function zo(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function VD(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*! 4038 * GSAP 3.12.5 4039 * https://gsap.com 4040 * 4041 * @license Copyright 2008-2024, GreenSock. All rights reserved. 4042 * Subject to the terms at https://gsap.com/standard-license or for 4043 * Club GSAP members, the agreement issued with that membership. 4044 * @author: Jack Doyle, [email protected] 4045*/var Fr={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Gh={duration:.5,overwrite:!1,delay:0},_w,Oi,mn,ds=1e8,on=1/ds,sM=Math.PI*2,Qj=sM/4,Zj=0,WD=Math.sqrt,qj=Math.cos,$j=Math.sin,mi=function(e){return typeof e=="string"},In=function(e){return typeof e=="function"},ea=function(e){return typeof e=="number"},xw=function(e){return typeof e>"u"},_o=function(e){return typeof e=="object"},fr=function(e){return e!==!1},vw=function(){return typeof window<"u"},Rg=function(e){return In(e)||mi(e)},jD=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ui=Array.isArray,oM=/(?:-?\.?\d|\.)+/gi,XD=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,fh=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,xA=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,JD=/[+-]=-?[.\d]+/,YD=/[^,'"\[\]\s]+/gi,eX=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,An,no,aM,Aw,kr={},s_={},KD,QD=function(e){return(s_=Ic(e,kr))&&gr},Sw=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},vp=function(e,t){return!t&&console.warn(e)},ZD=function(e,t){return e&&(kr[e]=t)&&s_&&(s_[e]=t)||kr},Ap=function(){return 0},tX={suppressEvents:!0,isStart:!0,kill:!1},Xg={suppressEvents:!0,kill:!1},nX={suppressEvents:!0},Mw={},Za=[],lM={},qD,Cr={},vA={},ub=30,Jg=[],Ew="",ww=function(e){var t=e[0],i,r;if(_o(t)||In(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(r=Jg.length;r--&&!Jg[r].targetTest(t););i=Jg[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new Sz(e[r],i)))||e.splice(r,1);return e},pc=function(e){return e._gsap||ww(ps(e))[0]._gsap},$D=function(e,t,i){return(i=e[t])&&In(i)?e[t]():xw(i)&&e.getAttribute&&e.getAttribute(t)||i}
vendor: 50,709 bytes, lines 4045-4053
4045,dr=function(e,t){return(e=e.split(",")).forEach(t)||e},Fn=function(e){return Math.round(e*1e5)/1e5||0},ui=function(e){return Math.round(e*1e7)/1e7||0},Mh=function(e,t){var i=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),i==="+"?e+r:i==="-"?e-r:i==="*"?e*r:e/r},iX=function(e,t){for(var i=t.length,r=0;e.indexOf(t[r])<0&&++r<i;);return r<i},o_=function(){var e=Za.length,t=Za.slice(0),i,r;for(lM={},Za.length=0,i=0;i<e;i++)r=t[i],r&&r._lazy&&(r.render(r._lazy[0],r._lazy[1],!0)._lazy=0)},ez=function(e,t,i,r){Za.length&&!Oi&&o_(),e.render(t,i,Oi&&t<0&&(e._initted||e._startAt)),Za.length&&!Oi&&o_()},tz=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(YD).length<2?t:mi(e)?e.trim():e},nz=function(e){return e},vs=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},rX=function(e){return function(t,i){for(var r in i)r in t||r==="duration"&&e||r==="ease"||(t[r]=i[r])}},Ic=function(e,t){for(var i in t)e[i]=t[i];return e},hb=function n(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=_o(t[i])?n(e[i]||(e[i]={}),t[i]):t[i]);return e},a_=function(e,t){var i={},r;for(r in e)r in t||(i[r]=e[r]);return i},Fd=function(e){var t=e.parent||An,i=e.keyframes?rX(Ui(e.keyframes)):vs;if(fr(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},sX=function(e,t){for(var i=e.length,r=i===t.length;r&&i--&&e[i]===t[i];);return i<0},iz=function(e,t,i,r,s){var o=e[r],a;if(s)for(a=t[s];o&&o[s]>a;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[r]=t,t._prev=o,t.parent=t._dp=e,t},dx=function(e,t,i,r){i===void 0&&(i="_first"),r===void 0&&(r="_last");var s=t._prev,o=t._next;s?s._next=o:e[i]===t&&(e[i]=o),o?o._prev=s:e[r]===t&&(e[r]=s),t._next=t._prev=t.parent=null},sl=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},mc=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var i=e;i;)i._dirty=1,i=i.parent;return e},oX=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},cM=function(e,t,i,r){return e._startAt&&(Oi?e._startAt.revert(Xg):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},aX=function n(e){return!e||e._ts&&n(e.parent)},fb=function(e){return e._repeat?Vh(e._tTime,e=e.duration()+e._rDelay)*e:0},Vh=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},l_=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},px=function(e){return e._end=ui(e._start+(e._tDur/Math.abs(e._ts||e._rts||on)||0))},mx=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=ui(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),px(e),i._dirty||mc(i,e)),e},rz=function(e,t){var i;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(i=l_(e.rawTime(),t),(!t._dur||Zp(0,t.totalDuration(),i)-t._tTime>on)&&t.render(i,!0)),mc(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(i=e;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-on}},so=function(e,t,i,r){return t.parent&&sl(t),t._start=ui((ea(i)?i:i||e!==An?ns(e,i,t):e._time)+t._delay),t._end=ui(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),iz(e,t,"_first","_last",e._sort?"_start":0),uM(t)||(e._recent=t),r||rz(e,t),e._ts<0&&mx(e,e._tTime),e},sz=function(e,t){return(kr.ScrollTrigger||Sw("scrollTrigger",t))&&kr.ScrollTrigger.create(t,e)},oz=function(e,t,i,r,s){if(Cw(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!Oi&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&qD!==br.frame)return Za.push(e),e._lazy=[s,r],1},lX=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},uM=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},cX=function(e,t,i,r){var s=e.ratio,o=t<0||!t&&(!e._start&&lX(e)&&!(!e._initted&&uM(e))||(e._ts<0||e._dp._ts<0)&&!uM(e))?0:1,a=e._rDelay,l=0,c,u,d;if(a&&e._repeat&&(l=Zp(0,e._tDur,t),u=Vh(l,a),e._yoyo&&u&1&&(o=1-o),u!==Vh(e._tTime,a)&&(s=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==s||Oi||r||e._zTime===on||!t&&e._zTime){if(!e._initted&&oz(e,t,r,i,l))return;for(d=e._zTime,e._zTime=t||(i?on:0),i||(i=t&&!d),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=l,c=e._pt;c;)c.r(o,c.d),c=c._next;t<0&&cM(e,t,i,!0),e._onUpdate&&!i&&Lr(e,"onUpdate"),l&&e._repeat&&!i&&e.parent&&Lr(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&sl(e,1),!i&&!Oi&&(Lr(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},uX=function(e,t,i){var r;if(i>t)for(r=e._first;r&&r._start<=i;){if(r.data==="isPause"&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=i;){if(r.data==="isPause"&&r._start<t)return r;r=r._prev}},Wh=function(e,t,i,r){var s=e._repeat,o=ui(t)||0,a=e._tTime/e._tDur;return a&&!r&&(e._time*=o/e._dur),e._dur=o,e._tDur=s?s<0?1e10:ui(o*(s+1)+e._rDelay*s):o,a>0&&!r&&mx(e,e._tTime=e._tDur*a),e.parent&&px(e),i||mc(e.parent,e),e},db=function(e){return e instanceof Yi?mc(e):Wh(e,e._dur)},hX={_start:0,endTime:Ap,totalDuration:Ap},ns=function n(e,t,i){var r=e.labels,s=e._recent||hX,o=e.duration()>=ds?s.endTime(!1):e._dur,a,l,c;return mi(t)&&(isNaN(t)||t in r)?(l=t.charAt(0),c=t.substr(-1)==="%",a=t.indexOf("="),l==="<"||l===">"?(a>=0&&(t=t.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(c?(a<0?s:i).totalDuration()/100:1)):a<0?(t in r||(r[t]=o),r[t]):(l=parseFloat(t.charAt(a-1)+t.substr(a+1)),c&&i&&(l=l/100*(Ui(i)?i[0]:i).totalDuration()),a>1?n(e,t.substr(0,a-1),i)+l:o+l)):t==null?o:+t},Od=function(e,t,i){var r=ea(t[1]),s=(r?2:1)+(e<2?0:1),o=t[s],a,l;if(r&&(o.duration=t[1]),o.parent=i,e){for(a=o,l=i;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=fr(l.vars.inherit)&&l.parent;o.immediateRender=fr(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new Wn(t[0],o,t[s+1])},gl=function(e,t){return e||e===0?t(e):t},Zp=function(e,t,i){return i<e?e:i>t?t:i},Di=function(e,t){return!mi(e)||!(t=eX.exec(e))?"":t[1]},fX=function(e,t,i){return gl(i,function(r){return Zp(e,t,r)})},hM=[].slice,az=function(e,t){return e&&_o(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&_o(e[0]))&&!e.nodeType&&e!==no},dX=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(r){var s;return mi(r)&&!t||az(r,1)?(s=i).push.apply(s,ps(r)):i.push(r)})||i},ps=function(e,t,i){return mn&&!t&&mn.selector?mn.selector(e):mi(e)&&!i&&(aM||!jh())?hM.call((t||Aw).querySelectorAll(e),0):Ui(e)?dX(e,i):az(e)?hM.call(e,0):e?[e]:[]},fM=function(e){return e=ps(e)[0]||vp("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return ps(t,i.querySelectorAll?i:i===e?vp("Invalid scope")||Aw.createElement("div"):e)}},lz=function(e){return e.sort(function(){return .5-Math.random()})},cz=function(e){if(In(e))return e;var t=_o(e)?e:{each:e},i=gc(t.ease),r=t.from||0,s=parseFloat(t.base)||0,o={},a=r>0&&r<1,l=isNaN(r)||a,c=t.axis,u=r,d=r;return mi(r)?u=d={center:.5,edges:.5,end:1}[r]||0:!a&&l&&(u=r[0],d=r[1]),function(p,m,y){var _=(y||t).length,x=o[_],g,v,S,M,w,T,R,B,b;if(!x){if(b=t.grid==="auto"?0:(t.grid||[1,ds])[1],!b){for(R=-ds;R<(R=y[b++].getBoundingClientRect().left)&&b<_;);b<_&&b--}for(x=o[_]=[],g=l?Math.min(b,_)*u-.5:r%b,v=b===ds?0:l?_*d/b-.5:r/b|0,R=0,B=ds,T=0;T<_;T++)S=T%b-g,M=v-(T/b|0),x[T]=w=c?Math.abs(c==="y"?M:S):WD(S*S+M*M),w>R&&(R=w),w<B&&(B=w);r==="random"&&lz(x),x.max=R-B,x.min=B,x.v=_=(parseFloat(t.amount)||parseFloat(t.each)*(b>_?_-1:c?c==="y"?_/b:b:Math.max(b,_/b))||0)*(r==="edges"?-1:1),x.b=_<0?s-_:s,x.u=Di(t.amount||t.each)||0,i=i&&_<0?xz(i):i}return _=(x[p]-x.min)/x.max||0,ui(x.b+(i?i(_):_)*x.v)+x.u}},dM=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var r=ui(Math.round(parseFloat(i)/e)*e*t);return(r-r%1)/t+(ea(i)?0:Di(i))}},uz=function(e,t){var i=Ui(e),r,s;return!i&&_o(e)&&(r=i=e.radius||ds,e.values?(e=ps(e.values),(s=!ea(e[0]))&&(r*=r)):e=dM(e.increment)),gl(t,i?In(e)?function(o){return s=e(o),Math.abs(s-o)<=r?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),c=ds,u=0,d=e.length,p,m;d--;)s?(p=e[d].x-a,m=e[d].y-l,p=p*p+m*m):p=Math.abs(e[d]-a),p<c&&(c=p,u=d);return u=!r||c<=r?e[u]:o,s||u===o||ea(o)?u:u+Di(o)}:dM(e))},hz=function(e,t,i,r){return gl(Ui(e)?!t:i===!0?!!(i=0):!r,function(){return Ui(e)?e[~~(Math.random()*e.length)]:(i=i||1e-5)&&(r=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((e-i/2+Math.random()*(t-e+i*.99))/i)*i*r)/r})},pX=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(r){return t.reduce(function(s,o){return o(s)},r)}},mX=function(e,t){return function(i){return e(parseFloat(i))+(t||Di(i))}},gX=function(e,t,i){return dz(e,t,0,1,i)},fz=function(e,t,i){return gl(i,function(r){return e[~~t(r)]})},yX=function n(e,t,i){var r=t-e;return Ui(e)?fz(e,n(0,e.length),t):gl(i,function(s){return(r+(s-e)%r)%r+e})},_X=function n(e,t,i){var r=t-e,s=r*2;return Ui(e)?fz(e,n(0,e.length-1),t):gl(i,function(o){return o=(s+(o-e)%s)%s||0,e+(o>r?s-o:o)})},Sp=function(e){for(var t=0,i="",r,s,o,a;~(r=e.indexOf("random(",t));)o=e.indexOf(")",r),a=e.charAt(r+7)==="[",s=e.substr(r+7,o-r-7).match(a?YD:oM),i+=e.substr(t,r-t)+hz(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),t=o+1;return i+e.substr(t,e.length-t)},dz=function(e,t,i,r,s){var o=t-e,a=r-i;return gl(s,function(l){return i+((l-e)/o*a||0)})},xX=function n(e,t,i,r){var s=isNaN(e+t)?0:function(m){return(1-m)*e+m*t};if(!s){var o=mi(e),a={},l,c,u,d,p;if(i===!0&&(r=1)&&(i=null),o)e={p:e},t={p:t};else if(Ui(e)&&!Ui(t)){for(u=[],d=e.length,p=d-2,c=1;c<d;c++)u.push(n(e[c-1],e[c]));d--,s=function(y){y*=d;var _=Math.min(p,~~y);return u[_](y-_)},i=t}else r||(e=Ic(Ui(e)?[]:{},e));if(!u){for(l in t)Tw.call(a,e,l,"get",t[l]);s=function(y){return Pw(y,a)||(o?e.p:e)}}}return gl(i,s)},pb=function(e,t,i){var r=e.labels,s=ds,o,a,l;for(o in r)a=r[o]-t,a<0==!!i&&a&&s>(a=Math.abs(a))&&(l=o,s=a);return l},Lr=function(e,t,i){var r=e.vars,s=r[t],o=mn,a=e._ctx,l,c,u;if(s)return l=r[t+"Params"],c=r.callbackScope||e,i&&Za.length&&o_(),a&&(mn=a),u=l?s.apply(c,l):s.call(c),mn=o,u},pd=function(e){return sl(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Oi),e.progress()<1&&Lr(e,"onInterrupt"),e},dh,pz=[],mz=function(e){if(e)if(e=!e.name&&e.default||e,vw()||e.headless){var t=e.name,i=In(e),r=t&&!i&&e.init?function(){this._props=[]}:e,s={init:Ap,render:Pw,add:Tw,kill:zX,modifier:DX,rawVars:0},o={targetTest:0,get:0,getSetter:bw,aliases:{},register:0};if(jh(),e!==r){if(Cr[t])return;vs(r,vs(a_(e,s),o)),Ic(r.prototype,Ic(s,a_(e,o))),Cr[r.prop=t]=r,e.targetTest&&(Jg.push(r),Mw[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}ZD(t,r),e.register&&e.register(gr,r,pr)}else pz.push(e)},Qt=255,md={aqua:[0,Qt,Qt],lime:[0,Qt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Qt],navy:[0,0,128],white:[Qt,Qt,Qt],olive:[128,128,0],yellow:[Qt,Qt,0],orange:[Qt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Qt,0,0],pink:[Qt,192,203],cyan:[0,Qt,Qt],transparent:[Qt,Qt,Qt,0]},AA=function(e,t,i){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(i-t)*e*6:e<.5?i:e*3<2?t+(i-t)*(2/3-e)*6:t)*Qt+.5|0},gz=function(e,t,i){var r=e?ea(e)?[e>>16,e>>8&Qt,e&Qt]:0:md.black,s,o,a,l,c,u,d,p,m,y;if(!r){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),md[e])r=md[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+s+s+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&Qt,r&Qt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&Qt,e&Qt]}else if(e.substr(0,3)==="hsl"){if(r=y=e.match(oM),!t)l=+r[0]%360/360,c=+r[1]/100,u=+r[2]/100,o=u<=.5?u*(c+1):u+c-u*c,s=u*2-o,r.length>3&&(r[3]*=1),r[0]=AA(l+1/3,s,o),r[1]=AA(l,s,o),r[2]=AA(l-1/3,s,o);else if(~e.indexOf("="))return r=e.match(XD),i&&r.length<4&&(r[3]=1),r}else r=e.match(oM)||md.transparent;r=r.map(Number)}return t&&!y&&(s=r[0]/Qt,o=r[1]/Qt,a=r[2]/Qt,d=Math.max(s,o,a),p=Math.min(s,o,a),u=(d+p)/2,d===p?l=c=0:(m=d-p,c=u>.5?m/(2-d-p):m/(d+p),l=d===s?(o-a)/m+(o<a?6:0):d===o?(a-s)/m+2:(s-o)/m+4,l*=60),r[0]=~~(l+.5),r[1]=~~(c*100+.5),r[2]=~~(u*100+.5)),i&&r.length<4&&(r[3]=1),r},yz=function(e){var t=[],i=[],r=-1;return e.split(qa).forEach(function(s){var o=s.match(fh)||[];t.push.apply(t,o),i.push(r+=o.length+1)}),t.c=i,t},mb=function(e,t,i){var r="",s=(e+r).match(qa),o=t?"hsla(":"rgba(",a=0,l,c,u,d;if(!s)return e;if(s=s.map(function(p){return(p=gz(p,t,1))&&o+(t?p[0]+","+p[1]+"%,"+p[2]+"%,"+p[3]:p.join(","))+")"}),i&&(u=yz(e),l=i.c,l.join(r)!==u.c.join(r)))for(c=e.replace(qa,"1").split(fh),d=c.length-1;a<d;a++)r+=c[a]+(~l.indexOf(a)?s.shift()||o+"0,0,0,0)":(u.length?u:s.length?s:i).shift());if(!c)for(c=e.split(qa),d=c.length-1;a<d;a++)r+=c[a]+s[a];return r+c[d]},qa=function(){var n="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in md)n+="|"+e+"\\b";return new RegExp(n+")","gi")}(),vX=/hsl[a]?\(/,_z=function(e){var t=e.join(" "),i;if(qa.lastIndex=0,qa.test(t))return i=vX.test(t),e[1]=mb(e[1],i),e[0]=mb(e[0],i,yz(e[1])),!0},Mp,br=function(){var n=Date.now,e=500,t=33,i=n(),r=i,s=1e3/240,o=s,a=[],l,c,u,d,p,m,y=function _(x){var g=n()-r,v=x===!0,S,M,w,T;if((g>e||g<0)&&(i+=g-t),r+=g,w=r-i,S=w-o,(S>0||v)&&(T=++d.frame,p=w-d.time*1e3,d.time=w=w/1e3,o+=S+(S>=s?4:s-S),M=1),v||(l=c(_)),M)for(m=0;m<a.length;m++)a[m](w,p,T,x)};return d={time:0,frame:0,tick:function(){y(!0)},deltaRatio:function(x){return p/(1e3/(x||60))},wake:function(){KD&&(!aM&&vw()&&(no=aM=window,Aw=no.document||{},kr.gsap=gr,(no.gsapVersions||(no.gsapVersions=[])).push(gr.version),QD(s_||no.GreenSockGlobals||!no.gsap&&no||{}),pz.forEach(mz)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&d.sleep(),c=u||function(x){return setTimeout(x,o-d.time*1e3+1|0)},Mp=1,y(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),Mp=0,c=Ap},lagSmoothing:function(x,g){e=x||1/0,t=Math.min(g||33,e)},fps:function(x){s=1e3/(x||240),o=d.time*1e3+s},add:function(x,g,v){var S=g?function(M,w,T,R){x(M,w,T,R),d.remove(S)}:x;return d.remove(x),a[v?"unshift":"push"](S),jh(),S},remove:function(x,g){~(g=a.indexOf(x))&&a.splice(g,1)&&m>=g&&m--},_listeners:a},d}(),jh=function(){return!Mp&&br.wake()},It={},AX=/^[\d.\-M][\d.\-,\s]/,SX=/["']/g,MX=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),r=i[0],s=1,o=i.length,a,l,c;s<o;s++)l=i[s],a=s!==o-1?l.lastIndexOf(","):l.length,c=l.substr(0,a),t[r]=isNaN(c)?c.replace(SX,"").trim():+c,r=l.substr(a+1).trim();return t},EX=function(e){var t=e.indexOf("(")+1,i=e.indexOf(")"),r=e.indexOf("(",t);return e.substring(t,~r&&r<i?e.indexOf(")",i+1):i)},wX=function(e){var t=(e+"").split("("),i=It[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[MX(t[1])]:EX(e).split(",").map(tz)):It._CE&&AX.test(e)?It._CE("",e):i},xz=function(e){return function(t){return 1-e(1-t)}},vz=function n(e,t){for(var i=e._first,r;i;)i instanceof Yi?n(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?n(i.timeline,t):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=t)),i=i._next},gc=function(e,t){return e&&(In(e)?e:It[e]||wX(e))||t},Vc=function(e,t,i,r){i===void 0&&(i=function(l){return 1-t(1-l)}),r===void 0&&(r=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var s={easeIn:t,easeOut:i,easeInOut:r},o;return dr(e,function(a){It[a]=kr[a]=s,It[o=a.toLowerCase()]=i;for(var l in s)It[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=It[a+"."+l]=s[l]}),s},Az=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},SA=function n(e,t,i){var r=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),o=s/sM*(Math.asin(1/r)||0),a=function(u){return u===1?1:r*Math.pow(2,-10*u)*$j((u-o)*s)+1},l=e==="out"?a:e==="in"?function(c){return 1-a(1-c)}:Az(a);return s=sM/s,l.config=function(c,u){return n(e,c,u)},l},MA=function n(e,t){t===void 0&&(t=1.70158);var i=function(o){return o?--o*o*((t+1)*o+t)+1:0},r=e==="out"?i:e==="in"?function(s){return 1-i(1-s)}:Az(i);return r.config=function(s){return n(e,s)},r};dr("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;Vc(n+",Power"+(t-1),e?function(i){return Math.pow(i,t)}:function(i){return i},function(i){return 1-Math.pow(1-i,t)},function(i){return i<.5?Math.pow(i*2,t)/2:1-Math.pow((1-i)*2,t)/2})});It.Linear.easeNone=It.none=It.Linear.easeIn;Vc("Elastic",SA("in"),SA("out"),SA());(function(n,e){var t=1/e,i=2*t,r=2.5*t,s=function(a){return a<t?n*a*a:a<i?n*Math.pow(a-1.5/e,2)+.75:a<r?n*(a-=2.25/e)*a+.9375:n*Math.pow(a-2.625/e,2)+.984375};Vc("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);Vc("Expo",function(n){return n?Math.pow(2,10*(n-1)):0});Vc("Circ",function(n){return-(WD(1-n*n)-1)});Vc("Sine",function(n){return n===1?1:-qj(n*Qj)+1});Vc("Back",MA("in"),MA("out"),MA());It.SteppedEase=It.steps=kr.SteppedEase={config:function(e,t){e===void 0&&(e=1);var i=1/e,r=e+(t?0:1),s=t?1:0,o=1-on;return function(a){return((r*Zp(0,o,a)|0)+s)*i}}};Gh.ease=It["quad.out"];dr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(n){return Ew+=n+","+n+"Params,"});var Sz=function(e,t){this.id=Zj++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:$D,this.set=t?t.getSetter:bw},Ep=function(){function n(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Wh(this,+t.duration,1,1),this.data=t.data,mn&&(this._ctx=mn,mn.data.push(this)),Mp||br.wake()}var e=n.prototype;return e.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},e.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},e.totalDuration=function(i){return arguments.length?(this._dirty=0,Wh(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,r){if(jh(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(mx(this,i),!s._dp||s.parent||rz(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&so(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===on||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),ez(this,i,r)),this},e.time=function(i,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+fb(this))%(this._dur+this._rDelay)||(i?this._dur:0),r):this._time},e.totalProgress=function(i,r){return arguments.length?this.totalTime(this.totalDuration()*i,r):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(i,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+fb(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(i,r){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*s,r):this._repeat?Vh(this._tTime,s)+1:1},e.timeScale=function(i,r){if(!arguments.length)return this._rts===-on?0:this._rts;if(this._rts===i)return this;var s=this.parent&&this._ts?l_(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-on?0:this._rts,this.totalTime(Zp(-Math.abs(this._delay),this._tDur,s),r!==!1),px(this),oX(this)},e.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(jh(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==on&&(this._tTime-=on)))),this):this._ps},e.startTime=function(i){if(arguments.length){this._start=i;var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&so(r,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(fr(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(i){var r=this.parent||this._dp;return r?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?l_(r.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=nX);var r=Oi;return Oi=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),Oi=r,this},e.globalTime=function(i){for(var r=this,s=arguments.length?i:r.rawTime();r;)s=r._start+s/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(i):s},e.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,db(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var r=this._time;return this._rDelay=i,db(this),r?this.time(r):this}return this._rDelay},e.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},e.seek=function(i,r){return this.totalTime(ns(this,i),fr(r))},e.restart=function(i,r){return this.play().totalTime(i?-this._delay:0,fr(r))},e.play=function(i,r){return i!=null&&this.seek(i,r),this.reversed(!1).paused(!1)},e.reverse=function(i,r){return i!=null&&this.seek(i||this.totalDuration(),r),this.reversed(!0).paused(!1)},e.pause=function(i,r){return i!=null&&this.seek(i,r),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-on:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-on,this},e.isActive=function(){var i=this.parent||this._dp,r=this._start,s;return!!(!i||this._ts&&this._initted&&i.isActive()&&(s=i.rawTime(!0))>=r&&s<this.endTime(!0)-on)},e.eventCallback=function(i,r,s){var o=this.vars;return arguments.length>1?(r?(o[i]=r,s&&(o[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=r)):delete o[i],this):o[i]},e.then=function(i){var r=this;return new Promise(function(s){var o=In(i)?i:nz,a=function(){var c=r.then;r.then=null,In(o)&&(o=o(r))&&(o.then||o===r)&&(r.then=c),s(o),r.then=c};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?a():r._prom=a})},e.kill=function(){pd(this)},n}();vs(Ep.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-on,_prom:0,_ps:!1,_rts:1});var Yi=function(n){VD(e,n);function e(i,r){var s;return i===void 0&&(i={}),s=n.call(this,i)||this,s.labels={},s.smoothChildTiming=!!i.smoothChildTiming,s.autoRemoveChildren=!!i.autoRemoveChildren,s._sort=fr(i.sortChildren),An&&so(i.parent||An,zo(s),r),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&sz(zo(s),i.scrollTrigger),s}var t=e.prototype;return t.to=function(r,s,o){return Od(0,arguments,this),this},t.from=function(r,s,o){return Od(1,arguments,this),this},t.fromTo=function(r,s,o,a){return Od(2,arguments,this),this},t.set=function(r,s,o){return s.duration=0,s.parent=this,Fd(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Wn(r,s,ns(this,o),1),this},t.call=function(r,s,o){return so(this,Wn.delayedCall(0,r,s),o)},t.staggerTo=function(r,s,o,a,l,c,u){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=u,o.parent=this,new Wn(r,o,ns(this,l)),this},t.staggerFrom=function(r,s,o,a,l,c,u){return o.runBackwards=1,Fd(o).immediateRender=fr(o.immediateRender),this.staggerTo(r,s,o,a,l,c,u)},t.staggerFromTo=function(r,s,o,a,l,c,u,d){return a.startAt=o,Fd(a).immediateRender=fr(a.immediateRender),this.staggerTo(r,s,a,l,c,u,d)},t.render=function(r,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=r<=0?0:ui(r),d=this._zTime<0!=r<0&&(this._initted||!c),p,m,y,_,x,g,v,S,M,w,T,R;if(this!==An&&u>l&&r>=0&&(u=l),u!==this._tTime||o||d){if(a!==this._time&&c&&(u+=this._time-a,r+=this._time-a),p=u,M=this._start,S=this._ts,g=!S,d&&(c||(a=this._zTime),(r||!s)&&(this._zTime=r)),this._repeat){if(T=this._yoyo,x=c+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(x*100+r,s,o);if(p=ui(u%x),u===l?(_=this._repeat,p=c):(_=~~(u/x),_&&_===u/x&&(p=c,_--),p>c&&(p=c)),w=Vh(this._tTime,x),!a&&this._tTime&&w!==_&&this._tTime-w*x-this._dur<=0&&(w=_),T&&_&1&&(p=c-p,R=1),_!==w&&!this._lock){var B=T&&w&1,b=B===(T&&_&1);if(_<w&&(B=!B),a=B?0:u%c?c:u,this._lock=1,this.render(a||(R?0:ui(_*x)),s,!c)._lock=0,this._tTime=u,!s&&this.parent&&Lr(this,"onRepeat"),this.vars.repeatRefresh&&!R&&(this.invalidate()._lock=1),a&&a!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,b&&(this._lock=2,a=B?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!R&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;vz(this,R)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(v=uX(this,ui(a),ui(p)),v&&(u-=p-(p=v._start))),this._tTime=u,this._time=p,this._act=!S,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=r,a=0),!a&&p&&!s&&!_&&(Lr(this,"onStart"),this._tTime!==u))return this;if(p>=a&&r>=0)for(m=this._first;m;){if(y=m._next,(m._act||p>=m._start)&&m._ts&&v!==m){if(m.parent!==this)return this.render(r,s,o);if(m.render(m._ts>0?(p-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(p-m._start)*m._ts,s,o),p!==this._time||!this._ts&&!g){v=0,y&&(u+=this._zTime=-on);break}}m=y}else{m=this._last;for(var P=r<0?r:p;m;){if(y=m._prev,(m._act||P<=m._end)&&m._ts&&v!==m){if(m.parent!==this)return this.render(r,s,o);if(m.render(m._ts>0?(P-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(P-m._start)*m._ts,s,o||Oi&&(m._initted||m._startAt)),p!==this._time||!this._ts&&!g){v=0,y&&(u+=this._zTime=P?-on:on);break}}m=y}}if(v&&!s&&(this.pause(),v.render(p>=a?0:-on)._zTime=p>=a?1:-1,this._ts))return this._start=M,px(this),this.render(r,s,o);this._onUpdate&&!s&&Lr(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&a)&&(M===this._start||Math.abs(S)!==Math.abs(this._ts))&&(this._lock||((r||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&sl(this,1),!s&&!(r<0&&!a)&&(u||a||!l)&&(Lr(this,u===l&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(r,s){var o=this;if(ea(s)||(s=ns(this,s,r)),!(r instanceof Ep)){if(Ui(r))return r.forEach(function(a){return o.add(a,s)}),this;if(mi(r))return this.addLabel(r,s);if(In(r))r=Wn.delayedCall(0,r);else return this}return this!==r?so(this,r,s):this},t.getChildren=function(r,s,o,a){r===void 0&&(r=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-ds);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof Wn?s&&l.push(c):(o&&l.push(c),r&&l.push.apply(l,c.getChildren(!0,s,o)))),c=c._next;return l},t.getById=function(r){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===r)return s[o]},t.remove=function(r){return mi(r)?this.removeLabel(r):In(r)?this.killTweensOf(r):(dx(this,r),r===this._recent&&(this._recent=this._last),mc(this))},t.totalTime=function(r,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ui(br.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),n.prototype.totalTime.call(this,r,s),this._forcing=0,this):this._tTime},t.addLabel=function(r,s){return this.labels[r]=ns(this,s),this},t.removeLabel=function(r){return delete this.labels[r],this},t.addPause=function(r,s,o){var a=Wn.delayedCall(0,s||Ap,o);return a.data="isPause",this._hasPause=1,so(this,a,ns(this,r))},t.removePause=function(r){var s=this._first;for(r=ns(this,r);s;)s._start===r&&s.data==="isPause"&&sl(s),s=s._next},t.killTweensOf=function(r,s,o){for(var a=this.getTweensOf(r,o),l=a.length;l--;)Ua!==a[l]&&a[l].kill(r,s);return this},t.getTweensOf=function(r,s){for(var o=[],a=ps(r),l=this._first,c=ea(s),u;l;)l instanceof Wn?iX(l._targets,a)&&(c?(!Ua||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(u=l.getTweensOf(a,s)).length&&o.push.apply(o,u),l=l._next;return o},t.tweenTo=function(r,s){s=s||{};var o=this,a=ns(o,r),l=s,c=l.startAt,u=l.onStart,d=l.onStartParams,p=l.immediateRender,m,y=Wn.to(o,vs({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale())||on,onStart:function(){if(o.pause(),!m){var x=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());y._dur!==x&&Wh(y,x,0,1).render(y._time,!0,!0),m=1}u&&u.apply(y,d||[])}},s));return p?y.render(0):y},t.tweenFromTo=function(r,s,o){return this.tweenTo(s,vs({startAt:{time:ns(this,r)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(r){return r===void 0&&(r=this._time),pb(this,ns(this,r))},t.previousLabel=function(r){return r===void 0&&(r=this._time),pb(this,ns(this,r),1)},t.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+on)},t.shiftChildren=function(r,s,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,c;a;)a._start>=o&&(a._start+=r,a._end+=r),a=a._next;if(s)for(c in l)l[c]>=o&&(l[c]+=r);return mc(this)},t.invalidate=function(r){var s=this._first;for(this._lock=0;s;)s.invalidate(r),s=s._next;return n.prototype.invalidate.call(this,r)},t.clear=function(r){r===void 0&&(r=!0);for(var s=this._first,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),mc(this)},t.totalDuration=function(r){var s=0,o=this,a=o._last,l=ds,c,u,d;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-r:r));if(o._dirty){for(d=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,so(o,a,u-a._delay,1)._lock=0):l=u,u<0&&a._ts&&(s-=u,(!d&&!o._dp||d&&d.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=c;Wh(o,o===An&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(r){if(An._ts&&(ez(An,l_(r,An)),qD=br.frame),br.frame>=ub){ub+=Fr.autoSleep||120;var s=An._first;if((!s||!s._ts)&&Fr.autoSleep&&br._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||br.sleep()}}},e}(Ep);vs(Yi.prototype,{_lock:0,_hasPause:0,_forcing:0});var TX=function(e,t,i,r,s,o,a){var l=new pr(this._pt,e,t,0,1,Rz,null,s),c=0,u=0,d,p,m,y,_,x,g,v;for(l.b=i,l.e=r,i+="",r+="",(g=~r.indexOf("random("))&&(r=Sp(r)),o&&(v=[i,r],o(v,e,t),i=v[0],r=v[1]),p=i.match(xA)||[];d=xA.exec(r);)y=d[0],_=r.substring(c,d.index),m?m=(m+1)%5:_.substr(-5)==="rgba("&&(m=1),y!==p[u++]&&(x=parseFloat(p[u-1])||0,l._pt={_next:l._pt,p:_||u===1?_:",",s:x,c:y.charAt(1)==="="?Mh(x,y)-x:parseFloat(y)-x,m:m&&m<4?Math.round:0},c=xA.lastIndex);return l.c=c<r.length?r.substring(c,r.length):"",l.fp=a,(JD.test(r)||g)&&(l.e=0),this._pt=l,l},Tw=function(e,t,i,r,s,o,a,l,c,u){In(r)&&(r=r(s||0,e,o));var d=e[t],p=i!=="get"?i:In(d)?c?e[t.indexOf("set")||!In(e["get"+t.substr(3)])?t:"get"+t.substr(3)](c):e[t]():d,m=In(d)?c?BX:Tz:Rw,y;if(mi(r)&&(~r.indexOf("random(")&&(r=Sp(r)),r.charAt(1)==="="&&(y=Mh(p,r)+(Di(p)||0),(y||y===0)&&(r=y))),!u||p!==r||pM)return!isNaN(p*r)&&r!==""?(y=new pr(this._pt,e,t,+p||0,r-(p||0),typeof d=="boolean"?LX:Cz,0,m),c&&(y.fp=c),a&&y.modifier(a,this,e),this._pt=y):(!d&&!(t in e)&&Sw(t,r),TX.call(this,e,t,p,r,m,l||Fr.stringFilter,c))},CX=function(e,t,i,r,s){if(In(e)&&(e=Ud(e,s,t,i,r)),!_o(e)||e.style&&e.nodeType||Ui(e)||jD(e))return mi(e)?Ud(e,s,t,i,r):e;var o={},a;for(a in e)o[a]=Ud(e[a],s,t,i,r);return o},Mz=function(e,t,i,r,s,o){var a,l,c,u;if(Cr[e]&&(a=new Cr[e]).init(s,a.rawVars?t[e]:CX(t[e],r,s,o,i),i,r,o)!==!1&&(i._pt=l=new pr(i._pt,s,e,0,1,a.render,a,0,a.priority),i!==dh))for(c=i._ptLookup[i._targets.indexOf(s)],u=a._props.length;u--;)c[a._props[u]]=l;return a},Ua,pM,Cw=function n(e,t,i){var r=e.vars,s=r.ease,o=r.startAt,a=r.immediateRender,l=r.lazy,c=r.onUpdate,u=r.runBackwards,d=r.yoyoEase,p=r.keyframes,m=r.autoRevert,y=e._dur,_=e._startAt,x=e._targets,g=e.parent,v=g&&g.data==="nested"?g.vars.targets:x,S=e._overwrite==="auto"&&!_w,M=e.timeline,w,T,R,B,b,P,L,U,G,j,X,J,te;if(M&&(!p||!s)&&(s="none"),e._ease=gc(s,Gh.ease),e._yEase=d?xz(gc(d===!0?s:d,Gh.ease)):0,d&&e._yoyo&&!e._repeat&&(d=e._yEase,e._yEase=e._ease,e._ease=d),e._from=!M&&!!r.runBackwards,!M||p&&!r.stagger){if(U=x[0]?pc(x[0]).harness:0,J=U&&r[U.prop],w=a_(r,Mw),_&&(_._zTime<0&&_.progress(1),t<0&&u&&a&&!m?_.render(-1,!0):_.revert(u&&y?Xg:tX),_._lazy=0),o){if(sl(e._startAt=Wn.set(x,vs({data:"isStart",overwrite:!1,parent:g,immediateRender:!0,lazy:!_&&fr(l),startAt:null,delay:0,onUpdate:c&&function(){return Lr(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Oi||!a&&!m)&&e._startAt.revert(Xg),a&&y&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(u&&y&&!_){if(t&&(a=!1),R=vs({overwrite:!1,data:"isFromStart",lazy:a&&!_&&fr(l),immediateRender:a,stagger:0,parent:g},w),J&&(R[U.prop]=J),sl(e._startAt=Wn.set(x,R)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Oi?e._startAt.revert(Xg):e._startAt.render(-1,!0)),e._zTime=t,!a)n(e._startAt,on,on);else if(!t)return}for(e._pt=e._ptCache=0,l=y&&fr(l)||l&&!y,T=0;T<x.length;T++){if(b=x[T],L=b._gsap||ww(x)[T]._gsap,e._ptLookup[T]=j={},lM[L.id]&&Za.length&&o_(),X=v===x?T:v.indexOf(b),U&&(G=new U).init(b,J||w,e,X,v)!==!1&&(e._pt=B=new pr(e._pt,b,G.name,0,1,G.render,G,0,G.priority),G._props.forEach(function(k){j[k]=B}),G.priority&&(P=1)),!U||J)for(R in w)Cr[R]&&(G=Mz(R,w,e,X,b,v))?G.priority&&(P=1):j[R]=B=Tw.call(e,b,R,"get",w[R],X,v,0,r.stringFilter);e._op&&e._op[T]&&e.kill(b,e._op[T]),S&&e._pt&&(Ua=e,An.killTweensOf(b,j,e.globalTime(t)),te=!e.parent,Ua=0),e._pt&&l&&(lM[L.id]=1)}P&&bz(e),e._onInit&&e._onInit(e)}e._onUpdate=c,e._initted=(!e._op||e._pt)&&!te,p&&t<=0&&M.render(ds,!0,!0)},RX=function(e,t,i,r,s,o,a,l){var c=(e._pt&&e._ptCache||(e._ptCache={}))[t],u,d,p,m;if(!c)for(c=e._ptCache[t]=[],p=e._ptLookup,m=e._targets.length;m--;){if(u=p[m][t],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==t&&u.fp!==t;)u=u._next;if(!u)return pM=1,e.vars[t]="+=0",Cw(e,a),pM=0,l?vp(t+" not eligible for reset"):1;c.push(u)}for(m=c.length;m--;)d=c[m],u=d._pt||d,u.s=(r||r===0)&&!s?r:u.s+(r||0)+o*u.c,u.c=i-u.s,d.e&&(d.e=Fn(i)+Di(d.e)),d.b&&(d.b=u.s+Di(d.b))},bX=function(e,t){var i=e[0]?pc(e[0]).harness:0,r=i&&i.aliases,s,o,a,l;if(!r)return t;s=Ic({},t);for(o in r)if(o in s)for(l=r[o].split(","),a=l.length;a--;)s[l[a]]=s[o];return s},PX=function(e,t,i,r){var s=t.ease||r||"power1.inOut",o,a;if(Ui(t))a=i[e]||(i[e]=[]),t.forEach(function(l,c){return a.push({t:c/(t.length-1)*100,v:l,e:s})});else for(o in t)a=i[o]||(i[o]=[]),o==="ease"||a.push({t:parseFloat(e),v:t[o],e:s})},Ud=function(e,t,i,r,s){return In(e)?e.call(t,i,r,s):mi(e)&&~e.indexOf("random(")?Sp(e):e},Ez=Ew+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",wz={};dr(Ez+",id,stagger,delay,duration,paused,scrollTrigger",function(n){return wz[n]=1});var Wn=function(n){VD(e,n);function e(i,r,s,o){var a;typeof r=="number"&&(s.duration=r,r=s,s=null),a=n.call(this,o?r:Fd(r))||this;var l=a.vars,c=l.duration,u=l.delay,d=l.immediateRender,p=l.stagger,m=l.overwrite,y=l.keyframes,_=l.defaults,x=l.scrollTrigger,g=l.yoyoEase,v=r.parent||An,S=(Ui(i)||jD(i)?ea(i[0]):"length"in r)?[i]:ps(i),M,w,T,R,B,b,P,L;if(a._targets=S.length?ww(S):vp("GSAP target "+i+" not found. https://gsap.com",!Fr.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=m,y||p||Rg(c)||Rg(u)){if(r=a.vars,M=a.timeline=new Yi({data:"nested",defaults:_||{},targets:v&&v.data==="nested"?v.vars.targets:S}),M.kill(),M.parent=M._dp=zo(a),M._start=0,p||Rg(c)||Rg(u)){if(R=S.length,P=p&&cz(p),_o(p))for(B in p)~Ez.indexOf(B)&&(L||(L={}),L[B]=p[B]);for(w=0;w<R;w++)T=a_(r,wz),T.stagger=0,g&&(T.yoyoEase=g),L&&Ic(T,L),b=S[w],T.duration=+Ud(c,zo(a),w,b,S),T.delay=(+Ud(u,zo(a),w,b,S)||0)-a._delay,!p&&R===1&&T.delay&&(a._delay=u=T.delay,a._start+=u,T.delay=0),M.to(b,T,P?P(w,b,S):0),M._ease=It.none;M.duration()?c=u=0:a.timeline=0}else if(y){Fd(vs(M.vars.defaults,{ease:"none"})),M._ease=gc(y.ease||r.ease||"none");var U=0,G,j,X;if(Ui(y))y.forEach(function(J){return M.to(S,J,">")}),M.duration();else{T={};for(B in y)B==="ease"||B==="easeEach"||PX(B,y[B],T,y.easeEach);for(B in T)for(G=T[B].sort(function(J,te){return J.t-te.t}),U=0,w=0;w<G.length;w++)j=G[w],X={ease:j.e,duration:(j.t-(w?G[w-1].t:0))/100*c},X[B]=j.v,M.to(S,X,U),U+=X.duration;M.duration()<c&&M.to({},{duration:c-M.duration()})}}c||a.duration(c=M.duration())}else a.timeline=0;return m===!0&&!_w&&(Ua=zo(a),An.killTweensOf(S),Ua=0),so(v,zo(a),s),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(d||!c&&!y&&a._start===ui(v._time)&&fr(d)&&aX(zo(a))&&v.data!=="nested")&&(a._tTime=-on,a.render(Math.max(0,-u)||0)),x&&sz(zo(a),x),a}var t=e.prototype;return t.render=function(r,s,o){var a=this._time,l=this._tDur,c=this._dur,u=r<0,d=r>l-on&&!u?l:r<on?0:r,p,m,y,_,x,g,v,S,M;if(!c)cX(this,r,s,o);else if(d!==this._tTime||!r||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(p=d,S=this.timeline,this._repeat){if(_=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(_*100+r,s,o);if(p=ui(d%_),d===l?(y=this._repeat,p=c):(y=~~(d/_),y&&y===ui(d/_)&&(p=c,y--),p>c&&(p=c)),g=this._yoyo&&y&1,g&&(M=this._yEase,p=c-p),x=Vh(this._tTime,_),p===a&&!o&&this._initted&&y===x)return this._tTime=d,this;y!==x&&(S&&this._yEase&&vz(S,g),this.vars.repeatRefresh&&!g&&!this._lock&&this._time!==_&&this._initted&&(this._lock=o=1,this.render(ui(_*y),!0).invalidate()._lock=0))}if(!this._initted){if(oz(this,u?r:p,o,s,d))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&y!==x))return this;if(c!==this._dur)return this.render(r,s,o)}if(this._tTime=d,this._time=p,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=v=(M||this._ease)(p/c),this._from&&(this.ratio=v=1-v),p&&!a&&!s&&!y&&(Lr(this,"onStart"),this._tTime!==d))return this;for(m=this._pt;m;)m.r(v,m.d),m=m._next;S&&S.render(r<0?r:S._dur*S._ease(p/this._dur),s,o)||this._startAt&&(this._zTime=r),this._onUpdate&&!s&&(u&&cM(this,r,s,o),Lr(this,"onUpdate")),this._repeat&&y!==x&&this.vars.onRepeat&&!s&&this.parent&&Lr(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&cM(this,r,!0,!0),(r||!c)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&sl(this,1),!s&&!(u&&!a)&&(d||a||g)&&(Lr(this,d===l?"onComplete":"onReverseComplete",!0),this._prom&&!(d<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(r){return(!r||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(r),n.prototype.invalidate.call(this,r)},t.resetTo=function(r,s,o,a,l){Mp||br.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Cw(this,c),u=this._ease(c/this._dur),RX(this,r,s,o,a,u,c,l)?this.resetTo(r,s,o,a,1):(mx(this,0),this.parent||iz(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(r,s){if(s===void 0&&(s="all"),!r&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?pd(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(r,s,Ua&&Ua.vars.overwrite!==!0)._first||pd(this),this.parent&&o!==this.timeline.totalDuration()&&Wh(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=r?ps(r):a,c=this._ptLookup,u=this._pt,d,p,m,y,_,x,g;if((!s||s==="all")&&sX(a,l))return s==="all"&&(this._pt=0),pd(this);for(d=this._op=this._op||[],s!=="all"&&(mi(s)&&(_={},dr(s,function(v){return _[v]=1}),s=_),s=bX(a,s)),g=a.length;g--;)if(~l.indexOf(a[g])){p=c[g],s==="all"?(d[g]=s,y=p,m={}):(m=d[g]=d[g]||{},y=s);for(_ in y)x=p&&p[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&dx(this,x,"_pt"),delete p[_]),m!=="all"&&(m[_]=1)}return this._initted&&!this._pt&&u&&pd(this),this},e.to=function(r,s){return new e(r,s,arguments[2])},e.from=function(r,s){return Od(1,arguments)},e.delayedCall=function(r,s,o,a){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(r,s,o){return Od(2,arguments)},e.set=function(r,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new e(r,s)},e.killTweensOf=function(r,s,o){return An.killTweensOf(r,s,o)},e}(Ep);vs(Wn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});dr("staggerTo,staggerFrom,staggerFromTo",function(n){Wn[n]=function(){var e=new Yi,t=hM.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var Rw=function(e,t,i){return e[t]=i},Tz=function(e,t,i){return e[t](i)},BX=function(e,t,i,r){return e[t](r.fp,i)},IX=function(e,t,i){return e.setAttribute(t,i)},bw=function(e,t){return In(e[t])?Tz:xw(e[t])&&e.setAttribute?IX:Rw},Cz=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},LX=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Rz=function(e,t){var i=t._pt,r="";if(!e&&t.b)r=t.b;else if(e===1&&t.e)r=t.e;else{for(;i;)r=i.p+(i.m?i.m(i.s+i.c*e):Math.round((i.s+i.c*e)*1e4)/1e4)+r,i=i._next;r+=t.c}t.set(t.t,t.p,r,t)},Pw=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},DX=function(e,t,i,r){for(var s=this._pt,o;s;)o=s._next,s.p===r&&s.modifier(e,t,i),s=o},zX=function(e){for(var t=this._pt,i,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?dx(this,t,"_pt"):t.dep||(i=1),t=r;return!i},FX=function(e,t,i,r){r.mSet(e,t,r.m.call(r.tween,i,r.mt),r)},bz=function(e){for(var t=e._pt,i,r,s,o;t;){for(i=t._next,r=s;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:o)?t._prev._next=t:s=t,(t._next=r)?r._prev=t:o=t,t=i}e._pt=s},pr=function(){function n(t,i,r,s,o,a,l,c,u){this.t=i,this.s=s,this.c=o,this.p=r,this.r=a||Cz,this.d=l||this,this.set=c||Rw,this.pr=u||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(i,r,s){this.mSet=this.mSet||this.set,this.set=FX,this.m=i,this.mt=s,this.tween=r},n}();dr(Ew+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return Mw[n]=1});kr.TweenMax=kr.TweenLite=Wn;kr.TimelineLite=kr.TimelineMax=Yi;An=new Yi({sortChildren:!1,defaults:Gh,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Fr.stringFilter=_z;var yc=[],Yg={},OX=[],gb=0,UX=0,EA=function(e){return(Yg[e]||OX).map(function(t){return t()})},mM=function(){var e=Date.now(),t=[];e-gb>2&&(EA("matchMediaInit"),yc.forEach(function(i){var r=i.queries,s=i.conditions,o,a,l,c;for(a in r)o=no.matchMedia(r[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(i.revert(),l&&t.push(i))}),EA("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i,function(r){return i.add(null,r)})}),gb=e,EA("matchMedia"))},Pz=function(){function n(t,i){this.selector=i&&fM(i),this.data=[],this._r=[],this.isReverted=!1,this.id=UX++,t&&this.add(t)}var e=n.prototype;return e.add=function(i,r,s){In(i)&&(s=r,r=i,i=In);var o=this,a=function(){var c=mn,u=o.selector,d;return c&&c!==o&&c.data.push(o),s&&(o.selector=fM(s)),mn=o,d=r.apply(o,arguments),In(d)&&o._r.push(d),mn=c,o.selector=u,o.isReverted=!1,d};return o.last=a,i===In?a(o,function(l){return o.add(null,l)}):i?o[i]=a:a},e.ignore=function(i){var r=mn;mn=null,i(this),mn=r},e.getTweens=function(){var i=[];return this.data.forEach(function(r){return r instanceof n?i.push.apply(i,r.getTweens()):r instanceof Wn&&!(r.parent&&r.parent.data==="nested")&&i.push(r)}),i},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(i,r){var s=this;if(i?function(){for(var a=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,d){return d.g-u.g||-1/0}).forEach(function(u){return u.t.revert(i)}),l=s.data.length;l--;)c=s.data[l],c instanceof Yi?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Wn)&&c.revert&&c.revert(i);s._r.forEach(function(u){return u(i,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),r)for(var o=yc.length;o--;)yc[o].id===this.id&&yc.splice(o,1)},e.revert=function(i){this.kill(i||{})},n}(),NX=function(){function n(t){this.contexts=[],this.scope=t,mn&&mn.data.push(this)}var e=n.prototype;return e.add=function(i,r,s){_o(i)||(i={matches:i});var o=new Pz(0,s||this.scope),a=o.conditions={},l,c,u;mn&&!o.selector&&(o.selector=mn.selector),this.contexts.push(o),r=o.add("onMatch",r),o.queries=i;for(c in i)c==="all"?u=1:(l=no.matchMedia(i[c]),l&&(yc.indexOf(o)<0&&yc.push(o),(a[c]=l.matches)&&(u=1),l.addListener?l.addListener(mM):l.addEventListener("change",mM)));return u&&r(o,function(d){return o.add(null,d)}),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(r){return r.kill(i,!0)})},n}(),c_={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t.forEach(function(r){return mz(r)})},timeline:function(e){return new Yi(e)},getTweensOf:function(e,t){return An.getTweensOf(e,t)},getProperty:function(e,t,i,r){mi(e)&&(e=ps(e)[0]);var s=pc(e||{}).get,o=i?nz:tz;return i==="native"&&(i=""),e&&(t?o((Cr[t]&&Cr[t].get||s)(e,t,i,r)):function(a,l,c){return o((Cr[a]&&Cr[a].get||s)(e,a,l,c))})},quickSetter:function(e,t,i){if(e=ps(e),e.length>1){var r=e.map(function(u){return gr.quickSetter(u,t,i)}),s=r.length;return function(u){for(var d=s;d--;)r[d](u)}}e=e[0]||{};var o=Cr[t],a=pc(e),l=a.harness&&(a.harness.aliases||{})[t]||t,c=o?function(u){var d=new o;dh._pt=0,d.init(e,i?u+i:u,dh,0,[e]),d.render(1,d),dh._pt&&Pw(1,dh)}:a.set(e,l);return o?c:function(u){return c(e,l,i?u+i:u,a,1)}},quickTo:function(e,t,i){var r,s=gr.to(e,Ic((r={},r[t]="+=0.1",r.paused=!0,r),i||{})),o=function(l,c,u){return s.resetTo(t,l,c,u)};return o.tween=s,o},isTweening:function(e){return An.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=gc(e.ease,Gh.ease)),hb(Gh,e||{})},config:function(e){return hb(Fr,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,r=e.plugins,s=e.defaults,o=e.extendTimeline;(r||"").split(",").forEach(function(a){return a&&!Cr[a]&&!kr[a]&&vp(t+" effect requires "+a+" plugin.")}),vA[t]=function(a,l,c){return i(ps(a),vs(l||{},s),c)},o&&(Yi.prototype[t]=function(a,l,c){return this.add(vA[t](a,_o(l)?l:(c=l)&&{},this),c)})},registerEase:function(e,t){It[e]=gc(t)},parseEase:function(e,t){return arguments.length?gc(e,t):It},getById:function(e){return An.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new Yi(e),r,s;for(i.smoothChildTiming=fr(e.smoothChildTiming),An.remove(i),i._dp=0,i._time=i._tTime=An._time,r=An._first;r;)s=r._next,(t||!(!r._dur&&r instanceof Wn&&r.vars.onComplete===r._targets[0]))&&so(i,r,r._start-r._delay),r=s;return so(An,i,0),i},context:function(e,t){return e?new Pz(e,t):mn},matchMedia:function(e){return new NX(e)},matchMediaRefresh:function(){return yc.forEach(function(e){var t=e.conditions,i,r;for(r in t)t[r]&&(t[r]=!1,i=1);i&&e.revert()})||mM()},addEventListener:function(e,t){var i=Yg[e]||(Yg[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=Yg[e],r=i&&i.indexOf(t);r>=0&&i.splice(r,1)},utils:{wrap:yX,wrapYoyo:_X,distribute:cz,random:hz,snap:uz,normalize:gX,getUnit:Di,clamp:fX,splitColor:gz,toArray:ps,selector:fM,mapRange:dz,pipe:pX,unitize:mX,interpolate:xX,shuffle:lz},install:QD,effects:vA,ticker:br,updateRoot:Yi.updateRoot,plugins:Cr,globalTimeline:An,core:{PropTween:pr,globals:ZD,Tween:Wn,Timeline:Yi,Animation:Ep,getCache:pc,_removeLinkedListItem:dx,reverting:function(){return Oi},context:function(e){return e&&mn&&(mn.data.push(e),e._ctx=mn),mn},suppressOverwrites:function(e){return _w=e}}};dr("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return c_[n]=Wn[n]});br.add(Yi.updateRoot);dh=c_.to({},{duration:0});var kX=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},HX=function(e,t){var i=e._targets,r,s,o;for(r in t)for(s=i.length;s--;)o=e._ptLookup[s][r],o&&(o=o.d)&&(o._pt&&(o=kX(o,r)),o&&o.modifier&&o.modifier(t[r],e,i[s],r))},wA=function(e,t){return{name:e,rawVars:1,init:function(r,s,o){o._onInit=function(a){var l,c;if(mi(s)&&(l={},dr(s,function(u){return l[u]=1}),s=l),t){l={};for(c in s)l[c]=t(s[c]);s=l}HX(a,s)}}}},gr=c_.registerPlugin({name:"attr",init:function(e,t,i,r,s){var o,a,l;this.tween=i;for(o in t)l=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(l||0)+"",t[o],r,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(e,t){for(var i=t._pt;i;)Oi?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",init:function(e,t){for(var i=t.length;i--;)this.add(e,i,e[i]||0,t[i],0,0,0,0,0,1)}},wA("roundProps",dM),wA("modifiers"),wA("snap",uz))||c_;Wn.version=Yi.version=gr.version="3.12.5";KD=1;vw()&&jh();It.Power0;It.Power1;It.Power2;It.Power3;It.Power4;It.Linear;It.Quad;It.Cubic;It.Quart;It.Quint;It.Strong;It.Elastic;It.Back;It.SteppedEase;It.Bounce;It.Sine;It.Expo;It.Circ;/*! 4046 * CSSPlugin 3.12.5 4047 * https://gsap.com 4048 * 4049 * Copyright 2008-2024, GreenSock. All rights reserved. 4050 * Subject to the terms at https://gsap.com/standard-license or for 4051 * Club GSAP members, the agreement issued with that membership. 4052 * @author: Jack Doyle, [email protected] 4053*/var yb,Na,Eh,Bw,ac,_b,Iw,GX=function(){return typeof window<"u"},ta={},Yl=180/Math.PI,wh=Math.PI/180,ju=Math.atan2,xb=1e8,Lw=/([A-Z])/g,VX=/(left|right|width|margin|padding|x)/i,WX=/[\s,\(]\S/,ao={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},gM=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},jX=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},XX=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},JX=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},Bz=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Iz=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},YX=function(e,t,i){return e.style[t]=i},KX=function(e,t,i){return e.style.setProperty(t,i)},QX=function(e,t,i){return e._gsap[t]=i},ZX=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},qX=function(e,t,i,r,s){var o=e._gsap;o.scaleX=o.scaleY=i,o.renderTransform(s,o)},$X=function(e,t,i,r,s){var o=e._gsap;o[t]=i,o.renderTransform(s,o)},Mn="transform",mr=Mn+"Origin",eJ=function n(e,t){var i=this,r=this.target,s=r.style,o=r._gsap;
vendor: 4,414 bytes, line 4053
4053if(e in ta&&s){if(this.tfm=this.tfm||{},e!=="transform")e=ao[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return i.tfm[a]=Oo(r,a)}):this.tfm[e]=o.x?o[e]:Oo(r,e),e===mr&&(this.tfm.zOrigin=o.zOrigin);else return ao.transform.split(",").forEach(function(a){return n.call(i,a,t)});if(this.props.indexOf(Mn)>=0)return;o.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(mr,t,"")),e=Mn}(s||t)&&this.props.push(e,t,s[e])},Lz=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},tJ=function(){var e=this.props,t=this.target,i=t.style,r=t._gsap,s,o;for(s=0;s<e.length;s+=3)e[s+1]?t[e[s]]=e[s+2]:e[s+2]?i[e[s]]=e[s+2]:i.removeProperty(e[s].substr(0,2)==="--"?e[s]:e[s].replace(Lw,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)r[o]=this.tfm[o];r.svg&&(r.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),s=Iw(),(!s||!s.isStart)&&!i[Mn]&&(Lz(i),r.zOrigin&&i[mr]&&(i[mr]+=" "+r.zOrigin+"px",r.zOrigin=0,r.renderTransform()),r.uncache=1)}},Dz=function(e,t){var i={target:e,props:[],revert:tJ,save:eJ};return e._gsap||gr.core.getCache(e),t&&t.split(",").forEach(function(r){return i.save(r)}),i},zz,yM=function(e,t){var i=Na.createElementNS?Na.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Na.createElement(e);return i&&i.style?i:Na.createElement(e)},yo=function n(e,t,i){var r=getComputedStyle(e);return r[t]||r.getPropertyValue(t.replace(Lw,"-$1").toLowerCase())||r.getPropertyValue(t)||!i&&n(e,Xh(t)||t,1)||""},vb="O,Moz,ms,Ms,Webkit".split(","),Xh=function(e,t,i){var r=t||ac,s=r.style,o=5;if(e in s&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(vb[o]+e in s););return o<0?null:(o===3?"ms":o>=0?vb[o]:"")+e},_M=function(){GX()&&window.document&&(yb=window,Na=yb.document,Eh=Na.documentElement,ac=yM("div")||{style:{}},yM("div"),Mn=Xh(Mn),mr=Mn+"Origin",ac.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",zz=!!Xh("perspective"),Iw=gr.core.reverting,Bw=1)},TA=function n(e){var t=yM("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,r=this.nextSibling,s=this.style.cssText,o;if(Eh.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=n}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(r?i.insertBefore(this,r):i.appendChild(this)),Eh.removeChild(t),this.style.cssText=s,o},Ab=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},Fz=function(e){var t;try{t=e.getBBox()}catch{t=TA.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===TA||(t=TA.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+Ab(e,["x","cx","x1"])||0,y:+Ab(e,["y","cy","y1"])||0,width:0,height:0}:t},Oz=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Fz(e))},Lc=function(e,t){if(t){var i=e.style,r;t in ta&&t!==mr&&(t=Mn),i.removeProperty?(r=t.substr(0,2),(r==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(r==="--"?t:t.replace(Lw,"-$1").toLowerCase())):i.removeAttribute(t)}},ka=function(e,t,i,r,s,o){var a=new pr(e._pt,t,i,0,1,o?Iz:Bz);return e._pt=a,a.b=r,a.e=s,e._props.push(i),a},Sb={deg:1,rad:1,turn:1},nJ={grid:1,flex:1},ol=function n(e,t,i,r){var s=parseFloat(i)||0,o=(i+"").trim().substr((s+"").length)||"px",a=ac.style,l=VX.test(t),c=e.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),d=100,p=r==="px",m=r==="%",y,_,x,g;if(r===o||!s||Sb[r]||Sb[o])return s;if(o!=="px"&&!p&&(s=n(e,t,i,"px")),g=e.getCTM&&Oz(e),(m||o==="%")&&(ta[t]||~t.indexOf("adius")))return y=g?e.getBBox()[l?"width":"height"]:e[u],Fn(m?s/y*d:s/100*y);if(a[l?"width":"height"]=d+(p?o:r),_=~t.indexOf("adius")||r==="em"&&e.appendChild&&!c?e:e.parentNode,g&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Na||!_.appendChild)&&(_=Na.body),x=_._gsap,x&&m&&x.width&&l&&x.time===br.time&&!x.uncache)return Fn(s/x.width*d);if(m&&(t==="height"||t==="width")){var v=e.style[t];e.style[t]=d+r,y=e[u],v?e.style[t]=v:Lc(e,t)}else(m||o==="%")&&!nJ[yo(_,"display")]&&(a.position=yo(e,"position")),_===e&&(a.position="static"),_.appendChild(ac),y=ac[u],_.removeChild(ac),a.position="absolute";return l&&m&&(x=pc(_),x.time=br.time,x.width=_[u]),Fn(p?y*s/d:y&&s?d/y*s:0)},Oo=function(e,t,i,r){var s;return Bw||_M(),t in ao&&t!=="transform"&&(t=ao[t],~t.indexOf(",")&&(t=t.
vendor: 13,975 bytes, line 4053
4053split(",")[0])),ta[t]&&t!=="transform"?(s=Tp(e,r),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:h_(yo(e,mr))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||r||~(s+"").indexOf("calc("))&&(s=u_[t]&&u_[t](e,t,i)||yo(e,t)||$D(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?ol(e,t,s,i)+i:s},iJ=function(e,t,i,r){if(!i||i==="none"){var s=Xh(t,e,1),o=s&&yo(e,s,1);o&&o!==i?(t=s,i=o):t==="borderColor"&&(i=yo(e,"borderTopColor"))}var a=new pr(this._pt,e.style,t,0,1,Rz),l=0,c=0,u,d,p,m,y,_,x,g,v,S,M,w;if(a.b=i,a.e=r,i+="",r+="",r==="auto"&&(_=e.style[t],e.style[t]=r,r=yo(e,t)||r,_?e.style[t]=_:Lc(e,t)),u=[i,r],_z(u),i=u[0],r=u[1],p=i.match(fh)||[],w=r.match(fh)||[],w.length){for(;d=fh.exec(r);)x=d[0],v=r.substring(l,d.index),y?y=(y+1)%5:(v.substr(-5)==="rgba("||v.substr(-5)==="hsla(")&&(y=1),x!==(_=p[c++]||"")&&(m=parseFloat(_)||0,M=_.substr((m+"").length),x.charAt(1)==="="&&(x=Mh(m,x)+M),g=parseFloat(x),S=x.substr((g+"").length),l=fh.lastIndex-S.length,S||(S=S||Fr.units[t]||M,l===r.length&&(r+=S,a.e+=S)),M!==S&&(m=ol(e,t,_,S)||0),a._pt={_next:a._pt,p:v||c===1?v:",",s:m,c:g-m,m:y&&y<4||t==="zIndex"?Math.round:0});a.c=l<r.length?r.substring(l,r.length):""}else a.r=t==="display"&&r==="none"?Iz:Bz;return JD.test(r)&&(a.e=0),this._pt=a,a},Mb={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},rJ=function(e){var t=e.split(" "),i=t[0],r=t[1]||"50%";return(i==="top"||i==="bottom"||r==="left"||r==="right")&&(e=i,i=r,r=e),t[0]=Mb[i]||i,t[1]=Mb[r]||r,t.join(" ")},sJ=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var i=t.t,r=i.style,s=t.u,o=i._gsap,a,l,c;if(s==="all"||s===!0)r.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)a=s[c],ta[a]&&(l=1,a=a==="transformOrigin"?mr:Mn),Lc(i,a);l&&(Lc(i,Mn),o&&(o.svg&&i.removeAttribute("transform"),Tp(i,1),o.uncache=1,Lz(r)))}},u_={clearProps:function(e,t,i,r,s){if(s.data!=="isFromStart"){var o=e._pt=new pr(e._pt,t,i,0,0,sJ);return o.u=r,o.pr=-10,o.tween=s,e._props.push(i),1}}},wp=[1,0,0,1,0,0],Uz={},Nz=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Eb=function(e){var t=yo(e,Mn);return Nz(t)?wp:t.substr(7).match(XD).map(Fn)},Dw=function(e,t){var i=e._gsap||pc(e),r=e.style,s=Eb(e),o,a,l,c;return i.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?wp:s):(s===wp&&!e.offsetParent&&e!==Eh&&!i.svg&&(l=r.display,r.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(c=1,a=e.nextElementSibling,Eh.appendChild(e)),s=Eb(e),l?r.display=l:Lc(e,"display"),c&&(a?o.insertBefore(e,a):o?o.appendChild(e):Eh.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},xM=function(e,t,i,r,s,o){var a=e._gsap,l=s||Dw(e,!0),c=a.xOrigin||0,u=a.yOrigin||0,d=a.xOffset||0,p=a.yOffset||0,m=l[0],y=l[1],_=l[2],x=l[3],g=l[4],v=l[5],S=t.split(" "),M=parseFloat(S[0])||0,w=parseFloat(S[1])||0,T,R,B,b;i?l!==wp&&(R=m*x-y*_)&&(B=M*(x/R)+w*(-_/R)+(_*v-x*g)/R,b=M*(-y/R)+w*(m/R)-(m*v-y*g)/R,M=B,w=b):(T=Fz(e),M=T.x+(~S[0].indexOf("%")?M/100*T.width:M),w=T.y+(~(S[1]||S[0]).indexOf("%")?w/100*T.height:w)),r||r!==!1&&a.smooth?(g=M-c,v=w-u,a.xOffset=d+(g*m+v*_)-g,a.yOffset=p+(g*y+v*x)-v):a.xOffset=a.yOffset=0,a.xOrigin=M,a.yOrigin=w,a.smooth=!!r,a.origin=t,a.originIsAbsolute=!!i,e.style[mr]="0px 0px",o&&(ka(o,a,"xOrigin",c,M),ka(o,a,"yOrigin",u,w),ka(o,a,"xOffset",d,a.xOffset),ka(o,a,"yOffset",p,a.yOffset)),e.setAttribute("data-svg-origin",M+" "+w)},Tp=function(e,t){var i=e._gsap||new Sz(e);if("x"in i&&!t&&!i.uncache)return i;var r=e.style,s=i.scaleX<0,o="px",a="deg",l=getComputedStyle(e),c=yo(e,mr)||"0",u,d,p,m,y,_,x,g,v,S,M,w,T,R,B,b,P,L,U,G,j,X,J,te,k,Q,$,oe,xe,De,ne,fe;return u=d=p=_=x=g=v=S=M=0,m=y=1,i.svg=!!(e.getCTM&&Oz(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(r[Mn]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Mn]!=="none"?l[Mn]:"")),r.scale=r.rotate=r.translate="none"),R=Dw(e,i.svg),i.svg&&(i.uncache?(k=e.getBBox(),c=i.xOrigin-k.x+"px "+(i.yOrigin-k.y)+"px",te=""):te=!t&&e.getAttribute("data-svg-origin"),xM(e,te||c,!!te||i.originIsAbsolute,i.smooth!==!1,R)),w=i.xOrigin||0,T=i.yOrigin||0,R!==wp&&(L=R[0],U=R[1],G=R[2],j=R[3],u=X=R[4],d=J=R[5],R.length===6?(m=Math.sqrt(L*L+U*U),y=Math.sqrt(j*j+G*G),_=L||U?ju(U,L)*Yl:0,v=G||j?ju(G,j)*Yl+_:0,v&&(y*=Math.abs(Math.cos(v*wh))),i.svg&&(u-=w-(w*L+T*G),d-=T-(w*U+T*j))):(fe=R[6],De=R[7],$=R[8],oe=R[9],xe=R[10],ne=R[11],u=R[12],d=R[13],p=R[14],B=ju(fe,xe),x=B*Yl,B&&(b=Math.cos(-B),P=Math.sin(-B),te=X*b+$*P,k=J*b+oe*P,Q=fe*b+xe*P,$=X*-P+$*b,oe=J*-P+oe*b,xe=fe*-P+xe*b,ne=De*-P+ne*b,X=te,J=k,fe=Q),B=ju(-G,xe),g=B*Yl,B&&(b=Math.cos(-B),P=Math.sin(-B),te=L*b-$*P,k=U*b-oe*P,Q=G*b-xe*P,ne=j*P+ne*b,L=te,U=k,G=Q),B=ju(U,L),_=B*Yl,B&&(b=Math.cos(B),P=Math.sin(B),te=L*b+U*P,k=X*b+J*P,U=U*b-L*P,J=J*b-X*P,L=te,X=k),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,g=180-g),m=Fn(Math.sqrt(L*L+U*U+G*G)),y=Fn(Math.sqrt(J*J+fe*fe)),B=ju(X,J),v=Math.abs(B)>2e-4?B*Yl:0,M=ne?1/(ne<0?-ne:ne):0),i.svg&&(te=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!Nz(yo(e,Mn)),te&&e.setAttribute("transform",te))),Math.abs(v)>90&&Math.abs(v)<270&&(s?(m*=-1,v+=_<=0?180:-180,_+=_<=0?180:-180):(y*=-1,v+=v<=0?180:-180)),t=t||i.uncache,i.x=u-((i.xPercent=u&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-u)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+o,i.y=d-((i.yPercent=d&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-d)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+o,i.z=p+o,i.scaleX=Fn(m),i.scaleY=Fn(y),i.rotation=Fn(_)+a,i.rotationX=Fn(x)+a,i.rotationY=Fn(g)+a,i.skewX=v+a,i.skewY=S+a,i.transformPerspective=M+o,(i.zOrigin=parseFloat(c.split(" ")[2])||!t&&i.zOrigin||0)&&(r[mr]=h_(c)),i.xOffset=i.yOffset=0,i.force3D=Fr.force3D,i.renderTransform=i.svg?aJ:zz?kz:oJ,i.uncache=0,i},h_=function(e){return(e=e.split(" "))[0]+" "+e[1]},CA=function(e,t,i){var r=Di(t);return Fn(parseFloat(t)+parseFloat(ol(e,"x",i+"px",r)))+r},oJ=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,kz(e,t)},Gl="0deg",sd="0px",Vl=") ",kz=function(e,t){var i=t||this,r=i.xPercent,s=i.yPercent,o=i.x,a=i.y,l=i.z,c=i.rotation,u=i.rotationY,d=i.rotationX,p=i.skewX,m=i.skewY,y=i.scaleX,_=i.scaleY,x=i.transformPerspective,g=i.force3D,v=i.target,S=i.zOrigin,M="",w=g==="auto"&&e&&e!==1||g===!0;if(S&&(d!==Gl||u!==Gl)){var T=parseFloat(u)*wh,R=Math.sin(T),B=Math.cos(T),b;T=parseFloat(d)*wh,b=Math.cos(T),o=CA(v,o,R*b*-S),a=CA(v,a,-Math.sin(T)*-S),l=CA(v,l,B*b*-S+S)}x!==sd&&(M+="perspective("+x+Vl),(r||s)&&(M+="translate("+r+"%, "+s+"%) "),(w||o!==sd||a!==sd||l!==sd)&&(M+=l!==sd||w?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+Vl),c!==Gl&&(M+="rotate("+c+Vl),u!==Gl&&(M+="rotateY("+u+Vl),d!==Gl&&(M+="rotateX("+d+Vl),(p!==Gl||m!==Gl)&&(M+="skew("+p+", "+m+Vl),(y!==1||_!==1)&&(M+="scale("+y+", "+_+Vl),v.style[Mn]=M||"translate(0, 0)"},aJ=function(e,t){var i=t||this,r=i.xPercent,s=i.yPercent,o=i.x,a=i.y,l=i.rotation,c=i.skewX,u=i.skewY,d=i.scaleX,p=i.scaleY,m=i.target,y=i.xOrigin,_=i.yOrigin,x=i.xOffset,g=i.yOffset,v=i.forceCSS,S=parseFloat(o),M=parseFloat(a),w,T,R,B,b;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=wh,c*=wh,w=Math.cos(l)*d,T=Math.sin(l)*d,R=Math.sin(l-c)*-p,B=Math.cos(l-c)*p,c&&(u*=wh,b=Math.tan(c-u),b=Math.sqrt(1+b*b),R*=b,B*=b,u&&(b=Math.tan(u),b=Math.sqrt(1+b*b),w*=b,T*=b)),w=Fn(w),T=Fn(T),R=Fn(R),B=Fn(B)):(w=d,B=p,T=R=0),(S&&!~(o+"").indexOf("px")||M&&!~(a+"").indexOf("px"))&&(S=ol(m,"x",o,"px"),M=ol(m,"y",a,"px")),(y||_||x||g)&&(S=Fn(S+y-(y*w+_*R)+x),M=Fn(M+_-(y*T+_*B)+g)),(r||s)&&(b=m.getBBox(),S=Fn(S+r/100*b.width),M=Fn(M+s/100*b.height)),b="matrix("+w+","+T+","+R+","+B+","+S+","+M+")",m.setAttribute("transform",b),v&&(m.style[Mn]=b)},lJ=function(e,t,i,r,s){var o=360,a=mi(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?Yl:1),c=l-r,u=r+c+"deg",d,p;return a&&(d=s.split("_")[1],d==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),d==="cw"&&c<0?c=(c+o*xb)%o-~~(c/o)*o:d==="ccw"&&c>0&&(c=(c-o*xb)%o-~~(c/o)*o)),e._pt=p=new pr(e._pt,t,i,r,c,jX),p.e=u,p.u="deg",e._props.push(i),p},wb=function(e,t){for(var i in t)e[i]=t[i];return e},cJ=function(e,t,i){var r=wb({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,l,c,u,d,p,m,y;r.svg?(c=i.getAttribute("transform"),i.setAttribute("transform",""),o[Mn]=t,a=Tp(i,1),Lc(i,Mn),i.setAttribute("transform",c)):(c=getComputedStyle(i)[Mn],o[Mn]=t,a=Tp(i,1),o[Mn]=c);for(l in ta)c=r[l],u=a[l],c!==u&&s.indexOf(l)<0&&(m=Di(c),y=Di(u),d=m!==y?ol(i,l,c,y):parseFloat(c),p=parseFloat(u),e._pt=new pr(e._pt,a,l,d,p-d,gM),e._pt.u=y||0,e._props.push(l));wb(a,r)};dr("padding,margin,Width,Radius",function(n,e){var t="Top",i="Right",r="Bottom",s="Left",o=(e<3?[t,i,r,s]:[t+s,t+i,r+i,r+s]).map(function(a){return e<2?n+a:"border"+a+n});u_[e>1?"border"+n:n]=function(a,l,c,u,d){var p,m;if(arguments.length<4)return p=o.map(function(y){return Oo(a,y,c)}),m=p.join(" "),m.split(p[0]).length===5?p[0]:m;p=(u+"").split(" "),m={},o.forEach(function(y,_){return m[y]=p[_]=p[_]||p[(_-1)/2|0]}),a.init(l,m,d)}});var Hz={name:"css",register:_M,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,r,s){var o=this._props,a=e.style,l=i.vars.startAt,c,u,d,p,m,y,_,x,g,v,S,M,w,T,R,B;Bw||_M(),this.styles=this.styles||Dz(e),B=this.styles.props,this.tween=i;for(_ in t)if(_!=="autoRound"&&(u=t[_],!(Cr[_]&&Mz(_,t,i,r,e,s)))){if(m=typeof u,y=u_[_],m==="function"&&(u=u.call(i,r,e,s),m=typeof u),m==="string"&&~u.indexOf("random(")&&(u=Sp(u)),y)y(this,e,_,u,i)&&(R=1);else if(_.substr(0,2)==="--")c=(getComputedStyle(e).getPropertyValue(_)+"").trim(),u+="",qa.lastIndex=0,qa.test(c)||(x=Di(c),g=Di(u)),g?x!==g&&(c=ol(e,_,c,g)+g):x&&(u+=x),this.add(a,"setProperty",c,u,r,s,0,0,_),o.push(_),B.push(_,0,a[_]);else if(m!=="undefined"){if(l&&_ in l?(c=typeof l[_]=="function"?l[_].call(i,r,e,s):l[_],mi(c)&&~c.indexOf("random(")&&(c=Sp(c)),Di(c+"")||c==="auto"||(c+=Fr.units[_]||Di(Oo(e,_))||""),(c+"").charAt(1)==="="&&(c=Oo(e,_))):c=Oo(e,_),p=parseFloat(c),v=m==="string"&&u.charAt(1)==="="&&u.substr(0,2),v&&(u=u.substr(2)),d=parseFloat(u),_ in ao&&(_==="autoAlpha"&&(p===1&&Oo(e,"visibility")==="hidden"&&d&&(p=0),B.push("visibility",0,a.visibility),ka(this,a,"visibility",p?"inherit":"hidden",d?"inherit":"hidden",!d)),_!=="scale"&&_!=="transform"&&(_=ao[_],~_.indexOf(",")&&(_=_.split(",")[0]))),S=_ in ta,S){if(this.styles.save(_),M||(w=e._gsap,w.renderTransform&&!t.parseTransform||Tp(e,t.parseTransform),T=t.smoothOrigin!==!1&&w.smooth,M=this._pt=new pr(this._pt,a,Mn,0,1,w.renderTransform,w,0,-1),M.dep=1),_==="scale")this._pt=new pr(this._pt,w,"scaleY",w.scaleY,(v?Mh(w.scaleY,v+d):d)-w.scaleY||0,gM),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){B.push(mr,0,a[mr]),u=rJ(u),w.svg?xM(e,u,0,T,0,this):(g=parseFloat(u.split(" ")[2])||0,g!==w.zOrigin&&ka(this,w,"zOrigin",w.zOrigin,g),ka(this,a,_,h_(c),h_(u)));continue}else if(_==="svgOrigin"){xM(e,u,1,T,0,this);continue}else if(_ in Uz){lJ(this,w,_,p,v?Mh(p,v+u):u);continue}else if(_==="smoothOrigin"){ka(this,w,"smooth",w.smooth,u);continue}else if(_==="force3D"){w[_]=u;continue}else if(_==="transform"){cJ(this,u,e);continue}}else _ in a||(_=Xh(_)||_);if(S||(d||d===0)&&(p||p===0)&&!WX.test(u)&&_ in a)x=(c+"").substr((p+"").length),d||(d=0),g=Di(u)||(_ in Fr.units?Fr.units[_]:x),x!==g&&(p=ol(e,_,c,g)),this._pt=new pr(this._pt,S?w:a,_,p,(v?Mh(p,v+d):d)-p,!S&&(g==="px"||_==="zIndex")&&t.autoRound!==!1?JX:gM),this._pt.u=g||0,x!==g&&g!=="%"&&(this._pt.b=c,this._pt.r=XX);else if(_ in a)iJ.call(this,e,_,c,v?v+u:u);else if(_ in e)this.add(e,_,c||e[_],v?v+u:u,r,s);else if(_!=="parseTransform"){Sw(_,u);continue}S||(_ in a?B.push(_,0,a[_]):B.push(_,1,c||e[_])),o.push(_)}}R&&bz(this)},render:function(e,t){if(t.tween._time||!Iw())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:Oo,aliases:ao,getSetter:function(e,t,i){var r=ao[t];return r&&r.indexOf(",")<0&&(t=r),t in ta&&t!==mr&&(e._gsap.x||Oo(e,"x"))?i&&_b===i?t==="scale"?ZX:QX:(_b=i||{})&&(t==="scale"?qX:$X):e.style&&!xw(e.style[t])?YX:~t.indexOf("-")?KX:bw(e,t)},core:{_removeProperty:Lc,_getMatrix:Dw}};gr.utils.checkPrefix=Xh;gr.core.getStyleSaver=Dz;(function(n,e,t,i){var r=dr(n+","+e+","+t,function(s){ta[s]=1});dr(e,function(s){Fr.units[s]="deg",Uz[s]=1}),ao[r[13]]=n+","+e,dr(i,function(s){var o=s.split(":");ao[o[1]]=r[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");dr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){Fr.units[n]="px"});gr.registerPlugin(Hz);var mt=gr.registerPlugin(Hz)||gr;mt.core.Tween;const uJ=()=>{const[n,e]=H.useState(!0),t=H.useCallback(()=>{e(document.visibilityState==="visible")},[]);return H.useEffect(()=>(document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}),[]),n},qp=H.createContext(),hJ=({children:n})=>{const[e,t]=H.useState(!1),[i,r]=H.useState(!1),s=uJ(),o=H.useRef(null),a=H.useRef(null),l=H.useRef(null);H.useEffect(()=>{const _=new Audio("/sounds/music.mp3"),x=new Audio("/sounds/transi.mp3"),g=new Audio("/sounds/btn.mp3");return _.loop=!0,_.volume=0,x.volume=0,g.volume=0,o.current=_,a.current=x,l.current=g,()=>{_.pause(),o.current=null,x.pause(),a.current=null,g.pause(),l.current=null}},[]),H.useEffect(()=>{if(!s){const _=o.current;t(!1),_.pause()}},[s]);const c=()=>{const _=o.current;e||(_.volume=0,_.play(),r(!0),t(!0),mt.to(_,{volume:.3,duration:1.2}),r(!1))},u=()=>{if(e){const _=a.current;_.volume=0,_.play(),mt.to(_,{volume:.34,duration:1})}},d=()=>{const _=a.current;_.volume=0,_.play(),mt.to(_,{volume:.4,duration:1,delay:1.6})},p=()=>
4053{if(e){const _=l.current;_.volume=0,_.play(),mt.to(_,{volume:.5,duration:0})}},m=()=>{const _=o.current;e&&!i&&(t(!1),r(!0),mt.to(_,{volume:0,duration:1,onComplete:()=>{_.pause(),_.currentTime=0,r(!1)}}))},y=_=>{const x=o.current;mt.to(x,{volume:_,duration:1})};return F.jsx(qp.Provider,{value:{isPlaying:e,playMusic:c,stopMusic:m,changeVolume:y,playTransi:u,playBtn:p,playStart:d},children:n})};function fJ(){const n=yw(),{playMusic:e,playStart:t}=H.useContext(qp),i=()=>{document.querySelector(".home_title_computer").classList.add("disappear"),document.querySelector(".home_title_mobile").classList.add("disappear"),document.querySelector(".home_description").classList.add("hidden"),document.querySelector(".home_img").classList.add("hidden"),document.querySelector(".home_button").classList.add("hidden"),document.querySelector(".home_logo").classList.add("hidden"),document.querySelector(".home_credits_mobile").classList.add("hidden"),document.querySelector(".home_credits_computer").classList.add("hidden"),t(),e(),setTimeout(()=>{n("/about")},1650)};return F.jsxs("div",{className:"home",children:[F.jsxs("div",{className:"home_logo",children:[F.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 210 96.6",children:[F.jsxs("defs",{children:[F.jsxs("linearGradient",{id:"Dégradé_sans_nom",x1:"63.34",y1:"-395.46",x2:"170.04",y2:"-502.06",gradientTransform:"matrix(1, 0, 0, -1, 0, -406)",gradientUnits:"userSpaceOnUse",children:[F.jsx("stop",{offset:"0",stopColor:"#1f4294"}),F.jsx("stop",{offset:"0.4",stopColor:"#246ea2"}),F.jsx("stop",{offset:"0.6",stopColor:"#2995ae"}),F.jsx("stop",{offset:"0.8",stopColor:"#2badb6"}),F.jsx("stop",{offset:"0.9",stopColor:"#2db6b9"})]}),F.jsx("linearGradient",{id:"Dégradé_sans_nom_2",x1:"38.3",y1:"-420.6",x2:"144.9",y2:"-527.2"}),F.jsx("linearGradient",{id:"Dégradé_sans_nom_3",x1:"64.7",y1:"-394.3",x2:"171.3",y2:"-500.9"}),F.jsx("linearGradient",{id:"Dégradé_sans_nom_4",x1:"36.17",y1:"-422.72",x2:"142.78",y2:"-529.33"}),F.jsx("linearGradient",{id:"Dégradé_sans_nom_5",x1:"-7.1",y1:"-466.1",x2:"99.6",y2:"-572.6"}),F.jsx("linearGradient",{id:"Dégradé_sans_nom_6",x1:"6.99",y1:"-451.91",x2:"113.59",y2:"-558.51"}),F.jsx("linearGradient",{id:"Dégradé_sans_nom_7",x1:"13.48",y1:"-445.42",x2:"120.08",y2:"-552.02"}),F.jsx("linearGradient",{id:"Dégradé_sans_nom_8",x1:"22.69",y1:"-436.31",x2:"129.29",y2:"-542.91"})]}),F.jsx("path",{className:"cls-1",d:"M92.4,96.2V79.4h3l5.3,11.2,5.2-11.2h3V96.2h-2.5V84l-4.7,10h-2L95,84V96.2Z"}),F.jsx("path",{className:"cls-1",d:"M123.3,86.8a5.56,5.56,0,0,0-2.2-2.1A6.41,6.41,0,0,0,118,84a6.48,6.48,0,0,0-3.1.8,6.32,6.32,0,0,0-2.2,2.1,7.19,7.19,0,0,0,0,6.6,5.81,5.81,0,0,0,2.2,2.2,6.23,6.23,0,0,0,3.1.8l-.2-.2a6.66,6.66,0,0,0,3.3-.8,5.81,5.81,0,0,0,2.2-2.2,6.29,6.29,0,0,0,.8-3.2A5.79,5.79,0,0,0,123.3,86.8Zm-2.1,5.5a3.17,3.17,0,0,1-1.3,1.5,4.13,4.13,0,0,1-1.85.5,3.48,3.48,0,0,1-1.75-.5,3.58,3.58,0,0,1-1.3-1.4,5.09,5.09,0,0,1-.5-2.2,4.74,4.74,0,0,1,.4-2.1,4.15,4.15,0,0,1,1.2-1.4,3.84,3.84,0,0,1,3.8,0,3,3,0,0,1,1.3,1.4A4.64,4.64,0,0,1,121.2,92.3Z"}),F.jsx("path",{className:"cls-1",d:"M127,96.2V84.3h2.4v1.8a3.55,3.55,0,0,1,1.7-1.5,4.71,4.71,0,0,1,7,4.7v7h-2.5V89.6a3.72,3.72,0,0,0-.7-2.5,2.67,2.67,0,0,0-2.2-.9,2.78,2.78,0,0,0-2.3,1,3.66,3.66,0,0,0-.9,2.7v6.4H127Z"}),F.jsx("path",{className:"cls-1",d:"M145.7,96.2a3.66,3.66,0,0,1-2.7-.9,3.8,3.8,0,0,1-1-2.8V86.4h-1.8V84.3H142V81.4h2.5v2.9h3v2.1h-3v6.1c0,.6.1,1,.4,1.2a2.27,2.27,0,0,0,1.3.3h1.3v2.2Z"}),F.jsx("path",{className:"cls-1",d:"M162.2,89.6a3.24,3.24,0,0,0-1.1-1.5,4.65,4.65,0,0,0-1.7-.9,3.78,3.78,0,0,0,1.8-1.3,3,3,0,0,0,.7-2.3,3.9,3.9,0,0,0-1.4-3,5.67,5.67,0,0,0-3.9-1.2h-6.1V96.2h6.7a6.74,6.74,0,0,0,3-.6,4.22,4.22,0,0,0,1.8-1.7,5.27,5.27,0,0,0,.6-2.4A4,4,0,0,0,162.2,89.6ZM153,86.2V81.5h3.3a3.38,3.38,0,0,1,2.2.6,2.27,2.27,0,0,1,.7,1.8,2.11,2.11,0,0,1-.7,1.8,3.09,3.09,0,0,1-2.1.6h-3.3v-.1Zm6.3,7.2a3.72,3.72,0,0,1-2.5.7h-3.5V88.5h3.6a3.61,3.61,0,0,1,2.4.7,2.45,2.45,0,0,1,.9,2.1A2.59,2.59,0,0,1,159.3,93.4Z"}),F.jsx("path",{className:"cls-1",d:"M165.4,96.2V79.4h2.5V96.2Z"}),F.jsx("path",{className:"cls-1",d:"M181.8,93.7a1.34,1.34,0,0,1-.3-1V89.1a5.58,5.58,0,0,0-.6-2.6,3.67,3.67,0,0,0-1.7-1.8,7.21,7.21,0,0,0-2.9-.6,6.92,6.92,0,0,0-2.5.5,4.48,4.48,0,0,0-1.9,1.4,3.34,3.34,0,0,0-.9,2.2h2.6a2,2,0,0,1,.9-1.5,4,4,0,0,1,1.8-.5,2.79,2.79,0,0,1,1.3.3,2,2,0,0,1,.9.9,4.3,4.3,0,0,1,.3,1.7h-3a9.53,9.53,0,0,0-2.6.4,3.58,3.58,0,0,0-1.8,1.2,3.42,3.42,0,0,0-.7,2.2,3.17,3.17,0,0,0,.6,2,3.6,3.6,0,0,0,1.5,1.2,4.74,4.74,0,0,0,2.1.4v.1h.1a5.23,5.23,0,0,0,2.5-.7,4.36,4.36,0,0,0,1.7-1.
40536,4.11,4.11,0,0,0,.7,1.1,2.37,2.37,0,0,0,1.2.7,4.67,4.67,0,0,0,1.7.2V94.1A1.84,1.84,0,0,1,181.8,93.7Zm-3.4-1.1a3.74,3.74,0,0,1-1.2,1.3,3.12,3.12,0,0,1-1.7.5v.1a2.73,2.73,0,0,1-1.6-.4,1.49,1.49,0,0,1-.6-1.3,1.37,1.37,0,0,1,.4-1.1,2.11,2.11,0,0,1,1-.6,2.76,2.76,0,0,1,1.3-.2h2.8a3.36,3.36,0,0,1-.4,1.7Z"}),F.jsx("path",{className:"cls-1",d:"M185,96.2V84.3h2.4v1.8a3.55,3.55,0,0,1,1.7-1.5,4.71,4.71,0,0,1,7,4.7v7h-2.5V89.6a3.72,3.72,0,0,0-.7-2.5,2.67,2.67,0,0,0-2.2-.9,2.78,2.78,0,0,0-2.3,1,3.66,3.66,0,0,0-.9,2.7v6.4H185Z"}),F.jsx("path",{className:"cls-1",d:"M204.6,96.5a6.23,6.23,0,0,1-3.1-.8,5.56,5.56,0,0,1-2.1-2.2,6.66,6.66,0,0,1-.8-3.3,6.35,6.35,0,0,1,.7-3.2,5.56,5.56,0,0,1,2.1-2.2,6.23,6.23,0,0,1,3.1-.8,6.6,6.6,0,0,1,3.6,1.1,4.77,4.77,0,0,1,1.9,3.1h-2.7a2.06,2.06,0,0,0-1-1.4,3.31,3.31,0,0,0-3.8,0,3.24,3.24,0,0,0-1.1,1.5,6.53,6.53,0,0,0-.4,2,4.88,4.88,0,0,0,.4,2.1,3.52,3.52,0,0,0,1.2,1.5,2.75,2.75,0,0,0,1.8.5,3.47,3.47,0,0,0,1.8-.5,2,2,0,0,0,1-1.5h2.7a4.59,4.59,0,0,1-1.1,2.2,6.93,6.93,0,0,1-1.9,1.5,7,7,0,0,1-2.6.5h.3Z"}),F.jsx("polygon",{className:"cls-2",points:"146.9 23.9 146.9 23.9 141.3 29.5 97.7 72.9 109 72.9 146.9 35.2 184.9 73 196.1 73 146.9 23.9"}),F.jsx("polygon",{className:"cls-3",points:"96.6 11.3 103.2 17.9 109 12.2 96.6 0 96.6 0 91 5.6 23.5 72.9 34.9 72.8 96.6 11.3"}),F.jsx("polygon",{className:"cls-4",points:"118.8 26.6 121 24.3 115.4 18.7 115.4 18.7 113.2 20.9 95 38.9 100.7 44.6 118.8 26.6"}),F.jsx("polygon",{className:"cls-5",points:"86.9 47.1 84.6 49.3 66.5 67.4 72 72.9 72.3 72.9 90.3 54.9 92.5 52.7 86.9 47.1 86.9 47.1"}),F.jsx("path",{className:"cls-6",d:"M28.1,85.8a4,4,0,0,0-2.3-.8,3.53,3.53,0,0,0-2.1.7A2.92,2.92,0,0,0,22.5,88h6.6A2.58,2.58,0,0,0,28.1,85.8Zm0,0a4,4,0,0,0-2.3-.8,3.53,3.53,0,0,0-2.1.7A2.92,2.92,0,0,0,22.5,88h6.6A2.58,2.58,0,0,0,28.1,85.8Zm12.5,2.9a5.12,5.12,0,0,0,2.6-1.5h.1a4.43,4.43,0,0,0,1-2.9,4.22,4.22,0,0,0-2.7-4.2,7.38,7.38,0,0,0-3-.6H17L0,96.3H24.13l-.53-.1a3.63,3.63,0,0,1-1.4-.6A6.67,6.67,0,0,1,19.8,93a7.58,7.58,0,0,1-.9-3.7,8,8,0,0,1,.9-3.8A5.91,5.91,0,0,1,22.3,83a7.58,7.58,0,0,1,3.7-.9,6.86,6.86,0,0,1,3.6.9h0a7.26,7.26,0,0,1,2.3,2.44,6.86,6.86,0,0,1,.9,3.6v1.4H22.5a3.3,3.3,0,0,0,.5,1.7,4.34,4.34,0,0,0,1.2,1.1,3.08,3.08,0,0,0,1.7.4,3.08,3.08,0,0,0,1.7-.4,3.63,3.63,0,0,0,1.1-1.3h3.8a7.28,7.28,0,0,1-1.3,2.3A6.19,6.19,0,0,1,29,95.9a2.9,2.9,0,0,1-.65.28l-.49.12H35.7V89.2h1.9l4.1,7.1h3.6Zm-.5-2.3v-.1a3.67,3.67,0,0,1-1.7.3H35.7V82.1h2.7a2.86,2.86,0,0,1,1.7.3,1.56,1.56,0,0,1,.8.8,2.16,2.16,0,0,1,.2,1.2,2.37,2.37,0,0,1-.2,1.2A1.93,1.93,0,0,1,40.1,86.4Zm-12-.6a4,4,0,0,0-2.3-.8,3.53,3.53,0,0,0-2.1.7A2.92,2.92,0,0,0,22.5,88h6.6A2.58,2.58,0,0,0,28.1,85.8Z"}),F.jsx("path",{className:"cls-7",d:"M54.6,84.8l.1.06V84.8ZM56.8,87a6.81,6.81,0,0,0-2.1-2.14h0a6.61,6.61,0,0,0-3.2-.8,6.8,6.8,0,0,0-3.2.7A5.85,5.85,0,0,0,46,86.9a6,6,0,0,0-.9,3.3,7.27,7.27,0,0,0,.8,3.3,5.81,5.81,0,0,0,2.2,2.2,6.61,6.61,0,0,0,3.2.8,7,7,0,0,0,3.3-.8,5.19,5.19,0,0,0,2.2-2.2,6.61,6.61,0,0,0,.8-3.2A7,7,0,0,0,56.8,87Zm-2.5,4.9v.2a2.85,2.85,0,0,1-1.1,1.3,3.12,3.12,0,0,1-1.7.5,2.73,2.73,0,0,1-1.6-.4,2.35,2.35,0,0,1-1.1-1.3,3.79,3.79,0,0,1-.4-1.9,4,4,0,0,1,.4-1.9,2.85,2.85,0,0,1,1.1-1.3,2.94,2.94,0,0,1,1.6-.5,3,3,0,0,1,1.6.4,3.45,3.45,0,0,1,1.2,1.2,3.79,3.79,0,0,1,.4,1.9A3.4,3.4,0,0,1,54.3,91.9Z"}),F.jsx("path",{className:"cls-8",d:"M70.5,93.4a.86.86,0,0,1-.4-.7V89.2a6,6,0,0,0-.6-2.7,4.46,4.46,0,0,0-1.8-1.8,6,6,0,0,0-2.8-.6,6.61,6.61,0,0,0-2.6.5,4.85,4.85,0,0,0-2,1.4,4.33,4.33,0,0,0-.9,2.2h3.1a1.34,1.34,0,0,1,.8-1.2,3.29,3.29,0,0,1,1.5-.4,1.9,1.9,0,0,1,1.2.3,1.54,1.54,0,0,1,.7.9,2.83,2.83,0,0,1,.3,1.4H64.2a7.44,7.44,0,0,0-2.6.4,4,4,0,0,0-1.8,1.2,3.79,3.79,0,0,0-.6,2.2,2.71,2.71,0,0,0,.6,1.9,4.6,4.6,0,0,0,1.5,1.2,4.45,4.45,0,0,0,2,.4,5.72,5.72,0,0,0,2.5-.6,3.76,3.76,0,0,0,1.7-1.6,4.37,4.37,0,0,0,.8,1.1,2.29,2.29,0,0,0,1.2.6,9.29,9.29,0,0,0,1.9.2V93.6C71,93.6,70.7,93.6,70.5,93.4ZM67,91.2a2.35,2.35,0,0,1-.4,1.5,2.65,2.65,0,0,1-1.1,1,3.29,3.29,0,0,1-1.5.4,2.47,2.47,0,0,1-1.3-.3,1.27,1.27,0,0,1-.5-1.1c0-.5,0-.7.3-.9a1.61,1.61,0,0,1,.8-.5,3.78,3.78,0,0,1,1-.2H67Z"}),F.jsx("path",{className:"cls-9",d:"M81.9,79.4v6.5h-.1A4.93,4.93,0,0,0,80,84.5a5.4,5.4,0,0,0-2.2-.5,6.28,6.28,0,0,0-2.9.8A5.76,5.76,0,0,0,73,87a7.88,7.88,0,0,0-.7,3.1,7.08,7.08,0,0,0,.7,3.2,5.32,5.32,0,0,0,1.9,2.3,4.87,4.87,0,0,0,3,.9,4.69,4.69,0,0,0,2.3-.5,3.55,3.55,0,0,0,1.7-1.5v1.7H85V79.4Zm-.56,12.8.06-.1v.1h-.06a3,3,0,0,1-4.4,1.2,2.79,2.79,0,0,1-1.1-1.3,4.27,4.27,0,0,1,0-3.6,3.25,3.25,0,0,1,1.1-1.2,2.94,2.94,0,0,1,1.6-.5,2.65,2.65,0,0,1,1.5.4,2.56,2.56,0,0,1,1.2,1.1,4.05,4.05,0,0,1,.5,2.1A3,3,0,0,1,81.34,92.2Z"}),F.jsx("path",{className:"cls-10",d:"M29.5,82.9l.1.06V82.9Z"})]}),F.jsxs("h2",{className:"home_title_mobile",children:[F.jsx("span",{children:"Bienvenue sur la"}),F.jsx("span",{children:"carte interactive"})]})]}),F.jsxs("div",{className:"home_infos",children:[F.jsxs("h2",{className:"home_title_computer",children:[F.jsx("span",{children:"Bienvenue sur la"}),F.jsx("span",{children:"carte interactive"})]}),F.jsx("p",{className:"home_description",children:"Plongez au cœur du projet eRoadMontBlanc et découvrez le fonctionnement du démonstrateur de cette technologie innovante pouvant faire émerger une solution de décarbonation massive de la mobilité routière longue distance en France et en Europe."}),F.jsx("button",{className:"home_button",onClick:i,children:"Commencer la visite"}),F.jsx("p",{class:"home_credits_mobile",children:"© Tous droits réservés, Univ. Gustave Eiffel & Mathéo Pougalan"})]}),F.jsx("p",{class:"home_credits_computer",children:"© Tous droits réservés, Univ. Gustave Eiffel & Mathéo Pougalan"}),F.jsx("div",{className:"home_img",children:F.jsx("img",{src:"/cover.jpg",alt:""})})]})}const RA=({position:n,text:e,onClick:t,size:i,visible:r=!1})=>r?F.jsx(SW,{firstHitOnly:!0,raycast:MW,onPointerEnter:()=>{document.body.style.cursor="pointer"},onPointerLeave:()=>{document.body.style.cursor="default"},children:F.jsx(l7,{position:n,center:!0,distanceFactor:i,className:`btn ${r?"dis
4053play":"hidden"}`,children:F.jsx("div",{className:"text-container",onClick:t,children:e})})}):null;function dJ(){const n=yw(),e=Ss(),[t,i]=H.useState(!1),{playTransi:r}=H.useContext(qp);return H.useEffect(()=>{if(e.pathname==="/map"){const s=setTimeout(()=>{i(!0)},2e3);return()=>clearTimeout(s)}else i(!1)},[e.pathname]),F.jsxs(F.Fragment,{children:[F.jsx(RA,{position:[70,18,56],text:"Routes de campagne",onClick:()=>{n("/routescampagne"),r()},size:460,visible:t}),F.jsx(RA,{position:[-400,18,268],text:"Autoroute",onClick:()=>{n("/autoroute"),r()},size:440,visible:t}),F.jsx(RA,{position:[-320,18,-80],text:"Ville laboratoire",onClick:()=>{n("/villelaboratoire"),r()},size:420,visible:t})]})}function oa({id:n,route:e,title:t,subtitle:i,description:r,prev:s,next:o,txtbtn:a}){const l=Ss(),{playTransi:c,playBtn:u}=H.useContext(qp);H.useEffect(()=>{const m=document.querySelector(`#${n}`);l.pathname===e?setTimeout(()=>{m.style.transform="translate(0, 0%)"},1500):m.style.transform="translate(0, 150%)"},[l,e,n]);const d=()=>{c()},p=()=>{u()};return F.jsxs("div",{id:n,className:"panel",children:[F.jsxs("div",{className:"panel_infos",children:[F.jsx("h1",{children:t}),F.jsxs("div",{className:"panel_description",children:[F.jsx("h2",{children:i}),F.jsx("p",{children:r})]})]}),F.jsxs("div",{className:"panel_btn",children:[s&&F.jsx(r_,{to:s,className:"panel_prev bt_sound",onClick:d,onMouseEnter:p,children:F.jsx("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{d:"M8.68907 1.68568L4.56454 5.50492L8.68907 9.32416C9.10364 9.70805 9.10364 10.3282 8.68907 10.7121C8.27449 11.096 7.60478 11.096 7.19021 10.7121L2.31093 6.19396C1.89636 5.81007 1.89636 5.18993 2.31093 4.80604L7.19021 0.287919C7.60478 -0.0959731 8.27449 -0.0959731 8.68907 0.287919C9.09301 0.671812 9.10364 1.30179 8.68907 1.68568Z"})})}),o&&F.jsx(r_,{to:o,className:"panel_next bt_sound",onClick:d,onMouseEnter:p,children:a})]})]})}function pJ(){return F.jsx(oa,{id:"about_pannel",route:"/about",title:"Transpolis",subtitle:"Centre d'essais pour l'innovation et la sécurité",description:"Bienvenue sur la plateforme Transpolis. Situé à45 km de Lyon, ce site de 80 hectares est dédié aux essais dans le domaine de la ville et de la mobilité intelligente et décarbonée. Dans le cadre du projet eRoadMontBlanc, il offre un environnement contrôlé pour évaluer le Système de Route Électrique (ERS) via un démonstrateur de 420 mètres, indispensable avant un déploiement sur route ouverte.",prev:"",next:"/energyflow",txtbtn:"ÉTAPE SUIVANTE"})}function mJ(){return F.jsx(oa,{id:"energy_pannel",route:"/energyflow",title:"Distribution de l’énergie",subtitle:"Alimentation électrique",description:"La première étape de ce test àgrande échelle consiste àfournir l'alimentation électrique au démonstrateur. Pour cela, un poste électrique central achemine le courant vers une sous-station composée de deux bâtiments. Cette sous-station a pour rôle de convertir le courant et de le redistribuer le long de la voie de test. À ce stade, le courant n'est pas encore utilisé par la piste ERS intégrée dans la chaussée.",prev:"/about",next:"/smartpowering",txtbtn:"ÉTAPE SUIVANTE"})}function gJ(){return F.jsx(oa,{id:"powering_pannel",route:"/smartpowering",title:"Alimentation électrique dynamique",subtitle:"Gestion de l'énergie selon la position du véhicule",description:"La deuxième étape de ce test consiste àalimenter la piste ERS. Celle-ci est en effet divisée en sections de 11 mètres, qui s'activent grâce àla communication entre le camion et la piste. Les sections ne s'activent que lorsque le véhicule les traverse, tandis que les autres demeurent inactives. Le résultat ? Une consommation optimisée tout en assurant la sécurité.",prev:"/energyflow",next:"/captation",txtbtn:"ÉTAPE SUIVANTE"})}function yJ(){return F.jsx(oa,{id:"charge_pannel",route:"/charge",title:"Recharge innovante",subtitle:"Les batteries NMC au cœur de la performance du camion",description:"Le camion capte l'énergie de la chaussée grâce au système ERS et la stocke dans ses batteries. Pour cela, il est équipé de 350kWh de batteries NMC (nickel-manganèse-cobalt) réparties sous sa cabine et en remplacement de ses réservoirs de carburant. Cette énergie lui permettra de quitter la route électrique avec une pleine charge et de poursuivre jusqu'àson point final de livraison.",prev:"/captation",next:"/autonomy",txtbtn:"ÉTAPE SUIVANTE"})}function _J(){return F.jsx(oa,{id:"autonomy_pannel",route:"/autonomy",title:"Maximiser l'énergie",subtitle:"Le camion tire profit de chaque mètre",description:"Grâce au système ERS, le camion se recharge en roulant. Sur le démonstrateur, quelques centaines de mètres de piste suffisent pour que le camion récupère plus d'énergie qu'il n'en utilise. Cette énergie stockée lui permet de continuer àcirculer sans s'arrêter, garantissant un trajet fluide, même sur de longues distances.",prev:"/charge",next:"",txtbtn:"ÉTAPE SUIVANTE"})}function xJ(){return F.jsx(oa,{id:"captation_pannel",route:"/captation",title:"Captation du courant",subt
4053itle:"Le capteur de courant rétractable et son rôle essentiel",description:"Enfin, la dernière étape permet la transmission de l'énergie de la piste ERS aux batteries du véhicule. Le capteur de courant rétractable se déploie lorsque le véhicule est sur la section ERS pour capter l'énergie par conduction électrique, puis se rétracte automatiquement àla fin de la piste ou en cas d'événement interrompant l'alimentation (obstacle, dépassement, etc.).",prev:"/smartpowering",next:"/charge",txtbtn:"ÉTAPE SUIVANTE"})}function vJ(){return F.jsx(oa,{id:"ville_pannel",route:"/villelaboratoire",title:"Ville Laboratoire",subtitle:"Études et recherches en mobilité urbaine grandeur nature",description:"Dans cet espace de 30 hectares dédié àl’innovation en mobilité urbaine, des solutions pour les transports de demain sont testés en conditions réelles. Reproduisant une véritable ville, le site offre 12 km de rues, des boulevards à6 voies, un périphérique de 1,8 km. Une zone multimodale de 7000 m² permet également d’explorer d'autres options de transport dans un environnement contrôlé et réaliste.",prev:"/routescampagne",next:"/autoroute",txtbtn:"ZONE SUIVANTE"})}function AJ(){return F.jsx(oa,{id:"autoroute_pannel",route:"/autoroute",title:"Autoroute",subtitle:"Une piste réglementaire pour l’évaluation des ADAS",description:"Cette piste est la représentation d’une autoroute d’un kilomètre, composée de 5 voies extensibles à9. Elle permet d’évaluer les fonctions d’aide àla conduite (ADAS) grâce àsa surface totalement plane et ses marquages répondant aux exigences réglementaires. Son but est également d’accueillir les innovations de transport et de travaux qui interviennent sur autoroute.",prev:"/villelaboratoire",next:"/routescampagne",txtbtn:"ZONE SUIVANTE"})}function SJ(){return F.jsx(oa,{id:"campagne_panel",route:"/routescampagne",title:"Routes de Campagne",subtitle:"21 819 m² de surface roulable",description:"Cette vaste piste représente les routes secondaires d’Europe àtravers de larges virages et ses différents marquages. Plusieurs parcours sont utilisables, en passant par deux grands ronds-points et un plateau de comportement. Sur cette piste, il est possible de mettre àl’épreuve la fonction de maintien dans la voie, ou encore de tester différents revêtements plus adhérents.",prev:"/autoroute",next:"/villelaboratoire",txtbtn:"ZONE SUIVANTE"})}function MJ({truckPos:n,opacity:e=1,...t}){const i=Ss(),r=new ei({color:new Re(0,.3,20),toneMapped:!1,transparent:!0,opacity:e}),s=new ei({color:new Re(1,1,1),toneMapped:!1,transparent:!0,opacity:e}),o=Ct("./models/tracks.glb"),a=[{min:.116,max:.12},{min:.116,max:.12228},{min:.12224,max:.12878},{min:.12852,max:.1348},{min:.13506,max:.141522},{min:.141262,max:.147802},{min:.147373,max:.154336},{min:.154286,max:.160899},{min:.160665,max:.167369},{min:.167155,max:.167629},{min:.173569,max:.180224},{min:.179991,max:.186582},{min:.186404,max:.193074},{min:.19279,max:.199503},{min:.199252,max:.205895},{min:.205613,max:.2124},{min:.212198,max:.218799},{min:.218555,max:.225269},{min:.224998,max:.231575},{min:.231334,max:.238078},{min:.237817,max:.244525},{min:.244329,max:.250983},{min:.250749,max:.257334},{min:.2571,max:.263661},{min:.263642,max:.270208},{min:.269954,max:.276667},{min:.276473,max:.283039},{min:.282793,max:.289435},{min:.289193,max:.295902},{min:.295679,max:.302368},{min:.30213,max:.308797},{min:.308583,max:.315093},{min:.315074,max:.321648},{min:.321287,max:.327966},{min:.327699,max:.3345},{min:.334213,max:.340845},{min:.340744,max:.347363},{min:.347115,max:.35328}],l=c=>{const u=a[c];return u&&n>=u.min&&n<=u.max&&(i.pathname==="/smartpowering"||i.pathname==="/charge"||i.pathname==="/captation")?r:s};return F.jsx("group",{...t,dispose:null,children:Object.keys(o.nodes).map((c,u)=>c.startsWith("track_")?F.jsx("mesh",{geometry:o.nodes[c].geometry,material:l(u),position:[-4,5.72,-59.1]},u):null)})}function eo(){const{isPlaying:n,playMusic:e,stopMusic:t,playBtn:i,playTransi:r}=H.useContext(qp),s=Ss(),o=()=>{n?t():e()},a=()=>{i()},l=()=>{r()},c=["/autoroute","/map","/villelaboratoire","/routescampagne"].includes(s.pathname);return F.jsxs("nav",{className:"navbar",children:[F.jsxs(r_,{to:"/",className:"nav_title bt_sound",onMouseEnter:a,children:[F.jsx("h1",{children:"La carte interactive"}),F.jsx("svg",{width:"20",height:"17",viewBox:"0 0 20 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{d:"M8 17V11H12V17H17V9H20L10 0L0 9H3V17H8Z"})})]}),F.jsxs("div",{className:"nav_controls",children:[F.jsxs("a",{className:"nav_license",href:"https://creativecommons.org/licenses/by-nc-nd/4.0/?ref=chooser-v1",target:"_blank",rel:"license noopener noreferrer",children:[F.jsxs("span",{children:[F.jsx("img",{src:"https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1",alt:""}),F.jsx("img",{src:"https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1",alt:""}),F.jsx("img",{src:"https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1",alt:""}),F.jsx("img",{src:"https://mirrors.creativecommons.org/presskit/icons/nd.svg?ref=chooser-v1",alt:""})]}),"Licensed sounds"]}),F.jsxs("div",{className:"nav_sound bt_sound",onClick:o,onMouseEnter:a,children:[F.jsx("p",{children:"Son"}),n?F.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{d:"M0 5.99998V12H4L9 17V0.99998L4 5.99998H0ZM13.5 8.99998C13.5 7.22998 12.48 5.70998 11 4.96998V13.02C12.48 12.29 13.5 10.77 13.5 8.99998ZM11 0.22998V2.28998C13.89 3.14998 16 5.82998 16 8.99998C16 12.17 13.89 14.85 11 15.71V17.77C15.01 16.86 18 13.28 18 8.99998C18 4.71998 15.01 1.13998 11 0.22998Z"})}):F.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{d:"M13.5 9C13.5 7.23 12.48 5.71 11 4.97V7.18L13.45 9.63C13.48 9.43 13.5 9.22 13.5 9ZM16 9C16 9.94 15.8 10.82 15.46 11.64L16.97 13.15C17.63
405311.91 18 10.5 18 9C18 4.72 15.01 1.14 11 0.23V2.29C13.89 3.15 16 5.83 16 9ZM1.27 0L0 1.27L4.73 6H0V12H4L9 17V10.27L13.25 14.52C12.58 15.04 11.83 15.45 11 15.7V17.76C12.38 17.45 13.63 16.81 14.69 15.95L16.73 18L18 16.73L9 7.73L1.27 0ZM9 1L6.91 3.09L9 5.18V1Z"})})]}),F.jsxs(r_,{to:c?"/about":"/map",className:"nav_map bt_sound",onClick:l,onMouseEnter:a,children:[F.jsx("p",{children:c?"Quitter":"Carte"}),c?F.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{d:"M7.09 12.59L8.5 14L13.5 9L8.5 4L7.09 5.41L9.67 8H0V10H9.67L7.09 12.59ZM16 0H2C0.89 0 0 0.9 0 2V6H2V2H16V16H2V12H0V16C0 17.1 0.89 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0Z"})}):F.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{d:"M17.5 0L17.34 0.03L12 2.1L6 0L0.36 1.9C0.15 1.97 0 2.15 0 2.38V17.5C0 17.78 0.22 18 0.5 18L0.66 17.97L6 15.9L12 18L17.64 16.1C17.85 16.03 18 15.85 18 15.62V0.5C18 0.22 17.78 0 17.5 0ZM12 16L6 13.89V2L12 4.11V16Z"})})]})]})]})}function EJ(){const n=Ss(),{scene:e}=Tr(),t=H.useRef();return H.useEffect(()=>{t.current||(t.current=new FE(new Re("#fbf8f4"),100,600),e.fog=t.current);let i,r;switch(n.pathname){case"/":i=100,r=300;break;case"/map":i=800,r=1800;break;case"/about":i=600,r=2e3;break;case"/energyflow":i=500,r=1e3;break;case"/smartpowering":i=200,r=480;break;case"/villelaboratoire":i=600,r=1e3;break;case"/routescampagne":i=700,r=1200;break;case"/autoroute":i=900,r=1200;break;case"/autonomy":i=400,r=520;break;default:i=50,r=800;break}mt.to(e.fog,{near:i,far:r,duration:4,ease:"power2.out"})},[n,e]),null}const Gz=[{x:"-566.193",y:"6",z:" -33.3918"},{x:"-566.106",y:"6",z:" -53.3917"},{x:"-566.015",y:"6",z:" -73.3913"},{x:"-565.797",y:"6",z:" -93.3886"},{x:"-564.647",y:"6",z:" -113.336"},{x:"-559.806",y:"6",z:" -132.68"},{x:"-551.528",y:"6",z:" -150.86"},{x:"-540.479",y:"6",z:" -167.515"},{x:"-527.126",y:"6",z:" -182.404"},{x:"-511.308",y:"6",z:" -194.618"},{x:"-494.24",y:"6",z:" -205.134"},{x:"-477.074",y:"6",z:" -215.495"},{x:"-459.882",y:"6",z:" -225.814"},{x:"-442.644",y:"6",z:" -236.054"},{x:"-424.786",y:"6",z:" -245.091"},{x:"-405.717",y:"6",z:" -251.268"},{x:"-385.992",y:"6",z:" -254.581"},{x:"-365.929",y:"6",z:" -254.838"},{x:"-345.86",y:"6",z:" -254.832"},{x:"-325.791",y:"6",z:" -254.79"},{x:"-305.722",y:"6",z:" -254.734"},{x:"-285.652",y:"6",z:" -254.674"},{x:"-265.583",y:"6",z:" -254.61"},{x:"-245.514",y:"6",z:" -254.546"},{x:"-225.444",y:"6",z:" -254.481"},{x:"-205.375",y:"6",z:" -254.417"},{x:"-185.306",y:"6",z:" -254.354"},{x:"-165.236",y:"6",z:" -254.292"},{x:"-145.167",y:"6",z:" -254.232"},{x:"-125.098",y:"6",z:" -254.172"},{x:"-105.028",y:"6",z:" -254.111"},{x:"-84.9596",y:"6",z:" -254.023"},{x:"-64.9525",y:"6",z:" -252.959"},{x:"-45.4332",y:"6",z:" -248.455"},{x:"-26.7519",y:"6",z:" -241.233"},{x:"-9.4527",y:"6",z:" -231.175"},{x:"5.83228",y:"6",z:" -218.277"},{x:"18.9337",y:"6",z:" -203.168"},{x:"29.3557",y:"6",z:" -186.131"},{x:"36.3017",y:"6",z:" -167.423"},{x:"39.5091",y:"6",z:" -147.724"},{x:"39.7115",y:"6",z:" -127.752"},{x:"37.0241",y:"6",z:" -107.973"},{x:"30.9479",y:"6",z:" -88.949"},{x:"22.1732",y:"6",z:" -70.9984"},{x:"11.0145",y:"6",z:" -54.3882"},{x:"-0.549561",y:"6",z:" -38.0428"},{x:"-12.162",y:"6",z:" -21.731"},{x:"-23.7919",y:"6",z:" -5.43146"},{x:"-35.431",y:"6",z:" 10.8616"},{x:"-47.0765",y:"6",z:" 27.1503"},{x:"-58.7279",y:"6",z:" 43.4346"},{x:"-70.3867",y:"6",z:" 59.7138"},{x:"-82.0589",y:"6",z:" 75.9834"},{x:"-93.7607",y:"6",z:" 92.2315"},{x:"-105.561",y:"6",z:" 108.408"},{x:"-118.298",y:"6",z:" 123.802"},{x:"-134.749",y:"6",z:" 135.16"},{x:"-152.652",y:"6",z:" 144.148"},{x:"-171.75",y:"6",z:" 150.129"},{x:"-191.57",y:"6",z:" 153.077"},{x:"-211.629",y:"6",z:" 153.435"},{x:"-231.698",y:"6",z:" 153.606"},{x:"-251.767",y:"6",z:" 153.763"},{x:"-271.835",y:"6",z:" 153.917"},{x:"-291.904",y:"6",z:" 154.07"},{x:"-311.973",y:"6",z:" 154.226"},{x:"-332.042",y:"6",z:" 154.391"},{x:"-352.112",y:"6",z:" 154.71"},{x:"-372",y:"6",z:" 157.413"},{x:"-391.842",y:"6",z:" 160.419"},{x:"-411.688",y:"6",z:" 163.391"},{x:"-431.561",y:"6",z:" 166.166"},{x:"-451.539",y:"6",z:" 167.803"},{x:"-471.468",y:"6",z:" 165.909"},{x:"-490.75",y:"6",z:" 160.503"},{x:"-508.836",y:"6",z:" 151.93"},{x:"-525.177",y:"6",z:" 140.393"},{x:"-539.213",y:"6",z:" 126.156"},{x:"-550.775",y:"6",z:" 109.849"},{x:"-559.508",y:"6",z:" 91.8907"},{x:"-564.874",y:"6",z:" 72.6742"},{x:"-566.077",y:"6",z:" 52.7528"},{x:"-566.139",y:"6",z:" 32.7535"},{x:"-566.146",y:"6",z:" 12.7536"}
4053,{x:"-566.165",y:"6",z:" -14.3918"},{x:"-566.193",y:"6",z:" -33.3918"}],wJ=[{x:"-420.626",y:"6",z:"109.195"},{x:"-413.171",y:"6",z:"107.759"},{x:"-412.666",y:"6",z:"91.867"},{x:"-412.669",y:"6",z:"83.8323"},{x:"-412.675",y:"6",z:"75.7976"},{x:"-412.685",y:"6",z:"67.763"},{x:"-412.699",y:"6",z:"59.7283"},{x:"-412.716",y:"6",z:"51.6936"},{x:"-412.735",y:"6",z:"43.659"},{x:"-412.756",y:"6",z:"35.6243"},{x:"-412.78",y:"6",z:"27.5896"},{x:"-412.812",y:"6",z:"19.2205"},{x:"-412.948",y:"6",z:"11.521"},{x:"-417.265",y:"6",z:"5.88325"},{x:"-425.269",y:"6",z:"5.73985"},{x:"-433.276",y:"6",z:"5.73985"},{x:"-441.283",y:"6",z:"5.73985"},{x:"-449.29",y:"6",z:"5.73985"},{x:"-457.296",y:"6",z:"5.73985"},{x:"-465.303",y:"6",z:"5.73985"},{x:"-473.31",y:"6",z:"5.73985"},{x:"-481.317",y:"6",z:"5.73985"},{x:"-489.324",y:"6",z:"5.73985"},{x:"-497.331",y:"6",z:"5.73985"},{x:"-505.338",y:"6",z:"5.73985"},{x:"-513.344",y:"6",z:"5.73985"},{x:"-521.351",y:"6",z:"5.73985"},{x:"-529.358",y:"6",z:"5.7399"},{x:"-537.141",y:"6",z:"5.23463"},{x:"-538.157",y:"6",z:"-2.24251"},{x:"-538.157",y:"6",z:"-10.2772"},{x:"-538.157",y:"6",z:"-18.3119"},{x:"-538.157",y:"6",z:"-26.3465"},{x:"-538.157",y:"6",z:"-34.3812"},{x:"-538.157",y:"6",z:"-42.4158"},{x:"-538.147",y:"6",z:"-50.4502"},{x:"-537.362",y:"6",z:"-58.3966"},{x:"-533.021",y:"6",z:"-64.985"},{x:"-526.288",y:"6",z:"-69.262"},{x:"-518.937",y:"6",z:"-72.4268"},{x:"-511.134",y:"6",z:"-74.0256"},{x:"-503.136",y:"6",z:"-74.3198"},{x:"-495.13",y:"6",z:"-74.3561"},{x:"-487.123",y:"6",z:"-74.3553"},{x:"-479.193",y:"6",z:"-73.5512"},{x:"-471.264",y:"6",z:"-72.5193"},{x:"-463.258",y:"6",z:"-72.4023"},{x:"-455.25",y:"6",z:"-72.4598"},{x:"-451.038",y:"6",z:"-77.5517"},{x:"-450.995",y:"6",z:"-85.587"},{x:"-450.995",y:"6",z:"-93.6216"},{x:"-450.995",y:"6",z:"-101.656"},{x:"-450.995",y:"6",z:"-109.691"},{x:"-450.995",y:"6",z:"-117.726"},{x:"-450.995",y:"6",z:"-125.76"},{x:"-450.995",y:"6",z:"-133.795"},{x:"-450.995",y:"6",z:"-141.829"},{x:"-450.995",y:"6",z:"-149.864"},{x:"-447.607",y:"6",z:"-154.843"},{x:"-440.984",y:"6",z:"-150.405"},{x:"-434.331",y:"6",z:"-145.933"},{x:"-427.647",y:"6",z:"-141.509"},{x:"-420.959",y:"6",z:"-137.091"},{x:"-414.269",y:"6",z:"-132.677"},{x:"-407.576",y:"6",z:"-128.266"},{x:"-400.88",y:"6",z:"-123.861"},{x:"-394.173",y:"6",z:"-119.471"},{x:"-387.409",y:"6",z:"-115.171"},{x:"-380.41",y:"6",z:"-111.27"},{x:"-372.864",y:"6",z:"-108.64"},{x:"-364.89",y:"6",z:"-107.998"},{x:"-356.883",y:"6",z:"-107.943"},{x:"-348.876",y:"6",z:"-107.941"},{x:"-340.869",y:"6",z:"-107.941"},{x:"-333.026",y:"6",z:"-108.965"},{x:"-328.803",y:"6",z:"-115.397"},{x:"-328.582",y:"6",z:"-123.425"},{x:"-328.582",y:"6",z:"-131.459"},{x:"-328.594",y:"6",z:"-139.494"},{x:"-328.663",y:"6",z:"-147.529"},{x:"-328.892",y:"6",z:"-155.558"},{x:"-324.472",y:"6",z:"-160.617"},{x:"-316.468",y:"6",z:"-160.472"},{x:"-308.461",y:"6",z:"-160.449"},{x:"-300.454",y:"6",z:"-160.459"},{x:"-292.447",y:"6",z:"-160.467"},{x:"-284.44",y:"6",z:"-160.468"},{x:"-276.433",y:"6",z:"-160.469"},{x:"-268.426",y:"6",z:"-160.470"},{x:"-260.42",y:"6",z:"-160.471"},{x:"-252.413",y:"6",z:"-160.472"},{x:"-244.406",y:"6",z:"-160.473"},{x:"-236.399",y:"6",z:"-160.474"},{x:"-228.392",y:"6",z:"-160.474"},{x:"-220.387",y:"6",z:"-160.445"},{x:"-214.572",y:"6",z:"-156.644"},{x:"-212.4",y:"6",z:"-148.918"},{x:"-208.998",y:"6",z:"-141.648"},{x:"-204.627",y:"6",z:"-134.921"},{x:"-199.293",y:"6",z:"-128.935"},{x:"-193.114",y:"6",z:"-123.831"},{x:"-186.379",y:"6",z:"-119.487"},{x:"-179.246",y:"6",z:"-115.838"},{x:"-171.751",y:"6",z:"-113.019"},{x:"-163.956",y:"6",z:"-111.194"},{x:"-156.009",y:"6",z:"-110.21"},{x:"-148.014",y:"6",z:"-109.755"},{x:"-140.009",y:"6",z:"-109.568"},{x:"-134.054",y:"6",z:"-106.309"},{x:"-133.938",y:"6",z:"-98.2853"},{x:"-133.968",y:"6",z:"-90.2507"},{x:"-133.977",y:"6",z:"-82.2159"},{x:"-134.906",y:"6",z:"-74.7847"},{x:"-142.698",y:"6",z:"-74.364"},{x:"-150.705",y:"6",z:"-74.364"},{x:"-158.712",y:"6",z:"-74.364"},{x:"-166.719",y:"6",z:"-74.364"},{x:"-174.726",y:"6",z:"-74.364"},{x:"-182.733",y:"6",z:"-74.364"},{x:"-190.74",y:"6",z:"-74.364"},{x:"-198.747",y:"6",z:"-74.364"},{x:"-206.753",y:"6",z:"-74.364"},{x:"-214.76",y:"6",z:"-74.364"},{x:"-222.767",y:"6",z:"-74.364"},{x:"-230.775",y:"6",z:"-74.3267"},{x:"-234.508",y:"6",z:"-68.8289"},{x:"-234.537",y:"6",z:"-60.794"},{x:"-234.537",y:"6",z:"-52.7592"},{x:"-234.537",y:"6",z:"-44.7245"},{x:"-234.537",y:"6",z:"-36.6899"},{x:"-234.512",y:"6",z:"-28.6551"},{x:"-234.015",y:"6",z:"-20.6449"},{x:"-228.222",y:"6",z:"-16.1752"},{x:"-220.222",y:"6",z:"-15.9025"},{x:"-212.215",y:"6",z:"-15.8889"},{x:"-204.208",y:"6",z:"-15.8886"},{x:"-196.201",y:"6",z:"-15.8886"},{x:"-188.194",y:"6",z:"-15.8886"},{x:"-180.187",y:"6",z:"-15.8886"},{x:"-172.181",y:"6",z:"-15.8886"},{x:"-164.174",y:"6",z:"-15.8889"},{x:"-156.167",y:"6",z:"-15.8922"},{x:"-148.16",y:"6",z:"-15.9059"},{x:"-140.153",y:"6",z:"-15.9454"},{x:"-134.338",y:"6",z:"-12.9467"},{x:"-134.27",y:"6",z:"-4.91503"},{x:"-134.334",y:"6",z:"3.1144"},{x:"-140.336",y:"6",z:"5.9448"},{x:"-148.343",y:"6",z:"5.94267"},{x:"-156.35",y:"6",z:"5.94267"},{x:"-164.357",y:"6",z:"5.94268"},{x:"-172.364",y:"6",z:"5.94613"},{x:"-180.371",y:"6",z:"6.06754"},{x:"-188.368",y:"6",z:"6.47646"},{x:"-196.343",y:"6",z:"7.20361"},{x:"-204.274",y:"6",z:"8.30871"},{x:"-212.112",y:"6",z:"9.95196"},{x:"-219.746",y:"6",z:"12.366"},{x:"-226.946",y:"6",z:"15.8669"},{x:"-233.325",y:"6",z:"20.6984"},{x:"-238.121",y:"6",z:"27.0884"},{x:"-240.471",y:"6",z:"34.7394"}
4053,{x:"-241.121",y:"6",z:"42.7447"},{x:"-241.351",y:"6",z:"50.7753"},{x:"-242.115",y:"6",z:"58.7625"},{x:"-244.754",y:"6",z:"66.2564"},{x:"-250.964",y:"6",z:"71.0379"},{x:"-258.754",y:"6",z:"72.7264"},{x:"-266.743",y:"6",z:"73.1588"},{x:"-274.749",y:"6",z:"73.1602"},{x:"-282.755",y:"6",z:"73.0976"},{x:"-290.762",y:"6",z:"73.071"},{x:"-298.769",y:"6",z:"73.0656"},{x:"-306.776",y:"6",z:"73.0656"},{x:"-314.783",y:"6",z:"73.0656"},{x:"-322.79",y:"6",z:"73.0656"},{x:"-328.929",y:"6",z:"70.7842"},{x:"-328.708",y:"6",z:"62.7545"},{x:"-328.689",y:"6",z:"54.7196"},{x:"-328.689",y:"6",z:"46.6849"},{x:"-328.689",y:"6",z:"38.6501"},{x:"-328.689",y:"6",z:"30.6155"},{x:"-331.873",y:"6",z:"24.1358"},{x:"-339.756",y:"6",z:"22.8685"},{x:"-347.762",y:"6",z:"22.7267"},{x:"-355.769",y:"6",z:"22.7257"},{x:"-363.776",y:"6",z:"22.7257"},{x:"-371.783",y:"6",z:"22.7257"},{x:"-379.79",y:"6",z:"22.7257"},{x:"-395.803",y:"6",z:"22.7257"},{x:"-403.81",y:"6",z:"22.7257"},{x:"-411.817",y:"6",z:"22.7257"},{x:"-419.824",y:"6",z:"22.7257"},{x:"-427.831",y:"6",z:"22.7257"},{x:"-435.838",y:"6",z:"22.7257"},{x:"-443.845",y:"6",z:"22.7257"},{x:"-451.852",y:"6",z:"22.7257"},{x:"-459.858",y:"6",z:"22.7257"},{x:"-467.865",y:"6",z:"22.7257"},{x:"-475.872",y:"6",z:"22.7257"},{x:"-483.879",y:"6",z:"22.7257"},{x:"-491.886",y:"6",z:"22.7257"},{x:"-499.893",y:"6",z:"22.7257"},{x:"-507.899",y:"6",z:"22.7257"},{x:"-515.906",y:"6",z:"22.7257"},{x:"-523.913",y:"6",z:"22.7257"},{x:"-531.92",y:"6",z:"22.7257"},{x:"-537.818",y:"6",z:"26.0145"},{x:"-538.2",y:"6",z:"34.0489"},{x:"-538.2",y:"6",z:"42.0835"},{x:"-538.2",y:"6",z:"50.1181"},{x:"-538.2",y:"6",z:"58.1527"},{x:"-538.2",y:"6",z:"66.1873"},{x:"-538.2",y:"6",z:"74.2221"},{x:"-538.2",y:"6",z:"82.2566"},{x:"-538.2",y:"6",z:"90.2913"},{x:"-538.2",y:"6",z:"98.3248"},{x:"-534.139",y:"6",z:"105.279"},{x:"-527.243",y:"6",z:"109.155"},{x:"-519.246",y:"6",z:"109.449"},{x:"-511.239",y:"6",z:"109.487"},{x:"-503.232",y:"6",z:"109.5"},{x:"-495.225",y:"6",z:"109.504"},{x:"-487.218",y:"6",z:"109.505"},{x:"-479.212",y:"6",z:"109.507"},{x:"-471.205",y:"6",z:"109.54"},{x:"-463.261",y:"6",z:"110.223"},{x:"-455.896",y:"6",z:"113.312"},{x:"-448.484",y:"6",z:"116.301"},{x:"-440.66",y:"6",z:"115.4"},{x:"-433.464",y:"6",z:"111.881"},{x:"-420.626",y:"6",z:"109.195"}],Vz={"/":{position:[-1200,20,-200],target:[0,0,0]},"/map":{position:[-800,216,-488],target:[-150,4,68]},"/about":{position:[-660,290,-614],target:[-270,26,-156]},"/energyflow":{position:[-400,400,-200],target:[-400,4,-200]},"/smartpowering":{position:[-170,30,-380],target:[-202,12,-304]},"/villelaboratoire":{position:[-712,238,214],target:[-458,40,-110]},"/routescampagne":{position:[-560,146,36],target:[-228,34,138]},"/autoroute":{position:[-360,406,-265],target:[58,4,238]},"/autonomy":{position:[52,30,-330],target:[-88,4,-224]},"/captation":{position:[5,1.2,-6.1],target:[20,-4,0]},"/charge":{position:[12,5,-14],target:[6,-5,10]}},Wz={"/":{position:[-1200,20,-200],target:[0,0,0]},"/map":{position:[-1120,240,-800],target:[-150,-40,175]},"/about":{position:[-920,160,-614],target:[-350,-40,-140]},"/energyflow":{position:[-340,320,-260],target:[-340,0,-260]},"/smartpowering":{position:[-178,24,-380],target:[-228,-4,-304]},"/villelaboratoire":{position:[-712,205,214],target:[-458,5,-110]},"/routescampagne":{position:[-560,115,36],target:[-228,4,138]},"/autoroute":{position:[-360,390,-280],target:[58,-30,200]},"/autonomy":{position:[65,40,-380],target:[-80,0,-315]},"/captation":{position:[3.4,1,-6],target:[20,-4.7,0]},"/charge":{position:[8,5,-20],target:[6.6,-6,10]}},TJ={computer:Vz,mobile:Wz},bg=Object.freeze(Object.defineProperty({__proto__:null,computer:Vz,default:TJ,mobile:Wz},Symbol.toStringTag,{value:"Module"})),CJ=Gz.map(n=>new z(parseFloat(n.x)-4,parseFloat(n.y),parseFloat(n.z)-59.1)),RJ=new Hp(CJ);function bJ({truckPos:n}){const e=H.useRef(),t=Ss(),i=window.innerWidth<768,r=i?"mobile":"computer";return H.useEffect(()=>{var u,d;const s=e.current,o=t.pathname,a=(u=bg[r][o])==null?void 0:u.position,l=(d=bg[r][o])==null?void 0:d.target;s&&a&&l&&o!=="/captation"&&o!=="/charge"&&s.setLookAt(...a,...l,!0);const c=document.querySelector("div[data-camera-controls-version]");o==="/smartpowering"||o==="/captation"||o==="/charge"?c.classList.add("none_select"):c.classList.remove("none_select")},[t.pathname,i]),H.useEffect(()=>{var a,l;const s=e.current,o=t.pathname;if(s&&(o==="/captation"||o==="/charge")){const c=RJ.getPoint(n),u=((a=bg[r][o])==null?void 0:a.position)||[0,0,0],d=((l=bg[r][o])==null?void 0:l.target)||[0,0,0],p=new z(...u),m=new z(...d),y=c.clone().add(p),_=c.clone().add(m);s.setLookAt(y.x,y.y,y.z,_.x,_.y,_.z,!0)}},[n,t.pathname,i]),F.jsx(mV,{ref:e,minDistance:20,maxDistance:1200,enabled:!0,verticalDragToForward:!0,dollyToCursor:!1,infinityDolly:!1,minZoom:20,maxZoom:900,smoothTime:2,restThreshold:.1,maxPolarAngle:Math.PI/2.2})}function PJ(){const{progress:n}=c7(),e=Math.round(n);return F.jsxs("div",{className:"loading_page",children:[F.jsxs("div",{className:"loading_infos",children:[F.jsx("p",{className:"infos",children:"Chargement de la carte interactive..."}),F.jsxs("p",{className:"percent",children:[e,"%"]})]}),F.jsx("div",{className:"progress_bar",children:F.jsx("div",{className:"progress_bar_fill",style:{width:`${e}%`}})})]})}function BJ(){const{nodes:n}=Ct("./models/map/island.glb"),e=Gt("./textures/map/island.jpg");return e.flipY=!1,F.jsx("mesh",{geometry:n.island.geometry,onClick:t=>t.stopPropagation(),onPointerEnter:t=>t.stopPropagation(),children:F.jsx("meshBasicMaterial",{map:e})})}function IJ(){const{nodes:n}=Ct("./models/map/crashpad.glb"),e=Gt("./textures/map/crashpad.jpg");return e.flipY=!1,F.jsx("mesh",{geometry:n.crashpad.geometry,onClick:t=>t.stopPropagation(),onPointerEnter:t=>t.stopPropagation(),children:F.jsx("meshBasicMaterial",{map:e})})}const LJ=[{x:-478,y:.2,z:-194,sx:.75,sy:.75,sz:.75},{x:220,y:.2,z:-98,sx:1,sy:1,sz:1},{x:-414,y:.2,z:-240,sx:.75,sy:.75,sz:.75},{x:216,y:.2,z:-86,sx:.75,sy:.75,sz:.75},{x:-404,y:.2,z:-232,sx:1,sy:1,sz:1},{x:232,y:.2,z:-92,sx:1,sy:1,sz:1},{x:-462,y:.2,z:-252,sx:.75,sy:.75,sz:.75},{x:198,y:.2,z:-84,sx:1,sy:1,sz:1},{x:-472,y:.2,z:-240,sx:.75,sy:.75,sz:.75},{x:-320,y:.2,z:-244,sx:1,sy:1,sz:1},{x:-312,y:.2,z:-248,sx:1,sy:1,sz:1},{x:-564,y:.2,z:-182,sx:.75,sy:.75,sz:.75},{x:-540,y:.2,z:-192,sx:.75,sy:.75,sz:.75},{x:-558,y:.2,z:-172,sx:.75,sy:.75,sz:.75},{x:-552,y:.2,z:-188,sx:1,sy:1,sz:1},{x:-568,y:.2,z:-156,sx:1,sy:1,sz:1},{x:-8,y:.2,z:152,sx:.75,sy:.75,sz:.75},{x:-218,y:.2,z:-274,sx:1,sy:1,sz:1},{x:-230,y:.2,z:-278,sx:.75,sy:.75,sz:.75},{x:-220,y:.2,z:-282,sx:1,sy:1,sz:1},{x:-260,y:.2,z:-284,sx:1,sy:1,sz:1},{x:-60,y:.2,z:-270,sx:1,sy:1,sz:1},{x:-50,y:.2,z:-278,sx:.75,sy:.75,sz:.75},{x:-20,y:.2,z:154,sx:1,sy:1,sz:1},{x:-38,y:.2,z:-266,sx:1,sy:1,sz:1},{x:-14,y:.2,z:146,sx:.75,sy:.75,sz:.75},{x:-152,y:.2,z:-244,sx:1,sy:1,sz:1},{x:-142,y:.2,z:-240,sx:.75,sy:.75,sz:.75},{x:-90,y:.2,z:-278,sx:.75,sy:.75,sz:.75},{x:-20,y:.2,z:-258,sx:1,sy:1,sz:1},{x:-80,y:.2,z:-288,sx:.75,sy:.75,sz:.75},{x:-244,y:.2,z:-244,sx:1,sy:1,sz:1},{x:-104,y:.2,z:-182,sx:1,sy:1,sz:1},{x:-80,y:.2,z:-192,sx:.75,sy:.75,sz:.75},{x:-98,y:.2,z:-172,sx:.75,sy:.75,sz:.75},{x:-108,y:.2,z:-156,sx:1,sy:1,sz:1},{x:-18,y:.2,z:-114,sx:1,sy:1,sz:1},{x:-30,y:.2,z:-118,sx:.75,sy:.75,sz:.75},{x:-20,y:.2,z:-122,sx:1,sy:1,sz:1},{x:-60,y:.2,z:-124,sx:1,sy:1,sz:1},{x:-52,y:.2,z:-128,sx:.75,sy:.75,sz:.75},{x:-88,y:.2,z:-54,sx:1,sy:1,sz:1},{x:-100,y:.2,z:-58,sx:.75,sy:.75,sz:.75},{x:-90,y:.2,z:-62,sx:1,sy:1,sz:1},{x:-120,y:.2,z:-90,sx:1,sy:1,sz:1},{x:-188,y:.2,z:-106,sx:.75,sy:.75,sz:.75},{x:-206,y:.2,z:-11,sx:1,sy:1,sz:1},{x:-194,y:.2,z:-114,sx:.75,sy:.75,sz:.75},{x:-220,y:.2,z:-134,sx:1,sy:1,sz:1},{x:-280,y:.2,z:-126,sx:1,sy:1,sz:1},{x:-312,y:.2,z:-90,sx:1,sy:1,sz:1},{x:-272,y:.2,z:-116,sx:.75,sy:.75,sz:.75},{x:-488,y:.2,z:68,sx:.75,sy:.75,sz:.75},{x:-510,y:.2,z:58,sx:.75,sy:.75,sz:.75},{x:-472,y:.2,z:60,sx:1,sy:1,sz:1},{x:-430,y:.2,z:84,sx:.75,sy:.75,sz:.75},{x:-444,y:.2,z:88,sx:1,sy:1,sz:1},{x:64,y:.2,z:292,sx:.75,sy:.75,sz:.75},{x:92,y:.2,z:276,sx:1,sy:1,sz:1},{x:44,y:.2,z:280,sx:1,sy:1,sz:1},{x:-406,y:.2,z:-106,sx:.75,sy:.75,sz:.75},{x:-428,y:.2,z:-126,sx:1,sy:1,sz:1},{x:-478,y:.2,z:234,sx:.75,sy:.75,sz:.75},{x:-442,y:.2,z:214,sx:.75,sy:.75,sz:.75},{x:-460,y:.2,z:244,sx:1,sy:1,sz:1},{x:-470,y:.2,z:260,sx:1,sy:1,sz:1},{x:-428,y:.2,z:242,sx:.75,sy:.75,sz:.75},{x:-454,y:.2,z:152,sx:1,sy:1,sz:1},{x:-432,y:.2,z:148,sx:1,sy:1,sz:1},{x:-314,y:.2,z:376,sx:1,sy:1,sz:1},{x:-362,y:.2,z:362,sx:.75,sy:.75,sz:.75},{x:-326,y:.2,z:364,sx:1,sy:1,sz:1},{x:-340,y:.2,z:372,sx:1,sy:1,sz:1},{x:-300,y:.2,z:352,sx:.75,sy:.75,sz:.75},{x:80,y:.2,z:286,sx:1,sy:1,sz:1},{x:-484,y:.2,z:376,sx:.75,sy:.75,sz:.75},{x:-458,y:.2,z:390,sx:1,sy:1,sz:1},{x:-466,y:.2,z:392,sx:1,sy:1,sz:1},{x:-592,y:.2,z:28,sx:.75,sy:.75,sz:.75},{x:-600,y:.2,z:20,sx:1,sy:1,sz:1},{x:-592,y:.2,z:12,sx:1,sy:1,sz:1},{x:-594,y:.2,z:-28,sx:.75,sy:.75,sz:.75},{x:-560,y:.2,z:132,sx:.75,sy:.75,sz:.75},{x:-92,y:.2,z:32,sx:1,sy:1,sz:1},{x:-90,y:.2,z:44,sx:1,sy:1,sz:1},{x:-80,y:.2,z:30,sx:1,sy:1,sz:1},{x:-104,y:.2,z:56,sx:.75,sy:.75,sz:.75},{x:-116,y:.2,z:2,sx:1,sy:1,sz:1},{x:-230,y:.2,z:238,sx:1,sy:1,sz:1},{x:-220,y:.2,z:234,sx:.75,sy:.75,sz:.75},{x:446,y:.2,z:94,sx:1,sy:1,sz:1},{x:458,y:.2,z:80,sx:1,sy:1,sz:1},{x:430,y:.2,z:92,sx:.75,sy:.75,sz:.75},{x:488,y:.2,z:64,sx:1,sy:1,sz:1},{x:492,y:.2,z:52,sx:1,sy:1,sz:1},{x:476,y:.2,z:68,sx:.75,sy:.75,sz:.75},{x:410,y:.2,z:98,sx:1,sy:1,sz:1},{x:476,y:.2,z:82,sx:.75,sy:.75,sz:.75},{x:410,y:.2,z:82,sx:.75,sy:.75,sz:.75}],DJ=[{x:-488.002,z:-175.823,y:0,sx:1,sy:1,sz:1},{x:-488.059,z:-146.823,y:0,sx:1,sy:1,sz:1},{x:-382.059,z:-215.823,y:0,sx:1,sy:1,sz:1},{x:-382.059,z:-175.823,y:0,sx:1,sy:1,sz:1},{x:-382.059,z:-146.823,y:0,sx:1,sy:1,sz:1},{x:-268.059,z:-215.823,y:0,sx:1,sy:1,sz:1},{x:-268.059,z:-175.823,y:0,sx:1,sy:1,sz:1},{x:-268.059,z:-146.823,y:0,sx:1,sy:1,sz:1},{x:-168.059,z:-215.823,y:0,sx:1,sy:1,sz:1},{x:-168.059,z:-175.823,y:0,sx:1,sy:1,sz:1},{x:-168.059,z:-146.823,y:0,sx:1,sy:1,sz:1},{x:-512.027,z:-3.21513,y:-.5,sx:.62,sy:1,sz:.62},{x:-440.443,z:-3.21513,y:-.5,sx:.62,sy:1,sz:.62},{x:-296.443,z:-3.21513,y:-.5,sx:.62,sy:1,sz:.62},{x:-226.443,z:-3.21513,y:-.5,sx:.62,sy:1,sz:.62},{x:-156.443,z:-3.21513,y:-.5,sx:.62,sy:1,sz:.62}],zJ=[{x:-168.059,z:-88.2124,y:0,sx:1,sy:1,sz:1},{x:-168.059,z:-59.2124,y:0,sx:1,sy:1,sz:1},{x:-268.059,z:-59.2124,y:0,sx:1,sy:1,sz:1},{x:-268.059,z:-88.2124,y:0,sx:1,sy:1,sz:1},{x:-382.059,z:-59.2124,y:0,sx:1,sy:1,sz:1},{x:-488.059,z:-88.2124,y:0,sx:1,sy:1,sz:1},{x:-488.059,z:-59.2124,y:0,sx:1,sy:1,sz:1},{x:-491.626,z:93.7776,y:0,sx:1,sy:1,sz:1},{x:-491.626,z:122.778,y:0,sx:1,sy:1,sz:1},{x:-377.385,z:122.778,y:0,sx:1,sy:1,sz:1},{x:-512.399,z:35.0871,y:-.5,sx:.62,sy:1,sz:.62},{x:-440.443,z:35.0871,y:-.5,sx:.62,sy:1,sz:.62},{x:-368.443,z:35.0871,y:-.5,sx:.62,sy:1,sz:.62},{x:-296.443,z:35.0871,y:-.5,sx:.62,sy:1,sz:.62},{x:-156.443,z:35.0871,y:-.5,sx:.62,sy:1,sz:.62}],FJ=[{x:-382.059,z:-88.2124,y:0,sx:1,sy:1,sz:1},{x:-162.39,z:93.7776,y:0,sx:1,sy:1,sz:1},{x:-162.39,z:122.778,y:0,sx:1,sy:1,sz:1},{x:-277.927,z:93.7776,y:0,sx:1,sy:1,sz:1},{x:-277.927,z:122.778,y:0,sx:1,sy:1,sz:1},{x:-377.385,z:93.7776,y:0,sx:1,sy:1,sz:1}],OJ=[{x:-43.053,z:-207.856,y:0,rx:0,ry:142,rz:0},{x:-16.4689,z:-184.86,y:0,rx:0,ry:134,rz:0},{x:348.715,z:30.0344,y:0,rx:0,ry:0,rz:0},{x:430.715,z:30.0344,y:0,rx:0,ry:0,rz:0}],UJ=[{x:-532.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-512.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-492.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-472.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-452.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-432.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-412.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-392.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-372.858,z:-13.6876,y:0,rx:0,ry:0,rz:0},{x:-352.858,z:-13.6876,y:0,rx:0,ry:0,rz:0}
4053,{x:-448.989,z:-48.0753,y:0,rx:0,ry:90,rz:0},{x:-448.989,z:-68.0753,y:0,rx:0,ry:90,rz:0},{x:-448.989,z:-88.0753,y:0,rx:0,ry:90,rz:0},{x:-448.989,z:-108.075,y:0,rx:0,ry:90,rz:0},{x:-448.989,z:-128.075,y:0,rx:0,ry:90,rz:0},{x:-448.989,z:-148.075,y:0,rx:0,ry:90,rz:0},{x:-427.127,z:-138.116,y:0,rx:0,ry:-32.64,rz:0},{x:-410.109,z:-127.026,y:0,rx:0,ry:-32.64,rz:0},{x:-393.109,z:-115.884,y:0,rx:0,ry:-32.64,rz:0},{x:-374.79,z:-106.656,y:0,rx:0,ry:0,rz:0}],NJ=[{x:-533.958,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-531.158,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-528.358,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-525.558,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-522.758,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-519.958,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-517.158,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-514.358,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-511.558,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-508.758,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-505.958,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-503.158,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-500.358,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-497.558,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-494.758,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-491.958,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-489.158,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-486.358,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-483.558,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-480.758,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-477.958,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-475.158,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-472.358,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-469.558,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-466.758,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-463.958,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-461.158,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-442.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-440.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-437.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-434.524,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-431.724,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-428.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-426.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-423.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-420.524,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-417.724,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-414.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-412.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-409.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-406.524,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-403.724,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-400.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-398.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-395.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-392.524,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-389.724,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-386.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-384.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-381.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-378.524,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-375.724,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-372.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-370.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-367.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-364.524,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-361.724,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-358.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-356.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-353.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-350.524,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-347.724,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-313.12,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-310.32,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-307.52,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-304.72,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-301.92,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-299.12,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-296.32,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-293.52,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-290.72,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-287.92,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-285.12,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-282.32,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-279.52,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-276.72,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-273.92,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-271.12,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-268.32,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-265.52,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-262.72,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-259.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-257.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-254.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-251.524,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-248.724,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-245.924,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-243.124,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-240.324,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-225.198,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-222.398,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-219.598,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-216.798,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-213.998,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-211.198,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-208.398,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-205.598,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-202.798,z:-34.6208,y:0,rx:0,ry:0,rz:0}
4053,{x:-199.998,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-197.198,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-194.398,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-191.598,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-188.798,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-185.998,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-183.198,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-180.398,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-177.598,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-174.798,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-171.998,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-169.198,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-166.398,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-163.598,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-160.798,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-157.998,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-155.198,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-152.398,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-149.598,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-146.798,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-143.998,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-141.198,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-127.224,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-124.424,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-121.624,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-118.824,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-116.024,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-113.224,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-110.424,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-107.624,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-104.824,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-102.024,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-99.224,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-96.424,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-93.624,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-90.824,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-88.024,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-85.224,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-82.424,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-79.624,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-76.824,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-74.024,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-71.224,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-68.424,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-65.624,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-62.824,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-60.024,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-57.224,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-54.424,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-51.624,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-48.824,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-46.024,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-43.224,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-40.424,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-37.624,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-34.824,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-32.024,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-29.224,z:-34.6208,y:0,rx:0,ry:0,rz:0},{x:-324.66,z:-156.691,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-153.891,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-151.091,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-148.291,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-145.491,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-142.691,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-139.891,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-137.091,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-134.291,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-131.491,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-128.691,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-125.891,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-123.091,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-120.291,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-117.491,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-114.691,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-111.891,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-109.091,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-106.291,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-103.491,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-100.691,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-97.891,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-95.091,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-92.291,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-89.491,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-86.691,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-83.891,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-81.091,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-78.291,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-68.253,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-65.453,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-62.653,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-59.853,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-57.053,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-54.253,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-51.453,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-48.653,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-45.853,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-43.053,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-40.253,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-37.453,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-34.653,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-11.905,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-9.105,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-6.305,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-3.505,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:-.705,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:11.287,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:14.087,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:16.887,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:19.687,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:32.012,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:34.812,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:37.612,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:40.412,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:43.212,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:46.012,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:48.812,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:51.612,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:54.412,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:57.212,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:60.012,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:62.812,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:65.612,y:0,rx:0,ry:-90,rz:0},{x:-324.66,z:68.412,y:0,rx:0,ry:-90,rz:0}],kJ=[{x:-424.211,z:27.4461,y:0,rx:0,ry:0,rz:0},{x:-417.742,z:16.2663,y:0,rx:0,ry:-90,rz:0},{x:-404.294,z:20.6856,y:0,rx:0,ry:-180,rz:0}
4053,{x:-410.97,z:34.2917,y:0,rx:0,ry:90,rz:0},{x:-417.742,z:96.5534,y:0,rx:0,ry:-90,rz:0},{x:-419.184,z:107.298,y:0,rx:0,ry:0,rz:0},{x:-419.184,z:114.088,y:0,rx:0,ry:0,rz:0},{x:-404.388,z:103.65,y:0,rx:0,ry:-180,rz:0}],HJ=[{x:-424.192,z:20.7055,y:0,rx:0,ry:0,rz:0},{x:-410.97,z:16.266,y:0,rx:0,ry:-90,rz:0},{x:-404.294,z:27.4575,y:0,rx:0,ry:-180,rz:0},{x:-417.742,z:34.292,y:0,rx:0,ry:90,rz:0},{x:-410.97,z:96.553,y:0,rx:0,ry:-90,rz:0},{x:-404.388,z:113.589,y:0,rx:0,ry:-180,rz:0}],gi={trees:LJ,builds1:DJ,builds2:zJ,builds3:FJ,smallHuts:OJ,lights:UJ,blocs:NJ,traficLights:kJ,userLights:HJ};function GJ(){const{nodes:n}=Ct("./models/map/tree.glb"),e=Gt("./textures/map/tree.jpg");e.flipY=!1;const t=H.useRef(),i=gi.trees.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;gi.trees.forEach((o,a)=>{const{x:l,y:c,z:u,sx:d,sy:p,sz:m}=o;s.position.set(l,c,u),s.scale.set(d,p,m),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.tree.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function VJ(){const{nodes:n}=Ct("./models/map/build1.glb"),e=Gt("./textures/map/build1.jpg");e.flipY=!1;const t=H.useRef(),i=gi.builds1.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;gi.builds1.forEach((o,a)=>{const{x:l,y:c,z:u,sx:d,sy:p,sz:m}=o;s.position.set(l,c,u),s.scale.set(d,p,m),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.build1.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function WJ(){const{nodes:n}=Ct("./models/map/build2.glb"),e=Gt("./textures/map/build2.jpg");e.flipY=!1;const t=H.useRef(),i=gi.builds2.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;gi.builds2.forEach((o,a)=>{const{x:l,y:c,z:u,sx:d,sy:p,sz:m}=o;s.position.set(l,c,u),s.scale.set(d,p,m),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.build2.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function jJ(){const{nodes:n}=Ct("./models/map/build3.glb"),e=Gt("./textures/map/build3.jpg");e.flipY=!1;const t=H.useRef(),i=gi.builds3.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;gi.builds3.forEach((o,a)=>{const{x:l,y:c,z:u,sx:d,sy:p,sz:m}=o;s.position.set(l,c,u),s.scale.set(d,p,m),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.build3.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function XJ(){const{nodes:n}=Ct("./models/map/bloc.glb"),e=Gt("./textures/map/bloc.jpg");e.flipY=!1;const t=H.useRef(),i=gi.blocs.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;gi.blocs.forEach((o,a)=>{const l=pi.degToRad(o.rx),c=pi.degToRad(o.ry),u=pi.degToRad(o.rz);s.position.set(o.x,o.y,o.z),s.rotation.set(l,c,u),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.bloc.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function JJ(){const{nodes:n}=Ct("./models/map/light.glb"),e=Gt("./textures/map/light.jpg");e.flipY=!1;const t=H.useRef(),i=gi.lights.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;gi.lights.forEach((o,a)=>{const l=pi.degToRad(o.rx),c=pi.degToRad(o.ry),u=pi.degToRad(o.rz);s.position.set(o.x,o.y,o.z),s.rotation.set(l,c,u),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.light.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function YJ(){const{nodes:n}=Ct("./models/map/signs.glb");return F.jsx("mesh",{geometry:n.signs.geometry,onClick:e=>e.stopPropagation(),onPointerEnter:e=>e.stopPropagation(),children:F.jsx("meshBasicMaterial",{color:16777215})})}function KJ(){const{nodes:n}=Ct("./models/map/largeHut.glb"),e=Gt("./textures/map/largeHut.jpg");return e.flipY=!1,F.jsx("mesh",{geometry:n.lcab.geometry,onClick:t=>t.stopPropagation(),onPointerEnter:t=>t.stopPropagation(),children:F.jsx("meshBasicMaterial",{map:e})})}function QJ(){const{nodes:n}=Ct("./models/map/smallHut.glb"),e=Gt("./textures/map/smallHut.jpg");e.flipY=!1;const t=H.useRef(),i=gi.smallHuts.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;
4053gi.smallHuts.forEach((o,a)=>{const l=pi.degToRad(o.rx),c=pi.degToRad(o.ry),u=pi.degToRad(o.rz);s.position.set(o.x,o.y,o.z),s.rotation.set(l,c,u),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.smallHut.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function ZJ(){const{nodes:n}=Ct("./models/map/sideroads.glb");return F.jsx("mesh",{geometry:n.sideroads.geometry,onClick:e=>e.stopPropagation(),onPointerEnter:e=>e.stopPropagation(),children:F.jsx("meshBasicMaterial",{color:12632256})})}function qJ(){const{nodes:n}=Ct("./models/map/localCenter.glb"),e=Gt("./textures/map/localCenter.jpg");return e.flipY=!1,F.jsx("mesh",{geometry:n.localCenter.geometry,onClick:t=>t.stopPropagation(),onPointerEnter:t=>t.stopPropagation(),children:F.jsx("meshBasicMaterial",{map:e})})}function $J(){const{nodes:n}=Ct("./models/map/traficLight.glb"),e=Gt("./textures/map/traficLight.jpg");e.flipY=!1;const t=H.useRef(),i=gi.traficLights.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;gi.traficLights.forEach((o,a)=>{const l=pi.degToRad(o.rx),c=pi.degToRad(o.ry),u=pi.degToRad(o.rz);s.position.set(o.x,o.y,o.z),s.rotation.set(l,c,u),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.traficLight.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function eY(){const{nodes:n}=Ct("./models/map/userLight.glb"),e=Gt("./textures/map/userLight.jpg");e.flipY=!1;const t=H.useRef(),i=gi.userLights.length,r=H.useRef(new Float32Array(i*16)).current;return H.useEffect(()=>{const s=new gt;gi.userLights.forEach((o,a)=>{const l=pi.degToRad(o.rx),c=pi.degToRad(o.ry),u=pi.degToRad(o.rz);s.position.set(o.x,o.y,o.z),s.rotation.set(l,c,u),s.updateMatrix(),s.matrix.toArray(r,a*16)}),t.current.instanceMatrix.set(r),t.current.instanceMatrix.needsUpdate=!0},[i,r]),F.jsx("instancedMesh",{ref:t,args:[n.userLight.geometry,null,i],onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),frustumCulled:!1,children:F.jsx("meshBasicMaterial",{map:e})})}function tY(){const{nodes:n}=Ct("./models/map/elecLocal.glb"),e=Gt("./textures/map/elecLocal.jpg");return e.flipY=!1,F.jsx("mesh",{geometry:n.elecLocal.geometry,onClick:t=>t.stopPropagation(),onPointerEnter:t=>t.stopPropagation(),children:F.jsx("meshBasicMaterial",{map:e})})}function nY(){const{nodes:n}=Ct("./models/map/road.glb");return F.jsx("mesh",{geometry:n.road.geometry,onClick:e=>e.stopPropagation(),onPointerEnter:e=>e.stopPropagation(),children:F.jsx("meshBasicMaterial",{color:14540253})})}function iY({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[0,0,0]}){const i=H.useRef();return F.jsx(F.Fragment,{children:F.jsx("group",{ref:i,position:n,rotation:[0,0,0],scale:t,children:F.jsxs(TD,{children:[F.jsx(tY,{}),F.jsx($J,{}),F.jsx(eY,{}),F.jsx(BJ,{}),F.jsx(IJ,{}),F.jsx(YJ,{}),F.jsx(GJ,{}),F.jsx(VJ,{}),F.jsx(WJ,{}),F.jsx(jJ,{}),F.jsx(QJ,{}),F.jsx(KJ,{}),F.jsx(qJ,{}),F.jsx(ZJ,{}),F.jsx(XJ,{}),F.jsx(JJ,{}),F.jsx(nY,{})]})})})}const rY=H.forwardRef((n,e)=>{const t=Ct("./models/truck/cabin.glb"),i=Gt("./textures/truck/cabin.jpg");return i.flipY=!1,F.jsx(F.Fragment,{children:F.jsx("mesh",{geometry:t.nodes.cabin.geometry,onClick:r=>r.stopPropagation(),onPointerEnter:r=>r.stopPropagation(),ref:e,renderOrder:2,children:F.jsx("meshBasicMaterial",{map:i,transparent:!0,opacity:1,blending:ti})})})}),sY=H.forwardRef((n,e)=>{const t=Ct("./models/truck/trailer.glb"),i=Gt("./textures/truck/trailer.jpg");return i.flipY=!1,F.jsx(F.Fragment,{children:F.jsx("mesh",{geometry:t.nodes.trailer.geometry,onClick:r=>r.stopPropagation(),onPointerEnter:r=>r.stopPropagation(),ref:e,renderOrder:2,children:F.jsx("meshBasicMaterial",{map:i,transparent:!0,opacity:1,blending:ti})})})}),oY=H.forwardRef((n,e)=>{const t=Ct("./models/truck/flockL.glb"),i=Gt("./textures/truck/flockL.jpg");return i.flipY=!1,F.jsx(F.Fragment,{children:F.jsx("mesh",{geometry:t.nodes.flockL.geometry,onClick:r=>r.stopPropagation(),onPointerEnter:r=>r.stopPropagation(),ref:e,children:F.jsx("meshBasicMaterial",{map:i,transparent:!0,opacity:1,blending:ti})})})}),aY=H.forwardRef((n,e)=>{const t=Ct("./models/truck/flockR.glb"),i=Gt("./textures/truck/flockR.jpg");return i.flipY=!1,F.jsx(F.Fragment,{children:F.jsx("mesh",{geometry:t.nodes.flockR.geometry,onClick:r=>r.stopPropagation(),onPointerEnter:r=>r.stopPropagation(),ref:e,children:F.jsx("meshBasicMaterial",{map:i,transparent:!0,opacity:1,blending:ti})})})}),lY=H.forwardRef(({isActive:n,opacity:e=1},t)=>{const i=Ct("./models/truck/batteries.glb"),r=Gt("./textures/truck/batteries.jpg");r.flipY=!1;const s=H.useMemo(()=>{const a=new ei({color:new Re(0,.3,20),toneMapped:!1,transparent:!0,opacity:e}),l=new ei({map:r,transparent:!0,opacity:e});return{glowBlue:a,baseMaterial:l}},[r,e]),o=n?s.glowBlue:s.baseMaterial;return H.useImperativeHandle(t,()=>({glowBlueMaterial:s.glowBlue,baseMaterial:s.baseMaterial})),F.jsx(F.Fragment,{children:F.jsx("mesh",{geometry:i.nodes.batteries.geometry,onClick:a=>a.stopPropagation(),onPointerEnter:a=>a.stopPropagation(),ref:t,renderOrder:2,children:F.jsx("primitive",{attach:"material",object:o})})})}),od=H.forwardRef(({position:n=[0,20,0],isRotate:e=!1},t)=>{const i=Ct("./models/truck/truckWheels.glb"),r=Gt("./textures/truck/truckWheels.jpg");r.flipY=!1;const s=H.useRef();return H.useImperativeHandle(t,()=>({get rotation(){return s.current.rotation},set rotation(o){s.current.rotation=o},...s.current}),[s]),pl(()=>{e&&s.current&&(s.current.rotation.x+=.06)}),F.jsx("mesh",{ref:s,geometry:i.nodes.wheels.geometry,position:n,onClick:o=>o.stopPropagation(),onPointerEnter:o=>o.stopPropagation(),renderOrder:2,children:F.jsx("meshBasicMaterial",{map:r,transparent:!0,opacity:.2,blending:ti})})}),cY=H.forwardRef(({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[1,1,1]},i)=>{const{nodes:r}=Ct("./models/ccr/arm.glb"),s=Gt("./textures/ccr/arm.jpg");return s.flipY=!1,F.jsx("mesh",{ref:i,geometry:r.arm.geometry,onClick:o=>o.stopPropagation(),onPointerEnter:o=>o.stopPropagation(),position:n,rotation:e,scale:t,children:F.jsx("meshBasicMaterial",{map:s,transparent:!0,opacity:1,blending:ti})})}),uY=H.forwardRef(({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[1,1,1]},i)=>{const{nodes:r}=Ct("./models/ccr/armSupport.glb"),s=Gt("./textures/ccr/armSupport.jpg");return s.flipY=!1,F.jsx("mesh",{ref:i,geometry:r.armSupport.geometry,onClick:o=>o.stopPropagation(),onPointerEnter:o=>o.stopPropagation(),position:n,rotation:e,scale:t,children:F.jsx("meshBasicMaterial",{map:s,transparent:!0,opacity:1,blending:ti})})}),hY=H.forwardRef(({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[1,1,1]},i)=>{const{nodes:r}=Ct("./models/ccr/plunger.glb"),s=Gt("./textures/ccr/plunger.jpg");return s.flipY=!1,F.jsx("mesh",{ref:i,geometry:r.plunger.geometry,onClick:o=>o.stopPropagation(),onPointerEnter:o=>o.stopPropagation(),position:n,rotation:e,scale:t,children:F.jsx("meshBasicMaterial",{map:s,transparent:!0,opacity:1,blending:ti})})}),fY=H.forwardRef(({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[1,1,1]},i)=>{const{nodes:r}=Ct("./models/ccr/rods.glb"),s=Gt("./textures/ccr/rods.jpg");return s.flipY=!1,F.jsx("mesh",{ref:i,geometry:r.rods.geometry,onClick:o=>o.stopPropagation(),onPointerEnter:o=>o.stopPropagation(),position:n,rotation:e,scale:t,children:F.jsx("meshBasicMaterial",{map:s,transparent:!0,opacity:1,blending:ti})})}),dY=H.forwardRef(({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[1,1,1]},i)=>{const{nodes:r}=Ct("./models/ccr/sensor.glb"),s=Gt("./textures/ccr/sensor.jpg");return s.flipY=!1,F.jsx("mesh",{ref:i,geometry:r.sensor.geometry,onClick:o=>o.stopPropagation(),onPointerEnter:o=>o.stopPropagation(),position:n,rotation:e,scale:t,children:F.jsx("meshBasicMaterial",{map:s,transparent:!0,opacity:1,blending:ti})})}),pY=H.forwardRef(({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[1,1,1]},i)=>{const{nodes:r}=Ct("./models/ccr/springs.glb"),s=Gt("./textures/ccr/springs.jpg");return s.flipY=!1,F.jsx("mesh",{ref:i,geometry:r.springs.geometry,onClick:o=>o.stopPropagation(),onPointerEnter:o=>o.stopPropagation(),position:n,rotation:e,scale:t,children:F.jsx("meshBasicMaterial",{map:s,transparent:!0,opacity:1,blending:ti})})}),mY=H.forwardRef(({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[1,1,1]},i)=>{const{nodes:r}=Ct("./models/ccr/support.glb"),s=Gt("./textures/ccr/support.jpg");
4053return s.flipY=!1,F.jsx("mesh",{ref:i,geometry:r.support.geometry,onClick:o=>o.stopPropagation(),onPointerEnter:o=>o.stopPropagation(),position:n,rotation:e,scale:t,children:F.jsx("meshBasicMaterial",{map:s,transparent:!0,opacity:1,blending:ti})})});function gY({position:n=[0,-40,0],rotation:e=[0,Math.PI/2,0],scale:t=[.72,.72,.72],isActive:i=!1,isVisible:r=!0}){const s=H.useRef(),o=H.useRef(),a=H.useRef(),l=H.useRef(),c=H.useRef(),u=H.useRef(),d=H.useRef(),p=_=>{mt.to(s.current.material,{opacity:_,duration:1}),mt.to(o.current.material,{opacity:_,duration:1}),mt.to(a.current.material,{opacity:_,duration:1}),mt.to(l.current.material,{opacity:_,duration:1}),mt.to(c.current.material,{opacity:_,duration:1}),mt.to(u.current.material,{opacity:_,duration:1}),mt.to(d.current.material,{opacity:_,duration:1})},m=()=>{mt.to(u.current.position,{y:-.068,duration:1.2,ease:"power1.out"}),mt.to(s.current.position,{y:-.164,duration:1.2,ease:"power1.out"}),mt.to(o.current.position,{y:-.37,duration:1.2,ease:"power1.out"}),mt.to(a.current.scale,{y:1.46,duration:1.2,ease:"power1.out"}),mt.to(l.current.position,{y:-.234,duration:1.2,ease:"power1.out"}),mt.to(c.current.position,{y:-.298,duration:1.2,ease:"power1.out"}),mt.to(s.current.rotation,{z:-Math.PI/12,duration:1.2,ease:"power1.out"}),mt.to(o.current.rotation,{z:-Math.PI/10,duration:1.2,ease:"power1.out"}),mt.to(l.current.position,{y:-.41,x:.65,duration:1.2,ease:"power1.out"}),mt.to(c.current.rotation,{z:-Math.PI/12,duration:1.2,ease:"power1.out"})},y=()=>{mt.to(u.current.position,{y:.03,duration:1.2,ease:"power1.out"}),mt.to(s.current.position,{y:-.066,duration:1.2,ease:"power1.out"}),mt.to(o.current.position,{y:-.272,duration:1.2,ease:"power1.out"}),mt.to(a.current.scale,{y:1,duration:1.2,ease:"power1.out"}),mt.to(l.current.position,{y:-.136,duration:1.2,ease:"power1.out"}),mt.to(c.current.position,{y:-.2,duration:1.2,ease:"power1.out"}),mt.to(s.current.rotation,{z:0,duration:1.2,ease:"power1.out"}),mt.to(o.current.rotation,{z:0,duration:1.2,ease:"power1.out"}),mt.to(l.current.position,{y:-.136,x:.69,duration:1.2,ease:"power1.out"}),mt.to(c.current.rotation,{z:0,duration:1.2,ease:"power1.out"})};return H.useEffect(()=>{i?m():y()},[i]),H.useEffect(()=>{p(r?1:0)},[r]),F.jsx(F.Fragment,{children:F.jsx("group",{position:n,rotation:e,scale:t,children:F.jsxs(TD,{children:[F.jsx(uY,{ref:u,position:[-.036,.03,.022],scale:[1,1,1],rotation:[0,0,0]}),F.jsx(cY,{ref:s,position:[-.014,-.066,.022],scale:[1,1,1],rotation:[0,0,0]}),F.jsx(hY,{ref:o,position:[.08,-.272,.022],scale:[1,1,1],rotation:[0,0,0]}),F.jsx(pY,{ref:a,position:[-.084,.2,.022],scale:[1,1,1],rotation:[0,0,0]}),F.jsx(dY,{ref:l,position:[.69,-.136,.022],scale:[1,1,1],rotation:[0,0,0]}),F.jsx(fY,{ref:c,position:[-.022,-.2,.022],scale:[1,1,1],rotation:[0,0,0]}),F.jsx(mY,{ref:d})]})})})}const yY=Gz.map(n=>new z(parseFloat(n.x)-4,parseFloat(n.y),parseFloat(n.z)-59.1)),Tb=new Hp(yY);function _Y({setTruckPos:n,position:e=[0,0,0],rotation:t=[0,0,0],scale:i=[1.2,1.2,1.2],isMooving:r=!1}){const[s,o]=H.useState(!1),[a,l]=H.useState(!1),[c,u]=H.useState(!1),d=H.useRef(),p=Ss(),m=H.useRef(.106),y=H.useRef(),_=H.useRef(),x=H.useRef(),g=H.useRef(),v=H.useRef(),S=Array.from({length:5},()=>H.useRef()),M=(w,T,R)=>{mt.to(y.current.material,{opacity:T,duration:1}),mt.to(_.current.material,{opacity:T,duration:1}),mt.to(x.current.material,{opacity:T,duration:1}),mt.to(g.current.material,{opacity:T,duration:1}),mt.to(v.current.glowBlueMaterial,{opacity:w,duration:1}),mt.to(v.current.baseMaterial,{opacity:w,duration:1}),l(R),S.forEach(B=>{mt.to(B.current.material,{opacity:T,duration:1})})};return H.useEffect(()=>{switch(p.pathname){case"/captation":M(.2,.2,!0);break;case"/charge":M(.8,.25,!0);break;default:m.current=.2,M(1,1,!0);break}},[p.pathname]),pl((w,T)=>{if(r){let R=.028*T;p.pathname==="/smartpowering"?(R=.02*T,m.current+=R,m.current>.34&&(m.current=.22)):p.pathname==="/captation"||p.pathname==="/charge"?(R=.001*T,m.current+=R,m.current>.131&&M(0,0,!1),m.current>.132&&(m.current=.106,M(.8,.25,!0))):m.current=(m.current+R)%1,n(m.current);const B=Tb.getPoint(m.current);d.current.position.copy(B);const b=Tb.getPoint((m.current+.002)%1);d.current.lookAt(b),m.current>=.1154&&m.current<=.35328?o(!0):o(!1),p.pathname==="/charge"&&m.current>=.116&&m.current<=.35328?u(!0):u(!1)}}),F.jsx(F.Fragment,{children:F.jsxs("group",{ref:d,position:e,rotation:[0,Math.PI,0],scale:i,children:[F.jsx(lY,{isActive:c,ref:v,position:[0,1,-5]}),F.jsx(od,{ref:S[0],position:[0,.23,1.54],isRotate:r}),F.jsx(od,{ref:S[1],position:[0,.23,5.1],isRotate:r}),F.jsx(od,{ref:S[2],position:[0,.23,-3.31],isRotate:r}),F.jsx(od,{ref:S[3],position:[0,.23,-4.35],isRotate:r}),F.jsx(od,{ref:S[4],position:[0,.23,-5.4],isRotate:r}),F.jsx(rY,{ref:_,position:[0,1,2]}),F.jsx(oY,{ref:g,position:[-1,0,3]}),F.jsx(aY,{ref:x,position:[1,0,3]}),F.jsx(sY,{ref:y,position:[0,1,-10]}),F.jsx(gY,{position:[0,.24,4.4],isActive:s,isVisible:a})]})})}function xY(){const n=Ct("./models/car/carBody.glb"),e=Gt("./textures/car/carBody.jpg");return e.flipY=!1,F.jsx(F.Fragment,{children:F.jsx("mesh",{geometry:n.nodes.carBody.geometry,onClick:t=>t.stopPropagation(),onPointerEnter:t=>t.stopPropagation(),children:F.jsx("meshBasicMaterial",{map:e})})})}function vY(){const n=Ct("./models/car/flockCar.glb"),e=Gt("./textures/car/flockCar.jpg");return e.flipY=!1,F.jsx(F.Fragment,{children:F.jsx("mesh",{geometry:n.nodes.flockCar.geometry,onClick:t=>t.stopPropagation(),onPointerEnter:t=>t.stopPropagation(),children:F.jsx("meshBasicMaterial",{map:e})})})}function Cb({position:n=[0,20,0],isRotate:e=!1}){const t=Ct("./models/car/carWheels.glb"),i=Gt("./textures/car/carWheels.jpg");i.flipY=!1;const r=H.useRef();return pl(()=>{e&&(r.current.rotation.x+=.1)}),F.jsx("mesh",{ref:r,geometry:t.nodes.carWheels.geometry,position:n,onClick:s=>s.stopPropagation(),onPointerEnter:s=>s.stopPropagation(),children:F.jsx("meshBasicMaterial",{map:i})})}const AY=wJ.map(n=>new z(parseFloat(n.x)-4.4,parseFloat(n.y),parseFloat(n.z)-59.1)),Rb=new Hp(AY);function SY({position:n=[0,0,0],rotation:e=[0,0,0],scale:t=[1,1,1],startOffset:i=0}){const r=H.useRef(),[s,o]=H.useState(i);return pl((a,l)=>{o(p=>(p+.008*l)%1);const c=Rb.getPoint(s);r.current.position.copy(c);const u=(s+.001)%1,d=Rb.getPoint(u);r.current.lookAt(d)}),F.jsx(F.Fragment,{children:F.jsxs("group",{ref:r,position:n,rotation:[0,Math.PI,0],scale:t,children:[F.jsx(xY,{position:[0,0,0]}),F.jsx(vY,{}),F.jsx(Cb,{position:[0,.04,1.72],isRotate:!0}),F.jsx(Cb,{position:[0,.04,-1.72],isRotate:!0})]})})}function MY({numCars:n=4}){const e=Array.from({length:n},(t,i)=>i/n);return F.jsx(F.Fragment,{children:e.map((t,i)=>F.jsx(SY,{startOffset:t},i))})}function EY({opacity:n=1,...e}){const t=new ei({color:new Re(0,.3,20),toneMapped:!1,transparent:!0,opacity:n}
4053),{nodes:i}=Ct("./models/generator.glb");return F.jsx("group",{...e,dispose:null,children:F.jsx("mesh",{geometry:i.generator.geometry,material:t,position:[-402.354,6.2,-282.407]})})}const zn=ZW();lx({UnrealBloomPass:uw});function wY(){const[n,e]=H.useState(0);return F.jsx(F.Fragment,{children:F.jsx(H.Suspense,{fallback:F.jsx(PJ,{}),children:F.jsx(Xj,{children:F.jsxs(hJ,{children:[F.jsx(zn.Out,{}),F.jsxs(qG,{flat:!0,camera:{fov:45,near:1,far:1500,position:[-1200,20,-200]},children:[F.jsx("color",{args:["#fbf8f4"],attach:"background"}),F.jsx(EJ,{}),F.jsx(bJ,{truckPos:n}),F.jsx(iY,{scale:[1,1,1]}),F.jsx(_Y,{isMooving:!0,setTruckPos:e}),F.jsx(MJ,{truckPos:n}),F.jsx(MY,{}),F.jsx(TY,{}),F.jsx(zn.In,{children:F.jsx(pJ,{})}),F.jsx(zn.In,{children:F.jsx(mJ,{})}),F.jsx(zn.In,{children:F.jsx(gJ,{})}),F.jsx(zn.In,{children:F.jsx(xJ,{})}),F.jsx(zn.In,{children:F.jsx(yJ,{})}),F.jsx(zn.In,{children:F.jsx(_J,{})}),F.jsx(zn.In,{children:F.jsx(vJ,{})}),F.jsx(zn.In,{children:F.jsx(AJ,{})}),F.jsx(zn.In,{children:F.jsx(SJ,{})}),F.jsx(dJ,{}),F.jsxs(Nj,{children:[F.jsx(ts,{path:"/",element:F.jsx(zn.In,{children:F.jsx(fJ,{})})}),F.jsx(ts,{path:"/about",element:F.jsx(zn.In,{children:F.jsx(eo,{})})}),F.jsx(ts,{path:"/energyflow",element:F.jsx(zn.In,{children:F.jsx(eo,{})})}),F.jsx(ts,{path:"/smartpowering",element:F.jsx(zn.In,{children:F.jsx(eo,{})})}),F.jsx(ts,{path:"/captation",element:F.jsx(zn.In,{children:F.jsx(eo,{})})}),F.jsx(ts,{path:"/charge",element:F.jsx(zn.In,{children:F.jsx(eo,{})})}),F.jsx(ts,{path:"/autonomy",element:F.jsx(zn.In,{children:F.jsx(eo,{})})}),F.jsx(ts,{path:"/map",element:F.jsx(F.Fragment,{children:F.jsx(zn.In,{children:F.jsx(eo,{})})})}),F.jsx(ts,{path:"/autoroute",element:F.jsx(zn.In,{children:F.jsx(eo,{})})}),F.jsx(ts,{path:"/villelaboratoire",element:F.jsx(zn.In,{children:F.jsx(eo,{})})}),F.jsx(ts,{path:"/routescampagne",element:F.jsx(zn.In,{children:F.jsx(eo,{})})})]})]})]})})})})}function TY(){const n=H.useRef(null),e=H.useRef(0),[t,i]=H.useState(0),r=Ss();return H.useEffect(()=>{r.pathname==="/energyflow"||r.pathname==="/smartpowering"?mt.to({opacity:t},{duration:3,opacity:1,onUpdate:function(){i(this.targets()[0].opacity)}}):mt.to({opacity:t},{duration:2,opacity:0,onUpdate:function(){i(this.targets()[0].opacity)}})},[r]),pl(({clock:s})=>{const o=s.getElapsedTime(),c=.2*Math.sin(5*o);e.current=c+.4,n.current&&(n.current.strength=e.current)}),F.jsxs(F.Fragment,{children:[F.jsx(EY,{opacity:t}),F.jsx(hV,{disableGamma:!0,children:F.jsx("unrealBloomPass",{ref:n,threshold:1,strength:e.current,radius:.02})})]})}const CY=bA.createRoot(document.querySelector("#root"));CY.render(F.jsx(_c.StrictMode,{children:F.jsx(wY,{})})); 4054//# sourceMappingURL=index-D_zeUMzR.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.