vendor: 4,898 bytes, lines 1-9
1var vI=Object.defineProperty;var yI=(n,e,t)=>e in n?vI(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var En=(n,e,t)=>yI(n,typeof e!="symbol"?e+"":e,t);(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 _I(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var u2={exports:{}},ag={},f2={exports:{}},zt={};/** 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 Zf=Symbol.for("react.element"),xI=Symbol.for("react.portal"),SI=Symbol.for("react.fragment"),MI=Symbol.for("react.strict_mode"),wI=Symbol.for("react.profiler"),EI=Symbol.for("react.provider"),TI=Symbol.for("react.context"),AI=Symbol.for("react.forward_ref"),bI=Symbol.for("react.suspense"),RI=Symbol.for("react.memo"),CI=Symbol.for("react.lazy"),FM=Symbol.iterator;function PI(n){return n===null||typeof n!="object"?null:(n=FM&&n[FM]||n["@@iterator"],typeof n=="function"?n:null)}var h2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d2=Object.assign,p2={};function Uc(n,e,t){this.props=n,this.context=e,this.refs=p2,this.updater=t||h2}Uc.prototype.isReactComponent={};Uc.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")};Uc.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function m2(){}m2.prototype=Uc.prototype;function lx(n,e,t){this.props=n,this.context=e,this.refs=p2,this.updater=t||h2}var cx=lx.prototype=new m2;cx.constructor=lx;d2(cx,Uc.prototype);cx.isPureReactComponent=!0;var kM=Array.isArray,g2=Object.prototype.hasOwnProperty,ux={current:null},v2={key:!0,ref:!0,__self:!0,__source:!0};function y2(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)g2.call(e,i)&&!v2.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1<a){for(var u=Array(a),f=0;f<a;f++)u[f]=arguments[f+2];r.children=u}if(n&&n.defaultProps)for(i in a=n.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:Zf,type:n,key:s,ref:o,props:r,_owner:ux.current}}function II(n,e){return{$$typeof:Zf,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function fx(n){return typeof n=="object"&&n!==null&&n.$$typeof===Zf}function LI(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var zM=/\/+/g;function mv(n,e){return typeof n=="object"&&n!==null&&n.key!=null?LI(""+n.key):e.toString(36)}function Rp(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 Zf:case xI:o=!0}}if(o)return o=n,r=r(o),n=i===""?"."+mv(o,0):i,kM(r)?(t="",n!=null&&(t=n.replace(zM,"$&/")+"/"),Rp(r,e,t,"",function(f){return f})):r!=null&&(fx(r)&&(r=II(r,t+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(zM,"$&/")+"/")+n)),e.push(r)),1;if(o=0,i=i===""?".":i+":",kM(n))for(var a=0;a<n.length;a++){s=n[a];var u=i+mv(s,a);o+=Rp(s,e,t,u,r)}else if(u=PI(n),typeof u=="function")for(n=u.call(n),a=0;!(s=n.next()).done;)s=s.value,u=i+mv(s,a++),o+=Rp(s,e,t,u,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 gd(n,e,t){if(n==null)return n;var i=[],r=0;return Rp(n,i,"","",function(s){return e.call(t,s,r++)}),i}function NI(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 Li={current:null},Cp={transition:null}
vendor: 4,115 bytes, lines 9-24
9,DI={ReactCurrentDispatcher:Li,ReactCurrentBatchConfig:Cp,ReactCurrentOwner:ux};function _2(){throw Error("act(...) is not supported in production builds of React.")}zt.Children={map:gd,forEach:function(n,e,t){gd(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return gd(n,function(){e++}),e},toArray:function(n){return gd(n,function(e){return e})||[]},only:function(n){if(!fx(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};zt.Component=Uc;zt.Fragment=SI;zt.Profiler=wI;zt.PureComponent=lx;zt.StrictMode=MI;zt.Suspense=bI;zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DI;zt.act=_2;zt.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=d2({},n.props),r=n.key,s=n.ref,o=n._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=ux.current),e.key!==void 0&&(r=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(u in e)g2.call(e,u)&&!v2.hasOwnProperty(u)&&(i[u]=e[u]===void 0&&a!==void 0?a[u]:e[u])}var u=arguments.length-2;if(u===1)i.children=t;else if(1<u){a=Array(u);for(var f=0;f<u;f++)a[f]=arguments[f+2];i.children=a}return{$$typeof:Zf,type:n.type,key:r,ref:s,props:i,_owner:o}};zt.createContext=function(n){return n={$$typeof:TI,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:EI,_context:n},n.Consumer=n};zt.createElement=y2;zt.createFactory=function(n){var e=y2.bind(null,n);return e.type=n,e};zt.createRef=function(){return{current:null}};zt.forwardRef=function(n){return{$$typeof:AI,render:n}};zt.isValidElement=fx;zt.lazy=function(n){return{$$typeof:CI,_payload:{_status:-1,_result:n},_init:NI}};zt.memo=function(n,e){return{$$typeof:RI,type:n,compare:e===void 0?null:e}};zt.startTransition=function(n){var e=Cp.transition;Cp.transition={};try{n()}finally{Cp.transition=e}};zt.unstable_act=_2;zt.useCallback=function(n,e){return Li.current.useCallback(n,e)};zt.useContext=function(n){return Li.current.useContext(n)};zt.useDebugValue=function(){};zt.useDeferredValue=function(n){return Li.current.useDeferredValue(n)};zt.useEffect=function(n,e){return Li.current.useEffect(n,e)};zt.useId=function(){return Li.current.useId()};zt.useImperativeHandle=function(n,e,t){return Li.current.useImperativeHandle(n,e,t)};zt.useInsertionEffect=function(n,e){return Li.current.useInsertionEffect(n,e)};zt.useLayoutEffect=function(n,e){return Li.current.useLayoutEffect(n,e)};zt.useMemo=function(n,e){return Li.current.useMemo(n,e)};zt.useReducer=function(n,e,t){return Li.current.useReducer(n,e,t)};zt.useRef=function(n){return Li.current.useRef(n)};zt.useState=function(n){return Li.current.useState(n)};zt.useSyncExternalStore=function(n,e,t){return Li.current.useSyncExternalStore(n,e,t)};zt.useTransition=function(){return Li.current.useTransition()};zt.version="18.3.1";f2.exports=zt;var ee=f2.exports;/** 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 UI=ee,OI=Symbol.for("react.element"),FI=Symbol.for("react.fragment"),kI=Object.prototype.hasOwnProperty,zI=UI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,BI={key:!0,ref:!0,__self:!0,__source:!0};function x2(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)kI.call(e,i)&&!BI.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:OI,type:n,key:s,ref:o,props:r,_owner:zI.current}}ag.Fragment=FI;ag.jsx=x2;ag.jsxs=x2;u2.exports=ag;var H=u2.exports,S2={exports:{}},ur={},M2={exports:{}},w2={};/** 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.
vendor: 9,987 bytes, lines 25-33
25 */(function(n){function e(z,ie){var $=z.length;z.push(ie);e:for(;0<$;){var le=$-1>>>1,ye=z[le];if(0<r(ye,ie))z[le]=ie,z[$]=ye,$=le;else break e}}function t(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var ie=z[0],$=z.pop();if($!==ie){z[0]=$;e:for(var le=0,ye=z.length,De=ye>>>1;le<De;){var ue=2*(le+1)-1,Me=z[ue],we=ue+1,Ce=z[we];if(0>r(Me,$))we<ye&&0>r(Ce,Me)?(z[le]=Ce,z[we]=$,le=we):(z[le]=Me,z[ue]=$,le=ue);else if(we<ye&&0>r(Ce,$))z[le]=Ce,z[we]=$,le=we;else break e}}return ie}function r(z,ie){var $=z.sortIndex-ie.sortIndex;return $!==0?$:z.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var u=[],f=[],h=1,d=null,p=3,m=!1,y=!1,w=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(z){for(var ie=t(f);ie!==null;){if(ie.callback===null)i(f);else if(ie.startTime<=z)i(f),ie.sortIndex=ie.expirationTime,e(u,ie);else break;ie=t(f)}}function T(z){if(w=!1,M(z),!y)if(t(u)!==null)y=!0,Q(I);else{var ie=t(f);ie!==null&&pe(T,ie.startTime-z)}}function I(z,ie){y=!1,w&&(w=!1,v(N),N=-1),m=!0;var $=p;try{for(M(ie),d=t(u);d!==null&&(!(d.expirationTime>ie)||z&&!R());){var le=d.callback;if(typeof le=="function"){d.callback=null,p=d.priorityLevel;var ye=le(d.expirationTime<=ie);ie=n.unstable_now(),typeof ye=="function"?d.callback=ye:d===t(u)&&i(u),M(ie)}else i(u);d=t(u)}if(d!==null)var De=!0;else{var ue=t(f);ue!==null&&pe(T,ue.startTime-ie),De=!1}return De}finally{d=null,p=$,m=!1}}var C=!1,L=null,N=-1,B=5,A=-1;function R(){return!(n.unstable_now()-A<B)}function j(){if(L!==null){var z=n.unstable_now();A=z;var ie=!0;try{ie=L(!0,z)}finally{ie?Y():(C=!1,L=null)}}else C=!1}var Y;if(typeof S=="function")Y=function(){S(j)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ae=Z.port2;Z.port1.onmessage=j,Y=function(){ae.postMessage(null)}}else Y=function(){_(j,0)};function Q(z){L=z,C||(C=!0,Y())}function pe(z,ie){N=_(function(){z(n.unstable_now())},ie)}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(z){z.callback=null},n.unstable_continueExecution=function(){y||m||(y=!0,Q(I))},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(u)},n.unstable_next=function(z){switch(p){case 1:case 2:case 3:var ie=3;break;default:ie=p}var $=p;p=ie;try{return z()}finally{p=$}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(z,ie){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var $=p;p=z;try{return ie()}finally{p=$}},n.unstable_scheduleCallback=function(z,ie,$){var le=n.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?le+$:le):$=le,z){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=$+ye,z={id:h++,callback:ie,priorityLevel:z,startTime:$,expirationTime:ye,sortIndex:-1},$>le?(z.sortIndex=$,e(f,z),t(u)===null&&z===t(f)&&(w?(v(N),N=-1):w=!0,pe(T,$-le))):(z.sortIndex=ye,e(u,z),y||m||(y=!0,Q(I))),z},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(z){var ie=p;return function(){var $=p;p=ie;try{return z.apply(this,arguments)}finally{p=$}}}})(w2);M2.exports=w2;var HI=M2.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 GI=ee,lr=HI;function Le(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 E2=new Set,uf={};function el(n,e){vc(n,e),vc(n+"Capture",e)}function vc(n,e){for(uf[n]=e,n=0;n<e.length;n++)E2.add(e[n])}var Xs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vy=Object.prototype.hasOwnProperty,VI=/^[: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]*$/,BM={},HM={};function WI(n){return Vy.call(HM,n)?!0:Vy.call(BM,n)?!1:VI.test(n)?HM[n]=!0:(BM[n]=!0,!1)}function XI(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 jI(n,e,t,i){if(e===null||typeof e>"u"||XI(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 Ni(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 oi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){oi[n]=new Ni(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];oi[e]=new Ni(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){oi[n]=new Ni(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){oi[n]=new Ni(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){oi[n]=new Ni(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){oi[n]=new Ni(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){oi[n]=new Ni(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){oi[n]=new Ni(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){oi[n]=new Ni(n,5,!1,n.toLowerCase(),null,!1,!1)});var hx=/[\-:]([a-z])/g;function dx(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(hx,dx);oi[e]=new Ni(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(hx,dx);oi[e]=new Ni(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(hx,dx);oi[e]=new Ni(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){oi[n]=new Ni(n,1,!1,n.toLowerCase(),null,!1,!1)});oi.xlinkHref=new Ni("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){oi[n]=new Ni(n,1,!1,n.toLowerCase(),null,!0,!0)});function px(n,e,t,i){var r=oi.hasOwnProperty(e)?oi[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(jI(e,t,r,i)&&(t=null),i||r===null?WI(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 Qs=GI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vd=Symbol.for("react.element"),Xl=Symbol.for("react.portal"),jl=Symbol.for("react.fragment"),mx=Symbol.for("react.strict_mode"),Wy=Symbol.for("react.profiler"),T2=Symbol.for("react.provider"),A2=Symbol.for("react.context"),gx=Symbol.for("react.forward_ref"),Xy=Symbol.for("react.suspense"),jy=Symbol.for("react.suspense_list"),vx=Symbol.for("react.memo"),_o=Symbol.for("react.lazy"),b2
vendor: 4,315 bytes, lines 33-37
33=Symbol.for("react.offscreen"),GM=Symbol.iterator;function uu(n){return n===null||typeof n!="object"?null:(n=GM&&n[GM]||n["@@iterator"],typeof n=="function"?n:null)}var Mn=Object.assign,gv;function Ou(n){if(gv===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);gv=e&&e[1]||""}return` 34`+gv+n}var vv=!1;function yv(n,e){if(!n||vv)return"";vv=!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(f){var i=f}Reflect.construct(n,[],e)}else{try{e.call()}catch(f){i=f}n.call(e.prototype)}else{try{throw Error()}catch(f){i=f}n()}}catch(f){if(f&&i&&typeof f.stack=="string"){for(var r=f.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 u=` 37`+r[o].replace(" at new "," at ");return n.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",n.displayName)),u}while(1<=o&&0<=a);break}}}finally{vv=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Ou(n):""}function YI(n){switch(n.tag){case 5:return Ou(n.type);case 16:return Ou("Lazy");case 13:return Ou("Suspense");case 19:return Ou("SuspenseList");case 0:case 2:case 15:return n=yv(n.type,!1),n;case 11:return n=yv(n.type.render,!1),n;case 1:return n=yv(n.type,!0),n;default:return""}}function Yy(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 jl:return"Fragment";case Xl:return"Portal";case Wy:return"Profiler";case mx:return"StrictMode";case Xy:return"Suspense";case jy:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case A2:return(n.displayName||"Context")+".Consumer";case T2:return(n._context.displayName||"Context")+".Provider";case gx:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case vx:return e=n.displayName||null,e!==null?e:Yy(n.type)||"Memo";case _o:e=n._payload,n=n._init;try{return Yy(n(e))}catch{}}return null}function qI(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 Yy(e);case 8:return e===mx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ko(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function R2(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function ZI(n){var e=R2(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 yd(n){n._valueTracker||(n._valueTracker=ZI(n))}function C2(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=R2(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function qp(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 qy(n,e){var t=e.checked;return Mn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}
vendor: 4,924 bytes, line 37
37function VM(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=ko(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function P2(n,e){e=e.checked,e!=null&&px(n,"checked",e,!1)}function Zy(n,e){P2(n,e);var t=ko(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?Ky(n,e.type,t):e.hasOwnProperty("defaultValue")&&Ky(n,e.type,ko(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function WM(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 Ky(n,e,t){(e!=="number"||qp(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Fu=Array.isArray;function cc(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=""+ko(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 Qy(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Le(91));return Mn({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function XM(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Le(92));if(Fu(t)){if(1<t.length)throw Error(Le(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:ko(t)}}function I2(n,e){var t=ko(e.value),i=ko(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 jM(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function L2(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 $y(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?L2(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var _d,N2=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(_d=_d||document.createElement("div"),_d.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=_d.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function ff(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Gu={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},KI=["Webkit","ms","Moz","O"];Object.keys(Gu).forEach(function(n){KI.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Gu[e]=Gu[n]})});function D2(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Gu.hasOwnProperty(n)&&Gu[n]?(""+e).trim():e+"px"}function U2(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=D2(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var QI=Mn({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 Jy(n,e){if(e){if(QI[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Le(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Le(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Le(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Le(62))}}function e_(n,e){if(n.indexOf("-")===-1)return typeof e.is=="str
37ing";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 t_=null;function yx(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var n_=null,uc=null,fc=null;function YM(n){if(n=$f(n)){if(typeof n_!="function")throw Error(Le(280));var e=n.stateNode;e&&(e=hg(e),n_(n.stateNode,n.type,e))}}function O2(n){uc?fc?fc.push(n):fc=[n]:uc=n}function F2(){if(uc){var n=uc,e=fc;if(fc=uc=null,YM(n),e)for(n=0;n<e.length;n++)YM(e[n])}}function k2(n,e){return n(e)}function z2(){}var _v=!1;function B2(n,e,t){if(_v)return n(e,t);_v=!0;try{return k2(n,e,t)}finally{_v=!1,(uc!==null||fc!==null)&&(z2(),F2())}}function hf(n,e){var t=n.stateNode;if(t===null)return null;var i=hg(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(Le(231,e,typeof t));return t}var i_=!1;if(Xs)try{var fu={};Object.defineProperty(fu,"passive",{get:function(){i_=!0}}),window.addEventListener("test",fu,fu),window.removeEventListener("test",fu,fu)}catch{i_=!1}function $I(n,e,t,i,r,s,o,a,u){var f=Array.prototype.slice.call(arguments,3);try{e.apply(t,f)}catch(h){this.onError(h)}}var Vu=!1,Zp=null,Kp=!1,r_=null,JI={onError:function(n){Vu=!0,Zp=n}};function e3(n,e,t,i,r,s,o,a,u){Vu=!1,Zp=null,$I.apply(JI,arguments)}function t3(n,e,t,i,r,s,o,a,u){if(e3.apply(this,arguments),Vu){if(Vu){var f=Zp;Vu=!1,Zp=null}else throw Error(Le(198));Kp||(Kp=!0,r_=f)}}function tl(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 H2(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 qM(n){if(tl(n)!==n)throw Error(Le(188))}function n3(n){var e=n.alternate;if(!e){if(e=tl(n),e===null)throw Error(Le(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 qM(r),n;if(s===i)return qM(r),e;s=s.sibling}throw Error(Le(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(Le(189))}}if(t.alternate!==i)throw Error(Le(190))}if(t.tag!==3)throw Error(Le(188));return t.stateNode.current===t?n:e}function G2(n){return n=n3(n),n!==null?V2(n):null}function V2(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=V2(n);if(e!==null)return e;n=n.sibling}return null}var W2=lr.unstable_scheduleCallback,ZM=lr.unstable_cancelCallback,i3=lr.unstable_shouldYield,r3=lr.unstable_requestPaint,In=lr.unstable_now,s3=lr.unstable_getCurrentPriorityLevel,_x=lr.unstable_ImmediatePriority,X2=lr.unstable_UserBlockingPriority,Qp=lr.unstable_NormalPriority,o3=lr.unstable_LowPriority,j2=lr.unstable_IdlePriority,lg=null,ps=null;function a3(n){if(ps&&typeof ps.onCommitFiberRoot=="function")try{ps.onCommitFiberRoot(lg,n,void 0,(n.current.flags&128)===128)}catch{}}var Yr=Math.clz32?Math.clz32:u3,l3=Math.log,c3=Math.LN2;function u3(n){return n>>>=0,n===0?32:31-(l3(n)/c3|0)|0}var xd=64,Sd=4194304;function ku(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 $p(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=ku(a):(s&=o,s!==0&&(i=ku(s)))}else o=t&~r,o!==0?i=ku(o):s!==0&&(i=ku(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-Yr(e),r=1<<t,i|=n[t],e&=~r;return i}function f3(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 h3(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,r=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-Yr(s),a=1<<o,u=r[o];u===-1?(!(a&t)||a&i)&&(r[o]=f3(a,e)):u<=e&&(n.expiredLanes|=a),s&=~a}}function s_(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function Y2(){var n=xd;return xd<<=1,!(xd&4194240)&&(xd=64),n}function xv(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function Kf(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Yr(e),n[e]=t}function d3(n,e){var t=n.pendingLanes&~e;
vendor: 4,148 bytes, line 37
37n.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-Yr(t),s=1<<r;e[r]=0,i[r]=-1,n[r]=-1,t&=~s}}function xx(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var i=31-Yr(t),r=1<<i;r&e|n[i]&e&&(n[i]|=e),t&=~r}}var $t=0;function q2(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var Z2,Sx,K2,Q2,$2,o_=!1,Md=[],Co=null,Po=null,Io=null,df=new Map,pf=new Map,wo=[],p3="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 KM(n,e){switch(n){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":Po=null;break;case"mouseover":case"mouseout":Io=null;break;case"pointerover":case"pointerout":df.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":pf.delete(e.pointerId)}}function hu(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=$f(e),e!==null&&Sx(e)),n):(n.eventSystemFlags|=i,e=n.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),n)}function m3(n,e,t,i,r){switch(e){case"focusin":return Co=hu(Co,n,e,t,i,r),!0;case"dragenter":return Po=hu(Po,n,e,t,i,r),!0;case"mouseover":return Io=hu(Io,n,e,t,i,r),!0;case"pointerover":var s=r.pointerId;return df.set(s,hu(df.get(s)||null,n,e,t,i,r)),!0;case"gotpointercapture":return s=r.pointerId,pf.set(s,hu(pf.get(s)||null,n,e,t,i,r)),!0}return!1}function J2(n){var e=Ea(n.target);if(e!==null){var t=tl(e);if(t!==null){if(e=t.tag,e===13){if(e=H2(t),e!==null){n.blockedOn=e,$2(n.priority,function(){K2(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 Pp(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=a_(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var i=new t.constructor(t.type,t);t_=i,t.target.dispatchEvent(i),t_=null}else return e=$f(t),e!==null&&Sx(e),n.blockedOn=t,!1;e.shift()}return!0}function QM(n,e,t){Pp(n)&&t.delete(e)}function g3(){o_=!1,Co!==null&&Pp(Co)&&(Co=null),Po!==null&&Pp(Po)&&(Po=null),Io!==null&&Pp(Io)&&(Io=null),df.forEach(QM),pf.forEach(QM)}function du(n,e){n.blockedOn===e&&(n.blockedOn=null,o_||(o_=!0,lr.unstable_scheduleCallback(lr.unstable_NormalPriority,g3)))}function mf(n){function e(r){return du(r,n)}if(0<Md.length){du(Md[0],n);for(var t=1;t<Md.length;t++){var i=Md[t];i.blockedOn===n&&(i.blockedOn=null)}}for(Co!==null&&du(Co,n),Po!==null&&du(Po,n),Io!==null&&du(Io,n),df.forEach(e),pf.forEach(e),t=0;t<wo.length;t++)i=wo[t],i.blockedOn===n&&(i.blockedOn=null);for(;0<wo.length&&(t=wo[0],t.blockedOn===null);)J2(t),t.blockedOn===null&&wo.shift()}var hc=Qs.ReactCurrentBatchConfig,Jp=!0;function v3(n,e,t,i){var r=$t,s=hc.transition;hc.transition=null;try{$t=1,Mx(n,e,t,i)}finally{$t=r,hc.transition=s}}function y3(n,e,t,i){var r=$t,s=hc.transition;hc.transition=null;try{$t=4,Mx(n,e,t,i)}finally{$t=r,hc.transition=s}}function Mx(n,e,t,i){if(Jp){var r=a_(n,e,t,i);if(r===null)Pv(n,e,i,em,t),KM(n,i);else if(m3(r,n,e,t,i))i.stopPropagation();else if(KM(n,i),e&4&&-1<p3.indexOf(n)){for(;r!==null;){var s=$f(r);if(s!==null&&Z2(s),s=a_(n,e,t,i),s===null&&Pv(n,e,i,em,t),s===r)break;r=s}r!==null&&i.stopPropagation()}else Pv(n,e,i,null,t)}}var em=null;function a_(n,e,t,i){if(em=null,n=yx(i),n=Ea(n),n!==null)if(e=tl(n),e===null)n=null;else if(t=e.tag,t===13){if(n=H2(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 em=n,null}function eA(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"invali
37d":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(s3()){case _x:return 1;case X2:return 4;case Qp:case o3:return 16;case j2:return 536870912;default:return 16}default:return 16}}var Ao=null,wx=null,Ip=null;function tA(){if(Ip)return Ip;var n,e=wx,t=e.length,i,r="value"in Ao?Ao.value:Ao.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 Ip=r.slice(n,1<i?1-i:void 0)}function Lp(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 wd(){return!0}function $M(){return!1}function fr(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)?wd:$M,this.isPropagationStopped=$M,this}return Mn(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=wd)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=wd)},persist:function(){},isPersistent:wd}),e}var Oc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ex=fr(Oc),Qf=Mn({},Oc,{view:0,detail:0}),_3=fr(Qf),Sv,Mv,pu,cg=Mn({},Qf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tx,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!==pu&&(pu&&n.type==="mousemove"?(Sv=n.screenX-pu.screenX,Mv=n.screenY-pu.screenY):Mv=Sv=0,pu=n),Sv)},movementY:function(n){return"movementY"in n?n.movementY:Mv}}),JM=fr(cg),x3=Mn({},cg,{dataTransfer:0}),S3=fr(x3),M3=Mn({},Qf,{relatedTarget:0}),wv=fr(M3),w3=Mn({},Oc,{animationName:0,elapsedTime:0,pseudoElement:0}),E3=fr(w3),T3=Mn({},Oc,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),A3=fr(T3),b3=Mn({},Oc,{data:0}),ew=fr(b3),R3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},C3={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"},P3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I3(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=P3[n])?!!e[n]:!1}function Tx(){return I3}var L3=Mn({},Qf,{key:function(n){if(n.key){var e=R3[n.key]||n.key;if(e!=="Unidentified")return e}
vendor: 6,028 bytes, line 37
37return n.type==="keypress"?(n=Lp(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?C3[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tx,charCode:function(n){return n.type==="keypress"?Lp(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Lp(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),N3=fr(L3),D3=Mn({},cg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tw=fr(D3),U3=Mn({},Qf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tx}),O3=fr(U3),F3=Mn({},Oc,{propertyName:0,elapsedTime:0,pseudoElement:0}),k3=fr(F3),z3=Mn({},cg,{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}),B3=fr(z3),H3=[9,13,27,32],Ax=Xs&&"CompositionEvent"in window,Wu=null;Xs&&"documentMode"in document&&(Wu=document.documentMode);var G3=Xs&&"TextEvent"in window&&!Wu,nA=Xs&&(!Ax||Wu&&8<Wu&&11>=Wu),nw=" ",iw=!1;function iA(n,e){switch(n){case"keyup":return H3.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rA(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Yl=!1;function V3(n,e){switch(n){case"compositionend":return rA(e);case"keypress":return e.which!==32?null:(iw=!0,nw);case"textInput":return n=e.data,n===nw&&iw?null:n;default:return null}}function W3(n,e){if(Yl)return n==="compositionend"||!Ax&&iA(n,e)?(n=tA(),Ip=wx=Ao=null,Yl=!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 nA&&e.locale!=="ko"?null:e.data;default:return null}}var X3={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 rw(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!X3[n.type]:e==="textarea"}function sA(n,e,t,i){O2(i),e=tm(e,"onChange"),0<e.length&&(t=new Ex("onChange","change",null,t,i),n.push({event:t,listeners:e}))}var Xu=null,gf=null;function j3(n){gA(n,0)}function ug(n){var e=Kl(n);if(C2(e))return n}function Y3(n,e){if(n==="change")return e}var oA=!1;if(Xs){var Ev;if(Xs){var Tv="oninput"in document;if(!Tv){var sw=document.createElement("div");sw.setAttribute("oninput","return;"),Tv=typeof sw.oninput=="function"}Ev=Tv}else Ev=!1;oA=Ev&&(!document.documentMode||9<document.documentMode)}function ow(){Xu&&(Xu.detachEvent("onpropertychange",aA),gf=Xu=null)}function aA(n){if(n.propertyName==="value"&&ug(gf)){var e=[];sA(e,gf,n,yx(n)),B2(j3,e)}}function q3(n,e,t){n==="focusin"?(ow(),Xu=e,gf=t,Xu.attachEvent("onpropertychange",aA)):n==="focusout"&&ow()}function Z3(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ug(gf)}function K3(n,e){if(n==="click")return ug(e)}function Q3(n,e){if(n==="input"||n==="change")return ug(e)}function $3(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Kr=typeof Object.is=="function"?Object.is:$3;function vf(n,e){if(Kr(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(!Vy.call(e,r)||!Kr(n[r],e[r]))return!1}return!0}function aw(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function lw(n,e){var t=aw(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=aw(t)}}function lA(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?lA(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function cA(){for(var n=window,e=qp();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=qp(n.document)}return e}function bx(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 J3(n){var e=cA(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&lA(t.ownerDocument.documentElement,t)){if(i!==null&&bx(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=lw(t,s);var o=lw(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 eL=Xs&&"documentMode"in document&&11>=document.documentMode,ql=null,l_=null,ju=null,c_=!1;function cw(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;c_||ql==null||ql!==qp(i)||(i=ql,"selectionStart"in i&&bx(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}),ju&&vf(ju,i)||(ju=i,i=tm(l_,"onSelect"),0<i.length&&(e=new Ex("onSelect","select",null,e,t),n.push({event:e,listeners:i}),e.target=ql)))}function Ed(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var Zl={animationend:Ed("Animation","AnimationEnd"),animationiteration:Ed("Animation","AnimationIteration"),animationstart:Ed("Animation","AnimationStart"),transitionend:Ed("Transition","TransitionEnd")},Av={},uA={};Xs&&(uA=document.createElement("div").style,"AnimationEvent"in window||(delete Zl.animationend.animation,delete Zl.animationiteration.animation,delete Zl.animationstart.animation),"TransitionEvent"in window||delete Zl.transitionend.transition);function fg(n){if(Av[n])return Av[n];if(!Zl[n])return n;var e=Zl[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in uA)return Av[n]=e[t];return n}var fA=fg("animationend"),hA=fg("animationiteration"),dA=fg("animationstart"),pA=fg("transitionend"),mA=new Map,uw="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 Xo(n,e){mA.set(n,e),el(e,[n])}for(var bv=0;bv<uw.length;bv++){var Rv=uw[bv],tL=Rv.toLowerCase(),nL=Rv[0].toUpperCase()+Rv.slice(1);Xo(tL,"on"+nL)}Xo(fA,"onAnimationEnd");Xo(hA,"onAnimationIteration");Xo(dA,"onAnimationStart");Xo("dblclick","onDoubleClick");Xo("focusin","onFocus");Xo("focusout","onBlur");Xo(pA,"onTransitionEnd");vc("onMouseEnter",["mouseout","mouseover"]);vc("onMouseLeave",["mouseout","mouseover"]);vc("onPointerEnter",["pointerout","pointerover"]);vc("onPointerLeave",["pointerout","pointerover"]);el("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));el("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));el("onBeforeInput",["compositionend","keypress","textInput","paste"]);el("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));el("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));el("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zu="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(" "),iL=new Set("cancel close invalid load scroll toggle".split(" ").concat(zu));function fw(n,e,t){var i=n.type||"unknown-event";n.currentTarget=t,t3(i,e,void 0,n),n.currentTarget=null}function gA(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],u=a.instance,f=a.currentTarget;if(a=a.listener,u!==s&&r.isPropagationStopped())break e;fw(r,a,f),s=u}else for(o=0;o<i.length;o++){if(a=i[o],u=a.instance,f=a.currentTarget,a=a.listener,u!==s&&r.isPropagationStopped())break e;fw(r,a,f),s=u}}}if(Kp)throw n=r_,Kp=!1,r_=null,n}function cn(n,e){var t=e[p_];t===void 0&&(t=e[p_]=new Set);var i=n+"__bubble";t.has(i)||(vA(e,n,2,!1),t.add(i))}function Cv(n,e,t){var i=0;e&&(i|=4),vA(t,n,i,e)}var Td="_reactListening"+Math.random().toString(36).slice(2);function yf(n){if(!n[Td]){n[Td]=!0,E2.forEach(function(t){t!=="selectionchange"&&(iL.has(t)||Cv(t,!1,n),Cv(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[Td]||(e[Td]=!0,Cv("selectionchange",!1,e))}}function vA(n,e,t,i){switch(eA(e)){case 1:var r=v3;break;case 4:r=y3;break;default:r=Mx}t=r.bind(null,e,t,n),r=void 0,!i_||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 Pv(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: 10,880 bytes, lines 37-38
37if(a===r||a.nodeType===8&&a.parentNode===r)break;if(o===4)for(o=i.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===r||u.nodeType===8&&u.parentNode===r))return;o=o.return}for(;a!==null;){if(o=Ea(a),o===null)return;if(u=o.tag,u===5||u===6){i=s=o;continue e}a=a.parentNode}}i=i.return}B2(function(){var f=s,h=yx(t),d=[];e:{var p=mA.get(n);if(p!==void 0){var m=Ex,y=n;switch(n){case"keypress":if(Lp(t)===0)break e;case"keydown":case"keyup":m=N3;break;case"focusin":y="focus",m=wv;break;case"focusout":y="blur",m=wv;break;case"beforeblur":case"afterblur":m=wv;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=JM;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=S3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=O3;break;case fA:case hA:case dA:m=E3;break;case pA:m=k3;break;case"scroll":m=_3;break;case"wheel":m=B3;break;case"copy":case"cut":case"paste":m=A3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=tw}var w=(e&4)!==0,_=!w&&n==="scroll",v=w?p!==null?p+"Capture":null:p;w=[];for(var S=f,M;S!==null;){M=S;var T=M.stateNode;if(M.tag===5&&T!==null&&(M=T,v!==null&&(T=hf(S,v),T!=null&&w.push(_f(S,T,M)))),_)break;S=S.return}0<w.length&&(p=new m(p,y,null,t,h),d.push({event:p,listeners:w}))}}if(!(e&7)){e:{if(p=n==="mouseover"||n==="pointerover",m=n==="mouseout"||n==="pointerout",p&&t!==t_&&(y=t.relatedTarget||t.fromElement)&&(Ea(y)||y[js]))break e;if((m||p)&&(p=h.window===h?h:(p=h.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=t.relatedTarget||t.toElement,m=f,y=y?Ea(y):null,y!==null&&(_=tl(y),y!==_||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=f),m!==y)){if(w=JM,T="onMouseLeave",v="onMouseEnter",S="mouse",(n==="pointerout"||n==="pointerover")&&(w=tw,T="onPointerLeave",v="onPointerEnter",S="pointer"),_=m==null?p:Kl(m),M=y==null?p:Kl(y),p=new w(T,S+"leave",m,t,h),p.target=_,p.relatedTarget=M,T=null,Ea(h)===f&&(w=new w(v,S+"enter",y,t,h),w.target=M,w.relatedTarget=_,T=w),_=T,m&&y)t:{for(w=m,v=y,S=0,M=w;M;M=Ml(M))S++;for(M=0,T=v;T;T=Ml(T))M++;for(;0<S-M;)w=Ml(w),S--;for(;0<M-S;)v=Ml(v),M--;for(;S--;){if(w===v||v!==null&&w===v.alternate)break t;w=Ml(w),v=Ml(v)}w=null}else w=null;m!==null&&hw(d,p,m,w,!1),y!==null&&_!==null&&hw(d,_,y,w,!0)}}e:{if(p=f?Kl(f):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var I=Y3;else if(rw(p))if(oA)I=Q3;else{I=Z3;var C=q3}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(I=K3);if(I&&(I=I(n,f))){sA(d,I,t,h);break e}C&&C(n,p,f),n==="focusout"&&(C=p._wrapperState)&&C.controlled&&p.type==="number"&&Ky(p,"number",p.value)}switch(C=f?Kl(f):window,n){case"focusin":(rw(C)||C.contentEditable==="true")&&(ql=C,l_=f,ju=null);break;case"focusout":ju=l_=ql=null;break;case"mousedown":c_=!0;break;case"contextmenu":case"mouseup":case"dragend":c_=!1,cw(d,t,h);break;case"selectionchange":if(eL)break;case"keydown":case"keyup":cw(d,t,h)}var L;if(Ax)e:{switch(n){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Yl?iA(n,t)&&(N="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(N="onCompositionStart");N&&(nA&&t.locale!=="ko"&&(Yl||N!=="onCompositionStart"?N==="onCompositionEnd"&&Yl&&(L=tA()):(Ao=h,wx="value"in Ao?Ao.value:Ao.textContent,Yl=!0)),C=tm(f,N),0<C.length&&(N=new ew(N,n,null,t,h),d.push({event:N,listeners:C}),L?N.data=L:(L=rA(t),L!==null&&(N.data=L)))),(L=G3?V3(n,t):W3(n,t))&&(f=tm(f,"onBeforeInput"),0<f.length&&(h=new ew("onBeforeInput","beforeinput",null,t,h),d.push({event:h,listeners:f}),h.data=L))}gA(d,e)})}function _f(n,e,t){return{instance:n,listener:e,currentTarget:t}}function tm(n,e){for(var t=e+"Capture",i=[];n!==null;){var r=n,s=r.stateNode;r.tag===5&&s!==null&&(r=s,s=hf(n,t),s!=null&&i.unshift(_f(n,s,r)),s=hf(n,e),s!=null&&i.push(_f(n,s,r))),n=n.return}return i}function Ml(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function hw(n,e,t,i,r){for(var s=e._reactName,o=[];t!==null&&t!==i;){var a=t,u=a.alternate,f=a.stateNode;if(u!==null&&u===i)break;a.tag===5&&f!==null&&(a=f,r?(u=hf(t,s),u!=null&&o.unshift(_f(t,u,a))):r||(u=hf(t,s),u!=null&&o.push(_f(t,u,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var rL=/\r\n?/g,sL=/\u0000|\uFFFD/g;function dw(n){return(typeof n=="string"?n:""+n).replace(rL,` 38`).replace(sL,"")}function Ad(n,e,t){if(e=dw(e),dw(n)!==e&&t)throw Error(Le(425))}function nm(){}var u_=null,f_=null;function h_(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 d_=typeof setTimeout=="function"?setTimeout:void 0,oL=typeof clearTimeout=="function"?clearTimeout:void 0,pw=typeof Promise=="function"?Promise:void 0,aL=typeof queueMicrotask=="function"?queueMicrotask:typeof pw<"u"?function(n){return pw.resolve(null).then(n).catch(lL)}:d_;function lL(n){setTimeout(function(){throw n})}function Iv(n,e){var t=e,i=0;do{var r=t.nextSibling;if(n.removeChild(t),r&&r.nodeType===8)if(t=r.data,t==="/$"){if(i===0){n.removeChild(r),mf(e);return}i--}else t!=="$"&&t!=="$?"&&t!=="$!"||i++;t=r}while(t);mf(e)}function Lo(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 mw(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 Fc=Math.random().toString(36).slice(2),fs="__reactFiber$"+Fc,xf="__reactProps$"+Fc,js="__reactContainer$"+Fc,p_="__reactEvents$"+Fc,cL="__reactListeners$"+Fc,uL="__reactHandles$"+Fc;function Ea(n){var e=n[fs];if(e)return e;for(var t=n.parentNode;t;){if(e=t[js]||t[fs]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=mw(n);n!==null;){if(t=n[fs])return t;n=mw(n)}return e}n=t,t=n.parentNode}return null}function $f(n){return n=n[fs]||n[js],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Kl(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Le(33))}function hg(n){return n[xf]||null}var m_=[],Ql=-1;function jo(n){return{current:n}}function hn(n){0>Ql||(n.current=m_[Ql],m_[Ql]=null,Ql--)}function an(n,e){Ql++,m_[Ql]=n.current,n.current=e}var zo={},_i=jo(zo),Wi=jo(!1),Va=zo;function yc(n,e){var t=n.type.contextTypes;if(!t)return zo;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 Xi(n){return n=n.childContextTypes,n!=null}function im(){hn(Wi),hn(_i)}function gw(n,e,t){if(_i.current!==zo)throw Error(Le(168));an(_i,e),an(Wi,t)}function yA(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(Le(108,qI(n)||"Unknown",r));return Mn({},t,i)}function rm(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||zo,Va=_i.current,an(_i,n),an(Wi,Wi.current),!0}function vw(n,e,t){var i=n.stateNode;if(!i)throw Error(Le(169));t?(n=yA(n,e,Va),i.__reactInternalMemoizedMergedChildContext=n,hn(Wi),hn(_i),an(_i,n)):hn(Wi),an(Wi,t)}var ks=null,dg=!1,Lv=!1;function _A(n){ks===null?ks=[n]:ks.push(n)}function fL(n){dg=!0,_A(n)}function Yo(){if(!Lv&&ks!==null){Lv=!0;var n=0,e=$t;try{var t=ks;for($t=1;n<t.length;n++){var i=t[n];do i=i(!0);while(i!==null)}ks=null,dg=!1}catch(r){throw ks!==null&&(ks=ks.slice(n+1)),W2(_x,Yo),r}finally{$t=e,Lv=!1}}return null}var $l=[],Jl=0,sm=null,om=0,Sr=[],Mr=0,Wa=null,Hs=1,Gs="";function _a(n,e){$l[Jl++]=om,$l[Jl++]=sm,sm=n,om=e}function xA(n,e,t){Sr[Mr++]=Hs,Sr[Mr++]=Gs,Sr[Mr++]=Wa,Wa=n;var i=Hs;n=Gs;var r=32-Yr(i)-1;i&=~(1<<r),t+=1;var s=32-Yr(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Hs=1<<32-Yr(e)+r|t<<r|i,Gs=s+n}else Hs=1<<s|t<<r|i,Gs=n}function Rx(n){n.return!==null&&(_a(n,1),xA(n,1,0))}function Cx(n){for(;n===sm;)sm=$l[--Jl],$l[Jl]=null,om=$l[--Jl],$l[Jl]=null;for(;n===Wa;)Wa=Sr[--Mr],Sr[Mr]=null,Gs=Sr[--Mr],Sr[Mr]=null,Hs=Sr[--Mr],Sr[Mr]=null}var sr=null,rr=null,pn=!1,Wr=null;function SA(n,e){var t=Tr(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 yw(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,sr=n,rr=Lo(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,sr=n,rr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=Wa!==null?{id:Hs,overflow:Gs}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=Tr(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,sr=n,rr=null,!0):!1;default:return!1}}function g_(n){return(n.mode&1)!==0&&(n.flags&128)===0}function v_(n){if(pn){var e=rr;if(e){var t=e;if(!yw(n,e)){if(g_(n))throw Error(Le(418));e=Lo(t.nextSibling);var i=sr;e&&yw(n,e)?SA(i,t):(n.flags=n.flags&-4097|2,pn=!1,sr=n)}}else{if(g_(n))throw Error(Le(418));n.flags=n.flags&-4097|2,pn=!1,sr=n}}}function _w(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;sr=n}function bd(n){if(n!==sr)return!1;if(!pn)return _w(n),pn=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!h_(n.type,n.memoizedProps)),e&&(e=rr)){if(g_(n))throw MA(),Error(Le(418));for(;e;)SA(n,e),e=Lo(e.nextSibling)}if(_w(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Le(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){rr=Lo(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}rr=null}}else rr=sr?Lo(n.stateNode.nextSibling):null;return!0}function MA(){for(var n=rr;n;)n=Lo(n.nextSibling)}function _c(){rr=sr=null,pn=!1}function Px(n){Wr===null?Wr=[n]:Wr.push(n)}var hL=Qs.ReactCurrentBatchConfig;function mu(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(Le(309));var i=t.stateNode}if(!i)throw Error(Le(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)}
vendor: 4,090 bytes, line 38
38if(typeof n!="string")throw Error(Le(284));if(!t._owner)throw Error(Le(290,n))}return n}function Rd(n,e){throw n=Object.prototype.toString.call(e),Error(Le(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function xw(n){var e=n._init;return e(n._payload)}function wA(n){function e(v,S){if(n){var M=v.deletions;M===null?(v.deletions=[S],v.flags|=16):M.push(S)}}function t(v,S){if(!n)return null;for(;S!==null;)e(v,S),S=S.sibling;return null}function i(v,S){for(v=new Map;S!==null;)S.key!==null?v.set(S.key,S):v.set(S.index,S),S=S.sibling;return v}function r(v,S){return v=Oo(v,S),v.index=0,v.sibling=null,v}function s(v,S,M){return v.index=M,n?(M=v.alternate,M!==null?(M=M.index,M<S?(v.flags|=2,S):M):(v.flags|=2,S)):(v.flags|=1048576,S)}function o(v){return n&&v.alternate===null&&(v.flags|=2),v}function a(v,S,M,T){return S===null||S.tag!==6?(S=zv(M,v.mode,T),S.return=v,S):(S=r(S,M),S.return=v,S)}function u(v,S,M,T){var I=M.type;return I===jl?h(v,S,M.props.children,T,M.key):S!==null&&(S.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===_o&&xw(I)===S.type)?(T=r(S,M.props),T.ref=mu(v,S,M),T.return=v,T):(T=zp(M.type,M.key,M.props,null,v.mode,T),T.ref=mu(v,S,M),T.return=v,T)}function f(v,S,M,T){return S===null||S.tag!==4||S.stateNode.containerInfo!==M.containerInfo||S.stateNode.implementation!==M.implementation?(S=Bv(M,v.mode,T),S.return=v,S):(S=r(S,M.children||[]),S.return=v,S)}function h(v,S,M,T,I){return S===null||S.tag!==7?(S=Ua(M,v.mode,T,I),S.return=v,S):(S=r(S,M),S.return=v,S)}function d(v,S,M){if(typeof S=="string"&&S!==""||typeof S=="number")return S=zv(""+S,v.mode,M),S.return=v,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case vd:return M=zp(S.type,S.key,S.props,null,v.mode,M),M.ref=mu(v,null,S),M.return=v,M;case Xl:return S=Bv(S,v.mode,M),S.return=v,S;case _o:var T=S._init;return d(v,T(S._payload),M)}if(Fu(S)||uu(S))return S=Ua(S,v.mode,M,null),S.return=v,S;Rd(v,S)}return null}function p(v,S,M,T){var I=S!==null?S.key:null;if(typeof M=="string"&&M!==""||typeof M=="number")return I!==null?null:a(v,S,""+M,T);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case vd:return M.key===I?u(v,S,M,T):null;case Xl:return M.key===I?f(v,S,M,T):null;case _o:return I=M._init,p(v,S,I(M._payload),T)}if(Fu(M)||uu(M))return I!==null?null:h(v,S,M,T,null);Rd(v,M)}return null}function m(v,S,M,T,I){if(typeof T=="string"&&T!==""||typeof T=="number")return v=v.get(M)||null,a(S,v,""+T,I);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case vd:return v=v.get(T.key===null?M:T.key)||null,u(S,v,T,I);case Xl:return v=v.get(T.key===null?M:T.key)||null,f(S,v,T,I);case _o:var C=T._init;return m(v,S,M,C(T._payload),I)}if(Fu(T)||uu(T))return v=v.get(M)||null,h(S,v,T,I,null);Rd(S,T)}return null}function y(v,S,M,T){for(var I=null,C=null,L=S,N=S=0,B=null;L!==null&&N<M.length;N++){L.index>N?(B=L,L=null):B=L.sibling;var A=p(v,L,M[N],T);if(A===null){L===null&&(L=B);break}n&&L&&A.alternate===null&&e(v,L),S=s(A,S,N),C===null?I=A:C.sibling=A,C=A,L=B}if(N===M.length)return t(v,L),pn&&_a(v,N),I;if(L===null){for(;N<M.length;N++)L=d(v,M[N],T),L!==null&&(S=s(L,S,N),C===null?I=L:C.sibling=L,C=L);return pn&&_a(v,N),I}for(L=i(v,L);N<M.length;N++)B=m(L,v,N,M[N],T),B!==null&&(n&&B.alternate!==null&&L.delete(B.key===null?N:B.key),S=s(B,S,N),C===null?I=B:C.sibling=B,C=B);return n&&L.forEach(function(R){return e(v,R)}),pn&&_a(v,N),I}function w(v,S,M,T){var I=uu(M);if(typeof I!="function")throw Error(Le(150));if(M=I.call(M),M==null)throw Error(Le(151));for(var C=I=null,L=S,N=S=0,B=null,A=M.next();L!==null&&!A.done;N++,A=M.next()){L.index>N?(B=L,L=null):B=L.sibling;var R=p(v,L,A.value,T);if(R===null){L===null&&(L=B);break}n&&L&&R.alternate===null&&e(v,L),S=s(R,S,N),C===null?I=R:C.sibling=R,C=R,L=B}if(A.done)return t(v,L),pn&&_a(v,N),I;if(L===null){for(;!A.done;N++,A=M.next())A=d(v,A.value,T),A!==null&&(S=s(A,S,N),C===null?I=A:C.sibling=A,C=A);return pn&&_a(v,N),I}for(L=i(v,L);!A.done;N++,A=M.next())A=m(L,v,N,A.value,T),A!==null&&(n&&A.alternate!==null&&L.delete(A.key===null?N:A.key),S=s(A,S,N),C===null?I=A:C.sibling=A,C=A);
vendor: 5,468 bytes, line 38
38return n&&L.forEach(function(j){return e(v,j)}),pn&&_a(v,N),I}function _(v,S,M,T){if(typeof M=="object"&&M!==null&&M.type===jl&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case vd:e:{for(var I=M.key,C=S;C!==null;){if(C.key===I){if(I=M.type,I===jl){if(C.tag===7){t(v,C.sibling),S=r(C,M.props.children),S.return=v,v=S;break e}}else if(C.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===_o&&xw(I)===C.type){t(v,C.sibling),S=r(C,M.props),S.ref=mu(v,C,M),S.return=v,v=S;break e}t(v,C);break}else e(v,C);C=C.sibling}M.type===jl?(S=Ua(M.props.children,v.mode,T,M.key),S.return=v,v=S):(T=zp(M.type,M.key,M.props,null,v.mode,T),T.ref=mu(v,S,M),T.return=v,v=T)}return o(v);case Xl:e:{for(C=M.key;S!==null;){if(S.key===C)if(S.tag===4&&S.stateNode.containerInfo===M.containerInfo&&S.stateNode.implementation===M.implementation){t(v,S.sibling),S=r(S,M.children||[]),S.return=v,v=S;break e}else{t(v,S);break}else e(v,S);S=S.sibling}S=Bv(M,v.mode,T),S.return=v,v=S}return o(v);case _o:return C=M._init,_(v,S,C(M._payload),T)}if(Fu(M))return y(v,S,M,T);if(uu(M))return w(v,S,M,T);Rd(v,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,S!==null&&S.tag===6?(t(v,S.sibling),S=r(S,M),S.return=v,v=S):(t(v,S),S=zv(M,v.mode,T),S.return=v,v=S),o(v)):t(v,S)}return _}var xc=wA(!0),EA=wA(!1),am=jo(null),lm=null,ec=null,Ix=null;function Lx(){Ix=ec=lm=null}function Nx(n){var e=am.current;hn(am),n._currentValue=e}function y_(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 dc(n,e){lm=n,Ix=ec=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Vi=!0),n.firstContext=null)}function br(n){var e=n._currentValue;if(Ix!==n)if(n={context:n,memoizedValue:e,next:null},ec===null){if(lm===null)throw Error(Le(308));ec=n,lm.dependencies={lanes:0,firstContext:n}}else ec=ec.next=n;return e}var Ta=null;function Dx(n){Ta===null?Ta=[n]:Ta.push(n)}function TA(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,Dx(e)):(t.next=r.next,r.next=t),e.interleaved=t,Ys(n,i)}function Ys(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 xo=!1;function Ux(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function AA(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 Ws(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function No(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,jt&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Ys(n,t)}return r=i.interleaved,r===null?(e.next=e,Dx(i)):(e.next=r.next,r.next=e),i.interleaved=e,Ys(n,t)}function Np(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,xx(n,t)}}function Sw(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 cm(n,e,t,i){var r=n.updateQueue;xo=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var u=a,f=u.next;u.next=null,o===null?s=f:o.next=f,o=u;var h=n.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=f:a.next=f,h.lastBaseUpdate=u))}if(s!==null){var d=r.baseState;o=0,h=f=u=null,a=s;do{var p=a.lane,m=a.eventTime;if((i&p)===p){h!==null&&(h=h.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=n,w=a;switch(p=e,m=t,w.tag){case 1:if(y=w.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=w.payload,p=typeof y=="function"?y.call(m,d,p):y,p==null)break e;d=Mn({},d,p);break e;case 2:xo=!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},h===null?(f=h=m,u=d):h=h.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(h===null&&(u=d),r.baseState=u,r.firstBaseUpdate=f,r.lastBaseUpdate=h,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);ja|=o,n.lanes=o,n.memoizedState=d}}function Mw(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(Le(191,r));r.call(i)}}}var Jf={},ms=jo(Jf),Sf=jo(Jf),Mf=jo(Jf);function Aa(n){if(n===Jf)throw Error(Le(174));return n}function Ox(n,e){switch(an(Mf,e),an(Sf,n),an(ms,Jf),n=e.nodeType,n){case 9:case 11:e=(e
vendor: 6,432 bytes, line 38
38=e.documentElement)?e.namespaceURI:$y(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=$y(e,n)}hn(ms),an(ms,e)}function Sc(){hn(ms),hn(Sf),hn(Mf)}function bA(n){Aa(Mf.current);var e=Aa(ms.current),t=$y(e,n.type);e!==t&&(an(Sf,n),an(ms,t))}function Fx(n){Sf.current===n&&(hn(ms),hn(Sf))}var vn=jo(0);function um(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Nv=[];function kx(){for(var n=0;n<Nv.length;n++)Nv[n]._workInProgressVersionPrimary=null;Nv.length=0}var Dp=Qs.ReactCurrentDispatcher,Dv=Qs.ReactCurrentBatchConfig,Xa=0,Sn=null,Bn=null,Qn=null,fm=!1,Yu=!1,wf=0,dL=0;function hi(){throw Error(Le(321))}function zx(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Kr(n[t],e[t]))return!1;return!0}function Bx(n,e,t,i,r,s){if(Xa=s,Sn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Dp.current=n===null||n.memoizedState===null?vL:yL,n=t(i,r),Yu){s=0;do{if(Yu=!1,wf=0,25<=s)throw Error(Le(301));s+=1,Qn=Bn=null,e.updateQueue=null,Dp.current=_L,n=t(i,r)}while(Yu)}if(Dp.current=hm,e=Bn!==null&&Bn.next!==null,Xa=0,Qn=Bn=Sn=null,fm=!1,e)throw Error(Le(300));return n}function Hx(){var n=wf!==0;return wf=0,n}function us(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?Sn.memoizedState=Qn=n:Qn=Qn.next=n,Qn}function Rr(){if(Bn===null){var n=Sn.alternate;n=n!==null?n.memoizedState:null}else n=Bn.next;var e=Qn===null?Sn.memoizedState:Qn.next;if(e!==null)Qn=e,Bn=n;else{if(n===null)throw Error(Le(310));Bn=n,n={memoizedState:Bn.memoizedState,baseState:Bn.baseState,baseQueue:Bn.baseQueue,queue:Bn.queue,next:null},Qn===null?Sn.memoizedState=Qn=n:Qn=Qn.next=n}return Qn}function Ef(n,e){return typeof e=="function"?e(n):e}function Uv(n){var e=Rr(),t=e.queue;if(t===null)throw Error(Le(311));t.lastRenderedReducer=n;var i=Bn,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,u=null,f=s;do{var h=f.lane;if((Xa&h)===h)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),i=f.hasEagerState?f.eagerState:n(i,f.action);else{var d={lane:h,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(a=u=d,o=i):u=u.next=d,Sn.lanes|=h,ja|=h}f=f.next}while(f!==null&&f!==s);u===null?o=i:u.next=a,Kr(i,e.memoizedState)||(Vi=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=u,t.lastRenderedState=i}if(n=t.interleaved,n!==null){r=n;do s=r.lane,Sn.lanes|=s,ja|=s,r=r.next;while(r!==n)}else r===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function Ov(n){var e=Rr(),t=e.queue;if(t===null)throw Error(Le(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);Kr(s,e.memoizedState)||(Vi=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,i]}function RA(){}function CA(n,e){var t=Sn,i=Rr(),r=e(),s=!Kr(i.memoizedState,r);if(s&&(i.memoizedState=r,Vi=!0),i=i.queue,Gx(LA.bind(null,t,i,n),[n]),i.getSnapshot!==e||s||Qn!==null&&Qn.memoizedState.tag&1){if(t.flags|=2048,Tf(9,IA.bind(null,t,i,r,e),void 0,null),ni===null)throw Error(Le(349));Xa&30||PA(t,e,r)}return r}function PA(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=Sn.updateQueue,e===null?(e={lastEffect:null,stores:null},Sn.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function IA(n,e,t,i){e.value=t,e.getSnapshot=i,NA(e)&&DA(n)}function LA(n,e,t){return t(function(){NA(e)&&DA(n)})}function NA(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Kr(n,t)}catch{return!0}}function DA(n){var e=Ys(n,1);e!==null&&qr(e,n,1,-1)}function ww(n){var e=us();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ef,lastRenderedState:n},e.queue=n,n=n.dispatch=gL.bind(null,Sn,n),[e.memoizedState,n]}function Tf(n,e,t,i){return n={tag:n,create:e,destroy:t,deps:i,next:null},e=Sn.updateQueue,e===null?(e={lastEffect:null,stores:null},Sn.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 UA(){return Rr().memoizedState}function Up(n,e,t,i){var r=us();Sn.flags|=n,r.memoizedState=Tf(1|e,t,void 0,i===void 0?null:i)}function pg(n,e,t,i){var r=Rr();i=i===void 0?null:i;var s=void 0;if(Bn!==null){var o=Bn.memoizedState;if(s=o.destroy,i!==null&&zx(i,o.deps)){r.memoizedState=Tf(e,t,s,i);return}}Sn.flags|=n,r.memoizedState=Tf(1|e,t,s,i)}function Ew(n,e){return Up(8390656,8,n,e)}function Gx(n,e){return pg(2048,8,n,e)}function OA(n,e){return pg(4,2,n,e)}function FA(n,e){return pg(4,4,n,e)}function kA(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 zA(n,e,t){return t=t!=null?t.concat([n]):null,pg(4,4,kA.bind(null,e,n),t)}function Vx(){}function BA(n,e){var t=Rr();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&zx(e,i[1])?i[0]:(t.memoizedState=[n,e],n)}function HA(n,e){var t=Rr();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&zx(e,i[1])?i[0]:(n=n(),t.memoizedState=[n,e],n)}function GA(n,e,t){return Xa&21?(Kr(t,e)||(t=Y2(),Sn.lanes|=t,ja|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Vi=!0),n.memoizedState=t)}function pL(n,e){var t=$t;$t=t!==0&&4>t?t:4,n(!0);var i=Dv.transition;Dv.transition={};try{n(!1),e()}finally{$t=t,Dv.transition=i}}function VA(){return Rr().memoizedState}function mL(n,e,t){var i=Uo(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},WA(n))XA(e,t);else if(t=TA(n,e,t,i),t!==null){var r=Ri();qr(t,n,i,r),jA(t,e,i)}}function gL(n,e,t){var i=Uo(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(WA(n))XA(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: 8,894 bytes, lines 38-40
38if(r.hasEagerState=!0,r.eagerState=a,Kr(a,o)){var u=e.interleaved;u===null?(r.next=r,Dx(e)):(r.next=u.next,u.next=r),e.interleaved=r;return}}catch{}finally{}t=TA(n,e,r,i),t!==null&&(r=Ri(),qr(t,n,i,r),jA(t,e,i))}}function WA(n){var e=n.alternate;return n===Sn||e!==null&&e===Sn}function XA(n,e){Yu=fm=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function jA(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,xx(n,t)}}var hm={readContext:br,useCallback:hi,useContext:hi,useEffect:hi,useImperativeHandle:hi,useInsertionEffect:hi,useLayoutEffect:hi,useMemo:hi,useReducer:hi,useRef:hi,useState:hi,useDebugValue:hi,useDeferredValue:hi,useTransition:hi,useMutableSource:hi,useSyncExternalStore:hi,useId:hi,unstable_isNewReconciler:!1},vL={readContext:br,useCallback:function(n,e){return us().memoizedState=[n,e===void 0?null:e],n},useContext:br,useEffect:Ew,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Up(4194308,4,kA.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Up(4194308,4,n,e)},useInsertionEffect:function(n,e){return Up(4,2,n,e)},useMemo:function(n,e){var t=us();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=us();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=mL.bind(null,Sn,n),[i.memoizedState,n]},useRef:function(n){var e=us();return n={current:n},e.memoizedState=n},useState:ww,useDebugValue:Vx,useDeferredValue:function(n){return us().memoizedState=n},useTransition:function(){var n=ww(!1),e=n[0];return n=pL.bind(null,n[1]),us().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Sn,r=us();if(pn){if(t===void 0)throw Error(Le(407));t=t()}else{if(t=e(),ni===null)throw Error(Le(349));Xa&30||PA(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,Ew(LA.bind(null,i,s,n),[n]),i.flags|=2048,Tf(9,IA.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=us(),e=ni.identifierPrefix;if(pn){var t=Gs,i=Hs;t=(i&~(1<<32-Yr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=wf++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=dL++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},yL={readContext:br,useCallback:BA,useContext:br,useEffect:Gx,useImperativeHandle:zA,useInsertionEffect:OA,useLayoutEffect:FA,useMemo:HA,useReducer:Uv,useRef:UA,useState:function(){return Uv(Ef)},useDebugValue:Vx,useDeferredValue:function(n){var e=Rr();return GA(e,Bn.memoizedState,n)},useTransition:function(){var n=Uv(Ef)[0],e=Rr().memoizedState;return[n,e]},useMutableSource:RA,useSyncExternalStore:CA,useId:VA,unstable_isNewReconciler:!1},_L={readContext:br,useCallback:BA,useContext:br,useEffect:Gx,useImperativeHandle:zA,useInsertionEffect:OA,useLayoutEffect:FA,useMemo:HA,useReducer:Ov,useRef:UA,useState:function(){return Ov(Ef)},useDebugValue:Vx,useDeferredValue:function(n){var e=Rr();return Bn===null?e.memoizedState=n:GA(e,Bn.memoizedState,n)},useTransition:function(){var n=Ov(Ef)[0],e=Rr().memoizedState;return[n,e]},useMutableSource:RA,useSyncExternalStore:CA,useId:VA,unstable_isNewReconciler:!1};function Br(n,e){if(n&&n.defaultProps){e=Mn({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}function __(n,e,t,i){e=n.memoizedState,t=t(i,e),t=t==null?e:Mn({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var mg={isMounted:function(n){return(n=n._reactInternals)?tl(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var i=Ri(),r=Uo(n),s=Ws(i,r);s.payload=e,t!=null&&(s.callback=t),e=No(n,s,r),e!==null&&(qr(e,n,r,i),Np(e,n,r))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var i=Ri(),r=Uo(n),s=Ws(i,r);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=No(n,s,r),e!==null&&(qr(e,n,r,i),Np(e,n,r))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=Ri(),i=Uo(n),r=Ws(t,i);r.tag=2,e!=null&&(r.callback=e),e=No(n,r,i),e!==null&&(qr(e,n,i,t),Np(e,n,i))}};function Tw(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?!vf(t,i)||!vf(r,s):!0}function YA(n,e,t){var i=!1,r=zo,s=e.contextType;return typeof s=="object"&&s!==null?s=br(s):(r=Xi(e)?Va:_i.current,i=e.contextTypes,s=(i=i!=null)?yc(n,r):zo),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=mg,n.stateNode=e,e._reactInternals=n,i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=r,n.__reactInternalMemoizedMaskedChildContext=s),e}function Aw(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&&mg.enqueueReplaceState(e,e.state,null)}function x_(n,e,t,i){var r=n.stateNode;r.props=t,r.state=n.memoizedState,r.refs={},Ux(n);var s=e.contextType;typeof s=="object"&&s!==null?r.context=br(s):(s=Xi(e)?Va:_i.current,r.context=yc(n,s)),r.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(__(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&&mg.enqueueReplaceState(r,r.state,null),cm(n,t,r,i),r.state=n.memoizedState),typeof r.componentDidMount=="function"&&(n.flags|=4194308)}function Mc(n,e){try{var t="",i=e;do t+=YI(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 Fv(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function S_(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var xL=typeof WeakMap=="function"?WeakMap:Map;function qA(n,e,t){t=Ws(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){pm||(pm=!0,I_=i),S_(n,e)},t}function ZA(n,e,t){t=Ws(-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(){S_(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){S_(n,e),typeof i!="function"&&(Do===null?Do=new Set([this]):Do.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function bw(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new xL;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=DL.bind(null,n,e,t),e.then(n,n))}function Rw(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 Cw(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=Ws(-1,1),e.tag=2,No(t,e,1))),t.lanes|=1),n)}var SL=Qs.ReactCurrentOwner,Vi=!1;function Ti(n,e,t,i){e.child=n===null?EA(e,null,t,i):xc(e,n.child,t,i)}function Pw(n,e,t,i,r){t=t.render;var s=e.ref;return dc(e,r),i=Bx(n,e,t,i,s,r),t=Hx(),n!==null&&!Vi?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,qs(n,e,r)):(pn&&t&&Rx(e),e.flags|=1,Ti(n,e,i,r),e.child)}function Iw(n,e,t,i,r){if(n===null){var s=t.type;return typeof s=="function"&&!Qx(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,KA(n,e,s,i,r)):(n=zp(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:vf,t(o,i)&&n.ref===e.ref)return qs(n,e,r)}return e.flags|=1,n=Oo(s,i),n.ref=e.ref,n.return=e,e.child=n}function KA(n,e,t,i,r){if(n!==null){var s=n.memoizedProps;if(vf(s,i)&&n.ref===e.ref)if(Vi=!1,e.pendingProps=i=s,(n.lanes&r)!==0)n.flags&131072&&(Vi=!0);else return e.lanes=n.lanes,qs(n,e,r)}return M_(n,e,t,i,r)}function QA(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(nc,nr),nr|=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(nc,nr),nr|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:t,an(nc,nr),nr|=i}else s!==null?(i=s.baseLanes|t,e.memoizedState=null):i=t,an(nc,nr),nr|=i;return Ti(n,e,r,t),e.child}function $A(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}
vendor: 4,711 bytes, line 40
40function M_(n,e,t,i,r){var s=Xi(t)?Va:_i.current;return s=yc(e,s),dc(e,r),t=Bx(n,e,t,i,s,r),i=Hx(),n!==null&&!Vi?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,qs(n,e,r)):(pn&&i&&Rx(e),e.flags|=1,Ti(n,e,t,r),e.child)}function Lw(n,e,t,i,r){if(Xi(t)){var s=!0;rm(e)}else s=!1;if(dc(e,r),e.stateNode===null)Op(n,e),YA(e,t,i),x_(e,t,i,r),i=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var u=o.context,f=t.contextType;typeof f=="object"&&f!==null?f=br(f):(f=Xi(t)?Va:_i.current,f=yc(e,f));var h=t.getDerivedStateFromProps,d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||u!==f)&&Aw(e,o,i,f),xo=!1;var p=e.memoizedState;o.state=p,cm(e,i,o,r),u=e.memoizedState,a!==i||p!==u||Wi.current||xo?(typeof h=="function"&&(__(e,t,h,i),u=e.memoizedState),(a=xo||Tw(e,t,a,i,p,u,f))?(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=u),o.props=i,o.state=u,o.context=f,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,AA(n,e),a=e.memoizedProps,f=e.type===e.elementType?a:Br(e.type,a),o.props=f,d=e.pendingProps,p=o.context,u=t.contextType,typeof u=="object"&&u!==null?u=br(u):(u=Xi(t)?Va:_i.current,u=yc(e,u));var m=t.getDerivedStateFromProps;(h=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||p!==u)&&Aw(e,o,i,u),xo=!1,p=e.memoizedState,o.state=p,cm(e,i,o,r);var y=e.memoizedState;a!==d||p!==y||Wi.current||xo?(typeof m=="function"&&(__(e,t,m,i),y=e.memoizedState),(f=xo||Tw(e,t,f,i,p,y,u)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,y,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,y,u)),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=u,i=f):(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 w_(n,e,t,i,s,r)}function w_(n,e,t,i,r,s){$A(n,e);var o=(e.flags&128)!==0;if(!i&&!o)return r&&vw(e,t,!1),qs(n,e,s);i=e.stateNode,SL.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&o?(e.child=xc(e,n.child,null,s),e.child=xc(e,null,a,s)):Ti(n,e,a,s),e.memoizedState=i.state,r&&vw(e,t,!0),e.child}function JA(n){var e=n.stateNode;e.pendingContext?gw(n,e.pendingContext,e.pendingContext!==e.context):e.context&&gw(n,e.context,!1),Ox(n,e.containerInfo)}function Nw(n,e,t,i,r){return _c(),Px(r),e.flags|=256,Ti(n,e,t,i),e.child}var E_={dehydrated:null,treeContext:null,retryLane:0};function T_(n){return{baseLanes:n,cachePool:null,transitions:null}}function eb(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 v_(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=yg(o,i,0,null),n=Ua(n,i,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=T_(t),e.memoizedState=E_,n):Wx(e,o));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return ML(n,e,o,i,a,r,t);if(s){s=i.fallback,o=e.mode,r=n.child,a=r.sibling;var u={mode:"hidden",children:i.children};return!(o&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=u,e.deletions=null):(i=Oo(r,u),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=Oo(a,s):(s=Ua(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?T_(t):{base
vendor: 7,079 bytes, line 40
40Lanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=E_,i}return s=n.child,n=s.sibling,i=Oo(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 Wx(n,e){return e=yg({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function Cd(n,e,t,i){return i!==null&&Px(i),xc(e,n.child,null,t),n=Wx(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function ML(n,e,t,i,r,s,o){if(t)return e.flags&256?(e.flags&=-257,i=Fv(Error(Le(422))),Cd(n,e,o,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=yg({mode:"visible",children:i.children},r,0,null),s=Ua(s,r,o,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&xc(e,n.child,null,o),e.child.memoizedState=T_(o),e.memoizedState=E_,s);if(!(e.mode&1))return Cd(n,e,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(Le(419)),i=Fv(s,i,void 0),Cd(n,e,o,i)}if(a=(o&n.childLanes)!==0,Vi||a){if(i=ni,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,Ys(n,r),qr(i,n,r,-1))}return Kx(),i=Fv(Error(Le(421))),Cd(n,e,o,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=UL.bind(null,n),r._reactRetry=e,null):(n=s.treeContext,rr=Lo(r.nextSibling),sr=e,pn=!0,Wr=null,n!==null&&(Sr[Mr++]=Hs,Sr[Mr++]=Gs,Sr[Mr++]=Wa,Hs=n.id,Gs=n.overflow,Wa=e),e=Wx(e,i.children),e.flags|=4096,e)}function Dw(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),y_(n.return,e,t)}function kv(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 tb(n,e,t){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(Ti(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&&Dw(n,t,e);else if(n.tag===19)Dw(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&&um(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),kv(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&&um(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}kv(e,!0,t,null,s);break;case"together":kv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Op(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function qs(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),ja|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Le(153));if(e.child!==null){for(n=e.child,t=Oo(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=Oo(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function wL(n,e,t){switch(e.tag){case 3:JA(e),_c();break;case 5:bA(e);break;case 1:Xi(e.type)&&rm(e);break;case 4:Ox(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;an(am,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?eb(n,e,t):(an(vn,vn.current&1),n=qs(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 tb(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,QA(n,e,t)}return qs(n,e,t)}var nb,A_,ib,rb;nb=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}};A_=function(){};ib=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,Aa(ms.current);var s=null;switch(t){case"input":r=qy(n,r),i=qy(n,i),s=[];break;case"select":r=Mn({},r,{value:void 0}),i=Mn({},i,{value:void 0}),s=[];break;case"textarea":r=Qy(n,r),i=Qy(n,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=nm)}Jy(t,i);var o;t=null;for(f in r)if(!i.hasOwnProperty(f)&&r.hasOwnProperty(f)&&r[f]!=null)if(f==="style"){var a=r[f];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(uf.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in i){var u=i[f];if(a=r!=null?r[f]:void 0,i.hasOwnProperty(f)&&u!==a&&(u!=null||a!=null))if(f==="style")if(a){for(o in a)!a.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in u)u.hasOwnProperty(o)&&a[o]!==u[o]&&(t||(t={}),t[o]=u[o])}else t||(s||(s=[]),s.push(f,t)),t=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(s=s||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(uf.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&cn("scroll",n),s||a===u||(s=[])):(s=s||[]).push(f,u))}t&&(s=s||[]).push("style",t);var f=s;(e.updateQueue=f)&&(e.flags|=4)}};rb=function(n,e,t,i){t!==i&&(e.flags|=4)};function gu(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 di(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 EL(n,e,t){var i=e.pendingProps;switch(Cx(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return di(e),null;case 1:return Xi(e.type)&&im(),di(e),null;
vendor: 31,354 bytes, line 40
40case 3:return i=e.stateNode,Sc(),hn(Wi),hn(_i),kx(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(bd(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Wr!==null&&(D_(Wr),Wr=null))),A_(n,e),di(e),null;case 5:Fx(e);var r=Aa(Mf.current);if(t=e.type,n!==null&&e.stateNode!=null)ib(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Le(166));return di(e),null}if(n=Aa(ms.current),bd(e)){i=e.stateNode,t=e.type;var s=e.memoizedProps;switch(i[fs]=e,i[xf]=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<zu.length;r++)cn(zu[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":VM(i,s),cn("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},cn("invalid",i);break;case"textarea":XM(i,s),cn("invalid",i)}Jy(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&&Ad(i.textContent,a,n),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Ad(i.textContent,a,n),r=["children",""+a]):uf.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&cn("scroll",i)}switch(t){case"input":yd(i),WM(i,s,!0);break;case"textarea":yd(i),jM(i);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(i.onclick=nm)}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=L2(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[fs]=e,n[xf]=i,nb(n,e,!1,!1),e.stateNode=n;e:{switch(o=e_(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<zu.length;r++)cn(zu[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":VM(n,i),r=qy(n,i),cn("invalid",n);break;case"option":r=i;break;case"select":n._wrapperState={wasMultiple:!!i.multiple},r=Mn({},i,{value:void 0}),cn("invalid",n);break;case"textarea":XM(n,i),r=Qy(n,i),cn("invalid",n);break;default:r=i}Jy(t,r),a=r;for(s in a)if(a.hasOwnProperty(s)){var u=a[s];s==="style"?U2(n,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&N2(n,u)):s==="children"?typeof u=="string"?(t!=="textarea"||u!=="")&&ff(n,u):typeof u=="number"&&ff(n,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(uf.hasOwnProperty(s)?u!=null&&s==="onScroll"&&cn("scroll",n):u!=null&&px(n,s,u,o))}switch(t){case"input":yd(n),WM(n,i,!1);break;case"textarea":yd(n),jM(n);break;case"option":i.value!=null&&n.setAttribute("value",""+ko(i.value));break;case"select":n.multiple=!!i.multiple,s=i.value,s!=null?cc(n,!!i.multiple,s,!1):i.defaultValue!=null&&cc(n,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(n.onclick=nm)}switch(t){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return di(e),null;case 6:if(n&&e.stateNode!=null)rb(n,e,n.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Le(166));if(t=Aa(Mf.current),Aa(ms.current),bd(e)){if(i=e.stateNode,t=e.memoizedProps,i[fs]=e,(s=i.nodeValue!==t)&&(n=sr,n!==null))switch(n.tag){case 3:Ad(i.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Ad(i.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else i=(t.nodeType===9?t:t.ownerDocument).createTextNode(i),i[fs]=e,e.stateNode=i}return di(e),null;case 13:if(hn(vn),i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(pn&&rr!==null&&e.mode&1&&!(e.flags&128))MA(),_c(),e.flags|=98560,s=!1;else if(s=bd(e),i!==null&&i.dehydrated!==null){if(n===null){if(!s)throw Error(Le(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Le(317));s[fs]=e}else _c(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;di(e),s=!1}else Wr!==null&&(D_(Wr),Wr=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?Hn===0&&(Hn=3):Kx())),e.updateQueue!==null&&(e.flags|=4),di(e),null);case 4:return Sc(),A_(n,e),n===null&&yf(e.stateNode.containerInfo),di(e),null;case 10:return Nx(e.type._context),di(e),null;case 17:return Xi(e.type)&&im(),di(e),null;case 19:if(hn(vn),s=e.memoizedState,s===null)return di(e),null;if(i=(e.flags&128)!==0,o=s.rendering,o===null)if(i)gu(s,!1);else{if(Hn!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=um(n),o!==null){for(e.flags|=128,gu(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&&In()>wc&&(e.flags|=128,i=!0,gu(s,!1),e.lanes=4194304)}else{if(!i)if(n=um(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),gu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!pn)return di(e),null}else 2*In()-s.renderingStartTime>wc&&t!==1073741824&&(e.flags|=128,i=!0,gu(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=In(),e.sibling=null,t=vn.current,an(vn,i?t&1|2:t&1),e):(di(e),null);case 22:case 23:return Zx(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?nr&1073741824&&(di(e),e.subtreeFlags&6&&(e.flags|=8192)):di(e),null;case 24:return null;case 25:return null}throw Error(Le(156,e.tag))}function TL(n,e){switch(Cx(e),e.tag){case 1:return Xi(e.type)&&im(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Sc(),hn(Wi),hn(_i),kx(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return Fx(e),null;case 13:if(hn(vn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Le(340));_c()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return hn(vn),null;case 4:return Sc(),null;case 10:return Nx(e.type._context),null;case 22:case 23:return Zx(),null;case 24:return null;default:return null}}var Pd=!1,vi=!1,AL=typeof WeakSet=="function"?WeakSet:Set,st=null;function tc(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){An(n,e,i)}else t.current=null}function b_(n,e,t){try{t()}catch(i){An(n,e,i)}}var Uw=!1;function bL(n,e){if(u_=Jp,n=cA(),bx(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,u=-1,f=0,h=0,d=n,p=null;t:for(;;){for(var m;d!==t||r!==0&&d.nodeType!==3||(a=o+r),d!==s||i!==0&&d.nodeType!==3||(u=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===n)break t;if(p===t&&++f===r&&(a=o),p===s&&++h===i&&(u=o),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}t=a===-1||u===-1?null:{start:a,end:u}}else t=null}t=t||{start:0,end:0}}else t=null;for(f_={focusedElem:n,selectionRange:t},Jp=!1,st=e;st!==null;)if(e=st,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,st=n;else for(;st!==null;){e=st;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,_=y.memoizedState,v=e.stateNode,S=v.getSnapshotBeforeUpdate(e.elementType===e.type?w:Br(e.type,w),_);v.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var M=e.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Le(163))}}catch(T){An(e,e.return,T)}if(n=e.sibling,n!==null){n.return=e.return,st=n;break}st=e.return}return y=Uw,Uw=!1,y}function qu(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&&b_(e,t,s)}r=r.next}while(r!==i)}}function gg(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 R_(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 sb(n){var e=n.alternate;e!==null&&(n.alternate=null,sb(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[fs],delete e[xf],delete e[p_],delete e[cL],delete e[uL])),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 ob(n){return n.tag===5||n.tag===3||n.tag===4}function Ow(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||ob(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 C_(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=nm));else if(i!==4&&(n=n.child,n!==null))for(C_(n,e,t),n=n.sibling;n!==null;)C_(n,e,t),n=n.sibling}function P_(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(P_(n,e,t),n=n.sibling;n!==null;)P_(n,e,t),n=n.sibling}var ri=null,Gr=!1;function lo(n,e,t){for(t=t.child;t!==null;)ab(n,e,t),t=t.sibling}function ab(n,e,t){if(ps&&typeof ps.onCommitFiberUnmount=="function")try{ps.onCommitFiberUnmount(lg,t)}catch{}switch(t.tag){case 5:vi||tc(t,e);case 6:var i=ri,r=Gr;ri=null,lo(n,e,t),ri=i,Gr=r,ri!==null&&(Gr?(n=ri,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):ri.removeChild(t.stateNode));break;case 18:ri!==null&&(Gr?(n=ri,t=t.stateNode,n.nodeType===8?Iv(n.parentNode,t):n.nodeType===1&&Iv(n,t),mf(n)):Iv(ri,t.stateNode));break;case 4:i=ri,r=Gr,ri=t.stateNode.containerInfo,Gr=!0,lo(n,e,t),ri=i,Gr=r;break;case 0:case 11:case 14:case 15:if(!vi&&(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)&&b_(t,e,o),r=r.next}while(r!==i)}lo(n,e,t);break;case 1:if(!vi&&(tc(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){An(t,e,a)}lo(n,e,t);break;case 21:lo(n,e,t);break;case 22:t.mode&1?(vi=(i=vi)||t.memoizedState!==null,lo(n,e,t),vi=i):lo(n,e,t);break;default:lo(n,e,t)}}function Fw(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new AL),e.forEach(function(i){var r=OL.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function Ur(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:ri=a.stateNode,Gr=!1;break e;case 3:ri=a.stateNode.containerInfo,Gr=!0;break e;case 4:ri=a.stateNode.containerInfo,Gr=!0;break e}a=a.return}if(ri===null)throw Error(Le(160));ab(s,o,r),ri=null,Gr=!1;var u=r.alternate;u!==null&&(u.return=null),r.return=null}catch(f){An(r,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)lb(e,n),e=e.sibling}function lb(n,e){var t=n.alternate,i=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Ur(e,n),cs(n),i&4){try{qu(3,n,n.return),gg(3,n)}catch(w){An(n,n.return,w)}try{qu(5,n,n.return)}catch(w){An(n,n.return,w)}}break;case 1:Ur(e,n),cs(n),i&512&&t!==null&&tc(t,t.return);break;case 5:if(Ur(e,n),cs(n),i&512&&t!==null&&tc(t,t.return),n.flags&32){var r=n.stateNode;try{ff(r,"")}catch(w){An(n,n.return,w)}}if(i&4&&(r=n.stateNode,r!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,u=n.updateQueue;if(n.updateQueue=null,u!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&P2(r,s),e_(a,o);var f=e_(a,s);for(o=0;o<u.length;o+=2){var h=u[o],d=u[o+1];h==="style"?U2(r,d):h==="dangerouslySetInnerHTML"?N2(r,d):h==="children"?ff(r,d):px(r,h,d,f)}switch(a){case"input":Zy(r,s);break;case"textarea":I2(r,s);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?cc(r,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?cc(r,!!s.multiple,s.defaultValue,!0):cc(r,!!s.multiple,s.multiple?[]:"",!1))}r[xf]=s}catch(w){An(n,n.return,w)}}break;case 6:if(Ur(e,n),cs(n),i&4){if(n.stateNode===null)throw Error(Le(162));r=n.stateNode,s=n.memoizedProps;try{r.nodeValue=s}catch(w){An(n,n.return,w)}}break;case 3:if(Ur(e,n),cs(n),i&4&&t!==null&&t.memoizedState.isDehydrated)try{mf(e.containerInfo)}catch(w){An(n,n.return,w)}break;case 4:Ur(e,n),cs(n);break;case 13:Ur(e,n),cs(n),r=n.child,r.flags&8192&&(s=r.memoizedState!==null,r.stateNode.isHidden=s,!s||r.alternate!==null&&r.alternate.memoizedState!==null||(Yx=In())),i&4&&Fw(n);break;case 22:if(h=t!==null&&t.memoizedState!==null,n.mode&1?(vi=(f=vi)||h,Ur(e,n),vi=f):Ur(e,n),cs(n),i&8192){if(f=n.memoizedState!==null,(n.stateNode.isHidden=f)&&!h&&n.mode&1)for(st=n,h=n.child;h!==null;){for(d=st=h;st!==null;){switch(p=st,m=p.child,p.tag){case 0:case 11:case 14:case 15:qu(4,p,p.return);break;case 1:tc(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(w){An(i,t,w)}}break;case 5:tc(p,p.return);break;case 22:if(p.memoizedState!==null){zw(d);continue}}m!==null?(m.return=p,st=m):zw(d)}h=h.sibling}e:for(h=null,d=n;;){if(d.tag===5){if(h===null){h=d;try{r=d.stateNode,f?(s=r.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,u=d.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=D2("display",o))}catch(w){An(n,n.return,w)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(w){An(n,n.return,w)}}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;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ur(e,n),cs(n),i&4&&Fw(n);break;case 21:break;default:Ur(e,n),cs(n)}}function cs(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(ob(t)){var i=t;break e}t=t.return}throw Error(Le(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(ff(r,""),i.flags&=-33);var s=Ow(n);P_(n,s,r);break;case 3:case 4:var o=i.stateNode.containerInfo,a=Ow(n);C_(n,a,o);break;default:throw Error(Le(161))}}catch(u){An(n,n.return,u)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function RL(n,e,t){st=n,cb(n)}function cb(n,e,t){for(var i=(n.mode&1)!==0;st!==null;){var r=st,s=r.child;if(r.tag===22&&i){var o=r.memoizedState!==null||Pd;if(!o){var a=r.alternate,u=a!==null&&a.memoizedState!==null||vi;a=Pd;var f=vi;if(Pd=o,(vi=u)&&!f)for(st=r;st!==null;)o=st,u=o.child,o.tag===22&&o.memoizedState!==null?Bw(r):u!==null?(u.return=o,st=u):Bw(r);for(;s!==null;)st=s,cb(s),s=s.sibling;st=r,Pd=a,vi=f}kw(n)}else r.subtreeFlags&8772&&s!==null?(s.return=r,st=s):kw(n)}}function kw(n){for(;st!==null;){var e=st;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:vi||gg(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!vi)if(t===null)i.componentDidMount();else{var r=e.elementType===e.type?t.memoizedProps:Br(e.type,t.memoizedProps);i.componentDidUpdate(r,t.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Mw(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}Mw(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var u=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&t.focus();break;case"img":u.src&&(t.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var f=e.alternate;if(f!==null){var h=f.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&mf(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Le(163))}vi||e.flags&512&&R_(e)}catch(p){An(e,e.return,p)}}if(e===n){st=null;break}if(t=e.sibling,t!==null){t.return=e.return,st=t;break}st=e.return}}function zw(n){for(;st!==null;){var e=st;if(e===n){st=null;break}var t=e.sibling;if(t!==null){t.return=e.return,st=t;break}st=e.return}}function Bw(n){for(;st!==null;){var e=st;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{gg(4,e)}catch(u){An(e,t,u)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(u){An(e,r,u)}}var s=e.return;try{R_(e)}catch(u){An(e,s,u)}break;case 5:var o=e.return;try{R_(e)}catch(u){An(e,o,u)}}}catch(u){An(e,e.return,u)}if(e===n){st=null;break}var a=e.sibling;if(a!==null){a.return=e.return,st=a;break}st=e.return}}var CL=Math.ceil,dm=Qs.ReactCurrentDispatcher,Xx=Qs.ReactCurrentOwner,Ar=Qs.ReactCurrentBatchConfig,jt=0,ni=null,On=null,si=0,nr=0,nc=jo(0),Hn=0,Af=null,ja=0,vg=0,jx=0,Zu=null,Hi=null,Yx=0,wc=1/0,Fs=null,pm=!1,I_=null,Do=null,Id=!1,bo=null,mm=0,Ku=0,L_=null,Fp=-1,kp=0;function Ri(){return jt&6?In():Fp!==-1?Fp:Fp=In()}function Uo(n){return n.mode&1?jt&2&&si!==0?si&-si:hL.transition!==null?(kp===0&&(kp=Y2()),kp):(n=$t,n!==0||(n=window.event,n=n===void 0?16:eA(n.type)),n):1}function qr(n,e,t,i){if(50<Ku)throw Ku=0,L_=null,Error(Le(185));Kf(n,t,i),(!(jt&2)||n!==ni)&&(n===ni&&(!(jt&2)&&(vg|=t),Hn===4&&Eo(n,si)),ji(n,i),t===1&&jt===0&&!(e.mode&1)&&(wc=In()+500,dg&&Yo()))}function ji(n,e){var t=n.callbackNode;h3(n,e);var i=$p(n,n===ni?si:0);if(i===0)t!==null&&ZM(t),n.callbackNode=null,n.callbackPriority=0;else if(e=i&-i,n.callbackPriority!==e){if(t!=null&&ZM(t),e===1)n.tag===0?fL(Hw.bind(null,n)):_A(Hw.bind(null,n)),aL(function(){!(jt&6)&&Yo()}),t=null;else{switch(q2(i)){case 1:t=_x;break;case 4:t=X2;break;case 16:t=Qp;break;case 536870912:t=j2;break;default:t=Qp}t=vb(t,ub.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function ub(n,e){if(Fp=-1,kp=0,jt&6)throw Error(Le(327));var t=n.callbackNode;if(pc()&&n.callbackNode!==t)return null;var i=$p(n,n===ni?si:0);if(i===0)return null;if(i&30||i&n.expiredLanes||e)e=gm(n,i);else{e=i;var r=jt;jt|=2;var s=hb();(ni!==n||si!==e)&&(Fs=null,wc=In()+500,Da(n,e));do try{LL();break}catch(a){fb(n,a)}while(!0);Lx(),dm.current=s,jt=r,On!==null?e=0:(ni=null,si=0,e=Hn)}if(e!==0){if(e===2&&(r=s_(n),r!==0&&(i=r,e=N_(n,r))),e===1)throw t=Af,Da(n,0),Eo(n,i),ji(n,In()),t;if(e===6)Eo(n,i);else{if(r=n.current.alternate,!(i&30)&&!PL(r)&&(e=gm(n,i),e===2&&(s=s_(n),s!==0&&(i=s,e=N_(n,s))),e===1))throw t=Af,Da(n,0),Eo(n,i),ji(n,In()),t;switch(n.finishedWork=r,n.finishedLanes=i,e){case 0:case 1:throw Error(Le(345));case 2:xa(n,Hi,Fs);break;case 3:if(Eo(n,i),(i&130023424)===i&&(e=Yx+500-In(),10<e)){if($p(n,0)!==0)break;if(r=n.suspendedLanes,(r&i)!==i){Ri(),n.pingedLanes|=n.suspendedLanes&r;break}n.timeoutHandle=d_(xa.bind(null,n,Hi,Fs),e);break}xa(n,Hi,Fs);break;case 4:if(Eo(n,i),(i&4194240)===i)break;for(e=n.eventTimes,r=-1;0<i;){var o=31-Yr(i);s=1<<o,o=e[o],o>r&&(r=o),i&=~s}if(i=r,i=In()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*CL(i/1960))-i,10<i){n.timeoutHandle=d_(xa.bind(null,n,Hi,Fs),i);break}xa(n,Hi,Fs);break;case 5:xa(n,Hi,Fs);break;default:throw Error(Le(329))}}}return ji(n,In()),n.callbackNode===t?ub.bind(null,n):null}function N_(n,e){var t=Zu;return n.current.memoizedState.isDehydrated&&(Da(n,e).flags|=256),n=gm(n,e),n!==2&&(e=Hi,Hi=t,e!==null&&D_(e)),n}function D_(n){Hi===null?Hi=n:Hi.push.apply(Hi,n)}function PL(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(!Kr(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 Eo(n,e){for(e&=~jx,e&=~vg,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-Yr(e),i=1<<t;n[t]=-1,e&=~i}}function Hw(n){if(jt&6)throw Error(Le(327));pc();var e=$p(n,0);if(!(e&1))return ji(n,In()),null;var t=gm(n,e);if(n.tag!==0&&t===2){var i=s_(n);i!==0&&(e=i,t=N_(n,i))}if(t===1)throw t=Af,Da(n,0),Eo(n,e),ji(n,In()),t;if(t===6)throw Error(Le(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,xa(n,Hi,Fs),ji(n,In()),null}function qx(n,e){var t=jt;jt|=1;try{return n(e)}finally{jt=t,jt===0&&(wc=In()+500,dg&&Yo())}}function Ya(n){bo!==null&&bo.tag===0&&!(jt&6)&&pc();var e=jt;jt|=1;var t=Ar.transition,i=$t;try{if(Ar.transition=null,$t=1,n)return n()}finally{$t=i,Ar.transition=t,jt=e,!(jt&6)&&Yo()}}function Zx(){nr=nc.current,hn(nc)}function Da(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,oL(t)),On!==null)for(t=On.return;t!==null;){var i=t;switch(Cx(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&im();break;case 3:Sc(),hn(Wi),hn(_i),kx();break;case 5:Fx(i);break;case 4:Sc();break;case 13:hn(vn);break;case 19:hn(vn);break;case 10:Nx(i.type._context);break;case 22:case 23:Zx()}t=t.return}if(ni=n,On=n=Oo(n.current,null),si=nr=e,Hn=0,Af=null,jx=vg=ja=0,Hi=Zu=null,Ta!==null){for(e=0;e<Ta.length;e++)if(t=Ta[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}Ta=null}return n}function fb(n,e){do{var t=On;try{if(Lx(),Dp.current=hm,fm){for(var i=Sn.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}fm=!1}if(Xa=0,Qn=Bn=Sn=null,Yu=!1,wf=0,Xx.current=null,t===null||t.return===null){Hn=1,Af=e,On=null;break}e:{var s=n,o=t.return,a=t,u=e;if(e=si,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,h=a,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var p=h.alternate;p?(h.updateQueue=p.updateQueue,h.memoizedState=p.memoizedState,h.lanes=p.lanes):(h.updateQueue=null,h.memoizedState=null)}var m=Rw(o);if(m!==null){m.flags&=-257,Cw(m,o,a,s,e),m.mode&1&&bw(s,f,e),e=m,u=f;var y=e.updateQueue;if(y===null){var w=new Set;w.add(u),e.updateQueue=w}else y.add(u);break e}else{if(!(e&1)){bw(s,f,e),Kx();break e}u=Error(Le(426))}}else if(pn&&a.mode&1){var _=Rw(o);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Cw(_,o,a,s,e),Px(Mc(u,a));break e}}s=u=Mc(u,a),Hn!==4&&(Hn=2),Zu===null?Zu=[s]:Zu.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var v=qA(s,u,e);Sw(s,v);break e;case 1:a=u;var S=s.type,M=s.stateNode;if(!(s.flags&128)&&(typeof S.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(Do===null||!Do.has(M)))){s.flags|=65536,e&=-e,s.lanes|=e;var T=ZA(s,a,e);Sw(s,T);break e}}s=s.return}while(s!==null)}pb(t)}catch(I){e=I,On===t&&t!==null&&(On=t=t.return);continue}break}while(!0)}function hb(){var n=dm.current;return dm.current=hm,n===null?hm:n}function Kx(){(Hn===0||Hn===3||Hn===2)&&(Hn=4),ni===null||!(ja&268435455)&&!(vg&268435455)||Eo(ni,si)}function gm(n,e){var t=jt;jt|=2;var i=hb();(ni!==n||si!==e)&&(Fs=null,Da(n,e));do try{IL();break}catch(r){fb(n,r)}while(!0);if(Lx(),jt=t,dm.current=i,On!==null)throw Error(Le(261));return ni=null,si=0,Hn}function IL(){for(;On!==null;)db(On)}function LL(){for(;On!==null&&!i3();)db(On)}function db(n){var e=gb(n.alternate,n,nr);n.memoizedProps=n.pendingProps,e===null?pb(n):On=e,Xx.current=null}function pb(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=TL(t,e),t!==null){t.flags&=32767,On=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{Hn=6,On=null;return}}else if(t=EL(t,e,nr),t!==null){On=t;return}if(e=e.sibling,e!==null){On=e;return}On=e=n}while(e!==null);Hn===0&&(Hn=5)}function xa(n,e,t){var i=$t,r=Ar.transition;try{Ar.transition=null,$t=1,NL(n,e,t,i)}finally{Ar.transition=r,$t=i}return null}function NL(n,e,t,i){do pc();while(bo!==null);if(jt&6)throw Error(Le(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(Le(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(d3(n,s),n===ni&&(On=ni=null,si=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||Id||(Id=!0,vb(Qp,function(){return pc(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=Ar.transition,Ar.transition=null;var o=$t;$t=1;var a=jt;jt|=4,Xx.current=null,bL(n,t),lb(t,n),J3(f_),Jp=!!u_,f_=u_=null,n.current=t,RL(t),r3(),jt=a,$t=o,Ar.transition=s}else n.current=t;if(Id&&(Id=!1,bo=n,mm=r),s=n.pendingLanes,s===0&&(Do=null),a3(t.stateNode),ji(n,In()),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(pm)throw pm=!1,n=I_,I_=null,n;return mm&1&&n.tag!==0&&pc(),s=n.pendingLanes,s&1?n===L_?Ku++:(Ku=0,L_=n):Ku=0,Yo(),null}function pc(){if(bo!==null){var n=q2(mm),e=Ar.transition,t=$t;try{if(Ar.transition=null,$t=16>n?16:n,bo===null)var i=!1;else{if(n=bo,bo=null,mm=0,jt&6)throw Error(Le(331));var r=jt;for(jt|=4,st=n.current;st!==null;){var s=st,o=s.child;if(st.flags&16){var a=s.deletions;if(a!==null){for(var u=0;u<a.length;u++){var f=a[u];for(st=f;st!==null;){var h=st;switch(h.tag){case 0:case 11:case 15:qu(8,h,s)}var d=h.child;if(d!==null)d.return=h,st=d;else for(;st!==null;){h=st;var p=h.sibling,m=h.return;if(sb(h),h===f){st=null;break}if(p!==null){p.return=m,st=p;break}st=m}}}var y=s.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var _=w.sibling;w.sibling=null,w=_}while(w!==null)}}st=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,st=o;else e:for(;st!==null;){if(s=st,s.flags&2048)switch(s.tag){case 0:case 11:case 15:qu(9,s,s.return)}var v=s.sibling;if(v!==null){v.return=s.return,st=v;break e}st=s.return}}var S=n.current;for(st=S;st!==null;){o=st;var M=o.child;if(o.subtreeFlags&2064&&M!==null)M.return=o,st=M;else e:for(o=S;st!==null;){if(a=st,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:gg(9,a)}}catch(I){An(a,a.return,I)}if(a===o){st=null;break e}var T=a.sibling;if(T!==null){T.return=a.return,st=T;break e}st=a.return}}if(jt=r,Yo(),ps&&typeof ps.onPostCommitFiberRoot=="function")try{ps.onPostCommitFiberRoot(lg,n)}catch{}i=!0}return i}finally{$t=t,Ar.transition=e}}return!1}function Gw(n,e,t){e=Mc(t,e),e=qA(n,e,1),n=No(n,e,1),e=Ri(),n!==null&&(Kf(n,1,e),ji(n,e))}function An(n,e,t){if(n.tag===3)Gw(n,n,t);else for(;e!==null;){if(e.tag===3){Gw(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Do===null||!Do.has(i))){n=Mc(t,n),n=ZA(e,n,1),e=No(e,n,1),n=Ri(),e!==null&&(Kf(e,1,n),ji(e,n));break}}e=e.return}}function DL(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),e=Ri(),n.pingedLanes|=n.suspendedLanes&t,ni===n&&(si&t)===t&&(Hn===4||Hn===3&&(si&130023424)===si&&500>In()-Yx?Da(n,0):jx|=t),ji(n,e)}function mb(n,e){e===0&&(n.mode&1?(e=Sd,Sd<<=1,!(Sd&130023424)&&(Sd=4194304)):e=1);var t=Ri();n=Ys(n,e),n!==null&&(Kf(n,e,t),ji(n,t))}function UL(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),mb(n,t)}function OL(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(Le(314))}i!==null&&i.delete(e),mb(n,t)}var gb;gb=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Wi.current)Vi=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Vi=!1,wL(n,e,t);Vi=!!(n.flags&131072)}else Vi=!1,pn&&e.flags&1048576&&xA(e,om,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Op(n,e),n=e.pendingProps;var r=yc(e,_i.current);dc(e,t),r=Bx(null,e,i,n,r,t);var s=Hx();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,Xi(i)?(s=!0,rm(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Ux(e),r.updater=mg,e.stateNode=r,r._reactInternals=e,x_(e,i,n,t),e=w_(null,e,i,!0,s,t)):(e.tag=0,pn&&s&&Rx(e),Ti(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Op(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=kL(i),n=Br(i,n),r){case 0:e=M_(null,e,i,n,t);break e;case 1:e=Lw(null,e,i,n,t);break e;case 11:e=Pw(null,e,i,n,t);break e;case 14:e=Iw(null,e,i,Br(i.type,n),t);break e}throw Error(Le(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Br(i,r),M_(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Br(i,r),Lw(n,e,i,r,t);case 3:e:{if(JA(e),n===null)throw Error(Le(387));i=e.pendingProps,s=e.memoizedState,r=s.element,AA(n,e),cm(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=Mc(Error(Le(423)),e),e=Nw(n,e,i,t,r);break e}else if(i!==r){r=Mc(Error(Le(424)),e),e=Nw(n,e,i,t,r);break e}else for(rr=Lo(e.stateNode.containerInfo.firstChild),sr=e,pn=!0,Wr=null,t=EA(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(_c(),i===r){e=qs(n,e,t);break e}Ti(n,e,i,t)}e=e.child}return e;case 5:return bA(e),n===null&&v_(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,h_(i,r)?o=null:s!==null&&h_(i,s)&&(e.flags|=32),$A(n,e),Ti(n,e,o,t),e.child;case 6:return n===null&&v_(e),null;case 13:return eb(n,e,t);case 4:return Ox(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=xc(e,null,i,t):Ti(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Br(i,r),Pw(n,e,i,r,t);case 7:return Ti(n,e,e.pendingProps,t),e.child;case 8:return Ti(n,e,e.pendingProps.children,t),e.child;case 12:return Ti(n,e,e.pendingProps.children,t),e.child;
vendor: 4,669 bytes, line 40
40case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,an(am,i._currentValue),i._currentValue=o,s!==null)if(Kr(s.value,o)){if(s.children===r.children&&!Wi.current){e=qs(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===i){if(s.tag===1){u=Ws(-1,t&-t),u.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?u.next=u:(u.next=h.next,h.next=u),f.pending=u}}s.lanes|=t,u=s.alternate,u!==null&&(u.lanes|=t),y_(s.return,t,e),a.lanes|=t;break}u=u.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Le(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),y_(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}Ti(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,dc(e,t),r=br(r),i=i(r),e.flags|=1,Ti(n,e,i,t),e.child;case 14:return i=e.type,r=Br(i,e.pendingProps),r=Br(i.type,r),Iw(n,e,i,r,t);case 15:return KA(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Br(i,r),Op(n,e),e.tag=1,Xi(i)?(n=!0,rm(e)):n=!1,dc(e,t),YA(e,i,r),x_(e,i,r,t),w_(null,e,i,!0,n,t);case 19:return tb(n,e,t);case 22:return QA(n,e,t)}throw Error(Le(156,e.tag))};function vb(n,e){return W2(n,e)}function FL(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 Tr(n,e,t,i){return new FL(n,e,t,i)}function Qx(n){return n=n.prototype,!(!n||!n.isReactComponent)}function kL(n){if(typeof n=="function")return Qx(n)?1:0;if(n!=null){if(n=n.$$typeof,n===gx)return 11;if(n===vx)return 14}return 2}function Oo(n,e){var t=n.alternate;return t===null?(t=Tr(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function zp(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")Qx(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case jl:return Ua(t.children,r,s,e);case mx:o=8,r|=8;break;case Wy:return n=Tr(12,t,e,r|2),n.elementType=Wy,n.lanes=s,n;case Xy:return n=Tr(13,t,e,r),n.elementType=Xy,n.lanes=s,n;case jy:return n=Tr(19,t,e,r),n.elementType=jy,n.lanes=s,n;case b2:return yg(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case T2:o=10;break e;case A2:o=9;break e;case gx:o=11;break e;case vx:o=14;break e;case _o:o=16,i=null;break e}throw Error(Le(130,n==null?n:typeof n,""))}return e=Tr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Ua(n,e,t,i){return n=Tr(7,n,i,e),n.lanes=t,n}function yg(n,e,t,i){return n=Tr(22,n,i,e),n.elementType=b2,n.lanes=t,n.stateNode={isHidden:!1},n}function zv(n,e,t){return n=Tr(6,n,null,e),n.lanes=t,n}function Bv(n,e,t){return e=Tr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function zL(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=xv(0),this.expirationTimes=xv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xv(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function $x(n,e,t,i,r,s,o,a,u){return n=new zL(n,e,t,a,u),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Tr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ux(s),n}function BL(n,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xl,key:i==null?null:""+i,children:n,containerInfo:e,implementation:t}}function yb(n){if(!n)return zo;
vendor: 9,685 bytes, lines 40-44
40n=n._reactInternals;e:{if(tl(n)!==n||n.tag!==1)throw Error(Le(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Xi(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Le(171))}if(n.tag===1){var t=n.type;if(Xi(t))return yA(n,t,e)}return e}function _b(n,e,t,i,r,s,o,a,u){return n=$x(t,i,!0,n,r,s,o,a,u),n.context=yb(null),t=n.current,i=Ri(),r=Uo(t),s=Ws(i,r),s.callback=e??null,No(t,s,r),n.current.lanes=r,Kf(n,r,i),ji(n,i),n}function _g(n,e,t,i){var r=e.current,s=Ri(),o=Uo(r);return t=yb(t),e.context===null?e.context=t:e.pendingContext=t,e=Ws(s,o),e.payload={element:n},i=i===void 0?null:i,i!==null&&(e.callback=i),n=No(r,e,o),n!==null&&(qr(n,r,o,s),Np(n,r,o)),o}function vm(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 Vw(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function Jx(n,e){Vw(n,e),(n=n.alternate)&&Vw(n,e)}function HL(){return null}var xb=typeof reportError=="function"?reportError:function(n){console.error(n)};function eS(n){this._internalRoot=n}xg.prototype.render=eS.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Le(409));_g(n,e,null,null)};xg.prototype.unmount=eS.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;Ya(function(){_g(null,n,null,null)}),e[js]=null}};function xg(n){this._internalRoot=n}xg.prototype.unstable_scheduleHydration=function(n){if(n){var e=Q2();n={blockedOn:null,target:n,priority:e};for(var t=0;t<wo.length&&e!==0&&e<wo[t].priority;t++);wo.splice(t,0,n),t===0&&J2(n)}};function tS(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function Sg(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function Ww(){}function GL(n,e,t,i,r){if(r){if(typeof i=="function"){var s=i;i=function(){var f=vm(o);s.call(f)}}var o=_b(e,i,n,0,null,!1,!1,"",Ww);return n._reactRootContainer=o,n[js]=o.current,yf(n.nodeType===8?n.parentNode:n),Ya(),o}for(;r=n.lastChild;)n.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var f=vm(u);a.call(f)}}var u=$x(n,0,!1,null,null,!1,!1,"",Ww);return n._reactRootContainer=u,n[js]=u.current,yf(n.nodeType===8?n.parentNode:n),Ya(function(){_g(e,u,t,i)}),u}function Mg(n,e,t,i,r){var s=t._reactRootContainer;if(s){var o=s;if(typeof r=="function"){var a=r;r=function(){var u=vm(o);a.call(u)}}_g(e,o,n,r)}else o=GL(t,e,n,r,i);return vm(o)}Z2=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=ku(e.pendingLanes);t!==0&&(xx(e,t|1),ji(e,In()),!(jt&6)&&(wc=In()+500,Yo()))}break;case 13:Ya(function(){var i=Ys(n,1);if(i!==null){var r=Ri();qr(i,n,1,r)}}),Jx(n,1)}};Sx=function(n){if(n.tag===13){var e=Ys(n,134217728);if(e!==null){var t=Ri();qr(e,n,134217728,t)}Jx(n,134217728)}};K2=function(n){if(n.tag===13){var e=Uo(n),t=Ys(n,e);if(t!==null){var i=Ri();qr(t,n,e,i)}Jx(n,e)}};Q2=function(){return $t};$2=function(n,e){var t=$t;try{return $t=n,e()}finally{$t=t}};n_=function(n,e,t){switch(e){case"input":if(Zy(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=hg(i);if(!r)throw Error(Le(90));C2(i),Zy(i,r)}}}break;case"textarea":I2(n,t);break;case"select":e=t.value,e!=null&&cc(n,!!t.multiple,e,!1)}};k2=qx;z2=Ya;var VL={usingClientEntryPoint:!1,Events:[$f,Kl,hg,O2,F2,qx]},vu={findFiberByHostInstance:Ea,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},WL={bundleType:vu.bundleType,version:vu.version,rendererPackageName:vu.rendererPackageName,rendererConfig:vu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Qs.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=G2(n),n===null?null:n.stateNode},findFiberByHostInstance:vu.findFiberByHostInstance||HL,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 Ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ld.isDisabled&&Ld.supportsFiber)try{lg=Ld.inject(WL),ps=Ld}catch{}}ur.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=VL;ur.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tS(e))throw Error(Le(200));return BL(n,e,null,t)};ur.createRoot=function(n,e){if(!tS(n))throw Error(Le(299));var t=!1,i="",r=xb;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=$x(n,1,!1,null,null,t,!1,i,r),n[js]=e.current,yf(n.nodeType===8?n.parentNode:n),new eS(e)};ur.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(Le(188)):(n=Object.keys(n).join(","),Error(Le(268,n)));return n=G2(e),n=n===null?null:n.stateNode,n};ur.flushSync=function(n){return Ya(n)};ur.hydrate=function(n,e,t){if(!Sg(e))throw Error(Le(200));return Mg(null,n,e,!0,t)};ur.hydrateRoot=function(n,e,t){if(!tS(n))throw Error(Le(405));var i=t!=null&&t.hydratedSources||null,r=!1,s="",o=xb;if(t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=_b(e,null,n,1,t??null,r,!1,s,o),n[js]=e.current,yf(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 xg(e)};ur.render=function(n,e,t){if(!Sg(e))throw Error(Le(200));return Mg(null,n,e,!1,t)};ur.unmountComponentAtNode=function(n){if(!Sg(n))throw Error(Le(40));return n._reactRootContainer?(Ya(function(){Mg(null,null,n,!1,function(){n._reactRootContainer=null,n[js]=null})}),!0):!1};ur.unstable_batchedUpdates=qx;ur.unstable_renderSubtreeIntoContainer=function(n,e,t,i){if(!Sg(t))throw Error(Le(200));if(n==null||n._reactInternals===void 0)throw Error(Le(38));return Mg(n,e,t,!1,i)};ur.version="18.3.1-next-f1338f8080-20240426";function Sb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sb)}catch(n){console.error(n)}}Sb(),S2.exports=ur;var XL=S2.exports,Mb,Xw=XL;Mb=Xw.createRoot,Xw.hydrateRoot;/** 41 * @license 42 * Copyright 2010-2024 Three.js Authors 43 * SPDX-License-Identifier: MIT 44 */const eh="169",jL={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},YL={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},wb=0,U_=1,Eb=2,qL=3,Tb=0,wg=1,Qu=2,Hr=3,Zs=0,Ci=1,jr=2,gs=0,Oa=1,O_=2,F_=3,k_=4,Ab=5,To=100,bb=101,Rb=102,Cb=103,Pb=104,Ib=200,Lb=201,Nb=202,Db=203,ym=204,_m=205,Ub=206,Ob=207,Fb=208,kb=209,zb=210,Bb=211,Hb=212,Gb=213,Vb=214,xm=0,Sm=1,Mm=2,qa=3,wm=4,Em=5,Tm=6,Am=7,th=0,Wb=1,Xb=2,vs=0,jb=1,Yb=2,qb=3,nh=4,Zb=5,Kb=6,Qb=7,z_="attached",$b="detached",Bo=300,_s=301,Ho=302,Ec=303,bf=304,kc=306,Rf=1e3,Fn=1001,Cf=1002,Jn=1003,nS=1004,ZL=1004,ic=1005,KL=1005,Qt=1006,$u=1007,QL=1007,hs=1008,B_=1008,Yi=1009,Eg=1010,Tg=1011,Tc=1012,ih=1013,xs=1014,_n=1015,ei=1016,Ag=1017,bg=1018,Za=1020,iS=35902,rS=1021,sS=1022,Ln=1023,oS=1024,aS=1025,Fa=1026,Ka=1027,rh=1028,sh=1029,lS=1030,Rg=1031,$L=1032,Cg=1033,Ju=33776,ef=33777,tf=33778,nf=33779,bm=35840,Rm=35841,Cm=35842,Pm=35843,Im=36196,Lm=37492,Nm=37496,Dm=37808,Um=37809,Om=37810,Fm=37811,km=37812,zm=37813,Bm=37814,Hm=37815,Gm=37816,Vm=37817,Wm=37818,Xm=37819,jm=37820,Ym=37821,rf=36492,qm=36494,Zm=36495,cS=36283,Km=36284,Qm=36285,$m=36286,Jb=2200,eR=2201,tR=2202,Pf=2300,Jm=2301,Bp=2302,ba=2400,Ra=2401,If=2402,Pg=2500,uS=2501,JL=0,eN=1,tN=2,nR=3200,iR=3201,nN=3202,iN=3203,qo=0,rR=1,zs="",ir="srgb",Cr="srgb-linear",Ig="display-p3",oh="display-p3-linear",Lf="linear",sn="srgb",Nf="rec709",Df="p3",rN=0,Sa=7680,sN=7681,oN=7682,aN=7683,lN=34055,cN=34056,uN=5386,fN=512,hN=513,dN=514,pN=515,mN=516,gN=517,vN=518,H_=519,sR=512,oR=513,aR=514,fS=515,lR=516,cR=517,uR=518,fR=519,Uf=35044,yN=35048,_N=35040,xN=35045,SN=35049,MN=35041,wN=35046,EN=35050,TN=35042,AN="100",G_="300 es",ds=2e3,Of=2001;class Ms{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","5
445","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 jw=1234567;const ka=Math.PI/180,Ac=180/Math.PI;function or(){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 hS(n,e){return(n%e+e)%e}function bN(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function RN(n,e,t){return n!==e?(t-n)/(e-n):0}function sf(n,e,t){return(1-t)*n+t*e}function CN(n,e,t,i){return sf(n,e,1-Math.exp(-t*i))}function PN(n,e=1){return e-Math.abs(hS(n,e*2)-e)}function IN(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function LN(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function NN(n,e){return n+Math.floor(Math.random()*(e-n+1))}function DN(n,e){return n+Math.random()*(e-n)}function UN(n){return n*(.5-Math.random())}function ON(n){n!==void 0&&(jw=n);let e=jw+=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 FN(n){return n*ka}function kN(n){return n*Ac}function zN(n){return(n&n-1)===0&&n!==0}function BN(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function HN(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function GN(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),u=o(t/2),f=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),y=o((i-e)/2);switch(r){case"XYX":n.set(a*h,u*d,u*p,a*f);break;case"YZY":n.set(u*p,a*h,u*d,a*f);break;case"ZXZ":n.set(u*d,u*p,a*h,a*f);break;case"XZX":n.set(a*h,u*y,u*m,a*f);break;case"YXY":n.set(u*m,a*h,u*y,a*f);break;case"ZYZ":n.set(u*y,u*m,a*h,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ai(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 Ct(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 VN={DEG2RAD:ka,RAD2DEG:Ac,generateUUID:or,clamp:bn,euclideanModulo:hS,mapLinear:bN,inverseLerp:RN,lerp:sf,damp:CN,pingpong:PN,smoothstep:IN,smootherstep:LN,randInt:NN,randFloat:DN,randFloatSpread:UN,seededRandom:ON,degToRad:FN,radToDeg:kN,isPowerOfTwo:zN,ceilPowerOfTwo:BN,floorPowerOfTwo:HN,setQuaternionFromProperEuler:GN,normalize:Ct,denormalize:Ai};class be{constructor(e=0,t=0){be.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}
vendor: 36,459 bytes, line 44
44sub(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 Rt{constructor(e,t,i,r,s,o,a,u,f){Rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,u,f)}set(e,t,i,r,s,o,a,u,f){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=u,h[6]=i,h[7]=o,h[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],u=i[6],f=i[1],h=i[4],d=i[7],p=i[2],m=i[5],y=i[8],w=r[0],_=r[3],v=r[6],S=r[1],M=r[4],T=r[7],I=r[2],C=r[5],L=r[8];return s[0]=o*w+a*S+u*I,s[3]=o*_+a*M+u*C,s[6]=o*v+a*T+u*L,s[1]=f*w+h*S+d*I,s[4]=f*_+h*M+d*C,s[7]=f*v+h*T+d*L,s[2]=p*w+m*S+y*I,s[5]=p*_+m*M+y*C,s[8]=p*v+m*T+y*L,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],f=e[7],h=e[8];return t*o*h-t*a*f-i*s*h+i*a*u+r*s*f-r*o*u}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],f=e[7],h=e[8],d=h*o-a*f,p=a*u-h*s,m=f*s-o*u,y=t*d+i*p+r*m;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/y;return e[0]=d*w,e[1]=(r*f-h*i)*w,e[2]=(a*i-r*o)*w,e[3]=p*w,e[4]=(h*t-r*u)*w,e[5]=(r*s-a*t)*w,e[6]=m*w,e[7]=(i*u-f*t)*w,e[8]=(o*t-i*s)*w,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const u=Math.cos(s),f=Math.sin(s);return this.set(i*u,i*f,-i*(u*o+f*a)+o+e,-r*f,r*u,-r*(-f*o+u*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Hv.makeScale(e,t)),this}rotate(e){return this.premultiply(Hv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Hv.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 Hv=new Rt;function hR(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const WN={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function rc(n,e){return new WN[n](e)}function Ff(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function dR(){const n=Ff("canvas");return n.style.display="block",n}const Yw={};function Hp(n){n in Yw||(Yw[n]=!0,console.warn(n))}function XN(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)})}function jN(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function YN(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const qw=new Rt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Zw=new Rt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),yu={[Cr]:{transfer:Lf,primaries:Nf,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[ir]:{transfer:sn,primaries:Nf,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[oh]:{transfer:Lf,primaries:Df,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(Zw),fromReference:n=>n.applyMatrix3(qw)},[Ig]:{transfer:sn,primaries:Df,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(Zw),fromReference:n=>n.applyMatrix3(qw).convertLinearToSRGB()}},qN=new Set([Cr,oh]),Kt={enabled:!0,_workingColorSpace:Cr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!qN.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=yu[e].toReference,r=yu[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 yu[n].primaries},getTransfer:function(n){return n===zs?Lf:yu[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(yu[e].luminanceCoefficients)}};function mc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Gv(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let wl;class pR{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{wl===void 0&&(wl=Ff("canvas")),wl.width=e.width,wl.height=e.height;const i=wl.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=wl}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=Ff("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]=mc(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(mc(t[i]/255)*255):t[i]=mc(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 ZN=0;class Ca{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ZN++}),this.uuid=or(),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(Vv(r[o].image)):s.push(Vv(r[o]))}else s=Vv(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Vv(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?pR.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 KN=0;class nn extends Ms{constructor(e=nn.DEFAULT_IMAGE,t=nn.DEFAULT_MAPPING,i=Fn,r=Fn,s=Qt,o=hs,a=Ln,u=Yi,f=nn.DEFAULT_ANISOTROPY,h=zs){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:KN++}),this.uuid=or(),this.name="",this.source=new Ca(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=f,this.format=a,this.internalFormat=null,this.type=u,this.offset=new be(0,0),this.repeat=new be(1,1),this.center=new be(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Rt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,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!==Bo)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Rf:e.x=e.x-Math.floor(e.x);break;case Fn:e.x=e.x<0?0:1;break;case Cf: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 Rf:e.y=e.y-Math.floor(e.y);break;case Fn:e.y=e.y<0?0:1;break;case Cf: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++}}nn.DEFAULT_IMAGE=null;nn.DEFAULT_MAPPING=Bo;nn.DEFAULT_ANISOTROPY=1;class Xt{constructor(e=0,t=0,i=0,r=1){Xt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const u=e.elements,f=u[0],h=u[4],d=u[8],p=u[1],m=u[5],y=u[9],w=u[2],_=u[6],v=u[10];if(Math.abs(h-p)<.01&&Math.abs(d-w)<.01&&Math.abs(y-_)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+w)<.1&&Math.abs(y+_)<.1&&Math.abs(f+m+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(f+1)/2,T=(m+1)/2,I=(v+1)/2,C=(h+p)/4,L=(d+w)/4,N=(y+_)/4;return M>T&&M>I?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=C/i,s=L/i):T>I?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=C/r,s=N/r):I<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(I),i=L/s,r=N/s),this.set(i,r,s,t),this}let S=Math.sqrt((_-y)*(_-y)+(d-w)*(d-w)+(p-h)*(p-h));return Math.abs(S)<.001&&(S=1),this.x=(_-y)/S,this.y=(d-w)/S,this.z=(p-h)/S,this.w=Math.acos((f+m+v-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 mR extends Ms{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Xt(0,0,e,t),this.scissorTest=!1,this.viewport=new Xt(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Qt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new nn(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 Ca(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 cr extends mR{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class Lg extends nn{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=Jn,this.minFilter=Jn,this.wrapR=Fn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class QN extends cr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new Lg(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class dS extends nn{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=Jn,this.minFilter=Jn,this.wrapR=Fn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class $N extends cr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new dS(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class Gn{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 u=i[r+0],f=i[r+1],h=i[r+2],d=i[r+3];const p=s[o+0],m=s[o+1],y=s[o+2],w=s[o+3];if(a===0){e[t+0]=u,e[t+1]=f,e[t+2]=h,e[t+3]=d;return}if(a===1){e[t+0]=p,e[t+1]=m,e[t+2]=y,e[t+3]=w;return}if(d!==w||u!==p||f!==m||h!==y){let _=1-a;const v=u*p+f*m+h*y+d*w,S=v>=0?1:-1,M=1-v*v;if(M>Number.EPSILON){const I=Math.sqrt(M),C=Math.atan2(I,v*S);_=Math.sin(_*C)/I,a=Math.sin(a*C)/I}const T=a*S;if(u=u*_+p*T,f=f*_+m*T,h=h*_+y*T,d=d*_+w*T,_===1-a){const I=1/Math.sqrt(u*u+f*f+h*h+d*d);u*=I,f*=I,h*=I,d*=I}}e[t]=u,e[t+1]=f,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],u=i[r+1],f=i[r+2],h=i[r+3],d=s[o],p=s[o+1],m=s[o+2],y=s[o+3];return e[t]=a*y+h*d+u*m-f*p,e[t+1]=u*y+h*p+f*d-a*m,e[t+2]=f*y+h*m+a*p-u*d,e[t+3]=h*y-a*d-u*p-f*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,u=Math.sin,f=a(i/2),h=a(r/2),d=a(s/2),p=u(i/2),m=u(r/2),y=u(s/2);switch(o){case"XYZ":this._x=p*h*d+f*m*y,this._y=f*m*d-p*h*y,this._z=f*h*y+p*m*d,this._w=f*h*d-p*m*y;break;case"YXZ":this._x=p*h*d+f*m*y,this._y=f*m*d-p*h*y,this._z=f*h*y-p*m*d,this._w=f*h*d+p*m*y;break;case"ZXY":this._x=p*h*d-f*m*y,this._y=f*m*d+p*h*y,this._z=f*h*y+p*m*d,this._w=f*h*d-p*m*y;break;case"ZYX":this._x=p*h*d-f*m*y,this._y=f*m*d+p*h*y,this._z=f*h*y-p*m*d,this._w=f*h*d+p*m*y;break;case"YZX":this._x=p*h*d+f*m*y,this._y=f*m*d+p*h*y,this._z=f*h*y-p*m*d,this._w=f*h*d-p*m*y;break;case"XZY":this._x=p*h*d-f*m*y,this._y=f*m*d-p*h*y,this._z=f*h*y+p*m*d,this._w=f*h*d+p*m*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],u=t[9],f=t[2],h=t[6],d=t[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-u)*m,this._y=(s-f)*m,this._z=(o-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(h-u)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+f)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(s-f)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(u+h)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(o-r)/m,this._x=(s+f)/m,this._y=(u+h)/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,u=t._y,f=t._z,h=t._w;return this._x=i*h+o*a+r*f-s*u,this._y=r*h+o*u+s*a-i*f,this._z=s*h+o*f+i*u-r*a,this._w=o*h-i*a-r*u-s*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const u=1-a*a;if(u<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const f=Math.sqrt(u),h=Math.atan2(f,a),d=Math.sin((1-t)*h)/f,p=Math.sin(t*h)/f;return this._w=o*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=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 k{constructor(e=0,t=0,i=0){k.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Kw.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Kw.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,u=e.w,f=2*(o*r-a*i),h=2*(a*t-s*r),d=2*(s*i-o*t);return this.x=t+u*f+o*d-a*h,this.y=i+u*h+a*f-s*d,this.z=r+u*d+s*h-o*f,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,u=t.z;return this.x=r*u-s*a,this.y=s*o-i*u,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Wv.copy(this).projectOnVector(e),this.sub(Wv)}reflect(e){return this.sub(Wv.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 Wv=new k,Kw=new Gn;class Pi{constructor(e=new k(1/0,1/0,1/0),t=new k(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(Or.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Or.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=Or.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,Or):Or.fromBufferAttribute(s,o),Or.applyM
vendor: 4,637 bytes, line 44
44atrix4(e.matrixWorld),this.expandByPoint(Or);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Nd.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Nd.copy(i.boundingBox)),Nd.applyMatrix4(e.matrixWorld),this.union(Nd)}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,Or),Or.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(_u),Dd.subVectors(this.max,_u),El.subVectors(e.a,_u),Tl.subVectors(e.b,_u),Al.subVectors(e.c,_u),co.subVectors(Tl,El),uo.subVectors(Al,Tl),aa.subVectors(El,Al);let t=[0,-co.z,co.y,0,-uo.z,uo.y,0,-aa.z,aa.y,co.z,0,-co.x,uo.z,0,-uo.x,aa.z,0,-aa.x,-co.y,co.x,0,-uo.y,uo.x,0,-aa.y,aa.x,0];return!Xv(t,El,Tl,Al,Dd)||(t=[1,0,0,0,1,0,0,0,1],!Xv(t,El,Tl,Al,Dd))?!1:(Ud.crossVectors(co,uo),t=[Ud.x,Ud.y,Ud.z],Xv(t,El,Tl,Al,Dd))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Or).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Or).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:(Is[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Is[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Is[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Is[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Is[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Is[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Is[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Is[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Is),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 Is=[new k,new k,new k,new k,new k,new k,new k,new k],Or=new k,Nd=new Pi,El=new k,Tl=new k,Al=new k,co=new k,uo=new k,aa=new k,_u=new k,Dd=new k,Ud=new k,la=new k;function Xv(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){la.fromArray(n,s);const a=r.x*Math.abs(la.x)+r.y*Math.abs(la.y)+r.z*Math.abs(la.z),u=e.dot(la),f=t.dot(la),h=i.dot(la);if(Math.max(-Math.max(u,f,h),Math.min(u,f,h))>a)return!1}return!0}const JN=new Pi,xu=new k,jv=new k;class yi{constructor(e=new k,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):JN.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)}
vendor: 17,927 bytes, line 44
44applyMatrix4(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;xu.subVectors(e,this.center);const t=xu.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(xu,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):(jv.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(xu.copy(e.center).add(jv)),this.expandByPoint(xu.copy(e.center).sub(jv))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ls=new k,Yv=new k,Od=new k,fo=new k,qv=new k,Fd=new k,Zv=new k;class zc{constructor(e=new k,t=new k(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ls)),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=Ls.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ls.copy(this.origin).addScaledVector(this.direction,t),Ls.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Yv.copy(e).add(t).multiplyScalar(.5),Od.copy(t).sub(e).normalize(),fo.copy(this.origin).sub(Yv);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Od),a=fo.dot(this.direction),u=-fo.dot(Od),f=fo.lengthSq(),h=Math.abs(1-o*o);let d,p,m,y;if(h>0)if(d=o*u-a,p=o*a-u,y=s*h,d>=0)if(p>=-y)if(p<=y){const w=1/h;d*=w,p*=w,m=d*(d+o*p+2*a)+p*(o*d+p+2*u)+f}else p=s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*u)+f;else p=-s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*u)+f;else p<=-y?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-u),s),m=-d*d+p*(p+2*u)+f):p<=y?(d=0,p=Math.min(Math.max(-s,-u),s),m=p*(p+2*u)+f):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-u),s),m=-d*d+p*(p+2*u)+f);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*u)+f;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Yv).addScaledVector(Od,p),m}intersectSphere(e,t){Ls.subVectors(e.center,this.origin);const i=Ls.dot(this.direction),r=Ls.dot(Ls)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,u=i+o;return u<0?null:a<0?this.at(u,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,u;const f=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return f>=0?(i=(e.min.x-p.x)*f,r=(e.max.x-p.x)*f):(i=(e.max.x-p.x)*f,r=(e.min.x-p.x)*f),h>=0?(s=(e.min.y-p.y)*h,o=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,o=(e.min.y-p.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),d>=0?(a=(e.min.z-p.z)*d,u=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,u=(e.min.z-p.z)*d),i>u||a>r)||((a>i||i!==i)&&(i=a),(u<r||r!==r)&&(r=u),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Ls)!==null}intersectTriangle(e,t,i,r,s){qv.subVectors(t,e),Fd.subVectors(i,e),Zv.crossVectors(qv,Fd);let o=this.direction.dot(Zv),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;fo.subVectors(this.origin,e);const u=a*this.direction.dot(Fd.crossVectors(fo,Fd));if(u<0)return null;const f=a*this.direction.dot(qv.cross(fo));if(f<0||u+f>o)return null;const h=-a*fo.dot(Zv);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class mt{constructor(e,t,i,r,s,o,a,u,f,h,d,p,m,y,w,_){mt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,u,f,h,d,p,m,y,w,_)}set(e,t,i,r,s,o,a,u,f,h,d,p,m,y,w,_){const v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=r,v[1]=s,v[5]=o,v[9]=a,v[13]=u,v[2]=f,v[6]=h,v[10]=d,v[14]=p,v[3]=m,v[7]=y,v[11]=w,v[15]=_,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 mt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/bl.setFromMatrixColumn(e,0).length(),s=1/bl.setFromMatrixColumn(e,1).length(),o=1/bl.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),u=Math.cos(r),f=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=o*h,m=o*d,y=a*h,w=a*d;t[0]=u*h,t[4]=-u*d,t[8]=f,t[1]=m+y*f,t[5]=p-w*f,t[9]=-a*u,t[2]=w-p*f,t[6]=y+m*f,t[10]=o*u}else if(e.order==="YXZ"){const p=u*h,m=u*d,y=f*h,w=f*d;t[0]=p+w*a,t[4]=y*a-m,t[8]=o*f,t[1]=o*d,t[5]=o*h,t[9]=-a,t[2]=m*a-y,t[6]=w+p*a,t[10]=o*u}else if(e.order==="ZXY"){const p=u*h,m=u*d,y=f*h,w=f*d;t[0]=p-w*a,t[4]=-o*d,t[8]=y+m*a,t[1]=m+y*a,t[5]=o*h,t[9]=w-p*a,t[2]=-o*f,t[6]=a,t[10]=o*u}else if(e.order==="ZYX"){const p=o*h,m=o*d,y=a*h,w=a*d;t[0]=u*h,t[4]=y*f-m,t[8]=p*f+w,t[1]=u*d,t[5]=w*f+p,t[9]=m*f-y,t[2]=-f,t[6]=a*u,t[10]=o*u}else if(e.order==="YZX"){const p=o*u,m=o*f,y=a*u,w=a*f;t[0]=u*h,t[4]=w-p*d,t[8]=y*d+m,t[1]=d,t[5]=o*h,t[9]=-a*h,t[2]=-f*h,t[6]=m*d+y,t[10]=p-w*d}else if(e.order==="XZY"){const p=o*u,m=o*f,y=a*u,w=a*f;t[0]=u*h,t[4]=-d,t[8]=f*h,t[1]=p*d+w,t[5]=o*h,t[9]=m*d-y,t[2]=y*d-m,t[6]=a*h,t[10]=w*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(eD,e,tD)}lookAt(e,t,i){const r=this.elements;return er.subVectors(e,t),er.lengthSq()===0&&(er.z=1),er.normalize(),ho.crossVectors(i,er),ho.lengthSq()===0&&(Math.abs(i.z)===1?er.x+=1e-4:er.z+=1e-4,er.normalize(),ho.crossVectors(i,er)),ho.normalize(),kd.crossVectors(er,ho),r[0]=ho.x,r[4]=kd.x,r[8]=er.x,r[1]=ho.y,r[5]=kd.y,r[9]=er.y,r[2]=ho.z,r[6]=kd.z,r[10]=er.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],u=i[8],f=i[12],h=i[1],d=i[5],p=i[9],m=i[13],y=i[2],w=i[6],_=i[10],v=i[14],S=i[3],M=i[7],T=i[11],I=i[15],C=r[0],L=r[4],N=r[8],B=r[12],A=r[1],R=r[5],j=r[9],Y=r[13],Z=r[2],ae=r[6],Q=r[10],pe=r[14],z=r[3],ie=r[7],$=r[11],le=r[15];return s[0]=o*C+a*A+u*Z+f*z,s[4]=o*L+a*R+u*ae+f*ie,s[8]=o*N+a*j+u*Q+f*$,s[12]=o*B+a*Y+u*pe+f*le,s[1]=h*C+d*A+p*Z+m*z,s[5]=h*L+d*R+p*ae+m*ie,s[9]=h*N+d*j+p*Q+m*$,s[13]=h*B+d*Y+p*pe+m*le,s[2]=y*C+w*A+_*Z+v*z,s[6]=y*L+w*R+_*ae+v*ie,s[10]=y*N+w*j+_*Q+v*$,s[14]=y*B+w*Y+_*pe+v*le,s[3]=S*C+M*A+T*Z+I*z,s[7]=S*L+M*R+T*ae+I*ie,s[11]=S*N+M*j+T*Q+I*$,s[15]=S*B+M*Y+T*pe+I*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],u=e[9],f=e[13],h=e[2],d=e[6],p=e[10],m=e[14],y=e[3],w=e[7],_=e[11],v=e[15];return y*(+s*u*d-r*f*d-s*a*p+i*f*p+r*a*m-i*u*m)+w*(+t*u*m-t*f*p+s*o*p-r*o*m+r*f*h-s*u*h)+_*(+t*f*d-t*a*m-s*o*d+i*o*m+s*a*h-i*f*h)+v*(-r*a*h-t*u*d+t*a*p+r*o*d-i*o*p+i*u*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],f=e[7],h=e[8],d=e[9],p=e[10],m=e[11],y=e[12],w=e[13],_=e[14],v=e[15],S=d*_*f-w*p*f+w*u*m-a*_*m-d*u*v+a*p*v,M=y*p*f-h*_*f-y*u*m+o*_*m+h*u*v-o*p*v,T=h*w*f-y*d*f+y*a*m-o*w*m-h*a*v+o*d*v,I=y*d*u-h*w*u-y*a*p+o*w*p+h*a*_-o*d*_,C=t*S+i*M+r*T+s*I;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/C;return e[0]=S*L,e[1]=(w*p*s-d*_*s-w*r*m+i*_*m+d*r*v-i*p*v)*L,e[2]=(a*_*s-w*u*s+w*r*f-i*_*f-a*r*v+i*u*v)*L,e[3]=(d*u*s-a*p*s-d*r*f+i*p*f+a*r*m-i*u*m)*L,e[4]=M*L,e[5]=(h*_*s-y*p*s+y*r*m-t*_*m-h*r*v+t*p*v)*L,e[6]=(y*u*s-o*_*s-y*r*f+t*_*f+o*r*v-t*u*v)*L,e[7]=(o*p*s-h*u*s+h*r*f-t*p*f-o*r*m+t*u*m)*L,e[8]=T*L,e[9]=(y*d*s-h*w*s-y*i*m+t*w*m+h*i*v-t*d*v)*L,e[10]=(o*w*s-y*a*s+y*i*f-t*w*f-o*i*v+t*a*v)*L,e[11]=(h*a*s-o*d*s-h*i*f+t*d*f+o*i*m-t*a*m)*L,e[12]=I*L,e[13]=(h*w*r-y*d*r+y*i*p-t*w*p-h*i*_+t*d*_)*L,e[14]=(y*a*r-o*w*r-y*i*u+t*w*u+o*i*_-t*a*_)*L,e[15]=(o*d*r-h*a*r+h*i*u-t*d*u-o*i*p+t*a*p)*L,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,u=e.z,f=s*o,h=s*a;return this.set(f*o+i,f*a-r*u,f*u+r*a,0,f*a+r*u,h*a+i,h*u-r*o,0,f*u-r*a,h*u+r*o,s*u*u+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,u=t._w,f=s+s,h=o+o,d=a+a,p=s*f,m=s*h,y=s*d,w=o*h,_=o*d,v=a*d,S=u*f,M=u*h,T=u*d,I=i.x,C=i.y,L=i.z;return r[0]=(1-(w+v))*I,r[1]=(m+T)*I,r[2]=(y-M)*I,r[3]=0,r[4]=(m-T)*C,r[5]=(1-(p+v))*C,r[6]=(_+S)*C,r[7]=0,r[8]=(y+M)*L,r[9]=(_-S)*L,r[10]=(1-(p+w))*L,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=bl.set(r[0],r[1],r[2]).length();const o=bl.set(r[4],r[5],r[6]).length(),a=bl.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Fr.copy(this);const f=1/s,h=1/o,d=1/a;return Fr.elements[0]*=f,Fr.elements[1]*=f,Fr.elements[2]*=f,Fr.elements[4]*=h,Fr.elements[5]*=h,Fr.elements[6]*=h,Fr.elements[8]*=d,Fr.elements[9]*=d,Fr.elements[10]*=d,t.setFromRotationMatrix(Fr),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=ds){const u=this.elements,f=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),p=(i+r)/(i-r);let m,y;if(a===ds)m=-(o+s)/(o-s),y=-2*o*s/(o-s);else if(a===Of)m=-o/(o-s),y=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return u[0]=f,u[4]=0,u[8]=d,u[12]=0,u[1]=0,u[5]=h,u[9]=p,u[13]=0,u[2]=0,u[6]=0,u[10]=m,u[14]=y,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=ds){const u=this.elements,f=1/(t-e),h=1/(i-r),d=1/(o-s),p=(t+e)*f,m=(i+r)*h;let y,w;if(a===ds)y=(o+s)*d,w=-2*d;else if(a===Of)y=s*d,w=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return u[0]=2*f,u[4]=0,u[8]=0,u[12]=-p,u[1]=0,u[5]=2*h,u[9]=0,u[13]=-m,u[2]=0,u[6]=0,u[10]=w,u[14]=-y,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const bl=new k,Fr=new mt,eD=new k(0,0,0),tD=new k(1,1,1),ho=new k,kd=new k,er=new k,Qw=new mt,$w=new Gn;class Ii{constructor(e=0,t=0,i=0,r=Ii.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],u=r[1],f=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(bn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,f),this._z=0);break;case"YXZ":this._x=Math.asin(-bn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(u,f)):(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,f)):(this._y=0,this._z=Math.atan2(u,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(u,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(bn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,f),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-bn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,f),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Qw.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Qw,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return $w.setFromEuler(this),this.setFromQuaternion($w,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}}Ii.DEFAULT_ORDER="XYZ";class za{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 nD=0;const Jw=new k,Rl=new Gn,Ns=new mt,zd=new k,Su=new k,iD=new k,rD=new Gn,eE=new k(1,0,0),tE=new k(0,1,0),nE=new k(0,0,1),iE={type:"added"},sD={type:"removed"},Cl={type:"childadded",child:null},Kv={type:"childremoved",child:null};class Gt extends Ms{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:nD++}),this.uuid=or(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Gt.DEFAULT_UP.clone();const e=new k,t=new Ii,i=new Gn,r=new k(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 mt},normalMatrix:{value:new Rt}}),this.matrix=new mt,this.matrixWorld=new mt,this.matrixAutoUpdate=Gt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Gt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new za,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)}
vendor: 4,289 bytes, line 44
44setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Rl.setFromAxisAngle(e,t),this.quaternion.multiply(Rl),this}rotateOnWorldAxis(e,t){return Rl.setFromAxisAngle(e,t),this.quaternion.premultiply(Rl),this}rotateX(e){return this.rotateOnAxis(eE,e)}rotateY(e){return this.rotateOnAxis(tE,e)}rotateZ(e){return this.rotateOnAxis(nE,e)}translateOnAxis(e,t){return Jw.copy(e).applyQuaternion(this.quaternion),this.position.add(Jw.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(eE,e)}translateY(e){return this.translateOnAxis(tE,e)}translateZ(e){return this.translateOnAxis(nE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ns.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?zd.copy(e):zd.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Su.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ns.lookAt(Su,zd,this.up):Ns.lookAt(zd,Su,this.up),this.quaternion.setFromRotationMatrix(Ns),r&&(Ns.extractRotation(r.matrixWorld),Rl.setFromRotationMatrix(Ns),this.quaternion.premultiply(Rl.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(iE),Cl.child=e,this.dispatchEvent(Cl),Cl.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(sD),Kv.child=e,this.dispatchEvent(Kv),Kv.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),Ns.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ns.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ns),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(iE),Cl.child=e,this.dispatchEvent(Cl),Cl.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(Su,e,iD),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Su,rD,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
vendor: 7,027 bytes, line 44
44):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,u){return a[u.uuid]===void 0&&(a[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const u=a.shapes;if(Array.isArray(u))for(let f=0,h=u.length;f<h;f++){const d=u[f];s(e.shapes,d)}else s(e.shapes,u)}}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 u=0,f=this.material.length;u<f;u++)a.push(s(e.materials,this.material[u]));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 u=this.animations[a];r.animations.push(s(e.animations,u))}}if(t){const a=o(e.geometries),u=o(e.materials),f=o(e.textures),h=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),u.length>0&&(i.materials=u),f.length>0&&(i.textures=f),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),y.length>0&&(i.nodes=y)}return i.object=r,i;function o(a){const u=[];for(const f in a){const h=a[f];delete h.metadata,u.push(h)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}Gt.DEFAULT_UP=new k(0,1,0);Gt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Gt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const kr=new k,Ds=new k,Qv=new k,Us=new k,Pl=new k,Il=new k,rE=new k,$v=new k,Jv=new k,ey=new k,ty=new Xt,ny=new Xt,iy=new Xt;class Gi{constructor(e=new k,t=new k,i=new k){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),kr.subVectors(e,t),r.cross(kr);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){kr.subVectors(r,t),Ds.subVectors(i,t),Qv.subVectors(e,t);const o=kr.dot(kr),a=kr.dot(Ds),u=kr.dot(Qv),f=Ds.dot(Ds),h=Ds.dot(Qv),d=o*f-a*a;if(d===0)return s.set(0,0,0),null;const p=1/d,m=(f*u-a*h)*p,y=(o*h-a*u)*p;return s.set(1-m-y,y,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Us)===null?!1:Us.x>=0&&Us.y>=0&&Us.x+Us.y<=1}static getInterpolation(e,t,i,r,s,o,a,u){return this.getBarycoord(e,t,i,r,Us)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(s,Us.x),u.addScaledVector(o,Us.y),u.addScaledVector(a,Us.z),u)}static getInterpolatedAttribute(e,t,i,r,s,o){return ty.setScalar(0),ny.setScalar(0),iy.setScalar(0),ty.fromBufferAttribute(e,t),ny.fromBufferAttribute(e,i),iy.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(ty,s.x),o.addScaledVector(ny,s.y),o.addScaledVector(iy,s.z),o}static isFrontFacing(e,t,i,r){return kr.subVectors(i,t),Ds.subVectors(e,t),kr.cross(Ds).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 kr.subVectors(this.c,this.b),Ds.subVectors(this.a,this.b),kr.cross(Ds).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Gi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Gi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Gi.getInterpolation(e,this.a,this.b,this.c,t,i,r,s
vendor: 6,700 bytes, line 44
44)}containsPoint(e){return Gi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Gi.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;Pl.subVectors(r,i),Il.subVectors(s,i),$v.subVectors(e,i);const u=Pl.dot($v),f=Il.dot($v);if(u<=0&&f<=0)return t.copy(i);Jv.subVectors(e,r);const h=Pl.dot(Jv),d=Il.dot(Jv);if(h>=0&&d<=h)return t.copy(r);const p=u*d-h*f;if(p<=0&&u>=0&&h<=0)return o=u/(u-h),t.copy(i).addScaledVector(Pl,o);ey.subVectors(e,s);const m=Pl.dot(ey),y=Il.dot(ey);if(y>=0&&m<=y)return t.copy(s);const w=m*f-u*y;if(w<=0&&f>=0&&y<=0)return a=f/(f-y),t.copy(i).addScaledVector(Il,a);const _=h*y-m*d;if(_<=0&&d-h>=0&&m-y>=0)return rE.subVectors(s,r),a=(d-h)/(d-h+(m-y)),t.copy(r).addScaledVector(rE,a);const v=1/(_+w+p);return o=w*v,a=p*v,t.copy(i).addScaledVector(Pl,o).addScaledVector(Il,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const gR={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},po={h:0,s:0,l:0},Bd={h:0,s:0,l:0};function ry(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 rt{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=ir){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Kt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Kt.workingColorSpace){return this.r=e,this.g=t,this.b=i,Kt.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Kt.workingColorSpace){if(e=hS(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;this.r=ry(o,s,e+1/3),this.g=ry(o,s,e),this.b=ry(o,s,e-1/3)}return Kt.toWorkingColorSpace(this,r),this}setStyle(e,t=ir){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=ir){const i=gR[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=mc(e.r),this.g=mc(e.g),this.b=mc(e.b),this}copyLinearToSRGB(e){return this.r=Gv(e.r),this.g=Gv(e.g),this.b=Gv(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ir){return Kt.fromWorkingColorSpace(mi.copy(this),e),Math.round(bn(mi.r*255,0,255))*65536+Math.round(bn(mi.g*255,0,255))*256+Math.round(bn(mi.b*255,0,255))}getHexString(e=ir){return("000000"+this.getHex(e).toString(16)).slice(-6)}
vendor: 3,897 bytes, line 44
44getHSL(e,t=Kt.workingColorSpace){Kt.fromWorkingColorSpace(mi.copy(this),t);const i=mi.r,r=mi.g,s=mi.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let u,f;const h=(a+o)/2;if(a===o)u=0,f=0;else{const d=o-a;switch(f=h<=.5?d/(o+a):d/(2-o-a),o){case i:u=(r-s)/d+(r<s?6:0);break;case r:u=(s-i)/d+2;break;case s:u=(i-r)/d+4;break}u/=6}return e.h=u,e.s=f,e.l=h,e}getRGB(e,t=Kt.workingColorSpace){return Kt.fromWorkingColorSpace(mi.copy(this),t),e.r=mi.r,e.g=mi.g,e.b=mi.b,e}getStyle(e=ir){Kt.fromWorkingColorSpace(mi.copy(this),e);const t=mi.r,i=mi.g,r=mi.b;return e!==ir?`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(po),this.setHSL(po.h+e,po.s+t,po.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(po),e.getHSL(Bd);const i=sf(po.h,Bd.h,t),r=sf(po.s,Bd.s,t),s=sf(po.l,Bd.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 mi=new rt;rt.NAMES=gR;let oD=0;class xi extends Ms{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:oD++}),this.uuid=or(),this.name="",this.type="Material",this.blending=Oa,this.side=Zs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=ym,this.blendDst=_m,this.blendEquation=To,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new rt(0,0,0),this.blendAlpha=0,this.depthFunc=qa,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=H_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Sa,this.stencilZFail=Sa,this.stencilZPass=Sa,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}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};
vendor: 8,832 bytes, line 44
44i.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!==Oa&&(i.blending=this.blending),this.side!==Zs&&(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!==ym&&(i.blendSrc=this.blendSrc),this.blendDst!==_m&&(i.blendDst=this.blendDst),this.blendEquation!==To&&(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!==qa&&(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!==H_&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Sa&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Sa&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Sa&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const u=s[a];delete u.metadata,o.push(u)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 6,318 bytes, line 44
44adows,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.")}}class $s extends xi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rt(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 Ii,this.combine=th,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 Bs=aD();function aD(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let u=0;u<256;++u){const f=u-127;f<-27?(i[u]=0,i[u|256]=32768,r[u]=24,r[u|256]=24):f<-14?(i[u]=1024>>-f-14,i[u|256]=1024>>-f-14|32768,r[u]=-f-1,r[u|256]=-f-1):f<=15?(i[u]=f+15<<10,i[u|256]=f+15<<10|32768,r[u]=13,r[u|256]=13):f<128?(i[u]=31744,i[u|256]=64512,r[u]=24,r[u|256]=24):(i[u]=31744,i[u|256]=64512,r[u]=13,r[u|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let u=1;u<1024;++u){let f=u<<13,h=0;for(;!(f&8388608);)f<<=1,h-=8388608;f&=-8388609,h+=947912704,s[u]=f|h}for(let u=1024;u<2048;++u)s[u]=939524096+(u-1024<<13);for(let u=1;u<31;++u)o[u]=u<<23;o[31]=1199570944,o[32]=2147483648;for(let u=33;u<63;++u)o[u]=2147483648+(u-32<<23);o[63]=3347054592;for(let u=1;u<64;++u)u!==32&&(a[u]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Bi(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=bn(n,-65504,65504),Bs.floatView[0]=n;const e=Bs.uint32View[0],t=e>>23&511;return Bs.baseTable[t]+((e&8388607)>>Bs.shiftTable[t])}function Bu(n){const e=n>>10;return Bs.uint32View[0]=Bs.mantissaTable[Bs.offsetTable[e]+(n&1023)]+Bs.exponentTable[e],Bs.floatView[0]}const Pa={toHalfFloat:Bi,fromHalfFloat:Bu},Un=new k,Hd=new be;class Jt{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=Uf,this.updateRanges=[],this.gpuType=_n,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let 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++)Hd.fromBufferAttribute(this,t),Hd.applyMatrix3(e),this.setXY(t,Hd.x,Hd.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)Un.fromBufferAttribute(this,t),Un.applyMatrix3(e),this.setXYZ(t,Un.x,Un.y,Un.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)Un.fromBufferAttribute(this,t),Un.applyMatrix4(e),this.setXYZ(t,Un.x,Un.y,Un.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Un.fromBufferAttribute(this,t),Un.applyNormalMatrix(e),this.setXYZ(t,Un.x,Un.y,Un.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Un.fromBufferAttribute(this,t),Un.transformDirection(e),this.setXYZ(t,Un.x,Un.y,Un.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=Ai(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ct(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ai(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ct(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ai(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ct(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=Ai(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ct(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=Ai(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ct(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ct(t,this.array),i=Ct(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=Ct(t,this.array),i=Ct(i,this.array),r=Ct(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=Ct(t,this.array),i=Ct(i,this.array),r=Ct(r,this.array),s=Ct(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}
vendor: 9,692 bytes, line 44
44onUpload(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!==Uf&&(e.usage=this.usage),e}}class lD extends Jt{constructor(e,t,i){super(new Int8Array(e),t,i)}}class cD extends Jt{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class uD extends Jt{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class fD extends Jt{constructor(e,t,i){super(new Int16Array(e),t,i)}}class pS extends Jt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class hD extends Jt{constructor(e,t,i){super(new Int32Array(e),t,i)}}class mS extends Jt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class dD extends Jt{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=Bu(this.array[e*this.itemSize]);return this.normalized&&(t=Ai(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ct(t,this.array)),this.array[e*this.itemSize]=Bi(t),this}getY(e){let t=Bu(this.array[e*this.itemSize+1]);return this.normalized&&(t=Ai(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ct(t,this.array)),this.array[e*this.itemSize+1]=Bi(t),this}getZ(e){let t=Bu(this.array[e*this.itemSize+2]);return this.normalized&&(t=Ai(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ct(t,this.array)),this.array[e*this.itemSize+2]=Bi(t),this}getW(e){let t=Bu(this.array[e*this.itemSize+3]);return this.normalized&&(t=Ai(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ct(t,this.array)),this.array[e*this.itemSize+3]=Bi(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ct(t,this.array),i=Ct(i,this.array)),this.array[e+0]=Bi(t),this.array[e+1]=Bi(i),this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Ct(t,this.array),i=Ct(i,this.array),r=Ct(r,this.array)),this.array[e+0]=Bi(t),this.array[e+1]=Bi(i),this.array[e+2]=Bi(r),this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=Ct(t,this.array),i=Ct(i,this.array),r=Ct(r,this.array),s=Ct(s,this.array)),this.array[e+0]=Bi(t),this.array[e+1]=Bi(i),this.array[e+2]=Bi(r),this.array[e+3]=Bi(s),this}}class lt extends Jt{constructor(e,t,i){super(new Float32Array(e),t,i)}}let pD=0;const xr=new mt,sy=new Gt,Ll=new k,tr=new Pi,Mu=new Pi,Kn=new k;class Pt extends Ms{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:pD++}),this.uuid=or(),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(hR(e)?mS:pS)(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 Rt().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 xr.makeRotationFromQuaternion(e),this.applyMatrix4(xr),this}rotateX(e){return xr.makeRotationX(e),this.applyMatrix4(xr),this}rotateY(e){return xr.makeRotationY(e),this.applyMatrix4(xr),this}rotateZ(e){return xr.makeRotationZ(e),this.applyMatrix4(xr),this}translate(e,t,i){return xr.makeTranslation(e,t,i),this.applyMatrix4(xr),this}scale(e,t,i){return xr.makeScale(e,t,i),this.applyMatrix4(xr),this}lookAt(e){return sy.lookAt(e),sy.updateMatrix(),this.applyMatrix4(sy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ll).negate(),this.translate(Ll.x,Ll.y,Ll.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 lt(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Pi);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 k(-1/0,-1/0,-1/0),new k(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];tr.setFromBufferAttribute(s),this.morphTargetsRelative?(Kn.addVectors(this.boundingBox.min,tr.min),this.boundingBox.expandByPoint(Kn),Kn.addVectors(this.boundingBox.max,tr.max),this.boundingBox.expandByPoint(Kn)):(this.boundingBox.expandByPoint(tr.min),this.boundingBox.expandByPoint(tr.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 yi);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 k,1/0);return}if(e){const i=this.boundingSphere.center;if(tr.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];Mu.setFromBufferAttribute(a),this.morphTargetsRelative?(Kn.addVectors(tr.min,Mu.min),tr.expandByPoint(Kn),Kn.addVectors(tr.max,Mu.max),tr.expandByPoint(Kn)):(tr.expandByPoint(Mu.min),tr.expandByPoint(Mu.max))}tr.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)Kn.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(Kn));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],u=this.morphTargetsRelative;for(let f=0,h=a.count;f<h;f++)Kn.fromBufferAttribute(a,f),u&&(Ll.fromBufferAttribute(e,f),Kn.add(Ll)),r=Math.max(r,i.distanceToSquared(Kn))}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 Jt(new Float32Array(4*i.count),4));const o=this.getAttribute("tangent"),a=[],u=[];for(let N=0;N<i.count;N++)a[N]=new k,u[N]=new k;const f=new k,h=new k,d=new k,p=new be,m=new be,y=new be,w=new k,_=new k;function v(N,B,A){f.fromBufferAttribute(i,N),h.fromBufferAttribute(i,B),d.fromBufferAttribute(i,A),p.fromBufferAttribute(s,N),m.fromBufferAttribute(s,B),y.fromBufferAttribute(s,A),h.sub(f),d.sub(f),m.sub(p),y.sub(p);const R=1/(m.x*y.y-y.x*m.y);isFinite(R)&&(w.copy(h).multiplyScalar(y.y).addScaledVector(d,-m.y).multiplyScalar(R),_.copy(d).multiplyScalar(m.x).addScaledVector(h,-y.x).multiplyScalar(R),a[N].add(w),a[B].add(w),a[A].add(w),u[N].add(_),u[B].add(_),u[A].add(_))}let S=this.groups;S.length===0&&(S=[{start:0,count:e.count}]);for(let N=0,B=S.length;N<B;++N){const A=S[N],R=A.start,j=A.count;for(let Y=R,Z=R+j;Y<Z;Y+=3)v(e.getX(Y+0),e.getX(Y+1),e.getX(Y+2))}const M=new k,T=new k,I=new k,C=new k;function L(N){I.fromBufferAttribute(r,N),C.copy(I);const B=a[N];M.copy(B),M.sub(I.multiplyScalar(I.dot(B))).normalize(),T.crossVectors(C,B);const R=T.dot(u[N])<0?-1:1;o.setXYZW(N,M.x,M.y,M.z,R)}for(let N=0,B=S.length;N<B;++N){const A=S[N],R=A.start,j=A.count;for(let Y=R,Z=R+j;Y<Z;Y+=3)L(e.getX(Y+0)),L(e.getX(Y+1)),L(e.getX(Y+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 Jt(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 k,s=new k,o=new k,a=new k,u=new k,f=new k,h=new k,d=new k;if(e)for(let p=0,m=e.count;p<m;p+=3){const y=e.getX(p+0),w=e.getX(p+1),_=e.getX(p+2);r.fromBufferAttribute(t,y),s.fromBufferAttribute(t,w),o.fromBufferAttribute(t,_),h.subVectors(o,s),d.subVectors(r,s),h.cross(d),a.fromBufferAttribute(i,y),u.fromBufferAttribute(i,w),f.fromBufferAttribute(i,_),a.add(h),u.add(h),f.add(h),i.setXYZ(y,a.x,a.y,a.z),i.setXYZ(w,u.x,u.y,u.z),i.setXYZ(_,f.x,f.y,f.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),h.subVectors(o,s),d.subVectors(r,s),h.cross(d),i.setXYZ(p+0,h.x,h.y,h.z),i.setXYZ(p+1,h.x,h.y,h.z),i.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Kn.fromBufferAttribute(e,t),Kn.normalize(),e.setXYZ(t,Kn.x,Kn.y,Kn.z)}toNonIndexed(){function e(a,u){const f=a.array,h=a.itemSize,d=a.normalized,p=new f.constructor(u.length*h);let m=0,y=0;for(let w=0,_=u.length;w<_;w++){a.isInterleavedBufferAttribute?m=u[w]*a.data.stride+a.offset:m=u[w]
vendor: 6,843 bytes, line 44
44*h;for(let v=0;v<h;v++)p[y++]=f[m++]}return new Jt(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Pt,i=this.index.array,r=this.attributes;for(const a in r){const u=r[a],f=e(u,i);t.setAttribute(a,f)}const s=this.morphAttributes;for(const a in s){const u=[],f=s[a];for(let h=0,d=f.length;h<d;h++){const p=f[h],m=e(p,i);u.push(m)}t.morphAttributes[a]=u}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,u=o.length;a<u;a++){const f=o[a];t.addGroup(f.start,f.count,f.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 u=this.parameters;for(const f in u)u[f]!==void 0&&(e[f]=u[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const u in i){const f=i[u];e.data.attributes[u]=f.toJSON(e.data)}const r={};let s=!1;for(const u in this.morphAttributes){const f=this.morphAttributes[u],h=[];for(let d=0,p=f.length;d<p;d++){const m=f[d];h.push(m.toJSON(e.data))}h.length>0&&(r[u]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const f in r){const h=r[f];this.setAttribute(f,h.clone(t))}const s=e.morphAttributes;for(const f in s){const h=[],d=s[f];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(t));this.morphAttributes[f]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let f=0,h=o.length;f<h;f++){const d=o[f];this.addGroup(d.start,d.count,d.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const sE=new mt,ca=new zc,Gd=new yi,oE=new k,Vd=new k,Wd=new k,Xd=new k,oy=new k,jd=new k,aE=new k,Yd=new k;class xn extends Gt{constructor(e=new Pt,t=new $s){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){jd.set(0,0,0);for(let u=0,f=s.length;u<f;u++){const h=a[u],d=s[u];h!==0&&(oy.fromBufferAttribute(d,e),o?jd.addScaledVector(oy,h):jd.addScaledVector(oy.sub(t),h))}t.add(jd)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Gd.copy(i.boundingSphere),Gd.applyMatrix4(s),ca.copy(e.ray).recast(e.near),!(Gd.containsPoint(ca.origin)===!1&&(ca.intersectSphere(Gd,oE)===null||ca.origin.distanceToSquared(oE)>(e.far-e.near)**2))&&(sE.copy(s).invert(),ca.copy(e.ray).applyMatrix4(sE),!(i.boundingBox!==null&&ca.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,ca)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,u=s.attributes.position,f=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let y=0,w=p.length;y<w;y++){const _=p[y],v=o[_.materialIndex],S=Math.max(_.start,m.start),M=Math.min(a.count,Math.min(_.start+_.count,m.start+m.count));for(let T=S,I=M;T<I;T+=3){const C=a.getX(T),L=a.getX(T+1),N=a.getX(T+2);r=qd(this,v,e,i,f,h,d,C,L,N),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const y=Math.max(0,m.start),w=Math.min(a.count,m.start+m.count);for(let _=y,v=w;_<v;_+=3){const S=a.getX(_),M=a.getX(_+1),T=a.getX(_+2);r=qd(this,o,e,i,f,h,d,S,M,T),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(u!==void 0)if(Array.isArray(o))for(let y=0,w=p.length;y<w;y++){const _=p[y],v=o[_.materialIndex],S=Math.max(_.start,m.start),M=Math.min(u.count,Math.min(_.start+_.count,m.start+m.count));for(let T=S,I=M;T<I;T+=3){const C=T,L=T+1,N=T+2;r=qd(this,v,e,i,f,h,d,C,L,N),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const y=Math.max(0,m.start),w=Math.min(u.count,m.start+m.count);for(let _=y,v=w;_<v;_+=3){const S=_,M=_+1,T=_+2;r=qd(this,o,e,i,f,h,d,S,M,T),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}}function mD(n,e,t,i,r,s,o,a){let u;if(e.side===Ci?u=i.intersectTriangle(o,s,r,!0,a):u=i.intersectTriangle(r,s,o,e.side===Zs,a),u===null)return null;Yd.copy(a),Yd.applyMatrix4(n.matrixWorld);const f=t.ray.origin.distanceTo(Yd);return f<t.near||f>t.far?null:{distance:f,point:Yd.clone(),object:n}}function qd(n,e,t,i,r,s,o,a,u,f){n.getVertexPosition(a,Vd),n.getVertexPosition(u,Wd),n.getVertexPosition(f,Xd);const h=mD(n,e,t,i,Vd,Wd,Xd,aE);if(h){const d=new k;Gi.getBarycoord(aE,Vd,Wd,Xd,d),r&&(h.uv=Gi.getInterpolatedAttribute(r,a,u,f,d,new be)),s&&(h.uv1=Gi.getInterpolatedAttribute(s,a,u,f,d,new be)),o&&(h.normal=Gi.getInterpolatedAttribute(o,a,u,f,d,new k),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const p={a,b:u,c:f,normal:new k,materialIndex:0};Gi.getNormal(Vd,Wd,Xd,p.normal),h.face=p,h.barycoord=d}return h}class nl extends Pt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const u=[],f=[],h=[],d=[];let p=0,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
vendor: 9,687 bytes, lines 44-48
44),y("x","z","y",1,1,e,i,t,r,o,2),y("x","z","y",1,-1,e,i,-t,r,o,3),y("x","y","z",1,-1,e,t,i,r,s,4),y("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(u),this.setAttribute("position",new lt(f,3)),this.setAttribute("normal",new lt(h,3)),this.setAttribute("uv",new lt(d,2));function y(w,_,v,S,M,T,I,C,L,N,B){const A=T/L,R=I/N,j=T/2,Y=I/2,Z=C/2,ae=L+1,Q=N+1;let pe=0,z=0;const ie=new k;for(let $=0;$<Q;$++){const le=$*R-Y;for(let ye=0;ye<ae;ye++){const De=ye*A-j;ie[w]=De*S,ie[_]=le*M,ie[v]=Z,f.push(ie.x,ie.y,ie.z),ie[w]=0,ie[_]=0,ie[v]=C>0?1:-1,h.push(ie.x,ie.y,ie.z),d.push(ye/L),d.push(1-$/N),pe+=1}}for(let $=0;$<N;$++)for(let le=0;le<L;le++){const ye=p+le+ae*$,De=p+le+ae*($+1),ue=p+(le+1)+ae*($+1),Me=p+(le+1)+ae*$;u.push(ye,De,Me),u.push(De,ue,Me),z+=6}a.addGroup(m,z,B),m+=z,p+=pe}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new nl(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function bc(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 Ei(n){const e={};for(let t=0;t<n.length;t++){const i=bc(n[t]);for(const r in i)e[r]=i[r]}return e}function gD(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function vR(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Kt.workingColorSpace}const yR={clone:bc,merge:Ei};var vD=`void main() { 45 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 46}`,yD=`void main() { 47 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 48}`;class qi extends xi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=vD,this.fragmentShader=yD,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=bc(e.uniforms),this.uniformsGroups=gD(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 ah extends Gt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new mt,this.projectionMatrix=new mt,this.projectionMatrixInverse=new mt,this.coordinateSystem=ds}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 mo=new k,lE=new be,cE=new be;class $n extends ah{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=Ac*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ka*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ac*2*Math.atan(Math.tan(ka*.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){mo.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(mo.x,mo.y).multiplyScalar(-e/mo.z),mo.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(mo.x,mo.y).multiplyScalar(-e/mo.z)}getViewSize(e,t){return this.getViewBounds(e,lE,cE),t.subVectors(cE,lE)}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(ka*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const u=o.fullWidth,f=o.fullHeight;s+=o.offsetX*r/u,t-=o.offsetY*i/f,r*=o.width/u,i*=o.height/f}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Nl=-90,Dl=1;class _R extends Gt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new $n(Nl,Dl,e,t);r.layers=this.layers,this.add(r);const s=new $n(Nl,Dl,e,t);s.layers=this.layers,this.add(s);const o=new $n(Nl,Dl,e,t);o.layers=this.layers,this.add(o);const a=new $n(Nl,Dl,e,t);a.layers=this.layers,this.add(a);const u=new $n(Nl,Dl,e,t);u.layers=this.layers,this.add(u);const f=new $n(Nl,Dl,e,t);f.layers=this.layers,this.add(f)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,u]=t;for(const f of t)this.remove(f);if(e===ds)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(e===Of)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const f of t)this.add(f),f.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,u,f,h]=this.children,d=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const w=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,u),e.setRenderTarget(i,4,r),e.render(t,f),i.texture.generateMipmaps=w,e.setRenderTarget(i,5,r),e.render(t,h),e.setRenderTarget(d,p,m),e.xr.enabled=y,i.texture.needsPMREMUpdate=!0}}class lh extends nn{constructor(e,t,i,r,s,o,a,u,f,h){e=e!==void 0?e:[],t=t!==void 0?t:_s,super(e,t,i,r,s,o,a,u,f,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class gS extends cr{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 lh(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:Qt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace
vendor: 12,245 bytes, lines 48-196
48=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 nl(5,5,5),s=new qi({name:"CubemapFromEquirect",uniforms:bc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Ci,blending:gs});s.uniforms.tEquirect.value=t;const o=new xn(r,s),a=t.minFilter;return t.minFilter===hs&&(t.minFilter=Qt),new _R(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 ay=new k,_D=new k,xD=new Rt;class So{constructor(e=new k(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=ay.subVectors(i,t).cross(_D.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(ay),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||xD.getNormalMatrix(e),r=this.coplanarPoint(ay).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 ua=new yi,Zd=new k;class ch{constructor(e=new So,t=new So,i=new So,r=new So,s=new So,o=new So){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=ds){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],u=r[3],f=r[4],h=r[5],d=r[6],p=r[7],m=r[8],y=r[9],w=r[10],_=r[11],v=r[12],S=r[13],M=r[14],T=r[15];if(i[0].setComponents(u-s,p-f,_-m,T-v).normalize(),i[1].setComponents(u+s,p+f,_+m,T+v).normalize(),i[2].setComponents(u+o,p+h,_+y,T+S).normalize(),i[3].setComponents(u-o,p-h,_-y,T-S).normalize(),i[4].setComponents(u-a,p-d,_-w,T-M).normalize(),t===ds)i[5].setComponents(u+a,p+d,_+w,T+M).normalize();else if(t===Of)i[5].setComponents(a,d,w,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ua.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ua.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ua)}intersectsSprite(e){return ua.center.set(0,0,0),ua.radius=.7071067811865476,ua.applyMatrix4(e.matrixWorld),this.intersectsSphere(ua)}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(Zd.x=r.normal.x>0?e.max.x:e.min.x,Zd.y=r.normal.y>0?e.max.y:e.min.y,Zd.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Zd)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function xR(){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 SD(n){const e=new WeakMap;function t(a,u){const f=a.array,h=a.usage,d=f.byteLength,p=n.createBuffer();n.bindBuffer(u,p),n.bufferData(u,f,h),a.onUploadCallback();let m;if(f instanceof Float32Array)m=n.FLOAT;else if(f instanceof Uint16Array)a.isFloat16BufferAttribute?m=n.HALF_FLOAT:m=n.UNSIGNED_SHORT;else if(f instanceof Int16Array)m=n.SHORT;else if(f instanceof Uint32Array)m=n.UNSIGNED_INT;else if(f instanceof Int32Array)m=n.INT;else if(f instanceof Int8Array)m=n.BYTE;else if(f instanceof Uint8Array)m=n.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)m=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:p,type:m,bytesPerElement:f.BYTES_PER_ELEMENT,version:a.version,size:d}}function i(a,u,f){const h=u.array,d=u.updateRanges;if(n.bindBuffer(f,a),d.length===0)n.bufferSubData(f,0,h);else{d.sort((m,y)=>m.start-y.start);let p=0;for(let m=1;m<d.length;m++){const y=d[p],w=d[m];w.start<=y.start+y.count+1?y.count=Math.max(y.count,w.start+w.count-y.start):(++p,d[p]=w)}d.length=p+1;for(let m=0,y=d.length;m<y;m++){const w=d[m];n.bufferSubData(f,w.start*h.BYTES_PER_ELEMENT,h,w.start,w.count)}u.clearUpdateRanges()}u.onUploadCallback()}function r(a){return a.isInterleavedBufferAttribute&&(a=a.data),e.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);const u=e.get(a);u&&(n.deleteBuffer(u.buffer),e.delete(a))}function o(a,u){if(a.isInterleavedBufferAttribute&&(a=a.data),a.isGLBufferAttribute){const h=e.get(a);(!h||h.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}const f=e.get(a);if(f===void 0)e.set(a,t(a,u));else if(f.version<a.version){if(f.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(f.buffer,a,u),f.version=a.version}}return{get:r,remove:s,update:o}}class Zo extends Pt{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),u=Math.floor(r),f=a+1,h=u+1,d=e/a,p=t/u,m=[],y=[],w=[],_=[];for(let v=0;v<h;v++){const S=v*p-o;for(let M=0;M<f;M++){const T=M*d-s;y.push(T,-S,0),w.push(0,0,1),_.push(M/a),_.push(1-v/u)}}for(let v=0;v<u;v++)for(let S=0;S<a;S++){const M=S+f*v,T=S+f*(v+1),I=S+1+f*(v+1),C=S+1+f*v;m.push(M,T,C),m.push(T,I,C)}this.setIndex(m),this.setAttribute("position",new lt(y,3)),this.setAttribute("normal",new lt(w,3)),this.setAttribute("uv",new lt(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Zo(e.width,e.height,e.widthSegments,e.heightSegments)}}var MD=`#ifdef USE_ALPHAHASH 84 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 85#endif`,wD=`#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`,ED=`#ifdef USE_ALPHAMAP 121 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 122#endif`,TD=`#ifdef USE_ALPHAMAP 123 uniform sampler2D alphaMap; 124#endif`,AD=`#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`,bD=`#ifdef USE_ALPHATEST 132 uniform float alphaTest; 133#endif`,RD=`#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`,CD=`#ifdef USE_AOMAP 147 uniform sampler2D aoMap; 148 uniform float aoMapIntensity; 149#endif`,PD=`#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`,ID=`#ifdef USE_BATCHING 184 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 185#endif`,LD=`vec3 transformed = vec3( position ); 186#ifdef USE_ALPHAHASH 187 vPosition = vec3( position ); 188#endif`,ND=`vec3 objectNormal = vec3( normal ); 189#ifdef USE_TANGENT 190 vec3 objectTangent = vec3( tangent.xyz ); 191#endif`,DD=`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`,UD=`#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`,OD=`#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`,FD=`#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`,kD=`#if NUM_CLIPPING_PLANES > 0 336 varying vec3 vClipPosition; 337 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 338#endif`,zD=`#if NUM_CLIPPING_PLANES > 0 339 varying vec3 vClipPosition; 340#endif`,BD=`#if NUM_CLIPPING_PLANES > 0 341 vClipPosition = - mvPosition.xyz; 342#endif`,HD=`#if defined( USE_COLOR_ALPHA ) 343 diffuseColor *= vColor; 344#elif defined( USE_COLOR ) 345 diffuseColor.rgb *= vColor; 346#endif`,GD=`#if defined( USE_COLOR_ALPHA ) 347 varying vec4 vColor; 348#elif defined( USE_COLOR ) 349 varying vec3 vColor; 350#endif`,VD=`#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`,WD=`#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`,XD=`#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} 424bool isPerspectiveMatrix( mat4 m ) { 425 return m[ 2 ][ 3 ] == - 1.0; 426} 427vec2 equirectUv( in vec3 dir ) { 428 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 429 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 430 return vec2( u, v ); 431}
432vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 433 return RECIPROCAL_PI * diffuseColor; 434} 435vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 436 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 437 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 438} 439float F_Schlick( const in float 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} // validated`,jD=`#ifdef ENVMAP_TYPE_CUBE_UV 443 #define cubeUV_minMipLevel 4.0 444 #define cubeUV_minTileSize 16.0 445 float getFace( vec3 direction ) { 446 vec3 absDirection = abs( direction ); 447 float face = - 1.0; 448 if ( absDirection.x > absDirection.z ) { 449 if ( absDirection.x > absDirection.y ) 450 face = direction.x > 0.0 ? 0.0 : 3.0; 451 else 452 face = direction.y > 0.0 ? 1.0 : 4.0; 453 } else { 454 if ( absDirection.z > absDirection.y ) 455 face = direction.z > 0.0 ? 2.0 : 5.0; 456 else 457 face = direction.y > 0.0 ? 1.0 : 4.0; 458 } 459 return face; 460 } 461 vec2 getUV( vec3 direction, float face ) { 462 vec2 uv; 463 if ( face == 0.0 ) { 464 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 465 } else if ( face == 1.0 ) { 466 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 467 } else if ( face == 2.0 ) { 468 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 469 } else if ( face == 3.0 ) { 470 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 471 } else if ( face == 4.0 ) { 472 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 473 } else { 474 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 475 } 476 return 0.5 * ( uv + 1.0 ); 477 } 478 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 479 float face = getFace( direction ); 480 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 481 mipInt = max( mipInt, cubeUV_minMipLevel ); 482 float faceSize = exp2( mipInt ); 483 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 484 if ( face > 2.0 ) { 485 uv.y += faceSize; 486 face -= 3.0; 487 } 488 uv.x += face * faceSize; 489 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 490 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 491 uv.x *= CUBEUV_TEXEL_WIDTH; 492 uv.y *= CUBEUV_TEXEL_HEIGHT; 493 #ifdef texture2DGradEXT 494 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 495 #else 496 return texture2D( envMap, uv ).rgb; 497 #endif 498 } 499 #define cubeUV_r0 1.0 500 #define cubeUV_m0 - 2.0 501 #define cubeUV_r1 0.8 502 #define cubeUV_m1 - 1.0 503 #define cubeUV_r4 0.4 504 #define cubeUV_m4 2.0 505 #define cubeUV_r5 0.305 506 #define cubeUV_m5 3.0 507 #define cubeUV_r6 0.21 508 #define cubeUV_m6 4.0 509 float roughnessToMip( float roughness ) { 510 float mip = 0.0; 511 if ( roughness >= cubeUV_r1 ) { 512 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 513 } else if ( roughness >= cubeUV_r4 ) { 514 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 515 } else if ( roughness >= cubeUV_r5 ) { 516 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 517 } else if ( roughness >= cubeUV_r6 ) { 518 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 519 } else { 520 mip = - 2.0 * log2( 1.16 * roughness ); } 521 return mip; 522 } 523 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 524 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 525 float mipF = fract( mip ); 526 float mipInt = floor( mip ); 527 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 528 if ( mipF == 0.0 ) { 529 return vec4( color0, 1.0 ); 530 } else { 531 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 532 return vec4( mix( color0, color1, mipF ), 1.0 ); 533 } 534 } 535#endif`,YD=`vec3 transformedNormal = objectNormal; 536#ifdef USE_TANGENT 537 vec3 transformedTangent = objectTangent; 538#endif 539#ifdef USE_BATCHING 540 mat3 bm = mat3( batchingMatrix ); 541 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 542 transformedNormal = bm * transformedNormal; 543 #ifdef USE_TANGENT 544 transformedTangent = bm * transformedTangent; 545 #endif 546#endif 547#ifdef USE_INSTANCING 548 mat3 im = mat3( instanceMatrix ); 549 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 550 transformedNormal = im * transformedNormal; 551 #ifdef USE_TANGENT 552 transformedTangent = im * transformedTangent; 553 #endif 554#endif 555transformedNormal = normalMatrix * transformedNormal; 556#ifdef FLIP_SIDED 557 transformedNormal = - transformedNormal; 558#endif 559#ifdef USE_TANGENT 560 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 561 #ifdef FLIP_SIDED 562 transformedTangent = - transformedTangent; 563 #endif 564#endif`,qD=`#ifdef USE_DISPLACEMENTMAP 565 uniform sampler2D displacementMap; 566 uniform float displacementScale; 567 uniform float displacementBias; 568#endif`,ZD=`#ifdef USE_DISPLACEMENTMAP 569 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
569placementBias ); 570#endif`,KD=`#ifdef USE_EMISSIVEMAP 571 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 572 totalEmissiveRadiance *= emissiveColor.rgb; 573#endif`,QD=`#ifdef USE_EMISSIVEMAP 574 uniform sampler2D emissiveMap; 575#endif`,$D="gl_FragColor = linearToOutputTexel( gl_FragColor );",JD=` 576const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( 577 vec3( 0.8224621, 0.177538, 0.0 ), 578 vec3( 0.0331941, 0.9668058, 0.0 ), 579 vec3( 0.0170827, 0.0723974, 0.9105199 ) 580); 581const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( 582 vec3( 1.2249401, - 0.2249404, 0.0 ), 583 vec3( - 0.0420569, 1.0420571, 0.0 ), 584 vec3( - 0.0196376, - 0.0786361, 1.0982735 ) 585); 586vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { 587 return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); 588} 589vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { 590 return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); 591} 592vec4 LinearTransferOETF( in vec4 value ) { 593 return value; 594} 595vec4 sRGBTransferOETF( in vec4 value ) { 596 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 ); 597}`,eU=`#ifdef USE_ENVMAP 598 #ifdef ENV_WORLDPOS 599 vec3 cameraToFrag; 600 if ( isOrthographic ) { 601 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 602 } else { 603 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 604 } 605 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 606 #ifdef ENVMAP_MODE_REFLECTION 607 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 608 #else 609 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 610 #endif 611 #else 612 vec3 reflectVec = vReflect; 613 #endif 614 #ifdef ENVMAP_TYPE_CUBE 615 vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 616 #else 617 vec4 envColor = vec4( 0.0 ); 618 #endif 619 #ifdef ENVMAP_BLENDING_MULTIPLY 620 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 621 #elif defined( ENVMAP_BLENDING_MIX ) 622 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 623 #elif defined( ENVMAP_BLENDING_ADD ) 624 outgoingLight += envColor.xyz * specularStrength * reflectivity; 625 #endif 626#endif`,tU=`#ifdef USE_ENVMAP 627 uniform float envMapIntensity; 628 uniform float flipEnvMap; 629 uniform mat3 envMapRotation; 630 #ifdef ENVMAP_TYPE_CUBE 631 uniform samplerCube envMap; 632 #else 633 uniform sampler2D envMap; 634 #endif 635 636#endif`,nU=`#ifdef USE_ENVMAP 637 uniform float reflectivity; 638 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 639 #define ENV_WORLDPOS 640 #endif 641 #ifdef ENV_WORLDPOS 642 varying vec3 vWorldPosition; 643 uniform float refractionRatio; 644 #else 645 varying vec3 vReflect; 646 #endif 647#endif`,iU=`#ifdef USE_ENVMAP 648 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 649 #define ENV_WORLDPOS 650 #endif 651 #ifdef ENV_WORLDPOS 652 653 varying vec3 vWorldPosition; 654 #else 655 varying vec3 vReflect; 656 uniform float refractionRatio; 657 #endif 658#endif`,rU=`#ifdef USE_ENVMAP 659 #ifdef ENV_WORLDPOS 660 vWorldPosition = worldPosition.xyz; 661 #else 662 vec3 cameraToVertex; 663 if ( isOrthographic ) { 664 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 665 } else {
666 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 667 } 668 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 669 #ifdef ENVMAP_MODE_REFLECTION 670 vReflect = reflect( cameraToVertex, worldNormal ); 671 #else 672 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 673 #endif 674 #endif 675#endif`,sU=`#ifdef USE_FOG 676 vFogDepth = - mvPosition.z; 677#endif`,oU=`#ifdef USE_FOG 678 varying float vFogDepth; 679#endif`,aU=`#ifdef USE_FOG 680 #ifdef FOG_EXP2 681 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 682 #else 683 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 684 #endif 685 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 686#endif`,lU=`#ifdef USE_FOG 687 uniform vec3 fogColor; 688 varying float vFogDepth; 689 #ifdef FOG_EXP2 690 uniform float fogDensity; 691 #else 692 uniform float fogNear; 693 uniform float fogFar; 694 #endif 695#endif`,cU=`#ifdef USE_GRADIENTMAP 696 uniform sampler2D gradientMap; 697#endif 698vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 699 float dotNL = dot( normal, lightDirection ); 700 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 701 #ifdef USE_GRADIENTMAP 702 return vec3( texture2D( gradientMap, coord ).r ); 703 #else 704 vec2 fw = fwidth( coord ) * 0.5; 705 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 706 #endif 707}`,uU=`#ifdef USE_LIGHTMAP 708 uniform sampler2D lightMap; 709 uniform float lightMapIntensity; 710#endif`,fU=`LambertMaterial material; 711material.diffuseColor = diffuseColor.rgb; 712material.specularStrength = specularStrength;`,hU=`varying vec3 vViewPosition; 713struct LambertMaterial { 714 vec3 diffuseColor; 715 float specularStrength; 716}; 717void 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 ) { 718 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 719 vec3 irradiance = dotNL * directLight.color; 720 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 721} 722void 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 ) { 723 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 724} 725#define RE_Direct RE_Direct_Lambert 726#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,dU=`uniform bool receiveShadow; 727uniform vec3 ambientLightColor; 728#if defined( USE_LIGHT_PROBES ) 729 uniform vec3 lightProbe[ 9 ]; 730#endif 731vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 732 float x = normal.x, y = normal.y, z = normal.z; 733 vec3 result = shCoefficients[ 0 ] * 0.886227; 734 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 735 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 736 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 737 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 738 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 739 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 740 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 741 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 742 return result; 743} 744vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 745 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 746 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 747 return irradiance; 748} 749vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 750 vec3 irradiance = ambientLightColor; 751 return irradiance; 752} 753float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 754 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 755 if ( cutoffDistance > 0.0 ) { 756 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 757 } 758 return distanceFalloff; 759} 760float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 761 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 762} 763#if NUM_DIR_LIGHTS > 0 764 struct DirectionalLight { 765 vec3 direction; 766 vec3 color; 767 }; 768 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 769 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 770 light.color = directionalLight.color; 771 light.direction = directionalLight.direction; 772 light.visible = true; 773 } 774#endif 775#if NUM_POINT_LIGHTS > 0 776 struct PointLight { 777 vec3 position; 778 vec3 color; 779 float distance; 780 float decay; 781 }; 782 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 783 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 784 vec3 lVector = pointLight.position - geometryPosition; 785 light.direction = normalize( lVector ); 786 float lightDistance = length( lVector ); 787 light.color = pointLight.color; 788 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 789 light.visible = ( light.color != vec3( 0.0 ) ); 790 } 791#endif
792#if NUM_SPOT_LIGHTS > 0 793 struct SpotLight { 794 vec3 position; 795 vec3 direction; 796 vec3 color; 797 float distance; 798 float decay; 799 float coneCos; 800 float penumbraCos; 801 }; 802 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 803 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 804 vec3 lVector = spotLight.position - geometryPosition; 805 light.direction = normalize( lVector ); 806 float angleCos = dot( light.direction, spotLight.direction ); 807 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 808 if ( spotAttenuation > 0.0 ) { 809 float lightDistance = length( lVector ); 810 light.color = spotLight.color * spotAttenuation; 811 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 812 light.visible = ( light.color != vec3( 0.0 ) ); 813 } else { 814 light.color = vec3( 0.0 ); 815 light.visible = false; 816 } 817 } 818#endif 819#if NUM_RECT_AREA_LIGHTS > 0 820 struct RectAreaLight { 821 vec3 color; 822 vec3 position; 823 vec3 halfWidth; 824 vec3 halfHeight; 825 }; 826 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 827 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 828#endif 829#if NUM_HEMI_LIGHTS > 0 830 struct HemisphereLight { 831 vec3 direction; 832 vec3 skyColor; 833 vec3 groundColor; 834 }; 835 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 836 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 837 float dotNL = dot( normal, hemiLight.direction ); 838 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 839 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 840 return irradiance; 841 } 842#endif`,pU=`#ifdef USE_ENVMAP 843 vec3 getIBLIrradiance( const in vec3 normal ) { 844 #ifdef ENVMAP_TYPE_CUBE_UV 845 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 846 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 847 return PI * envMapColor.rgb * envMapIntensity; 848 #else 849 return vec3( 0.0 ); 850 #endif 851 } 852 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 853 #ifdef ENVMAP_TYPE_CUBE_UV 854 vec3 reflectVec = reflect( - viewDir, normal ); 855 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 856 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 857 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 858 return envMapColor.rgb * envMapIntensity; 859 #else 860 return vec3( 0.0 ); 861 #endif 862 } 863 #ifdef USE_ANISOTROPY 864 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 865 #ifdef ENVMAP_TYPE_CUBE_UV 866 vec3 bentNormal = cross( bitangent, viewDir ); 867 bentNormal = normalize( cross( bentNormal, bitangent ) ); 868 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 869 return getIBLRadiance( viewDir, bentNormal, roughness ); 870 #else 871 return vec3( 0.0 ); 872 #endif 873 } 874 #endif 875#endif`,mU=`ToonMaterial material; 876material.diffuseColor = diffuseColor.rgb;`,gU=`varying vec3 vViewPosition; 877struct ToonMaterial { 878 vec3 diffuseColor; 879}; 880void 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 ) { 881 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 882 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 883} 884void 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 ) { 885 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 886} 887#define RE_Direct RE_Direct_Toon 888#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,vU=`BlinnPhongMaterial material; 889material.diffuseColor = diffuseColor.rgb; 890material.specularColor = specular; 891material.specularShininess = shininess; 892material.specularStrength = specularStrength;`,yU=`varying vec3 vViewPosition; 893struct BlinnPhongMaterial { 894 vec3 diffuseColor; 895 vec3 specularColor; 896 float specularShininess; 897 float specularStrength; 898}; 899void 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 ) {
900 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 901 vec3 irradiance = dotNL * directLight.color; 902 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 903 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 904} 905void 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 ) { 906 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 907} 908#define RE_Direct RE_Direct_BlinnPhong 909#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,_U=`PhysicalMaterial material; 910material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 911vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 912float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 913material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 914material.roughness = min( material.roughness, 1.0 ); 915#ifdef IOR 916 material.ior = ior; 917 #ifdef USE_SPECULAR 918 float specularIntensityFactor = specularIntensity; 919 vec3 specularColorFactor = specularColor; 920 #ifdef USE_SPECULAR_COLORMAP 921 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 922 #endif 923 #ifdef USE_SPECULAR_INTENSITYMAP 924 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 925 #endif 926 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 927 #else 928 float specularIntensityFactor = 1.0; 929 vec3 specularColorFactor = vec3( 1.0 ); 930 material.specularF90 = 1.0; 931 #endif 932 material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 933#else 934 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 935 material.specularF90 = 1.0; 936#endif 937#ifdef USE_CLEARCOAT 938 material.clearcoat = clearcoat; 939 material.clearcoatRoughness = clearcoatRoughness; 940 material.clearcoatF0 = vec3( 0.04 ); 941 material.clearcoatF90 = 1.0; 942 #ifdef USE_CLEARCOATMAP 943 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 944 #endif 945 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 946 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 947 #endif 948 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 949 material.clearcoatRoughness += geometryRoughness; 950 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 951#endif 952#ifdef USE_DISPERSION 953 material.dispersion = dispersion; 954#endif 955#ifdef USE_IRIDESCENCE 956 material.iridescence = iridescence; 957 material.iridescenceIOR = iridescenceIOR; 958 #ifdef USE_IRIDESCENCEMAP 959 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 960 #endif 961 #ifdef USE_IRIDESCENCE_THICKNESSMAP 962 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 963 #else 964 material.iridescenceThickness = iridescenceThicknessMaximum; 965 #endif 966#endif 967#ifdef USE_SHEEN 968 material.sheenColor = sheenColor; 969 #ifdef USE_SHEEN_COLORMAP 970 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 971 #endif 972 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 973 #ifdef USE_SHEEN_ROUGHNESSMAP 974 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 975 #endif 976#endif 977#ifdef USE_ANISOTROPY 978 #ifdef USE_ANISOTROPYMAP 979 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 980 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 981 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 982 #else 983 vec2 anisotropyV = anisotropyVector; 984 #endif 985 material.anisotropy = length( anisotropyV ); 986 if( material.anisotropy == 0.0 ) { 987 anisotropyV = vec2( 1.0, 0.0 ); 988 } else { 989 anisotropyV /= material.anisotropy; 990 material.anisotropy = saturate( material.anisotropy ); 991 } 992 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
993 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 994 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 995#endif`,xU
vendor: 14,687 bytes, lines 995-1296
995=`struct PhysicalMaterial { 996 vec3 diffuseColor; 997 float roughness; 998 vec3 specularColor; 999 float specularF90; 1000 float dispersion; 1001 #ifdef USE_CLEARCOAT 1002 float clearcoat; 1003 float clearcoatRoughness; 1004 vec3 clearcoatF0; 1005 float clearcoatF90; 1006 #endif 1007 #ifdef USE_IRIDESCENCE 1008 float iridescence; 1009 float iridescenceIOR; 1010 float iridescenceThickness; 1011 vec3 iridescenceFresnel; 1012 vec3 iridescenceF0; 1013 #endif 1014 #ifdef USE_SHEEN 1015 vec3 sheenColor; 1016 float sheenRoughness; 1017 #endif 1018 #ifdef IOR 1019 float ior; 1020 #endif 1021 #ifdef USE_TRANSMISSION 1022 float transmission; 1023 float transmissionAlpha; 1024 float thickness; 1025 float attenuationDistance; 1026 vec3 attenuationColor; 1027 #endif 1028 #ifdef USE_ANISOTROPY 1029 float anisotropy; 1030 float alphaT; 1031 vec3 anisotropyT; 1032 vec3 anisotropyB; 1033 #endif 1034}; 1035vec3 clearcoatSpecularDirect = vec3( 0.0 ); 1036vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 1037vec3 sheenSpecularDirect = vec3( 0.0 ); 1038vec3 sheenSpecularIndirect = vec3(0.0 ); 1039vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 1040 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 1041 float x2 = x * x; 1042 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 1043 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 1044} 1045float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 1046 float a2 = pow2( alpha ); 1047 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1048 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1049 return 0.5 / max( gv + gl, EPSILON ); 1050} 1051float D_GGX( const in float alpha, const in float dotNH ) { 1052 float a2 = pow2( alpha ); 1053 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1054 return RECIPROCAL_PI * a2 / pow2( denom ); 1055} 1056#ifdef USE_ANISOTROPY 1057 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 ) { 1058 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1059 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1060 float v = 0.5 / ( gv + gl ); 1061 return saturate(v); 1062 } 1063 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1064 float a2 = alphaT * alphaB; 1065 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1066 highp float v2 = dot( v, v ); 1067 float w2 = a2 / v2; 1068 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1069 } 1070#endif 1071#ifdef USE_CLEARCOAT 1072 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1073 vec3 f0 = material.clearcoatF0; 1074 float f90 = material.clearcoatF90; 1075 float roughness = material.clearcoatRoughness; 1076 float alpha = pow2( roughness ); 1077 vec3 halfDir = normalize( lightDir + viewDir ); 1078 float dotNL = saturate( dot( normal, lightDir ) ); 1079 float dotNV = saturate( dot( normal, viewDir ) ); 1080 float dotNH = saturate( dot( normal, halfDir ) ); 1081 float dotVH = saturate( dot( viewDir, halfDir ) ); 1082 vec3 F = F_Schlick( f0, f90, dotVH ); 1083 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1084 float D = D_GGX( alpha, dotNH ); 1085 return F * ( V * D ); 1086 } 1087#endif 1088vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1089 vec3 f0 = material.specularColor; 1090 float f90 = material.specularF90; 1091 float roughness = material.roughness; 1092 float alpha = pow2( roughness ); 1093 vec3 halfDir = normalize( lightDir + viewDir ); 1094 float dotNL = saturate( dot( normal, lightDir ) ); 1095 float dotNV = saturate( dot( normal, viewDir ) ); 1096 float dotNH = saturate( dot( normal, halfDir ) ); 1097 float dotVH = saturate( dot( viewDir, halfDir ) ); 1098 vec3 F = F_Schlick( f0, f90, dotVH ); 1099 #ifdef USE_IRIDESCENCE 1100 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1101 #endif 1102 #ifdef USE_ANISOTROPY 1103 float dotTL = dot( material.anisotropyT, lightDir ); 1104 float dotTV = dot( material.anisotropyT, viewDir ); 1105 float dotTH = dot( material.anisotropyT, halfDir ); 1106 float dotBL = dot( material.anisotropyB, lightDir ); 1107 float dotBV = dot( material.anisotropyB, viewDir ); 1108 float dotBH = dot( material.anisotropyB, halfDir ); 1109 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1110 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1111 #else 1112 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1113 float D = D_GGX( alpha, dotNH ); 1114 #endif 1115 return F * ( V * D ); 1116} 1117vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1118 const float LUT_SIZE = 64.0; 1119 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1120 const float LUT_BIAS = 0.5 / LUT_SIZE; 1121 float dotNV = saturate( dot( N, V ) ); 1122 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1123 uv = uv * LUT_SCALE + LUT_BIAS; 1124 return uv; 1125} 1126float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1127 float l = length( f ); 1128 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1129} 1130vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1131 float x = dot( v1, v2 ); 1132 float y = abs( x ); 1133 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1134 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1135 float v = a / b; 1136 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1137 return cross( v1, v2 ) * theta_sintheta; 1138} 1139vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1140 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1141 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1142 vec3 lightNormal = cross( v1, v2 ); 1143 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1144 vec3 T1, T2; 1145 T1 = normalize( V - N * dot( V, N ) ); 1146 T2 = - cross( N, T1 ); 1147 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 1148 vec3 coords[ 4 ]; 1149 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1150 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1151 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1152 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1153 coords[ 0 ] = normalize( coords[ 0 ] ); 1154 coords[ 1 ] = normalize( coords[ 1 ] ); 1155 coords[ 2 ] = normalize( coords[ 2 ] ); 1156 coords[ 3 ] = normalize( coords[ 3 ] ); 1157 vec3 vectorFormFactor = vec3( 0.0 ); 1158 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1159 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1160 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1161 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1162 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1163 return vec3( result ); 1164} 1165#if defined( USE_SHEEN ) 1166float D_Charlie( float roughness, float dotNH ) { 1167 float alpha = pow2( roughness ); 1168 float invAlpha = 1.0 / alpha; 1169 float cos2h = dotNH * dotNH; 1170 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1171 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1172} 1173float V_Neubelt( float dotNV, float dotNL ) { 1174 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1175} 1176vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1177 vec3 halfDir = normalize( lightDir + viewDir ); 1178 float dotNL = saturate( dot( normal, lightDir ) ); 1179 float dotNV = saturate( dot( normal, viewDir ) ); 1180 float dotNH = saturate( dot( normal, halfDir ) ); 1181 float D = D_Charlie( sheenRoughness, dotNH ); 1182 float V = V_Neubelt( dotNV, dotNL ); 1183 return sheenColor * ( D * V ); 1184} 1185#endif 1186float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1187 float dotNV = saturate( dot( normal, viewDir ) ); 1188 float r2 = roughness * roughness; 1189 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 1190 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 1191 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 1192 return saturate( DG * RECIPROCAL_PI ); 1193} 1194vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1195 float dotNV = saturate( dot( normal, viewDir ) ); 1196 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 1197 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 1198 vec4 r = roughness * c0 + c1; 1199 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 1200 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 1201 return fab; 1202} 1203vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1204 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1205 return specularColor * fab.x + specularF90 * fab.y; 1206} 1207#ifdef USE_IRIDESCENCE 1208void 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 ) { 1209#else 1210void 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 ) { 1211#endif 1212 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1213 #ifdef USE_IRIDESCENCE 1214 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1215 #else 1216 vec3 Fr = specularColor; 1217 #endif 1218 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1219 float Ess = fab.x + fab.y; 1220 float Ems = 1.0 - Ess; 1221 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1222 singleScatter += FssEss; 1223 multiScatter += Fms * Ems; 1224} 1225#if NUM_RECT_AREA_LIGHTS > 0 1226 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 ) { 1227 vec3 normal = geometryNormal; 1228 vec3 viewDir = geometryViewDir; 1229 vec3 position = geometryPosition; 1230 vec3 lightPos = rectAreaLight.position; 1231 vec3 halfWidth = rectAreaLight.halfWidth; 1232 vec3 halfHeight = rectAreaLight.halfHeight; 1233 vec3 lightColor = rectAreaLight.color; 1234 float roughness = material.roughness; 1235 vec3 rectCoords[ 4 ]; 1236 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1237 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1238 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1239 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1240 vec4 t1 = texture2D( ltc_1, uv ); 1241 vec4 t2 = texture2D( ltc_2, uv ); 1242 mat3 mInv = mat3( 1243 vec3( t1.x, 0, t1.y ), 1244 vec3( 0, 1, 0 ), 1245 vec3( t1.z, 0, t1.w ) 1246 ); 1247 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 1248 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1249 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1250 } 1251#endif 1252void 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 ) { 1253 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1254 vec3 irradiance = dotNL * directLight.color; 1255 #ifdef USE_CLEARCOAT 1256 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1257 vec3 ccIrradiance = dotNLcc * directLight.color; 1258 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1259 #endif 1260 #ifdef USE_SHEEN 1261 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1262 #endif 1263 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); 1264 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1265} 1266void 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 ) { 1267 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1268} 1269void 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) { 1270 #ifdef USE_CLEARCOAT 1271 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1272 #endif 1273 #ifdef USE_SHEEN 1274 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1275 #endif 1276 vec3 singleScattering = vec3( 0.0 ); 1277 vec3 multiScattering = vec3( 0.0 ); 1278 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1279 #ifdef USE_IRIDESCENCE 1280 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); 1281 #else 1282 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 1283 #endif 1284 vec3 totalScattering = singleScattering + multiScattering; 1285 vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); 1286 reflectedLight.indirectSpecular += radiance * singleScattering; 1287 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 1288 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 1289} 1290#define RE_Direct RE_Direct_Physical 1291#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1292#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1293#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1294float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1295 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1296}`,
1296SU=` 1297vec3 geometryPosition = - vViewPosition; 1298vec3 geometryNormal = normal; 1299vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1300vec3 geometryClearcoatNormal = vec3( 0.0 ); 1301#ifdef USE_CLEARCOAT 1302 geometryClearcoatNormal = clearcoatNormal; 1303#endif 1304#ifdef USE_IRIDESCENCE 1305 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1306 if ( material.iridescenceThickness == 0.0 ) { 1307 material.iridescence = 0.0; 1308 } else { 1309 material.iridescence = saturate( material.iridescence ); 1310 } 1311 if ( material.iridescence > 0.0 ) { 1312 material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1313 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1314 } 1315#endif 1316IncidentLight directLight; 1317#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1318 PointLight pointLight; 1319 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1320 PointLightShadow pointLightShadow; 1321 #endif 1322 #pragma unroll_loop_start 1323 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1324 pointLight = pointLights[ i ]; 1325 getPointLightInfo( pointLight, geometryPosition, directLight ); 1326 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 1327 pointLightShadow = pointLightShadows[ i ]; 1328 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1329 #endif 1330 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1331 } 1332 #pragma unroll_loop_end 1333#endif 1334#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1335 SpotLight spotLight; 1336 vec4 spotColor; 1337 vec3 spotLightCoord; 1338 bool inSpotLightMap; 1339 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1340 SpotLightShadow spotLightShadow; 1341 #endif 1342 #pragma unroll_loop_start 1343 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1344 spotLight = spotLights[ i ]; 1345 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1346 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1347 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1348 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1349 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1350 #else 1351 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1352 #endif 1353 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1354 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1355 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1356 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1357 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1358 #endif 1359 #undef SPOT_LIGHT_MAP_INDEX 1360 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1361 spotLightShadow = spotLightShadows[ i ]; 1362 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1363 #endif 1364 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1365 } 1366 #pragma unroll_loop_end 1367#endif 1368#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1369 DirectionalLight directionalLight; 1370 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1371 DirectionalLightShadow directionalLightShadow; 1372 #endif 1373 #pragma unroll_loop_start 1374 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1375 directionalLight = directionalLights[ i ]; 1376 getDirectionalLightInfo( directionalLight, directLight ); 1377 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1378 directionalLightShadow = directionalLightShadows[ i ]; 1379 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1380 #endif 1381 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1382 } 1383 #pragma unroll_loop_end 1384#endif 1385#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1386 RectAreaLight rectAreaLight; 1387 #pragma unroll_loop_start 1388 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1389 rectAreaLight = rectAreaLights[ i ]; 1390 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1391 } 1392 #pragma unroll_loop_end 1393#endif 1394#if defined( RE_IndirectDiffuse ) 1395 vec3 iblIrradiance = vec3( 0.0 ); 1396 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1397 #if defined( USE_LIGHT_PROBES ) 1398 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1399 #endif 1400 #if ( NUM_HEMI_LIGHTS > 0 ) 1401 #pragma unroll_loop_start 1402 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1403 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1404 } 1405 #pragma unroll_loop_end 1406 #endif 1407#endif 1408#if defined( RE_IndirectSpecular ) 1409 vec3 radiance = vec3( 0.0 ); 1410 vec3 clearcoatRadiance = vec3( 0.0 ); 1411#endif`,MU=`#if defined( RE_IndirectDiffuse ) 1412 #ifdef USE_LIGHTMAP 1413 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1414 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1415 irradiance += lightMapIrradiance; 1416 #endif 1417 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 1418 iblIrradiance += getIBLIrradiance( geometryNormal ); 1419 #endif 1420#endif 1421#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1422 #ifdef USE_ANISOTROPY 1423 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1424 #else 1425 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1426 #endif 1427 #ifdef USE_CLEARCOAT 1428 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1429 #endif 1430#endif`,wU=`#if defined( RE_IndirectDiffuse ) 1431 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1432#endif 1433#if defined( RE_IndirectSpecular ) 1434 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1435#endif`,EU=`#if defined( USE_LOGDEPTHBUF ) 1436 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1437#endif`,TU=`#if defined( USE_LOGDEPTHBUF ) 1438 uniform float logDepthBufFC; 1439 varying float vFragDepth; 1440 varying float vIsPerspective; 1441#endif`,AU=`#ifdef USE_LOGDEPTHBUF 1442 varying float vFragDepth; 1443 varying float vIsPerspective; 1444#endif`,bU=`#ifdef USE_LOGDEPTHBUF 1445 vFragDepth = 1.0 + gl_Position.w; 1446 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1447#endif`,RU=`#ifdef USE_MAP 1448 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1449 #ifdef DECODE_VIDEO_TEXTURE 1450 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 ); 1451 1452 #endif 1453 diffuseColor *= sampledDiffuseColor; 1454#endif`,CU=`#ifdef USE_MAP 1455 uniform sampler2D map; 1456#endif`,PU=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1457 #if defined( USE_POINTS_UV ) 1458 vec2 uv = vUv; 1459 #else 1460 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1461 #endif 1462#endif 1463#ifdef USE_MAP 1464 diffuseColor *= texture2D( map, uv ); 1465#endif 1466#ifdef USE_ALPHAMAP 1467 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1468#endif`,IU=`#if defined( USE_POINTS_UV ) 1469 varying vec2 vUv; 1470#else 1471 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1472 uniform mat3 uvTransform; 1473 #endif 1474#endif 1475#ifdef USE_MAP 1476 uniform sampler2D map; 1477#endif 1478#ifdef USE_ALPHAMAP 1479 uniform sampler2D alphaMap; 1480#endif`,LU=`float metalnessFactor = metalness; 1481#ifdef USE_METALNESSMAP 1482 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1483 metalnessFactor *= texelMetalness.b; 1484#endif`,NU=`#ifdef USE_METALNESSMAP 1485 uniform sampler2D metalnessMap; 1486#endif`,DU=`#ifdef USE_INSTANCING_MORPH 1487 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1488 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1489 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1490 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1491 } 1492#endif`,UU=`#if defined( USE_MORPHCOLORS ) 1493 vColor *= morphTargetBaseInfluence; 1494 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1495 #if defined( USE_COLOR_ALPHA ) 1496 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1497 #elif defined( USE_COLOR ) 1498 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1499 #endif 1500 } 1501#endif`,OU=`#ifdef USE_MORPHNORMALS 1502 objectNormal *= morphTargetBaseInfluence; 1503 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1504 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1505 } 1506#endif`,FU=`#ifdef USE_MORPHTARGETS 1507 #ifndef USE_INSTANCING_MORPH 1508 uniform float morphTargetBaseInfluence; 1509 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1510 #endif 1511 uniform sampler2DArray morphTargetsTexture; 1512 uniform ivec2 morphTargetsTextureSize; 1513 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1514 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1515 int y = texelIndex / morphTargetsTextureSize.x; 1516 int x = texelIndex - y * morphTargetsTextureSize.x; 1517 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1518 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1519 } 1520#endif`,kU=`#ifdef USE_MORPHTARGETS 1521 transformed *= morphTargetBaseInfluence; 1522 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1523 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1524 } 1525#endif`,zU=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1526#ifdef FLAT_SHADED 1527 vec3 fdx = dFdx( vViewPosition ); 1528 vec3 fdy = dFdy( vViewPosition ); 1529 vec3 normal = normalize( cross( fdx, fdy ) ); 1530#else 1531 vec3 normal = normalize( vNormal ); 1532 #ifdef DOUBLE_SIDED 1533 normal *= faceDirection; 1534 #endif 1535#endif 1536#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1537 #ifdef USE_TANGENT 1538 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1539 #else 1540 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1541 #if defined( USE_NORMALMAP ) 1542 vNormalMapUv 1543 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1544 vClearcoatNormalMapUv 1545 #else 1546 vUv 1547 #endif 1548 ); 1549 #endif 1550 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1551 tbn[0] *= faceDirection; 1552 tbn[1] *= faceDirection; 1553 #endif 1554#endif 1555#ifdef USE_CLEARCOAT_NORMALMAP 1556 #ifdef USE_TANGENT 1557 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1558 #else 1559 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1560 #endif 1561 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1562 tbn2[0] *= faceDirection; 1563 tbn2[1] *= faceDirection; 1564 #endif 1565#endif 1566vec3 nonPerturbedNormal = normal;`,BU=`#ifdef USE_NORMALMAP_OBJECTSPACE 1567 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1568 #ifdef FLIP_SIDED 1569 normal = - normal; 1570 #endif 1571 #ifdef DOUBLE_SIDED 1572 normal = normal * faceDirection; 1573 #endif 1574 normal = normalize( normalMatrix * normal ); 1575#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1576 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1577 mapN.xy *= normalScale; 1578 normal = normalize( tbn * mapN ); 1579#elif defined( USE_BUMPMAP )
1580 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1581#endif`,HU=`#ifndef FLAT_SHADED 1582 varying vec3 vNormal; 1583 #ifdef USE_TANGENT 1584 varying vec3 vTangent; 1585 varying vec3 vBitangent; 1586 #endif 1587#endif`,GU=`#ifndef FLAT_SHADED 1588 varying vec3 vNormal; 1589 #ifdef USE_TANGENT 1590 varying vec3 vTangent; 1591 varying vec3 vBitangent; 1592 #endif 1593#endif`,VU=`#ifndef FLAT_SHADED 1594 vNormal = normalize( transformedNormal ); 1595 #ifdef USE_TANGENT 1596 vTangent = normalize( transformedTangent ); 1597 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1598 #endif 1599#endif`,WU=`#ifdef USE_NORMALMAP 1600 uniform sampler2D normalMap; 1601 uniform vec2 normalScale; 1602#endif 1603#ifdef USE_NORMALMAP_OBJECTSPACE 1604 uniform mat3 normalMatrix; 1605#endif 1606#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1607 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1608 vec3 q0 = dFdx( eye_pos.xyz ); 1609 vec3 q1 = dFdy( eye_pos.xyz ); 1610 vec2 st0 = dFdx( uv.st ); 1611 vec2 st1 = dFdy( uv.st ); 1612 vec3 N = surf_norm; 1613 vec3 q1perp = cross( q1, N ); 1614 vec3 q0perp = cross( N, q0 ); 1615 vec3 T = q1perp * st0.x + q0perp * st1.x; 1616 vec3 B = q1perp * st0.y + q0perp * st1.y; 1617 float det = max( dot( T, T ), dot( B, B ) ); 1618 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1619 return mat3( T * scale, B * scale, N ); 1620 } 1621#endif`,XU=`#ifdef USE_CLEARCOAT 1622 vec3 clearcoatNormal = nonPerturbedNormal; 1623#endif`,jU=`#ifdef USE_CLEARCOAT_NORMALMAP 1624 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1625 clearcoatMapN.xy *= clearcoatNormalScale; 1626 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1627#endif`,YU=`#ifdef USE_CLEARCOATMAP 1628 uniform sampler2D clearcoatMap; 1629#endif 1630#ifdef USE_CLEARCOAT_NORMALMAP 1631 uniform sampler2D clearcoatNormalMap; 1632 uniform vec2 clearcoatNormalScale; 1633#endif 1634#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1635 uniform sampler2D clearcoatRoughnessMap; 1636#endif`,qU=`#ifdef USE_IRIDESCENCEMAP 1637 uniform sampler2D iridescenceMap; 1638#endif 1639#ifdef USE_IRIDESCENCE_THICKNESSMAP 1640 uniform sampler2D iridescenceThicknessMap; 1641#endif`,ZU=`#ifdef OPAQUE 1642diffuseColor.a = 1.0; 1643#endif 1644#ifdef USE_TRANSMISSION 1645diffuseColor.a *= material.transmissionAlpha; 1646#endif 1647gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,KU=`vec3 packNormalToRGB( const in vec3 normal ) { 1648 return normalize( normal ) * 0.5 + 0.5; 1649} 1650vec3 unpackRGBToNormal( const in vec3 rgb ) { 1651 return 2.0 * rgb.xyz - 1.0; 1652} 1653const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 1654const float Inv255 = 1. / 255.; 1655const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 1656const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 1657const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 1658const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 1659vec4 packDepthToRGBA( const in float v ) { 1660 if( v <= 0.0 ) 1661 return vec4( 0., 0., 0., 0. ); 1662 if( v >= 1.0 ) 1663 return vec4( 1., 1., 1., 1. ); 1664 float vuf; 1665 float af = modf( v * PackFactors.a, vuf ); 1666 float bf = modf( vuf * ShiftRight8, vuf ); 1667 float gf = modf( vuf * ShiftRight8, vuf ); 1668 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 1669} 1670vec3 packDepthToRGB( const in float v ) { 1671 if( v <= 0.0 ) 1672 return vec3( 0., 0., 0. ); 1673 if( v >= 1.0 ) 1674 return vec3( 1., 1., 1. ); 1675 float vuf; 1676 float bf = modf( v * PackFactors.b, vuf ); 1677 float gf = modf( vuf * ShiftRight8, vuf ); 1678 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 1679} 1680vec2 packDepthToRG( const in float v ) { 1681 if( v <= 0.0 ) 1682 return vec2( 0., 0. ); 1683 if( v >= 1.0 ) 1684 return vec2( 1., 1. ); 1685 float vuf; 1686 float gf = modf( v * 256., vuf ); 1687 return vec2( vuf * Inv255, gf ); 1688} 1689float unpackRGBAToDepth( const in vec4 v ) { 1690 return dot( v, UnpackFactors4 ); 1691} 1692float unpackRGBToDepth( const in vec3 v ) { 1693 return dot( v, UnpackFactors3 ); 1694} 1695float unpackRGToDepth( const in vec2 v ) { 1696 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 1697} 1698vec4 pack2HalfToRGBA( const in vec2 v ) {
1699 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1700 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1701} 1702vec2 unpackRGBATo2Half( const in vec4 v ) { 1703 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1704} 1705float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1706 return ( viewZ + near ) / ( near - far ); 1707} 1708float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1709 return depth * ( near - far ) - near; 1710} 1711float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1712 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1713} 1714float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1715 return ( near * far ) / ( ( far - near ) * depth - far ); 1716}`,QU=`#ifdef PREMULTIPLIED_ALPHA 1717 gl_FragColor.rgb *= gl_FragColor.a; 1718#endif`,$U=`vec4 mvPosition = vec4( transformed, 1.0 ); 1719#ifdef USE_BATCHING 1720 mvPosition = batchingMatrix * mvPosition; 1721#endif 1722#ifdef USE_INSTANCING 1723 mvPosition = instanceMatrix * mvPosition; 1724#endif 1725mvPosition = modelViewMatrix * mvPosition; 1726gl_Position = projectionMatrix * mvPosition;`,JU=`#ifdef DITHERING 1727 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1728#endif`,e5=`#ifdef DITHERING 1729 vec3 dithering( vec3 color ) { 1730 float grid_position = rand( gl_FragCoord.xy ); 1731 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1732 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1733 return color + dither_shift_RGB; 1734 } 1735#endif`,t5=`float roughnessFactor = roughness; 1736#ifdef USE_ROUGHNESSMAP 1737 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1738 roughnessFactor *= texelRoughness.g; 1739#endif`,n5=`#ifdef USE_ROUGHNESSMAP 1740 uniform sampler2D roughnessMap; 1741#endif`,i5=
vendor: 8,887 bytes, lines 1741-1927
1741`#if NUM_SPOT_LIGHT_COORDS > 0 1742 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1743#endif 1744#if NUM_SPOT_LIGHT_MAPS > 0 1745 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1746#endif 1747#ifdef USE_SHADOWMAP 1748 #if NUM_DIR_LIGHT_SHADOWS > 0 1749 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1750 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1751 struct DirectionalLightShadow { 1752 float shadowIntensity; 1753 float shadowBias; 1754 float shadowNormalBias; 1755 float shadowRadius; 1756 vec2 shadowMapSize; 1757 }; 1758 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1759 #endif 1760 #if NUM_SPOT_LIGHT_SHADOWS > 0 1761 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1762 struct SpotLightShadow { 1763 float shadowIntensity; 1764 float shadowBias; 1765 float shadowNormalBias; 1766 float shadowRadius; 1767 vec2 shadowMapSize; 1768 }; 1769 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1770 #endif 1771 #if NUM_POINT_LIGHT_SHADOWS > 0 1772 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1773 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1774 struct PointLightShadow { 1775 float shadowIntensity; 1776 float shadowBias; 1777 float shadowNormalBias; 1778 float shadowRadius; 1779 vec2 shadowMapSize; 1780 float shadowCameraNear; 1781 float shadowCameraFar; 1782 }; 1783 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1784 #endif 1785 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 1786 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 1787 } 1788 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 1789 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 1790 } 1791 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 1792 float occlusion = 1.0; 1793 vec2 distribution = texture2DDistribution( shadow, uv ); 1794 float hard_shadow = step( compare , distribution.x ); 1795 if (hard_shadow != 1.0 ) { 1796 float distance = compare - distribution.x ; 1797 float variance = max( 0.00000, distribution.y * distribution.y ); 1798 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 ); 1799 } 1800 return occlusion; 1801 } 1802 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1803 float shadow = 1.0; 1804 shadowCoord.xyz /= shadowCoord.w; 1805 shadowCoord.z += shadowBias; 1806 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1807 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1808 if ( frustumTest ) { 1809 #if defined( SHADOWMAP_TYPE_PCF ) 1810 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1811 float dx0 = - texelSize.x * shadowRadius; 1812 float dy0 = - texelSize.y * shadowRadius; 1813 float dx1 = + texelSize.x * shadowRadius; 1814 float dy1 = + texelSize.y * shadowRadius; 1815 float dx2 = dx0 / 2.0; 1816 float dy2 = dy0 / 2.0; 1817 float dx3 = dx1 / 2.0; 1818 float dy3 = dy1 / 2.0; 1819 shadow = ( 1820 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 1821 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 1822 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 1823 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 1824 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 1825 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 1826 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 1827 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 1828 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 1829 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 1830 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 1831 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 1832 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 1833 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 1834 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 1835 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 1836 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 1837 ) * ( 1.0 / 17.0 ); 1838 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 1839 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1840 float dx = texelSize.x; 1841 float dy = texelSize.y; 1842 vec2 uv = shadowCoord.xy; 1843 vec2 f = fract( uv * shadowMapSize + 0.5 ); 1844 uv -= f * texelSize; 1845 shadow = ( 1846 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 1847 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 1848 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 1849 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 1850 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 1851 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 1852 f.x ) + 1853 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 1854 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 1855 f.x ) + 1856 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 1857 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 1858 f.y ) + 1859 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 1860 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 1861 f.y ) + 1862 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 1863 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 1864 f.x ), 1865 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 1866 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 1867 f.x ), 1868 f.y ) 1869 ) * ( 1.0 / 9.0 ); 1870 #elif defined( SHADOWMAP_TYPE_VSM ) 1871 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 1872 #else 1873 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 1874 #endif 1875 } 1876 return mix( 1.0, shadow, shadowIntensity ); 1877 } 1878 vec2 cubeToUV( vec3 v, float texelSizeY ) { 1879 vec3 absV = abs( v ); 1880 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 1881 absV *= scaleToCube; 1882 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 1883 vec2 planar = v.xy; 1884 float almostATexel = 1.5 * texelSizeY; 1885 float almostOne = 1.0 - almostATexel; 1886 if ( absV.z >= almostOne ) { 1887 if ( v.z > 0.0 ) 1888 planar.x = 4.0 - v.x; 1889 } else if ( absV.x >= almostOne ) { 1890 float signX = sign( v.x ); 1891 planar.x = v.z * signX + 2.0 * signX; 1892 } else if ( absV.y >= almostOne ) { 1893 float signY = sign( v.y ); 1894 planar.x = v.x + 2.0 * signY + 2.0; 1895 planar.y = v.z * signY - 2.0; 1896 } 1897 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 1898 } 1899 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1900 float shadow = 1.0; 1901 vec3 lightToPosition = shadowCoord.xyz; 1902 1903 float lightToPositionLength = length( lightToPosition ); 1904 if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { 1905 float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 1906 vec3 bd3D = normalize( lightToPosition ); 1907 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 1908 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 1909 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 1910 shadow = ( 1911 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 1912 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 1913 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 1914 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 1915 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 1916 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 1917 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 1918 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 1919 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 1920 ) * ( 1.0 / 9.0 ); 1921 #else 1922 shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 1923 #endif 1924 } 1925 return mix( 1.0, shadow, shadowIntensity ); 1926 } 1927#endif`,
1927r5=`#if NUM_SPOT_LIGHT_COORDS > 0 1928 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 1929 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1930#endif 1931#ifdef USE_SHADOWMAP 1932 #if NUM_DIR_LIGHT_SHADOWS > 0 1933 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 1934 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1935 struct DirectionalLightShadow { 1936 float shadowIntensity; 1937 float shadowBias; 1938 float shadowNormalBias; 1939 float shadowRadius; 1940 vec2 shadowMapSize; 1941 }; 1942 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1943 #endif 1944 #if NUM_SPOT_LIGHT_SHADOWS > 0 1945 struct SpotLightShadow { 1946 float shadowIntensity; 1947 float shadowBias; 1948 float shadowNormalBias; 1949 float shadowRadius; 1950 vec2 shadowMapSize; 1951 }; 1952 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1953 #endif 1954 #if NUM_POINT_LIGHT_SHADOWS > 0 1955 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 1956 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1957 struct PointLightShadow { 1958 float shadowIntensity; 1959 float shadowBias; 1960 float shadowNormalBias; 1961 float shadowRadius; 1962 vec2 shadowMapSize; 1963 float shadowCameraNear; 1964 float shadowCameraFar; 1965 }; 1966 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1967 #endif 1968#endif`,s5=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 1969 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 1970 vec4 shadowWorldPosition; 1971#endif 1972#if defined( USE_SHADOWMAP ) 1973 #if NUM_DIR_LIGHT_SHADOWS > 0 1974 #pragma unroll_loop_start 1975 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1976 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 1977 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 1978 } 1979 #pragma unroll_loop_end 1980 #endif 1981 #if NUM_POINT_LIGHT_SHADOWS > 0 1982 #pragma unroll_loop_start 1983 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1984 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 1985 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 1986 } 1987 #pragma unroll_loop_end 1988 #endif 1989#endif 1990#if NUM_SPOT_LIGHT_COORDS > 0 1991 #pragma unroll_loop_start 1992 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 1993 shadowWorldPosition = worldPosition; 1994 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1995 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 1996 #endif 1997 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 1998 } 1999 #pragma unroll_loop_end 2000#endif`,o5=`float getShadowMask() { 2001 float shadow = 1.0; 2002 #ifdef USE_SHADOWMAP 2003 #if NUM_DIR_LIGHT_SHADOWS > 0 2004 DirectionalLightShadow directionalLight; 2005 #pragma unroll_loop_start 2006 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2007 directionalLight = directionalLightShadows[ i ]; 2008 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2009 } 2010 #pragma unroll_loop_end 2011 #endif 2012 #if NUM_SPOT_LIGHT_SHADOWS > 0 2013 SpotLightShadow spotLight; 2014 #pragma unroll_loop_start 2015 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 2016 spotLight = spotLightShadows[ i ]; 2017 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2018 } 2019 #pragma unroll_loop_end 2020 #endif 2021 #if NUM_POINT_LIGHT_SHADOWS > 0 2022 PointLightShadow pointLight; 2023 #pragma unroll_loop_start 2024 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2025 pointLight = pointLightShadows[ i ]; 2026 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2027 } 2028 #pragma unroll_loop_end 2029 #endif 2030 #endif 2031 return shadow; 2032}`,a5=`#ifdef USE_SKINNING 2033 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2034 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2035 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2036 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2037#endif`,l5=`#ifdef USE_SKINNING 2038 uniform mat4 bindMatrix; 2039 uniform mat4 bindMatrixInverse; 2040 uniform highp sampler2D boneTexture; 2041 mat4 getBoneMatrix( const in float i ) { 2042 int size = textureSize( boneTexture, 0 ).x; 2043 int j = int( i ) * 4; 2044 int x = j % size; 2045 int y = j / size; 2046 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2047 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2048 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2049 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2050 return mat4( v1, v2, v3, v4 ); 2051 } 2052#endif`,c5=`#ifdef USE_SKINNING 2053 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2054 vec4 skinned = vec4( 0.0 ); 2055 skinned += boneMatX * skinVertex * skinWeight.x; 2056 skinned += boneMatY * skinVertex * skinWeight.y; 2057 skinned += boneMatZ * skinVertex * skinWeight.z; 2058 skinned += boneMatW * skinVertex * skinWeight.w; 2059 transformed = ( bindMatrixInverse * skinned ).xyz; 2060#endif`,u5=`#ifdef USE_SKINNING 2061 mat4 skinMatrix = mat4( 0.0 ); 2062 skinMatrix += skinWeight.x * boneMatX; 2063 skinMatrix += skinWeight.y * boneMatY; 2064 skinMatrix += skinWeight.z * boneMatZ; 2065 skinMatrix += skinWeight.w * boneMatW; 2066 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2067 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2068 #ifdef USE_TANGENT 2069 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2070 #endif 2071#endif`,f5=`float specularStrength; 2072#ifdef USE_SPECULARMAP 2073 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2074 specularStrength = texelSpecular.r; 2075#else 2076 specularStrength = 1.0; 2077#endif`,h5=`#ifdef USE_SPECULARMAP 2078 uniform sampler2D specularMap; 2079#endif`,d5=`#if defined( TONE_MAPPING ) 2080 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2081#endif`,p5=`#ifndef saturate 2082#define saturate( a ) clamp( a, 0.0, 1.0 ) 2083#endif 2084uniform float toneMappingExposure; 2085vec3 LinearToneMapping( vec3 color ) { 2086 return saturate( toneMappingExposure * color ); 2087} 2088vec3 ReinhardToneMapping( vec3 color ) { 2089 color *= toneMappingExposure; 2090 return saturate( color / ( vec3( 1.0 ) + color ) ); 2091} 2092vec3 CineonToneMapping( vec3 color ) { 2093 color *= toneMappingExposure; 2094 color = max( vec3( 0.0 ), color - 0.004 ); 2095 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2096} 2097vec3 RRTAndODTFit( vec3 v ) { 2098 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2099 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2100 return a / b; 2101} 2102vec3 ACESFilmicToneMapping( vec3 color ) { 2103 const mat3 ACESInputMat = mat3( 2104 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2105 vec3( 0.04823, 0.01566, 0.83777 ) 2106 ); 2107 const mat3 ACESOutputMat = mat3( 2108 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2109 vec3( -0.07367, -0.00605, 1.07602 ) 2110 ); 2111 color *= toneMappingExposure / 0.6; 2112 color = ACESInputMat * color; 2113 color = RRTAndODTFit( color ); 2114 color = ACESOutputMat * color; 2115 return saturate( color ); 2116} 2117const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2118 vec3( 1.6605, - 0.1246, - 0.0182 ), 2119 vec3( - 0.5876, 1.1329, - 0.1006 ), 2120 vec3( - 0.0728, - 0.0083, 1.1187 ) 2121); 2122const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2123 vec3( 0.6274, 0.0691, 0.0164 ), 2124 vec3( 0.3293, 0.9195, 0.0880 ), 2125 vec3( 0.0433, 0.0113, 0.8956 ) 2126); 2127vec3 agxDefaultContrastApprox( vec3 x ) { 2128 vec3 x2 = x * x; 2129 vec3 x4 = x2 * x2; 2130 return + 15.5 * x4 * x2 2131 - 40.14 * x4 * x 2132 + 31.96 * x4 2133 - 6.868 * x2 * x 2134 + 0.4298 * x2 2135 + 0.1191 * x 2136 - 0.00232; 2137} 2138vec3 AgXToneMapping( vec3 color ) { 2139 const mat3 AgXInsetMatrix = mat3( 2140 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2141 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2142 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2143 );
2144 const mat3 AgXOutsetMatrix = mat3( 2145 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2146 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2147 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2148 ); 2149 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2150 color *= toneMappingExposure; 2151 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2152 color = AgXInsetMatrix * color; 2153 color = max( color, 1e-10 ); color = log2( color ); 2154 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2155 color = clamp( color, 0.0, 1.0 ); 2156 color = agxDefaultContrastApprox( color ); 2157 color = AgXOutsetMatrix * color; 2158 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2159 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2160 color = clamp( color, 0.0, 1.0 ); 2161 return color; 2162} 2163vec3 NeutralToneMapping( vec3 color ) { 2164 const float StartCompression = 0.8 - 0.04; 2165 const float Desaturation = 0.15; 2166 color *= toneMappingExposure; 2167 float x = min( color.r, min( color.g, color.b ) ); 2168 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2169 color -= offset; 2170 float peak = max( color.r, max( color.g, color.b ) ); 2171 if ( peak < StartCompression ) return color; 2172 float d = 1. - StartCompression; 2173 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2174 color *= newPeak / peak; 2175 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2176 return mix( color, vec3( newPeak ), g ); 2177} 2178vec3 CustomToneMapping( vec3 color ) { return color; }`,m5=`#ifdef USE_TRANSMISSION 2179 material.transmission = transmission; 2180 material.transmissionAlpha = 1.0; 2181 material.thickness = thickness; 2182 material.attenuationDistance = attenuationDistance; 2183 material.attenuationColor = attenuationColor; 2184 #ifdef USE_TRANSMISSIONMAP 2185 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2186 #endif 2187 #ifdef USE_THICKNESSMAP 2188 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2189 #endif 2190 vec3 pos = vWorldPosition; 2191 vec3 v = normalize( cameraPosition - pos ); 2192 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2193 vec4 transmitted = getIBLVolumeRefraction( 2194 n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, 2195 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2196 material.attenuationColor, material.attenuationDistance ); 2197 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2198 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2199#endif`,g5=`#ifdef USE_TRANSMISSION 2200 uniform float transmission; 2201 uniform float thickness; 2202 uniform float attenuationDistance; 2203 uniform vec3 attenuationColor; 2204 #ifdef USE_TRANSMISSIONMAP 2205 uniform sampler2D transmissionMap; 2206 #endif 2207 #ifdef USE_THICKNESSMAP 2208 uniform sampler2D thicknessMap; 2209 #endif 2210 uniform vec2 transmissionSamplerSize; 2211 uniform sampler2D transmissionSamplerMap; 2212 uniform mat4 modelMatrix; 2213 uniform mat4 projectionMatrix; 2214 varying vec3 vWorldPosition; 2215 float w0( float a ) { 2216 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2217 } 2218 float w1( float a ) { 2219 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2220 } 2221 float w2( float a ){ 2222 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2223 } 2224 float w3( float a ) { 2225 return ( 1.0 / 6.0 ) * ( a * a * a ); 2226 } 2227 float g0( float a ) { 2228 return w0( a ) + w1( a ); 2229 } 2230 float g1( float a ) { 2231 return w2( a ) + w3( a ); 2232 } 2233 float h0( float a ) { 2234 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2235 } 2236 float h1( float a ) { 2237 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2238 } 2239 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2240 uv = uv * texelSize.zw + 0.5; 2241 vec2 iuv = floor( uv ); 2242 vec2 fuv = fract( uv ); 2243 float g0x = g0( fuv.x ); 2244 float g1x = g1( fuv.x ); 2245 float h0x = h0( fuv.x ); 2246 float h1x = h1( fuv.x ); 2247 float h0y = h0( fuv.y ); 2248 float h1y = h1( fuv.y ); 2249 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2250 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2251 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2252 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2253 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2254 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2255 } 2256 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2257 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2258 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2259 vec2 fLodSizeInv = 1.0 / fLodSize; 2260 vec2 cLodSizeInv = 1.0 / cLodSize; 2261 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2262 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2263 return mix( fSample, cSample, fract( lod ) ); 2264 } 2265 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2266 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2267 vec3 modelScale; 2268 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2269 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2270 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2271 return normalize( refractionVector ) * thickness * modelScale; 2272 } 2273 float applyIorToRoughness( const in float roughness, const in float ior ) { 2274 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2275 } 2276 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2277 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2278 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2279 } 2280 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2281 if ( isinf( attenuationDistance ) ) { 2282 return vec3( 1.0 ); 2283 } else { 2284 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2285 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2286 } 2287 } 2288 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2289 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2290 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2291 const in vec3 attenuationColor, const in float attenuationDistance ) { 2292 vec4 transmittedLight; 2293 vec3 transmittance; 2294 #ifdef USE_DISPERSION 2295 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2296 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2297 for ( int i = 0; i < 3; i ++ ) { 2298 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2299 vec3 refractedRayExit = position + transmissionRay; 2300 2301 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2302 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2303 refractionCoords += 1.0; 2304 refractionCoords /= 2.0; 2305 2306 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2307 transmittedLight[ i ] = transmissionSample[ i ]; 2308 transmittedLight.a += transmissionSample.a; 2309 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2310 } 2311 transmittedLight.a /= 3.0; 2312 2313 #else 2314 2315 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2316 vec3 refractedRayExit = position + transmissionRay; 2317 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2318 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2319 refractionCoords += 1.0; 2320 refractionCoords /= 2.0; 2321 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2322 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2323 2324 #endif 2325 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2326 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2327 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2328 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2329 } 2330#endif`,v5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2331 varying vec2 vUv; 2332#endif 2333#ifdef USE_MAP 2334 varying vec2 vMapUv; 2335#endif 2336#ifdef USE_ALPHAMAP
2337 varying vec2 vAlphaMapUv; 2338#endif 2339#ifdef USE_LIGHTMAP 2340 varying vec2 vLightMapUv; 2341#endif 2342#ifdef USE_AOMAP 2343 varying vec2 vAoMapUv; 2344#endif 2345#ifdef USE_BUMPMAP 2346 varying vec2 vBumpMapUv; 2347#endif 2348#ifdef USE_NORMALMAP 2349 varying vec2 vNormalMapUv; 2350#endif 2351#ifdef USE_EMISSIVEMAP 2352 varying vec2 vEmissiveMapUv; 2353#endif 2354#ifdef USE_METALNESSMAP 2355 varying vec2 vMetalnessMapUv; 2356#endif 2357#ifdef USE_ROUGHNESSMAP 2358 varying vec2 vRoughnessMapUv; 2359#endif 2360#ifdef USE_ANISOTROPYMAP 2361 varying vec2 vAnisotropyMapUv; 2362#endif 2363#ifdef USE_CLEARCOATMAP 2364 varying vec2 vClearcoatMapUv; 2365#endif 2366#ifdef USE_CLEARCOAT_NORMALMAP 2367 varying vec2 vClearcoatNormalMapUv; 2368#endif 2369#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2370 varying vec2 vClearcoatRoughnessMapUv; 2371#endif 2372#ifdef USE_IRIDESCENCEMAP 2373 varying vec2 vIridescenceMapUv; 2374#endif 2375#ifdef USE_IRIDESCENCE_THICKNESSMAP 2376 varying vec2 vIridescenceThicknessMapUv; 2377#endif 2378#ifdef USE_SHEEN_COLORMAP 2379 varying vec2 vSheenColorMapUv; 2380#endif 2381#ifdef USE_SHEEN_ROUGHNESSMAP 2382 varying vec2 vSheenRoughnessMapUv; 2383#endif 2384#ifdef USE_SPECULARMAP 2385 varying vec2 vSpecularMapUv; 2386#endif 2387#ifdef USE_SPECULAR_COLORMAP 2388 varying vec2 vSpecularColorMapUv; 2389#endif 2390#ifdef USE_SPECULAR_INTENSITYMAP 2391 varying vec2 vSpecularIntensityMapUv; 2392#endif 2393#ifdef USE_TRANSMISSIONMAP 2394 uniform mat3 transmissionMapTransform; 2395 varying vec2 vTransmissionMapUv; 2396#endif 2397#ifdef USE_THICKNESSMAP 2398 uniform mat3 thicknessMapTransform; 2399 varying vec2 vThicknessMapUv; 2400#endif`,y5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2401 varying vec2 vUv; 2402#endif 2403#ifdef USE_MAP 2404 uniform mat3 mapTransform; 2405 varying vec2 vMapUv; 2406#endif 2407#ifdef USE_ALPHAMAP 2408 uniform mat3 alphaMapTransform; 2409 varying vec2 vAlphaMapUv; 2410#endif 2411#ifdef USE_LIGHTMAP 2412 uniform mat3 lightMapTransform; 2413 varying vec2 vLightMapUv; 2414#endif 2415#ifdef USE_AOMAP 2416 uniform mat3 aoMapTransform; 2417 varying vec2 vAoMapUv; 2418#endif 2419#ifdef USE_BUMPMAP 2420 uniform mat3 bumpMapTransform; 2421 varying vec2 vBumpMapUv; 2422#endif 2423#ifdef USE_NORMALMAP 2424 uniform mat3 normalMapTransform; 2425 varying vec2 vNormalMapUv; 2426#endif 2427#ifdef USE_DISPLACEMENTMAP 2428 uniform mat3 displacementMapTransform; 2429 varying vec2 vDisplacementMapUv; 2430#endif 2431#ifdef USE_EMISSIVEMAP 2432 uniform mat3 emissiveMapTransform; 2433 varying vec2 vEmissiveMapUv; 2434#endif 2435#ifdef USE_METALNESSMAP 2436 uniform mat3 metalnessMapTransform; 2437 varying vec2 vMetalnessMapUv; 2438#endif 2439#ifdef USE_ROUGHNESSMAP 2440 uniform mat3 roughnessMapTransform; 2441 varying vec2 vRoughnessMapUv; 2442#endif 2443#ifdef USE_ANISOTROPYMAP 2444 uniform mat3 anisotropyMapTransform; 2445 varying vec2 vAnisotropyMapUv; 2446#endif 2447#ifdef USE_CLEARCOATMAP 2448 uniform mat3 clearcoatMapTransform; 2449 varying vec2 vClearcoatMapUv; 2450#endif 2451#ifdef USE_CLEARCOAT_NORMALMAP 2452 uniform mat3 clearcoatNormalMapTransform; 2453 varying vec2 vClearcoatNormalMapUv; 2454#endif 2455#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2456 uniform mat3 clearcoatRoughnessMapTransform; 2457 varying vec2 vClearcoatRoughnessMapUv; 2458#endif 2459#ifdef USE_SHEEN_COLORMAP 2460 uniform mat3 sheenColorMapTransform; 2461 varying vec2 vSheenColorMapUv; 2462#endif 2463#ifdef USE_SHEEN_ROUGHNESSMAP 2464 uniform mat3 sheenRoughnessMapTransform; 2465 varying vec2 vSheenRoughnessMapUv; 2466#endif 2467#ifdef USE_IRIDESCENCEMAP 2468 uniform mat3 iridescenceMapTransform; 2469 varying vec2 vIridescenceMapUv; 2470#endif 2471#ifdef USE_IRIDESCENCE_THICKNESSMAP 2472 uniform mat3 iridescenceThicknessMapTransform; 2473 varying vec2 vIridescenceThicknessMapUv; 2474#endif 2475#ifdef USE_SPECULARMAP 2476 uniform mat3 specularMapTransform; 2477 varying vec2 vSpecularMapUv; 2478#endif 2479#ifdef USE_SPECULAR_COLORMAP 2480 uniform mat3 specularColorMapTransform; 2481 varying vec2 vSpecularColorMapUv; 2482#endif 2483#ifdef USE_SPECULAR_INTENSITYMAP 2484 uniform mat3 specularIntensityMapTransform; 2485 varying vec2 vSpecularIntensityMapUv; 2486#endif 2487#ifdef USE_TRANSMISSIONMAP 2488 uniform mat3 transmissionMapTransform; 2489 varying vec2 vTransmissionMapUv; 2490#endif 2491#ifdef USE_THICKNESSMAP 2492 uniform mat3 thicknessMapTransform; 2493 varying vec2 vThicknessMapUv; 2494#endif`,_5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2495 vUv = vec3( uv, 1 ).xy; 2496#endif 2497#ifdef USE_MAP 2498 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2499#endif 2500#ifdef USE_ALPHAMAP 2501 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2502#endif 2503#ifdef USE_LIGHTMAP 2504 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2505#endif 2506#ifdef USE_AOMAP 2507 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2508#endif 2509#ifdef USE_BUMPMAP 2510 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2511#endif 2512#ifdef USE_NORMALMAP 2513 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2514#endif 2515#ifdef USE_DISPLACEMENTMAP 2516 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2517#endif 2518#ifdef USE_EMISSIVEMAP 2519 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2520#endif 2521#ifdef USE_METALNESSMAP 2522 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2523#endif 2524#ifdef USE_ROUGHNESSMAP 2525 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2526#endif 2527#ifdef USE_ANISOTROPYMAP 2528 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2529#endif 2530#ifdef USE_CLEARCOATMAP 2531 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2532#endif 2533#ifdef USE_CLEARCOAT_NORMALMAP 2534 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2535#endif 2536#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2537 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2538#endif
2539#ifdef USE_IRIDESCENCEMAP 2540 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2541#endif 2542#ifdef USE_IRIDESCENCE_THICKNESSMAP 2543 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2544#endif 2545#ifdef USE_SHEEN_COLORMAP 2546 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2547#endif 2548#ifdef USE_SHEEN_ROUGHNESSMAP 2549 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2550#endif 2551#ifdef USE_SPECULARMAP 2552 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2553#endif 2554#ifdef USE_SPECULAR_COLORMAP 2555 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2556#endif 2557#ifdef USE_SPECULAR_INTENSITYMAP 2558 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2559#endif 2560#ifdef USE_TRANSMISSIONMAP 2561 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2562#endif 2563#ifdef USE_THICKNESSMAP 2564 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2565#endif`,x5=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2566 vec4 worldPosition = vec4( transformed, 1.0 ); 2567 #ifdef USE_BATCHING 2568 worldPosition = batchingMatrix * worldPosition; 2569 #endif 2570 #ifdef USE_INSTANCING 2571 worldPosition = instanceMatrix * worldPosition; 2572 #endif 2573 worldPosition = modelMatrix * worldPosition; 2574#endif`;const S5=`varying vec2 vUv; 2575uniform mat3 uvTransform; 2576void main() { 2577 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2578 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2579}`,M5=`uniform sampler2D t2D; 2580uniform float backgroundIntensity; 2581varying vec2 vUv; 2582void main() { 2583 vec4 texColor = texture2D( t2D, vUv ); 2584 #ifdef DECODE_VIDEO_TEXTURE 2585 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 ); 2586 #endif 2587 texColor.rgb *= backgroundIntensity; 2588 gl_FragColor = texColor; 2589 #include <tonemapping_fragment> 2590 #include <colorspace_fragment> 2591}`,w5=`varying vec3 vWorldDirection; 2592#include <common> 2593void main() { 2594 vWorldDirection = transformDirection( position, modelMatrix ); 2595 #include <begin_vertex> 2596 #include <project_vertex> 2597 gl_Position.z = gl_Position.w; 2598}`,E5=`#ifdef ENVMAP_TYPE_CUBE 2599 uniform samplerCube envMap; 2600#elif defined( ENVMAP_TYPE_CUBE_UV ) 2601 uniform sampler2D envMap; 2602#endif 2603uniform float flipEnvMap; 2604uniform float backgroundBlurriness; 2605uniform float backgroundIntensity; 2606uniform mat3 backgroundRotation; 2607varying vec3 vWorldDirection; 2608#include <cube_uv_reflection_fragment> 2609void main() { 2610 #ifdef ENVMAP_TYPE_CUBE 2611 vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 2612 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2613 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2614 #else 2615 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2616 #endif 2617 texColor.rgb *= backgroundIntensity; 2618 gl_FragColor = texColor; 2619 #include <tonemapping_fragment> 2620 #include <colorspace_fragment> 2621}`,T5=`varying vec3 vWorldDirection; 2622#include <common> 2623void main() { 2624 vWorldDirection = transformDirection( position, modelMatrix ); 2625 #include <begin_vertex> 2626 #include <project_vertex> 2627 gl_Position.z = gl_Position.w; 2628}`,A5=`uniform samplerCube tCube; 2629uniform float tFlip; 2630uniform float opacity; 2631varying vec3 vWorldDirection; 2632void main() { 2633 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2634 gl_FragColor = texColor; 2635 gl_FragColor.a *= opacity; 2636 #include <tonemapping_fragment> 2637 #include <colorspace_fragment> 2638}`,b5=`#include <common> 2639#include <batching_pars_vertex> 2640#include <uv_pars_vertex> 2641#include <displacementmap_pars_vertex> 2642#include <morphtarget_pars_vertex> 2643#include <skinning_pars_vertex> 2644#include <logdepthbuf_pars_vertex> 2645#include <clipping_planes_pars_vertex> 2646varying vec2 vHighPrecisionZW; 2647void main() { 2648 #include <uv_vertex> 2649 #include <batching_vertex> 2650 #include <skinbase_vertex> 2651 #include <morphinstance_vertex> 2652 #ifdef USE_DISPLACEMENTMAP 2653 #include <beginnormal_vertex> 2654 #include <morphnormal_vertex> 2655 #include <skinnormal_vertex> 2656 #endif 2657 #include <begin_vertex> 2658 #include <morphtarget_vertex> 2659 #include <skinning_vertex> 2660 #include <displacementmap_vertex> 2661 #include <project_vertex> 2662 #include <logdepthbuf_vertex> 2663 #include <clipping_planes_vertex> 2664 vHighPrecisionZW = gl_Position.zw; 2665}`,R5=`#if DEPTH_PACKING == 3200 2666 uniform float opacity; 2667#endif 2668#include <common> 2669#include <packing> 2670#include <uv_pars_fragment> 2671#include <map_pars_fragment> 2672#include <alphamap_pars_fragment> 2673#include <alphatest_pars_fragment> 2674#include <alphahash_pars_fragment> 2675#include <logdepthbuf_pars_fragment> 2676#include <clipping_planes_pars_fragment> 2677varying vec2 vHighPrecisionZW; 2678void main() { 2679 vec4 diffuseColor = vec4( 1.0 ); 2680 #include <clipping_planes_fragment> 2681 #if DEPTH_PACKING == 3200 2682 diffuseColor.a = opacity; 2683 #endif 2684 #include <map_fragment> 2685 #include <alphamap_fragment> 2686 #include <alphatest_fragment> 2687 #include <alphahash_fragment> 2688 #include <logdepthbuf_fragment> 2689 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 2690 #if DEPTH_PACKING == 3200 2691 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2692 #elif DEPTH_PACKING == 3201 2693 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2694 #elif DEPTH_PACKING == 3202 2695 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 2696 #elif DEPTH_PACKING == 3203 2697 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 2698 #endif 2699}`,C5=`#define DISTANCE 2700varying vec3 vWorldPosition; 2701#include <common> 2702#include <batching_pars_vertex> 2703#include <uv_pars_vertex> 2704#include <displacementmap_pars_vertex> 2705#include <morphtarget_pars_vertex> 2706#include <skinning_pars_vertex> 2707#include <clipping_planes_pars_vertex> 2708void main() { 2709 #include <uv_vertex> 2710 #include <batching_vertex> 2711 #include <skinbase_vertex> 2712 #include <morphinstance_vertex> 2713 #ifdef USE_DISPLACEMENTMAP 2714 #include <beginnormal_vertex> 2715 #include <morphnormal_vertex> 2716 #include <skinnormal_vertex> 2717 #endif 2718 #include <begin_vertex> 2719 #include <morphtarget_vertex> 2720 #include <skinning_vertex> 2721 #include <displacementmap_vertex> 2722 #include <project_vertex> 2723 #include <worldpos_vertex> 2724 #include <clipping_planes_vertex> 2725 vWorldPosition = worldPosition.xyz; 2726}`,P5=`#define DISTANCE 2727uniform vec3 referencePosition; 2728uniform float nearDistance; 2729uniform float farDistance; 2730varying vec3 vWorldPosition; 2731#include <common> 2732#include <packing> 2733#include <uv_pars_fragment> 2734#include <map_pars_fragment> 2735#include <alphamap_pars_fragment> 2736#include <alphatest_pars_fragment> 2737#include <alphahash_pars_fragment> 2738#include <clipping_planes_pars_fragment> 2739void main () { 2740 vec4 diffuseColor = vec4( 1.0 ); 2741 #include <clipping_planes_fragment> 2742 #include <map_fragment> 2743 #include <alphamap_fragment> 2744 #include <alphatest_fragment> 2745 #include <alphahash_fragment> 2746 float dist = length( vWorldPosition - referencePosition ); 2747 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2748 dist = saturate( dist ); 2749 gl_FragColor = packDepthToRGBA( dist ); 2750}`,I5=`varying vec3 vWorldDirection; 2751#include <common> 2752void main() { 2753 vWorldDirection = transformDirection( position, modelMatrix ); 2754 #include <begin_vertex> 2755 #include <project_vertex> 2756}`,L5=`uniform sampler2D tEquirect; 2757varying vec3 vWorldDirection; 2758#include <common> 2759void main() { 2760 vec3 direction = normalize( vWorldDirection ); 2761 vec2 sampleUV = equirectUv( direction ); 2762 gl_FragColor = texture2D( tEquirect, sampleUV ); 2763 #include <tonemapping_fragment> 2764 #include <colorspace_fragment> 2765}`,N5=`uniform float scale; 2766attribute float lineDistance; 2767varying float vLineDistance; 2768#include <common> 2769#include <uv_pars_vertex> 2770#include <color_pars_vertex> 2771#include <fog_pars_vertex> 2772#include <morphtarget_pars_vertex> 2773#include <logdepthbuf_pars_vertex> 2774#include <clipping_planes_pars_vertex> 2775void main() { 2776 vLineDistance = scale * lineDistance; 2777 #include <uv_vertex> 2778 #include <color_vertex> 2779 #include <morphinstance_vertex> 2780 #include <morphcolor_vertex> 2781 #include <begin_vertex> 2782 #include <morphtarget_vertex> 2783 #include <project_vertex> 2784 #include <logdepthbuf_vertex> 2785 #include <clipping_planes_vertex> 2786 #include <fog_vertex> 2787}`,D5=`uniform vec3 diffuse; 2788uniform float opacity; 2789uniform float dashSize; 2790uniform float totalSize; 2791varying float vLineDistance; 2792#include <common> 2793#include <color_pars_fragment> 2794#include <uv_pars_fragment> 2795#include <map_pars_fragment> 2796#include <fog_pars_fragment> 2797#include <logdepthbuf_pars_fragment> 2798#include <clipping_planes_pars_fragment> 2799void main() { 2800 vec4 diffuseColor = vec4( diffuse, opacity ); 2801 #include <clipping_planes_fragment> 2802 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2803 discard; 2804 } 2805 vec3 outgoingLight = vec3( 0.0 ); 2806 #include <logdepthbuf_fragment> 2807 #include <map_fragment> 2808 #include <color_fragment> 2809 outgoingLight = diffuseColor.rgb; 2810 #include <opaque_fragment> 2811 #include <tonemapping_fragment> 2812 #include <colorspace_fragment> 2813 #include <fog_fragment> 2814 #include <premultiplied_alpha_fragment> 2815}`,U5=`#include <common> 2816#include <batching_pars_vertex> 2817#include <uv_pars_vertex> 2818#include <envmap_pars_vertex> 2819#include <color_pars_vertex> 2820#include <fog_pars_vertex> 2821#include <morphtarget_pars_vertex> 2822#include <skinning_pars_vertex> 2823#include <logdepthbuf_pars_vertex> 2824#include <clipping_planes_pars_vertex> 2825void main() { 2826 #include <uv_vertex> 2827 #include <color_vertex> 2828 #include <morphinstance_vertex> 2829 #include <morphcolor_vertex> 2830 #include <batching_vertex> 2831 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2832 #include <beginnormal_vertex> 2833 #include <morphnormal_vertex> 2834 #include <skinbase_vertex> 2835 #include <skinnormal_vertex> 2836 #include <defaultnormal_vertex> 2837 #endif 2838 #include <begin_vertex> 2839 #include <morphtarget_vertex> 2840 #include <skinning_vertex> 2841 #include <project_vertex> 2842 #include <logdepthbuf_vertex> 2843 #include <clipping_planes_vertex> 2844 #include <worldpos_vertex> 2845 #include <envmap_vertex> 2846 #include <fog_vertex> 2847}`,O5=`uniform vec3 diffuse; 2848uniform float opacity; 2849#ifndef FLAT_SHADED 2850 varying vec3 vNormal; 2851#endif 2852#include <common> 2853#include <dithering_pars_fragment> 2854#include <color_pars_fragment> 2855#include <uv_pars_fragment> 2856#include <map_pars_fragment> 2857#include <alphamap_pars_fragment> 2858#include <alphatest_pars_fragment> 2859#include <alphahash_pars_fragment> 2860#include <aomap_pars_fragment> 2861#include <lightmap_pars_fragment> 2862#include <envmap_common_pars_fragment> 2863#include <envmap_pars_fragment> 2864#include <fog_pars_fragment> 2865#include <specularmap_pars_fragment> 2866#include <logdepthbuf_pars_fragment> 2867#include <clipping_planes_pars_fragment> 2868void main() { 2869 vec4 diffuseColor = vec4( diffuse, opacity ); 2870 #include <clipping_planes_fragment> 2871 #include <logdepthbuf_fragment> 2872 #include <map_fragment> 2873 #include <color_fragment> 2874 #include <alphamap_fragment> 2875 #include <alphatest_fragment> 2876 #include <alphahash_fragment> 2877 #include <specularmap_fragment> 2878 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2879 #ifdef USE_LIGHTMAP 2880 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2881 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 2882 #else 2883 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2884 #endif 2885 #include <aomap_fragment> 2886 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2887 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2888 #include <envmap_fragment> 2889 #include <opaque_fragment> 2890 #include <tonemapping_fragment> 2891 #include <colorspace_fragment> 2892 #include <fog_fragment> 2893 #include <premultiplied_alpha_fragment> 2894 #include <dithering_fragment> 2895}`,F5=`#define LAMBERT 2896varying vec3 vViewPosition; 2897#include <common> 2898#include <batching_pars_vertex> 2899#include <uv_pars_vertex> 2900#include <displacementmap_pars_vertex> 2901#include <envmap_pars_vertex> 2902#include <color_pars_vertex> 2903#include <fog_pars_vertex> 2904#include <normal_pars_vertex> 2905#include <morphtarget_pars_vertex> 2906#include <skinning_pars_vertex> 2907#include <shadowmap_pars_vertex> 2908#include <logdepthbuf_pars_vertex> 2909#include <clipping_planes_pars_vertex> 2910void main() { 2911 #include <uv_vertex> 2912 #include <color_vertex> 2913 #include <morphinstance_vertex> 2914 #include <morphcolor_vertex> 2915 #include <batching_vertex> 2916 #include <beginnormal_vertex> 2917 #include <morphnormal_vertex> 2918 #include <skinbase_vertex> 2919 #include <skinnormal_vertex> 2920 #include <defaultnormal_vertex> 2921 #include <normal_vertex> 2922 #include <begin_vertex> 2923 #include <morphtarget_vertex> 2924 #include <skinning_vertex> 2925 #include <displacementmap_vertex> 2926 #include <project_vertex> 2927 #include <logdepthbuf_vertex> 2928 #include <clipping_planes_vertex> 2929 vViewPosition = - mvPosition.xyz; 2930 #include <worldpos_vertex> 2931 #include <envmap_vertex> 2932 #include <shadowmap_vertex> 2933 #include <fog_vertex> 2934}`,k5=`#define LAMBERT 2935uniform vec3 diffuse; 2936uniform vec3 emissive; 2937uniform float opacity; 2938#include <common> 2939#include <packing> 2940#include <dithering_pars_fragment> 2941#include <color_pars_fragment> 2942#include <uv_pars_fragment> 2943#include <map_pars_fragment> 2944#include <alphamap_pars_fragment> 2945#include <alphatest_pars_fragment> 2946#include <alphahash_pars_fragment> 2947#include <aomap_pars_fragment> 2948#include <lightmap_pars_fragment> 2949#include <emissivemap_pars_fragment> 2950#include <envmap_common_pars_fragment> 2951#include <envmap_pars_fragment> 2952#include <fog_pars_fragment> 2953#include <bsdfs> 2954#include <lights_pars_begin> 2955#include <normal_pars_fragment> 2956#include <lights_lambert_pars_fragment> 2957#include <shadowmap_pars_fragment> 2958#include <bumpmap_pars_fragment> 2959#include <normalmap_pars_fragment> 2960#include <specularmap_pars_fragment> 2961#include <logdepthbuf_pars_fragment> 2962#include <clipping_planes_pars_fragment> 2963void main() { 2964 vec4 diffuseColor = vec4( diffuse, opacity ); 2965 #include <clipping_planes_fragment> 2966 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2967 vec3 totalEmissiveRadiance = emissive; 2968 #include <logdepthbuf_fragment> 2969 #include <map_fragment> 2970 #include <color_fragment> 2971 #include <alphamap_fragment> 2972 #include <alphatest_fragment> 2973 #include <alphahash_fragment> 2974 #include <specularmap_fragment> 2975 #include <normal_fragment_begin> 2976 #include <normal_fragment_maps> 2977 #include <emissivemap_fragment> 2978 #include <lights_lambert_fragment> 2979 #include <lights_fragment_begin> 2980 #include <lights_fragment_maps> 2981 #include <lights_fragment_end> 2982 #include <aomap_fragment> 2983 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 2984 #include <envmap_fragment> 2985 #include <opaque_fragment> 2986 #include <tonemapping_fragment> 2987 #include <colorspace_fragment> 2988 #include <fog_fragment> 2989 #include <premultiplied_alpha_fragment> 2990 #include <dithering_fragment> 2991}`,z5=`#define MATCAP 2992varying vec3 vViewPosition; 2993#include <common> 2994#include <batching_pars_vertex> 2995#include <uv_pars_vertex> 2996#include <color_pars_vertex> 2997#include <displacementmap_pars_vertex> 2998#include <fog_pars_vertex> 2999#include <normal_pars_vertex> 3000#include <morphtarget_pars_vertex> 3001#include <skinning_pars_vertex> 3002#include <logdepthbuf_pars_vertex> 3003#include <clipping_planes_pars_vertex> 3004void main() { 3005 #include <uv_vertex> 3006 #include <color_vertex> 3007 #include <morphinstance_vertex> 3008 #include <morphcolor_vertex> 3009 #include <batching_vertex> 3010 #include <beginnormal_vertex> 3011 #include <morphnormal_vertex> 3012 #include <skinbase_vertex> 3013 #include <skinnormal_vertex> 3014 #include <defaultnormal_vertex> 3015 #include <normal_vertex> 3016 #include <begin_vertex> 3017 #include <morphtarget_vertex> 3018 #include <skinning_vertex> 3019 #include <displacementmap_vertex> 3020 #include <project_vertex> 3021 #include <logdepthbuf_vertex> 3022 #include <clipping_planes_vertex> 3023 #include <fog_vertex> 3024 vViewPosition = - mvPosition.xyz; 3025}`,B5=`#define MATCAP 3026uniform vec3 diffuse; 3027uniform float opacity; 3028uniform sampler2D matcap; 3029varying vec3 vViewPosition; 3030#include <common> 3031#include <dithering_pars_fragment> 3032#include <color_pars_fragment> 3033#include <uv_pars_fragment> 3034#include <map_pars_fragment> 3035#include <alphamap_pars_fragment> 3036#include <alphatest_pars_fragment> 3037#include <alphahash_pars_fragment> 3038#include <fog_pars_fragment> 3039#include <normal_pars_fragment> 3040#include <bumpmap_pars_fragment> 3041#include <normalmap_pars_fragment> 3042#include <logdepthbuf_pars_fragment> 3043#include <clipping_planes_pars_fragment> 3044void main() { 3045 ve
3045c4 diffuseColor = vec4( diffuse, opacity ); 3046 #include <clipping_planes_fragment> 3047 #include <logdepthbuf_fragment> 3048 #include <map_fragment> 3049 #include <color_fragment> 3050 #include <alphamap_fragment> 3051 #include <alphatest_fragment> 3052 #include <alphahash_fragment> 3053 #include <normal_fragment_begin> 3054 #include <normal_fragment_maps> 3055 vec3 viewDir = normalize( vViewPosition ); 3056 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3057 vec3 y = cross( viewDir, x ); 3058 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3059 #ifdef USE_MATCAP 3060 vec4 matcapColor = texture2D( matcap, uv ); 3061 #else 3062 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3063 #endif 3064 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3065 #include <opaque_fragment> 3066 #include <tonemapping_fragment> 3067 #include <colorspace_fragment> 3068 #include <fog_fragment> 3069 #include <premultiplied_alpha_fragment> 3070 #include <dithering_fragment> 3071}`,H5=`#define NORMAL 3072#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3073 varying vec3 vViewPosition; 3074#endif 3075#include <common> 3076#include <batching_pars_vertex> 3077#include <uv_pars_vertex> 3078#include <displacementmap_pars_vertex> 3079#include <normal_pars_vertex> 3080#include <morphtarget_pars_vertex> 3081#include <skinning_pars_vertex> 3082#include <logdepthbuf_pars_vertex> 3083#include <clipping_planes_pars_vertex> 3084void main() { 3085 #include <uv_vertex> 3086 #include <batching_vertex> 3087 #include <beginnormal_vertex> 3088 #include <morphinstance_vertex> 3089 #include <morphnormal_vertex> 3090 #include <skinbase_vertex> 3091 #include <skinnormal_vertex> 3092 #include <defaultnormal_vertex> 3093 #include <normal_vertex> 3094 #include <begin_vertex> 3095 #include <morphtarget_vertex> 3096 #include <skinning_vertex> 3097 #include <displacementmap_vertex> 3098 #include <project_vertex> 3099 #include <logdepthbuf_vertex> 3100 #include <clipping_planes_vertex> 3101#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3102 vViewPosition = - mvPosition.xyz; 3103#endif 3104}`,G5=`#define NORMAL 3105uniform float opacity; 3106#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3107 varying vec3 vViewPosition; 3108#endif 3109#include <packing> 3110#include <uv_pars_fragment> 3111#include <normal_pars_fragment> 3112#include <bumpmap_pars_fragment> 3113#include <normalmap_pars_fragment> 3114#include <logdepthbuf_pars_fragment> 3115#include <clipping_planes_pars_fragment> 3116void main() { 3117 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3118 #include <clipping_planes_fragment> 3119 #include <logdepthbuf_fragment> 3120 #include <normal_fragment_begin> 3121 #include <normal_fragment_maps> 3122 gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); 3123 #ifdef OPAQUE 3124 gl_FragColor.a = 1.0; 3125 #endif 3126}`,V5=`#define PHONG 3127varying vec3 vViewPosition; 3128#include <common> 3129#include <batching_pars_vertex> 3130#include <uv_pars_vertex> 3131#include <displacementmap_pars_vertex> 3132#include <envmap_pars_vertex> 3133#include <color_pars_vertex> 3134#include <fog_pars_vertex> 3135#include <normal_pars_vertex> 3136#include <morphtarget_pars_vertex> 3137#include <skinning_pars_vertex> 3138#include <shadowmap_pars_vertex> 3139#include <logdepthbuf_pars_vertex> 3140#include <clipping_planes_pars_vertex> 3141void main() { 3142 #include <uv_vertex> 3143 #include <color_vertex> 3144 #include <morphcolor_vertex> 3145 #include <batching_vertex> 3146 #include <beginnormal_vertex> 3147 #include <morphinstance_vertex> 3148 #include <morphnormal_vertex> 3149 #include <skinbase_vertex> 3150 #include <skinnormal_vertex> 3151 #include <defaultnormal_vertex> 3152 #include <normal_vertex> 3153 #include <begin_vertex> 3154 #include <morphtarget_vertex> 3155 #include <skinning_vertex> 3156 #include <displacementmap_vertex> 3157 #include <project_vertex> 3158 #include <logdepthbuf_vertex> 3159 #include <clipping_planes_vertex> 3160 vViewPosition = - mvPosition.xyz; 3161 #include <worldpos_vertex> 3162 #include <envmap_vertex> 3163 #include <shadowmap_vertex> 3164 #include <fog_vertex> 3165}`,W5=`#define PHONG 3166uniform vec3 diffuse; 3167uniform vec3 emissive; 3168uniform vec3 specular; 3169uniform float shininess; 3170uniform float opacity; 3171#include <common> 3172#include <packing> 3173#include <dithering_pars_fragment> 3174#include <color_pars_fragment> 3175#include <uv_pars_fragment> 3176#include <map_pars_fragment> 3177#include <alphamap_pars_fragment> 3178#include <alphatest_pars_fragment> 3179#include <alphahash_pars_fragment> 3180#include <aomap_pars_fragment> 3181#include <lightmap_pars_fragment> 3182#include <emissivemap_pars_fragment> 3183#include <envmap_common_pars_fragment> 3184#include <envmap_pars_fragment> 3185#include <fog_pars_fragment> 3186#include <bsdfs> 3187#include <lights_pars_begin> 3188#include <normal_pars_fragment> 3189#include <lights_phong_pars_fragment> 3190#include <shadowmap_pars_fragment> 3191#include <bumpmap_pars_fragment> 3192#include <normalmap_pars_fragment> 3193#include <specularmap_pars_fragment> 3194#include <logdepthbuf_pars_fragment> 3195#include <clipping_planes_pars_fragment> 3196void main() { 3197 vec4 diffuseColor = vec4( diffuse, opacity ); 3198 #include <clipping_planes_fragment> 3199 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3200 vec3 totalEmissiveRadiance = emissive; 3201 #include <logdepthbuf_fragment> 3202 #include <map_fragment> 3203 #include <color_fragment> 3204 #include <alphamap_fragment> 3205 #include <alphatest_fragment> 3206 #include <alphahash_fragment> 3207 #include <specularmap_fragment> 3208 #include <normal_fragment_begin> 3209 #include <normal_fragment_maps> 3210 #include <emissivemap_fragment> 3211 #include <lights_phong_fragment> 3212 #include <lights_fragment_begin> 3213 #include <lights_fragment_maps> 3214 #include <lights_fragment_end> 3215 #include <aomap_fragment> 3216 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3217 #include <envmap_fragment> 3218 #include <opaque_fragment> 3219 #include <tonemapping_fragment> 3220 #include <colorspace_fragment> 3221 #include <fog_fragment> 3222 #include <premultiplied_alpha_fragment> 3223 #include <dithering_fragment> 3224}`,X5=`#define STANDARD 3225varying vec3 vViewPosition; 3226#ifdef USE_TRANSMISSION 3227 varying vec3 vWorldPosition; 3228#endif 3229#include <common> 3230#include <batching_pars_vertex> 3231#include <uv_pars_vertex> 3232#include <displacementmap_pars_vertex> 3233#include <color_pars_vertex> 3234#include <fog_pars_vertex> 3235#include <normal_pars_vertex> 3236#include <morphtarget_pars_vertex> 3237#include <skinning_pars_vertex> 3238#include <shadowmap_pars_vertex> 3239#include <logdepthbuf_pars_vertex> 3240#include <clipping_planes_pars_vertex> 3241void main() { 3242 #include <uv_vertex> 3243 #include <color_vertex> 3244 #include <morphinstance_vertex> 3245 #include <morphcolor_vertex> 3246 #include <batching_vertex> 3247 #include <beginnormal_vertex> 3248 #include <morphnormal_vertex> 3249 #include <skinbase_vertex> 3250 #include <skinnormal_vertex> 3251 #include <defaultnormal_vertex> 3252 #include <normal_vertex> 3253 #include <begin_vertex> 3254 #include <morphtarget_vertex> 3255 #include <skinning_vertex> 3256 #include <displacementmap_vertex> 3257 #include <project_vertex> 3258 #include <logdepthbuf_vertex> 3259 #include <clipping_planes_vertex> 3260 vViewPosition = - mvPosition.xyz; 3261 #include <worldpos_vertex> 3262 #include <shadowmap_vertex> 3263 #include <fog_vertex> 3264#ifdef USE_TRANSMISSION 3265 vWorldPosition = worldPosition.xyz; 3266#endif 3267}`,j5=`#define STANDARD 3268#ifdef PHYSICAL 3269 #define IOR 3270 #define USE_SPECULAR 3271#endif 3272uniform vec3 diffuse; 3273uniform vec3 emissive; 3274uniform float roughness; 3275uniform float metalness; 3276uniform float opacity; 3277#ifdef IOR 3278 uniform float ior; 3279#endif 3280#ifdef USE_SPECULAR 3281 uniform float specularIntensity; 3282 uniform vec3 specularColor; 3283 #ifdef USE_SPECULAR_COLORMAP 3284 uniform sampler2D specularColorMap; 3285 #endif 3286 #ifdef USE_SPECULAR_INTENSITYMAP 3287 uniform sampler2D specularIntensityMap; 3288 #endif 3289#endif 3290#ifdef USE_CLEARCOAT 3291 uniform float clearcoat; 3292 uniform float clearcoatRoughness; 3293#endif 3294#ifdef USE_DISPERSION 3295 uniform float dispersion; 3296#endif
3297#ifdef USE_IRIDESCENCE 3298 uniform float iridescence; 3299 uniform float iridescenceIOR; 3300 uniform float iridescenceThicknessMinimum; 3301 uniform float iridescenceThicknessMaximum; 3302#endif 3303#ifdef USE_SHEEN 3304 uniform vec3 sheenColor; 3305 uniform float sheenRoughness; 3306 #ifdef USE_SHEEN_COLORMAP 3307 uniform sampler2D sheenColorMap; 3308 #endif 3309 #ifdef USE_SHEEN_ROUGHNESSMAP 3310 uniform sampler2D sheenRoughnessMap; 3311 #endif 3312#endif 3313#ifdef USE_ANISOTROPY 3314 uniform vec2 anisotropyVector; 3315 #ifdef USE_ANISOTROPYMAP 3316 uniform sampler2D anisotropyMap; 3317 #endif 3318#endif 3319varying vec3 vViewPosition; 3320#include <common> 3321#include <packing> 3322#include <dithering_pars_fragment> 3323#include <color_pars_fragment> 3324#include <uv_pars_fragment> 3325#include <map_pars_fragment> 3326#include <alphamap_pars_fragment> 3327#include <alphatest_pars_fragment> 3328#include <alphahash_pars_fragment> 3329#include <aomap_pars_fragment> 3330#include <lightmap_pars_fragment> 3331#include <emissivemap_pars_fragment> 3332#include <iridescence_fragment> 3333#include <cube_uv_reflection_fragment> 3334#include <envmap_common_pars_fragment> 3335#include <envmap_physical_pars_fragment> 3336#include <fog_pars_fragment> 3337#include <lights_pars_begin> 3338#include <normal_pars_fragment> 3339#include <lights_physical_pars_fragment> 3340#include <transmission_pars_fragment> 3341#include <shadowmap_pars_fragment> 3342#include <bumpmap_pars_fragment> 3343#include <normalmap_pars_fragment> 3344#include <clearcoat_pars_fragment> 3345#include <iridescence_pars_fragment> 3346#include <roughnessmap_pars_fragment> 3347#include <metalnessmap_pars_fragment> 3348#include <logdepthbuf_pars_fragment> 3349#include <clipping_planes_pars_fragment> 3350void main() { 3351 vec4 diffuseColor = vec4( diffuse, opacity ); 3352 #include <clipping_planes_fragment> 3353 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3354 vec3 totalEmissiveRadiance = emissive; 3355 #include <logdepthbuf_fragment> 3356 #include <map_fragment> 3357 #include <color_fragment> 3358 #include <alphamap_fragment> 3359 #include <alphatest_fragment> 3360 #include <alphahash_fragment> 3361 #include <roughnessmap_fragment> 3362 #include <metalnessmap_fragment> 3363 #include <normal_fragment_begin> 3364 #include <normal_fragment_maps> 3365 #include <clearcoat_normal_fragment_begin> 3366 #include <clearcoat_normal_fragment_maps> 3367 #include <emissivemap_fragment> 3368 #include <lights_physical_fragment> 3369 #include <lights_fragment_begin> 3370 #include <lights_fragment_maps> 3371 #include <lights_fragment_end> 3372 #include <aomap_fragment> 3373 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3374 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3375 #include <transmission_fragment> 3376 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3377 #ifdef USE_SHEEN 3378 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 3379 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; 3380 #endif 3381 #ifdef USE_CLEARCOAT 3382 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3383 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3384 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3385 #endif 3386 #include <opaque_fragment> 3387 #include <tonemapping_fragment> 3388 #include <colorspace_fragment> 3389 #include <fog_fragment> 3390 #include <premultiplied_alpha_fragment> 3391 #include <dithering_fragment> 3392}`,Y5=`#define TOON 3393varying vec3 vViewPosition; 3394#include <common> 3395#include <batching_pars_vertex> 3396#include <uv_pars_vertex> 3397#include <displacementmap_pars_vertex> 3398#include <color_pars_vertex> 3399#include <fog_pars_vertex> 3400#include <normal_pars_vertex> 3401#include <morphtarget_pars_vertex> 3402#include <skinning_pars_vertex> 3403#include <shadowmap_pars_vertex> 3404#include <logdepthbuf_pars_vertex> 3405#include <clipping_planes_pars_vertex> 3406void main() { 3407 #include <uv_vertex> 3408 #include <color_vertex> 3409 #include <morphinstance_vertex> 3410 #include <morphcolor_vertex> 3411 #include <batching_vertex> 3412 #include <beginnormal_vertex> 3413 #include <morphnormal_vertex> 3414 #include <skinbase_vertex> 3415 #include <skinnormal_vertex> 3416 #include <defaultnormal_vertex> 3417 #include <normal_vertex> 3418 #include <begin_vertex> 3419 #include <morphtarget_vertex> 3420 #include <skinning_vertex> 3421 #include <displacementmap_vertex> 3422 #include <project_vertex> 3423 #include <logdepthbuf_vertex> 3424 #include <clipping_planes_vertex> 3425 vViewPosition = - mvPosition.xyz; 3426 #include <worldpos_vertex> 3427 #include <shadowmap_vertex> 3428 #include <fog_vertex> 3429}`,q5=`#define TOON 3430uniform vec3 diffuse; 3431uniform vec3 emissive; 3432uniform float opacity; 3433#include <common> 3434#include <packing> 3435#include <dithering_pars_fragment> 3436#include <color_pars_fragment> 3437#include <uv_pars_fragment> 3438#include <map_pars_fragment> 3439#include <alphamap_pars_fragment> 3440#include <alphatest_pars_fragment> 3441#include <alphahash_pars_fragment> 3442#include <aomap_pars_fragment> 3443#include <lightmap_pars_fragment> 3444#include <emissivemap_pars_fragment> 3445#include <gradientmap_pars_fragment> 3446#include <fog_pars_fragment> 3447#include <bsdfs> 3448#include <lights_pars_begin> 3449#include <normal_pars_fragment> 3450#include <lights_toon_pars_fragment> 3451#include <shadowmap_pars_fragment> 3452#include <bumpmap_pars_fragment> 3453#include <normalmap_pars_fragment> 3454#include <logdepthbuf_pars_fragment> 3455#include <clipping_planes_pars_fragment> 3456void main() { 3457 vec4 diffuseColor = vec4( diffuse, opacity ); 3458 #include <clipping_planes_fragment> 3459 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3460 vec3 totalEmissiveRadiance = emissive; 3461 #include <logdepthbuf_fragment> 3462 #include <map_fragment> 3463 #include <color_fragment> 3464 #include <alphamap_fragment> 3465 #include <alphatest_fragment> 3466 #include <alphahash_fragment> 3467 #include <normal_fragment_begin> 3468 #include <normal_fragment_maps> 3469 #include <emissivemap_fragment> 3470 #include <lights_toon_fragment> 3471 #include <lights_fragment_begin> 3472 #include <lights_fragment_maps> 3473 #include <lights_fragment_end> 3474 #include <aomap_fragment> 3475 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3476 #include <opaque_fragment> 3477 #include <tonemapping_fragment> 3478 #include <colorspace_fragment> 3479 #include <fog_fragment> 3480 #include <premultiplied_alpha_fragment> 3481 #include <dithering_fragment> 3482}`,Z5=`uniform float size; 3483uniform float scale; 3484#include <common> 3485#include <color_pars_vertex> 3486#include <fog_pars_vertex> 3487#include <morphtarget_pars_vertex> 3488#include <logdepthbuf_pars_vertex> 3489#include <clipping_planes_pars_vertex> 3490#ifdef USE_POINTS_UV 3491 varying vec2 vUv; 3492 uniform mat3 uvTransform; 3493#endif 3494void main() { 3495 #ifdef USE_POINTS_UV 3496 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3497 #endif 3498 #include <color_vertex> 3499 #include <morphinstance_vertex> 3500 #include <morphcolor_vertex> 3501 #include <begin_vertex> 3502 #include <morphtarget_vertex> 3503 #include <project_vertex> 3504 gl_PointSize = size; 3505 #ifdef USE_SIZEATTENUATION 3506 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3507 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3508 #endif 3509 #include <logdepthbuf_vertex> 3510 #include <clipping_planes_vertex> 3511 #include <worldpos_vertex> 3512 #include <fog_vertex> 3513}`,K5=`uniform vec3 diffuse; 3514uniform float opacity; 3515#include <common> 3516#include <color_pars_fragment> 3517#include <map_particle_pars_fragment> 3518#include <alphatest_pars_fragment> 3519#include <alphahash_pars_fragment> 3520#include <fog_pars_fragment> 3521#include <logdepthbuf_pars_fragment> 3522#include <clipping_planes_pars_fragment> 3523void main() { 3524 vec4 diffuseColor = vec4( diffuse, opacity ); 3525 #include <clipping_planes_fragment> 3526 vec3 outgoingLight = vec3( 0.0 ); 3527 #include <logdepthbuf_fragment> 3528 #include <map_particle_fragment> 3529 #include <color_fragment> 3530 #include <alphatest_fragment> 3531 #include <alphahash_fragment> 3532 outgoingLight = diffuseColor.rgb; 3533 #include <opaque_fragment> 3534 #include <tonemapping_fragment> 3535 #include <colorspace_fragment> 3536 #include <fog_fragment> 3537 #include <premultiplied_alpha_fragment> 3538}`,Q5=`#include <common> 3539#include <batching_pars_vertex> 3540#include <fog_pars_vertex> 3541#include <morphtarget_pars_vertex> 3542#include <skinning_pars_vertex> 3543#include <logdepthbuf_pars_vertex> 3544#include <shadowmap_pars_vertex> 3545void main() { 3546 #include <batching_vertex> 3547 #include <beginnormal_vertex> 3548 #include <morphinstance_vertex> 3549 #include <morphnormal_vertex> 3550 #include <skinbase_vertex> 3551 #include <skinnormal_vertex> 3552 #include <defaultnormal_vertex> 3553 #include <begin_vertex> 3554 #include <morphtarget_vertex> 3555 #include <skinning_vertex> 3556 #include <project_vertex> 3557 #include <logdepthbuf_vertex> 3558 #include <worldpos_vertex> 3559 #include <shadowmap_vertex> 3560 #include <fog_vertex> 3561}`,$5=`uniform vec3 color; 3562uniform float opacity; 3563#include <common> 3564#include <packing> 3565#include <fog_pars_fragment> 3566#include <bsdfs> 3567#include <lights_pars_begin> 3568#include <logdepthbuf_pars_fragment> 3569#include <shadowmap_pars_fragment> 3570#include <shadowmask_pars_fragment> 3571void main() { 3572 #include <logdepthbuf_fragment> 3573 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3574 #include <tonemapping_fragment> 3575 #include <colorspace_fragment> 3576 #include <fog_fragment> 3577}`,J5=`uniform float rotation; 3578uniform vec2 center; 3579#include <common> 3580#include <uv_pars_vertex> 3581#include <fog_pars_vertex> 3582#include <logdepthbuf_pars_vertex> 3583#include <clipping_planes_pars_vertex> 3584void main() { 3585 #include <uv_vertex> 3586 vec4 mvPosition = modelViewMatrix[ 3 ]; 3587 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3588 #ifndef USE_SIZEATTENUATION 3589 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3590 if ( isPerspective ) scale *= - mvPosition.z; 3591 #endif 3592 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3593 vec2 rotatedPosition; 3594 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3595 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3596 mvPosition.xy += rotatedPosition; 3597 gl_Position = projectionMatrix * mvPosition; 3598 #include <logdepthbuf_vertex> 3599 #include <clipping_planes_vertex> 3600 #include <fog_vertex> 3601}`,eO=`uniform vec3 diffuse; 3602uniform float opacity; 3603#include <common> 3604#include <uv_pars_fragment> 3605#include <map_pars_fragment> 3606#include <alphamap_pars_fragment> 3607#include <alphatest_pars_fragment> 3608#include <alphahash_pars_fragment> 3609#include <fog_pars_fragment> 3610#include <logdepthbuf_pars_fragment> 3611#include <clipping_planes_pars_fragment> 3612void main() { 3613 vec4 diffuseColor = vec4( diffuse, opacity ); 3614 #include <clipping_planes_fragment> 3615 vec3 outgoingLight = vec3( 0.0 ); 3616 #include <logdepthbuf_fragment> 3617 #include <map_fragment> 3618 #include <alphamap_fragment> 3619 #include <alphatest_fragment> 3620 #include <alphahash_fragment> 3621 outgoingLight = diffuseColor.rgb; 3622 #include <opaque_fragment> 3623 #include <tonemapping_fragment> 3624 #include <colorspace_fragment> 3625 #include <fog_fragment> 3626}
3626`,Lt={alphahash_fragment:MD,alphahash_pars_fragment:wD,alphamap_fragment:ED,alphamap_pars_fragment:TD,alphatest_fragment:AD,alphatest_pars_fragment:bD,aomap_fragment:RD,aomap_pars_fragment:CD,batching_pars_vertex:PD,batching_vertex:ID,begin_vertex:LD,beginnormal_vertex:ND,bsdfs:DD,iridescence_fragment:UD,bumpmap_pars_fragment:OD,clipping_planes_fragment:FD,clipping_planes_pars_fragment:kD,clipping_planes_pars_vertex:zD,clipping_planes_vertex:BD,color_fragment:HD,color_pars_fragment:GD,color_pars_vertex:VD,color_vertex:WD,common:XD,cube_uv_reflection_fragment:jD,defaultnormal_vertex:YD,displacementmap_pars_vertex:qD,displacementmap_vertex:ZD,emissivemap_fragment:KD,emissivemap_pars_fragment:QD,colorspace_fragment:$D,colorspace_pars_fragment:JD,envmap_fragment:eU,envmap_common_pars_fragment:tU,envmap_pars_fragment:nU,envmap_pars_vertex:iU,envmap_physical_pars_fragment:pU,envmap_vertex:rU,fog_vertex:sU,fog_pars_vertex:oU,fog_fragment:aU,fog_pars_fragment:lU,gradientmap_pars_fragment:cU,lightmap_pars_fragment:uU,lights_lambert_fragment:fU,lights_lambert_pars_fragment:hU,lights_pars_begin:dU,lights_toon_fragment:mU,lights_toon_pars_fragment:gU,lights_phong_fragment:vU,lights_phong_pars_fragment:yU,lights_physical_fragment:_U,lights_physical_pars_fragment:xU,lights_fragment_begin:SU,lights_fragment_maps:MU,lights_fragment_end:wU,logdepthbuf_fragment:EU,logdepthbuf_pars_fragment:TU,logdepthbuf_pars_vertex:AU,logdepthbuf_vertex:bU,map_fragment:RU,map_pars_fragment:CU,map_particle_fragment:PU,map_particle_pars_fragment:IU,metalnessmap_fragment:LU,metalnessmap_pars_fragment:NU,morphinstance_vertex:DU,morphcolor_vertex:UU,morphnormal_vertex:OU,morphtarget_pars_vertex:FU,morphtarget_vertex:kU,normal_fragment_begin:zU,normal_fragment_maps:BU,normal_pars_fragment:HU,normal_pars_vertex:GU,normal_vertex:VU,normalmap_pars_fragment:WU,clearcoat_normal_fragment_begin:XU,clearcoat_normal_fragment_maps:jU,clearcoat_pars_fragment:YU,iridescence_pars_fragment:qU,opaque_fragment:ZU,packing:KU,premultiplied_alpha_fragment:QU,project_vertex:$U,dithering_fragment:JU,dithering_pars_fragment:e5,roughnessmap_fragment:t5,roughnessmap_pars_fragment:n5,shadowmap_pars_fragment:i5,shadowmap_pars_vertex:r5,shadowmap_vertex:s5,shadowmask_pars_fragment:o5,skinbase_vertex:a5,skinning_pars_vertex:l5,skinning_vertex:c5,skinnormal_vertex:u5,specularmap_fragment:f5,specularmap_pars_fragment:h5,tonemapping_fragment:d5,tonemapping_pars_fragment:p5,transmission_fragment:m5,transmission_pars_fragment:g5,uv_pars_fragment:v5,uv_pars_vertex:y5,uv_vertex:_5,worldpos_vertex:x5,background_vert:S5,background_frag:M5,backgroundCube_vert:w5,backgroundCube_frag:E5,cube_vert:T5,cube_frag:A5,depth_vert:b5,depth_frag:R5,distanceRGBA_vert:C5,distanceRGBA_frag:P5,equirect_vert:I5,equirect_frag:L5,linedashed_vert:N5,linedashed_frag:D5,meshbasic_vert:U5,meshbasic_frag:O5,meshlambert_vert:F5,meshlambert_frag:k5,meshmatcap_vert:z5,meshmatcap_frag:B5,meshnormal_vert:H5,meshnormal_frag:G5,meshphong_vert:V5,meshphong_frag:W5,meshphysical_vert:X5,meshphysical_frag:j5,meshtoon_vert:Y5,meshtoon_frag:q5,points_vert:Z5,points_frag:K5,shadow_vert:Q5,shadow_frag:$5,sprite_vert:J5,sprite_frag:eO},Xe={common:{diffuse:{value:new rt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Rt}},envmap:{envMap:{value:null},envMapRotation:{value:new Rt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Rt},normalScale:{value:new be(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rt(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 rt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0},uvTransform:{value:new Rt}},sprite:{diffuse:{value:new rt(16777215)},opacity:{value:1},center:{value:new be(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}}},Xr={basic:{uniforms:Ei([Xe.common,Xe.specularmap,Xe.envmap,Xe.aomap,Xe.lightmap,Xe.fog]),vertexShader:Lt.meshbasic_vert,fragmentShader:Lt.meshbasic_frag},lambert:{uniforms:Ei([Xe.common,Xe.specularmap,Xe.envmap,Xe.aomap,Xe.lightmap,Xe.emissivemap,Xe.bumpmap,Xe.normalmap,Xe.dis
3626placementmap,Xe.fog,Xe.lights,{emissive:{value:new rt(0)}}]),vertexShader:Lt.meshlambert_vert,fragmentShader:Lt.meshlambert_frag},phong:{uniforms:Ei([Xe.common,Xe.specularmap,Xe.envmap,Xe.aomap,Xe.lightmap,Xe.emissivemap,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,Xe.fog,Xe.lights,{emissive:{value:new rt(0)},specular:{value:new rt(1118481)},shininess:{value:30}}]),vertexShader:Lt.meshphong_vert,fragmentShader:Lt.meshphong_frag},standard:{uniforms:Ei([Xe.common,Xe.envmap,Xe.aomap,Xe.lightmap,Xe.emissivemap,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,Xe.roughnessmap,Xe.metalnessmap,Xe.fog,Xe.lights,{emissive:{value:new rt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Lt.meshphysical_vert,fragmentShader:Lt.meshphysical_frag},toon:{uniforms:Ei([Xe.common,Xe.aomap,Xe.lightmap,Xe.emissivemap,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,Xe.gradientmap,Xe.fog,Xe.lights,{emissive:{value:new rt(0)}}]),vertexShader:Lt.meshtoon_vert,fragmentShader:Lt.meshtoon_frag},matcap:{uniforms:Ei([Xe.common,Xe.bumpmap,Xe.normalmap,Xe.dis
vendor: 5,288 bytes, line 3626
3626placementmap,Xe.fog,{matcap:{value:null}}]),vertexShader:Lt.meshmatcap_vert,fragmentShader:Lt.meshmatcap_frag},points:{uniforms:Ei([Xe.points,Xe.fog]),vertexShader:Lt.points_vert,fragmentShader:Lt.points_frag},dashed:{uniforms:Ei([Xe.common,Xe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Lt.linedashed_vert,fragmentShader:Lt.linedashed_frag},depth:{uniforms:Ei([Xe.common,Xe.displacementmap]),vertexShader:Lt.depth_vert,fragmentShader:Lt.depth_frag},normal:{uniforms:Ei([Xe.common,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,{opacity:{value:1}}]),vertexShader:Lt.meshnormal_vert,fragmentShader:Lt.meshnormal_frag},sprite:{uniforms:Ei([Xe.sprite,Xe.fog]),vertexShader:Lt.sprite_vert,fragmentShader:Lt.sprite_frag},background:{uniforms:{uvTransform:{value:new Rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Lt.background_vert,fragmentShader:Lt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Rt}},vertexShader:Lt.backgroundCube_vert,fragmentShader:Lt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Lt.cube_vert,fragmentShader:Lt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Lt.equirect_vert,fragmentShader:Lt.equirect_frag},distanceRGBA:{uniforms:Ei([Xe.common,Xe.displacementmap,{referencePosition:{value:new k},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Lt.distanceRGBA_vert,fragmentShader:Lt.distanceRGBA_frag},shadow:{uniforms:Ei([Xe.lights,Xe.fog,{color:{value:new rt(0)},opacity:{value:1}}]),vertexShader:Lt.shadow_vert,fragmentShader:Lt.shadow_frag}};Xr.physical={uniforms:Ei([Xr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Rt},clearcoatNormalScale:{value:new be(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Rt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Rt},sheen:{value:0},sheenColor:{value:new rt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Rt},transmissionSamplerSize:{value:new be},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Rt},attenuationDistance:{value:0},attenuationColor:{value:new rt(0)},specularColor:{value:new rt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Rt},anisotropyVector:{value:new be},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Rt}}]),vertexShader:Lt.meshphysical_vert,fragmentShader:Lt.meshphysical_frag};const Kd={r:0,b:0,g:0},fa=new Ii,tO=new mt;function nO(n,e,t,i,r,s,o){const a=new rt(0);let u=s===!0?0:1,f,h,d=null,p=0,m=null;function y(S){let M=S.isScene===!0?S.background:null;return M&&M.isTexture&&(M=(S.backgroundBlurriness>0?t:e).get(M)),M}function w(S){let M=!1;const T=y(S);T===null?v(a,u):T&&T.isColor&&(v(T,1),M=!0);const I=n.xr.getEnvironmentBlendMode();I==="additive"?i.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||M)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function _(S,M){const T=y(M);T&&(T.isCubeTexture||T.mapping===kc)?(h===void 0&&(h=new xn(new nl(1,1,1),new qi({name:"BackgroundCubeMaterial",uniforms:bc(Xr.backgroundCube.uniforms),vertexShader:Xr.backgroundCube.vertexShader,fragmentShader:Xr.backgroundCube.fragmentShader,side:Ci,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(I,C,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),fa.copy(M.backgroundRotation),fa.x*=-1,fa.y*=-1,fa.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(fa.y*=-1,fa.z*=-1),h.material.uniforms.envMap.value=T,h.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(tO.makeRotationFromEuler(fa)),h.material.toneMapped=Kt.getTransfer(T.colorSpace)!==sn,(d!==T||p!==T.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,d=T,p=T.version,m=n.toneMapping),h.layers.enableAll(),S.unshift(h,h.geometry,h.material,0,0,null)):T&&T.isTexture&&(f===void 0&&(f=new xn(new Zo(2,2),new qi({name:"Backgroun
3626dMaterial",uniforms:bc(Xr.background.uniforms),vertexShader:Xr.background.vertexShader,fragmentShader:Xr.background.fragmentShader,side:Zs,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),Object.defineProperty(f.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(f)),f.material.uniforms.t2D.value=T,f.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,f.material.toneMapped=Kt.getTransfer(T.colorSpace)!==sn,T.matrixAutoUpdate===!0&&T.updateMatrix(),f.material.uniforms.uvTransform.value.copy(T.matrix),(d!==T||p!==T.version||m!==n.toneMapping)&&(f.material.needsUpdate=!0,d=T,p=T.version,m=n.toneMapping),f.layers.enableAll(),S.unshift(f,f.geometry,f.material,0,0,null))}function v(S,M){S.getRGB(Kd,vR(n)),i.buffers.color.setClear(Kd.r,Kd.g,Kd.b,M,o)}return{getClearColor:function(){return a},setClearColor:function(S,M=1){a.set(S),u=M,v(a,u)},getClearAlpha:function(){return u},setClearAlpha:function(S){u=S,v(a,u)},render:w,addToRenderList:_}}function iO(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null);let s=r,o=!1;function a(A,R,j,Y,Z){let ae=!1;const Q=d(Y,j,R);s!==Q&&(s=Q,f(s.object)),ae=m(A,Y,j,Z),ae&&y(A,Y,j,Z),Z!==null&&e.update(Z,n.ELEMENT_ARRAY_BUFFER),(ae||o)&&(o=!1,T(A,R,j,Y),Z!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(Z).buffer))}function u(){return n.createVertexArray()}function f(A){return n.bindVertexArray(A)}function h(A){return n.deleteVertexArray(A)}function d(A,R,j){const Y=j.wireframe===!0;let Z=i[A.id];Z===void 0&&(Z={},i[A.id]=Z);let ae=Z[R.id];ae===void 0&&(ae={},Z[R.id]=ae);let Q=ae[Y];return Q===void 0&&(Q=p(u()),ae[Y]=Q),Q}function p(A){const R=[],j=[],Y=[];for(let Z=0;Z<t;Z++)R[Z]=0,j[Z]=0,Y[Z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:j,attributeDivisors:Y,object:A,attributes:{},index:null}}function m(A,R,j,Y){const Z=s.attributes,ae=R.attributes;let Q=0;const pe=j.getAttributes();for(const z in pe)if(pe[z].location>=0){const $=Z[z];let le=ae[z];if(le===void 0&&(z==="instanceMatrix"&&A.instanceMatrix&&(le=A.instanceMatrix),z==="instanceColor"&&A.instanceColor&&(le=A.instanceColor)),$===void 0||$.attribute!==le||le&&$.data!==le.data)return!0;Q++}return s.attributesNum!==Q||s.index!==Y}function y(A,R,j,Y){const Z={},ae=R.attributes;let Q=0;const pe=j.getAttributes();for(const z in pe)if(pe[z].location>=0){let $=ae[z];$===void 0&&(z==="instanceMatrix"&&A.instanceMatrix&&($=A.instanceMatrix),z==="instanceColor"&&A.instanceColor&&($=A.instanceColor));const le={};le.attribute=$,$&&$.data&&(le.data=$.data),Z[z]=le,Q++}s.attributes=Z,s.attributesNum=Q,s.index=Y}function w(){const A=s.newAttributes;for(let R=0,j=A.length;R<j;R++)A[R]=0}function _(A){v(A,0)}function v(A,R){const j=s.newAttributes,Y=s.enabledAttributes,Z=s.attributeDivisors;j[A]=1,Y[A]===0&&(n.enableVertexAttribArray(A),Y[A]=1),Z[A]!==R&&(n.vertexAttribDivisor(A,R),Z[A]=R)}function S(){const A=s.newAttributes,R=s.enabledAttributes;for(let j=0,Y=R.length;j<Y;j++)R[j]!==A[j]&&(n.disableVertexAttribArray(j),R[j]=0)}function M(A,R,j,Y,Z,ae,Q){Q===!0?n.vertexAttribIPointer(A,R,j,Z,ae):n.vertexAttribPointer(A,R,j,Y,Z,ae)}function T(A,R,j,Y){w();const Z=Y.attributes,ae=j.getAttributes(),Q=R.defaultAttributeValues;for(const pe in ae){const z=ae[pe];if(z.location>=0){let ie=Z[pe];if(ie===void 0&&(pe==="instanceMatrix"&&A.instanceMatrix&&(ie=A.instanceMatrix),pe==="instanceColor"&&A.instanceColor&&(ie=A.instanceColor)),ie!==void 0){const $=ie.normalized,le=ie.itemSize,ye=e.get(ie);if(ye===void 0)continue;const De=ye.buffer,ue=ye.type,Me=ye.bytesPerElement,we=ue===n.INT||ue===n.UNSIGNED_INT||ie.gpuType===ih;if(ie.isInterleavedBufferAttribute){const Ce=ie.data,ct=Ce.stride,gt=ie.offset;if(Ce.isInstancedInterleavedBuffer){for(let We=0;We<z.locationSize;We++)v(z.location+We,Ce.meshPerAttribute);A.isInstancedMesh!==!0&&Y._maxInstanceCount===void 0&&(Y._maxInstanceCount=Ce.meshPerAttribute*Ce.count)}else for(let We=0;We<z.locationSize;We++)_(z.location+We);n.bindBuffer(n.ARRAY_BUFFER,De);for(let We=0;We<z.locationSize;We++)M(z.location+We,le/z.locationSize,ue,$,ct*Me,(gt+le/z.locationSize*We)*Me,we)}else{if(ie.isInstancedBufferAttribute){for(let Ce=0;Ce<z.locationSize;Ce++)v(z.location+Ce,ie.meshPerAttribute);A.isInstancedMesh!==!0&&Y._maxInstanceCount===void 0&&(Y._maxInstanceCount=ie.meshPerAttribute*ie.count)}else for(let Ce=0;Ce<z.locationSize;Ce++)_(z.location+Ce);n.bindBuffer(n.ARRAY_BUFFER,De);for(let Ce=0;Ce<z.locationSize;Ce++)M(z.location+Ce,le/z.locationSize,ue,$,le*Me,le/z.locationSize*Ce*Me,we)}}else if(Q!==void 0){const $=Q[pe];if($!==void 0)switch($.length){case 2:n.vertexAttrib2fv(z.location,$);break;case 3:n.vertexAttrib3fv(z.location,$);break;case 4:n.vertexAttrib4fv(z.location,$);break;default:n.vertexAttrib1fv(z.location,$)}}}}S()}function I(){N();for(const A in i){const R=i[A];for(const j in R){const Y=R[j];for(const Z in Y)h(Y[Z].object),delete Y[Z];delete R[j]}delete i[A]}}function C(A){if(i[A.id]===void 0)return;const R=i[A.id];for(const j in R){const Y=R[j];for(const Z in Y)h(Y[Z].object),delete Y[Z];delete R[j]}delete i[A.id]}function L(A){for(const R in i){const j=i[R];if(j[A.id]===void 0)continue;const Y=j[A.id];for(const Z in Y)h(Y[Z].object),delete Y[Z];delete j[A.id]}}function N(){B(),o=!0,s!==r&&(s=r,f(s.object))}function B(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:a,reset:N,resetDefaultState:B,dispose:I,releaseStatesOfGeometry:C,releaseStatesOfProgram:L,initAttributes:w,enableAttribute:_,disableUnusedAttributes:S}}function rO(n,e,t){let i;function r(f){i=f}function s(f,h){n.drawArrays(i,f,h),t.update(h,i,1)}function o(f,h,d){d!==0&&(n.drawArraysInstanced(i,f,h,d),t.update(h,i,d))}function a(f,h,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,f,0,h,0,d);let m=0;for(let y=0;y<d;y++)m+=h[y];t.update(m,i,1)}function u(f,h,d,p){if(d===0)return;const m=e.get("WEBGL_multi_draw");if(m===null)for(let y=0;y<f.length;y++)o(f[y],h[y],p[y]);
vendor: 4,110 bytes, line 3626
3626else{m.multiDrawArraysInstancedWEBGL(i,f,0,h,0,p,0,d);let y=0;for(let w=0;w<d;w++)y+=h[w];for(let w=0;w<p.length;w++)t.update(y,i,p[w])}}this.setMode=r,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=u}function sO(n,e,t,i){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const L=e.get("EXT_texture_filter_anisotropic");r=n.getParameter(L.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(L){return!(L!==Ln&&i.convert(L)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(L){const N=L===ei&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(L!==Yi&&i.convert(L)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&L!==_n&&!N)}function u(L){if(L==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";L="mediump"}return L==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let f=t.precision!==void 0?t.precision:"highp";const h=u(f);h!==f&&(console.warn("THREE.WebGLRenderer:",f,"not supported, using",h,"instead."),f=h);const d=t.logarithmicDepthBuffer===!0,p=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control");if(p===!0){const L=e.get("EXT_clip_control");L.clipControlEXT(L.LOWER_LEFT_EXT,L.ZERO_TO_ONE_EXT)}const m=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),y=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),w=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),v=n.getParameter(n.MAX_VERTEX_ATTRIBS),S=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),M=n.getParameter(n.MAX_VARYING_VECTORS),T=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),I=y>0,C=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:u,textureFormatReadable:o,textureTypeReadable:a,precision:f,logarithmicDepthBuffer:d,reverseDepthBuffer:p,maxTextures:m,maxVertexTextures:y,maxTextureSize:w,maxCubemapSize:_,maxAttributes:v,maxVertexUniforms:S,maxVaryings:M,maxFragmentUniforms:T,vertexTextures:I,maxSamples:C}}function oO(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new So,a=new Rt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const m=d.length!==0||p||i!==0||r;return r=p,i=d.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,p){t=h(d,p,0)},this.setState=function(d,p,m){const y=d.clippingPlanes,w=d.clipIntersection,_=d.clipShadows,v=n.get(d);if(!r||y===null||y.length===0||s&&!_)s?h(null):f();else{const S=s?0:i,M=S*4;let T=v.clippingState||null;u.value=T,T=h(y,p,M,m);for(let I=0;I!==M;++I)T[I]=t[I];v.clippingState=T,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=S}};function f(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,m,y){const w=d!==null?d.length:0;let _=null;if(w!==0){if(_=u.value,y!==!0||_===null){const v=m+w*4,S=p.matrixWorldInverse;a.getNormalMatrix(S),(_===null||_.length<v)&&(_=new Float32Array(v));for(let M=0,T=m;M!==w;++M,T+=4)o.copy(d[M]).applyMatrix4(S,a),o.normal.toArray(_,T),_[T+3]=o.constant}u.value=_,u.needsUpdate=!0}return e.numPlanes=w,e.numIntersection=0,_}}function aO(n){let e=new WeakMap;function t(o,a){return a===Ec?o.mapping=_s:a===bf&&(o.mapping=Ho),o}function i(o){if(o&&o.isTexture){const a=o.mapping;if(a===Ec||a===bf)if(e.has(o)){const u=e.get(o).texture;return t(u,o.mapping)}else{const u=o.image;if(u&&u.height>0){const f=new gS(u.height);return f.fromEquirectangularTexture(n,o),e.set(o,f),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const u=e.get(a);u!==void 0&&(e.delete(a),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Bc extends ah{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
3626phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=f*this.view.offsetX,o=s+f*this.view.width,a-=h*this.view.offsetY,u=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,u,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const sc=4,uE=[.125,.215,.35,.446,.526,.582],wa=20,ly=new Bc,fE=new rt;let cy=null,uy=0,fy=0,hy=!1;const Ma=(1+Math.sqrt(5))/2,Ul=1/Ma,hE=[new k(-Ma,Ul,0),new k(Ma,Ul,0),new k(-Ul,0,Ma),new k(Ul,0,Ma),new k(0,Ma,-Ul),new k(0,Ma,Ul),new k(-1,1,-1),new k(1,1,-1),new k(-1,1,1),new k(1,1,1)];class V_{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){cy=this._renderer.getRenderTarget(),uy=this._renderer.getActiveCubeFace(),fy=this._renderer.getActiveMipmapLevel(),hy=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=mE(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=pE(),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(cy,uy,fy),this._renderer.xr.enabled=hy,e.scissorTest=!1,Qd(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===_s||e.mapping===Ho?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),cy=this._renderer.getRenderTarget(),uy=this._renderer.getActiveCubeFace(),fy=this._renderer.getActiveMipmapLevel(),hy=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:Qt,minFilter:Qt,generateMipmaps:!1,type:ei,format:Ln,colorSpace:Cr,depthBuffer:!1},r=dE(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=dE(e,t,i);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}
vendor: 5,734 bytes, lines 3626-3701
3626=lO(s)),this._blurMaterial=cO(s,e,t)}return r}_compileMaterial(e){const t=new xn(this._lodPlanes[0],e);this._renderer.compile(t,ly)}_sceneToCubeUV(e,t,i,r){const a=new $n(90,1,t,i),u=[1,-1,1,1,1,1],f=[1,1,1,-1,-1,-1],h=this._renderer,d=h.autoClear,p=h.toneMapping;h.getClearColor(fE),h.toneMapping=vs,h.autoClear=!1;const m=new $s({name:"PMREM.Background",side:Ci,depthWrite:!1,depthTest:!1}),y=new xn(new nl,m);let w=!1;const _=e.background;_?_.isColor&&(m.color.copy(_),e.background=null,w=!0):(m.color.copy(fE),w=!0);for(let v=0;v<6;v++){const S=v%3;S===0?(a.up.set(0,u[v],0),a.lookAt(f[v],0,0)):S===1?(a.up.set(0,0,u[v]),a.lookAt(0,f[v],0)):(a.up.set(0,u[v],0),a.lookAt(0,0,f[v]));const M=this._cubeSize;Qd(r,S*M,v>2?M:0,M,M),h.setRenderTarget(r),w&&h.render(y,a),h.render(e,a)}y.geometry.dispose(),y.material.dispose(),h.toneMapping=p,h.autoClear=d,e.background=_}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===_s||e.mapping===Ho;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=mE()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=pE());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new xn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const u=this._cubeSize;Qd(t,0,0,3*u,2*u),i.setRenderTarget(t),i.render(o,ly)}_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=hE[(r-s-1)%hE.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 u=this._renderer,f=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,d=new xn(this._lodPlanes[r],f),p=f.uniforms,m=this._sizeLods[i]-1,y=isFinite(s)?Math.PI/(2*m):2*Math.PI/(2*wa-1),w=s/y,_=isFinite(s)?1+Math.floor(h*w):wa;_>wa&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${wa}`);const v=[];let S=0;for(let L=0;L<wa;++L){const N=L/w,B=Math.exp(-N*N/2);v.push(B),L===0?S+=B:L<_&&(S+=2*B)}for(let L=0;L<v.length;L++)v[L]=v[L]/S;p.envMap.value=e.texture,p.samples.value=_,p.weights.value=v,p.latitudinal.value=o==="latitudinal",a&&(p.poleAxis.value=a);const{_lodMax:M}=this;p.dTheta.value=y,p.mipInt.value=M-i;const T=this._sizeLods[r],I=3*T*(r>M-sc?r-M+sc:0),C=4*(this._cubeSize-T);Qd(t,I,C,3*T,2*T),u.setRenderTarget(t),u.render(d,ly)}}function lO(n){const e=[],t=[],i=[];let r=n;const s=n-sc+1+uE.length;for(let o=0;o<s;o++){const a=Math.pow(2,r);t.push(a);let u=1/a;o>n-sc?u=uE[o-n+sc-1]:o===0&&(u=0),i.push(u);const f=1/(a-2),h=-f,d=1+f,p=[h,h,d,h,d,d,h,h,d,d,h,d],m=6,y=6,w=3,_=2,v=1,S=new Float32Array(w*y*m),M=new Float32Array(_*y*m),T=new Float32Array(v*y*m);for(let C=0;C<m;C++){const L=C%3*2/3-1,N=C>2?0:-1,B=[L,N,0,L+2/3,N,0,L+2/3,N+1,0,L,N,0,L+2/3,N+1,0,L,N+1,0];S.set(B,w*y*C),M.set(p,_*y*C);const A=[C,C,C,C,C,C];T.set(A,v*y*C)}const I=new Pt;I.setAttribute("position",new Jt(S,w)),I.setAttribute("uv",new Jt(M,_)),I.setAttribute("faceIndex",new Jt(T,v)),e.push(I),r>sc&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function dE(n,e,t){const i=new cr(n,e,t);return i.texture.mapping=kc,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Qd(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function cO(n,e,t){const i=new Float32Array(wa),r=new k(0,1,0);return new qi({name:"SphericalGaussianBlur",defines:{n:wa,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:vS(),fragmentShader:` 3627 3628 precision mediump float; 3629 precision mediump int; 3630 3631 varying vec3 vOutputDirection; 3632 3633 uniform sampler2D envMap; 3634 uniform int samples; 3635 uniform float weights[ n ]; 3636 uniform bool latitudinal; 3637 uniform float dTheta; 3638 uniform float mipInt; 3639 uniform vec3 poleAxis; 3640 3641 #define ENVMAP_TYPE_CUBE_UV 3642 #include <cube_uv_reflection_fragment> 3643 3644 vec3 getSample( float theta, vec3 axis ) { 3645 3646 float cosTheta = cos( theta ); 3647 // Rodrigues' axis-angle rotation 3648 vec3 sampleDirection = vOutputDirection * cosTheta 3649 + cross( axis, vOutputDirection ) * sin( theta ) 3650 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3651 3652 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3653 3654 } 3655 3656 void main() { 3657 3658 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3659 3660 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3661 3662 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3663 3664 } 3665 3666 axis = normalize( axis ); 3667 3668 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3669 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3670 3671 for ( int i = 1; i < n; i++ ) { 3672 3673 if ( i >= samples ) { 3674 3675 break; 3676 3677 } 3678 3679 float theta = dTheta * float( i ); 3680 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3681 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3682 3683 } 3684 3685 } 3686 `,blending:gs,depthTest:!1,depthWrite:!1})}function pE(){return new qi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:vS(),fragmentShader:` 3687 3688 precision mediump float; 3689 precision mediump int; 3690 3691 varying vec3 vOutputDirection; 3692 3693 uniform sampler2D envMap; 3694 3695 #include <common> 3696 3697 void main() { 3698 3699 vec3 outputDirection = normalize( vOutputDirection ); 3700 vec2 uv = equirectUv( outputDirection ); 3701
3702 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3703 3704 } 3705 `,blending:gs,depthTest:!1,depthWrite:!1})}function mE(){return new qi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:vS(),fragmentShader:` 3706 3707 precision mediump float; 3708 precision mediump int; 3709 3710 uniform float flipEnvMap; 3711 3712 varying vec3 vOutputDirection; 3713 3714 uniform samplerCube envMap; 3715 3716 void main() { 3717 3718 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3719 3720 } 3721 `,blending:gs,depthTest:!1,depthWrite:!1})}function vS(){return` 3722 3723 precision mediump float; 3724 precision mediump int; 3725 3726 attribute float faceIndex; 3727 3728 varying vec3 vOutputDirection; 3729 3730 // RH coordinate system; PMREM face-indexing convention 3731 vec3 getDirection( vec2 uv, float face ) { 3732 3733 uv = 2.0 * uv - 1.0; 3734 3735 vec3 direction = vec3( uv, 1.0 ); 3736 3737 if ( face == 0.0 ) { 3738 3739 direction = direction.zyx; // ( 1, v, u ) pos x 3740 3741 } else if ( face == 1.0 ) { 3742 3743 direction = direction.xzy; 3744 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3745 3746 } else if ( face == 2.0 ) { 3747 3748 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3749 3750 } else if ( face == 3.0 ) { 3751 3752 direction = direction.zyx; 3753 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3754 3755 } else if ( face == 4.0 ) { 3756 3757 direction = direction.xzy; 3758 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3759 3760 } else if ( face == 5.0 ) { 3761 3762 direction.z *= -1.0; // ( u, v, -1 ) neg z 3763 3764 } 3765 3766 return direction; 3767 3768 } 3769 3770 void main() { 3771 3772 vOutputDirection = getDirection( uv, faceIndex ); 3773 gl_Position = vec4( position, 1.0 ); 3774 3775 } 3776 `}function uO(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const u=a.mapping,f=u===Ec||u===bf,h=u===_s||u===Ho;if(f||h){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 V_(n)),d=f?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 f&&m&&m.height>0||h&&m&&r(m)?(t===null&&(t=new V_(n)),d=f?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 u=0;const f=6;for(let h=0;h<f;h++)a[h]!==void 0&&u++;return u===f}function s(a){const u=a.target;u.removeEventListener("dispose",s);const f=e.get(u);f!==void 0&&(e.delete(u),f.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function fO(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&&Hp("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function hO(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 w=p.morphAttributes[y];for(let _=0,v=w.length;_<v;_++)e.remove(w[_])}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 u(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 w=m[y];for(let _=0,v=w.length;_<v;_++)e.update(w[_],n.ARRAY_BUFFER)}}function f(d){const p=[],m=d.index,y=d.attributes.position;let w=0;if(m!==null){const S=m.array;w=m.version;for(let M=0,T=S.length;M<T;M+=3){const I=S[M+0],C=S[M+1],L=S[M+2];p.push(I,C,C,L,L,I)}}else if(y!==void 0){const S=y.array;w=y.version;for(let M=0,T=S.length/3-1;M<T;M+=3){const I=M+0,C=M+1,L=M+2;p.push(I,C,C,L,L,I)}}else return;const _=new(hR(p)?mS:pS)(p,1);_.version=w;const v=s.get(d);v&&e.remove(v),s.set(d,_)}function h(d){const p=s.get(d);if(p){const m=d.index;m!==null&&p.version<m.version&&f(d)}else f(d);return s.get(d)}return{get:a,update:u,getWireframeAttribute:h}}function dO(n,e,t){let i;function r(p){i=p}let s,o;function a(p){s=p.type,o=p.bytesPerElement}function u(p,m){n.drawElements(i,m,s,p*o),t.update(m,i,1)}function f(p,m,y){y!==0&&(n.drawElementsInstanced(i,m,s,p*o,y),t.update(m,i,y))}function h(p,m,y){if(y===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,m,0,s,p,0,y);let _=0;for(let v=0;v<y;v++)_+=m[v];t.update(_,i,1)}function d(p,m,y,w){if(y===0)return;const _=e.get("WEBGL_multi_draw");if(_===null)for(let v=0;v<p.length;v++)f(p[v]/o,m[v],w[v]);
vendor: 4,584 bytes, line 3776
3776else{_.multiDrawElementsInstancedWEBGL(i,m,0,s,p,0,w,0,y);let v=0;for(let S=0;S<y;S++)v+=m[S];for(let S=0;S<w.length;S++)t.update(v,i,w[S])}}this.setMode=r,this.setIndex=a,this.render=u,this.renderInstances=f,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function pO(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 mO(n,e,t){const i=new WeakMap,r=new Xt;function s(o,a,u){const f=o.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,d=h!==void 0?h.length:0;let p=i.get(a);if(p===void 0||p.count!==d){let A=function(){N.dispose(),i.delete(a),a.removeEventListener("dispose",A)};var m=A;p!==void 0&&p.texture.dispose();const y=a.morphAttributes.position!==void 0,w=a.morphAttributes.normal!==void 0,_=a.morphAttributes.color!==void 0,v=a.morphAttributes.position||[],S=a.morphAttributes.normal||[],M=a.morphAttributes.color||[];let T=0;y===!0&&(T=1),w===!0&&(T=2),_===!0&&(T=3);let I=a.attributes.position.count*T,C=1;I>e.maxTextureSize&&(C=Math.ceil(I/e.maxTextureSize),I=e.maxTextureSize);const L=new Float32Array(I*C*4*d),N=new Lg(L,I,C,d);N.type=_n,N.needsUpdate=!0;const B=T*4;for(let R=0;R<d;R++){const j=v[R],Y=S[R],Z=M[R],ae=I*C*4*R;for(let Q=0;Q<j.count;Q++){const pe=Q*B;y===!0&&(r.fromBufferAttribute(j,Q),L[ae+pe+0]=r.x,L[ae+pe+1]=r.y,L[ae+pe+2]=r.z,L[ae+pe+3]=0),w===!0&&(r.fromBufferAttribute(Y,Q),L[ae+pe+4]=r.x,L[ae+pe+5]=r.y,L[ae+pe+6]=r.z,L[ae+pe+7]=0),_===!0&&(r.fromBufferAttribute(Z,Q),L[ae+pe+8]=r.x,L[ae+pe+9]=r.y,L[ae+pe+10]=r.z,L[ae+pe+11]=Z.itemSize===4?r.w:1)}}p={count:d,texture:N,size:new be(I,C)},i.set(a,p),a.addEventListener("dispose",A)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)u.getUniforms().setValue(n,"morphTexture",o.morphTexture,t);else{let y=0;for(let _=0;_<f.length;_++)y+=f[_];const w=a.morphTargetsRelative?1:1-y;u.getUniforms().setValue(n,"morphTargetBaseInfluence",w),u.getUniforms().setValue(n,"morphTargetInfluences",f)}u.getUniforms().setValue(n,"morphTargetsTexture",p.texture,t),u.getUniforms().setValue(n,"morphTargetsTextureSize",p.size)}return{update:s}}function gO(n,e,t,i){let r=new WeakMap;function s(u){const f=i.render.frame,h=u.geometry,d=e.get(u,h);if(r.get(d)!==f&&(e.update(d),r.set(d,f)),u.isInstancedMesh&&(u.hasEventListener("dispose",a)===!1&&u.addEventListener("dispose",a),r.get(u)!==f&&(t.update(u.instanceMatrix,n.ARRAY_BUFFER),u.instanceColor!==null&&t.update(u.instanceColor,n.ARRAY_BUFFER),r.set(u,f))),u.isSkinnedMesh){const p=u.skeleton;r.get(p)!==f&&(p.update(),r.set(p,f))}return d}function o(){r=new WeakMap}function a(u){const f=u.target;f.removeEventListener("dispose",a),t.remove(f.instanceMatrix),f.instanceColor!==null&&t.remove(f.instanceColor)}return{update:s,dispose:o}}class yS extends nn{constructor(e,t,i,r,s,o,a,u,f,h=Fa){if(h!==Fa&&h!==Ka)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===Fa&&(i=xs),i===void 0&&h===Ka&&(i=Za),super(null,r,s,o,a,u,h,i,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:Jn,this.minFilter=u!==void 0?u:Jn,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 SR=new nn,gE=new yS(1,1),MR=new Lg,wR=new dS,ER=new lh,vE=[],yE=[],_E=new Float32Array(16),xE=new Float32Array(9),SE=new Float32Array(4);function Hc(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=vE[r];if(s===void 0&&(s=new Float32Array(r),vE[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 Vn(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 Wn(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function Ng(n,e){let t=yE[e];t===void 0&&(t=new Int32Array(e),yE[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function vO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function yO(n,e){const t=this.cache;
vendor: 5,610 bytes, line 3776
3776if(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(Vn(t,e))return;n.uniform2fv(this.addr,e),Wn(t,e)}}function _O(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(Vn(t,e))return;n.uniform3fv(this.addr,e),Wn(t,e)}}function xO(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(Vn(t,e))return;n.uniform4fv(this.addr,e),Wn(t,e)}}function SO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Vn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Wn(t,e)}else{if(Vn(t,i))return;SE.set(i),n.uniformMatrix2fv(this.addr,!1,SE),Wn(t,i)}}function MO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Vn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Wn(t,e)}else{if(Vn(t,i))return;xE.set(i),n.uniformMatrix3fv(this.addr,!1,xE),Wn(t,i)}}function wO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Vn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Wn(t,e)}else{if(Vn(t,i))return;_E.set(i),n.uniformMatrix4fv(this.addr,!1,_E),Wn(t,i)}}function EO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function TO(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(Vn(t,e))return;n.uniform2iv(this.addr,e),Wn(t,e)}}function AO(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(Vn(t,e))return;n.uniform3iv(this.addr,e),Wn(t,e)}}function bO(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(Vn(t,e))return;n.uniform4iv(this.addr,e),Wn(t,e)}}function RO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function CO(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(Vn(t,e))return;n.uniform2uiv(this.addr,e),Wn(t,e)}}function PO(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(Vn(t,e))return;n.uniform3uiv(this.addr,e),Wn(t,e)}}function IO(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(Vn(t,e))return;n.uniform4uiv(this.addr,e),Wn(t,e)}}function LO(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?(gE.compareFunction=fS,s=gE):s=SR,t.setTexture2D(e||s,r)}function NO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||wR,r)}function DO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTextureCube(e||ER,r)}function UO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||MR,r)}function OO(n){switch(n){case 5126:return vO;case 35664:return yO;case 35665:return _O;case 35666:return xO;case 35674:return SO;case 35675:return MO;case 35676:return wO;case 5124:case 35670:return EO;case 35667:case 35671:return TO;case 35668:case 35672:return AO;case 35669:case 35673:return bO;case 5125:return RO;case 36294:return CO;case 36295:return PO;case 36296:return IO;case 35678:case 36198:case 36298:case 36306:case 35682:return LO;case 35679:case 36299:case 36307:return NO;case 35680:case 36300:case 36308:case 36293:return DO;case 36289:case 36303:case 36311:case 36292:return UO}}function FO(n,e){n.uniform1fv(this.addr,e)}function kO(n,e){const t=Hc(e,this.size,2);n.uniform2fv(this.addr,t)}function zO(n,e){const t=Hc(e,this.size,3);n.uniform3fv(this.addr,t)}function BO(n,e){const t=Hc(e,this.size,4);n.uniform4fv(this.addr,t)}function HO(n,e){const t=Hc(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function GO(n,e){const t=Hc(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function VO(n,e){const t=Hc(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function WO(n,e){n.uniform1iv(this.addr,e)}function XO(n,e){n.uniform2iv(this.addr,e)}function jO(n,e){n.uniform3iv(this.addr,e)}function YO(n,e){n.uniform4iv(this.addr,e)}function qO(n,e){n.uniform1uiv(this.addr,e)}function ZO(n,e){n.uniform2uiv(this.addr,e)}function KO(n,e){n.uniform3uiv(this.addr,e)}function QO(n,e){n.uniform4uiv(this.addr,e)}function $O(n,e,t){const i=this.cache,r=e.length,s=Ng(t,r);Vn(i,s)||(n.uniform1iv(this.addr,s),Wn(i,s));for(let o=0;o!==r;++o)t.setTexture2D(e[o]||SR,s[o])}function JO(n,e,t){const i=this.cache,r=e.length,s=Ng(t,r);Vn(i,s)||(n.uniform1iv(this.addr,s),Wn(i,s));for(let o=0;o!==r;++o)t.setTexture3D(e[o]||wR,s[o])}function eF(n,e,t){const i=this.cache,r=e.length,s=Ng(t,r);Vn(i,s)||(n.uniform1iv(this.addr,s),Wn(i,s));for(let o=0;o!==r;++o)t.setTextureCube(e[o]||ER,s[o])}function tF(n,e,t){const i=this.cache,r=e.length,s=Ng(t,r);Vn(i,s)||(n.uniform1iv(this.addr,s),Wn(i,s));for(let o=0;o!==r;++o)t.setTexture2DArray(e[o]||MR,s[o])}function nF(n){switch(n){case 5126:return FO;case 35664:return kO;case 35665:return zO;case 35666:return BO;case 35674:return HO;case 35675:return GO;case 35676:return VO;
vendor: 4,261 bytes, lines 3776-3785
3776case 5124:case 35670:return WO;case 35667:case 35671:return XO;case 35668:case 35672:return jO;case 35669:case 35673:return YO;case 5125:return qO;case 36294:return ZO;case 36295:return KO;case 36296:return QO;case 35678:case 36198:case 36298:case 36306:case 35682:return $O;case 35679:case 36299:case 36307:return JO;case 35680:case 36300:case 36308:case 36293:return eF;case 36289:case 36303:case 36311:case 36292:return tF}}class iF{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=OO(t.type)}}class rF{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=nF(t.type)}}class sF{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 dy=/(\w+)(\])?(\[|\.)?/g;function ME(n,e){n.seq.push(e),n.map[e.id]=e}function oF(n,e,t){const i=n.name,r=i.length;for(dy.lastIndex=0;;){const s=dy.exec(i),o=dy.lastIndex;let a=s[1];const u=s[2]==="]",f=s[3];if(u&&(a=a|0),f===void 0||f==="["&&o+2===r){ME(t,f===void 0?new iF(a,n,e):new rF(a,n,e));break}else{let d=t.map[a];d===void 0&&(d=new sF(a),ME(t,d)),t=d}}}class Gp{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);oF(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],u=i[a.id];u.needsUpdate!==!1&&a.setValue(e,u.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 wE(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}const aF=37297;let lF=0;function cF(n,e){const t=n.split(` 3777`),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(` 3778`)}function uF(n){const e=Kt.getPrimaries(Kt.workingColorSpace),t=Kt.getPrimaries(n);let i;switch(e===t?i="":e===Df&&t===Nf?i="LinearDisplayP3ToLinearSRGB":e===Nf&&t===Df&&(i="LinearSRGBToLinearDisplayP3"),n){case Cr:case oh:return[i,"LinearTransferOETF"];case ir:case Ig:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function EE(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()+` 3779 3780`+r+` 3781 3782`+cF(n.getShaderSource(e),o)}else return r}function fF(n,e){const t=uF(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function hF(n,e){let t;switch(e){case jb:t="Linear";break;case Yb:t="Reinhard";break;case qb:t="Cineon";break;case nh:t="ACESFilmic";break;case Kb:t="AgX";break;case Qb:t="Neutral";break;case Zb:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const $d=new k;function dF(){Kt.getLuminanceCoefficients($d);const n=$d.x.toFixed(4),e=$d.y.toFixed(4),t=$d.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` 3783`)}function pF(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Hu).join(` 3784`)}function mF(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` 3785`)}function gF(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 Hu(n){return n!==""}function TE(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_L
vendor: 4,762 bytes, lines 3785-3810
3785IGHTS/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_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function AE(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const vF=/^[ \t]*#include +<([\w\d./]+)>/gm;function W_(n){return n.replace(vF,_F)}const yF=new Map;function _F(n,e){let t=Lt[e];if(t===void 0){const i=yF.get(e);if(i!==void 0)t=Lt[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 W_(t)}const xF=/#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 bE(n){return n.replace(xF,SF)}function SF(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 RE(n){let e=`precision ${n.precision} float; 3786 precision ${n.precision} int; 3787 precision ${n.precision} sampler2D; 3788 precision ${n.precision} samplerCube; 3789 precision ${n.precision} sampler3D; 3790 precision ${n.precision} sampler2DArray; 3791 precision ${n.precision} sampler2DShadow; 3792 precision ${n.precision} samplerCubeShadow; 3793 precision ${n.precision} sampler2DArrayShadow; 3794 precision ${n.precision} isampler2D; 3795 precision ${n.precision} isampler3D; 3796 precision ${n.precision} isamplerCube; 3797 precision ${n.precision} isampler2DArray; 3798 precision ${n.precision} usampler2D; 3799 precision ${n.precision} usampler3D; 3800 precision ${n.precision} usamplerCube; 3801 precision ${n.precision} usampler2DArray; 3802 `;return n.precision==="highp"?e+=` 3803#define HIGH_PRECISION`:n.precision==="mediump"?e+=` 3804#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=` 3805#define LOW_PRECISION`),e}function MF(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===wg?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===Qu?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Hr&&(e="SHADOWMAP_TYPE_VSM"),e}function wF(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case _s:case Ho:e="ENVMAP_TYPE_CUBE";break;case kc:e="ENVMAP_TYPE_CUBE_UV";break}return e}function EF(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Ho:e="ENVMAP_MODE_REFRACTION";break}return e}function TF(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case th:e="ENVMAP_BLENDING_MULTIPLY";break;case Wb:e="ENVMAP_BLENDING_MIX";break;case Xb:e="ENVMAP_BLENDING_ADD";break}return e}function AF(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 bF(n,e,t,i){const r=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const u=MF(t),f=wF(t),h=EF(t),d=TF(t),p=AF(t),m=pF(t),y=mF(s),w=r.createProgram();let _,v,S=t.glslVersion?"#version "+t.glslVersion+` 3806`:"";t.isRawShaderMaterial?(_=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(Hu).join(` 3807`),_.length>0&&(_+=` 3808`),v=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(Hu).join(` 3809`),v.length>0&&(v+=` 3810`)):(_=[RE(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 "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IR
3810IDESCENCEMAP":"",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 "+u:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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",` 3811`].filter(Hu).join(` 3812`),v=[RE(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 "+f:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
3812IDESCENCE":"",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 "+u:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==vs?"#define TONE_MAPPING":"",t.toneMapping!==vs?Lt.tonemapping_pars_fragment:"",t.toneMapping!==vs?hF("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Lt.colorspace_pars_fragment,fF("linearToOutputTexel",t.outputColorSpace),dF(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 3813`].filter(Hu).join(` 3814`)),o=W_(o),o=TE(o,t),o=AE(o,t),a=W_(a),a=TE(a,t),a=AE(a,t),o=bE(o),a=bE(a),t.isRawShaderMaterial!==!0&&(S=`#version 300 es 3815`,_=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` 3816`)+` 3817`+_,v=["#define varying in",t.glslVersion===G_?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===G_?"":"#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(` 3818`)+` 3819`+v);const M=S+_+o,T=S+v+a,I=wE(r,r.VERTEX_SHADER,M),C=wE(r,r.FRAGMENT_SHADER,T);r.attachShader(w,I),r.attachShader(w,C),t.index0AttributeName!==void 0?r.bindAttribLocation(w,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(w,0,"position"),r.linkProgram(w);function L(R){if(n.debug.checkShaderErrors){const j=r.getProgramInfoLog(w).trim(),Y=r.getShaderInfoLog(I).trim(),Z=r.getShaderInfoLog(C).trim();let ae=!0,Q=!0;if(r.getProgramParameter(w,r.LINK_STATUS)===!1)if(ae=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,w,I,C);else{const pe=EE(r,I,"vertex"),z=EE(r,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(w,r.VALIDATE_STATUS)+` 3820 3821Material Name: `+R.name+` 3822Material Type: `+R.type+` 3823 3824Program Info Log: `+j+` 3825`+pe+` 3826`+z)}else j!==""?console.warn("THREE.WebGLProgram: Program Info Log:",j):(Y===""||Z==="")&&(Q=!1);Q&&(R.diagnostics={runnable:ae,programLog:j,vertexShader:{log:Y,prefix:_},fragmentShader:{log:Z,prefix:v}})}r.deleteShader(I),r.deleteShader(C),N=new Gp(r,w),B=gF(r,w)}let N;this.getUniforms=function(){return N===void 0&&L(this),N};let B;this.getAttributes=function(){return B===void 0&&L(this),B};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=r.getProgramParameter(w,aF)),A},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(w),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=lF++,this.cacheKey=e,this.usedTimes=1,this.program=w,this.vertexShader=I,this.fragmentShader=C,this}let RF=0;class CF{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 PF(e),t.set(e,i)),i}}class PF{constructor(e){this.id=RF++,this.code=e,this.usedTimes=0}}function IF(n,e,t,i,r,s,o){const a=new za,u=new CF,f=new Set,h=[],d=r.logarithmicDepthBuffer,p=r.reverseDepthBuffer,m=r.vertexTextures;let y=r.precision;const w={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(A){return f.add(A),A===0?"uv":`uv${A}`}function v(A,R,j,Y,Z){const ae=Y.fog,Q=Z.geometry,pe=A.isMeshStandardMaterial?Y.environment:null,z=(A.isMeshStandardMaterial?t:e).get(A.envMap||pe),ie=z&&z.mapping===kc?z.image.height:null,$=w[A.type];A.precision!==null&&(y=r.getMaxPrecision(A.precision),y!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",y,"instead."));const le=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,ye=le!==void 0?le.length:0;let De=0;Q.morphAttributes.position!==void 0&&(De=1),Q.morphAttributes.normal!==void 0&&(De=2),Q.morphAttributes.color!==void 0&&(De=3);let ue,Me,we,Ce;if($){const kn=Xr[$];ue=kn.vertexShader,Me=kn.fragmentShader}else ue=A.vertexShader,Me=A.fragmentShader,u.update(A),we=u.getVertexShaderID(A),Ce=u.getFragmentShaderID(A);const ct=n.getRenderTarget(),gt=Z.isInstancedMesh===!0,We=Z.isBatchedMesh===!0,nt=!!A.map,xe=!!A.matcap,G=!!z,Oe=!!A.aoMap,Fe=!!A.lightMap,Ie=!!A.bumpMap,He=!!A.normalMap,ft=!!A.displacementMap,Qe=!!A.emissiveMap,V=!!A.metalnessMap,U=!!A.roughnessMap,ce=A.anisotropy>0,Se=A.clearcoat>0,Ee=A.dispersion>0,_e=A.iridescence>0,at=A.sheen>0,Ve=A.transmission>0,$e=ce&&!!A.anisotropyMap,It=Se&&!!A.clearcoatMap,Ne=Se&&!!A.clearcoatNormalMap,it=Se&&!!A.clearcoatRoughnessMap,Mt=_e&&!!A.iridescenceMap,yt=_e&&!!A.iridescenceThicknessMap,Ge=at&&!!A.sheenColorMap,Ut=at&&!!A.sheenRoughnessMap,St=!!A.specularMap,bt=!!A.specularColorMap,te=!!A.specularIntensityMap,Je=Ve&&!!A.transmissionMap,ne=Ve&&!!A.thicknessMap,Te=!!A.gradientMap,Ye=!!A.alphaMap,et=A.alphaTest>0,Ft=!!A.alphaHash,ln=!!A.extensions;let Xn=vs;A.toneMapped&&(ct===null||ct.isXRRenderTarget===!0)&&(Xn=n.toneMapping);const Bt={shaderID:$,shaderType:A.type,shaderName:A.name,vertexShader:ue,fragmentShader:Me,defines:A.defines,customVertexShaderID:we,customFragmentShaderID:Ce,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:y,batching:We,batchingColor:We&&Z._colorsTexture!==null,instancing:gt,instancingColor:gt&&Z.instanceColor!==null,instancingMorph:gt&&Z.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:ct===null?n.outputColorSpace:ct.isXRRenderTarget===!0?ct.texture.colorSpace:Cr,alphaToCoverage:!!A.alphaToCoverage,map:nt,matcap:xe,envMap:G,envMapMode:G&&z.mapping,envMapCubeUVHeight:ie,aoMap:Oe,lightMap:Fe,bumpMap:Ie,normalMap:He,displacementMap:m&&ft,emissiveMap:Qe,normalMapObjectSpace:He&&A.normalMapType===rR,normalMapTangentSpace:He&&A.normalMapType===qo,metalnessMap:V,roughnessMap:U,anisotropy:ce,anisotropyMap:$e,clearcoat:Se,clearcoatMap:It,clearcoatNormalMap:Ne,clearcoatRoughnessMap:it,dispersion:Ee,iridescence:_e,iridescenceMap:Mt,iridescenceThicknessMap:yt,sheen:at,sheenColorMap:Ge,sheenRoughnessMap:Ut,specularMap:St,specularColorMap:bt,specularIntensityMap:te,transmission:Ve,transmissionMap:Je,thicknessMap:ne,gradientMap:Te,opaque:A.transparent===!1&&A.blending===Oa&&A.alphaToCoverage===!1,alphaMap:Ye,alphaTest:et,alphaHash:Ft,combine:A.combine,mapUv:nt&&_(A.map.channel),aoMapUv:Oe&&_(A.aoMap.channel),lightMapUv:Fe&&_(A.lightMap.channel),bumpMapUv:Ie&&_(A.bumpMap.channel),normalMapUv:He&&_(A.normalMap.channel),displacementMapUv:ft&&_(A.displacementMap.channel),emissiveMapUv:Qe&&_(A.emissiveMap.channel),metalnessMapUv:V&&_(A.metalnessMap.channel),roughnessMapUv:U&&_(A.roughnessMap.channel),anisotropyMapUv:$e&&_(A.anisotropyMap.channel),clearcoatMapUv:It&&_(A.clearcoatMap.channel),clearcoatNormalMapUv:Ne&&_(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:it&&_(A.clearcoatRoughnessMap.channel),iridescenceMapUv:Mt&&_(A.iridescenceMap.channel),iridescenceThicknessMapUv:yt&&_(A.iridescenceThicknessMap.channel),sheenColorMapUv:Ge&&_(A.sheenColorMap.channel),sheenRoughnessMapUv:Ut&&_(A.sheenRoughnessMap.channel),specularMapUv:St&&_(A.specularMap.channel),specularColorMapUv:bt&&_(A.specularColorMap.channel),specularIntensityMapUv:te&&_(A.specularIntensityMap.channel),transmissionMapUv:Je&&_(A.transmissionMap.channel),thicknessMapUv:ne&&_(A.thicknessMap.channel),alphaMapUv:Ye&&_(A.alphaMap.channel),vertexTangents:!!Q.attributes.tangent&&(He||ce),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!Q.attributes.color&&Q.attributes.color.itemSize===4,pointsUvs:Z.isPoints===!0&&!!Q.attributes.uv&&(nt||Ye),fog:!!ae,useFog:A.fog===!0,fogExp2:!!ae&&ae.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:p,skinning:Z.isSkinnedMesh===!0,morphTargets:Q.morphAttributes.position!==void 0,morphNormals:Q.morphAttributes.normal!==void 0,morphColors:Q.morphAttributes.color!==void 0,morphTargetsCount:ye,morphTextureStride:De,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:A.dithering,shadowMapEnabled:n.shadowMap.enabled&&j.length>0,shadowMapType:n.shadowMap.type,toneMapping:Xn,decodeVideoTexture:nt&&A.map.isVideoTexture===!0&&Kt.getTransfer(A.map.colorSpace)===sn,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===jr,flipSided:A.side===Ci,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionCl
vendor: 13,671 bytes, lines 3826-3832
3826ipCullDistance:ln&&A.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ln&&A.extensions.multiDraw===!0||We)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()};return Bt.vertexUv1s=f.has(1),Bt.vertexUv2s=f.has(2),Bt.vertexUv3s=f.has(3),f.clear(),Bt}function S(A){const R=[];if(A.shaderID?R.push(A.shaderID):(R.push(A.customVertexShaderID),R.push(A.customFragmentShaderID)),A.defines!==void 0)for(const j in A.defines)R.push(j),R.push(A.defines[j]);return A.isRawShaderMaterial===!1&&(M(R,A),T(R,A),R.push(n.outputColorSpace)),R.push(A.customProgramCacheKey),R.join()}function M(A,R){A.push(R.precision),A.push(R.outputColorSpace),A.push(R.envMapMode),A.push(R.envMapCubeUVHeight),A.push(R.mapUv),A.push(R.alphaMapUv),A.push(R.lightMapUv),A.push(R.aoMapUv),A.push(R.bumpMapUv),A.push(R.normalMapUv),A.push(R.displacementMapUv),A.push(R.emissiveMapUv),A.push(R.metalnessMapUv),A.push(R.roughnessMapUv),A.push(R.anisotropyMapUv),A.push(R.clearcoatMapUv),A.push(R.clearcoatNormalMapUv),A.push(R.clearcoatRoughnessMapUv),A.push(R.iridescenceMapUv),A.push(R.iridescenceThicknessMapUv),A.push(R.sheenColorMapUv),A.push(R.sheenRoughnessMapUv),A.push(R.specularMapUv),A.push(R.specularColorMapUv),A.push(R.specularIntensityMapUv),A.push(R.transmissionMapUv),A.push(R.thicknessMapUv),A.push(R.combine),A.push(R.fogExp2),A.push(R.sizeAttenuation),A.push(R.morphTargetsCount),A.push(R.morphAttributeCount),A.push(R.numDirLights),A.push(R.numPointLights),A.push(R.numSpotLights),A.push(R.numSpotLightMaps),A.push(R.numHemiLights),A.push(R.numRectAreaLights),A.push(R.numDirLightShadows),A.push(R.numPointLightShadows),A.push(R.numSpotLightShadows),A.push(R.numSpotLightShadowsWithMaps),A.push(R.numLightProbes),A.push(R.shadowMapType),A.push(R.toneMapping),A.push(R.numClippingPlanes),A.push(R.numClipIntersection),A.push(R.depthPacking)}function T(A,R){a.disableAll(),R.supportsVertexTextures&&a.enable(0),R.instancing&&a.enable(1),R.instancingColor&&a.enable(2),R.instancingMorph&&a.enable(3),R.matcap&&a.enable(4),R.envMap&&a.enable(5),R.normalMapObjectSpace&&a.enable(6),R.normalMapTangentSpace&&a.enable(7),R.clearcoat&&a.enable(8),R.iridescence&&a.enable(9),R.alphaTest&&a.enable(10),R.vertexColors&&a.enable(11),R.vertexAlphas&&a.enable(12),R.vertexUv1s&&a.enable(13),R.vertexUv2s&&a.enable(14),R.vertexUv3s&&a.enable(15),R.vertexTangents&&a.enable(16),R.anisotropy&&a.enable(17),R.alphaHash&&a.enable(18),R.batching&&a.enable(19),R.dispersion&&a.enable(20),R.batchingColor&&a.enable(21),A.push(a.mask),a.disableAll(),R.fog&&a.enable(0),R.useFog&&a.enable(1),R.flatShading&&a.enable(2),R.logarithmicDepthBuffer&&a.enable(3),R.reverseDepthBuffer&&a.enable(4),R.skinning&&a.enable(5),R.morphTargets&&a.enable(6),R.morphNormals&&a.enable(7),R.morphColors&&a.enable(8),R.premultipliedAlpha&&a.enable(9),R.shadowMapEnabled&&a.enable(10),R.doubleSided&&a.enable(11),R.flipSided&&a.enable(12),R.useDepthPacking&&a.enable(13),R.dithering&&a.enable(14),R.transmission&&a.enable(15),R.sheen&&a.enable(16),R.opaque&&a.enable(17),R.pointsUvs&&a.enable(18),R.decodeVideoTexture&&a.enable(19),R.alphaToCoverage&&a.enable(20),A.push(a.mask)}function I(A){const R=w[A.type];let j;if(R){const Y=Xr[R];j=yR.clone(Y.uniforms)}else j=A.uniforms;return j}function C(A,R){let j;for(let Y=0,Z=h.length;Y<Z;Y++){const ae=h[Y];if(ae.cacheKey===R){j=ae,++j.usedTimes;break}}return j===void 0&&(j=new bF(n,R,A,s),h.push(j)),j}function L(A){if(--A.usedTimes===0){const R=h.indexOf(A);h[R]=h[h.length-1],h.pop(),A.destroy()}}function N(A){u.remove(A)}function B(){u.dispose()}return{getParameters:v,getProgramCacheKey:S,getUniforms:I,acquireProgram:C,releaseProgram:L,releaseShaderCache:N,programs:h,dispose:B}}function LF(){let n=new WeakMap;function e(o){return n.has(o)}function t(o){let a=n.get(o);return a===void 0&&(a={},n.set(o,a)),a}function i(o){n.delete(o)}function r(o,a,u){n.get(o)[a]=u}function s(){n=new WeakMap}return{has:e,get:t,remove:i,update:r,dispose:s}}function NF(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 CE(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 PE(){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,w,_){let v=n[e];return v===void 0?(v={id:d.id,object:d,geometry:p,material:m,groupOrder:y,renderOrder:d.renderOrder,z:w,group:_},n[e]=v):(v.id=d.id,v.object=d,v.geometry=p,v.material=m,v.groupOrder=y,v.renderOrder=d.renderOrder,v.z=w,v.group=_),e++,v}function a(d,p,m,y,w,_){const v=o(d,p,m,y,w,_);m.transmission>0?i.push(v):m.transparent===!0?r.push(v):t.push(v)}function u(d,p,m,y,w,_){const v=o(d,p,m,y,w,_);m.transmission>0?i.unshift(v):m.transparent===!0?r.unshift(v):t.unshift(v)}function f(d,p){t.length>1&&t.sort(d||NF),i.length>1&&i.sort(p||CE),r.length>1&&r.sort(p||CE)}function h(){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:u,finish:h,sort:f}}function DF(){let n=new WeakMap;function e(i,r){const s=n.get(i);let o;return s===void 0?(o=new PE,n.set(i,[o])):r>=s.length?(o=new PE,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function UF(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new k,color:new rt};break;case"SpotLight":t={position:new k,direction:new k,color:new rt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new k,color:new rt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new k,skyColor:new rt,groundColor:new rt};break;case"RectAreaLight":t={color:new rt,position:new k,halfWidth:new k,halfHeight:new k};break}return n[e.id]=t,t}}}function OF(){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 be};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let FF=0;function kF(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function zF(n){const e=new UF,t=OF(),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 f=0;f<9;f++)i.probe.push(new k);const r=new k,s=new mt,o=new mt;function a(f){let h=0,d=0,p=0;for(let B=0;B<9;B++)i.probe[B].set(0,0,0);let m=0,y=0,w=0,_=0,v=0,S=0,M=0,T=0,I=0,C=0,L=0;f.sort(kF);for(let B=0,A=f.length;B<A;B++){const R=f[B],j=R.color,Y=R.intensity,Z=R.distance,ae=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)h+=j.r*Y,d+=j.g*Y,p+=j.b*Y;else if(R.isLightProbe){for(let Q=0;Q<9;Q++)i.probe[Q].addScaledVector(R.sh.coefficients[Q],Y);L++}else if(R.isDirectionalLight){const Q=e.get(R);if(Q.color.copy(R.color).multiplyScalar(R.intensity),R.castShadow){const pe=R.shadow,z=t.get(R);z.shadowIntensity=pe.intensity,z.shadowBias=pe.bias,z.shadowNormalBias=pe.normalBias,z.shadowRadius=pe.radius,z.shadowMapSize=pe.mapSize,i.directionalShadow[m]=z,i.directionalShadowMap[m]=ae,i.directionalShadowMatrix[m]=R.shadow.matrix,S++}i.directional[m]=Q,m++}else if(R.isSpotLight){const Q=e.get(R);Q.position.setFromMatrixPosition(R.matrixWorld),Q.color.copy(j).multiplyScalar(Y),Q.distance=Z,Q.coneCos=Math.cos(R.angle),Q.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),Q.decay=R.decay,i.spot[w]=Q;const pe=R.shadow;if(R.map&&(i.spotLightMap[I]=R.map,I++,pe.updateMatrices(R),R.castShadow&&C++),i.spotLightMatrix[w]=pe.matrix,R.castShadow){const z=t.get(R);z.shadowIntensity=pe.intensity,z.shadowBias=pe.bias,z.shadowNormalBias=pe.normalBias,z.shadowRadius=pe.radius,z.shadowMapSize=pe.mapSize,i.spotShadow[w]=z,i.spotShadowMap[w]=ae,T++}w++}else if(R.isRectAreaLight){const Q=e.get(R);Q.color.copy(j).multiplyScalar(Y),Q.halfWidth.set(R.width*.5,0,0),Q.halfHeight.set(0,R.height*.5,0),i.rectArea[_]=Q,_++}else if(R.isPointLight){const Q=e.get(R);if(Q.color.copy(R.color).multiplyScalar(R.intensity),Q.distance=R.distance,Q.decay=R.decay,R.castShadow){const pe=R.shadow,z=t.get(R);z.shadowIntensity=pe.intensity,z.shadowBias=pe.bias,z.shadowNormalBias=pe.normalBias,z.shadowRadius=pe.radius,z.shadowMapSize=pe.mapSize,z.shadowCameraNear=pe.camera.near,z.shadowCameraFar=pe.camera.far,i.pointShadow[y]=z,i.pointShadowMap[y]=ae,i.pointShadowMatrix[y]=R.shadow.matrix,M++}i.point[y]=Q,y++}else if(R.isHemisphereLight){const Q=e.get(R);Q.skyColor.copy(R.color).multiplyScalar(Y),Q.groundColor.copy(R.groundColor).multiplyScalar(Y),i.hemi[v]=Q,v++}}_>0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Xe.LTC_FLOAT_1,i.rectAreaLTC2=Xe.LTC_FLOAT_2):(i.rectAreaLTC1=Xe.LTC_HALF_1,i.rectAreaLTC2=Xe.LTC_HALF_2)),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=p;const N=i.hash;(N.directionalLength!==m||N.pointLength!==y||N.spotLength!==w||N.rectAreaLength!==_||N.hemiLength!==v||N.numDirectionalShadows!==S||N.numPointShadows!==M||N.numSpotShadows!==T||N.numSpotMaps!==I||N.numLightProbes!==L)&&(i.directional.length=m,i.spot.length=w,i.rectArea.length=_,i.point.length=y,i.hemi.length=v,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=M,i.pointShadowMap.length=M,i.spotShadow.length=T,i.spotShadowMap.length=T,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=M,i.spotLightMatrix.length=T+I-C,i.spotLightMap.length=I,i.numSpotLightShadowsWithMaps=C,i.numLightProbes=L,N.directionalLength=m,N.pointLength=y,N.spotLength=w,N.rectAreaLength=_,N.hemiLength=v,N.numDirectionalShadows=S,N.numPointShadows=M,N.numSpotShadows=T,N.numSpotMaps=I,N.numLightProbes=L,i.version=FF++)}function u(f,h){let d=0,p=0,m=0,y=0,w=0;const _=h.matrixWorldInverse;for(let v=0,S=f.length;v<S;v++){const M=f[v];if(M.isDirectionalLight){const T=i.directional[d];T.direction.setFromMatrixPosition(M.matrixWorld),r.setFromMatrixPosition(M.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(_),d++}else if(M.isSpotLight){const T=i.spot[m];T.position.setFromMatrixPosition(M.matrixWorld),T.position.applyMatrix4(_),T.direction.setFromMatrixPosition(M.matrixWorld),r.setFromMatrixPosition(M.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(_),m++}else if(M.isRectAreaLight){const T=i.rectArea[y];T.position.setFromMatrixPosition(M.matrixWorld),T.position.applyMatrix4(_),o.identity(),s.copy(M.matrixWorld),s.premultiply(_),o.extractRotation(s),T.halfWidth.set(M.width*.5,0,0),T.halfHeight.set(0,M.height*.5,0),T.halfWidth.applyMatrix4(o),T.halfHeight.applyMatrix4(o),y++}else if(M.isPointLight){const T=i.point[p];T.position.setFromMatrixPosition(M.matrixWorld),T.position.applyMatrix4(_),p++}else if(M.isHemisphereLight){const T=i.hemi[w];T.direction.setFromMatrixPosition(M.matrixWorld),T.direction.transformDirection(_),w++}}}return{setup:a,setupView:u,state:i}}function IE(n){const e=new zF(n),t=[],i=[];function r(h){f.camera=h,t.length=0,i.length=0}function s(h){t.push(h)}function o(h){i.push(h)}function a(){e.setup(t)}function u(h){e.setupView(t,h)}const f={lightsArray:t,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:f,setupLights:a,setupLightsView:u,pushLight:s,pushShadow:o}}function BF(n){let e=new WeakMap;function t(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new IE(n),e.set(r,[a])):s>=o.length?(a=new IE(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}class _S extends xi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=nR,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 xS extends xi{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 HF=`void main() { 3827 gl_Position = vec4( position, 1.0 ); 3828}`,GF=`uniform sampler2D shadow_pass; 3829uniform vec2 resolution; 3830uniform float radius; 3831#include <packing> 3832void main() {
3833 const float samples = float( VSM_SAMPLES ); 3834 float mean = 0.0; 3835 float squared_mean = 0.0; 3836 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 3837 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 3838 for ( float i = 0.0; i < samples; i ++ ) { 3839 float uvOffset = uvStart + i * uvStride; 3840 #ifdef HORIZONTAL_PASS 3841 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 3842 mean += distribution.x; 3843 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 3844 #else 3845 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 3846 mean += depth; 3847 squared_mean += depth * depth; 3848 #endif 3849 } 3850 mean = mean / samples; 3851 squared_mean = squared_mean / samples; 3852 float std_dev = sqrt( squared_mean - mean * mean ); 3853 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 3854}`;function VF(n,e,t){let i=new ch;const r=new be,s=new be,o=new Xt,a=new _S({depthPacking:iR}),u=new xS,f={},h=t.maxTextureSize,d={[Zs]:Ci,[Ci]:Zs,[jr]:jr},p=new qi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new be},radius:{value:4}},vertexShader:HF,fragmentShader:GF}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const y=new Pt;y.setAttribute("position",new Jt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new xn(y,p),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=wg;let v=this.type;this.render=function(C,L,N){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||C.length===0)return;const B=n.getRenderTarget(),A=n.getActiveCubeFace(),R=n.getActiveMipmapLevel(),j=n.state;j.setBlending(gs),j.buffers.color.setClear(1,1,1,1),j.buffers.depth.setTest(!0),j.setScissorTest(!1);const Y=v!==Hr&&this.type===Hr,Z=v===Hr&&this.type!==Hr;for(let ae=0,Q=C.length;ae<Q;ae++){const pe=C[ae],z=pe.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",pe,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;r.copy(z.mapSize);const ie=z.getFrameExtents();if(r.multiply(ie),s.copy(z.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/ie.x),r.x=s.x*ie.x,z.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/ie.y),r.y=s.y*ie.y,z.mapSize.y=s.y)),z.map===null||Y===!0||Z===!0){const le=this.type!==Hr?{minFilter:Jn,magFilter:Jn}:{};z.map!==null&&z.map.dispose(),z.map=new cr(r.x,r.y,le),z.map.texture.name=pe.name+".shadowMap",z.camera.updateProjectionMatrix()}n.setRenderTarget(z.map),n.clear();const $=z.getViewportCount();for(let le=0;le<$;le++){const ye=z.getViewport(le);o.set(s.x*ye.x,s.y*ye.y,s.x*ye.z,s.y*ye.w),j.viewport(o),z.updateMatrices(pe,le),i=z.getFrustum(),T(L,N,z.camera,pe,this.type)}z.isPointLightShadow!==!0&&this.type===Hr&&S(z,N),z.needsUpdate=!1}v=this.type,_.needsUpdate=!1,n.setRenderTarget(B,A,R)};function S(C,L){const N=e.update(w);p.defines.VSM_SAMPLES!==C.blurSamples&&(p.defines.VSM_SAMPLES=C.blurSamples,m.defines.VSM_SAMPLES=C.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),C.mapPass===null&&(C.mapPass=new cr(r.x,r.y)),p.uniforms.shadow_pass.value=C.map.texture,p.uniforms.resolution.value=C.mapSize,p.uniforms.radius.value=C.radius,n.setRenderTarget(C.mapPass),n.clear(),n.renderBufferDirect(L,null,N,p,w,null),m.uniforms.shadow_pass.value=C.mapPass.texture,m.uniforms.resolution.value=C.mapSize,m.uniforms.radius.value=C.radius,n.setRenderTarget(C.map),n.clear(),n.renderBufferDirect(L,null,N,m,w,null)}function M(C,L,N,B){let A=null;const R=N.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(R!==void 0)A=R;else if(A=N.isPointLight===!0?u:a,n.localClippingEnabled&&L.clipShadows===!0&&Array.isArray(L.clippingPlanes)&&L.clippingPlanes.length!==0||L.displacementMap&&L.displacementScale!==0||L.alphaMap&&L.alphaTest>0||L.map&&L.alphaTest>0){const j=A.uuid,Y=L.uuid;let Z=f[j];Z===void 0&&(Z={},f[j]=Z);let ae=Z[Y];ae===void 0&&(ae=A.clone(),Z[Y]=ae,L.addEventListener("dispose",I)),A=ae}if(A.visible=L.visible,A.wireframe=L.wireframe,B===Hr?A.side=L.shadowSide!==null?L.shadowSide:L.side:A.side=L.shadowSide!==null?L.shadowSide:d[L.side],A.alphaMap=L.alphaMap,A.alphaTest=L.alphaTest,A.map=L.map,A.clipShadows=L.clipShadows,A.clippingPlanes=L.clippingPlanes,A.clipIntersection=L.clipIntersection,A.displacementMap=L.displacementMap,A.displacementScale=L.displacementScale,A.displacementBias=L.displacementBias,A.wireframeLinewidth=L.wireframeLinewidth,A.linewidth=L.linewidth,N.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const j=n.properties.get(A);j.light=N}return A}function T(C,L,N,B,A){if(C.visible===!1)return;if(C.layers.test(L.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&A===Hr)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,C.matrixWorld);const Y=e.update(C),Z=C.material;if(Array.isArray(Z)){const ae=Y.groups;for(let Q=0,pe=ae.length;Q<pe;Q++){const z=ae[Q],ie=Z[z.materialIndex];if(ie&&ie.visible){const $=M(C,ie,B,A);C.onBeforeShadow(n,C,L,N,Y,$,z),n.renderBufferDirect(N,null,Y,$,C,z),C.onAfterShadow(n,C,L,N,Y,$,z)}}}else if(Z.visible){const ae=M(C,Z,B,A);C.onBeforeShadow(n,C,L,N,Y,ae,null),n.renderBufferDirect(N,null,Y,ae,C,null),C.onAfterShadow(n,C,L,N,Y,ae,null)}}const j=C.children;for(let Y=0,Z=j.length;Y<Z;Y++)T(j[Y],L,N,B,A)}function I(C){C.target.removeEventListener("dispose",I);for(const N in f){const B=f[N],A=C.target.uuid;A in B&&(B[A].dispose(),delete B[A])}}}const WF={[xm]:Sm,[Mm]:Tm,[wm]:Am,[qa]:Em,[Sm]:xm,[Tm]:Mm,[Am]:wm,[Em]:qa};function XF(n){function e(){let te=!1;const Je=new Xt;let ne=null;const Te=new Xt(0,0,0,0);return{setMask:function(Ye){ne!==Ye&&!te&&(n.colorMask(Ye,Ye,Ye,Ye),ne=Ye)},setLocked:function(Ye){te=Ye},setClear:function(Ye,et,Ft,ln,Xn){Xn===!0&&(Ye*=ln,et*=ln,Ft*=ln),Je.set(Ye,et,Ft,ln),Te.equals(Je)===!1&&(n.clearColor(Ye,et,Ft,ln),Te.copy(Je))},reset:function(){te=!1,ne=null,Te.set(-1,0,0,0)}}}function t(){let te=!1,Je=!1,ne=null,Te=null,Ye=null;return{setReversed:function(et){Je=et},setTest:function(et){et?we(n.DEPTH_TEST):Ce(n.DEPTH_TEST)},setMask:function(et){ne!==et&&!te&&(n.depthMask(et),ne=et)},setFunc:function(et){if(Je&&(et=WF[et]),Te!==et){switch(et){case xm:n.depthFunc(n.NEVER);break;case Sm:n.depthFunc(n.ALWAYS);break;case Mm:n.depthFunc(n.LESS);break;case qa:n.depthFunc(n.LEQUAL);break;case wm:n.depthFunc(n.EQUAL);break;case Em:n.depthFunc(n.GEQUAL);break;case Tm:n.depthFunc(n.GREATER);break;case Am:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Te=et}},setLocked:function(et){te=et},setClear:function(et){Ye!==et&&(n.clearDepth(et),Ye=et)},reset:function(){te=!1,ne=null,Te=null,Ye=null}}}function i(){let te=!1,Je=null,ne=null,Te=null,Ye=null,et=null,Ft=null,ln=null,Xn=null;return{setTest:function(Bt){te||(Bt?we(n.STENCIL_TEST):Ce(n.STENCIL_TEST))},setMask:function(Bt){Je!==Bt&&!te&&(n.stencilMask(Bt),Je=Bt)},setFunc:function(Bt,kn,Oi){(ne!==Bt||Te!==kn||Ye!==Oi)&&(n.stencilFunc(Bt,kn,Oi),ne=Bt,Te=kn,Ye=Oi)},setOp:function(Bt,kn,Oi){(et!==Bt||Ft!==kn||ln!==Oi)&&(n.stencilOp(Bt,kn,Oi),et=Bt,Ft=kn,ln=Oi)}
vendor: 7,455 bytes, line 3854
3854,setLocked:function(Bt){te=Bt},setClear:function(Bt){Xn!==Bt&&(n.clearStencil(Bt),Xn=Bt)},reset:function(){te=!1,Je=null,ne=null,Te=null,Ye=null,et=null,Ft=null,ln=null,Xn=null}}}const r=new e,s=new t,o=new i,a=new WeakMap,u=new WeakMap;let f={},h={},d=new WeakMap,p=[],m=null,y=!1,w=null,_=null,v=null,S=null,M=null,T=null,I=null,C=new rt(0,0,0),L=0,N=!1,B=null,A=null,R=null,j=null,Y=null;const Z=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let ae=!1,Q=0;const pe=n.getParameter(n.VERSION);pe.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec(pe)[1]),ae=Q>=1):pe.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(pe)[1]),ae=Q>=2);let z=null,ie={};const $=n.getParameter(n.SCISSOR_BOX),le=n.getParameter(n.VIEWPORT),ye=new Xt().fromArray($),De=new Xt().fromArray(le);function ue(te,Je,ne,Te){const Ye=new Uint8Array(4),et=n.createTexture();n.bindTexture(te,et),n.texParameteri(te,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(te,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ft=0;Ft<ne;Ft++)te===n.TEXTURE_3D||te===n.TEXTURE_2D_ARRAY?n.texImage3D(Je,0,n.RGBA,1,1,Te,0,n.RGBA,n.UNSIGNED_BYTE,Ye):n.texImage2D(Je+Ft,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,Ye);return et}const Me={};Me[n.TEXTURE_2D]=ue(n.TEXTURE_2D,n.TEXTURE_2D,1),Me[n.TEXTURE_CUBE_MAP]=ue(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),Me[n.TEXTURE_2D_ARRAY]=ue(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),Me[n.TEXTURE_3D]=ue(n.TEXTURE_3D,n.TEXTURE_3D,1,1),r.setClear(0,0,0,1),s.setClear(1),o.setClear(0),we(n.DEPTH_TEST),s.setFunc(qa),Fe(!1),Ie(U_),we(n.CULL_FACE),G(gs);function we(te){f[te]!==!0&&(n.enable(te),f[te]=!0)}function Ce(te){f[te]!==!1&&(n.disable(te),f[te]=!1)}function ct(te,Je){return h[te]!==Je?(n.bindFramebuffer(te,Je),h[te]=Je,te===n.DRAW_FRAMEBUFFER&&(h[n.FRAMEBUFFER]=Je),te===n.FRAMEBUFFER&&(h[n.DRAW_FRAMEBUFFER]=Je),!0):!1}function gt(te,Je){let ne=p,Te=!1;if(te){ne=d.get(Je),ne===void 0&&(ne=[],d.set(Je,ne));const Ye=te.textures;if(ne.length!==Ye.length||ne[0]!==n.COLOR_ATTACHMENT0){for(let et=0,Ft=Ye.length;et<Ft;et++)ne[et]=n.COLOR_ATTACHMENT0+et;ne.length=Ye.length,Te=!0}}else ne[0]!==n.BACK&&(ne[0]=n.BACK,Te=!0);Te&&n.drawBuffers(ne)}function We(te){return m!==te?(n.useProgram(te),m=te,!0):!1}const nt={[To]:n.FUNC_ADD,[bb]:n.FUNC_SUBTRACT,[Rb]:n.FUNC_REVERSE_SUBTRACT};nt[Cb]=n.MIN,nt[Pb]=n.MAX;const xe={[Ib]:n.ZERO,[Lb]:n.ONE,[Nb]:n.SRC_COLOR,[ym]:n.SRC_ALPHA,[zb]:n.SRC_ALPHA_SATURATE,[Fb]:n.DST_COLOR,[Ub]:n.DST_ALPHA,[Db]:n.ONE_MINUS_SRC_COLOR,[_m]:n.ONE_MINUS_SRC_ALPHA,[kb]:n.ONE_MINUS_DST_COLOR,[Ob]:n.ONE_MINUS_DST_ALPHA,[Bb]:n.CONSTANT_COLOR,[Hb]:n.ONE_MINUS_CONSTANT_COLOR,[Gb]:n.CONSTANT_ALPHA,[Vb]:n.ONE_MINUS_CONSTANT_ALPHA};function G(te,Je,ne,Te,Ye,et,Ft,ln,Xn,Bt){if(te===gs){y===!0&&(Ce(n.BLEND),y=!1);return}if(y===!1&&(we(n.BLEND),y=!0),te!==Ab){if(te!==w||Bt!==N){if((_!==To||M!==To)&&(n.blendEquation(n.FUNC_ADD),_=To,M=To),Bt)switch(te){case Oa:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case O_:n.blendFunc(n.ONE,n.ONE);break;case F_:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case k_:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",te);break}else switch(te){case Oa:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case O_:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case F_:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case k_:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",te);break}v=null,S=null,T=null,I=null,C.set(0,0,0),L=0,w=te,N=Bt}return}Ye=Ye||Je,et=et||ne,Ft=Ft||Te,(Je!==_||Ye!==M)&&(n.blendEquationSeparate(nt[Je],nt[Ye]),_=Je,M=Ye),(ne!==v||Te!==S||et!==T||Ft!==I)&&(n.blendFuncSeparate(xe[ne],xe[Te],xe[et],xe[Ft]),v=ne,S=Te,T=et,I=Ft),(ln.equals(C)===!1||Xn!==L)&&(n.blendColor(ln.r,ln.g,ln.b,Xn),C.copy(ln),L=Xn),w=te,N=!1}function Oe(te,Je){te.side===jr?Ce(n.CULL_FACE):we(n.CULL_FACE);let ne=te.side===Ci;Je&&(ne=!ne),Fe(ne),te.blending===Oa&&te.transparent===!1?G(gs):G(te.blending,te.blendEquation,te.blendSrc,te.blendDst,te.blendEquationAlpha,te.blendSrcAlpha,te.blendDstAlpha,te.blendColor,te.blendAlpha,te.premultipliedAlpha),s.setFunc(te.depthFunc),s.setTest(te.depthTest),s.setMask(te.depthWrite),r.setMask(te.colorWrite);const Te=te.stencilWrite;o.setTest(Te),Te&&(o.setMask(te.stencilWriteMask),o.setFunc(te.stencilFunc,te.stencilRef,te.stencilFuncMask),o.setOp(te.stencilFail,te.stencilZFail,te.stencilZPass)),ft(te.polygonOffset,te.polygonOffsetFactor,te.polygonOffsetUnits),te.alphaToCoverage===!0?we(n.SAMPLE_ALPHA_TO_COVERAGE):Ce(n.SAMPLE_ALPHA_TO_COVERAGE)}function Fe(te){B!==te&&(te?n.frontFace(n.CW):n.frontFace(n.CCW),B=te)}function Ie(te){te!==wb?(we(n.CULL_FACE),te!==A&&(te===U_?n.cullFace(n.BACK):te===Eb?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Ce(n.CULL_FACE),A=te}function He(te){te!==R&&(ae&&n.lineWidth(te),R=te)}function ft(te,Je,ne){te?(we(n.POLYGON_OFFSET_FILL),(j!==Je||Y!==ne)&&(n.polygonOffset(Je,ne),j=Je,Y=ne)):Ce(n.POLYGON_OFFSET_FILL)}function Qe(te){te?we(n.SCISSOR_TEST):Ce(n.SCISSOR_TEST)}function V(te){te===void 0&&(te=n.TEXTURE0+Z-1),z!==te&&(n.activeTexture(te),z=te)}function U(te,Je,ne){ne===void 0&&(z===null?ne=n.TEXTURE0+Z-1:ne=z);let Te=ie[ne];Te===void 0&&(Te={type:void 0,texture:void 0},ie[ne]=Te),(Te.type!==te||Te.texture!==Je)&&(z!==ne&&(n.activeTexture(ne),z=ne),n.bindTexture(te,Je||Me[te]),Te.type=te,Te.texture=Je)}function ce(){const te=ie[z];te!==void 0&&te.type!==void 0&&(n.bindTexture(te.type,null),te.type=void 0,te.texture=void 0)}function Se(){try{n.compressedTexImage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Ee(){try{n.compressedTexImage3D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function _e(){try{n.texSubImage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function at(){try{n.texSubImage3D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Ve(){try{n.compressedTexSubImage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function $e(){try{n.compressedTexSubImage3D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function It(){try{n.texStorage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Ne(){try{n.texStorage3D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function it(){try{n.texImage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Mt(){try{n.texImage3D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function yt(te){ye.equals(te)===!1&&(n.scissor(te.x,te.y,te.z,te.w),ye.copy(te))}function Ge(te){De.equals(te)===!1&&(n.viewport(te.x,te.y,te.z,te.w),De.copy(te))}function Ut(te,Je){let ne=u.get(Je);ne===void 0&&(ne=new WeakMap,u.set(Je,ne));let Te=ne.get(te);Te===void 0&&(Te=n.getUniformBlockIndex(Je,te.name),ne.set(te,Te))}function St(te,Je){const Te=u.get(Je).get(te);a.get(Je)!==Te&&(n.uniformBlockBinding(Je,Te,te.__bindingPointIndex),a.set(Je,Te))}function bt(){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: 5,967 bytes, line 3854
3854(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),f={},z=null,ie={},h={},d=new WeakMap,p=[],m=null,y=!1,w=null,_=null,v=null,S=null,M=null,T=null,I=null,C=new rt(0,0,0),L=0,N=!1,B=null,A=null,R=null,j=null,Y=null,ye.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:we,disable:Ce,bindFramebuffer:ct,drawBuffers:gt,useProgram:We,setBlending:G,setMaterial:Oe,setFlipSided:Fe,setCullFace:Ie,setLineWidth:He,setPolygonOffset:ft,setScissorTest:Qe,activeTexture:V,bindTexture:U,unbindTexture:ce,compressedTexImage2D:Se,compressedTexImage3D:Ee,texImage2D:it,texImage3D:Mt,updateUBOMapping:Ut,uniformBlockBinding:St,texStorage2D:It,texStorage3D:Ne,texSubImage2D:_e,texSubImage3D:at,compressedTexSubImage2D:Ve,compressedTexSubImage3D:$e,scissor:yt,viewport:Ge,reset:bt}}function jF(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 YF(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 qF(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function X_(n,e,t,i){const r=ZF(i);switch(t){case rS:return n*e;case oS:return n*e;case aS:return n*e*2;case rh:return n*e/r.components*r.byteLength;case sh:return n*e/r.components*r.byteLength;case lS:return n*e*2/r.components*r.byteLength;case Rg:return n*e*2/r.components*r.byteLength;case sS:return n*e*3/r.components*r.byteLength;case Ln:return n*e*4/r.components*r.byteLength;case Cg:return n*e*4/r.components*r.byteLength;case Ju:case ef:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case tf:case nf:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Rm:case Pm:return Math.max(n,16)*Math.max(e,8)/4;case bm:case Cm:return Math.max(n,8)*Math.max(e,8)/2;case Im:case Lm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Nm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Dm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Um:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case Om:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case Fm:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case km:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case zm:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case Bm:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case Hm:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Gm:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Vm:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Wm:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Xm:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case jm:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case Ym:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case rf:case qm:case Zm:return Math.ceil(n/4)*Math.ceil(e/4)*16;case cS:case Km:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Qm:case $m:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function ZF(n){switch(n){case Yi:case Eg:return{byteLength:1,components:1};case Tc:case Tg:case ei:return{byteLength:2,components:1};case Ag:case bg:return{byteLength:2,components:4};case xs:case ih:case _n:return{byteLength:4,components:1};case iS:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const KF={contain:jF,cover:YF,fill:qF,getByteLength:X_};function QF(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new be,h=new WeakMap;let d;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(V,U){return m?new OffscreenCanvas(V,U):Ff("canvas")}function w(V,U,ce){let Se=1;const Ee=Qe(V);if((Ee.width>ce||Ee.height>ce)&&(Se=ce/Math.max(Ee.width,Ee.height)),Se<1)if(typeof HTMLImageElement<"u"&&V instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&V instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&V instanceof ImageBitmap||typeof VideoFrame<"u"&&V instanceof VideoFrame){const _e=Math.floor(Se*Ee.width),at=Math.floor(Se*Ee.height);d===void 0&&(d=y(_e,at));const Ve=U?y(_e,at):d;return Ve.width=_e,Ve.height=at,Ve.getContext("2d").drawImage(V,0,0,_e,at),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ee.width+"x"+Ee.height+") to ("+_e+"x"+at+")."),Ve}else return"data"in V&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ee.width+"x"+Ee.height+")."),V;return V}function _(V){return V.generateMipmaps&&V.minFilter!==Jn&&V.minFilter!==Qt}function v(V){n.generateMipmap(V)}function S(V,U,ce,Se,Ee=!1){if(V!==null){if(n[V]!==void 0)return n[V];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+V+"'")}let _e=U;if(U===n.RED&&(ce===n.FLOAT&&(_e=n.R32F),ce===n.HALF_FLOAT&&(_e=n.R16F),ce===n.UNSIGNED_BYTE&&(_e=n.R8)),U===n.RED_INTEGER&&(ce===n.UNSIGNED_BYTE&&(_e=n.R8UI),ce===n.UNSIGNED_SHORT&&(_e=n.R16UI),ce===n.UNSIGNED_INT&&(_e=n.R32UI),ce===n.BYTE&&(_e=n.R8I),ce===n.SHORT&&(_e=n.R16I),ce===n.INT&&(_e=n.R32I)),U===n.RG&&(ce
vendor: 7,259 bytes, line 3854
3854===n.FLOAT&&(_e=n.RG32F),ce===n.HALF_FLOAT&&(_e=n.RG16F),ce===n.UNSIGNED_BYTE&&(_e=n.RG8)),U===n.RG_INTEGER&&(ce===n.UNSIGNED_BYTE&&(_e=n.RG8UI),ce===n.UNSIGNED_SHORT&&(_e=n.RG16UI),ce===n.UNSIGNED_INT&&(_e=n.RG32UI),ce===n.BYTE&&(_e=n.RG8I),ce===n.SHORT&&(_e=n.RG16I),ce===n.INT&&(_e=n.RG32I)),U===n.RGB_INTEGER&&(ce===n.UNSIGNED_BYTE&&(_e=n.RGB8UI),ce===n.UNSIGNED_SHORT&&(_e=n.RGB16UI),ce===n.UNSIGNED_INT&&(_e=n.RGB32UI),ce===n.BYTE&&(_e=n.RGB8I),ce===n.SHORT&&(_e=n.RGB16I),ce===n.INT&&(_e=n.RGB32I)),U===n.RGBA_INTEGER&&(ce===n.UNSIGNED_BYTE&&(_e=n.RGBA8UI),ce===n.UNSIGNED_SHORT&&(_e=n.RGBA16UI),ce===n.UNSIGNED_INT&&(_e=n.RGBA32UI),ce===n.BYTE&&(_e=n.RGBA8I),ce===n.SHORT&&(_e=n.RGBA16I),ce===n.INT&&(_e=n.RGBA32I)),U===n.RGB&&ce===n.UNSIGNED_INT_5_9_9_9_REV&&(_e=n.RGB9_E5),U===n.RGBA){const at=Ee?Lf:Kt.getTransfer(Se);ce===n.FLOAT&&(_e=n.RGBA32F),ce===n.HALF_FLOAT&&(_e=n.RGBA16F),ce===n.UNSIGNED_BYTE&&(_e=at===sn?n.SRGB8_ALPHA8:n.RGBA8),ce===n.UNSIGNED_SHORT_4_4_4_4&&(_e=n.RGBA4),ce===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 M(V,U){let ce;return V?U===null||U===xs||U===Za?ce=n.DEPTH24_STENCIL8:U===_n?ce=n.DEPTH32F_STENCIL8:U===Tc&&(ce=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===xs||U===Za?ce=n.DEPTH_COMPONENT24:U===_n?ce=n.DEPTH_COMPONENT32F:U===Tc&&(ce=n.DEPTH_COMPONENT16),ce}function T(V,U){return _(V)===!0||V.isFramebufferTexture&&V.minFilter!==Jn&&V.minFilter!==Qt?Math.log2(Math.max(U.width,U.height))+1:V.mipmaps!==void 0&&V.mipmaps.length>0?V.mipmaps.length:V.isCompressedTexture&&Array.isArray(V.image)?U.mipmaps.length:1}function I(V){const U=V.target;U.removeEventListener("dispose",I),L(U),U.isVideoTexture&&h.delete(U)}function C(V){const U=V.target;U.removeEventListener("dispose",C),B(U)}function L(V){const U=i.get(V);if(U.__webglInit===void 0)return;const ce=V.source,Se=p.get(ce);if(Se){const Ee=Se[U.__cacheKey];Ee.usedTimes--,Ee.usedTimes===0&&N(V),Object.keys(Se).length===0&&p.delete(ce)}i.remove(V)}function N(V){const U=i.get(V);n.deleteTexture(U.__webglTexture);const ce=V.source,Se=p.get(ce);delete Se[U.__cacheKey],o.memory.textures--}function B(V){const U=i.get(V);if(V.depthTexture&&V.depthTexture.dispose(),V.isWebGLCubeRenderTarget)for(let Se=0;Se<6;Se++){if(Array.isArray(U.__webglFramebuffer[Se]))for(let Ee=0;Ee<U.__webglFramebuffer[Se].length;Ee++)n.deleteFramebuffer(U.__webglFramebuffer[Se][Ee]);else n.deleteFramebuffer(U.__webglFramebuffer[Se]);U.__webglDepthbuffer&&n.deleteRenderbuffer(U.__webglDepthbuffer[Se])}else{if(Array.isArray(U.__webglFramebuffer))for(let Se=0;Se<U.__webglFramebuffer.length;Se++)n.deleteFramebuffer(U.__webglFramebuffer[Se]);else n.deleteFramebuffer(U.__webglFramebuffer);if(U.__webglDepthbuffer&&n.deleteRenderbuffer(U.__webglDepthbuffer),U.__webglMultisampledFramebuffer&&n.deleteFramebuffer(U.__webglMultisampledFramebuffer),U.__webglColorRenderbuffer)for(let Se=0;Se<U.__webglColorRenderbuffer.length;Se++)U.__webglColorRenderbuffer[Se]&&n.deleteRenderbuffer(U.__webglColorRenderbuffer[Se]);U.__webglDepthRenderbuffer&&n.deleteRenderbuffer(U.__webglDepthRenderbuffer)}const ce=V.textures;for(let Se=0,Ee=ce.length;Se<Ee;Se++){const _e=i.get(ce[Se]);_e.__webglTexture&&(n.deleteTexture(_e.__webglTexture),o.memory.textures--),i.remove(ce[Se])}i.remove(V)}let A=0;function R(){A=0}function j(){const V=A;return V>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+V+" texture units while this GPU supports only "+r.maxTextures),A+=1,V}function Y(V){const U=[];return U.push(V.wrapS),U.push(V.wrapT),U.push(V.wrapR||0),U.push(V.magFilter),U.push(V.minFilter),U.push(V.anisotropy),U.push(V.internalFormat),U.push(V.format),U.push(V.type),U.push(V.generateMipmaps),U.push(V.premultiplyAlpha),U.push(V.flipY),U.push(V.unpackAlignment),U.push(V.colorSpace),U.join()}function Z(V,U){const ce=i.get(V);if(V.isVideoTexture&&He(V),V.isRenderTargetTexture===!1&&V.version>0&&ce.__version!==V.version){const Se=V.image;if(Se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{De(ce,V,U);return}}t.bindTexture(n.TEXTURE_2D,ce.__webglTexture,n.TEXTURE0+U)}function ae(V,U){const ce=i.get(V);if(V.version>0&&ce.__version!==V.version){De(ce,V,U);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ce.__webglTexture,n.TEXTURE0+U)}function Q(V,U){const ce=i.get(V);if(V.version>0&&ce.__version!==V.version){De(ce,V,U);return}t.bindTexture(n.TEXTURE_3D,ce.__webglTexture,n.TEXTURE0+U)}function pe(V,U){const ce=i.get(V);if(V.version>0&&ce.__version!==V.version){ue(ce,V,U);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ce.__webglTexture,n.TEXTURE0+U)}const z={[Rf]:n.REPEAT,[Fn]:n.CLAMP_TO_EDGE,[Cf]:n.MIRRORED_REPEAT},ie={[Jn]:n.NEAREST,[nS]:n.NEAREST_MIPMAP_NEAREST,[ic]:n.NEAREST_MIPMAP_LINEAR,[Qt]:n.LINEAR,[$u]:n.LINEAR_MIPMAP_NEAREST,[hs]:n.LINEAR_MIPMAP_LINEAR},$={[sR]:n.NEVER,[fR]:n.ALWAYS,[oR]:n.LESS,[fS]:n.LEQUAL,[aR]:n.EQUAL,[uR]:n.GEQUAL,[lR]:n.GREATER,[cR]:n.NOTEQUAL};function le(V,U){if(U.type===_n&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===Qt||U.magFilter===$u||U.magFilter===ic||U.magFilter===hs||U.minFilter===Qt||U.minFilter===$u||U.minFilter===ic||U.minFilter===hs)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(V,n.TEXTURE_WRAP_S,z[U.wrapS]),n.texParameteri(V,n.TEXTURE_WRAP_T,z[U.wrapT]),(V===n.TEXTURE_3D||V===n.TEXTURE_2D_ARRAY)&&n.texParameteri(V,n.TEXTURE_WRAP_R,z[U.wrapR]),n.texParameteri(V,n.TEXTURE_MAG_FILTER,ie[U.magFilter]),n.texParameteri(V,n.TEXTURE_MIN_FILTER,ie[U.minFilter]),U.compareFunction&&(n.texParameteri(V,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(V,n.TEXTURE_COMPARE_FUNC,$[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===Jn||U.minFilter!==ic&&U.minFilter!==hs||U.type===_n&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||i.get(U).__currentAnisotropy){const ce=e.get("EXT_texture_filter_anisotropic");n.texParameterf(V,ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy}}}function ye(V,U){let ce=!1;V.__webglInit===void 0&&(V.__webglInit=!0,U.addEventListener("dispose",I));const Se=U.source;let Ee=p.get(Se);Ee===void 0&&(Ee={},p.set(Se,Ee));const _e=Y(U);if(_e!==V.__cacheKey){Ee[_e]===void 0&&(Ee[_e]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ce=!0),Ee[_e].usedTimes++;const at=Ee[V.__cacheKey];at!==void 0&&(Ee[V.__cacheKey].usedTimes--,at.usedTimes===0&&N(U)),V.__cacheKey=_e,V.__webglTexture=Ee[_e].texture}return ce}function De(V,U,ce){let Se=n.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(Se=n.TEXTURE_2D_ARRAY),U.isData3DTexture&&(Se=n.TEXTURE_3D);const Ee=ye(V,U),_e=U.source;t.bindTexture(Se,V.__webglTexture,n.TEXTURE0+ce);const at=i.get(_e);if(_e.version!==at.__version||Ee===!0){t.activeTexture(n.TEXTURE0+ce);
vendor: 4,503 bytes, line 3854
3854const Ve=Kt.getPrimaries(Kt.workingColorSpace),$e=U.colorSpace===zs?null:Kt.getPrimaries(U.colorSpace),It=U.colorSpace===zs||Ve===$e?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,U.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,U.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,It);let Ne=w(U.image,!1,r.maxTextureSize);Ne=ft(U,Ne);const it=s.convert(U.format,U.colorSpace),Mt=s.convert(U.type);let yt=S(U.internalFormat,it,Mt,U.colorSpace,U.isVideoTexture);le(Se,U);let Ge;const Ut=U.mipmaps,St=U.isVideoTexture!==!0,bt=at.__version===void 0||Ee===!0,te=_e.dataReady,Je=T(U,Ne);if(U.isDepthTexture)yt=M(U.format===Ka,U.type),bt&&(St?t.texStorage2D(n.TEXTURE_2D,1,yt,Ne.width,Ne.height):t.texImage2D(n.TEXTURE_2D,0,yt,Ne.width,Ne.height,0,it,Mt,null));else if(U.isDataTexture)if(Ut.length>0){St&&bt&&t.texStorage2D(n.TEXTURE_2D,Je,yt,Ut[0].width,Ut[0].height);for(let ne=0,Te=Ut.length;ne<Te;ne++)Ge=Ut[ne],St?te&&t.texSubImage2D(n.TEXTURE_2D,ne,0,0,Ge.width,Ge.height,it,Mt,Ge.data):t.texImage2D(n.TEXTURE_2D,ne,yt,Ge.width,Ge.height,0,it,Mt,Ge.data);U.generateMipmaps=!1}else St?(bt&&t.texStorage2D(n.TEXTURE_2D,Je,yt,Ne.width,Ne.height),te&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,Ne.width,Ne.height,it,Mt,Ne.data)):t.texImage2D(n.TEXTURE_2D,0,yt,Ne.width,Ne.height,0,it,Mt,Ne.data);else if(U.isCompressedTexture)if(U.isCompressedArrayTexture){St&&bt&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Je,yt,Ut[0].width,Ut[0].height,Ne.depth);for(let ne=0,Te=Ut.length;ne<Te;ne++)if(Ge=Ut[ne],U.format!==Ln)if(it!==null)if(St){if(te)if(U.layerUpdates.size>0){const Ye=X_(Ge.width,Ge.height,U.format,U.type);for(const et of U.layerUpdates){const Ft=Ge.data.subarray(et*Ye/Ge.data.BYTES_PER_ELEMENT,(et+1)*Ye/Ge.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ne,0,0,et,Ge.width,Ge.height,1,it,Ft,0,0)}U.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ne,0,0,0,Ge.width,Ge.height,Ne.depth,it,Ge.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,ne,yt,Ge.width,Ge.height,Ne.depth,0,Ge.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else St?te&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,ne,0,0,0,Ge.width,Ge.height,Ne.depth,it,Mt,Ge.data):t.texImage3D(n.TEXTURE_2D_ARRAY,ne,yt,Ge.width,Ge.height,Ne.depth,0,it,Mt,Ge.data)}else{St&&bt&&t.texStorage2D(n.TEXTURE_2D,Je,yt,Ut[0].width,Ut[0].height);for(let ne=0,Te=Ut.length;ne<Te;ne++)Ge=Ut[ne],U.format!==Ln?it!==null?St?te&&t.compressedTexSubImage2D(n.TEXTURE_2D,ne,0,0,Ge.width,Ge.height,it,Ge.data):t.compressedTexImage2D(n.TEXTURE_2D,ne,yt,Ge.width,Ge.height,0,Ge.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):St?te&&t.texSubImage2D(n.TEXTURE_2D,ne,0,0,Ge.width,Ge.height,it,Mt,Ge.data):t.texImage2D(n.TEXTURE_2D,ne,yt,Ge.width,Ge.height,0,it,Mt,Ge.data)}else if(U.isDataArrayTexture)if(St){if(bt&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Je,yt,Ne.width,Ne.height,Ne.depth),te)if(U.layerUpdates.size>0){const ne=X_(Ne.width,Ne.height,U.format,U.type);for(const Te of U.layerUpdates){const Ye=Ne.data.subarray(Te*ne/Ne.data.BYTES_PER_ELEMENT,(Te+1)*ne/Ne.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Te,Ne.width,Ne.height,1,it,Mt,Ye)}U.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Ne.width,Ne.height,Ne.depth,it,Mt,Ne.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,yt,Ne.width,Ne.height,Ne.depth,0,it,Mt,Ne.data);else if(U.isData3DTexture)St?(bt&&t.texStorage3D(n.TEXTURE_3D,Je,yt,Ne.width,Ne.height,Ne.depth),te&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Ne.width,Ne.height,Ne.depth,it,Mt,Ne.data)):t.texImage3D(n.TEXTURE_3D,0,yt,Ne.width,Ne.height,Ne.depth,0,it,Mt,Ne.data);else if(U.isFramebufferTexture){if(bt)if(St)t.texStorage2D(n.TEXTURE_2D,Je,yt,Ne.width,Ne.height);else{let ne=Ne.width,Te=Ne.height;for(let Ye=0;Ye<Je;Ye++)t.texImage2D(n.TEXTURE_2D,Ye,yt,ne,Te,0,it,Mt,null),ne>>=1,Te>>=1}}else if(Ut.length>0){if(St&&bt){const ne=Qe(Ut[0]);t.texStorage2D(n.TEXTURE_2D,Je,yt,ne.width,ne.height)}for(let ne=0,Te=Ut.length;ne<Te;ne++)Ge=Ut[ne],St?te&&t.texSubImage2D(n.TEXTURE_2D,ne,0,0,it,Mt,Ge):t.texImage2D(n.TEXTURE_2D,ne,yt,it,Mt,Ge);U.generateMipmaps=!1}else if(St){if(bt){const ne=Qe(Ne);t.texStorage2D(n.TEXTURE_2D,Je,yt,ne.width,ne.height)}te&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,it,Mt,Ne)}else t.texImage2D(n.TEXTURE_2D,0,yt,it,Mt,Ne);
vendor: 4,602 bytes, line 3854
3854_(U)&&v(Se),at.__version=_e.version,U.onUpdate&&U.onUpdate(U)}V.__version=U.version}function ue(V,U,ce){if(U.image.length!==6)return;const Se=ye(V,U),Ee=U.source;t.bindTexture(n.TEXTURE_CUBE_MAP,V.__webglTexture,n.TEXTURE0+ce);const _e=i.get(Ee);if(Ee.version!==_e.__version||Se===!0){t.activeTexture(n.TEXTURE0+ce);const at=Kt.getPrimaries(Kt.workingColorSpace),Ve=U.colorSpace===zs?null:Kt.getPrimaries(U.colorSpace),$e=U.colorSpace===zs||at===Ve?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,U.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,U.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,$e);const It=U.isCompressedTexture||U.image[0].isCompressedTexture,Ne=U.image[0]&&U.image[0].isDataTexture,it=[];for(let Te=0;Te<6;Te++)!It&&!Ne?it[Te]=w(U.image[Te],!0,r.maxCubemapSize):it[Te]=Ne?U.image[Te].image:U.image[Te],it[Te]=ft(U,it[Te]);const Mt=it[0],yt=s.convert(U.format,U.colorSpace),Ge=s.convert(U.type),Ut=S(U.internalFormat,yt,Ge,U.colorSpace),St=U.isVideoTexture!==!0,bt=_e.__version===void 0||Se===!0,te=Ee.dataReady;let Je=T(U,Mt);le(n.TEXTURE_CUBE_MAP,U);let ne;if(It){St&&bt&&t.texStorage2D(n.TEXTURE_CUBE_MAP,Je,Ut,Mt.width,Mt.height);for(let Te=0;Te<6;Te++){ne=it[Te].mipmaps;for(let Ye=0;Ye<ne.length;Ye++){const et=ne[Ye];U.format!==Ln?yt!==null?St?te&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,Ye,0,0,et.width,et.height,yt,et.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,Ye,Ut,et.width,et.height,0,et.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):St?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,Ye,0,0,et.width,et.height,yt,Ge,et.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,Ye,Ut,et.width,et.height,0,yt,Ge,et.data)}}}else{if(ne=U.mipmaps,St&&bt){ne.length>0&&Je++;const Te=Qe(it[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Je,Ut,Te.width,Te.height)}for(let Te=0;Te<6;Te++)if(Ne){St?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,0,0,it[Te].width,it[Te].height,yt,Ge,it[Te].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,Ut,it[Te].width,it[Te].height,0,yt,Ge,it[Te].data);for(let Ye=0;Ye<ne.length;Ye++){const Ft=ne[Ye].image[Te].image;St?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,Ye+1,0,0,Ft.width,Ft.height,yt,Ge,Ft.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,Ye+1,Ut,Ft.width,Ft.height,0,yt,Ge,Ft.data)}}else{St?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,0,0,yt,Ge,it[Te]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,Ut,yt,Ge,it[Te]);for(let Ye=0;Ye<ne.length;Ye++){const et=ne[Ye];St?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,Ye+1,0,0,yt,Ge,et.image[Te]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Te,Ye+1,Ut,yt,Ge,et.image[Te])}}}_(U)&&v(n.TEXTURE_CUBE_MAP),_e.__version=Ee.version,U.onUpdate&&U.onUpdate(U)}V.__version=U.version}function Me(V,U,ce,Se,Ee,_e){const at=s.convert(ce.format,ce.colorSpace),Ve=s.convert(ce.type),$e=S(ce.internalFormat,at,Ve,ce.colorSpace);if(!i.get(U).__hasExternalTextures){const Ne=Math.max(1,U.width>>_e),it=Math.max(1,U.height>>_e);Ee===n.TEXTURE_3D||Ee===n.TEXTURE_2D_ARRAY?t.texImage3D(Ee,_e,$e,Ne,it,U.depth,0,at,Ve,null):t.texImage2D(Ee,_e,$e,Ne,it,0,at,Ve,null)}t.bindFramebuffer(n.FRAMEBUFFER,V),Ie(U)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Se,Ee,i.get(ce).__webglTexture,0,Fe(U)):(Ee===n.TEXTURE_2D||Ee>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Ee<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Se,Ee,i.get(ce).__webglTexture,_e),t.bindFramebuffer(n.FRAMEBUFFER,null)}function we(V,U,ce){if(n.bindRenderbuffer(n.RENDERBUFFER,V),U.depthBuffer){const Se=U.depthTexture,Ee=Se&&Se.isDepthTexture?Se.type:null,_e=M(U.stencilBuffer,Ee),at=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ve=Fe(U);Ie(U)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ve,_e,U.width,U.height):ce?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ve,_e,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,_e,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,at,n.RENDERBUFFER,V)}else{const Se=U.textures;for(let Ee=0;Ee<Se.length;Ee++){const _e=Se[Ee],at=s.convert(_e.format,_e.colorSpace),Ve=s.convert(_e.type),$e=S(_e.internalFormat,at,Ve,_e.colorSpace),It=Fe(U);ce&&Ie(U)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,It,$e,U.width,U.height):Ie(U)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,It,$e,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,$e,U.width,U.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}
vendor: 12,936 bytes, line 3854
3854function Ce(V,U){if(U&&U.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,V),!(U.depthTexture&&U.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(U.depthTexture).__webglTexture||U.depthTexture.image.width!==U.width||U.depthTexture.image.height!==U.height)&&(U.depthTexture.image.width=U.width,U.depthTexture.image.height=U.height,U.depthTexture.needsUpdate=!0),Z(U.depthTexture,0);const Se=i.get(U.depthTexture).__webglTexture,Ee=Fe(U);if(U.depthTexture.format===Fa)Ie(U)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,Se,0,Ee):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,Se,0);else if(U.depthTexture.format===Ka)Ie(U)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,Se,0,Ee):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,Se,0);else throw new Error("Unknown depthTexture format")}function ct(V){const U=i.get(V),ce=V.isWebGLCubeRenderTarget===!0;if(U.__boundDepthTexture!==V.depthTexture){const Se=V.depthTexture;if(U.__depthDisposeCallback&&U.__depthDisposeCallback(),Se){const Ee=()=>{delete U.__boundDepthTexture,delete U.__depthDisposeCallback,Se.removeEventListener("dispose",Ee)};Se.addEventListener("dispose",Ee),U.__depthDisposeCallback=Ee}U.__boundDepthTexture=Se}if(V.depthTexture&&!U.__autoAllocateDepthBuffer){if(ce)throw new Error("target.depthTexture not supported in Cube render targets");Ce(U.__webglFramebuffer,V)}else if(ce){U.__webglDepthbuffer=[];for(let Se=0;Se<6;Se++)if(t.bindFramebuffer(n.FRAMEBUFFER,U.__webglFramebuffer[Se]),U.__webglDepthbuffer[Se]===void 0)U.__webglDepthbuffer[Se]=n.createRenderbuffer(),we(U.__webglDepthbuffer[Se],V,!1);else{const Ee=V.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,_e=U.__webglDepthbuffer[Se];n.bindRenderbuffer(n.RENDERBUFFER,_e),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ee,n.RENDERBUFFER,_e)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,U.__webglFramebuffer),U.__webglDepthbuffer===void 0)U.__webglDepthbuffer=n.createRenderbuffer(),we(U.__webglDepthbuffer,V,!1);else{const Se=V.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ee=U.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,Ee),n.framebufferRenderbuffer(n.FRAMEBUFFER,Se,n.RENDERBUFFER,Ee)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function gt(V,U,ce){const Se=i.get(V);U!==void 0&&Me(Se.__webglFramebuffer,V,V.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),ce!==void 0&&ct(V)}function We(V){const U=V.texture,ce=i.get(V),Se=i.get(U);V.addEventListener("dispose",C);const Ee=V.textures,_e=V.isWebGLCubeRenderTarget===!0,at=Ee.length>1;if(at||(Se.__webglTexture===void 0&&(Se.__webglTexture=n.createTexture()),Se.__version=U.version,o.memory.textures++),_e){ce.__webglFramebuffer=[];for(let Ve=0;Ve<6;Ve++)if(U.mipmaps&&U.mipmaps.length>0){ce.__webglFramebuffer[Ve]=[];for(let $e=0;$e<U.mipmaps.length;$e++)ce.__webglFramebuffer[Ve][$e]=n.createFramebuffer()}else ce.__webglFramebuffer[Ve]=n.createFramebuffer()}else{if(U.mipmaps&&U.mipmaps.length>0){ce.__webglFramebuffer=[];for(let Ve=0;Ve<U.mipmaps.length;Ve++)ce.__webglFramebuffer[Ve]=n.createFramebuffer()}else ce.__webglFramebuffer=n.createFramebuffer();if(at)for(let Ve=0,$e=Ee.length;Ve<$e;Ve++){const It=i.get(Ee[Ve]);It.__webglTexture===void 0&&(It.__webglTexture=n.createTexture(),o.memory.textures++)}if(V.samples>0&&Ie(V)===!1){ce.__webglMultisampledFramebuffer=n.createFramebuffer(),ce.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ce.__webglMultisampledFramebuffer);for(let Ve=0;Ve<Ee.length;Ve++){const $e=Ee[Ve];ce.__webglColorRenderbuffer[Ve]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,ce.__webglColorRenderbuffer[Ve]);const It=s.convert($e.format,$e.colorSpace),Ne=s.convert($e.type),it=S($e.internalFormat,It,Ne,$e.colorSpace,V.isXRRenderTarget===!0),Mt=Fe(V);n.renderbufferStorageMultisample(n.RENDERBUFFER,Mt,it,V.width,V.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ve,n.RENDERBUFFER,ce.__webglColorRenderbuffer[Ve])}n.bindRenderbuffer(n.RENDERBUFFER,null),V.depthBuffer&&(ce.__webglDepthRenderbuffer=n.createRenderbuffer(),we(ce.__webglDepthRenderbuffer,V,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(_e){t.bindTexture(n.TEXTURE_CUBE_MAP,Se.__webglTexture),le(n.TEXTURE_CUBE_MAP,U);for(let Ve=0;Ve<6;Ve++)if(U.mipmaps&&U.mipmaps.length>0)for(let $e=0;$e<U.mipmaps.length;$e++)Me(ce.__webglFramebuffer[Ve][$e],V,U,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,$e);else Me(ce.__webglFramebuffer[Ve],V,U,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0);_(U)&&v(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(at){for(let Ve=0,$e=Ee.length;Ve<$e;Ve++){const It=Ee[Ve],Ne=i.get(It);t.bindTexture(n.TEXTURE_2D,Ne.__webglTexture),le(n.TEXTURE_2D,It),Me(ce.__webglFramebuffer,V,It,n.COLOR_ATTACHMENT0+Ve,n.TEXTURE_2D,0),_(It)&&v(n.TEXTURE_2D)}t.unbindTexture()}else{let Ve=n.TEXTURE_2D;if((V.isWebGL3DRenderTarget||V.isWebGLArrayRenderTarget)&&(Ve=V.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(Ve,Se.__webglTexture),le(Ve,U),U.mipmaps&&U.mipmaps.length>0)for(let $e=0;$e<U.mipmaps.length;$e++)Me(ce.__webglFramebuffer[$e],V,U,n.COLOR_ATTACHMENT0,Ve,$e);else Me(ce.__webglFramebuffer,V,U,n.COLOR_ATTACHMENT0,Ve,0);_(U)&&v(Ve),t.unbindTexture()}V.depthBuffer&&ct(V)}function nt(V){const U=V.textures;for(let ce=0,Se=U.length;ce<Se;ce++){const Ee=U[ce];if(_(Ee)){const _e=V.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,at=i.get(Ee).__webglTexture;t.bindTexture(_e,at),v(_e),t.unbindTexture()}}}const xe=[],G=[];function Oe(V){if(V.samples>0){if(Ie(V)===!1){const U=V.textures,ce=V.width,Se=V.height;let Ee=n.COLOR_BUFFER_BIT;const _e=V.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,at=i.get(V),Ve=U.length>1;if(Ve)for(let $e=0;$e<U.length;$e++)t.bindFramebuffer(n.FRAMEBUFFER,at.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+$e,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,at.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+$e,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,at.__webglMultisampledFramebuffer),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,at.__webglFramebuffer);for(let $e=0;$e<U.length;$e++){if(V.resolveDepthBuffer&&(V.depthBuffer&&(Ee|=n.DEPTH_BUFFER_BIT),V.stencilBuffer&&V.resolveStencilBuffer&&(Ee|=n.STENCIL_BUFFER_BIT)),Ve){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,at.__webglColorRenderbuffer[$e]);const It=i.get(U[$e]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,It,0)}n.blitFramebuffer(0,0,ce,Se,0,0,ce,Se,Ee,n.NEAREST),u===!0&&(xe.length=0,G.length=0,xe.push(n.COLOR_ATTACHMENT0+$e),V.depthBuffer&&V.resolveDepthBuffer===!1&&(xe.push(_e),G.push(_e),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,G)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,xe))}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),Ve)for(let $e=0;$e<U.length;$e++){t.bindFramebuffer(n.FRAMEBUFFER,at.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+$e,n.RENDERBUFFER,at.__webglColorRenderbuffer[$e]);const It=i.get(U[$e]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,at.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+$e,n.TEXTURE_2D,It,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,at.__webglMultisampledFramebuffer)}else if(V.depthBuffer&&V.resolveDepthBuffer===!1&&u){const U=V.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[U])}}}function Fe(V){return Math.min(r.maxSamples,V.samples)}function Ie(V){const U=i.get(V);return V.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function He(V){const U=o.render.frame;h.get(V)!==U&&(h.set(V,U),V.update())}function ft(V,U){const ce=V.colorSpace,Se=V.format,Ee=V.type;return V.isCompressedTexture===!0||V.isVideoTexture===!0||ce!==Cr&&ce!==zs&&(Kt.getTransfer(ce)===sn?(Se!==Ln||Ee!==Yi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ce)),U}function Qe(V){return typeof HTMLImageElement<"u"&&V instanceof HTMLImageElement?(f.width=V.naturalWidth||V.width,f.height=V.naturalHeight||V.height):typeof VideoFrame<"u"&&V instanceof VideoFrame?(f.width=V.displayWidth,f.height=V.displayHeight):(f.width=V.width,f.height=V.height),f}this.allocateTextureUnit=j,this.resetTextureUnits=R,this.setTexture2D=Z,this.setTexture2DArray=ae,this.setTexture3D=Q,this.setTextureCube=pe,this.rebindTextures=gt,this.setupRenderTarget=We,this.updateRenderTargetMipmap=nt,this.updateMultisampleRenderTarget=Oe,this.setupDepthRenderbuffer=ct,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=Ie}function TR(n,e){function t(i,r=zs){let s;const o=Kt.getTransfer(r);if(i===Yi)return n.UNSIGNED_BYTE;if(i===Ag)return n.UNSIGNED_SHORT_4_4_4_4;if(i===bg)return n.UNSIGNED_SHORT_5_5_5_1;if(i===iS)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===Eg)return n.BYTE;if(i===Tg)return n.SHORT;if(i===Tc)return n.UNSIGNED_SHORT;if(i===ih)return n.INT;if(i===xs)return n.UNSIGNED_INT;if(i===_n)return n.FLOAT;if(i===ei)return n.HALF_FLOAT;if(i===rS)return n.ALPHA;if(i===sS)return n.RGB;if(i===Ln)return n.RGBA;if(i===oS)return n.LUMINANCE;if(i===aS)return n.LUMINANCE_ALPHA;if(i===Fa)return n.DEPTH_COMPONENT;if(i===Ka)return n.DEPTH_STENCIL;if(i===rh)return n.RED;if(i===sh)return n.RED_INTEGER;if(i===lS)return n.RG;if(i===Rg)return n.RG_INTEGER;if(i===Cg)return n.RGBA_INTEGER;if(i===Ju||i===ef||i===tf||i===nf)if(o===sn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Ju)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===ef)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===tf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===nf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Ju)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===ef)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===tf)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===nf)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===bm||i===Rm||i===Cm||i===Pm)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===bm)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Rm)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Cm)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Pm)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Im||i===Lm||i===Nm)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Im||i===Lm)return o===sn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Nm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===Dm||i===Um||i===Om||i===Fm||i===km||i===zm||i===Bm||i===Hm||i===Gm||i===Vm||i===Wm||i===Xm||i===jm||i===Ym)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===Dm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Um)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Om)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Fm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===km)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===zm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Bm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Hm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Gm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Vm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Wm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Xm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===jm)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Ym)return o===sn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===rf||i===qm||i===Zm)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===rf)return o===sn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===qm)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Zm)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===cS||i===Km||i===Qm||i===$m)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===rf)return s.COMPRESSED_RED_RGT
vendor: 6,948 bytes, lines 3854-3878
3854C1_EXT;if(i===Km)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Qm)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===$m)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Za?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class AR extends $n{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class oc extends Gt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const $F={type:"move"};class py{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new oc,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 oc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new k,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new k),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new oc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new k,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new k),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,u=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const w of e.hand.values()){const _=t.getJointPose(w,i),v=this._getHandJoint(f,w);_!==null&&(v.matrix.fromArray(_.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=_.radius),v.visible=_!==null}const h=f.joints["index-finger-tip"],d=f.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,y=.005;f.inputState.pinching&&p>m+y?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&p<=m-y&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent($F)))}return a!==null&&(a.visible=r!==null),u!==null&&(u.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new oc;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const JF=` 3855void main() { 3856 3857 gl_Position = vec4( position, 1.0 ); 3858 3859}`,ek=` 3860uniform sampler2DArray depthColor; 3861uniform float depthWidth; 3862uniform float depthHeight; 3863 3864void main() { 3865 3866 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 3867 3868 if ( coord.x >= 1.0 ) { 3869 3870 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 3871 3872 } else { 3873 3874 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 3875 3876 } 3877 3878}`;class tk{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new nn,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 qi({vertexShader:JF,fragmentShader:ek,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new xn(new Zo(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class nk extends Ms{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",u=1,f=null,h=null,d=null,p=null,m=null,y=null;const w=new tk,_=t.getContextAttributes();let v=null,S=null;const M=[],T=[],I=new be;let C=null;const L=new $n;L.layers.enable(1),L.viewport=new Xt;const N=new $n;N.layers.enable(2),N.viewport=new Xt;const B=[L,N],A=new AR;A.layers.enable(1),A.layers.enable(2);let R=null,j=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ue){let Me=M[ue];return Me===void 0&&(Me=new py,M[ue]=Me),Me.getTargetRaySpace()},this.getControllerGrip=function(ue){let Me=M[ue];return Me===void 0&&(Me=new py,M[ue]=Me),Me.getGripSpace()},this.getHand=function(ue){let Me=M[ue];return Me===void 0&&(Me=new py,M[ue]=Me),Me.getHandSpace()};function Y(ue){const Me=T.indexOf(ue.inputSource);if(Me===-1)return;const we=M[Me];we!==void 0&&(we.update(ue.inputSource,ue.frame,f||o),we.dispatchEvent({type:ue.type,data:ue.inputSource}))}function Z(){r.removeEventListener("select",Y),r.removeEventListener("selectstart",Y),r.removeEventListener("selectend",Y),r.removeEventListener("squeeze",Y),r.removeEventListener("squeezestart",Y),r.removeEventListener("squeezeend",Y),r.removeEventListener("end",Z),r.removeEventListener("inputsourceschange",ae);for(let ue=0;ue<M.length;ue++){const Me=T[ue];Me!==null&&(T[ue]=null,M[ue].disconnect(Me))}R=null,j=null,w.reset(),e.setRenderTarget(v),m=null,p=null,d=null,r=null,S=null,De.stop(),i.isPresenting=!1,e.setPixelRatio(C),e.setSize(I.width,I.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ue){s=ue,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ue){a=ue,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||o},this.setReferenceSpace=function(ue){f=ue},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return d},this.getFrame=function(){return y}
vendor: 6,440 bytes, line 3878
3878,this.getSession=function(){return r},this.setSession=async function(ue){if(r=ue,r!==null){if(v=e.getRenderTarget(),r.addEventListener("select",Y),r.addEventListener("selectstart",Y),r.addEventListener("selectend",Y),r.addEventListener("squeeze",Y),r.addEventListener("squeezestart",Y),r.addEventListener("squeezeend",Y),r.addEventListener("end",Z),r.addEventListener("inputsourceschange",ae),_.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(I),r.renderState.layers===void 0){const Me={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,t,Me),r.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),S=new cr(m.framebufferWidth,m.framebufferHeight,{format:Ln,type:Yi,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil})}else{let Me=null,we=null,Ce=null;_.depth&&(Ce=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Me=_.stencil?Ka:Fa,we=_.stencil?Za:xs);const ct={colorFormat:t.RGBA8,depthFormat:Ce,scaleFactor:s};d=new XRWebGLBinding(r,t),p=d.createProjectionLayer(ct),r.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),S=new cr(p.textureWidth,p.textureHeight,{format:Ln,type:Yi,depthTexture:new yS(p.textureWidth,p.textureHeight,we,void 0,void 0,void 0,void 0,void 0,void 0,Me),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:p.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(u),f=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 w.getDepthTexture()};function ae(ue){for(let Me=0;Me<ue.removed.length;Me++){const we=ue.removed[Me],Ce=T.indexOf(we);Ce>=0&&(T[Ce]=null,M[Ce].disconnect(we))}for(let Me=0;Me<ue.added.length;Me++){const we=ue.added[Me];let Ce=T.indexOf(we);if(Ce===-1){for(let gt=0;gt<M.length;gt++)if(gt>=T.length){T.push(we),Ce=gt;break}else if(T[gt]===null){T[gt]=we,Ce=gt;break}if(Ce===-1)break}const ct=M[Ce];ct&&ct.connect(we)}}const Q=new k,pe=new k;function z(ue,Me,we){Q.setFromMatrixPosition(Me.matrixWorld),pe.setFromMatrixPosition(we.matrixWorld);const Ce=Q.distanceTo(pe),ct=Me.projectionMatrix.elements,gt=we.projectionMatrix.elements,We=ct[14]/(ct[10]-1),nt=ct[14]/(ct[10]+1),xe=(ct[9]+1)/ct[5],G=(ct[9]-1)/ct[5],Oe=(ct[8]-1)/ct[0],Fe=(gt[8]+1)/gt[0],Ie=We*Oe,He=We*Fe,ft=Ce/(-Oe+Fe),Qe=ft*-Oe;if(Me.matrixWorld.decompose(ue.position,ue.quaternion,ue.scale),ue.translateX(Qe),ue.translateZ(ft),ue.matrixWorld.compose(ue.position,ue.quaternion,ue.scale),ue.matrixWorldInverse.copy(ue.matrixWorld).invert(),ct[10]===-1)ue.projectionMatrix.copy(Me.projectionMatrix),ue.projectionMatrixInverse.copy(Me.projectionMatrixInverse);else{const V=We+ft,U=nt+ft,ce=Ie-Qe,Se=He+(Ce-Qe),Ee=xe*nt/U*V,_e=G*nt/U*V;ue.projectionMatrix.makePerspective(ce,Se,Ee,_e,V,U),ue.projectionMatrixInverse.copy(ue.projectionMatrix).invert()}}function ie(ue,Me){Me===null?ue.matrixWorld.copy(ue.matrix):ue.matrixWorld.multiplyMatrices(Me.matrixWorld,ue.matrix),ue.matrixWorldInverse.copy(ue.matrixWorld).invert()}this.updateCamera=function(ue){if(r===null)return;let Me=ue.near,we=ue.far;w.texture!==null&&(w.depthNear>0&&(Me=w.depthNear),w.depthFar>0&&(we=w.depthFar)),A.near=N.near=L.near=Me,A.far=N.far=L.far=we,(R!==A.near||j!==A.far)&&(r.updateRenderState({depthNear:A.near,depthFar:A.far}),R=A.near,j=A.far);const Ce=ue.parent,ct=A.cameras;ie(A,Ce);for(let gt=0;gt<ct.length;gt++)ie(ct[gt],Ce);ct.length===2?z(A,L,N):A.projectionMatrix.copy(L.projectionMatrix),$(ue,A,Ce)};function $(ue,Me,we){we===null?ue.matrix.copy(Me.matrixWorld):(ue.matrix.copy(we.matrixWorld),ue.matrix.invert(),ue.matrix.multiply(Me.matrixWorld)),ue.matrix.decompose(ue.position,ue.quaternion,ue.scale),ue.updateMatrixWorld(!0),ue.projectionMatrix.copy(Me.projectionMatrix),ue.projectionMatrixInverse.copy(Me.projectionMatrixInverse),ue.isPerspectiveCamera&&(ue.fov=Ac*2*Math.atan(1/ue.projectionMatrix.elements[5]),ue.zoom=1)}this.getCamera=function(){return A},this.getFoveation=function(){if(!(p===null&&m===null))return u},this.setFoveation=function(ue){u=ue,p!==null&&(p.fixedFoveation=ue),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=ue)},this.hasDepthSensing=function(){return w.texture!==null},this.getDepthSensingMesh=function(){return w.getMesh(A)};let le=null;function ye(ue,Me){if(h=Me.getViewerPose(f||o),y=Me,h!==null){const we=h.views;m!==null&&(e.setRenderTargetFramebuffer(S,m.framebuffer),e.setRenderTarget(S));let Ce=!1;we.length!==A.cameras.length&&(A.cameras.length=0,Ce=!0);for(let gt=0;gt<we.length;gt++){const We=we[gt];let nt=null;if(m!==null)nt=m.getViewport(We);else{const G=d.getViewSubImage(p,We);nt=G.viewport,gt===0&&(e.setRenderTargetTextures(S,G.colorTexture,p.ignoreDepthValues?void 0:G.depthStencilTexture),e.setRenderTarget(S))}let xe=B[gt];xe===void 0&&(xe=new $n,xe.layers.enable(gt),xe.viewport=new Xt,B[gt]=xe),xe.matrix.fromArray(We.transform.matrix),xe.matrix.decompose(xe.position,xe.quaternion,xe.scale),xe.projectionMatrix.fromArray(We.projectionMatrix),xe.projectionMatrixInverse.copy(xe.projectionMatrix).invert(),xe.viewport.set(nt.x,nt.y,nt.width,nt.height),gt===0&&(A.matrix.copy(xe.matrix),A.matrix.decompose(A.position,A.quaternion,A.scale)),Ce===!0&&A.cameras.push(xe)}const ct=r.enabledFeatures;if(ct&&ct.includes("depth-sensing")){const gt=d.getDepthInformation(we[0]);gt&>.isValid&>.texture&&w.init(e,gt,r.renderState)}}for(let we=0;we<M.length;we++){const Ce=T[we],ct=M[we];Ce!==null&&ct!==void 0&&ct.update(Ce,Me,f||o)}le&&le(ue,Me),Me.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:Me}),y=null}const De=new xR;De.setAnimationLoop(ye),this.setAnimationLoop=function(ue){le=ue},this.dispose=function(){}}}const ha=new Ii,ik=new mt;function rk(n,e){function t(_,v){_.matrixAutoUpdate===!0&&_.updateMatrix(),v.value.copy(_.matrix)}function i(_,v){v.color.getRGB(_.fogColor.value,vR(n)),v.isFog?(_.fogNear.value=v.near,_.fogFar.value=v.far):v.isFogExp2&&(_.fogDensity.value=v.density)}function r(_,v,S,M,T){v.isMeshBasicMaterial||v.isMeshLambertMaterial?s(_,v):v.isMeshToonMaterial?(s(_,v),d(_,v)):v.isMeshPhongMaterial?(s(_,v),h(_,v)):v.isMeshStandardMaterial?(s(_,v),p(_,v),v.isMeshPhysicalMaterial&&m(_,v,T)):v.isMeshMat
vendor: 30,020 bytes, line 3878
3878capMaterial?(s(_,v),y(_,v)):v.isMeshDepthMaterial?s(_,v):v.isMeshDistanceMaterial?(s(_,v),w(_,v)):v.isMeshNormalMaterial?s(_,v):v.isLineBasicMaterial?(o(_,v),v.isLineDashedMaterial&&a(_,v)):v.isPointsMaterial?u(_,v,S,M):v.isSpriteMaterial?f(_,v):v.isShadowMaterial?(_.color.value.copy(v.color),_.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function s(_,v){_.opacity.value=v.opacity,v.color&&_.diffuse.value.copy(v.color),v.emissive&&_.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.bumpMap&&(_.bumpMap.value=v.bumpMap,t(v.bumpMap,_.bumpMapTransform),_.bumpScale.value=v.bumpScale,v.side===Ci&&(_.bumpScale.value*=-1)),v.normalMap&&(_.normalMap.value=v.normalMap,t(v.normalMap,_.normalMapTransform),_.normalScale.value.copy(v.normalScale),v.side===Ci&&_.normalScale.value.negate()),v.displacementMap&&(_.displacementMap.value=v.displacementMap,t(v.displacementMap,_.displacementMapTransform),_.displacementScale.value=v.displacementScale,_.displacementBias.value=v.displacementBias),v.emissiveMap&&(_.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,_.emissiveMapTransform)),v.specularMap&&(_.specularMap.value=v.specularMap,t(v.specularMap,_.specularMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest);const S=e.get(v),M=S.envMap,T=S.envMapRotation;M&&(_.envMap.value=M,ha.copy(T),ha.x*=-1,ha.y*=-1,ha.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(ha.y*=-1,ha.z*=-1),_.envMapRotation.value.setFromMatrix4(ik.makeRotationFromEuler(ha)),_.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=v.reflectivity,_.ior.value=v.ior,_.refractionRatio.value=v.refractionRatio),v.lightMap&&(_.lightMap.value=v.lightMap,_.lightMapIntensity.value=v.lightMapIntensity,t(v.lightMap,_.lightMapTransform)),v.aoMap&&(_.aoMap.value=v.aoMap,_.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,_.aoMapTransform))}function o(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform))}function a(_,v){_.dashSize.value=v.dashSize,_.totalSize.value=v.dashSize+v.gapSize,_.scale.value=v.scale}function u(_,v,S,M){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.size.value=v.size*S,_.scale.value=M*.5,v.map&&(_.map.value=v.map,t(v.map,_.uvTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function f(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.rotation.value=v.rotation,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function h(_,v){_.specular.value.copy(v.specular),_.shininess.value=Math.max(v.shininess,1e-4)}function d(_,v){v.gradientMap&&(_.gradientMap.value=v.gradientMap)}function p(_,v){_.metalness.value=v.metalness,v.metalnessMap&&(_.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,_.metalnessMapTransform)),_.roughness.value=v.roughness,v.roughnessMap&&(_.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,_.roughnessMapTransform)),v.envMap&&(_.envMapIntensity.value=v.envMapIntensity)}function m(_,v,S){_.ior.value=v.ior,v.sheen>0&&(_.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),_.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(_.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,_.sheenColorMapTransform)),v.sheenRoughnessMap&&(_.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,_.sheenRoughnessMapTransform))),v.clearcoat>0&&(_.clearcoat.value=v.clearcoat,_.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(_.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,_.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(_.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Ci&&_.clearcoatNormalScale.value.negate())),v.dispersion>0&&(_.dispersion.value=v.dispersion),v.iridescence>0&&(_.iridescence.value=v.iridescence,_.iridescenceIOR.value=v.iridescenceIOR,_.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(_.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,_.iridescenceMapTransform)),v.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),v.transmission>0&&(_.transmission.value=v.transmission,_.transmissionSamplerMap.value=S.texture,_.transmissionSamplerSize.value.set(S.width,S.height),v.transmissionMap&&(_.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,_.transmissionMapTransform)),_.thickness.value=v.thickness,v.thicknessMap&&(_.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=v.attenuationDistance,_.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(_.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(_.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=v.specularIntensity,_.specularColor.value.copy(v.specularColor),v.specularColorMap&&(_.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,_.specularColorMapTransform)),v.specularIntensityMap&&(_.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,_.specularIntensityMapTransform))}function y(_,v){v.matcap&&(_.matcap.value=v.matcap)}function w(_,v){const S=e.get(v).light;_.referencePosition.value.setFromMatrixPosition(S.matrixWorld),_.nearDistance.value=S.shadow.camera.near,_.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function sk(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function u(S,M){const T=M.program;i.uniformBlockBinding(S,T)}function f(S,M){let T=r[S.id];T===void 0&&(y(S),T=h(S),r[S.id]=T,S.addEventListener("dispose",_));const I=M.program;i.updateUBOMapping(S,I);const C=e.render.frame;s[S.id]!==C&&(p(S),s[S.id]=C)}function h(S){const M=d();S.__bindingPointIndex=M;const T=n.createBuffer(),I=S.__size,C=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,I,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,M,T),T}function d(){for(let S=0;S<a;S++)if(o.indexOf(S)===-1)return o.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(S){const M=r[S.id],T=S.uniforms,I=S.__cache;n.bindBuffer(n.UNIFORM_BUFFER,M);for(let C=0,L=T.length;C<L;C++){const N=Array.isArray(T[C])?T[C]:[T[C]];for(let B=0,A=N.length;B<A;B++){const R=N[B];if(m(R,C,B,I)===!0){const j=R.__offset,Y=Array.isArray(R.value)?R.value:[R.value];let Z=0;for(let ae=0;ae<Y.length;ae++){const Q=Y[ae],pe=w(Q);typeof Q=="number"||typeof Q=="boolean"?(R.__data[0]=Q,n.bufferSubData(n.UNIFORM_BUFFER,j+Z,R.__data)):Q.isMatrix3?(R.__data[0]=Q.elements[0],R.__data[1]=Q.elements[1],R.__data[2]=Q.elements[2],R.__data[3]=0,R.__data[4]=Q.elements[3],R.__data[5]=Q.elements[4],R.__data[6]=Q.elements[5],R.__data[7]=0,R.__data[8]=Q.elements[6],R.__data[9]=Q.elements[7],R.__data[10]=Q.elements[8],R.__data[11]=0):(Q.toArray(R.__data,Z),Z+=pe.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,j,R.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function m(S,M,T,I){const C=S.value,L=M+"_"+T;if(I[L]===void 0)return typeof C=="number"||typeof C=="boolean"?I[L]=C:I[L]=C.clone(),!0;{const N=I[L];if(typeof C=="number"||typeof C=="boolean"){if(N!==C)return I[L]=C,!0}else if(N.equals(C)===!1)return N.copy(C),!0}return!1}function y(S){const M=S.uniforms;let T=0;const I=16;for(let L=0,N=M.length;L<N;L++){const B=Array.isArray(M[L])?M[L]:[M[L]];for(let A=0,R=B.length;A<R;A++){const j=B[A],Y=Array.isArray(j.value)?j.value:[j.value];for(let Z=0,ae=Y.length;Z<ae;Z++){const Q=Y[Z],pe=w(Q),z=T%I,ie=z%pe.boundary,$=z+ie;T+=ie,$!==0&&I-$<pe.storage&&(T+=I-$),j.__data=new Float32Array(pe.storage/Float32Array.BYTES_PER_ELEMENT),j.__offset=T,T+=pe.storage}}}const C=T%I;return C>0&&(T+=I-C),S.__size=T,S.__cache={},this}function w(S){const M={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(M.boundary=4,M.storage=4):S.isVector2?(M.boundary=8,M.storage=8):S.isVector3||S.isColor?(M.boundary=16,M.storage=12):S.isVector4?(M.boundary=16,M.storage=16):S.isMatrix3?(M.boundary=48,M.storage=48):S.isMatrix4?(M.boundary=64,M.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),M}function _(S){const M=S.target;M.removeEventListener("dispose",_);const T=o.indexOf(M.__bindingPointIndex);o.splice(T,1),n.deleteBuffer(r[M.id]),delete r[M.id],delete s[M.id]}function v(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:u,update:f,dispose:v}}class SS{constructor(e={}){const{canvas:t=dR(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:f=!1,powerPreference:h="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 w=null,_=null;const v=[],S=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ir,this.toneMapping=vs,this.toneMappingExposure=1;const M=this;let T=!1,I=0,C=0,L=null,N=-1,B=null;const A=new Xt,R=new Xt;let j=null;const Y=new rt(0);let Z=0,ae=t.width,Q=t.height,pe=1,z=null,ie=null;const $=new Xt(0,0,ae,Q),le=new Xt(0,0,ae,Q);let ye=!1;const De=new ch;let ue=!1,Me=!1;const we=new mt,Ce=new mt,ct=new k,gt=new Xt,We={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let nt=!1;function xe(){return L===null?pe:1}let G=i;function Oe(P,F){return t.getContext(P,F)}try{const P={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:u,preserveDrawingBuffer:f,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${eh}`),t.addEventListener("webglcontextlost",Te,!1),t.addEventListener("webglcontextrestored",Ye,!1),t.addEventListener("webglcontextcreationerror",et,!1),G===null){const F="webgl2";if(G=Oe(F,P),G===null)throw Oe(F)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(P){throw console.error("THREE.WebGLRenderer: "+P.message),P}let Fe,Ie,He,ft,Qe,V,U,ce,Se,Ee,_e,at,Ve,$e,It,Ne,it,Mt,yt,Ge,Ut,St,bt,te;function Je(){Fe=new fO(G),Fe.init(),St=new TR(G,Fe),Ie=new sO(G,Fe,e,St),He=new XF(G),Ie.reverseDepthBuffer&&He.buffers.depth.setReversed(!0),ft=new pO(G),Qe=new LF,V=new QF(G,Fe,He,Qe,Ie,St,ft),U=new aO(M),ce=new uO(M),Se=new SD(G),bt=new iO(G,Se),Ee=new hO(G,Se,ft,bt),_e=new gO(G,Ee,Se,ft),yt=new mO(G,Ie,V),Ne=new oO(Qe),at=new IF(M,U,ce,Fe,Ie,bt,Ne),Ve=new rk(M,Qe),$e=new DF,It=new BF(Fe),Mt=new nO(M,U,ce,He,_e,p,u),it=new VF(M,_e,Ie),te=new sk(G,ft,Ie,He),Ge=new rO(G,Fe,ft),Ut=new dO(G,Fe,ft),ft.programs=at.programs,M.capabilities=Ie,M.extensions=Fe,M.properties=Qe,M.renderLists=$e,M.shadowMap=it,M.state=He,M.info=ft}Je();const ne=new nk(M,G);this.xr=ne,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const P=Fe.get("WEBGL_lose_context");P&&P.loseContext()},this.forceContextRestore=function(){const P=Fe.get("WEBGL_lose_context");P&&P.restoreContext()},this.getPixelRatio=function(){return pe},this.setPixelRatio=function(P){P!==void 0&&(pe=P,this.setSize(ae,Q,!1))},this.getSize=function(P){return P.set(ae,Q)},this.setSize=function(P,F,K=!0){if(ne.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}ae=P,Q=F,t.width=Math.floor(P*pe),t.height=Math.floor(F*pe),K===!0&&(t.style.width=P+"px",t.style.height=F+"px"),this.setViewport(0,0,P,F)},this.getDrawingBufferSize=function(P){return P.set(ae*pe,Q*pe).floor()},this.setDrawingBufferSize=function(P,F,K){ae=P,Q=F,pe=K,t.width=Math.floor(P*K),t.height=Math.floor(F*K),this.setViewport(0,0,P,F)},this.getCurrentViewport=function(P){return P.copy(A)},this.getViewport=function(P){return P.copy($)},this.setViewport=function(P,F,K,q){P.isVector4?$.set(P.x,P.y,P.z,P.w):$.set(P,F,K,q),He.viewport(A.copy($).multiplyScalar(pe).round())},this.getScissor=function(P){return P.copy(le)},this.setScissor=function(P,F,K,q){P.isVector4?le.set(P.x,P.y,P.z,P.w):le.set(P,F,K,q),He.scissor(R.copy(le).multiplyScalar(pe).round())},this.getScissorTest=function(){return ye},this.setScissorTest=function(P){He.setScissorTest(ye=P)},this.setOpaqueSort=function(P){z=P},this.setTransparentSort=function(P){ie=P},this.getClearColor=function(P){return P.copy(Mt.getClearColor())},this.setClearColor=function(){Mt.setClearColor.apply(Mt,arguments)},this.getClearAlpha=function(){return Mt.getClearAlpha()},this.setClearAlpha=function(){Mt.setClearAlpha.apply(Mt,arguments)},this.clear=function(P=!0,F=!0,K=!0){let q=0;if(P){let X=!1;if(L!==null){const oe=L.texture.format;X=oe===Cg||oe===Rg||oe===sh}if(X){const oe=L.texture.type,fe=oe===Yi||oe===xs||oe===Tc||oe===Za||oe===Ag||oe===bg,me=Mt.getClearColor(),ke=Mt.getClearAlpha(),Ae=me.r,Re=me.g,Pe=me.b;fe?(m[0]=Ae,m[1]=Re,m[2]=Pe,m[3]=ke,G.clearBufferuiv(G.COLOR,0,m)):(y[0]=Ae,y[1]=Re,y[2]=Pe,y[3]=ke,G.clearBufferiv(G.COLOR,0,y))}else q|=G.COLOR_BUFFER_BIT}F&&(q|=G.DEPTH_BUFFER_BIT,G.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),K&&(q|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(q)},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",Te,!1),t.removeEventListener("webglcontextrestored",Ye,!1),t.removeEventListener("webglcontextcreationerror",et,!1),$e.dispose(),It.dispose(),Qe.dispose(),U.dispose(),ce.dispose(),_e.dispose(),bt.dispose(),te.dispose(),at.dispose(),ne.dispose(),ne.removeEventListener("sessionstart",al),ne.removeEventListener("sessionend",ll),Pr.stop()};function Te(P){P.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),T=!0}function Ye(){console.log("THREE.WebGLRenderer: Context Restored."),T=!1;const P=ft.autoReset,F=it.enabled,K=it.autoUpdate,q=it.needsUpdate,X=it.type;Je(),ft.autoReset=P,it.enabled=F,it.autoUpdate=K,it.needsUpdate=q,it.type=X}function et(P){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",P.statusMessage)}function Ft(P){const F=P.target;F.removeEventListener("dispose",Ft),ln(F)}function ln(P){Xn(P),Qe.remove(P)}function Xn(P){const F=Qe.get(P).programs;F!==void 0&&(F.forEach(function(K){at.releaseProgram(K)}),P.isShaderMaterial&&at.releaseShaderCache(P))}this.renderBufferDirect=function(P,F,K,q,X,oe){F===null&&(F=We);const fe=X.isMesh&&X.matrixWorld.determinant()<0,me=O(P,F,K,q,X);He.setMaterial(q,fe);let ke=K.index,Ae=1;if(q.wireframe===!0){if(ke=Ee.getWireframeAttribute(K),ke===void 0)return;Ae=2}const Re=K.drawRange,Pe=K.attributes.position;let Ze=Re.start*Ae,ut=(Re.start+Re.count)*Ae;oe!==null&&(Ze=Math.max(Ze,oe.start*Ae),ut=Math.min(ut,(oe.start+oe.count)*Ae)),ke!==null?(Ze=Math.max(Ze,0),ut=Math.min(ut,ke.count)):Pe!=null&&(Ze=Math.max(Ze,0),ut=Math.min(ut,Pe.count));const dt=ut-Ze;if(dt<0||dt===1/0)return;bt.setup(X,q,me,K,ke);let ht,qe=Ge;if(ke!==null&&(ht=Se.get(ke),qe=Ut,qe.setIndex(ht)),X.isMesh)q.wireframe===!0?(He.setLineWidth(q.wireframeLinewidth*xe()),qe.setMode(G.LINES)):qe.setMode(G.TRIANGLES);else if(X.isLine){let Ue=q.linewidth;Ue===void 0&&(Ue=1),He.setLineWidth(Ue*xe()),X.isLineSegments?qe.setMode(G.LINES):X.isLineLoop?qe.setMode(G.LINE_LOOP):qe.setMode(G.LINE_STRIP)}else X.isPoints?qe.setMode(G.POINTS):X.isSprite&&qe.setMode(G.TRIANGLES);if(X.isBatchedMesh)if(X._multiDrawInstances!==null)qe.renderMultiDrawInstances(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount,X._multiDrawInstances);else if(Fe.get("WEBGL_multi_draw"))qe.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const Ue=X._multiDrawStarts,wt=X._multiDrawCounts,tt=X._multiDrawCount,kt=ke?Se.get(ke).bytesPerElement:1,mn=Qe.get(q).currentProgram.getUniforms();for(let Ht=0;Ht<tt;Ht++)mn.setValue(G,"_gl_DrawID",Ht),qe.render(Ue[Ht]/kt,wt[Ht])}else if(X.isInstancedMesh)qe.renderInstances(Ze,dt,X.count);else if(K.isInstancedBufferGeometry){const Ue=K._maxInstanceCount!==void 0?K._maxInstanceCount:1/0,wt=Math.min(K.instanceCount,Ue);qe.renderInstances(Ze,dt,wt)}else qe.render(Ze,dt)};function Bt(P,F,K){P.transparent===!0&&P.side===jr&&P.forceSinglePass===!1?(P.side=Ci,P.needsUpdate=!0,Es(P,F,K),P.side=Zs,P.needsUpdate=!0,Es(P,F,K),P.side=jr):Es(P,F,K)}this.compile=function(P,F,K=null){K===null&&(K=P),_=It.get(K),_.init(F),S.push(_),K.traverseVisible(function(X){X.isLight&&X.layers.test(F.layers)&&(_.pushLight(X),X.castShadow&&_.pushShadow(X))}),P!==K&&P.traverseVisible(function(X){X.isLight&&X.layers.test(F.layers)&&(_.pushLight(X),X.castShadow&&_.pushShadow(X))}),_.setupLights();const q=new Set;return P.traverse(function(X){if(!(X.isMesh||X.isPoints||X.isLine||X.isSprite))return;const oe=X.material;if(oe)if(Array.isArray(oe))for(let fe=0;fe<oe.length;fe++){const me=oe[fe];Bt(me,K,X),q.add(me)}else Bt(oe,K,X),q.add(oe)}),S.pop(),_=null,q},this.compileAsync=function(P,F,K=null){const q=this.compile(P,F,K);return new Promise(X=>{function oe(){if(q.forEach(function(fe){Qe.get(fe).currentProgram.isReady()&&q.delete(fe)}),q.size===0){X(P);return}setTimeout(oe,10)}Fe.get("KHR_parallel_shader_compile")!==null?oe():setTimeout(oe,10)})};let kn=null;function Oi(P){kn&&kn(P)}function al(){Pr.stop()}function ll(){Pr.start()}const Pr=new xR;Pr.setAnimationLoop(Oi),typeof self<"u"&&Pr.setContext(self),this.setAnimationLoop=function(P){kn=P,ne.setAnimationLoop(P),P===null?Pr.stop():Pr.start()},ne.addEventListener("sessionstart",al),ne.addEventListener("sessionend",ll),this.render=function(P,F){if(F!==void 0&&F.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;if(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),F.parent===null&&F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ne.enabled===!0&&ne.isPresenting===!0&&(ne.cameraAutoUpdate===!0&&ne.updateCamera(F),F=ne.getCamera()),P.isScene===!0&&P.onBeforeRender(M,P,F,L),_=It.get(P,S.length),_.init(F),S.push(_),Ce.multiplyMatrices(F.projectionMatrix,F.matrixWorldInverse),De.setFromProjectionMatrix(Ce),Me=this.localClippingEnabled,ue=Ne.init(this.clippingPlanes,Me),w=$e.get(P,v.length),w.init(),v.push(w),ne.enabled===!0&&ne.isPresenting===!0){const oe=M.xr.getDepthSensingMesh();oe!==null&&Ir(oe,F,-1/0,M.sortObjects)}Ir(P,F,0,M.sortObjects),w.finish(),M.sortObjects===!0&&w.sort(z,ie),nt=ne.enabled===!1||ne.isPresenting===!1||ne.hasDepthSensing()===!1,nt&&Mt.addToRenderList(w,P),this.info.render.frame++,ue===!0&&Ne.beginShadows();const K=_.state.shadowsArray;it.render(K,P,F),ue===!0&&Ne.endShadows(),this.info.autoReset===!0&&this.info.reset();const q=w.opaque,X=w.transmissive;if(_.setupLights(),F.isArrayCamera){const oe=F.cameras;if(X.length>0)for(let fe=0,me=oe.length;fe<me;fe++){const ke=oe[fe];es(q,X,P,ke)}nt&&Mt.render(P);for(let fe=0,me=oe.length;fe<me;fe++){const ke=oe[fe];Js(w,P,ke,ke.viewport)}}else X.length>0&&es(q,X,P,F),nt&&Mt.render(P),Js(w,P,F);L!==null&&(V.updateMultisampleRenderTarget(L),V.updateRenderTargetMipmap(L)),P.isScene===!0&&P.onAfterRender(M,P,F),bt.resetDefaultState(),N=-1,B=null,S.pop(),S.length>0?(_=S[S.length-1],ue===!0&&Ne.setGlobalState(M.clippingPlanes,_.state.camera)):_=null,v.pop(),v.length>0?w=v[v.length-1]:w=null};function Ir(P,F,K,q){if(P.visible===!1)return;if(P.layers.test(F.layers)){if(P.isGroup)K=P.renderOrder;else if(P.isLOD)P.autoUpdate===!0&&P.update(F);else if(P.isLight)_.pushLight(P),P.castShadow&&_.pushShadow(P);else if(P.isSprite){if(!P.frustumCulled||De.intersectsSprite(P)){q&>.setFromMatrixPosition(P.matrixWorld).applyMatrix4(Ce);const fe=_e.update(P),me=P.material;me.visible&&w.push(P,fe,me,K,gt.z,null)}}else if((P.isMesh||P.isLine||P.isPoints)&&(!P.frustumCulled||De.intersectsObject(P))){const fe=_e.update(P),me=P.material;if(q&&(P.boundingSphere!==void 0?(P.boundingSphere===null&&P.computeBoundingSphere(),gt.copy(P.boundingSphere.center)):(fe.boundingSphere===null&&fe.computeBoundingSphere(),gt.copy(fe.boundingSphere.center)),gt.applyMatrix4(P.matrixWorld).applyMatrix4(Ce)),Array.isArray(me)){const ke=fe.groups;for(let Ae=0,Re=ke.length;Ae<Re;Ae++){const Pe=ke[Ae],Ze=me[Pe.materialIndex];Ze&&Ze.visible&&w.push(P,fe,Ze,K,gt.z,Pe)}}else me.visible&&w.push(P,fe,me,K,gt.z,null)}}const oe=P.children;for(let fe=0,me=oe.length;fe<me;fe++)Ir(oe[fe],F,K,q)}function Js(P,F,K,q){const X=P.opaque,oe=P.transmissive,fe=P.transparent;_.setupLightsView(K),ue===!0&&Ne.setGlobalState(M.clippingPlanes,K),q&&He.viewport(A.copy(q)),X.length>0&&ai(X,F,K),oe.length>0&&ai(oe,F,K),fe.length>0&&ai(fe,F,K),He.buffers.depth.setTest(!0),He.buffers.depth.setMask(!0),He.buffers.color.setMask(!0),He.setPolygonOffset(!1)}function es(P,F,K,q){if((K.isScene===!0?K.overrideMaterial:null)!==null)return;_.state.transmissionRenderTarget[q.id]===void 0&&(_.state.transmissionRenderTarget[q.id]=new cr(1,1,{generateMipmaps:!0,type:Fe.has("EXT_color_buffer_half_float")||Fe.has("EXT_color_buffer_float")?ei:Yi,minFilter:hs,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Kt.workingColorSpace}));const oe=_.state.transmissionRenderTarget[q.id],fe=q.viewport||A;oe.setSize(fe.z,fe.w);const me=M.getRenderTarget();M.setRenderTarget(oe),M.getClearColor(Y),Z=M.getClearAlpha(),Z<1&&M.setClearColor(16777215,.5),M.clear(),nt&&Mt.render(K);const ke=M.toneMapping;M.toneMapping=vs;const Ae=q.viewport;if(q.viewport!==void 0&&(q.viewport=void 0),_.setupLightsView(q),ue===!0&&Ne.setGlobalState(M.clippingPlanes,q),ai(P,K,q),V.updateMultisampleRenderTarget(oe),V.updateRenderTargetMipmap(oe),Fe.has("WEBGL_multisampled_render_to_texture")===!1){let Re=!1;for(let Pe=0,Ze=F.length;Pe<Ze;Pe++){const ut=F[Pe],dt=ut.object,ht=ut.geometry,qe=ut.material,Ue=ut.group;if(qe.side===jr&&dt.layers.test(q.layers)){const wt=qe.side;qe.side=Ci,qe.needsUpdate=!0,Nt(dt,K,q,ht,qe,Ue),qe.side=wt,qe.needsUpdate=!0,Re=!0}}Re===!0&&(V.updateMultisampleRenderTarget(oe),V.updateRenderTargetMipmap(oe))}M.setRenderTarget(me),M.setClearColor(Y,Z),Ae!==void 0&&(q.viewport=Ae),M.toneMapping=ke}function ai(P,F,K){const q=F.isScene===!0?F.overrideMaterial:null;for(let X=0,oe=P.length;X<oe;X++){const fe=P[X],me=fe.object,ke=fe.geometry,Ae=q===null?fe.material:q,Re=fe.group;me.layers.test(K.layers)&&Nt(me,F,K,ke,Ae,Re)}}function Nt(P,F,K,q,X,oe){P.onBeforeRender(M,F,K,q,X,oe),P.modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,P.matrixWorld),P.normalMatrix.getNormalMatrix(P.modelViewMatrix),X.onBeforeRender(M,F,K,q,P,oe),X.transparent===!0&&X.side===jr&&X.forceSinglePass===!1?(X.side=Ci,X.needsUpdate=!0,M.renderBufferDirect(K,F,q,X,P,oe),X.side=Zs,X.needsUpdate=!0,M.renderBufferDirect(K,F,q,X,P,oe),X.side=jr):M.renderBufferDirect(K,F,q,X,P,oe),P.onAfterRender(M,F,K,q,X,oe)}function Es(P,F,K){F.isScene!==!0&&(F=We);const q=Qe.get(P),X=_.state.lights,oe=_.state.shadowsArray,fe=X.state.version,me=at.getParameters(P,X.state,oe,F,K),ke=at.getProgramCacheKey(me);let Ae=q.programs;q.environment=P.isMeshStandardMaterial?F.environment:null,q.fog=F.fog,q.envMap=(P.isMeshStandardMaterial?ce:U).get(P.envMap||q.environment),q.envMapRotation=q.environment!==null&&P.envMap===null?F.environmentRotation:P.envMapRotation,Ae===void 0&&(P.addEventListener("dispose",Ft),Ae=new Map,q.programs=Ae);let Re=Ae.get(ke);if(Re!==void 0){if(q.currentProgram===Re&&q.lightsStateVersion===fe)return D(P,me),Re}else me.uniforms=at.getUniforms(P),P.onBeforeCompile(me,M),Re=at.acquireProgram(me,ke),Ae.set(ke,Re),q.uniforms=me.uniforms;const Pe=q.uniforms;return(!P.isShaderMaterial&&!P.isRawShaderMaterial||P.clipping===!0)&&(Pe.clippingPlanes=Ne.uniform),D(P,me),q.needsLights=de(P),q.lightsStateVersion=fe,q.needsLights&&(Pe.ambientLightColor.value=X.state.ambient,Pe.lightProbe.value=X.state.probe,Pe.directionalLights.value=X.state.directional,Pe.directionalLightShadows.value=X.state.directionalShadow,Pe.spotLights.value=X.state.spot,Pe.spotLightShadows.value=X.state.spotShadow,Pe.rectAreaLights.value=X.state.rectArea,Pe.ltc_1.value=X.state.rectAreaLTC1,Pe.ltc_2.value=X.state.rectAreaLTC2,Pe.pointLights.value=X.state.point,Pe.pointLightShadows.value=X.state.pointShadow,Pe.hemisphereLights.value=X.state.hemi,Pe.directionalShadowMap.value=X.state.directionalShadowMap,Pe.directionalShadowMatrix.value=X.state.directionalShadowMatrix,Pe.spotShadowMap.value=X.state.spotShadowMap,Pe.spotLightMatrix.value=X.state.spotLightMatrix,Pe.spotLightMap.value=X.state.spotLightMap,Pe.pointShadowMap.value=X.state.pointShadowMap,Pe.pointShadowMatrix.value=X.state.pointShadowMatrix),q.currentProgram=Re,q.uniformsList=null,Re}function cl(P){if(P.uniformsList===null){const F=P.currentProgram.getUniforms();P.uniformsList=Gp.seqWithValue(F.seq,P.uniforms)}return P.uniformsList}function D(P,F){const K=Qe.get(P);K.outputColorSpace=F.outputColorSpace,K.batching=F.batching,K.batchingColor=F.batchingColor,K.instancing=F.instancing,K.instancingColor=F.instancingColor,K.instancingMorph=F.instancingMorph,K.skinning=F.skinning,K.morphTargets=F.morphTargets,K.morphNormals=F.morphNormals,K.morphColors=F.morphColors,K.morphTargetsCount=F.morphTargetsCount,K.numClippingPlanes=F.numClippingPlanes,K.numIntersection=F.numClipIntersection,K.vertexAlphas=F.vertexAlphas,K.vertexTangents=F.vertexTangents,K.toneMapping=F.toneMapping}function O(P,F,K,q,X){F.isScene!==!0&&(F=We),V.resetTextureUnits();const oe=F.fog,fe=q.isMeshStandardMaterial?F.environment:null,me=L===null?M.outputColorSpace:L.isXRRenderTarget===!0?L.texture.colorSpace:Cr,ke=(q.isMeshStandardMaterial?ce:U).get(q.envMap||fe),Ae=q.vertexColors===!0&&!!K.attributes.color&&K.attributes.color.itemSize===4,Re=!!K.attributes.tangent&&(!!q.normalMap||q.anisotropy>0),Pe=!!K.morphAttributes.position,Ze=!!K.morphAttributes.normal,ut=!!K.morphAttributes.color;let dt=vs;q.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(dt=M.toneMapping);const ht=K.morphAttributes.position||K.morphAttributes.normal||K.morphAttributes.color,qe=ht!==void 0?ht.length:0,Ue=Qe.get(q),wt=_.state.lights;if(ue===!0&&(Me===!0||P!==B)){const Et=P===B&&q.id===N;Ne.setState(q,P,Et)}let tt=!1;q.version===Ue.__version?(Ue.needsLights&&Ue.lightsStateVersion!==wt.state.version||Ue.outputColorSpace!==me||X.isBatchedMesh&&Ue.batching===!1||!X.isBatchedMesh&&Ue.batching===!0||X.isBatchedMesh&&Ue.batchingColor===!0&&X.colorTexture===null||X.isBatchedMesh&&Ue.batchingColor===!1&&X.colorTexture!==null||X.isInstancedMesh&&Ue.instancing===!1||!X.isInstancedMesh&&Ue.instancing===!0||X.isSkinnedMesh&&Ue.skinning===!1||!X.isSkinnedMesh&&Ue.skinning===!0||X.isInstancedMesh&&Ue.instancingColor===!0&&X.instanceColor===null||X.isInstancedMesh&&Ue.instancingColor===!1&&X.instanceColor!==null||X.isInstancedMesh&&Ue.instancingMorph===!0&&X.morphTexture===null||X.isInstancedMesh&&Ue.instancingMorph===!1&&X.morphTexture!==null||Ue.envMap!==ke||q.fog===!0&&Ue.fog!==oe||Ue.numClippingPlanes!==void 0&&(Ue.numClippingPlanes!==Ne.numPlanes||Ue.numIntersection!==Ne.numIntersection)||Ue.vertexAlphas!==Ae||Ue.vertexTangents!==Re||Ue.morphTargets!==Pe||Ue.morphNormals!==Ze||Ue.morphColors!==ut||Ue.toneMapping!==dt||Ue.morphTargetsCount!==qe)&&(tt=!0):(tt=!0,Ue.__version=q.version);let kt=Ue.currentProgram;tt===!0&&(kt=Es(q,F,X));let mn=!1,Ht=!1,Rn=!1;const _t=kt.getUniforms(),en=Ue.uniforms;if(He.useProgram(kt.program)&&(mn=!0,Ht=!0,Rn=!0),q.id!==N&&(N=q.id,Ht=!0),mn||B!==P){Ie.reverseDepthBuffer?(we.copy(P.projectionMatrix),jN(we),YN(we),_t.setValue(G,"projectionMatrix",we)):_t.setValue(G,"projectionMatrix",P.projectionMatrix),_t.setValue(G,"viewMatrix",P.matrixWorldInverse);const Et=_t.map.cameraPosition;Et!==void 0&&Et.setValue(G,ct.setFromMatrixPosition(P.matrixWorld)),Ie.logarithmicDepthBuffer&&_t.setValue(G,"logDepthBufFC",2/(Math.log(P.far+1)/Math.LN2)),(q.isMeshPhongMaterial||q.isMeshToonMaterial||q.isMeshLambertMaterial||q.isMeshBasicMaterial||q.isMeshStandardMaterial||q.isShaderMaterial)&&_t.setValue(G,"isOrthographic",P.isOrthographicCamera===!0),B!==P&&(B=P,Ht=!0,Rn=!0)}if(X.isSkinnedMesh){_t.setOptional(G,X,"bindMatrix"),_t.setOptional(G,X,"bindMatrixInverse");const Et=X.skeleton;Et&&(Et.boneTexture===null&&Et.computeBoneTexture(),_t.setValue(G,"boneTexture",Et.boneTexture,V))}X.isBatchedMesh&&(_t.setOptional(G,X,"batchingTexture"),_t.setValue(G,"batchingTexture",X._matricesTexture,V),_t.setOptional(G,X,"batchingIdTexture"),_t.setValue(G,"batchingIdTexture",X._indirectTexture,V),_t.setOptional(G,X,"batchingColorTexture"),X._colorsTexture!==null&&_t.setValue(G,"batchingColorTexture",X._colorsTexture,V));const Vt=K.morphAttributes;if((Vt.position!==void 0||Vt.normal!==void 0||Vt.color!==void 0)&&yt.update(X,K,kt),(Ht||Ue.receiveShadow!==X.receiveShadow)&&(Ue.receiveShadow=X.receiveShadow,_t.setValue(G,"re
3878ceiveShadow",X.receiveShadow)),q.isMeshGouraudMaterial&&q.envMap!==null&&(en.envMap.value=ke,en.flipEnvMap.value=ke.isCubeTexture&&ke.isRenderTargetTexture===!1?-1:1),q.isMeshStandardMaterial&&q.envMap===null&&F.environment!==null&&(en.envMapIntensity.value=F.environmentIntensity),Ht&&(_t.setValue(G,"toneMappingExposure",M.toneMappingExposure),Ue.needsLights&&J(en,Rn),oe&&q.fog===!0&&Ve.refreshFogUniforms(en,oe),Ve.refreshMaterialUniforms(en,q,pe,Q,_.state.transmissionRenderTarget[P.id]),Gp.upload(G,cl(Ue),en,V)),q.isShaderMaterial&&q.uniformsNeedUpdate===!0&&(Gp.upload(G,cl(Ue),en,V),q.uniformsNeedUpdate=!1),q.isSpriteMaterial&&_t.setValue(G,"center",X.center),_t.setValue(G,"modelViewMatrix",X.modelViewMatrix),_t.setValue(G,"normalMatrix",X.normalMatrix),_t.setValue(G,"modelMatrix",X.matrixWorld),q.isShaderMaterial||q.isRawShaderMaterial){const Et=q.uniformsGroups;for(let tn=0,Lr=Et.length;tn<Lr;tn++){const jn=Et[tn];te.update(jn,kt),te.bind(jn,kt)}}return kt}function J(P,F){P.ambientLightColor.needsUpdate=F,P.lightProbe.needsUpdate=F,P.directionalLights.needsUpdate=F,P.directionalLightShadows.needsUpdate=F,P.pointLights.needsUpdate=F,P.pointLightShadows.needsUpdate=F,P.spotLights.needsUpdate=F,P.spotLightShadows.needsUpdate=F,P.rectAreaLights.needsUpdate=F,P.hemisphereLights.needsUpdate=F}function de(P){return P.isMeshLambertMaterial||P.isMeshToonMaterial||P.isMeshPhongMaterial||P.isMeshStandardMaterial||P.isShadowMaterial||P.isShaderMaterial&&P.lights===!0}this.getActiveCubeFace=function(){return I},this.getActiveMipmapLevel=function(){return C},this.getRenderTarget=function(){return L},this.setRenderTargetTextures=function(P,F,K){Qe.get(P.texture).__webglTexture=F,Qe.get(P.depthTexture).__webglTexture=K;const q=Qe.get(P);q.__hasExternalTextures=!0,q.__autoAllocateDepthBuffer=K===void 0,q.__autoAllocateDepthBuffer||Fe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),q.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(P,F){const K=Qe.get(P);K.__webglFramebuffer=F,K.__useDefaultFramebuffer=F===void 0},this.setRenderTarget=function(P,F=0,K=0){L=P,I=F,C=K;let q=!0,X=null,oe=!1,fe=!1;if(P){const ke=Qe.get(P);if(ke.__useDefaultFramebuffer!==void 0)He.bindFramebuffer(G.FRAMEBUFFER,null),q=!1;else if(ke.__webglFramebuffer===void 0)V.setupRenderTarget(P);else if(ke.__hasExternalTextures)V.rebindTextures(P,Qe.get(P.texture).__webglTexture,Qe.get(P.depthTexture).__webglTexture);else if(P.depthBuffer){const Pe=P.depthTexture;if(ke.__boundDepthTexture!==Pe){if(Pe!==null&&Qe.has(Pe)&&(P.width!==Pe.image.width||P.height!==Pe.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");V.setupDepthRenderbuffer(P)}}const Ae=P.texture;(Ae.isData3DTexture||Ae.isDataArrayTexture||Ae.isCompressedArrayTexture)&&(fe=!0);const Re=Qe.get(P).__webglFramebuffer;P.isWebGLCubeRenderTarget?(Array.isArray(Re[F])?X=Re[F][K]:X=Re[F],oe=!0):P.samples>0&&V.useMultisampledRTT(P)===!1?X=Qe.get(P).__webglMultisampledFramebuffer:Array.isArray(Re)?X=Re[K]:X=Re,A.copy(P.viewport),R.copy(P.scissor),j=P.scissorTest}else A.copy($).multiplyScalar(pe).floor(),R.copy(le).multiplyScalar(pe).floor(),j=ye;if(He.bindFramebuffer(G.FRAMEBUFFER,X)&&q&&He.drawBuffers(P,X),He.viewport(A),He.scissor(R),He.setScissorTest(j),oe){const ke=Qe.get(P.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+F,ke.__webglTexture,K)}else if(fe){const ke=Qe.get(P.texture),Ae=F||0;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,ke.__webglTexture,K||0,Ae)}N=-1},this.readRenderTargetPixels=function(P,F,K,q,X,oe,fe){if(!(P&&P.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let me=Qe.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&fe!==void 0&&(me=me[fe]),me){He.bindFramebuffer(G.FRAMEBUFFER,me);try{const ke=P.texture,Ae=ke.format,Re=ke.type;if(!Ie.textureFormatReadable(Ae)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ie.textureTypeReadable(Re)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}F>=0&&F<=P.width-q&&K>=0&&K<=P.height-X&&G.readPixels(F,K,q,X,St.convert(Ae),St.convert(Re),oe)}finally{const ke=L!==null?Qe.get(L).__webglFramebuffer:null;He.bindFramebuffer(G.FRAMEBUFFER,ke)}}},this.readRenderTargetPixelsAsync=async function(P,F,K,q,X,oe,fe){if(!(P&&P.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let me=Qe.get(P).__webglFramebuffer;
3878if(P.isWebGLCubeRenderTarget&&fe!==void 0&&(me=me[fe]),me){const ke=P.texture,Ae=ke.format,Re=ke.type;if(!Ie.textureFormatReadable(Ae))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ie.textureTypeReadable(Re))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(F>=0&&F<=P.width-q&&K>=0&&K<=P.height-X){He.bindFramebuffer(G.FRAMEBUFFER,me);const Pe=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,Pe),G.bufferData(G.PIXEL_PACK_BUFFER,oe.byteLength,G.STREAM_READ),G.readPixels(F,K,q,X,St.convert(Ae),St.convert(Re),0);const Ze=L!==null?Qe.get(L).__webglFramebuffer:null;He.bindFramebuffer(G.FRAMEBUFFER,Ze);const ut=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await XN(G,ut,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,Pe),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,oe),G.deleteBuffer(Pe),G.deleteSync(ut),oe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(P,F=null,K=0){P.isTexture!==!0&&(Hp("WebGLRenderer: copyFramebufferToTexture function signature has changed."),F=arguments[0]||null,P=arguments[1]);const q=Math.pow(2,-K),X=Math.floor(P.image.width*q),oe=Math.floor(P.image.height*q),fe=F!==null?F.x:0,me=F!==null?F.y:0;V.setTexture2D(P,0),G.copyTexSubImage2D(G.TEXTURE_2D,K,0,0,fe,me,X,oe),He.unbindTexture()},this.copyTextureToTexture=function(P,F,K=null,q=null,X=0){P.isTexture!==!0&&(Hp("WebGLRenderer: copyTextureToTexture function signature has changed."),q=arguments[0]||null,P=arguments[1],F=arguments[2],X=arguments[3]||0,K=null);let oe,fe,me,ke,Ae,Re;K!==null?(oe=K.max.x-K.min.x,fe=K.max.y-K.min.y,me=K.min.x,ke=K.min.y):(oe=P.image.width,fe=P.image.height,me=0,ke=0),q!==null?(Ae=q.x,Re=q.y):(Ae=0,Re=0);const Pe=St.convert(F.format),Ze=St.convert(F.type);V.setTexture2D(F,0),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,F.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,F.unpackAlignment);const ut=G.getParameter(G.UNPACK_ROW_LENGTH),dt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),ht=G.getParameter(G.UNPACK_SKIP_PIXELS),qe=G.getParameter(G.UNPACK_SKIP_ROWS),Ue=G.getParameter(G.UNPACK_SKIP_IMAGES),wt=P.isCompressedTexture?P.mipmaps[X]:P.image;G.pixelStorei(G.UNPACK_ROW_LENGTH,wt.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,wt.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,me),G.pixelStorei(G.UNPACK_SKIP_ROWS,ke),P.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,X,Ae,Re,oe,fe,Pe,Ze,wt.data):P.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,X,Ae,Re,wt.width,wt.height,Pe,wt.data):G.texSubImage2D(G.TEXTURE_2D,X,Ae,Re,oe,fe,Pe,Ze,wt),G.pixelStorei(G.UNPACK_ROW_LENGTH,ut),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,dt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,ht),G.pixelStorei(G.UNPACK_SKIP_ROWS,qe),G.pixelStorei(G.UNPACK_SKIP_IMAGES,Ue),X===0&&F.generateMipmaps&&G.generateMipmap(G.TEXTURE_2D),He.unbindTexture()},this.copyTextureToTexture3D=function(P,F,K=null,q=null,X=0){P.isTexture!==!0&&(Hp("WebGLRenderer: copyTextureToTexture3D function signature has changed."),K=arguments[0]||null,q=arguments[1]||null,P=arguments[2],F=arguments[3],X=arguments[4]||0);let oe,fe,me,ke,Ae,Re,Pe,Ze,ut;const dt=P.isCompressedTexture?P.mipmaps[X]:P.image;K!==null?(oe=K.max.x-K.min.x,fe=K.max.y-K.min.y,me=K.max.z-K.min.z,ke=K.min.x,Ae=K.min.y,Re=K.min.z):(oe=dt.width,fe=dt.height,me=dt.depth,ke=0,Ae=0,Re=0),q!==null?(Pe=q.x,Ze=q.y,ut=q.z):(Pe=0,Ze=0,ut=0);const ht=St.convert(F.format),qe=St.convert(F.type);let Ue;if(F.isData3DTexture)V.setTexture3D(F,0),Ue=G.TEXTURE_3D;else if(F.isDataArrayTexture||F.isCompressedArrayTexture)V.setTexture2DArray(F,0),Ue=G.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,F.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,F.unpackAlignment);const wt=G.getParameter(G.UNPACK_ROW_LENGTH),tt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),kt=G.getParameter(G.UNPACK_SKIP_PIXELS),mn=G.getParameter(G.UNPACK_SKIP_ROWS),Ht=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,dt.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,dt.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,ke),G.pixelStorei(G.UNPACK_SKIP_ROWS,Ae),G.pixelStorei(G.UNPACK_SKIP_IMAGES,Re),P.isDataTexture||P.isData3DTexture?G.texSubImage3D(Ue,X,Pe,Ze,ut,oe,fe,me,ht,qe,dt.data):F.isCompressedArrayTexture?G.compressedTexSubImage3D(Ue,X,Pe,Ze,ut,oe,fe,me,ht,dt.data):G.texSubImage3D(Ue,X,Pe,Ze,ut,oe,fe,me,ht,qe,dt),G.pixelStorei(G.UNPACK_ROW_LENGTH,wt),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,tt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,kt),G.pixelStorei(G.UNPACK_SKIP_ROWS,mn),G.pixelStorei(G.UNPACK_SKIP_IMAGES,Ht),X===0&&F.generateMipmaps&&G.generateMipmap(Ue),He.unbindTexture()},this.initRenderTarget=function(P){Qe.get(P).__webglFramebuffer===void 0&&V.setupRenderTarget(P)},this.initTexture=function(P){P.isCubeTexture?V.setTextureCube(P,0):P.isData3DTexture?V.setTexture3D(P,0):P.isDataArrayTexture||P.isCompressedArrayTexture?V.setTexture2DArray(P,0):V.setTexture2D(P,0),He.unbindTexture()},this.resetState=function(){I=0,C=0,L=null,He.reset(),bt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ds}get outputColorSpace(){return this._outputColorSpace}
vendor: 20,486 bytes, line 3878
3878set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Ig?"display-p3":"srgb",t.unpackColorSpace=Kt.workingColorSpace===oh?"display-p3":"srgb"}}class Dg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new rt(e),this.density=t}clone(){return new Dg(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Ug{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new rt(e),this.near=t,this.far=i}clone(){return new Ug(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class uh 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 Ii,this.environmentIntensity=1,this.environmentRotation=new Ii,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 Og{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Uf,this.updateRanges=[],this.version=0,this.uuid=or()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.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=or()),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=or()),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 k;class Qa{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=Ai(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ct(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Ct(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ct(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ct(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ct(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=Ai(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ai(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ai(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ai(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ct(t,this.array),i=Ct(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=Ct(t,this.array),i=Ct(i,this.array),r=Ct(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=Ct(t,this.array),i=Ct(i,this.array),r=Ct(r,this.array),s=Ct(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 Jt(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 Qa(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 MS extends xi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new rt(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 Ol;const wu=new k,Fl=new k,kl=new k,zl=new be,Eu=new be,bR=new mt,Jd=new k,Tu=new k,ep=new k,LE=new be,my=new be,NE=new be;class RR extends Gt{constructor(e=new MS){if(super(),this.isSprite=!0,this.type="Sprite",Ol===void 0){Ol=new Pt;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 Og(t,5);Ol.setIndex([0,1,2,0,2,3]),Ol.setAttribute("position",new Qa(i,3,0,!1)),Ol.setAttribute("uv",new Qa(i,2,3,!1))}this.geometry=Ol,this.material=e,this.center=new be(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Fl.setFromMatrixScale(this.matrixWorld),bR.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),kl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Fl.multiplyScalar(-kl.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;tp(Jd.set(-.5,-.5,0),kl,o,Fl,r,s),tp(Tu.set(.5,-.5,0),kl,o,Fl,r,s),tp(ep.set(.5,.5,0),kl,o,Fl,r,s),LE.set(0,0),my.set(1,0),NE.set(1,1);let a=e.ray.intersectTriangle(Jd,Tu,ep,!1,wu);if(a===null&&(tp(Tu.set(-.5,.5,0),kl,o,Fl,r,s),my.set(0,1),a=e.ray.intersectTriangle(Jd,ep,Tu,!1,wu),a===null))return;const u=e.ray.origin.distanceTo(wu);u<e.near||u>e.far||t.push({distance:u,point:wu.clone(),uv:Gi.getInterpolation(wu,Jd,Tu,ep,LE,my,NE,new be),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 tp(n,e,t,i,r,s){zl.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Eu.x=s*zl.x-r*zl.y,Eu.y=r*zl.x+s*zl.y):Eu.copy(zl),n.copy(e),n.x+=Eu.x,n.y+=Eu.y,n.applyMatrix4(bR)}const np=new k,DE=new k;class CR 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}removeLevel(e){const t=this.levels;for(let i=0;i<t.length;i++)if(t[i].distance===e){const r=t.splice(i,1);return this.remove(r[0].object),!0}return!1}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){np.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(np);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){np.setFromMatrixPosition(e.matrixWorld),DE.setFromMatrixPosition(this.matrixWorld);const i=np.distanceTo(DE)/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 UE=new k,OE=new Xt,FE=new Xt,ok=new k,kE=new mt,ip=new k,gy=new yi,zE=new mt,vy=new zc;class PR extends xn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=z_,this.bindMatrix=new mt,this.bindMatrixInverse=new mt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Pi),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,ip),this.boundingBox.expandByPoint(ip)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new yi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,ip),this.boundingSphere.expandByPoint(ip)}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(),gy.copy(this.boundingSphere),gy.applyMatrix4(r),e.ray.intersectsSphere(gy)!==!1&&(zE.copy(r).invert(),vy.copy(e.ray).applyMatrix4(zE),!(this.boundingBox!==null&&vy.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,vy)))}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 Xt,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===z_?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===$b?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,r=this.geometry;OE.fromBufferAttribute(r.attributes.skinIndex,e),FE.fromBufferAttribute(r.attributes.skinWeight,e),UE.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=FE.getComponent(s);if(o!==0){const a=OE.getComponent(s);kE.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),t.addScaledVector(ok.copy(UE).applyMatrix4(kE),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class wS extends Gt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Zr extends nn{constructor(e=null,t=1,i=1,r,s,o,a,u,f=Jn,h=Jn,d,p){super(null,o,a,u,f,h,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 BE=new mt,ak=new mt;class Fg{constructor(e=[],t=[]){this.uuid=or(),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 mt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new mt;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:ak;BE.multiplyMatrices(a,t[s]),BE.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Fg(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 Zr(t,e,e,Ln,_n);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 wS),this.bones.push(o),this.boneInverses.push(new mt().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 Rc extends Jt{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 Bl=new mt,HE=new mt,rp=[],GE=new Pi,lk=new mt,Au=new xn,bu=new yi;class IR extends xn{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Rc(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,lk)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Pi),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Bl),GE.copy(e.boundingBox).applyMatrix4(Bl),this.boundingBox.union(GE)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new yi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Bl),bu.copy(e.boundingSphere).applyMatrix4(Bl),this.boundingSphere.union(bu)}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(Au.geometry=this.geometry,Au.material=this.material,Au.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),bu.copy(this.boundingSphere),bu.applyMatrix4(i),e.ray.intersectsSphere(bu)!==!1))for(let s=0;s<r;s++){this.getMatrixAt(s,Bl),HE.multiplyMatrices(i,Bl),Au.matrixWorld=HE,Au.raycast(e,rp);for(let o=0,a=rp.length;o<a;o++){const u=rp[o];u.instanceId=s,u.object=this,t.push(u)}rp.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Rc(new Float32Array(this.instanceMatrix.count*3).fill(1),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 Zr(new Float32Array(r*this.count),r,this.count,rh,_n));const s=this.morphTexture.source.data.data;let o=0;for(let f=0;f<i.length;f++)o+=i[f];const a=this.geometry.morphTargetsRelative?1:1-o,u=r*e;s[u]=a,s.set(i,u+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}function ck(n,e){return n.z-e.z}function uk(n,e){return e.z-n.z}class fk{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 go=new mt,yy=new mt,hk=new mt,dk=new rt(1,1,1),VE=new mt,_y=new ch,sp=new Pi,da=new yi,Ru=new k,WE=new k,pk=new k,xy=new fk,gi=new xn,op=[];function mk(n,e,t=0){const i=e.itemSize;
3878if(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 LR extends xn{get maxInstanceCount(){return this._maxInstanceCount}constructor(e,t,i=t*2,r){super(new Pt,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawInfo=[],this._availableInstanceIds=[],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 Zr(t,e,e,Ln,_n);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),i=new Zr(t,e,e,sh,xs);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),i=new Zr(t,e,e,Ln,_n);
3878i.colorSpace=Kt.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:u,normalized:f}=o,h=new a.constructor(i*u),d=new Jt(h,u,f);t.setAttribute(s,d)}if(e.getIndex()!==null){const s=i>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Jt(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 Pi);const e=this.boundingBox,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,go),this.getBoundingBoxAt(s,sp).applyMatrix4(go),e.union(sp)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new yi);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,go),this.getBoundingSphereAt(s,da).applyMatrix4(go),e.union(da)}}addInstance(e){if(this._drawInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(r=this._availableInstanceIds.pop(),this._drawInfo[r]=i):(r=this._drawInfo.length,this._drawInfo.push(i));const s=this._matricesTexture,o=s.image.data;hk.toArray(o,r*16),s.needsUpdate=!0;const a=this._colorsTexture;return a&&(dk.toArray(a.image.data,r*4),a.needsUpdate=!0),r}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,u=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const f=e.getIndex(),h=f!==null;if(h&&(i===-1?r.indexCount=f.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const d=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:h?r.indexStart:r.vertexStart,count:-1}),u.push({boxInitialized:!1,box:new Pi,sphereInitialized:!1,sphere:new yi}),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 u=a.vertexStart,f=a.vertexCount;for(const m in i.attributes){const y=t.getAttribute(m),w=i.getAttribute(m);mk(y,w,u);const _=y.itemSize;for(let v=y.count,S=f;v<S;v++){const M=u+v;for(let T=0;T<_;T++)w.setComponent(M,T,0)}w.needsUpdate=!0,w.addUpdateRange(u*_,f*_)}if(r){const m=a.indexStart;for(let y=0;y<o.count;y++)s.setX(m+y,u+o.getX(y));for(let y=o.count,w=a.indexCount;y<w;y++)s.setX(m+y,u);s.needsUpdate=!0,s.addUpdateRange(m,a.indexCount)}const h=this._bounds[e];
3878t.boundingBox!==null?(h.box.copy(t.boundingBox),h.boxInitialized=!0):h.boxInitialized=!1,t.boundingSphere!==null?(h.sphere.copy(t.boundingSphere),h.sphereInitialized=!0):h.sphereInitialized=!1;const d=this._drawRanges[e],p=t.getAttribute("position");return d.count=r?o.count:p.count,this._visibilityChanged=!0,e}deleteInstance(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?this:(t[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this)}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,u=this._drawRanges[e];for(let f=u.start,h=u.start+u.count;f<h;f++){let d=f;o&&(d=o.getX(d)),r.expandByPoint(Ru.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,sp),sp.getCenter(r.center);const o=s.index,a=s.attributes.position,u=this._drawRanges[e];let f=0;for(let h=u.start,d=u.start+u.count;h<d;h++){let p=h;o&&(p=o.getX(p)),Ru.fromBufferAttribute(a,p),f=Math.max(f,r.center.distanceToSquared(Ru))}r.radius=Math.sqrt(f),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}setGeometryIdAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||t<0||t>=this._geometryCount?null:(i[e].geometryIndex=t,this)}getGeometryIdAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?-1:t[e].geometryIndex}getGeometryRangeAt(e,t={}){if(e<0||e>=this._geometryCount)return null;const i=this._drawRanges[e];return t.start=i.start,t.count=i.count,t}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;gi.material=this.material,gi.geometry.index=o.index,gi.geometry.attributes=o.attributes,gi.geometry.boundingBox===null&&(gi.geometry.boundingBox=new Pi),gi.geometry.boundingSphere===null&&(gi.geometry.boundingSphere=new yi);for(let a=0,u=i.length;a<u;a++){if(!i[a].visible||!i[a].active)continue;const f=i[a].geometryIndex,h=r[f];gi.geometry.setDrawRange(h.start,h.count),this.getMatrixAt(a,gi.matrixWorld).premultiply(s),this.getBoundingBoxAt(f,gi.geometry.boundingBox),this.getBoundingSphereAt(f,gi.geometry.boundingSphere),gi.raycast(e,op);for(let d=0,p=op.length;d<p;d++){const m=op[d];m.object=this,m.batchId=a,t.push(m)}op.length=0}gi.material=null,gi.geometry.index=null,gi.geometry.attributes={},gi.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.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.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,u=this._drawInfo,f=this._multiDrawStarts,h=this._multiDrawCounts,d=this._drawRanges,p=this.perObjectFrustumCulled,m=this._indirectTexture,y=m.image.data;p&&(VE.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),_y.setFromProjectionMatrix(VE,e.coordinateSystem));let w=0;if(this.sortObjects){yy.copy(this.matrixWorld).invert(),Ru.setFromMatrixPosition(i.matrixWorld).applyMatrix4(yy),WE.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(yy);for(let S=0,M=u.length;S<M;S++)if(u[S].visible&&u[S].active){const T=u[S].geometryIndex;this.getMatrixAt(S,go),this.getBoundingSphereAt(T,da).applyMatrix4(go);let I=!1;if(p&&(I=!_y.intersectsSphere(da)),!I){const C=pk.subVectors(da.center,Ru).dot(WE);xy.push(d[T],C,S)}}const _=xy.list,v=this.customSort;v===null?_.sort(s.transparent?uk:ck):v.call(this,_,i);for(let S=0,M=_.length;S<M;S++){const T=_[S];f[w]=T.start*a,h[w]=T.count,y[w]=T.index,w++}xy.reset()}else for(let _=0,v=u.length;_<v;_++)if(u[_].visible&&u[_].active){const S=u[_].geometryIndex;let M=!1;if(p&&(this.getMatrixAt(_,go),this.getBoundingSphereAt(S,da).applyMatrix4(go),M=!_y.intersectsSphere(da)),!M){const T=d[S];f[w]=T.start*a,h[w]=T.count,y[w]=_,w++}}m.needsUpdate=!0,this._multiDrawCount=w,this._visibilityChanged=!1}onBeforeShadow(e,t,i,r,s,o){this.onBeforeRender(e,null,r,s,o)}}class Di extends xi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new rt(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 eg=new k,tg=new k,XE=new mt,Cu=new zc,ap=new yi,Sy=new k,jE=new k;class Go extends Gt{constructor(e=new Pt,t=new Di){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++)eg.fromBufferAttribute(t,r-1),tg.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=eg.distanceTo(tg);e.setAttribute("lineDistance",new lt(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(),ap.copy(i.boundingSphere),ap.applyMatrix4(r),ap.radius+=s,e.ray.intersectsSphere(ap)===!1)return;XE.copy(r).invert(),Cu.copy(e.ray).applyMatrix4(XE);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=a*a,f=this.isLineSegments?2:1,h=i.index,p=i.attributes.position;if(h!==null){const m=Math.max(0,o.start),y=Math.min(h.count,o.start+o.count);for(let w=m,_=y-1;w<_;w+=f){const v=h.getX(w),S=h.getX(w+1),M=lp(this,e,Cu,u,v,S);M&&t.push(M)}if(this.isLineLoop){const w=h.getX(y-1),_=h.getX(m),v=lp(this,e,Cu,u,w,_);v&&t.push(v)}}else{const m=Math.max(0,o.start),y=Math.min(p.count,o.start+o.count);for(let w=m,_=y-1;w<_;w+=f){const v=lp(this,e,Cu,u,w,w+1);v&&t.push(v)}if(this.isLineLoop){const w=lp(this,e,Cu,u,y-1,m);
vendor: 13,327 bytes, line 3878
3878w&&t.push(w)}}}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 lp(n,e,t,i,r,s){const o=n.geometry.attributes.position;if(eg.fromBufferAttribute(o,r),tg.fromBufferAttribute(o,s),t.distanceSqToSegment(eg,tg,Sy,jE)>i)return;Sy.applyMatrix4(n.matrixWorld);const u=e.ray.origin.distanceTo(Sy);if(!(u<e.near||u>e.far))return{distance:u,point:jE.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:n}}const YE=new k,qE=new k;class ws extends Go{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)YE.fromBufferAttribute(t,r),qE.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+YE.distanceTo(qE);e.setAttribute("lineDistance",new lt(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class NR extends Go{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class ES extends xi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new rt(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 ZE=new mt,j_=new zc,cp=new yi,up=new k;class DR extends Gt{constructor(e=new Pt,t=new ES){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(),cp.copy(i.boundingSphere),cp.applyMatrix4(r),cp.radius+=s,e.ray.intersectsSphere(cp)===!1)return;ZE.copy(r).invert(),j_.copy(e.ray).applyMatrix4(ZE);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=a*a,f=i.index,d=i.attributes.position;if(f!==null){const p=Math.max(0,o.start),m=Math.min(f.count,o.start+o.count);for(let y=p,w=m;y<w;y++){const _=f.getX(y);up.fromBufferAttribute(d,_),KE(up,_,u,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,w=m;y<w;y++)up.fromBufferAttribute(d,y),KE(up,y,u,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 KE(n,e,t,i,r,s,o){const a=j_.distanceSqToPoint(n);if(a<t){const u=new k;j_.closestPointToPoint(n,u),u.applyMatrix4(i);const f=r.ray.origin.distanceTo(u);if(f<r.near||f>r.far)return;s.push({distance:f,distanceToRay:Math.sqrt(a),point:u,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class gk extends nn{constructor(e,t,i,r,s,o,a,u,f){super(e,t,i,r,s,o,a,u,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:Qt,this.magFilter=s!==void 0?s:Qt,this.generateMipmaps=!1;const h=this;function d(){h.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class vk extends nn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Jn,this.minFilter=Jn,this.generateMipmaps=!1,this.needsUpdate=!0}}class kg extends nn{constructor(e,t,i,r,s,o,a,u,f,h,d,p){super(null,o,a,u,f,h,r,s,d,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class yk extends kg{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Fn,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class _k extends kg{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,_s),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class xk extends nn{constructor(e,t,i,r,s,o,a,u,f){super(e,t,i,r,s,o,a,u,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class $r{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,u=s-1,f;for(;a<=u;)if(r=Math.floor(a+(u-a)/2),f=i[r]-o,f<0)a=r+1;else if(f>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const h=i[r],p=i[r+1]-h,m=(o-h)/p;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),u=t||(o.isVector2?new be:new k);return u.copy(a).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new k,r=[],s=[],o=[],a=new k,u=new mt;for(let m=0;m<=e;m++){const y=m/e;r[m]=this.getTangentAt(y,new k)}s[0]=new k,o[0]=new k;let f=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=f&&(f=h,i.set(1,0,0)),d<=f&&(f=d,i.set(0,1,0)),p<=f&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let 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(u.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(u.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 zg extends $r{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,u=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=u}getPoint(e,t=new be){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 u=this.aX+this.xRadius*Math.cos(a),f=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=u-this.aX,m=f-this.aY;u=p*h-m*d+this.aX,f=p*d+m*h+this.aY}return i.set(u,f)}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 UR extends zg{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function TS(){let n=0,e=0,t=0,i=0;function r(s,o,a,u){n=s,e=a,t=-3*s+3*o-2*a-u,i=2*s-2*o+a+u}return{initCatmullRom:function(s,o,a,u,f){r(o,a,f*(a-s),f*(u-o))},initNonuniformCatmullRom:function(s,o,a,u,f,h,d){let p=(o-s)/f-(a-s)/(f+h)+(a-o)/h,m=(a-o)/h-(u-o)/(h+d)+(u-a)/d;p*=h,m*=h,r(o,a,p,m)},calc:function(s){const o=s*s,a=o*s;return n+e*s+t*o+i*a}}}const fp=new k,My=new TS,wy=new TS,Ey=new TS;class Bg extends $r{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 k){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),u=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:u===0&&a===s-1&&(a=s-2,u=1);let f,h;this.closed||a>0?f=r[(a-1)%s]:(fp.subVectors(r[0],r[1]).add(r[0]),f=fp);const d=r[a%s],p=r[(a+1)%s];if(this.closed||a+2<s?h=r[(a+2)%s]:(fp.subVectors(r[s-1],r[s-2]).add(r[s-1]),h=fp),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let y=Math.pow(f.distanceToSquared(d),m),w=Math.pow(d.distanceToSquared(p),m),_=Math.pow(p.distanceToSquared(h),m);w<1e-4&&(w=1),y<1e-4&&(y=w),_<1e-4&&(_=w),My.initNonuniformCatmullRom(f.x,d.x,p.x,h.x,y,w,_),wy.initNonuniformCatmullRom(f.y,d.y,p.y,h.y,y,w,_),Ey.initNonuniformCatmullRom(f.z,d.z,p.z,h.z,y,w,_)}else this.curveType==="catmullrom"&&(My.initCatmullRom(f.x,d.x,p.x,h.x,this.tension),wy.initCatmullRom(f.y,d.y,p.y,h.y,this.tension),Ey.initCatmullRom(f.z,d.z,p.z,h.z,this.tension));return i.set(My.calc(u),wy.calc(u),Ey.calc(u)),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 k().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function QE(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,a=n*n,u=n*a;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*a+s*n+t}function Sk(n,e){const t=1-n;return t*t*e}function Mk(n,e){return 2*(1-n)*n*e}function wk(n,e){return n*n*e}function of(n,e,t,i){return Sk(n,e)+Mk(n,t)+wk(n,i)}function Ek(n,e){const t=1-n;return t*t*t*e}function Tk(n,e){const t=1-n;return 3*t*t*n*e}function Ak(n,e){return 3*(1-n)*n*n*e}function bk(n,e){return n*n*n*e}function af(n,e,t,i,r){return Ek(n,e)+Tk(n,t)+Ak(n,i)+bk(n,r)}class AS extends $r{constructor(e=new be,t=new be,i=new be,r=new be){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new be){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(af(e,r.x,s.x,o.x,a.x),af(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 OR extends $r{constructor(e=new k,t=new k,i=new k,r=new k){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new k){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(af(e,r.x,s.x,o.x,a.x),af(e,r.y,s.y,o.y,a.y),af(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 bS extends $r{constructor(e=new be,t=new be){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new be){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 3878
3878getTangent(e,t=new be){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 FR extends $r{constructor(e=new k,t=new k){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new k){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 k){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 RS extends $r{constructor(e=new be,t=new be,i=new be){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new be){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(of(e,r.x,s.x,o.x),of(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 CS extends $r{constructor(e=new k,t=new k,i=new k){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new k){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(of(e,r.x,s.x,o.x),of(e,r.y,s.y,o.y),of(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 PS extends $r{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new be){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,u=r[o===0?o:o-1],f=r[o],h=r[o>r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(QE(a,u.x,f.x,h.x,d.x),QE(a,u.y,f.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;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 be().fromArray(r))}return this}}var ng=Object.freeze({__proto__:null,ArcCurve:UR,CatmullRomCurve3:Bg,CubicBezierCurve:AS,CubicBezierCurve3:OR,EllipseCurve:zg,LineCurve:bS,LineCurve3:FR,QuadraticBezierCurve:RS,QuadraticBezierCurve3:CS,SplineCurve:PS});class kR extends $r{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 ng[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],u=a.getLength(),f=u===0?0:1-o/u;return a.getPointAt(f,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;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,580 bytes, line 3878
3878plineCurve?e*o.points.length:e,u=o.getPoints(a);for(let f=0;f<u.length;f++){const h=u[f];i&&i.equals(h)||(t.push(h),i=h)}}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 ng[r.type]().fromJSON(r))}return this}}class kf extends kR{constructor(e){super(),this.type="Path",this.currentPoint=new be,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 bS(this.currentPoint.clone(),new be(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new RS(this.currentPoint.clone(),new be(e,t),new be(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const a=new AS(this.currentPoint.clone(),new be(e,t),new be(i,r),new be(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new PS(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,u=this.currentPoint.y;return this.absarc(e+a,t+u,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,u){const f=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+f,t+h,i,r,s,o,a,u),this}absellipse(e,t,i,r,s,o,a,u){const f=new zg(e,t,i,r,s,o,a,u);if(this.curves.length>0){const d=f.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(f);const h=f.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class fh extends Pt{constructor(e=[new be(0,-.5),new be(.5,0),new be(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=[],u=[],f=[],h=1/t,d=new k,p=new be,m=new k,y=new k,w=new k;let _=0,v=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:_=e[S+1].x-e[S].x,v=e[S+1].y-e[S].y,m.x=v*1,m.y=-_,m.z=v*0,w.copy(m),m.normalize(),u.push(m.x,m.y,m.z);break;case e.length-1:u.push(w.x,w.y,w.z);break;default:_=e[S+1].x-e[S].x,v=e[S+1].y-e[S].y,m.x=v*1,m.y=-_,m.z=v*0,y.copy(m),m.x+=w.x,m.y+=w.y,m.z+=w.z,m.normalize(),u.push(m.x,m.y,m.z),w.copy(y)}for(let S=0;S<=t;S++){const M=i+S*h*r,T=Math.sin(M),I=Math.cos(M);for(let C=0;C<=e.length-1;C++){d.x=e[C].x*T,d.y=e[C].y,d.z=e[C].x*I,o.push(d.x,d.y,d.z),p.x=S/t,p.y=C/(e.length-1),a.push(p.x,p.y);const L=u[3*C+0]*T,N=u[3*C+1],B=u[3*C+0]*I;f.push(L,N,B)}}for(let S=0;S<t;S++)for(let M=0;M<e.length-1;M++){const T=M+S*e.length,I=T,C=T+e.length,L=T+e.length+1,N=T+1;s.push(I,C,N),s.push(L,N,C)}this.setIndex(s),this.setAttribute("position",new lt(o,3)),this.setAttribute("uv",new lt(a,2)),this.setAttribute("normal",new lt(f,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fh(e.points,e.segments,e.phiStart,e.phiLength)}}class Hg extends fh{constructor(e=1,t=1,i=4,r=8){const s=new kf;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 Hg(e.radius,e.length,e.capSegments,e.radialSegments)}}class Gg extends Pt{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=[],u=[],f=new k,h=new be;o.push(0,0,0),a.push(0,0,1),u.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const m=i+d/t*r;f.x=e*Math.cos(m),f.y=e*Math.sin(m),o.push(f.x,f.y,f.z),a.push(0,0,1),h.x=(o[p]/e+1)/2,h.y=(o[p+1]/e+1)/2,u.push(h.x,h.y)}for(let d=1;d<=t;d++)s.push(d,d+1,0);this.setIndex(s),this.setAttribute("position",new lt(o,3)),this.setAttribute("normal",new lt(a,3)),this.setAttribute("uv",new lt(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Gg(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Ss extends Pt{constructor(e=1,t=1,i=1,r=32,s=1,o=!1,a=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:u};const f=this;r=Math.floor(r),s=Math.floor(s);const h=[],d=[],p=[],m=[];let y=0;const w=[],_=i/2;let v=0;S(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(h),this.setAttribute("position",new lt(d,3)),this.setAttribute("normal",new lt(p,3)),this.setAttribute("uv",new lt(m,2));function S(){const T=new k,I=new k;let C=0;const L=(t-e)/i;for(let N=0;N<=s;N++){const B=[],A=N/s,R=A*(t-e)+e;for(let j=0;j<=r;j++){const Y=j/r,Z=Y*u+a,ae=Math.sin(Z),Q=Math.cos(Z);I.x=R*ae,I.y=-A*i+_,I.z=R*Q,d.push(I.x,I.y,I.z),T.set(ae,L,Q).normalize(),p.push(T.x,T.y,T.z),m.push(Y,1-A),B.push(y++)}w.push(B)}for(let N=0;N<r;N++)for(let B=0;B<s;B++){const A=w[B][N],R=w[B+1][N],j=w[B+1][N+1],Y=w[B][N+1];e>0&&(h.push(A,R,Y),C+=3),t>0&&(h.push(R,j,Y),C+=3)}f.addGroup(v,C,0),v+=C}function M(T){const I=y,C=new be,L=new k;let N=0;const B=T===!0?e:t,A=T===!0?1:-1;for(let j=1;j<=r;j++)d.push(0,_*A,0),p.push(0,A,0),m.push(.5,.5),y++;const R=y;for(let j=0;j<=r;j++){const Z=j/r*u+a,ae=Math.cos(Z),Q=Math.sin(Z);L.x=B*Q,L.y=_*A,L.z=B*ae,d.push(L.x,L.y,L.z),p.push(0,A,0),C.x=ae*.5+.5,C.y=Q*.5*A+.5,m.push(C.x,C.y),y++}for(let j=0;j<r;j++){const Y=I+j,Z=R+j;T===!0?h.push(Z,Z+1,Y):h.push(Z+1,Z,Y),N+=3}f.addGroup(v,N,T===!0?1:2),v+=N}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ss(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Vg extends Ss{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
3878oneGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new Vg(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ko extends Pt{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),f(i),h(),this.setAttribute("position",new lt(s,3)),this.setAttribute("normal",new lt(s.slice(),3)),this.setAttribute("uv",new lt(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function a(S){const M=new k,T=new k,I=new k;for(let C=0;C<t.length;C+=3)m(t[C+0],M),m(t[C+1],T),m(t[C+2],I),u(M,T,I,S)}function u(S,M,T,I){const C=I+1,L=[];for(let N=0;N<=C;N++){L[N]=[];const B=S.clone().lerp(T,N/C),A=M.clone().lerp(T,N/C),R=C-N;for(let j=0;j<=R;j++)j===0&&N===C?L[N][j]=B:L[N][j]=B.clone().lerp(A,j/R)}for(let N=0;N<C;N++)for(let B=0;B<2*(C-N)-1;B++){const A=Math.floor(B/2);B%2===0?(p(L[N][A+1]),p(L[N+1][A]),p(L[N][A])):(p(L[N][A+1]),p(L[N+1][A+1]),p(L[N+1][A]))}}function f(S){const M=new k;for(let T=0;T<s.length;T+=3)M.x=s[T+0],M.y=s[T+1],M.z=s[T+2],M.normalize().multiplyScalar(S),s[T+0]=M.x,s[T+1]=M.y,s[T+2]=M.z}function h(){const S=new k;for(let M=0;M<s.length;M+=3){S.x=s[M+0],S.y=s[M+1],S.z=s[M+2];const T=_(S)/2/Math.PI+.5,I=v(S)/Math.PI+.5;o.push(T,1-I)}y(),d()}function d(){for(let S=0;S<o.length;S+=6){const M=o[S+0],T=o[S+2],I=o[S+4],C=Math.max(M,T,I),L=Math.min(M,T,I);C>.9&&L<.1&&(M<.2&&(o[S+0]+=1),T<.2&&(o[S+2]+=1),I<.2&&(o[S+4]+=1))}}function p(S){s.push(S.x,S.y,S.z)}function m(S,M){const T=S*3;M.x=e[T+0],M.y=e[T+1],M.z=e[T+2]}function y(){const S=new k,M=new k,T=new k,I=new k,C=new be,L=new be,N=new be;for(let B=0,A=0;B<s.length;B+=9,A+=6){S.set(s[B+0],s[B+1],s[B+2]),M.set(s[B+3],s[B+4],s[B+5]),T.set(s[B+6],s[B+7],s[B+8]),C.set(o[A+0],o[A+1]),L.set(o[A+2],o[A+3]),N.set(o[A+4],o[A+5]),I.copy(S).add(M).add(T).divideScalar(3);const R=_(I);w(C,A+0,S,R),w(L,A+2,M,R),w(N,A+4,T,R)}}function w(S,M,T,I){I<0&&S.x===1&&(o[M]=S.x-1),T.x===0&&T.z===0&&(o[M]=I/2/Math.PI+.5)}function _(S){return Math.atan2(S.z,-S.x)}function v(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ko(e.vertices,e.indices,e.radius,e.details)}}class Wg extends Ko{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: 128,303 bytes, line 3878
387819,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 Wg(e.radius,e.detail)}}const hp=new k,dp=new k,Ty=new k,pp=new Gi;class zR extends Pt{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(ka*t),o=e.getIndex(),a=e.getAttribute("position"),u=o?o.count:a.count,f=[0,0,0],h=["a","b","c"],d=new Array(3),p={},m=[];for(let y=0;y<u;y+=3){o?(f[0]=o.getX(y),f[1]=o.getX(y+1),f[2]=o.getX(y+2)):(f[0]=y,f[1]=y+1,f[2]=y+2);const{a:w,b:_,c:v}=pp;if(w.fromBufferAttribute(a,f[0]),_.fromBufferAttribute(a,f[1]),v.fromBufferAttribute(a,f[2]),pp.getNormal(Ty),d[0]=`${Math.round(w.x*r)},${Math.round(w.y*r)},${Math.round(w.z*r)}`,d[1]=`${Math.round(_.x*r)},${Math.round(_.y*r)},${Math.round(_.z*r)}`,d[2]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let S=0;S<3;S++){const M=(S+1)%3,T=d[S],I=d[M],C=pp[h[S]],L=pp[h[M]],N=`${T}_${I}`,B=`${I}_${T}`;B in p&&p[B]?(Ty.dot(p[B].normal)<=s&&(m.push(C.x,C.y,C.z),m.push(L.x,L.y,L.z)),p[B]=null):N in p||(p[N]={index0:f[S],index1:f[M],normal:Ty.clone()})}}for(const y in p)if(p[y]){const{index0:w,index1:_}=p[y];hp.fromBufferAttribute(a,w),dp.fromBufferAttribute(a,_),m.push(hp.x,hp.y,hp.z),m.push(dp.x,dp.y,dp.z)}this.setAttribute("position",new lt(m,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Ba extends kf{constructor(e){super(e),this.uuid=or(),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 kf().fromJSON(r))}return this}}const Rk={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=BR(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,u,f,h,d,p,m;if(i&&(s=Nk(n,e,s,t)),n.length>80*t){a=f=n[0],u=h=n[1];for(let y=t;y<r;y+=t)d=n[y],p=n[y+1],d<a&&(a=d),p<u&&(u=p),d>f&&(f=d),p>h&&(h=p);m=Math.max(f-a,h-u),m=m!==0?32767/m:0}return zf(s,o,t,a,u,m,0),o}};function BR(n,e,t,i,r){let s,o;if(r===Wk(n,e,t,i)>0)for(s=e;s<t;s+=i)o=$E(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=$E(s,n[s],n[s+1],o);return o&&Xg(o,o.next)&&(Hf(o),o=o.next),o}function $a(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Xg(t,t.next)||yn(t.prev,t,t.next)===0)){if(Hf(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function zf(n,e,t,i,r,s,o){if(!n)return;!o&&s&&kk(n,i,r,s);let a=n,u,f;for(;n.prev!==n.next;){if(u=n.prev,f=n.next,s?Pk(n,i,r,s):Ck(n)){e.push(u.i/t|0),e.push(n.i/t|0),e.push(f.i/t|0),Hf(n),n=f.next,a=f.next;continue}if(n=f,n===a){o?o===1?(n=Ik($a(n),e,t),zf(n,e,t,i,r,s,2)):o===2&&Lk(n,e,t,i,r,s):zf($a(n),e,t,i,r,s,1);break}}}function Ck(n){const e=n.prev,t=n,i=n.next;if(yn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,u=t.y,f=i.y,h=r<s?r<o?r:o:s<o?s:o,d=a<u?a<f?a:f:u<f?u:f,p=r>s?r>o?r:o:s>o?s:o,m=a>u?a>f?a:f:u>f?u:f;let y=i.next;for(;y!==e;){if(y.x>=h&&y.x<=p&&y.y>=d&&y.y<=m&&ac(r,a,s,u,o,f,y.x,y.y)&&yn(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function Pk(n,e,t,i){const r=n.prev,s=n,o=n.next;if(yn(r,s,o)>=0)return!1;const a=r.x,u=s.x,f=o.x,h=r.y,d=s.y,p=o.y,m=a<u?a<f?a:f:u<f?u:f,y=h<d?h<p?h:p:d<p?d:p,w=a>u?a>f?a:f:u>f?u:f,_=h>d?h>p?h:p:d>p?d:p,v=Y_(m,y,e,t,i),S=Y_(w,_,e,t,i);let M=n.prevZ,T=n.nextZ;for(;M&&M.z>=v&&T&&T.z<=S;){if(M.x>=m&&M.x<=w&&M.y>=y&&M.y<=_&&M!==r&&M!==o&&ac(a,h,u,d,f,p,M.x,M.y)&&yn(M.prev,M,M.next)>=0||(M=M.prevZ,T.x>=m&&T.x<=w&&T.y>=y&&T.y<=_&&T!==r&&T!==o&&ac(a,h,u,d,f,p,T.x,T.y)&&yn(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;M&&M.z>=v;){if(M.x>=m&&M.x<=w&&M.y>=y&&M.y<=_&&M!==r&&M!==o&&ac(a,h,u,d,f,p,M.x,M.y)&&yn(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;T&&T.z<=S;){if(T.x>=m&&T.x<=w&&T.y>=y&&T.y<=_&&T!==r&&T!==o&&ac(a,h,u,d,f,p,T.x,T.y)&&yn(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function Ik(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Xg(r,s)&&HR(r,i,i.next,s)&&Bf(r,s)&&Bf(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Hf(i),Hf(i.next),i=n=s),i=i.next}while(i!==n);return $a(i)}function Lk(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Hk(o,a)){let u=GR(o,a);o=$a(o,o.next),u=$a(u,u.next),zf(o,e,t,i,r,s,0),zf(u,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function Nk(n,e,t,i){const r=[];let s,o,a,u,f;for(s=0,o=e.length;s<o;s++)a=e[s]*i,u=s<o-1?e[s+1]*i:n.length,f=BR(n,a,u,i,!1),f===f.next&&(f.steiner=!0),r.push(Bk(f));for(r.sort(Dk),s=0;s<r.length;s++)t=Uk(r[s],t);return t}function Dk(n,e){return n.x-e.x}function Uk(n,e){const t=Ok(n,e);if(!t)return e;const i=GR(t,n);return $a(i,i.next),$a(t,t.next)}function Ok(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,u=r.x,f=r.y;let h=1/0,d;t=r;do s>=t.x&&t.x>=u&&s!==t.x&&ac(o<f?s:i,o,u,f,o<f?i:s,o,t.x,t.y)&&(d=Math.abs(o-t.y)/(s-t.x),Bf(t,n)&&(d<h||d===h&&(t.x>r.x||t.x===r.x&&Fk(r,t)))&&(r=t,h=d)),t=t.next;while(t!==a);return r}function Fk(n,e){return yn(n.prev,n,e.prev)<0&&yn(e.next,n,n.next)<0}function kk(n,e,t,i){let r=n;do r.z===0&&(r.z=Y_(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,zk(r)}function zk(n){let e,t,i,r,s,o,a,u,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e<f&&(a++,i=i.nextZ,!!i);e++);for(u=f;a>0||u>0&&i;)a!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,f*=2}while(o>1);return n}function Y_(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 Bk(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 ac(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 Hk(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!Gk(n,e)&&(Bf(n,e)&&Bf(e,n)&&Vk(n,e)&&(yn(n.prev,n,e.prev)||yn(n,e.prev,e))||Xg(n,e)&&yn(n.prev,n,n.next)>0&&yn(e.prev,e,e.next)>0)}function yn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Xg(n,e){return n.x===e.x&&n.y===e.y}function HR(n,e,t,i){const r=gp(yn(n,e,t)),s=gp(yn(n,e,i)),o=gp(yn(t,i,n)),a=gp(yn(t,i,e));return!!(r!==s&&o!==a||r===0&&mp(n,t,e)||s===0&&mp(n,i,e)||o===0&&mp(t,n,i)||a===0&&mp(t,e,i))}function mp(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 gp(n){return n>0?1:n<0?-1:0}function Gk(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&&HR(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Bf(n,e){return yn(n.prev,n,n.next)<0?yn(n,e,n.next)>=0&&yn(n,n.prev,e)>=0:yn(n,e,n.prev)<0||yn(n,n.next,e)<0}function Vk(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 GR(n,e){const t=new q_(n.i,n.x,n.y),i=new q_(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 $E(n,e,t,i){const r=new q_(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 Hf(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 q_(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 Wk(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 ys{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 ys.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];JE(e),eT(i,e);let o=e.length;t.forEach(JE);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,eT(i,t[u]);const a=Rk.triangulate(i,r);for(let u=0;u<a.length;u+=3)s.push(a.slice(u,u+3));return s}}function JE(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function eT(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class jg extends Pt{constructor(e=new Ba([new be(.5,.5),new be(-.5,.5),new be(-.5,-.5),new be(.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,u=e.length;a<u;a++){const f=e[a];o(f)}this.setAttribute("position",new lt(r,3)),this.setAttribute("uv",new lt(s,2)),this.computeVertexNormals();function o(a){const u=[],f=t.curveSegments!==void 0?t.curveSegments:12,h=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,w=t.bevelOffset!==void 0?t.bevelOffset:0,_=t.bevelSegments!==void 0?t.bevelSegments:3;const v=t.extrudePath,S=t.UVGenerator!==void 0?t.UVGenerator:Xk;let M,T=!1,I,C,L,N;v&&(M=v.getSpacedPoints(h),T=!0,p=!1,I=v.computeFrenetFrames(h,!1),C=new k,L=new k,N=new k),p||(_=0,m=0,y=0,w=0);const B=a.extractPoints(f);let A=B.shape;const R=B.holes;if(!ys.isClockWise(A)){A=A.reverse();for(let xe=0,G=R.length;xe<G;xe++){const Oe=R[xe];ys.isClockWise(Oe)&&(R[xe]=Oe.reverse())}}const Y=ys.triangulateShape(A,R),Z=A;for(let xe=0,G=R.length;xe<G;xe++){const Oe=R[xe];A=A.concat(Oe)}function ae(xe,G,Oe){return G||console.error("THREE.ExtrudeGeometry: vec does not exist"),xe.clone().addScaledVector(G,Oe)}const Q=A.length,pe=Y.length;function z(xe,G,Oe){let Fe,Ie,He;const ft=xe.x-G.x,Qe=xe.y-G.y,V=Oe.x-xe.x,U=Oe.y-xe.y,ce=ft*ft+Qe*Qe,Se=ft*U-Qe*V;if(Math.abs(Se)>Number.EPSILON){const Ee=Math.sqrt(ce),_e=Math.sqrt(V*V+U*U),at=G.x-Qe/Ee,Ve=G.y+ft/Ee,$e=Oe.x-U/_e,It=Oe.y+V/_e,Ne=(($e-at)*U-(It-Ve)*V)/(ft*U-Qe*V);Fe=at+ft*Ne-xe.x,Ie=Ve+Qe*Ne-xe.y;const it=Fe*Fe+Ie*Ie;if(it<=2)return new be(Fe,Ie);He=Math.sqrt(it/2)}else{let Ee=!1;ft>Number.EPSILON?V>Number.EPSILON&&(Ee=!0):ft<-Number.EPSILON?V<-Number.EPSILON&&(Ee=!0):Math.sign(Qe)===Math.sign(U)&&(Ee=!0),Ee?(Fe=-Qe,Ie=ft,He=Math.sqrt(ce)):(Fe=ft,Ie=Qe,He=Math.sqrt(ce/2))}return new be(Fe/He,Ie/He)}const ie=[];for(let xe=0,G=Z.length,Oe=G-1,Fe=xe+1;xe<G;xe++,Oe++,Fe++)Oe===G&&(Oe=0),Fe===G&&(Fe=0),ie[xe]=z(Z[xe],Z[Oe],Z[Fe]);const $=[];let le,ye=ie.concat();for(let xe=0,G=R.length;xe<G;xe++){const Oe=R[xe];le=[];for(let Fe=0,Ie=Oe.length,He=Ie-1,ft=Fe+1;Fe<Ie;Fe++,He++,ft++)He===Ie&&(He=0),ft===Ie&&(ft=0),le[Fe]=z(Oe[Fe],Oe[He],Oe[ft]);$.push(le),ye=ye.concat(le)}for(let xe=0;xe<_;xe++){const G=xe/_,Oe=m*Math.cos(G*Math.PI/2),Fe=y*Math.sin(G*Math.PI/2)+w;for(let Ie=0,He=Z.length;Ie<He;Ie++){const ft=ae(Z[Ie],ie[Ie],Fe);Ce(ft.x,ft.y,-Oe)}for(let Ie=0,He=R.length;Ie<He;Ie++){const ft=R[Ie];le=$[Ie];for(let Qe=0,V=ft.length;Qe<V;Qe++){const U=ae(ft[Qe],le[Qe],Fe);Ce(U.x,U.y,-Oe)}}}const De=y+w;for(let xe=0;xe<Q;xe++){const G=p?ae(A[xe],ye[xe],De):A[xe];T?(L.copy(I.normals[0]).multiplyScalar(G.x),C.copy(I.binormals[0]).multiplyScalar(G.y),N.copy(M[0]).add(L).add(C),Ce(N.x,N.y,N.z)):Ce(G.x,G.y,0)}for(let xe=1;xe<=h;xe++)for(let G=0;G<Q;G++){const Oe=p?ae(A[G],ye[G],De):A[G];T?(L.copy(I.normals[xe]).multiplyScalar(Oe.x),C.copy(I.binormals[xe]).multiplyScalar(Oe.y),N.copy(M[xe]).add(L).add(C),Ce(N.x,N.y,N.z)):Ce(Oe.x,Oe.y,d/h*xe)}for(let xe=_-1;xe>=0;xe--){const G=xe/_,Oe=m*Math.cos(G*Math.PI/2),Fe=y*Math.sin(G*Math.PI/2)+w;for(let Ie=0,He=Z.length;Ie<He;Ie++){const ft=ae(Z[Ie],ie[Ie],Fe);Ce(ft.x,ft.y,d+Oe)}for(let Ie=0,He=R.length;Ie<He;Ie++){const ft=R[Ie];le=$[Ie];for(let Qe=0,V=ft.length;Qe<V;Qe++){const U=ae(ft[Qe],le[Qe],Fe);T?Ce(U.x,U.y+M[h-1].y,M[h-1].x+Oe):Ce(U.x,U.y,d+Oe)}}}ue(),Me();function ue(){const xe=r.length/3;if(p){let G=0,Oe=Q*G;for(let Fe=0;Fe<pe;Fe++){const Ie=Y[Fe];ct(Ie[2]+Oe,Ie[1]+Oe,Ie[0]+Oe)}G=h+_*2,Oe=Q*G;for(let Fe=0;Fe<pe;Fe++){const Ie=Y[Fe];ct(Ie[0]+Oe,Ie[1]+Oe,Ie[2]+Oe)}}else{for(let G=0;G<pe;G++){const Oe=Y[G];ct(Oe[2],Oe[1],Oe[0])}for(let G=0;G<pe;G++){const Oe=Y[G];ct(Oe[0]+Q*h,Oe[1]+Q*h,Oe[2]+Q*h)}}i.addGroup(xe,r.length/3-xe,0)}function Me(){const xe=r.length/3;let G=0;we(Z,G),G+=Z.length;for(let Oe=0,Fe=R.length;Oe<Fe;Oe++){const Ie=R[Oe];we(Ie,G),G+=Ie.length}i.addGroup(xe,r.length/3-xe,1)}function we(xe,G){let Oe=xe.length;for(;--Oe>=0;){const Fe=Oe;let Ie=Oe-1;Ie<0&&(Ie=xe.length-1);for(let He=0,ft=h+_*2;He<ft;He++){const Qe=Q*He,V=Q*(He+1),U=G+Fe+Qe,ce=G+Ie+Qe,Se=G+Ie+V,Ee=G+Fe+V;gt(U,ce,Se,Ee)}}}function Ce(xe,G,Oe){u.push(xe),u.push(G),u.push(Oe)}function ct(xe,G,Oe){We(xe),We(G),We(Oe);const Fe=r.length/3,Ie=S.generateTopUV(i,r,Fe-3,Fe-2,Fe-1);nt(Ie[0]),nt(Ie[1]),nt(Ie[2])}function gt(xe,G,Oe,Fe){We(xe),We(G),We(Fe),We(G),We(Oe),We(Fe);const Ie=r.length/3,He=S.generateSideWallUV(i,r,Ie-6,Ie-3,Ie-2,Ie-1);nt(He[0]),nt(He[1]),nt(He[3]),nt(He[1]),nt(He[2]),nt(He[3])}function We(xe){r.push(u[xe*3+0]),r.push(u[xe*3+1]),r.push(u[xe*3+2])}function nt(xe){s.push(xe.x),s.push(xe.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 jk(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 ng[r.type]().fromJSON(r)),new jg(i,e.options)}}const Xk={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],a=e[i*3],u=e[i*3+1],f=e[r*3],h=e[r*3+1];return[new be(s,o),new be(a,u),new be(f,h)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],a=e[t*3+1],u=e[t*3+2],f=e[i*3],h=e[i*3+1],d=e[i*3+2],p=e[r*3],m=e[r*3+1],y=e[r*3+2],w=e[s*3],_=e[s*3+1],v=e[s*3+2];return Math.abs(a-h)<Math.abs(o-f)?[new be(o,1-u),new be(f,1-d),new be(p,1-y),new be(w,1-v)]:[new be(a,1-u),new be(h,1-d),new be(m,1-y),new be(_,1-v)]}};function jk(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 hh extends Ko{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 hh(e.radius,e.detail)}}class dh extends Ko{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 dh(e.radius,e.detail)}}class Yg extends Pt{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=[],u=[],f=[],h=[];let d=e;const p=(t-e)/r,m=new k,y=new be;for(let w=0;w<=r;w++){for(let _=0;_<=i;_++){const v=s+_/i*o;m.x=d*Math.cos(v),m.y=d*Math.sin(v),u.push(m.x,m.y,m.z),f.push(0,0,1),y.x=(m.x/t+1)/2,y.y=(m.y/t+1)/2,h.push(y.x,y.y)}d+=p}for(let w=0;w<r;w++){const _=w*(i+1);for(let v=0;v<i;v++){const S=v+_,M=S,T=S+i+1,I=S+i+2,C=S+1;a.push(M,T,C),a.push(T,I,C)}}this.setIndex(a),this.setAttribute("position",new lt(u,3)),this.setAttribute("normal",new lt(f,3)),this.setAttribute("uv",new lt(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Yg(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class qg extends Pt{constructor(e=new Ba([new be(0,.5),new be(-.5,-.5),new be(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let a=0,u=0;if(Array.isArray(e)===!1)f(e);else for(let h=0;h<e.length;h++)f(e[h]),this.addGroup(a,u,h),a+=u,u=0;this.setIndex(i),this.setAttribute("position",new lt(r,3)),this.setAttribute("normal",new lt(s,3)),this.setAttribute("uv",new lt(o,2));function f(h){const d=r.length/3,p=h.extractPoints(t);let m=p.shape;const y=p.holes;ys.isClockWise(m)===!1&&(m=m.reverse());for(let _=0,v=y.length;_<v;_++){const S=y[_];ys.isClockWise(S)===!0&&(y[_]=S.reverse())}const w=ys.triangulateShape(m,y);for(let _=0,v=y.length;_<v;_++){const S=y[_];m=m.concat(S)}for(let _=0,v=m.length;_<v;_++){const S=m[_];r.push(S.x,S.y,0),s.push(0,0,1),o.push(S.x,S.y)}for(let _=0,v=w.length;_<v;_++){const S=w[_],M=S[0]+d,T=S[1]+d,I=S[2]+d;i.push(M,T,I),u+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return Yk(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 qg(i,e.curveSegments)}}function Yk(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 ph extends Pt{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 u=Math.min(o+a,Math.PI);let f=0;const h=[],d=new k,p=new k,m=[],y=[],w=[],_=[];for(let v=0;v<=i;v++){const S=[],M=v/i;let T=0;v===0&&o===0?T=.5/t:v===i&&u===Math.PI&&(T=-.5/t);for(let I=0;I<=t;I++){const C=I/t;d.x=-e*Math.cos(r+C*s)*Math.sin(o+M*a),d.y=e*Math.cos(o+M*a),d.z=e*Math.sin(r+C*s)*Math.sin(o+M*a),y.push(d.x,d.y,d.z),p.copy(d).normalize(),w.push(p.x,p.y,p.z),_.push(C+T,1-M),S.push(f++)}h.push(S)}for(let v=0;v<i;v++)for(let S=0;S<t;S++){const M=h[v][S+1],T=h[v][S],I=h[v+1][S],C=h[v+1][S+1];(v!==0||o>0)&&m.push(M,T,C),(v!==i-1||u<Math.PI)&&m.push(T,I,C)}this.setIndex(m),this.setAttribute("position",new lt(y,3)),this.setAttribute("normal",new lt(w,3)),this.setAttribute("uv",new lt(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ph(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Zg extends Ko{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 Zg(e.radius,e.detail)}}class Kg extends Pt{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=[],u=[],f=[],h=new k,d=new k,p=new k;for(let m=0;m<=i;m++)for(let y=0;y<=r;y++){const w=y/r*s,_=m/i*Math.PI*2;d.x=(e+t*Math.cos(_))*Math.cos(w),d.y=(e+t*Math.cos(_))*Math.sin(w),d.z=t*Math.sin(_),a.push(d.x,d.y,d.z),h.x=e*Math.cos(w),h.y=e*Math.sin(w),p.subVectors(d,h).normalize(),u.push(p.x,p.y,p.z),f.push(y/r),f.push(m/i)}for(let m=1;m<=i;m++)for(let y=1;y<=r;y++){const w=(r+1)*m+y-1,_=(r+1)*(m-1)+y-1,v=(r+1)*(m-1)+y,S=(r+1)*m+y;o.push(w,_,S),o.push(_,v,S)}this.setIndex(o),this.setAttribute("position",new lt(a,3)),this.setAttribute("normal",new lt(u,3)),this.setAttribute("uv",new lt(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Kg(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Qg extends Pt{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=[],u=[],f=[],h=[],d=new k,p=new k,m=new k,y=new k,w=new k,_=new k,v=new k;for(let M=0;M<=i;++M){const T=M/i*s*Math.PI*2;S(T,s,o,e,m),S(T+.01,s,o,e,y),_.subVectors(y,m),v.addVectors(y,m),w.crossVectors(_,v),v.crossVectors(w,_),w.normalize(),v.normalize();for(let I=0;I<=r;++I){const C=I/r*Math.PI*2,L=-t*Math.cos(C),N=t*Math.sin(C);d.x=m.x+(L*v.x+N*w.x),d.y=m.y+(L*v.y+N*w.y),d.z=m.z+(L*v.z+N*w.z),u.push(d.x,d.y,d.z),p.subVectors(d,m).normalize(),f.push(p.x,p.y,p.z),h.push(M/i),h.push(I/r)}}for(let M=1;M<=i;M++)for(let T=1;T<=r;T++){const I=(r+1)*(M-1)+(T-1),C=(r+1)*M+(T-1),L=(r+1)*M+T,N=(r+1)*(M-1)+T;a.push(I,C,N),a.push(C,L,N)}this.setIndex(a),this.setAttribute("position",new lt(u,3)),this.setAttribute("normal",new lt(f,3)),this.setAttribute("uv",new lt(h,2));function S(M,T,I,C,L){const N=Math.cos(M),B=Math.sin(M),A=I/T*M,R=Math.cos(A);L.x=C*(2+R)*.5*N,L.y=C*(2+R)*B*.5,L.z=C*Math.sin(A)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Qg(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Gc extends Pt{constructor(e=new CS(new k(-1,-1,0),new k(-1,1,0),new k(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 k,u=new k,f=new be;let h=new k;const d=[],p=[],m=[],y=[];w(),this.setIndex(y),this.setAttribute("position",new lt(d,3)),this.setAttribute("normal",new lt(p,3)),this.setAttribute("uv",new lt(m,2));function w(){for(let M=0;M<t;M++)_(M);_(s===!1?t:0),S(),v()}function _(M){h=e.getPointAt(M/t,h);const T=o.normals[M],I=o.binormals[M];for(let C=0;C<=r;C++){const L=C/r*Math.PI*2,N=Math.sin(L),B=-Math.cos(L);u.x=B*T.x+N*I.x,u.y=B*T.y+N*I.y,u.z=B*T.z+N*I.z,u.normalize(),p.push(u.x,u.y,u.z),a.x=h.x+i*u.x,a.y=h.y+i*u.y,a.z=h.z+i*u.z,d.push(a.x,a.y,a.z)}}function v(){for(let M=1;M<=t;M++)for(let T=1;T<=r;T++){const I=(r+1)*(M-1)+(T-1),C=(r+1)*M+(T-1),L=(r+1)*M+T,N=(r+1)*(M-1)+T;y.push(I,C,N),y.push(C,L,N)}}function S(){for(let M=0;M<=t;M++)for(let T=0;T<=r;T++)f.x=M/t,f.y=T/r,m.push(f.x,f.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 Gc(new ng[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class VR extends Pt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new k,s=new k;if(e.index!==null){const o=e.attributes.position,a=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:a.count,materialIndex:0}]);for(let f=0,h=u.length;f<h;++f){const d=u[f],p=d.start,m=d.count;for(let y=p,w=p+m;y<w;y+=3)for(let _=0;_<3;_++){const v=a.getX(y+_),S=a.getX(y+(_+1)%3);r.fromBufferAttribute(o,v),s.fromBufferAttribute(o,S),tT(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,u=o.count/3;a<u;a++)for(let f=0;f<3;f++){const h=3*a+f,d=3*a+(f+1)%3;r.fromBufferAttribute(o,h),s.fromBufferAttribute(o,d),tT(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new lt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function tT(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 nT=Object.freeze({__proto__:null,BoxGeometry:nl,CapsuleGeometry:Hg,CircleGeometry:Gg,ConeGeometry:Vg,CylinderGeometry:Ss,DodecahedronGeometry:Wg,EdgesGeometry:zR,ExtrudeGeometry:jg,IcosahedronGeometry:hh,LatheGeometry:fh,OctahedronGeometry:dh,PlaneGeometry:Zo,PolyhedronGeometry:Ko,RingGeometry:Yg,ShapeGeometry:qg,SphereGeometry:ph,TetrahedronGeometry:Zg,TorusGeometry:Kg,TorusKnotGeometry:Qg,TubeGeometry:Gc,WireframeGeometry:VR});class WR extends xi{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new rt(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 XR extends qi{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class IS extends xi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new rt(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 rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new be(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 Ii,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 jR extends IS{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new be(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 rt(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 rt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new rt(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 YR extends xi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new rt(16777215),this.specular=new rt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ii,this.combine=th,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 qR extends xi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new rt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new be(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 ZR extends xi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new be(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 KR extends xi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new rt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ii,this.combine=th,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 QR extends xi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new rt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,this.normalScale=new be(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 $R extends Di{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 Ia(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 JR(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function eC(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 Z_(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[a+u]}return r}function LS(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 qk(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const f=s.tracks[u],h=f.getValueSize(),d=[],p=[];for(let m=0;m<f.times.length;++m){const y=f.times[m]*r;if(!(y<t||y>=i)){d.push(f.times[m]);for(let w=0;w<h;++w)p.push(f.values[m*h+w])}}d.length!==0&&(f.times=Ia(d,f.times.constructor),f.values=Ia(p,f.values.constructor),o.push(f))}s.tracks=o;let a=1/0;for(let u=0;u<s.tracks.length;++u)a>s.tracks[u].times[0]&&(a=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*a);return s.resetDuration(),s}function Zk(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],u=a.ValueTypeName;if(u==="bool"||u==="string")continue;const f=n.tracks.find(function(v){return v.name===a.name&&v.ValueTypeName===u});if(f===void 0)continue;let h=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);let p=0;const m=f.getValueSize();f.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const y=a.times.length-1;let w;if(s<=a.times[0]){const v=h,S=d-h;w=a.values.slice(v,S)}else if(s>=a.times[y]){const v=y*d+h,S=v+d-h;w=a.values.slice(v,S)}else{const v=a.createInterpolant(),S=h,M=d-h;v.evaluate(s),w=v.resultBuffer.slice(S,M)}u==="quaternion"&&new Gn().fromArray(w).normalize().conjugate().toArray(w);const _=f.times.length;for(let v=0;v<_;++v){const S=v*m+p;if(u==="quaternion")Gn.multiplyQuaternionsFlat(f.values,S,w,0,f.values,S);else{const M=m-p*2;for(let T=0;T<M;++T)f.values[S+T]-=w[T]}}}return n.blendMode=uS,n}const Kk={convertArray:Ia,isTypedArray:JR,getKeyframeOrder:eC,sortedArray:Z_,flattenJSON:LS,subclip:qk,makeClipAdditive:Zk};class mh{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 u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===u)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 tC extends mh{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:ba,endingEnd:ba}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,a=r[s],u=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case Ra:s=e,a=2*t-i;break;case If:s=r.length-2,a=t+r[s]-r[s+1];break;default:s=e,a=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Ra:o=e,u=2*i-t;break;case If:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const f=(i-t)*.5,h=this.valueSize;this._weightPrev=f/(t-a),this._weightNext=f/(u-i),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,u=e*a,f=u-a,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,m=this._weightNext,y=(i-t)/(r-t),w=y*y,_=w*y,v=-p*_+2*p*w-p*y,S=(1+p)*_+(-1.5-2*p)*w+(-.5+p)*y+1,M=(-1-m)*_+(1.5+m)*w+.5*y,T=m*_-m*w;for(let I=0;I!==a;++I)s[I]=v*o[h+I]+S*o[f+I]+M*o[u+I]+T*o[d+I];return s}}class NS extends mh{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,u=e*a,f=u-a,h=(i-t)/(r-t),d=1-h;for(let p=0;p!==a;++p)s[p]=o[f+p]*d+o[u+p]*h;return s}}class nC extends mh{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Jr{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=Ia(t,this.TimeBufferType),this.values=Ia(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:Ia(e.times,Array),values:Ia(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new nC(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new NS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new tC(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Pf:t=this.InterpolantFactoryMethodDiscrete;break;case Jm:t=this.InterpolantFactoryMethodLinear;break;case Bp: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 Pf;case this.InterpolantFactoryMethodLinear:return Jm;case this.InterpolantFactoryMethodSmooth:return Bp}}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 u=i[a];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,u,o),e=!1;break}o=u}if(r!==void 0&&JR(r))for(let a=0,u=r.length;a!==u;++a){const f=r[a];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,f),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Bp,s=e.length-1;let o=1;for(let a=1;a<s;++a){let u=!1;const f=e[a],h=e[a+1];if(f!==h&&(a!==1||f!==e[0]))if(r)u=!0;else{const d=a*i,p=d-i,m=d+i;for(let y=0;y!==i;++y){const w=t[d+y];if(w!==t[p+y]||w!==t[m+y]){u=!0;break}}}if(u){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,u=o*i,f=0;f!==i;++f)t[u+f]=t[a+f];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Jr.prototype.TimeBufferType=Float32Array;Jr.prototype.ValueBufferType=Float32Array;Jr.prototype.DefaultInterpolation=Jm;class il extends Jr{constructor(e,t,i){super(e,t,i)}}il.prototype.ValueTypeName="bool";il.prototype.ValueBufferType=Array;il.prototype.DefaultInterpolation=Pf;il.prototype.InterpolantFactoryMethodLinear=void 0;il.prototype.InterpolantFactoryMethodSmooth=void 0;class DS extends Jr{}DS.prototype.ValueTypeName="color";class Gf extends Jr{}Gf.prototype.ValueTypeName="number";class iC extends mh{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,u=(i-t)/(r-t);let f=e*a;for(let h=f+a;f!==h;f+=4)Gn.slerpFlat(s,0,o,f-a,o,f,u);return s}}class gh extends Jr{InterpolantFactoryMethodLinear(e){return new iC(this.times,this.values,this.getValueSize(),e)}}gh.prototype.ValueTypeName="quaternion";gh.prototype.InterpolantFactoryMethodSmooth=void 0;class rl extends Jr{constructor(e,t,i){super(e,t,i)}}rl.prototype.ValueTypeName="string";rl.prototype.ValueBufferType=Array;rl.prototype.DefaultInterpolation=Pf;rl.prototype.InterpolantFactoryMethodLinear=void 0;rl.prototype.InterpolantFactoryMethodSmooth=void 0;class Vf extends Jr{}Vf.prototype.ValueTypeName="vector";class Wf{constructor(e="",t=-1,i=[],r=Pg){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=or(),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($k(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(Jr.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a<s;a++){let u=[],f=[];u.push((a+s-1)%s,a,(a+1)%s),f.push(0,1,0);const h=eC(u);u=Z_(u,1,h),f=Z_(f,1,h),!r&&u[0]===0&&(u.push(s),f.push(f[0])),o.push(new Gf(".morphTargetInfluences["+t[a].name+"]",u,f).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,u=e.length;a<u;a++){const f=e[a],h=f.name.match(s);if(h&&h.length>1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(f)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,m,y,w){if(m.length!==0){const _=[],v=[];LS(m,_,v,y),_.length!==0&&w.push(new d(p,_,v))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let u=e.length||-1;const f=e.hierarchy||[];for(let d=0;d<f.length;d++){const p=f[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 w=0;w<p[y].morphTargets.length;w++)m[p[y].morphTargets[w]]=-1;for(const w in m){const _=[],v=[];for(let S=0;S!==p[y].morphTargets.length;++S){const M=p[y];_.push(M.time),v.push(M.morphTarget===w?1:0)}r.push(new Gf(".morphTargetInfluence["+w+"]",_,v))}u=m.length*o}else{const m=".bones["+t[d].name+"]";i(Vf,m+".position",p,"pos",r),i(gh,m+".quaternion",p,"rot",r),i(Vf,m+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,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 Qk(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Gf;case"vector":case"vector2":case"vector3":case"vector4":return Vf;case"color":return DS;case"quaternion":return gh;case"bool":case"boolean":return il;case"string":return rl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function $k(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=Qk(n.type);if(n.times===void 0){const t=[],i=[];LS(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 Vs={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 $g{constructor(e,t,i){const r=this;let s=!1,o=0,a=0,u;const f=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(h){a++,s===!1&&r.onStart!==void 0&&r.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,r.onProgress!==void 0&&r.onProgress(h,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(h){r.onError!==void 0&&r.onError(h)},this.resolveURL=function(h){return u?u(h):h},this.setURLModifier=function(h){return u=h,this},this.addHandler=function(h,d){return f.push(h,d),this},this.removeHandler=function(h){const d=f.indexOf(h);return d!==-1&&f.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=f.length;d<p;d+=2){const m=f[d],y=f[d+1];if(m.global&&(m.lastIndex=0),m.test(h))return y}return null}}}const rC=new $g;class Ui{constructor(e){this.manager=e!==void 0?e:rC,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}}Ui.DEFAULT_MATERIAL_NAME="__DEFAULT";const Os={};class Jk extends Error{constructor(e,t){super(e),this.response=t}}class ar extends Ui{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=Vs.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Os[e]!==void 0){Os[e].push({onLoad:t,onProgress:i,onError:r});return}Os[e]=[],Os[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,u=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const h=Os[e],d=f.body.getReader(),p=f.headers.get("X-File-Size")||f.headers.get("Content-Length"),m=p?parseInt(p):0,y=m!==0;let w=0;const _=new ReadableStream({start(v){S();function S(){d.read().then(({done:M,value:T})=>{if(M)v.close();else{w+=T.byteLength;const I=new ProgressEvent("progress",{lengthComputable:y,loaded:w,total:m});for(let C=0,L=h.length;C<L;C++){const N=h[C];N.onProgress&&N.onProgress(I)}v.enqueue(T),S()}},M=>{v.error(M)})}}});return new Response(_)}else throw new Jk(`fetch for "${f.url}" responded with ${f.status}: ${f.statusText}`,f)}).then(f=>{switch(u){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return f.json();default:if(a===void 0)return f.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),p=d&&d[1]?d[1].toLowerCase():void 0,m=new TextDecoder(p);return f.arrayBuffer().then(y=>m.decode(y))}}}).then(f=>{Vs.add(e,f);const h=Os[e];delete Os[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onLoad&&m.onLoad(f)}}).catch(f=>{const h=Os[e];if(h===void 0)throw this.manager.itemError(e),f;delete Os[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(f)}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 ez extends Ui{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ar(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=Wf.parse(e[i]);t.push(r)}return t}}class tz extends Ui{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],a=new kg,u=new ar(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let f=0;function h(d){u.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},f+=1,f===6&&(m.mipmapCount===1&&(a.minFilter=Qt),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)h(d);else u.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 w=0;w<p.mipmapCount;w++)o[y].mipmaps.push(p.mipmaps[y*p.mipmapCount+w]),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=Qt),a.format=p.format,a.needsUpdate=!0,t&&t(a)},i,r);return a}}class Xf extends Ui{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=Vs.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=Ff("img");function u(){h(),Vs.add(e,this),t&&t(this),s.manager.itemEnd(e)}function f(d){h(),r&&r(d),s.manager.itemError(e),s.manager.itemEnd(e)}function h(){a.removeEventListener("load",u,!1),a.removeEventListener("error",f,!1)}return a.addEventListener("load",u,!1),a.addEventListener("error",f,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class sC extends Ui{constructor(e){super(e)}load(e,t,i,r){const s=new lh;s.colorSpace=ir;const o=new Xf(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function u(f){o.load(e[f],function(h){s.images[f]=h,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let f=0;f<e.length;++f)u(f);return s}}class US extends Ui{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Zr,a=new ar(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(u){let f;try{f=s.parse(u)}catch(h){if(r!==void 0)r(h);else{console.error(h);return}}f.image!==void 0?o.image=f.image:f.data!==void 0&&(o.image.width=f.width,o.image.height=f.height,o.image.data=f.data),o.wrapS=f.wrapS!==void 0?f.wrapS:Fn,o.wrapT=f.wrapT!==void 0?f.wrapT:Fn,o.magFilter=f.magFilter!==void 0?f.magFilter:Qt,o.minFilter=f.minFilter!==void 0?f.minFilter:Qt,o.anisotropy=f.anisotropy!==void 0?f.anisotropy:1,f.colorSpace!==void 0&&(o.colorSpace=f.colorSpace),f.flipY!==void 0&&(o.flipY=f.flipY),f.format!==void 0&&(o.format=f.format),f.type!==void 0&&(o.type=f.type),f.mipmaps!==void 0&&(o.mipmaps=f.mipmaps,o.minFilter=hs),f.mipmapCount===1&&(o.minFilter=Qt),f.generateMipmaps!==void 0&&(o.generateMipmaps=f.generateMipmaps),o.needsUpdate=!0,t&&t(o,f)},i,r),o}}class nz extends Ui{constructor(e){super(e)}load(e,t,i,r){const s=new nn,o=new Xf(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 Qo extends Gt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new rt(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 oC extends Qo{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Gt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new rt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Ay=new mt,iT=new k,rT=new k;class OS{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new be(512,512),this.map=null,this.mapPass=null,this.matrix=new mt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ch,this._frameExtents=new be(1,1),this._viewportCount=1,this._viewports=[new Xt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;iT.setFromMatrixPosition(e.matrixWorld),t.position.copy(iT),rT.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(rT),t.updateMatrixWorld(),Ay.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ay),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Ay)}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 iz extends OS{constructor(){super(new $n(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=Ac*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 aC extends Qo{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 iz}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 sT=new mt,Pu=new k,by=new k;class rz extends OS{constructor(){super(new $n(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new be(4,2),this._viewportCount=6,this._viewports=[new Xt(2,1,1,1),new Xt(0,1,1,1),new Xt(3,1,1,1),new Xt(1,1,1,1),new Xt(3,0,1,1),new Xt(1,0,1,1)],this._cubeDirections=[new k(1,0,0),new k(-1,0,0),new k(0,0,1),new k(0,0,-1),new k(0,1,0),new k(0,-1,0)],this._cubeUps=[new k(0,1,0),new k(0,1,0),new k(0,1,0),new k(0,1,0),new k(0,0,1),new k(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()),Pu.setFromMatrixPosition(e.matrixWorld),i.position.copy(Pu),by.copy(i.position),by.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(by),i.updateMatrixWorld(),r.makeTranslation(-Pu.x,-Pu.y,-Pu.z),sT.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(sT)}}class lC extends Qo{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 rz}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 sz extends OS{constructor(){super(new Bc(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class cC extends Qo{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 sz}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class uC extends Qo{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class fC extends Qo{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 hC{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new k)}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 dC extends Qo{constructor(e=new hC,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 Jg extends Ui{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new ar(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(u){r?r(u):console.error(u),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=this.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 rt().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 rt().setHex(o.value);break;case"v2":r.uniforms[s].value=new be().fromArray(o.value);break;case"v3":r.uniforms[s].value=new k().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Xt().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Rt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new mt().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 be().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 be().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}createMaterialFromType(e){return Jg.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:WR,SpriteMaterial:MS,RawShaderMaterial:XR,ShaderMaterial:qi,PointsMaterial:ES,MeshPhysicalMaterial:jR,MeshStandardMaterial:IS,MeshPhongMaterial:YR,MeshToonMaterial:qR,MeshNormalMaterial:ZR,MeshLambertMaterial:KR,MeshDepthMaterial:_S,MeshDistanceMaterial:xS,MeshBasicMaterial:$s,MeshMatcapMaterial:QR,LineDashedMaterial:$R,LineBasicMaterial:Di,Material:xi};return new t[e]}}class K_{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 pC extends Pt{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 mC extends Ui{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ar(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(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(m,y){if(t[y]!==void 0)return t[y];const _=m.interleavedBuffers[y],v=s(m,_.buffer),S=rc(_.type,v),M=new Og(S,_.stride);return M.uuid=_.uuid,t[y]=M,M}function s(m,y){if(i[y]!==void 0)return i[y];const _=m.arrayBuffers[y],v=new Uint32Array(_).buffer;return i[y]=v,v}const o=e.isInstancedBufferGeometry?new pC:new Pt,a=e.data.index;if(a!==void 0){const m=rc(a.type,a.array);o.setIndex(new Jt(m,1))}const u=e.data.attributes;for(const m in u){const y=u[m];let w;if(y.isInterleavedBufferAttribute){const _=r(e.data,y.data);w=new Qa(_,y.itemSize,y.offset,y.normalized)}else{const _=rc(y.type,y.array),v=y.isInstancedBufferAttribute?Rc:Jt;w=new v(_,y.itemSize,y.normalized)}y.name!==void 0&&(w.name=y.name),y.usage!==void 0&&w.setUsage(y.usage),o.setAttribute(m,w)}const f=e.data.morphAttributes;if(f)for(const m in f){const y=f[m],w=[];for(let _=0,v=y.length;_<v;_++){const S=y[_];let M;if(S.isInterleavedBufferAttribute){const T=r(e.data,S.data);M=new Qa(T,S.itemSize,S.offset,S.normalized)}else{const T=rc(S.type,S.array);M=new Jt(T,S.itemSize,S.normalized)}S.name!==void 0&&(M.name=S.name),w.push(M)}o.morphAttributes[m]=w}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 w=d[m];o.addGroup(w.start,w.count,w.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const m=new k;p.center!==void 0&&m.fromArray(p.center),o.boundingSphere=new yi(m,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class oz extends Ui{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?K_.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new ar(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(u){let f=null;try{f=JSON.parse(u)}catch(d){r!==void 0&&r(d),console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message);return}const h=f.metadata;if(h===void 0||h.type===void 0||h.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(f,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?K_.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new ar(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),u=a.metadata;if(u===void 0||u.type===void 0||u.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(f)}),a=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,a),f=this.parseObject(e.object,s,u,a,i),h=this.parseSkeletons(e.skeletons,f);if(this.bindSkeletons(f,h),this.bindLightTargets(f),t!==void 0){let d=!1;for(const p in o)if(o[p].data instanceof HTMLImageElement){d=!0;break}d===!1&&t(f)}return f}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),u=this.parseObject(e.object,r,a,o,t),f=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,f),this.bindLightTargets(u),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new Ba().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 Fg().fromJSON(e[s],r);i[a.uuid]=a}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new mC;for(let s=0,o=e.length;s<o;s++){let a;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(u);break;default:u.type in nT?a=nT[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}a.uuid=u.uuid,u.name!==void 0&&(a.name=u.name),u.userData!==void 0&&(a.userData=u.userData),i[u.uuid]=a}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new Jg;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const u=e[o];i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=Wf.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function a(u){if(typeof u=="string"){const f=u,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(f)?f:i.resourcePath+f;return o(h)}else return u.data?{data:rc(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new $g(t);s=new Xf(u),s.setCrossOrigin(this.crossOrigin);for(let f=0,h=e.length;f<h;f++){const d=e[f],p=d.url;if(Array.isArray(p)){const m=[];for(let y=0,w=p.length;y<w;y++){const _=p[y],v=a(_);v!==null&&(v instanceof HTMLImageElement?m.push(v):m.push(new Zr(v.data,v.width,v.height)))}r[d.uuid]=new Ca(m)}else{const m=a(d.url);r[d.uuid]=new Ca(m)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const a=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await r.loadAsync(u)}else return o.data?{data:rc(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new Xf(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const u=e[o],f=u.url;if(Array.isArray(f)){const h=[];for(let d=0,p=f.length;d<p;d++){const m=f[d],y=await s(m);y!==null&&(y instanceof HTMLImageElement?h.push(y):h.push(new Zr(y.data,y.width,y.height)))}i[u.uuid]=new Ca(h)}else{const h=await s(u.url);i[u.uuid]=new Ca(h)}}}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 u=t[a.image],f=u.data;let h;Array.isArray(f)?(h=new lh,f.length===6&&(h.needsUpdate=!0)):(f&&f.data?h=new Zr:h=new nn,f&&(h.needsUpdate=!0)),h.source=u,h.uuid=a.uuid,a.name!==void 0&&(h.name=a.name),a.mapping!==void 0&&(h.mapping=i(a.mapping,az)),a.channel!==void 0&&(h.channel=a.channel),a.offset!==void 0&&h.offset.fromArray(a.offset),a.repeat!==void 0&&h.repeat.fromArray(a.repeat),a.center!==void 0&&h.center.fromArray(a.center),a.rotation!==void 0&&(h.rotation=a.rotation),a.wrap!==void 0&&(h.wrapS=i(a.wrap[0],oT),h.wrapT=i(a.wrap[1],oT)),a.format!==void 0&&(h.format=a.format),a.internalFormat!==void 0&&(h.internalFormat=a.internalFormat),a.type!==void 0&&(h.type=a.type),a.colorSpace!==void 0&&(h.colorSpace=a.colorSpace),a.minFilter!==void 0&&(h.minFilter=i(a.minFilter,aT)),a.magFilter!==void 0&&(h.magFilter=i(a.magFilter,aT)),a.anisotropy!==void 0&&(h.anisotropy=a.anisotropy),a.flipY!==void 0&&(h.flipY=a.flipY),a.generateMipmaps!==void 0&&(h.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(h.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(h.unpackAlignment=a.unpackAlignment),a.compareFunction!==void 0&&(h.compareFunction=a.compareFunction),a.userData!==void 0&&(h.userData=a.userData),r[a.uuid]=h}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 u(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let y=0,w=p.length;y<w;y++){const _=p[y];i[_]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",_),m.push(i[_])}return m}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function f(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let h,d;switch(e.type){case"Scene":o=new uh,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new rt(e.background):o.background=f(e.background)),e.environment!==void 0&&(o.environment=f(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new Ug(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new Dg(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 $n(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 Bc(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 uC(e.color,e.intensity);break;case"DirectionalLight":o=new cC(e.color,e.intensity),o.target=e.target||"";break;case"PointLight":o=new lC(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new fC(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new aC(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),o.target=e.target||"";break;case"HemisphereLight":o=new oC(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new dC().fromJSON(e);break;case"SkinnedMesh":h=a(e.geometry),d=u(e.material),o=new PR(h,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":h=a(e.geometry),d=u(e.material),o=new xn(h,d);break;case"InstancedMesh":h=a(e.geometry),d=u(e.material);const p=e.count,m=e.instanceMatrix,y=e.instanceColor;o=new IR(h,d,p),o.instanceMatrix=new Rc(new Float32Array(m.array),16),y!==void 0&&(o.instanceColor=new Rc(new Float32Array(y.array),y.itemSize));break;case"BatchedMesh":h=a(e.geometry),d=u(e.material),o=new LR(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,d),o.geometry=h,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(w=>{const _=new Pi;_.min.fromArray(w.boxMin),_.max.fromArray(w.boxMax);const v=new yi;return v.radius=w.sphereRadius,v.center.fromArray(w.sphereCenter),{boxInitialized:w.boxInitialized,box:_,sphereInitialized:w.sphereInitialized,sphere:v}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=f(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=f(e.colorsTexture.uuid));break;case"LOD":o=new CR;break;case"Line":o=new Go(a(e.geometry),u(e.material));break;case"LineLoop":o=new NR(a(e.geometry),u(e.material));break;case"LineSegments":o=new ws(a(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new DR(a(e.geometry),u(e.material));break;case"Sprite":o=new RR(u(e.material));break;case"Group":o=new oc;break;case"Bone":o=new wS;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],w=o.getObjectByProperty("uuid",y.object);w!==void 0&&o.addLevel(w,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 az={UVMapping:Bo,CubeReflectionMapping:_s,CubeRefractionMapping:Ho,EquirectangularReflectionMapping:Ec,EquirectangularRefractionMapping:bf,CubeUVReflectionMapping:kc},oT={RepeatWrapping:Rf,ClampToEdgeWrapping:Fn,MirroredRepeatWrapping:Cf},aT={NearestFilter:Jn,NearestMipmapNearestFilter:nS,NearestMipmapLinearFilter:ic,LinearFilter:Qt,LinearMipmapNearestFilter:$u,LinearMipmapLinearFilter:hs};class lz extends Ui{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=Vs.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(f=>{t&&t(f),s.manager.itemEnd(e)}).catch(f=>{r&&r(f)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const u=fetch(e,a).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(f){return Vs.add(e,f),t&&t(f),s.manager.itemEnd(e),f}).catch(function(f){r&&r(f),Vs.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Vs.add(e,u),s.manager.itemStart(e)}}let vp;class FS{static getContext(){return vp===void 0&&(vp=new(window.AudioContext||window.webkitAudioContext)),vp}static setContext(e){vp=e}}class cz extends Ui{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ar(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){try{const f=u.slice(0);FS.getContext().decodeAudioData(f,function(d){t(d)}).catch(a)}catch(f){a(f)}},i,r);function a(u){r?r(u):console.error(u),s.manager.itemError(e)}}}const lT=new mt,cT=new mt,pa=new mt;class uz{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new $n,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new $n,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,pa.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(ka*t.fov*.5)/t.zoom;let a,u;cT.elements[12]=-r,lT.elements[12]=r,a=-o*t.aspect+s,u=o*t.aspect+s,pa.elements[0]=2*t.near/(u-a),pa.elements[8]=(u+a)/(u-a),this.cameraL.projectionMatrix.copy(pa),a=-o*t.aspect-s,u=o*t.aspect-s,pa.elements[0]=2*t.near/(u-a),pa.elements[8]=(u+a)/(u-a),this.cameraR.projectionMatrix.copy(pa)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(cT),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(lT)}}class kS{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=uT(),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=uT();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function uT(){return performance.now()}const ma=new k,fT=new Gn,fz=new k,ga=new k;class hz extends Gt{constructor(){super(),this.type="AudioListener",this.context=FS.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new kS}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(ma,fT,fz),ga.set(0,0,-1).applyQuaternion(fT),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ma.x,r),t.positionY.linearRampToValueAtTime(ma.y,r),t.positionZ.linearRampToValueAtTime(ma.z,r),t.forwardX.linearRampToValueAtTime(ga.x,r),t.forwardY.linearRampToValueAtTime(ga.y,r),t.forwardZ.linearRampToValueAtTime(ga.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(ma.x,ma.y,ma.z),t.setOrientation(ga.x,ga.y,ga.z,i.x,i.y,i.z)}}class gC 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(e=0){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.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;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 va=new k,hT=new Gn,dz=new k,ya=new k;class pz extends gC{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(va,hT,dz),ya.set(0,0,1).applyQuaternion(hT);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(va.x,i),t.positionY.linearRampToValueAtTime(va.y,i),t.positionZ.linearRampToValueAtTime(va.z,i),t.orientationX.linearRampToValueAtTime(ya.x,i),t.orientationY.linearRampToValueAtTime(ya.y,i),t.orientationZ.linearRampToValueAtTime(ya.z,i)}else t.setPosition(va.x,va.y,va.z),t.setOrientation(ya.x,ya.y,ya.z)}}class mz{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 vC{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 u=t*this._origIndex;this._mixBufferRegion(i,r,u,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let u=t,f=t+t;u!==f;++u)if(i[u]!==i[u+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<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){Gn.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Gn.multiplyQuaternionsFlat(e,o,e,t,e,i),Gn.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const u=t+a;e[u]=e[u]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const zS="\\[\\]\\.:\\/",gz=new RegExp("["+zS+"]","g"),BS="[^"+zS+"]",vz="[^"+zS.replace("\\.","")+"]",yz=/((?:WC+[\/:])*)/.source.replace("WC",BS),_z=/(WCOD+)?/.source.replace("WCOD",vz),xz=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",BS),Sz=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",BS),Mz=new RegExp("^"+yz+_z+xz+Sz+"$"),wz=["material","materials","bones","map"];class Ez{constructor(e,t,i){const r=i||Wt.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 Wt{constructor(e,t,i){this.path=t,this.parsedPath=i||Wt.parseTrackName(t),this.node=Wt.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 Wt.Composite(e,t,i):new Wt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(gz,"")}static parseTrackName(e){const t=Mz.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);wz.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 u=i(a.children);if(u)return u}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=Wt.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 f=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 h=0;h<e.length;h++)if(e[h].name===f){f=h;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(f!==void 0){if(e[f]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[f]}}const o=e[r];if(o===void 0){const f=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+f+"."+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 u=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])}u=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(u=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Wt.Composite=Ez;Wt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Wt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Wt.prototype.GetterByBindingType=[Wt.prototype._getValue_direct,Wt.prototype._getValue_array,Wt.prototype._getValue_arrayElement,Wt.prototype._getValue_toArray];Wt.prototype.SetterByBindingTypeAndVersioning=[[Wt.prototype._setValue_direct,Wt.prototype._setValue_direct_setNeedsUpdate,Wt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Wt.prototype._setValue_array,Wt.prototype._setValue_array_setNeedsUpdate,Wt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Wt.prototype._setValue_arrayElement,Wt.prototype._setValue_arrayElement_setNeedsUpdate,Wt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Wt.prototype._setValue_fromArray,Wt.prototype._setValue_fromArray_setNeedsUpdate,Wt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Tz{constructor(){this.isAnimationObjectGroup=!0,this.uuid=or(),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,u=e.length,f=this.nCachedObjects_;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],m=p.uuid;let y=t[m];if(y===void 0){y=u++,t[m]=y,e.push(p);for(let w=0,_=o;w!==_;++w)s[w].push(new Wt(p,i[w],r[w]))}else if(y<f){a=e[y];const w=--f,_=e[w];t[_.uuid]=y,e[y]=_,t[m]=w,e[w]=p;for(let v=0,S=o;v!==S;++v){const M=s[v],T=M[w];let I=M[y];M[y]=T,I===void 0&&(I=new Wt(p,i[v],r[v])),M[w]=I}}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_=f}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 u=arguments[o],f=u.uuid,h=t[f];if(h!==void 0&&h>=s){const d=s++,p=e[d];t[p.uuid]=h,e[h]=p,t[f]=d,e[d]=u;for(let m=0,y=r;m!==y;++m){const w=i[m],_=w[d],v=w[h];w[h]=_,w[d]=v}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,u=arguments.length;a!==u;++a){const f=arguments[a],h=f.uuid,d=t[h];if(d!==void 0)if(delete t[h],d<s){const p=--s,m=e[p],y=--o,w=e[y];t[m.uuid]=d,e[d]=m,t[w.uuid]=p,e[p]=w,e.pop();for(let _=0,v=r;_!==v;++_){const S=i[_],M=S[p],T=S[y];S[d]=M,S[p]=T,S.pop()}}else{const p=--o,m=e[p];p>0&&(t[m.uuid]=d),e[d]=m,e.pop();for(let y=0,w=r;y!==w;++y){const _=i[y];_[d]=_[p],_.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,u=this._objects,f=u.length,h=this.nCachedObjects_,d=new Array(f);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(d);for(let p=h,m=u.length;p!==m;++p){const y=u[p];d[p]=new Wt(y,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,u=o[a],f=e[a];t[f]=i,o[i]=u,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class yC{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),u={endingStart:ba,endingEnd:ba};for(let f=0;f!==o;++f){const h=s[f].createInterpolant(null);a[f]=h,h.settings=u}this._interpolantSettings=u,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=eR,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const u=a.parameterPositions,f=a.sampleValues;return u[0]=s,u[1]=s+i,f[0]=e/o,f[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const u=(e-s)*i;u<0||i===0?t=0:(this._startTime=null,t=i*u)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const u=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case uS:for(let h=0,d=u.length;h!==d;++h)u[h].evaluate(o),f[h].accumulateAdditive(a);break;case Pg:default:for(let h=0,d=u.length;h!==d;++h)u[h].evaluate(o),f[h].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===tR;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===Jb){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const u=this.repetitions-s;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Ra,r.endingEnd=Ra):(e?r.endingStart=this.zeroSlopeAtStart?Ra:ba:r.endingStart=If,t?r.endingEnd=this.zeroSlopeAtEnd?Ra:ba:r.endingEnd=If)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,u=o.sampleValues;return a[0]=s,u[0]=t,a[1]=s+e,u[1]=i,this}}const Az=new Float32Array(1);class bz extends Ms{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,u=i.uuid,f=this._bindingsByRootAndName;let h=f[u];h===void 0&&(h={},f[u]=h);for(let d=0;d!==s;++d){const p=r[d],m=p.name;let y=h[m];if(y!==void 0)++y.referenceCount,o[d]=y;else{if(y=o[d],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,u,m));continue}const w=t&&t._propertyBindings[d].binding.parsedPath;y=new vC(Wt.create(i,m,w),p.ValueTypeName,p.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,u,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],u=a.knownActions,f=u[u.length-1],h=e._byClipCacheIndex;f._byClipCacheIndex=h,u[h]=f,u.pop(),e._byClipCacheIndex=null;const d=a.actionByRoot,p=(e._localRoot||this._root).uuid;delete d[p],u.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],u=t[t.length-1],f=e._cacheIndex;u._cacheIndex=f,t[f]=u,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 NS(new Float32Array(2),new Float32Array(2),1,Az),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"?Wf.findByName(r,e):e;const a=o!==null?o.uuid:e,u=this._actionsByClip[a];let f=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Pg),u!==void 0){const d=u.actionByRoot[s];if(d!==void 0&&d.blendMode===i)return d;f=u.knownActions[0],o===null&&(o=f._clip)}if(o===null)return null;const h=new yC(this,o,t,i);return this._bindAction(h,f),this._addInactiveAction(h,a,s),h}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?Wf.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 f=0;f!==i;++f)t[f]._update(r,e,s,o);const a=this._bindings,u=this._nActiveBindings;for(let f=0;f!==u;++f)a[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;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,u=o.length;a!==u;++a){const f=o[a];this._deactivateAction(f);const h=f._cacheIndex,d=t[t.length-1];f._cacheIndex=null,f._byClipCacheIndex=null,d._cacheIndex=h,t[h]=d,t.pop(),this._removeInactiveBindingsForAction(f)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const a=i[o].actionByRoot,u=a[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}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 HS{constructor(e){this.value=e}clone(){return new HS(this.value.clone===void 0?this.value:this.value.clone())}}let Rz=0;class Cz extends Ms{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:Rz++}),this.name="",this.usage=Uf,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 Pz extends Og{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 Iz{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 dT=new mt;class GS{constructor(e,t,i=0,r=1/0){this.ray=new zc(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new za,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:
3878Unsupported camera type: "+t.type)}setFromXRController(e){return dT.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(dT),this}intersectObject(e,t=!0,i=[]){return Q_(e,this,i,t),i.sort(pT),i}intersectObjects(e,t=!0,i=[]){for(let r=0,s=e.length;r<s;r++)Q_(e[r],this,i,t);return i.sort(pT),i}}function pT(n,e){return n.distance-e.distance}function Q_(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++)Q_(s[o],e,t,!0)}}class Lz{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 Nz{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)}}class VS{constructor(e,t,i,r){VS.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,r){const s=this.elements;return s[0]=e,s[2]=t,s[1]=i,s[3]=r,this}}const mT=new be;class Dz{constructor(e=new be(1/0,1/0),t=new be(-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=mT.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,mT).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 gT=new k,yp=new k;class Uz{constructor(e=new k,t=new k){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){gT.subVectors(e,this.start),yp.subVectors(this.end,this.start);const i=yp.dot(yp);let s=yp.dot(gT)/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: 10,138 bytes, line 3878
3878applyMatrix4(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 vT=new k;class Oz extends Gt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Pt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,u=32;o<u;o++,a++){const f=o/u*Math.PI*2,h=a/u*Math.PI*2;r.push(Math.cos(f),Math.sin(f),1,Math.cos(h),Math.sin(h),1)}i.setAttribute("position",new lt(r,3));const s=new Di({fog:!1,toneMapped:!1});this.cone=new ws(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),vT.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(vT),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const vo=new k,_p=new mt,Ry=new mt;class Fz extends ws{constructor(e){const t=_C(e),i=new Pt,r=[],s=[],o=new rt(0,0,1),a=new rt(0,1,0);for(let f=0;f<t.length;f++){const h=t[f];h.parent&&h.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 lt(r,3)),i.setAttribute("color",new lt(s,3));const u=new Di({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,u),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");Ry.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(_p.multiplyMatrices(Ry,a.matrixWorld),vo.setFromMatrixPosition(_p),r.setXYZ(o,vo.x,vo.y,vo.z),_p.multiplyMatrices(Ry,a.parent.matrixWorld),vo.setFromMatrixPosition(_p),r.setXYZ(o+1,vo.x,vo.y,vo.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function _C(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,_C(n.children[t]));return e}class kz extends xn{constructor(e,t,i){const r=new ph(t,4,2),s=new $s({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 zz=new k,yT=new rt,_T=new rt;class Bz 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 dh(t);r.rotateY(Math.PI*.5),this.material=new $s({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 Jt(o,3)),this.add(new xn(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");yT.copy(this.light.color),_T.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?yT:_T;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(zz.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Hz extends ws{constructor(e=10,t=10,i=4473924,r=8947848){i=new rt(i),r=new rt(r);const s=t/2,o=e/t,a=e/2,u=[],f=[];for(let p=0,m=0,y=-a;p<=t;p++,y+=o){u.push(-a,0,y,a,0,y),u.push(y,0,-a,y,0,a);const w=p===s?i:r;w.toArray(f,m),m+=3,w.toArray(f,m),m+=3,w.toArray(f,m),m+=3,w.toArray(f,m),m+=3}const h=new Pt;h.setAttribute("position",new lt(u,3)),h.setAttribute("color",new lt(f,3));const d=new Di({vertexColors:!0,toneMapped:!1});super(h,d),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Gz extends ws{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new rt(s),o=new rt(o);const a=[],u=[];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 w=d&1?s:o;u.push(w.r,w.g,w.b),u.push(w.r,w.g,w.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 w=y/r*(Math.PI*2),_=Math.sin(w)*m,v=Math.cos(w)*m;a.push(_,0,v),u.push(p.r,p.g,p.b),w=(y+1)/r*(Math.PI*2),_=Math.sin(w)*m,v=Math.cos(w)*m,a.push(_,0,v),u.push(p.r,p.g,p.b)}}const f=new Pt;f.setAttribute("position",new lt(a,3)),f.setAttribute("color",new lt(u,3));const h=new Di({vertexColors:!0,toneMapped:!1});super(f,h),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const xT=new k,xp=new k,ST=new k;class Vz 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 Pt;r.setAttribute("position",new lt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new Di({fog:!1,toneMapped:!1});this.lightPlane=new Go(r,s),this.add(this.lightPlane),r=new Pt,r.setAttribute("position",new lt([0,0,0,0,0,1],3)),this.targetLine=new Go(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),xT.setFromMatrixPosition(this.light.matrixWorld),xp.setFromMatrixPosition(this.light.target.matrixWorld),ST.subVectors(xp,xT),this.lightPlane.lookAt(xp),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(xp),this.targetLine.scale.z=ST.length()}}const Sp=new k,Tn=new ah;class Wz extends ws{constructor(e){const t=new Pt,i=new Di({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,w){u(y),u(w)}function u(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 lt(r,3)),t.setAttribute("color",new lt(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 f=new rt(16755200),h=new rt(16711680),d=new rt(43775),p=new rt(16777215),m=new rt(3355443);this.setColors(f,h,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;Tn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Pn("c",t,e,Tn,0,0,-1),Pn("t",t,e,Tn,0,0,1),Pn("n1",t,e,Tn,-i,-r,-1),Pn("n2",t,e,Tn,i,-r,-1),Pn("n3",t,e,Tn,-i,r,-1),Pn("n4",t,e,Tn,i,r,-1),Pn("f1",t,e,Tn,-i,-r,1),Pn("f2",t,e,Tn,i,-r,1),Pn("f3",t,e,Tn,-i,r,1),Pn("f4",t,e,Tn,i,r,1),Pn("u1",t,e,Tn,i*.7,r*1.1,-1),Pn("u2",t,e,Tn,-i*.7,r*1.1,-1),Pn("u3",t,e,Tn,0,r*2,-1),Pn("cf1",t,e,Tn,-i,0,1),Pn("cf2",t,e,Tn,i,0,1),Pn("cf3",t,e,Tn,0,-r,1),Pn("cf4",t,e,Tn,0,r,1),Pn("cn1",t,e,Tn,-i,0,-1),Pn("cn2",t,e,Tn,i,0,-1),Pn("cn3",t,e,Tn,0,-r,-1),Pn("cn4",t,e,Tn,0,r,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Pn(n,e,t,i,r,s,o){Sp.set(r,s,o).unproject(i);const a=e[n];if(a!==void 0){const u=t.getAttribute("position");for(let f=0,h=a.length;f<h;f++)u.setXYZ(a[f],Sp.x,Sp.y,Sp.z)}}const Mp=new Pi;class Xz extends ws{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 Pt;s.setIndex(new Jt(i,1)),s.setAttribute("position",new Jt(r,3)),super(s,new Di({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(
3878) has no longer arguments."),this.object!==void 0&&Mp.setFromObject(this.object),Mp.isEmpty())return;const t=Mp.min,i=Mp.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 jz extends ws{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 Pt;s.setIndex(new Jt(i,1)),s.setAttribute("position",new lt(r,3)),super(s,new Di({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 Yz extends Go{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 Pt;o.setAttribute("position",new lt(s,3)),o.computeBoundingSphere(),super(o,new Di({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],u=new Pt;u.setAttribute("position",new lt(a,3)),u.computeBoundingSphere(),this.add(new xn(u,new $s({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 MT=new k;let wp,Cy;class qz extends Gt{constructor(e=new k(0,0,1),t=new k(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",wp===void 0&&(wp=new Pt,wp.setAttribute("position",new lt([0,0,0,0,1,0],3)),Cy=new Ss(0,.5,1,5,1),Cy.translate(0,-.5,0)),this.position.copy(t),this.line=new Go(wp,new Di({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new xn(Cy,new $s({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{MT.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(MT,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 Zz extends ws{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 Pt;r.setAttribute("position",new lt(t,3)),r.setAttribute("color",new lt(i,3));const s=new Di({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new rt,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 Kz{constructor(){this.type="ShapePath",this.color=new rt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new kf,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(v){const S=[];for(let M=0,T=v.length;M<T;M++){const I=v[M],C=new Ba;C.curves=I.curves,S.push(C)}return S}function i(v,S){const M=S.length;let T=!1;for(let I=M-1,C=0;C<M;I=C++){let L=S[I],N=S[C],B=N.x-L.x,A=N.y-L.y;
vendor: 5,525 bytes, line 3878
3878if(Math.abs(A)>Number.EPSILON){if(A<0&&(L=S[C],B=-B,N=S[I],A=-A),v.y<L.y||v.y>N.y)continue;if(v.y===L.y){if(v.x===L.x)return!0}else{const R=A*(v.x-L.x)-B*(v.y-L.y);if(R===0)return!0;if(R<0)continue;T=!T}}else{if(v.y!==L.y)continue;if(N.x<=v.x&&v.x<=L.x||L.x<=v.x&&v.x<=N.x)return!0}}return T}const r=ys.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,u;const f=[];if(s.length===1)return a=s[0],u=new Ba,u.curves=a.curves,f.push(u),f;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],p=[];let m=[],y=0,w;p[y]=void 0,m[y]=[];for(let v=0,S=s.length;v<S;v++)a=s[v],w=a.getPoints(),o=r(w),o=e?!o:o,o?(!h&&p[y]&&y++,p[y]={s:new Ba,p:w},p[y].s.curves=a.curves,h&&y++,m[y]=[]):m[y].push({h:a,p:w[0]});if(!p[0])return t(s);if(p.length>1){let v=!1,S=0;for(let M=0,T=p.length;M<T;M++)d[M]=[];for(let M=0,T=p.length;M<T;M++){const I=m[M];for(let C=0;C<I.length;C++){const L=I[C];let N=!0;for(let B=0;B<p.length;B++)i(L.p,p[B].p)&&(M!==B&&S++,N?(N=!1,d[B].push(L)):v=!0);N&&d[M].push(L)}}S>0&&v===!1&&(m=d)}let _;for(let v=0,S=p.length;v<S;v++){u=p[v].s,f.push(u),_=m[v];for(let M=0,T=_.length;M<T;M++)u.holes.push(_[M].h)}return f}}class Qz extends Ms{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(){}disconnect(){}dispose(){}update(){}}class $z extends cr{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:eh}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=eh);const Jz=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:nh,AddEquation:To,AddOperation:Xb,AdditiveAnimationBlendMode:uS,AdditiveBlending:O_,AgXToneMapping:Kb,AlphaFormat:rS,AlwaysCompare:fR,AlwaysDepth:Sm,AlwaysStencilFunc:H_,AmbientLight:uC,AnimationAction:yC,AnimationClip:Wf,AnimationLoader:ez,AnimationMixer:bz,AnimationObjectGroup:Tz,AnimationUtils:Kk,ArcCurve:UR,ArrayCamera:AR,ArrowHelper:qz,AttachedBindMode:z_,Audio:gC,AudioAnalyser:mz,AudioContext:FS,AudioListener:hz,AudioLoader:cz,AxesHelper:Zz,BackSide:Ci,BasicDepthPacking:nR,BasicShadowMap:Tb,BatchedMesh:LR,Bone:wS,BooleanKeyframeTrack:il,Box2:Dz,Box3:Pi,Box3Helper:jz,BoxGeometry:nl,BoxHelper:Xz,BufferAttribute:Jt,BufferGeometry:Pt,BufferGeometryLoader:mC,ByteType:Eg,Cache:Vs,Camera:ah,CameraHelper:Wz,CanvasTexture:xk,CapsuleGeometry:Hg,CatmullRomCurve3:Bg,CineonToneMapping:qb,CircleGeometry:Gg,ClampToEdgeWrapping:Fn,Clock:kS,Color:rt,ColorKeyframeTrack:DS,ColorManagement:Kt,CompressedArrayTexture:yk,CompressedCubeTexture:_k,CompressedTexture:kg,CompressedTextureLoader:tz,ConeGeometry:Vg,ConstantAlphaFactor:Gb,ConstantColorFactor:Bb,Controls:Qz,CubeCamera:_R,CubeReflectionMapping:_s,CubeRefractionMapping:Ho,CubeTexture:lh,CubeTextureLoader:sC,CubeUVReflectionMapping:kc,CubicBezierCurve:AS,CubicBezierCurve3:OR,CubicInterpolant:tC,CullFaceBack:U_,CullFaceFront:Eb,CullFaceFrontBack:qL,CullFaceNone:wb,Curve:$r,CurvePath:kR,CustomBlending:Ab,CustomToneMapping:Zb,CylinderGeometry:Ss,Cylindrical:Nz,Data3DTexture:dS,DataArrayTexture:Lg,DataTexture:Zr,DataTextureLoader:US,DataUtils:Pa,DecrementStencilOp:aN,DecrementWrapStencilOp:cN,DefaultLoadingManager:rC,DepthFormat:Fa,DepthStencilFormat:Ka,DepthTexture:yS,DetachedBindMode:$b,DirectionalLight:cC,DirectionalLightHelper:Vz,DiscreteInterpolant:nC,DisplayP3ColorSpace:Ig,DodecahedronGeometry:Wg,DoubleSide:jr,DstAlphaFactor:Ub,DstColorFactor:Fb,DynamicCopyUsage:EN,DynamicDrawUsage:yN,DynamicReadUsage:SN,EdgesGeometry:zR,EllipseCurve:zg,EqualCompare:aR,EqualDepth:wm,EqualStencilFunc:dN,EquirectangularReflectionMapping:Ec,EquirectangularRefractionMapping:bf,Euler:Ii,EventDispatcher:Ms,ExtrudeGeometry:jg,FileLoader:ar,Float16BufferAttribute:dD,Float32BufferAttribute:lt,FloatType:_n,Fog:Ug,FogExp2:Dg,FramebufferTexture:vk,FrontSide:Zs,Frustum:ch,GLBufferAttribute:Iz,GLSL1:AN,GLSL3:G_,GreaterCompare:lR,GreaterDepth:Tm,GreaterEqualCompare:uR,GreaterEqualDepth:Em,GreaterEqualStencilFunc:vN,GreaterStencilFunc:mN,GridHelper:Hz,Group:oc,HalfFloatType:ei,HemisphereLight:oC,HemisphereLightHelper:Bz,IcosahedronGeometry:hh,ImageBitmapLoader:lz,ImageLoader:Xf,ImageUtils:pR,IncrementStencilOp:oN,IncrementWrapStencilOp:lN,InstancedBufferAttribute:Rc,InstancedBufferGeometry:pC,InstancedInterleavedBuffer:Pz,InstancedMesh:IR,Int16BufferAttribute:fD,Int32BufferAttribute:hD,Int8BufferAttribute:lD,IntType:ih,InterleavedBuffer:Og,InterleavedBufferAttribute:Qa,Interpolant:mh,InterpolateDiscrete:Pf,InterpolateLinear:Jm,InterpolateSmooth:Bp,InvertStencilOp:uN,KeepStencilOp:Sa,KeyframeTrack:Jr,LOD:CR,LatheGeometry:fh,Layers:za,LessCompare:oR,LessDepth:Mm,LessEqualCompare:fS,LessEqualDepth:qa,LessEqualStencilFunc:pN,LessStencilFunc:hN,Light:Qo,LightProbe:dC,Line:Go,Line3:Uz,LineBasicMaterial:Di,LineCurve:bS,LineCurve3:FR,LineDashedMaterial:$R,LineLoop:NR,LineSegments:ws,LinearDisplayP3ColorSpace:oh,LinearFilter:Qt,LinearInterpolant:NS,LinearMipMapLinearFilter:B_,LinearMipMapNearestFilter:QL,LinearMipmapLinearFilter:hs,LinearMipmapNearestFilter:$u,LinearSRGBColorSpace:Cr,LinearToneMapping:jb,LinearTransfer:Lf,Loa
3878der:Ui,LoaderUtils:K_,LoadingManager:$g,LoopOnce:Jb,LoopPingPong:tR,LoopRepeat:eR,LuminanceAlphaFormat:aS,LuminanceFormat:oS,MOUSE:jL,Material:xi,MaterialLoader:Jg,MathUtils:VN,Matrix2:VS,Matrix3:Rt,Matrix4:mt,MaxEquation:Pb,Mesh:xn,MeshBasicMaterial:$s,MeshDepthMaterial:_S,MeshDistanceMaterial:xS,MeshLambertMaterial:KR,MeshMatcapMaterial:QR,MeshNormalMaterial:ZR,MeshPhongMaterial:YR,MeshPhysicalMaterial:jR,MeshStandardMaterial:IS,MeshToonMaterial:qR,MinEquation:Cb,MirroredRepeatWrapping:Cf,MixOperation:Wb,MultiplyBlending:k_,MultiplyOperation:th,NearestFilter:Jn,NearestMipMapLinearFilter:KL,NearestMipMapNearestFilter:ZL,NearestMipmapLinearFilter:ic,NearestMipmapNearestFilter:nS,NeutralToneMapping:Qb,NeverCompare:sR,NeverDepth:xm,NeverStencilFunc:fN,NoBlending:gs,NoColorSpace:zs,NoToneMapping:vs,NormalAnimationBlendMode:Pg,NormalBlending:Oa,NotEqualCompare:cR,NotEqualDepth:Am,NotEqualStencilFunc:gN,NumberKeyframeTrack:Gf,Object3D:Gt,ObjectLoader:oz,ObjectSpaceNormalMap:rR,OctahedronGeometry:dh,OneFactor:Lb,OneMinusConstantAlphaFactor:Vb,OneMinusConstantColorFactor:Hb,OneMinusDstAlphaFactor:Ob,OneMinusDstColorFactor:kb,OneMinusSrcAlphaFactor:_m,OneMinusSrcColorFactor:Db,OrthographicCamera:Bc,P3Primaries:Df,PCFShadowMap:wg,PCFSoftShadowMap:Qu,PMREMGenerator:V_,Path:kf,PerspectiveCamera:$n,Plane:So,PlaneGeometry:Zo,PlaneHelper:Yz,PointLight:lC,PointLightHelper:kz,Points:DR,PointsMaterial:ES,PolarGridHelper:Gz,PolyhedronGeometry:Ko,PositionalAudio:pz,PropertyBinding:Wt,PropertyMixer:vC,QuadraticBezierCurve:RS,QuadraticBezierCurve3:CS,Quaternion:Gn,QuaternionKeyframeTrack:gh,QuaternionLinearInterpolant:iC,RED_GREEN_RGTC2_Format:Qm,RED_RGTC1_Format:cS,REVISION:eh,RGBADepthPacking:iR,RGBAFormat:Ln,RGBAIntegerFormat:Cg,RGBA_ASTC_10x10_Format:Xm,RGBA_ASTC_10x5_Format:Gm,RGBA_ASTC_10x6_Format:Vm,RGBA_ASTC_10x8_Format:Wm,RGBA_ASTC_12x10_Format:jm,RGBA_ASTC_12x12_Format:Ym,RGBA_ASTC_4x4_Format:Dm,RGBA_ASTC_5x4_Format:Um,RGBA_ASTC_5x5_Format:Om,RGBA_ASTC_6x5_Format:Fm,RGBA_ASTC_6x6_Format:km,RGBA_ASTC_8x5_Format:zm,RGBA_ASTC_8x6_Format:Bm,RGBA_ASTC_8x8_Format:Hm,RGBA_BPTC_Format:rf,RGBA_ETC2_EAC_Format:Nm,RGBA_PVRTC_2BPPV1_Format:Pm,RGBA_PVRTC_4BPPV1_Format:Cm,RGBA_S3TC_DXT1_Format:ef,RGBA_S3TC_DXT3_Format:tf,RGBA_S3TC_DXT5_Format:nf,RGBDepthPacking:nN,RGBFormat:sS,RGBIntegerFormat:$L,RGB_BPTC_SIGNED_Format:qm,RGB_BPTC_UNSIGNED_Format:Zm,RGB_ETC1_Format:Im,RGB_ETC2_Format:Lm,RGB_PVRTC_2BPPV1_Format:Rm,RGB_PVRTC_4BPPV1_Format:bm,RGB_S3TC_DXT1_Format:Ju,RGDepthPacking:iN,RGFormat:lS,RGIntegerFormat:Rg,RawShaderMaterial:XR,Ray:zc,Raycaster:GS,Rec709Primaries:Nf,RectAreaLight:fC,RedFormat:rh,RedIntegerFormat:sh,ReinhardToneMapping:Yb,RenderTarget:mR,RepeatWrapping:Rf,ReplaceStencilOp:sN,ReverseSubtractEquation:Rb,RingGeometry:Yg,SIGNED_RED_GREEN_RGTC2_Format:$m,SIGNED_RED_RGTC1_Format:Km,SRGBColorSpace:ir,SRGBTransfer:sn,Scene:uh,ShaderChunk:Lt,ShaderLib:Xr,ShaderMaterial:qi,ShadowMaterial:WR,Shape:Ba,ShapeGeometry:qg,ShapePath:Kz,ShapeUtils:ys,ShortType:Tg,Skeleton:Fg,SkeletonHelper:Fz,SkinnedMesh:PR,Source:Ca,Sphere:yi,SphereGeometry:ph,Spherical:Lz,SphericalHarmonics3:hC,SplineCurve:PS,SpotLight:aC,SpotLightHelper:Oz,Sprite:RR,SpriteMaterial:MS,SrcAlphaFactor:ym,SrcAlphaSaturateFactor:zb,SrcColorFactor:Nb,StaticCopyUsage:wN,StaticDrawUsage:Uf,StaticReadUsage:xN,StereoCamera:uz,StreamCopyUsage:TN,StreamDrawUsage:_N,StreamReadUsage:MN,StringKeyframeTrack:rl,SubtractEquation:bb,SubtractiveBlending:F_,TOUCH:YL,TangentSpaceNormalMap:qo,TetrahedronGeometry:Zg,Texture:nn,TextureLoader:nz,TextureUtils:KF,TorusGeometry:Kg,TorusKnotGeometry:Qg,Triangle:Gi,TriangleFanDrawMode:tN,TriangleStripDrawMode:eN,TrianglesDrawMode:JL,TubeGeometry:Gc,UVMapping:Bo,Uint16BufferAttribute:pS,Uint32BufferAttribute:mS,Uint8BufferAttribute:cD,Uint8ClampedBufferAttribute:uD,Uniform:HS,UniformsGroup:Cz,UniformsLib:Xe,UniformsUtils:yR,UnsignedByteType:Yi,UnsignedInt248Type:Za,UnsignedInt5999Type:iS,UnsignedIntType:xs,UnsignedShort4444Type:Ag,UnsignedShort5551Type:bg,UnsignedShortType:Tc,VSMShadowMap:Hr,Vector2:be,Vector3:k,Vector4:Xt,VectorKeyframeTrack:Vf,VideoTexture:gk,WebGL3DRenderTarget:$N,WebGLArrayRenderTarget:QN,WebGLCoordinateSystem:ds,WebGLCubeRen
vendor: 115,519 bytes, lines 3878-3912
3878derTarget:gS,WebGLMultipleRenderTargets:$z,WebGLRenderTarget:cr,WebGLRenderer:SS,WebGLUtils:TR,WebGPUCoordinateSystem:Of,WireframeGeometry:VR,WrapAroundEnding:If,ZeroCurvatureEnding:ba,ZeroFactor:Ib,ZeroSlopeEnding:Ra,ZeroStencilOp:rN,createCanvasElement:dR},Symbol.toStringTag,{value:"Module"}));var xC={exports:{}},sl={};/** 3879 * @license React 3880 * react-reconciler-constants.production.min.js 3881 * 3882 * Copyright (c) Facebook, Inc. and its affiliates. 3883 * 3884 * This source code is licensed under the MIT license found in the 3885 * LICENSE file in the root directory of this source tree. 3886 */sl.ConcurrentRoot=1;sl.ContinuousEventPriority=4;sl.DefaultEventPriority=16;sl.DiscreteEventPriority=1;sl.IdleEventPriority=536870912;sl.LegacyRoot=0;xC.exports=sl;var lc=xC.exports;function eB(n){let e;const t=new Set,i=(f,h)=>{const d=typeof f=="function"?f(e):f;if(d!==e){const p=e;e=h?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,s=(f,h=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(e);function m(){const y=h(e);if(!d(p,y)){const w=p;f(p=y,w)}}return t.add(m),()=>t.delete(m)},u={setState:i,getState:r,subscribe:(f,h,d)=>h||d?s(f,h,d):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(i,r,u),u}const tB=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),wT=tB?ee.useEffect:ee.useLayoutEffect;function SC(n){const e=typeof n=="function"?eB(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=ee.useReducer(_=>_+1,0),o=e.getState(),a=ee.useRef(o),u=ee.useRef(i),f=ee.useRef(r),h=ee.useRef(!1),d=ee.useRef();d.current===void 0&&(d.current=i(o));let p,m=!1;(a.current!==o||u.current!==i||f.current!==r||h.current)&&(p=i(o),m=!r(d.current,p)),wT(()=>{m&&(d.current=p),a.current=o,u.current=i,f.current=r,h.current=!1});const y=ee.useRef(o);wT(()=>{const _=()=>{try{const S=e.getState(),M=u.current(S);f.current(d.current,M)||(a.current=S,d.current=M,s())}catch{h.current=!0,s()}},v=e.subscribe(_);return e.getState()!==y.current&&_(),v},[]);const w=m?p:d.current;return ee.useDebugValue(w),w};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}const nB=n=>typeof n=="object"&&typeof n.then=="function",La=[];function MC(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 wC(n,e=null,t=!1,i={}){e===null&&(e=[n]);for(const s of La)if(MC(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=La.indexOf(r);s!==-1&&La.splice(s,1)},promise:(nB(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(La.push(r),!t)throw r.promise}const iB=(n,e,t)=>wC(n,e,!1,t),rB=(n,e,t)=>void wC(n,e,!0,t),sB=n=>{if(n===void 0||n.length===0)La.splice(0,La.length);else{const e=La.find(t=>MC(n,t.keys,t.equal));e&&e.remove()}};var EC={exports:{}},TC={exports:{}},AC={};/** 3887 * @license React 3888 * scheduler.production.min.js 3889 * 3890 * Copyright (c) Facebook, Inc. and its affiliates. 3891 * 3892 * This source code is licensed under the MIT license found in the 3893 * LICENSE file in the root directory of this source tree. 3894 */(function(n){function e(z,ie){var $=z.length;z.push(ie);e:for(;0<$;){var le=$-1>>>1,ye=z[le];if(0<r(ye,ie))z[le]=ie,z[$]=ye,$=le;else break e}}function t(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var ie=z[0],$=z.pop();if($!==ie){z[0]=$;e:for(var le=0,ye=z.length,De=ye>>>1;le<De;){var ue=2*(le+1)-1,Me=z[ue],we=ue+1,Ce=z[we];if(0>r(Me,$))we<ye&&0>r(Ce,Me)?(z[le]=Ce,z[we]=$,le=we):(z[le]=Me,z[ue]=$,le=ue);else if(we<ye&&0>r(Ce,$))z[le]=Ce,z[we]=$,le=we;else break e}}return ie}function r(z,ie){var $=z.sortIndex-ie.sortIndex;return $!==0?$:z.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var u=[],f=[],h=1,d=null,p=3,m=!1,y=!1,w=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(z){for(var ie=t(f);ie!==null;){if(ie.callback===null)i(f);else if(ie.startTime<=z)i(f),ie.sortIndex=ie.expirationTime,e(u,ie);else break;ie=t(f)}}function T(z){if(w=!1,M(z),!y)if(t(u)!==null)y=!0,Q(I);else{var ie=t(f);ie!==null&&pe(T,ie.startTime-z)}}function I(z,ie){y=!1,w&&(w=!1,v(N),N=-1),m=!0;var $=p;try{for(M(ie),d=t(u);d!==null&&(!(d.expirationTime>ie)||z&&!R());){var le=d.callback;if(typeof le=="function"){d.callback=null,p=d.priorityLevel;var ye=le(d.expirationTime<=ie);ie=n.unstable_now(),typeof ye=="function"?d.callback=ye:d===t(u)&&i(u),M(ie)}else i(u);d=t(u)}if(d!==null)var De=!0;else{var ue=t(f);ue!==null&&pe(T,ue.startTime-ie),De=!1}return De}finally{d=null,p=$,m=!1}}var C=!1,L=null,N=-1,B=5,A=-1;function R(){return!(n.unstable_now()-A<B)}function j(){if(L!==null){var z=n.unstable_now();A=z;var ie=!0;try{ie=L(!0,z)}finally{ie?Y():(C=!1,L=null)}}else C=!1}var Y;if(typeof S=="function")Y=function(){S(j)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ae=Z.port2;Z.port1.onmessage=j,Y=function(){ae.postMessage(null)}}else Y=function(){_(j,0)};function Q(z){L=z,C||(C=!0,Y())}function pe(z,ie){N=_(function(){z(n.unstable_now())},ie)}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(z){z.callback=null},n.unstable_continueExecution=function(){y||m||(y=!0,Q(I))},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(u)},n.unstable_next=function(z){switch(p){case 1:case 2:case 3:var ie=3;break;default:ie=p}var $=p;p=ie;try{return z()}finally{p=$}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(z,ie){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var $=p;p=z;try{return ie()}finally{p=$}},n.unstable_scheduleCallback=function(z,ie,$){var le=n.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?le+$:le):$=le,z){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=$+ye,z={id:h++,callback:ie,priorityLevel:z,startTime:$,expirationTime:ye,sortIndex:-1},$>le?(z.sortIndex=$,e(f,z),t(u)===null&&z===t(f)&&(w?(v(N),N=-1):w=!0,pe(T,$-le))):(z.sortIndex=ye,e(u,z),y||m||(y=!0,Q(I))),z},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(z){var ie=p;return function(){var $=p;p=ie;try{return z.apply(this,arguments)}finally{p=$}}}})(AC);TC.exports=AC;var $_=TC.exports;/** 3895 * @license React 3896 * react-reconciler.production.min.js 3897 * 3898 * Copyright (c) Facebook, Inc. and its affiliates. 3899 * 3900 * This source code is licensed under the MIT license found in the 3901 * LICENSE file in the root directory of this source tree. 3902 */var oB=function(e){var t={},i=ee,r=$_,s=Object.assign;function o(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+c+" 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,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=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"),w=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),I=Symbol.iterator;function C(l){return l===null||typeof l!="object"?null:(l=I&&l[I]||l["@@iterator"],typeof l=="function"?l:null)}function L(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case f:return"Portal";case p:return"Profiler";case d:return"StrictMode";case _:return"Suspense";case v:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case y:return(l.displayName||"Context")+".Consumer";case m:return(l._context.displayName||"Context")+".Provider";case w:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case S:return c=l.displayName||null,c!==null?c:L(l.type)||"Memo";case M:c=l._payload,l=l._init;try{return L(l(c))}catch{}}return null}function N(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return L(c);case 8:return c===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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function B(l){var c=l,g=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,c.flags&4098&&(g=c.return),l=c.return;while(l)}return c.tag===3?g:null}function A(l){if(B(l)!==l)throw Error(o(188))}function R(l){var c=l.alternate;if(!c){if(c=B(l),c===null)throw Error(o(188));return c!==l?null:l}for(var g=l,x=c;;){var E=g.return;if(E===null)break;var b=E.alternate;if(b===null){if(x=E.return,x!==null){g=x;continue}break}if(E.child===b.child){for(b=E.child;b;){if(b===g)return A(E),l;if(b===x)return A(E),c;b=b.sibling}throw Error(o(188))}if(g.return!==x.return)g=E,x=b;else{for(var W=!1,re=E.child;re;){if(re===g){W=!0,g=E,x=b;break}if(re===x){W=!0,x=E,g=b;break}re=re.sibling}if(!W){for(re=b.child;re;){if(re===g){W=!0,g=b,x=E;break}if(re===x){W=!0,x=b,g=E;break}re=re.sibling}if(!W)throw Error(o(189))}}if(g.alternate!==x)throw Error(o(190))}if(g.tag!==3)throw Error(o(188));return g.stateNode.current===g?l:c}function j(l){return l=R(l),l!==null?Y(l):null}function Y(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=Y(l);if(c!==null)return c;l=l.sibling}return null}function Z(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var c=Z(l);if(c!==null)return c}l=l.sibling}return null}var ae=Array.isArray,Q=e.getPublicInstance,pe=e.getRootHostContext,z=e.getChildHostContext,ie=e.prepareForCommit,$=e.resetAfterCommit,le=e.createInstance,ye=e.appendInitialChild,De=e.finalizeInitialChildren,ue=e.prepareUpdate,Me=e.shouldSetTextContent,we=e.createTextInstance,Ce=e.scheduleTimeout,ct=e.cancelTimeout,gt=e.noTimeout,We=e.isPrimaryRenderer,nt=e.supportsMutation,xe=e.supportsPersistence,G=e.supportsHydration,Oe=e.getInstanceFromNode,Fe=e.preparePortalMount,Ie=e.getCurrentEventPriority,He=e.detachDeletedInstance,ft=e.supportsMicrotasks,Qe=e.scheduleMicrotask,V=e.supportsTestSelectors,U=e.findFiberRoot,ce=e.getBoundingRect,Se=e.getTextContent,Ee=e.isHiddenSubtree,_e=e.matchAccessibilityRole,at=e.setFocusIfFocusable,Ve=e.setupIntersectionObserver,$e=e.appendChild,It=e.appendChildToContainer,Ne=e.commitTextUpdate,it=e.commitMount,Mt=e.commitUpdate,yt=e.insertBefore,Ge=e.insertInContainerBefore,Ut=e.removeChild,St=e.removeChildFromContainer,bt=e.resetTextContent,te=e.hideInstance,Je=e.hideTextInstance,ne=e.unhideInstance,Te=e.unhideTextInstance,Ye=e.clearContainer,et=e.cloneInstance,Ft=e.createContainerChildSet,ln=e.appendChildToContainerChildSet,Xn=e.finalizeContainerChildren,Bt=e.replaceContainerChildren,kn=e.cloneHiddenInstance,Oi=e.cloneHiddenTextInstance,al=e.canHydrateInstance,ll=e.canHydrateTextInstance,Pr=e.canHydrateSuspenseInstance,Ir=e.isSuspenseInstancePending,Js=e.isSuspenseInstanceFallback,es=e.registerSuspenseInstanceRetry,ai=e.getNextHydratableSibling,Nt=e.getFirstHydratableChild,Es=e.getFirstHydratableChildWithinContainer,cl=e.getFirstHydratableChildWithinSuspenseInstance,D=e.hydrateInstance,O=e.hydrateTextInstance,J=e.hydrateSuspenseInstance,de=e.getNextHydratableInstanceAfterSuspenseInstance,P=e.commitHydratedContainer,F=e.commitHydratedSuspenseInstance,K=e.clearSuspenseBoundary,q=e.clearSuspenseBoundaryFromContainer,X=e.shouldDeleteUnhydratedTailInstances,oe=e.didNotMatchHydratedContainerTextInstance,fe=e.didNotMatchHydratedTextInstance,me;function ke(l){if(me===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);me=c&&c[1]||""}return` 3903`+me+l}var Ae=!1;function Re(l,c){if(!l||Ae)return"";Ae=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ze){var x=ze}Reflect.construct(l,[],c)}else{try{c.call()}catch(ze){x=ze}l.call(c.prototype)}else{try{throw Error()}catch(ze){x=ze}l()}}catch(ze){if(ze&&x&&typeof ze.stack=="string"){for(var E=ze.stack.split(` 3904`),b=x.stack.split(` 3905`),W=E.length-1,re=b.length-1;1<=W&&0<=re&&E[W]!==b[re];)re--;for(;1<=W&&0<=re;W--,re--)if(E[W]!==b[re]){if(W!==1||re!==1)do if(W--,re--,0>re||E[W]!==b[re]){var ve=` 3906`+E[W].replace(" at new "," at ");return l.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",l.displayName)),ve}while(1<=W&&0<=re);break}}}finally{Ae=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?ke(l):""}var Pe=Object.prototype.hasOwnProperty,Ze=[],ut=-1;function dt(l){return{current:l}}function ht(l){0>ut||(l.current=Ze[ut],Ze[ut]=null,ut--)}function qe(l,c){ut++,Ze[ut]=l.current,l.current=c}var Ue={},wt=dt(Ue),tt=dt(!1),kt=Ue;function mn(l,c){var g=l.type.contextTypes;if(!g)return Ue;var x=l.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===c)return x.__reactInternalMemoizedMaskedChildContext;var E={},b;for(b in g)E[b]=c[b];return x&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=E),E}function Ht(l){return l=l.childContextTypes,l!=null}function Rn(){ht(tt),ht(wt)}function _t(l,c,g){if(wt.current!==Ue)throw Error(o(168));qe(wt,c),qe(tt,g)}function en(l,c,g){var x=l.stateNode;if(c=c.childContextTypes,typeof x.getChildContext!="function")return g;x=x.getChildContext();for(var E in x)if(!(E in c))throw Error(o(108,N(l)||"Unknown",E));return s({},g,x)}function Vt(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Ue,kt=wt.current,qe(wt,l),qe(tt,tt.current),!0}function Et(l,c,g){var x=l.stateNode;if(!x)throw Error(o(169));g?(l=en(l,c,kt),x.__reactInternalMemoizedMergedChildContext=l,ht(tt),ht(wt),qe(wt,l)):ht(tt),qe(tt,g)}var tn=Math.clz32?Math.clz32:ts,Lr=Math.log,jn=Math.LN2;function ts(l){return l>>>=0,l===0?32:31-(Lr(l)/jn|0)|0}var Eh=64,Th=4194304;function Xc(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Ah(l,c){var g=l.pendingLanes;if(g===0)return 0;var x=0,E=l.suspendedLanes,b=l.pingedLanes,W=g&268435455;if(W!==0){var re=W&~E;re!==0?x=Xc(re):(b&=W,b!==0&&(x=Xc(b)))}else W=g&~E,W!==0?x=Xc(W):b!==0&&(x=Xc(b));if(x===0)return 0;if(c!==0&&c!==x&&!(c&E)&&(E=x&-x,b=c&-c,E>=b||E===16&&(b&4194240)!==0))return c;if(x&4&&(x|=g&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=x;0<c;)g=31-tn(c),E=1<<g,x|=l[g],c&=~E;return x}function CP(l,c){switch(l){case 1:case 2:case 4:return c+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 c+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 PP(l,c){for(var g=l.suspendedLanes,x=l.pingedLanes,E=l.expirationTimes,b=l.pendingLanes;0<b;){var W=31-tn(b),re=1<<W,ve=E[W];ve===-1?(!(re&g)||re&x)&&(E[W]=CP(re,c)):ve<=c&&(l.expiredLanes|=re),b&=~re}}function f0(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function h0(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function jc(l,c,g){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-tn(c),l[c]=g}function IP(l,c){var g=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var x=l.eventTimes;for(l=l.expirationTimes;0<g;){var E=31-tn(g),b=1<<E;c[E]=0,x[E]=-1,l[E]=-1,g&=~b}}function d0(l,c){var g=l.entangledLanes|=c;for(l=l.entanglements;g;){var x=31-tn(g),E=1<<x;E&c|l[x]&c&&(l[x]|=c),g&=~E}}var Yt=0;function o1(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var p0=r.unstable_scheduleCallback,a1=r.unstable_cancelCallback,LP=r.unstable_shouldYield,NP=r.unstable_requestPaint,Yn=r.unstable_now,m0=r.unstable_ImmediatePriority,DP=r.unstable_UserBlockingPriority,g0=r.unstable_NormalPriority,UP=r.unstable_IdlePriority,bh=null,ns=null;function OP(l){if(ns&&typeof ns.onCommitFiberRoot=="function")try{ns.onCommitFiberRoot(bh,l,void 0,(l.current.flags&128)===128)}catch{}}function FP(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var is=typeof Object.is=="function"?Object.is:FP,Ts=null,Rh=!1,v0=!1;function l1(l){Ts===null?Ts=[l]:Ts.push(l)}function kP(l){Rh=!0,l1(l)}function rs(){if(!v0&&Ts!==null){v0=!0;var l=0,c=Yt;try{var g=Ts;for(Yt=1;l<g.length;l++){var x=g[l];do x=x(!0);while(x!==null)}Ts=null,Rh=!1}catch(E){throw Ts!==null&&(Ts=Ts.slice(l+1)),p0(m0,rs),E}finally{Yt=c,v0=!1}}return null}var zP=a.ReactCurrentBatchConfig;function Ch(l,c){if(is(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var g=Object.keys(l),x=Object.keys(c);if(g.length!==x.length)return!1;for(x=0;x<g.length;x++){var E=g[x];if(!Pe.call(c,E)||!is(l[E],c[E]))return!1}return!0}function BP(l){switch(l.tag){case 5:return ke(l.type);case 16:return ke("Lazy");case 13:return ke("Suspense");case 19:return ke("SuspenseList");case 0:case 2:case 15:return l=Re(l.type,!1),l;case 11:return l=Re(l.type.render,!1),l;case 1:return l=Re(l.type,!0),l;default:return""}}function Nr(l,c){if(l&&l.defaultProps){c=s({},c),l=l.defaultProps;for(var g in l)c[g]===void 0&&(c[g]=l[g]);return c}return c}var Ph=dt(null),Ih=null,ul=null,y0=null;function _0(){y0=ul=Ih=null}function c1(l,c,g){We?(qe(Ph,c._currentValue),c._currentValue=g):(qe(Ph,c._currentValue2),c._currentValue2=g)}function x0(l){var c=Ph.current;ht(Ph),We?l._currentValue=c:l._currentValue2=c}function S0(l,c,g){for(;l!==null;){var x=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),l===g)break;l=l.return}}function fl(l,c){Ih=l,y0=ul=null,l=l.dependencies,l!==null&&l.firstContext!==null&&(l.lanes&c&&($i=!0),l.firstContext=null)}function hr(l){var c=We?l._currentValue:l._currentValue2;if(y0!==l)if(l={context:l,memoizedValue:c,next:null},ul===null){if(Ih===null)throw Error(o(308));ul=l,Ih.dependencies={lanes:0,firstContext:l}}else ul=ul.next=l;return c}var ss=null,eo=!1;function M0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function u1(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function As(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function to(l,c){var g=l.updateQueue;g!==null&&(g=g.shared,Nn!==null&&l.mode&1&&!(Ot&2)?(l=g.interleaved,l===null?(c.next=c,ss===null?ss=[g]:ss.push(g)):(c.next=l.next,l.next=c),g.interleaved=c):(l=g.pending,l===null?c.next=c:(c.next=l.next,l.next=c),g.pending=c))}function Lh(l,c,g){if(c=c.updateQueue,c!==null&&(c=c.shared,(g&4194240)!==0)){var x=c.lanes;x&=l.pendingLanes,g|=x,c.lanes=g,d0(l,g)}}function f1(l,c){var g=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,g===x)){var E=null,b=null;if(g=g.firstBaseUpdate,g!==null){do{var W={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};b===null?E=b=W:b=b.next=W,g=g.next}while(g!==null);b===null?E=b=c:b=b.next=c}else E=b=c;g={baseState:x.baseState,firstBaseUpdate:E,lastBaseUpdate:b,shared:x.shared,effects:x.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=c:l.next=c,g.lastBaseUpdate=c}function Nh(l,c,g,x){var E=l.updateQueue;eo=!1;var b=E.firstBaseUpdate,W=E.lastBaseUpdate,re=E.shared.pending;if(re!==null){E.shared.pending=null;var ve=re,ze=ve.next;ve.next=null,W===null?b=ze:W.next=ze,W=ve;var ot=l.alternate;ot!==null&&(ot=ot.updateQueue,re=ot.lastBaseUpdate,re!==W&&(re===null?ot.firstBaseUpdate=ze:re.next=ze,ot.lastBaseUpdate=ve))}if(b!==null){var Tt=E.baseState;W=0,ot=ze=ve=null,re=b;do{var xt=re.lane,rn=re.eventTime;if((x&xt)===xt){ot!==null&&(ot=ot.next={eventTime:rn,lane:0,tag:re.tag,payload:re.payload,callback:re.callback,next:null});e:{var vt=l,fi=re;switch(xt=c,rn=g,fi.tag){case 1:if(vt=fi.payload,typeof vt=="function"){Tt=vt.call(rn,Tt,xt);break e}Tt=vt;break e;case 3:vt.flags=vt.flags&-65537|128;case 0:if(vt=fi.payload,xt=typeof vt=="function"?vt.call(rn,Tt,xt):vt,xt==null)break e;Tt=s({},Tt,xt);break e;case 2:eo=!0}}re.callback!==null&&re.lane!==0&&(l.flags|=64,xt=E.effects,xt===null?E.effects=[re]:xt.push(re))}else rn={eventTime:rn,lane:xt,tag:re.tag,payload:re.payload,callback:re.callback,next:null},ot===null?(ze=ot=rn,ve=Tt):ot=ot.next=rn,W|=xt;if(re=re.next,re===null){if(re=E.shared.pending,re===null)break;xt=re,re=xt.next,xt.next=null,E.lastBaseUpdate=xt,E.shared.pending=null}}while(!0);if(ot===null&&(ve=Tt),E.baseState=ve,E.firstBaseUpdate=ze,E.lastBaseUpdate=ot,c=E.shared.interleaved,c!==null){E=c;do W|=E.lane,E=E.next;while(E!==c)}else b===null&&(E.shared.lanes=0);xl|=W,l.lanes=W,l.memoizedState=Tt}}function h1(l,c,g){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var x=l[c],E=x.callback;if(E!==null){if(x.callback=null,x=g,typeof E!="function")throw Error(o(191,E));E.call(x)}}}var d1=new i.Component().refs;function w0(l,c,g,x){c=l.memoizedState,g=g(x,c),g=g==null?c:s({},c,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var Dh={isMounted:function(l){return(l=l._reactInternals)?B(l)===l:!1},enqueueSetState:function(l,c,g){l=l._reactInternals;var x=Mi(),E=ro(l),b=As(x,E);b.payload=c,g!=null&&(b.callback=g),to(l,b),c=vr(l,E,x),c!==null&&Lh(c,l,E)},enqueueReplaceState:function(l,c,g){l=l._reactInternals;var x=Mi(),E=ro(l),b=As(x,E);b.tag=1,b.payload=c,g!=null&&(b.callback=g),to(l,b),c=vr(l,E,x),c!==null&&Lh(c,l,E)},enqueueForceUpdate:function(l,c){l=l._reactInternals;var g=Mi(),x=ro(l),E=As(g,x);E.tag=2,c!=null&&(E.callback=c),to(l,E),c=vr(l,x,g),c!==null&&Lh(c,l,x)}};function p1(l,c,g,x,E,b,W){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,b,W):c.prototype&&c.prototype.isPureReactComponent?!Ch(g,x)||!Ch(E,b):!0}function m1(l,c,g){var x=!1,E=Ue,b=c.contextType;return typeof b=="object"&&b!==null?b=hr(b):(E=Ht(c)?kt:wt.current,x=c.contextTypes,b=(x=x!=null)?mn(l,E):Ue),c=new c(g,b),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Dh,l.stateNode=c,c._reactInternals=l,x&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=E,l.__reactInternalMemoizedMaskedChildContext=b),c}function g1(l,c,g,x){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,x),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,x),c.state!==l&&Dh.enqueueReplaceState(c,c.state,null)}function E0(l,c,g,x){var E=l.stateNode;E.props=g,E.state=l.memoizedState,E.refs=d1,M0(l);var b=c.contextType;typeof b=="object"&&b!==null?E.context=hr(b):(b=Ht(c)?kt:wt.current,E.context=mn(l,b)),E.state=l.memoizedState,b=c.getDerivedStateFromProps,typeof b=="function"&&(w0(l,c,b,g),E.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(c=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),c!==E.state&&Dh.enqueueReplaceState(E,E.state,null),Nh(l,g,E,x),E.state=l.memoizedState),typeof E.componentDidMount=="function"&&(l.flags|=4194308)}var hl=[],dl=0,Uh=null,Oh=0,dr=[],pr=0,$o=null,bs=1,Rs="";function Jo(l,c){hl[dl++]=Oh,hl[dl++]=Uh,Uh=l,Oh=c}function v1(l,c,g){dr[pr++]=bs,dr[pr++]=Rs,dr[pr++]=$o,$o=l;var x=bs;l=Rs;var E=32-tn(x)-1;x&=~(1<<E),g+=1;var b=32-tn(c)+E;if(30<b){var W=E-E%5;b=(x&(1<<W)-1).toString(32),x>>=W,E-=W,bs=1<<32-tn(c)+E|g<<E|x,Rs=b+l}else bs=1<<b|g<<E|x,Rs=l}function T0(l){l.return!==null&&(Jo(l,1),v1(l,1,0))}function A0(l){for(;l===Uh;)Uh=hl[--dl],hl[dl]=null,Oh=hl[--dl],hl[dl]=null;for(;l===$o;)$o=dr[--pr],dr[pr]=null,Rs=dr[--pr],dr[pr]=null,bs=dr[--pr],dr[pr]=null}var Ki=null,Qi=null,dn=!1,Yc=!1,Dr=null;function y1(l,c){var g=yr(5,null,null,0);g.elementType="DELETED",g.stateNode=c,g.return=l,c=l.deletions,c===null?(l.deletions=[g],l.flags|=16):c.push(g)}function _1(l,c){switch(l.tag){case 5:return c=al(c,l.type,l.pendingProps),c!==null?(l.stateNode=c,Ki=l,Qi=Nt(c),!0):!1;case 6:return c=ll(c,l.pendingProps),c!==null?(l.stateNode=c,Ki=l,Qi=null,!0):!1;case 13:if(c=Pr(c),c!==null){var g=$o!==null?{id:bs,overflow:Rs}:null;return l.memoizedState={dehydrated:c,treeContext:g,retryLane:1073741824},g=yr(18,null,null,0),g.stateNode=c,g.return=l,l.child=g,Ki=l,Qi=null,!0}return!1;default:return!1}}function b0(l){return(l.mode&1)!==0&&(l.flags&128)===0}function R0(l){if(dn){var c=Qi;if(c){var g=c;if(!_1(l,c)){if(b0(l))throw Error(o(418));c=ai(g);var x=Ki;c&&_1(l,c)?y1(x,g):(l.flags=l.flags&-4097|2,dn=!1,Ki=l)}}else{if(b0(l))throw Error(o(418));l.flags=l.flags&-4097|2,dn=!1,Ki=l}}}function x1(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Ki=l}function qc(l){if(!G||l!==Ki)return!1;if(!dn)return x1(l),dn=!0,!1;if(l.tag!==3&&(l.tag!==5||X(l.type)&&!Me(l.type,l.memoizedProps))){var c=Qi;if(c){if(b0(l)){for(l=Qi;l;)l=ai(l);throw Error(o(418))}for(;c;)y1(l,c),c=ai(c)}}if(x1(l),l.tag===13){if(!G)throw Error(o(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));Qi=de(l)}else Qi=Ki?ai(l.stateNode):null;return!0}function pl(){G&&(Qi=Ki=null,Yc=dn=!1)}function C0(l){Dr===null?Dr=[l]:Dr.push(l)}function Zc(l,c,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(o(309));var x=g.stateNode}if(!x)throw Error(o(147,l));var E=x,b=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===b?c.ref:(c=function(W){var re=E.refs;re===d1&&(re=E.refs={}),W===null?delete re[b]:re[b]=W},c._stringRef=b,c)}if(typeof l!="string")throw Error(o(284));if(!g._owner)throw Error(o(290,l))}return l}function Fh(l,c){throw l=Object.prototype.toString.call(c),Error(o(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function S1(l){var c=l._init;return c(l._payload)}function M1(l){function c(he,se){if(l){var ge=he.deletions;ge===null?(he.deletions=[se],he.flags|=16):ge.push(se)}}function g(he,se){if(!l)return null;for(;se!==null;)c(he,se),se=se.sibling;return null}function x(he,se){for(he=new Map;se!==null;)se.key!==null?he.set(se.key,se):he.set(se.index,se),se=se.sibling;return he}function E(he,se){return he=oo(he,se),he.index=0,he.sibling=null,he}function b(he,se,ge){return he.index=ge,l?(ge=he.alternate,ge!==null?(ge=ge.index,ge<se?(he.flags|=2,se):ge):(he.flags|=2,se)):(he.flags|=1048576,se)}function W(he){return l&&he.alternate===null&&(he.flags|=2),he}function re(he,se,ge,Ke){return se===null||se.tag!==6?(se=hv(ge,he.mode,Ke),se.return=he,se):(se=E(se,ge),se.return=he,se)}function ve(he,se,ge,Ke){var pt=ge.type;return pt===h?ot(he,se,ge.props.children,Ke,ge.key):se!==null&&(se.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===M&&S1(pt)===se.type)?(Ke=E(se,ge.props),Ke.ref=Zc(he,se,ge),Ke.return=he,Ke):(Ke=pd(ge.type,ge.key,ge.props,null,he.mode,Ke),Ke.ref=Zc(he,se,ge),Ke.return=he,Ke)}function ze(he,se,ge,Ke){return se===null||se.tag!==4||se.stateNode.containerInfo!==ge.containerInfo||se.stateNode.implementation!==ge.implementation?(se=dv(ge,he.mode,Ke),se.return=he,se):(se=E(se,ge.children||[]),se.return=he,se)}function ot(he,se,ge,Ke,pt){return se===null||se.tag!==7?(se=oa(ge,he.mode,Ke,pt),se.return=he,se):(se=E(se,ge),se.return=he,se)}function Tt(he,se,ge){if(typeof se=="string"&&se!==""||typeof se=="number")return se=hv(""+se,he.mode,ge),se.return=he,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case u:return ge=pd(se.type,se.key,se.props,null,he.mode,ge),ge.ref=Zc(he,null,se),ge.return=he,ge;case f:return se=dv(se,he.mode,ge),se.return=he,se;case M:var Ke=se._init;return Tt(he,Ke(se._payload),ge)}if(ae(se)||C(se))return se=oa(se,he.mode,ge,null),se.return=he,se;Fh(he,se)}return null}function xt(he,se,ge,Ke){var pt=se!==null?se.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return pt!==null?null:re(he,se,""+ge,Ke);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:return ge.key===pt?ve(he,se,ge,Ke):null;case f:return ge.key===pt?ze(he,se,ge,Ke):null;case M:return pt=ge._init,xt(he,se,pt(ge._payload),Ke)}if(ae(ge)||C(ge))return pt!==null?null:ot(he,se,ge,Ke,null);Fh(he,ge)}return null}function rn(he,se,ge,Ke,pt){if(typeof Ke=="string"&&Ke!==""||typeof Ke=="number")return he=he.get(ge)||null,re(se,he,""+Ke,pt);if(typeof Ke=="object"&&Ke!==null){switch(Ke.$$typeof){case u:return he=he.get(Ke.key===null?ge:Ke.key)||null,ve(se,he,Ke,pt);case f:return he=he.get(Ke.key===null?ge:Ke.key)||null,ze(se,he,Ke,pt);case M:var Dt=Ke._init;return rn(he,se,ge,Dt(Ke._payload),pt)}if(ae(Ke)||C(Ke))return he=he.get(ge)||null,ot(se,he,Ke,pt,null);Fh(se,Ke)}return null}function vt(he,se,ge,Ke){for(var pt=null,Dt=null,At=se,qt=se=0,Zn=null;At!==null&&qt<ge.length;qt++){At.index>qt?(Zn=At,At=null):Zn=At.sibling;var Zt=xt(he,At,ge[qt],Ke);if(Zt===null){At===null&&(At=Zn);break}l&&At&&Zt.alternate===null&&c(he,At),se=b(Zt,se,qt),Dt===null?pt=Zt:Dt.sibling=Zt,Dt=Zt,At=Zn}if(qt===ge.length)return g(he,At),dn&&Jo(he,qt),pt;if(At===null){for(;qt<ge.length;qt++)At=Tt(he,ge[qt],Ke),At!==null&&(se=b(At,se,qt),Dt===null?pt=At:Dt.sibling=At,Dt=At);return dn&&Jo(he,qt),pt}for(At=x(he,At);qt<ge.length;qt++)Zn=rn(At,he,qt,ge[qt],Ke),Zn!==null&&(l&&Zn.alternate!==null&&At.delete(Zn.key===null?qt:Zn.key),se=b(Zn,se,qt),Dt===null?pt=Zn:Dt.sibling=Zn,Dt=Zn);return l&&At.forEach(function(ao){return c(he,ao)}),dn&&Jo(he,qt),pt}function fi(he,se,ge,Ke){var pt=C(ge);if(typeof pt!="function")throw Error(o(150));if(ge=pt.call(ge),ge==null)throw Error(o(151));for(var Dt=pt=null,At=se,qt=se=0,Zn=null,Zt=ge.next();At!==null&&!Zt.done;qt++,Zt=ge.next()){At.index>qt?(Zn=At,At=null):Zn=At.sibling;var ao=xt(he,At,Zt.value,Ke);if(ao===null){At===null&&(At=Zn);break}l&&At&&ao.alternate===null&&c(he,At),se=b(ao,se,qt),Dt===null?pt=ao:Dt.sibling=ao,Dt=ao,At=Zn}if(Zt.done)return g(he,At),dn&&Jo(he,qt),pt;if(At===null){for(;!Zt.done;qt++,Zt=ge.next())Zt=Tt(he,Zt.value,Ke),Zt!==null&&(se=b(Zt,se,qt),Dt===null?pt=Zt:Dt.sibling=Zt,Dt=Zt);return dn&&Jo(he,qt),pt}for(At=x(he,At);!Zt.done;qt++,Zt=ge.next())Zt=rn(At,he,qt,Zt.value,Ke),Zt!==null&&(l&&Zt.alternate!==null&&At.delete(Zt.key===null?qt:Zt.key),se=b(Zt,se,qt),Dt===null?pt=Zt:Dt.sibling=Zt,Dt=Zt);return l&&At.forEach(function(gI){return c(he,gI)}),dn&&Jo(he,qt),pt}function _r(he,se,ge,Ke){if(typeof ge=="object"&&ge!==null&&ge.type===h&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:e:{for(var pt=ge.key,Dt=se;Dt!==null;){if(Dt.key===pt){if(pt=ge.type,pt===h){if(Dt.tag===7){g(he,Dt.sibling),se=E(Dt,ge.props.children),se.return=he,he=se;break e}}else if(Dt.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===M&&S1(pt)===Dt.type){g(he,Dt.sibling),se=E(Dt,ge.props),se.ref=Zc(he,Dt,ge),se.return=he,he=se;break e}g(he,Dt);break}else c(he,Dt);Dt=Dt.sibling}ge.type===h?(se=oa(ge.props.children,he.mode,Ke,ge.key),se.return=he,he=se):(Ke=pd(ge.type,ge.key,ge.props,null,he.mode,Ke),Ke.ref=Zc(he,se,ge),Ke.return=he,he=Ke)}return W(he);case f:e:{for(Dt=ge.key;se!==null;){if(se.key===Dt)if(se.tag===4&&se.stateNode.containerInfo===ge.containerInfo&&se.stateNode.implementation===ge.implementation){g(he,se.sibling),se=E(se,ge.children||[]),se.return=he,he=se;break e}else{g(he,se);break}else c(he,se);se=se.sibling}se=dv(ge,he.mode,Ke),se.return=he,he=se}return W(he);case M:return Dt=ge._init,_r(he,se,Dt(ge._payload),Ke)}if(ae(ge))return vt(he,se,ge,Ke);if(C(ge))return fi(he,se,ge,Ke);Fh(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,se!==null&&se.tag===6?(g(he,se.sibling),se=E(se,ge),se.return=he,he=se):(g(he,se),se=hv(ge,he.mode,Ke),se.return=he,he=se),W(he)):g(he,se)}return _r}var ml=M1(!0),w1=M1(!1),Kc={},mr=dt(Kc),Qc=dt(Kc),gl=dt(Kc);function os(l){if(l===Kc)throw Error(o(174));return l}function P0(l,c){qe(gl,c),qe(Qc,l),qe(mr,Kc),l=pe(c),ht(mr),qe(mr,l)}function vl(){ht(mr),ht(Qc),ht(gl)}function E1(l){var c=os(gl.current),g=os(mr.current);c=z(g,l.type,c),g!==c&&(qe(Qc,l),qe(mr,c))}function I0(l){Qc.current===l&&(ht(mr),ht(Qc))}var gn=dt(0);function kh(l){for(var c=l;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Ir(g)||Js(g)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var L0=[];function N0(){for(var l=0;l<L0.length;l++){var c=L0[l];We?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}L0.length=0}var zh=a.ReactCurrentDispatcher,gr=a.ReactCurrentBatchConfig,yl=0,wn=null,li=null,qn=null,Bh=!1,$c=!1,Jc=0,HP=0;function ci(){throw Error(o(321))}function D0(l,c){if(c===null)return!1;for(var g=0;g<c.length&&g<l.length;g++)if(!is(l[g],c[g]))return!1;return!0}function U0(l,c,g,x,E,b){if(yl=b,wn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,zh.current=l===null||l.memoizedState===null?XP:jP,l=g(x,E),$c){b=0;do{if($c=!1,Jc=0,25<=b)throw Error(o(301));b+=1,qn=li=null,c.updateQueue=null,zh.current=YP,l=g(x,E)}while($c)}if(zh.current=Xh,c=li!==null&&li.next!==null,yl=0,qn=li=wn=null,Bh=!1,c)throw Error(o(300));return l}function O0(){var l=Jc!==0;return Jc=0,l}function Cs(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qn===null?wn.memoizedState=qn=l:qn=qn.next=l,qn}function as(){if(li===null){var l=wn.alternate;l=l!==null?l.memoizedState:null}else l=li.next;var c=qn===null?wn.memoizedState:qn.next;if(c!==null)qn=c,li=l;else{if(l===null)throw Error(o(310));li=l,l={memoizedState:li.memoizedState,baseState:li.baseState,baseQueue:li.baseQueue,queue:li.queue,next:null},qn===null?wn.memoizedState=qn=l:qn=qn.next=l}return qn}function ea(l,c){return typeof c=="function"?c(l):c}function Hh(l){var c=as(),g=c.queue;if(g===null)throw Error(o(311));g.lastRenderedReducer=l;var x=li,E=x.baseQueue,b=g.pending;if(b!==null){if(E!==null){var W=E.next;E.next=b.next,b.next=W}x.baseQueue=E=b,g.pending=null}if(E!==null){b=E.next,x=x.baseState;var re=W=null,ve=null,ze=b;do{var ot=ze.lane;if((yl&ot)===ot)ve!==null&&(ve=ve.next={lane:0,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null}),x=ze.hasEagerState?ze.eagerState:l(x,ze.action);else{var Tt={lane:ot,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null};ve===null?(re=ve=Tt,W=x):ve=ve.next=Tt,wn.lanes|=ot,xl|=ot}ze=ze.next}while(ze!==null&&ze!==b);ve===null?W=x:ve.next=re,is(x,c.memoizedState)||($i=!0),c.memoizedState=x,c.baseState=W,c.baseQueue=ve,g.lastRenderedState=x}if(l=g.interleaved,l!==null){E=l;do b=E.lane,wn.lanes|=b,xl|=b,E=E.next;while(E!==l)}else E===null&&(g.lanes=0);return[c.memoizedState,g.dispatch]}function Gh(l){var c=as(),g=c.queue;if(g===null)throw Error(o(311));g.lastRenderedReducer=l;var x=g.dispatch,E=g.pending,b=c.memoizedState;if(E!==null){g.pending=null;var W=E=E.next;do b=l(b,W.action),W=W.next;while(W!==E);is(b,c.memoizedState)||($i=!0),c.memoizedState=b,c.baseQueue===null&&(c.baseState=b),g.lastRenderedState=b}return[b,x]}function T1(){}function A1(l,c){var g=wn,x=as(),E=c(),b=!is(x.memoizedState,E);if(b&&(x.memoizedState=E,$i=!0),x=x.queue,tu(C1.bind(null,g,x,l),[l]),x.getSnapshot!==c||b||qn!==null&&qn.memoizedState.tag&1){if(g.flags|=2048,eu(9,R1.bind(null,g,x,E,c),void 0,null),Nn===null)throw Error(o(349));yl&30||b1(g,c,E)}return E}function b1(l,c,g){l.flags|=16384,l={getSnapshot:c,value:g},c=wn.updateQueue,c===null?(c={lastEffect:null,stores:null},wn.updateQueue=c,c.stores=[l]):(g=c.stores,g===null?c.stores=[l]:g.push(l))}function R1(l,c,g,x){c.value=g,c.getSnapshot=x,P1(c)&&vr(l,1,-1)}function C1(l,c,g){return g(function(){P1(c)&&vr(l,1,-1)})}function P1(l){var c=l.getSnapshot;l=l.value;try{var g=c();return!is(l,g)}catch{return!0}}function F0(l){var c=Cs();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:l},c.queue=l,l=l.dispatch=WP.bind(null,wn,l),[c.memoizedState,l]}function eu(l,c,g,x){return l={tag:l,create:c,destroy:g,deps:x,next:null},c=wn.updateQueue,c===null?(c={lastEffect:null,stores:null},wn.updateQueue=c,c.lastEffect=l.next=l):(g=c.lastEffect,g===null?c.lastEffect=l.next=l:(x=g.next,g.next=l,l.next=x,c.lastEffect=l)),l}function I1(){return as().memoizedState}function Vh(l,c,g,x){var E=Cs();wn.flags|=l,E.memoizedState=eu(1|c,g,void 0,x===void 0?null:x)}function Wh(l,c,g,x){var E=as();x=x===void 0?null:x;var b=void 0;if(li!==null){var W=li.memoizedState;if(b=W.destroy,x!==null&&D0(x,W.deps)){E.memoizedState=eu(c,g,b,x);return}}wn.flags|=l,E.memoizedState=eu(1|c,g,b,x)}function k0(l,c){return Vh(8390656,8,l,c)}function tu(l,c){return Wh(2048,8,l,c)}function L1(l,c){return Wh(4,2,l,c)}function N1(l,c){return Wh(4,4,l,c)}function D1(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function U1(l,c,g){return g=g!=null?g.concat([l]):null,Wh(4,4,D1.bind(null,c,l),g)}function z0(){}function O1(l,c){var g=as();c=c===void 0?null:c;var x=g.memoizedState;return x!==null&&c!==null&&D0(c,x[1])?x[0]:(g.memoizedState=[l,c],l)}function F1(l,c){var g=as();c=c===void 0?null:c;var x=g.memoizedState;return x!==null&&c!==null&&D0(c,x[1])?x[0]:(l=l(),g.memoizedState=[l,c],l)}function GP(l,c){var g=Yt;Yt=g!==0&&4>g?g:4,l(!0);var x=gr.transition;gr.transition={};try{l(!1),c()}finally{Yt=g,gr.transition=x}}function k1(){return as().memoizedState}function VP(l,c,g){var x=ro(l);g={lane:x,action:g,hasEagerState:!1,eagerState:null,next:null},z1(l)?B1(c,g):(H1(l,c,g),g=Mi(),l=vr(l,x,g),l!==null&&G1(l,c,x))}function WP(l,c,g){var x=ro(l),E={lane:x,action:g,hasEagerState:!1,eagerState:null,next:null};if(z1(l))B1(c,E);else{H1(l,c,E);var b=l.alternate;if(l.lanes===0&&(b===null||b.lanes===0)&&(b=c.lastRenderedReducer,b!==null))try{var W=c.lastRenderedState,re=b(W,g);if(E.hasEagerState=!0,E.eagerState=re,is(re,W))return}catch{}finally{}g=Mi(),l=vr(l,x,g),l!==null&&G1(l,c,x)}}function z1(l){var c=l.alternate;return l===wn||c!==null&&c===wn}function B1(l,c){$c=Bh=!0;var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}function H1(l,c,g){Nn!==null&&l.mode&1&&!(Ot&2)?(l=c.interleaved,l===null?(g.next=g,ss===null?ss=[c]:ss.push(c)):(g.next=l.next,l.next=g),c.interleaved=g):(l=c.pending,l===null?g.next=g:(g.next=l.next,l.next=g),c.pending=g)}function G1(l,c,g){if(g&4194240){var x=c.lanes;x&=l.pendingLanes,g|=x,c.lanes=g,d0(l,g)}}var Xh={readContext:hr,useCallback:ci,useContext:ci,useEffect:ci,useImperativeHandle:ci,useInsertionEffect:ci,useLayoutEffect:ci,useMemo:ci,useReducer:ci,useRef:ci,useState:ci,useDebugValue:ci,useDeferredValue:ci,useTransition:ci,useMutableSource:ci,useSyncExternalStore:ci,useId:ci,unstable_isNewReconciler:!1},XP={readContext:hr,useCallback:function(l,c){return Cs().memoizedState=[l,c===void 0?null:c],l},useContext:hr,useEffect:k0,useImperativeHandle:function(l,c,g){return g=g!=null?g.concat([l]):null,Vh(4194308,4,D1.bind(null,c,l),g)},useLayoutEffect:function(l,c){return Vh(4194308,4,l,c)},useInsertionEffect:function(l,c){return Vh(4,2,l,c)},useMemo:function(l,c){var g=Cs();return c=c===void 0?null:c,l=l(),g.memoizedState=[l,c],l},useReducer:function(l,c,g){var x=Cs();return c=g!==void 0?g(c):c,x.memoizedState=x.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},x.queue=l,l=l.dispatch=VP.bind(null,wn,l),[x.memoizedState,l]},useRef:function(l){var c=Cs();return l={current:l},c.memoizedState=l},useState:F0,useDebugValue:z0,useDeferredValue:function(l){var c=F0(l),g=c[0],x=c[1];return k0(function(){var E=gr.transition;gr.transition={};try{x(l)}finally{gr.transition=E}},[l]),g},useTransition:function(){var l=F0(!1),c=l[0];return l=GP.bind(null,l[1]),Cs().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,g){var x=wn,E=Cs();if(dn){if(g===void 0)throw Error(o(407));g=g()}else{if(g=c(),Nn===null)throw Error(o(349));yl&30||b1(x,c,g)}E.memoizedState=g;var b={value:g,getSnapshot:c};return E.queue=b,k0(C1.bind(null,x,b,l),[l]),x.flags|=2048,eu(9,R1.bind(null,x,b,g,c),void 0,null),g},useId:function(){var l=Cs(),c=Nn.identifierPrefix;if(dn){var g=Rs,x=bs;g=(x&~(1<<32-tn(x)-1)).toString(32)+g,c=":"+c+"R"+g,g=Jc++,0<g&&(c+="H"+g.toString(32)),c+=":"}else g=HP++,c=":"+c+"r"+g.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},jP={readContext:hr,useCallback:O1,useContext:hr,useEffect:tu,useImperativeHandle:U1,useInsertionEffect:L1,useLayoutEffect:N1,useMemo:F1,useReducer:Hh,useRef:I1,useState:function(){return Hh(ea)},useDebugValue:z0,useDeferredValue:function(l){var c=Hh(ea),g=c[0],x=c[1];return tu(function(){var E=gr.transition;gr.transition={};try{x(l)}finally{gr.transition=E}},[l]),g},useTransition:function(){var l=Hh(ea)[0],c=as().memoizedState;return[l,c]},useMutableSource:T1,useSyncExternalStore:A1,useId:k1,unstable_isNewReconciler:!1},YP={readContext:hr,useCallback:O1,useContext:hr,useEffect:tu,useImperativeHandle:U1,useInsertionEffect:L1,useLayoutEffect:N1,useMemo:F1,useReducer:Gh,useRef:I1,useState:function(){return Gh(ea)},useDebugValue:z0,useDeferredValue:function(l){var c=Gh(ea),g=c[0],x=c[1];return tu(function(){var E=gr.transition;gr.transition={};try{x(l)}finally{gr.transition=E}},[l]),g},useTransition:function(){var l=Gh(ea)[0],c=as().memoizedState;return[l,c]},useMutableSource:T1,useSyncExternalStore:A1,useId:k1,unstable_isNewReconciler:!1};function B0(l,c){try{var g="",x=c;do g+=BP(x),x=x.return;while(x);var E=g}catch(b){E=` 3907Error generating stack: `+b.message+` 3908`+b.stack}return{value:l,source:c,stack:E}}function H0(l,c){try{console.error(c.value)}catch(g){setTimeout(function(){throw g})}}var qP=typeof WeakMap=="function"?WeakMap:Map;function V1(l,c,g){g=As(-1,g),g.tag=3,g.payload={element:null};var x=c.value;return g.callback=function(){ad||(ad=!0,sv=x),H0(l,c)},g}function W1(l,c,g){g=As(-1,g),g.tag=3;var x=l.type.getDerivedStateFromError;if(typeof x=="function"){var E=c.value;g.payload=function(){return x(E)},g.callback=function(){H0(l,c)}}var b=l.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(g.callback=function(){H0(l,c),typeof x!="function"&&(no===null?no=new Set([this]):no.add(this));var W=c.stack;this.componentDidCatch(c.value,{componentStack:W!==null?W:""})}),g}function X1(l,c,g){var x=l.pingCache;if(x===null){x=l.pingCache=new qP;var E=new Set;x.set(c,E)}else E=x.get(c),E===void 0&&(E=new Set,x.set(c,E));E.has(g)||(E.add(g),l=lI.bind(null,l,c,g),c.then(l,l))}function j1(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function Y1(l,c,g,x,E){return l.mode&1?(l.flags|=65536,l.lanes=E,l):(l===c?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(c=As(-1,1),c.tag=2,to(g,c))),g.lanes|=1),l)}function ls(l){l.flags|=4}function q1(l,c){if(l!==null&&l.child===c.child)return!0;if(c.flags&16)return!1;for(l=c.child;l!==null;){if(l.flags&12854||l.subtreeFlags&12854)return!1;l=l.sibling}return!0}var nu,iu,jh,Yh;if(nt)nu=function(l,c){for(var g=c.child;g!==null;){if(g.tag===5||g.tag===6)ye(l,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===c)break;for(;g.sibling===null;){if(g.return===null||g.return===c)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},iu=function(){},jh=function(l,c,g,x,E){if(l=l.memoizedProps,l!==x){var b=c.stateNode,W=os(mr.current);g=ue(b,g,l,x,E,W),(c.updateQueue=g)&&ls(c)}},Yh=function(l,c,g,x){g!==x&&ls(c)};else if(xe){nu=function(l,c,g,x){for(var E=c.child;E!==null;){if(E.tag===5){var b=E.stateNode;g&&x&&(b=kn(b,E.type,E.memoizedProps,E)),ye(l,b)}else if(E.tag===6)b=E.stateNode,g&&x&&(b=Oi(b,E.memoizedProps,E)),ye(l,b);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)b=E.child,b!==null&&(b.return=E),nu(l,E,!0,!0);else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===c)break;for(;E.sibling===null;){if(E.return===null||E.return===c)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};var Z1=function(l,c,g,x){for(var E=c.child;E!==null;){if(E.tag===5){var b=E.stateNode;g&&x&&(b=kn(b,E.type,E.memoizedProps,E)),ln(l,b)}else if(E.tag===6)b=E.stateNode,g&&x&&(b=Oi(b,E.memoizedProps,E)),ln(l,b);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)b=E.child,b!==null&&(b.return=E),Z1(l,E,!0,!0);else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===c)break;for(;E.sibling===null;){if(E.return===null||E.return===c)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};iu=function(l,c){var g=c.stateNode;if(!q1(l,c)){l=g.containerInfo;var x=Ft(l);Z1(x,c,!1,!1),g.pendingChildren=x,ls(c),Xn(l,x)}},jh=function(l,c,g,x,E){var b=l.stateNode,W=l.memoizedProps;if((l=q1(l,c))&&W===x)c.stateNode=b;else{var re=c.stateNode,ve=os(mr.current),ze=null;W!==x&&(ze=ue(re,g,W,x,E,ve)),l&&ze===null?c.stateNode=b:(b=et(b,ze,g,W,x,c,l,re),De(b,g,x,E,ve)&&ls(c),c.stateNode=b,l?ls(c):nu(b,c,!1,!1))}},Yh=function(l,c,g,x){g!==x?(l=os(gl.current),g=os(mr.current),c.stateNode=we(x,l,g,c),ls(c)):c.stateNode=l.stateNode}}else iu=function(){},jh=function(){},Yh=function(){};function ru(l,c){if(!dn)switch(l.tailMode){case"hidden":c=l.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var x=null;g!==null;)g.alternate!==null&&(x=g),g=g.sibling;x===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null}}function ui(l){var c=l.alternate!==null&&l.alternate.child===l.child,g=0,x=0;if(c)for(var E=l.child;E!==null;)g|=E.lanes|E.childLanes,x|=E.subtreeFlags&14680064,x|=E.flags&14680064,E.return=l,E=E.sibling;else for(E=l.child;E!==null;)g|=E.lanes|E.childLanes,x|=E.subtreeFlags,x|=E.flags,E.return=l,E=E.sibling;return l.subtreeFlags|=x,l.childLanes=g,c}function ZP(l,c,g){var x=c.pendingProps;switch(A0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ui(c),null;case 1:return Ht(c.type)&&Rn(),ui(c),null;case 3:return x=c.stateNode,vl(),ht(tt),ht(wt),N0(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(l===null||l.child===null)&&(qc(c)?ls(c):l===null||l.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,Dr!==null&&(lv(Dr),Dr=null))),iu(l,c),ui(c),null;case 5:I0(c),g=os(gl.current);var E=c.type;if(l!==null&&c.stateNode!=null)jh(l,c,E,x,g),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!x){if(c.stateNode===null)throw Error(o(166));return ui(c),null}if(l=os(mr.current),qc(c)){if(!G)throw Error(o(175));l=D(c.stateNode,c.type,c.memoizedProps,g,l,c,!Yc),c.updateQueue=l,l!==null&&ls(c)}else{var b=le(E,x,g,l,c);nu(b,c,!1,!1),c.stateNode=b,De(b,E,x,g,l)&&ls(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return ui(c),null;case 6:if(l&&c.stateNode!=null)Yh(l,c,l.memoizedProps,x);else{if(typeof x!="string"&&c.stateNode===null)throw Error(o(166));if(l=os(gl.current),g=os(mr.current),qc(c)){if(!G)throw Error(o(176));if(l=c.stateNode,x=c.memoizedProps,(g=O(l,x,c,!Yc))&&(E=Ki,E!==null))switch(b=(E.mode&1)!==0,E.tag){case 3:oe(E.stateNode.containerInfo,l,x,b);break;case 5:fe(E.type,E.memoizedProps,E.stateNode,l,x,b)}g&&ls(c)}else c.stateNode=we(x,l,g,c)}return ui(c),null;case 13:if(ht(gn),x=c.memoizedState,dn&&Qi!==null&&c.mode&1&&!(c.flags&128)){for(l=Qi;l;)l=ai(l);return pl(),c.flags|=98560,c}if(x!==null&&x.dehydrated!==null){if(x=qc(c),l===null){if(!x)throw Error(o(318));if(!G)throw Error(o(344));if(l=c.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));J(l,c)}else pl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;return ui(c),null}return Dr!==null&&(lv(Dr),Dr=null),c.flags&128?(c.lanes=g,c):(x=x!==null,g=!1,l===null?qc(c):g=l.memoizedState!==null,x&&!g&&(c.child.flags|=8192,c.mode&1&&(l===null||gn.current&1?zn===0&&(zn=3):uv())),c.updateQueue!==null&&(c.flags|=4),ui(c),null);case 4:return vl(),iu(l,c),l===null&&Fe(c.stateNode.containerInfo),ui(c),null;case 10:return x0(c.type._context),ui(c),null;case 17:return Ht(c.type)&&Rn(),ui(c),null;case 19:if(ht(gn),E=c.memoizedState,E===null)return ui(c),null;if(x=(c.flags&128)!==0,b=E.rendering,b===null)if(x)ru(E,!1);else{if(zn!==0||l!==null&&l.flags&128)for(l=c.child;l!==null;){if(b=kh(l),b!==null){for(c.flags|=128,ru(E,!1),l=b.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),c.subtreeFlags=0,l=g,x=c.child;x!==null;)g=x,E=l,g.flags&=14680066,b=g.alternate,b===null?(g.childLanes=0,g.lanes=E,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=b.childLanes,g.lanes=b.lanes,g.child=b.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=b.memoizedProps,g.memoizedState=b.memoizedState,g.updateQueue=b.updateQueue,g.type=b.type,E=b.dependencies,g.dependencies=E===null?null:{lanes:E.lanes,firstContext:E.firstContext}),x=x.sibling;return qe(gn,gn.current&1|2),c.child}l=l.sibling}E.tail!==null&&Yn()>rv&&(c.flags|=128,x=!0,ru(E,!1),c.lanes=4194304)}else{if(!x)if(l=kh(b),l!==null){if(c.flags|=128,x=!0,l=l.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),ru(E,!0),E.tail===null&&E.tailMode==="hidden"&&!b.alternate&&!dn)return ui(c),null}else 2*Yn()-E.renderingStartTime>rv&&g!==1073741824&&(c.flags|=128,x=!0,ru(E,!1),c.lanes=4194304);E.isBackwards?(b.sibling=c.child,c.child=b):(l=E.last,l!==null?l.sibling=b:c.child=b,E.last=b)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=Yn(),c.sibling=null,l=gn.current,qe(gn,x?l&1|2:l&1),c):(ui(c),null);case 22:case 23:return cv(),x=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==x&&(c.flags|=8192),x&&c.mode&1?Ji&1073741824&&(ui(c),nt&&c.subtreeFlags&6&&(c.flags|=8192)):ui(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}var KP=a.ReactCurrentOwner,$i=!1;function Si(l,c,g,x){c.child=l===null?w1(c,null,g,x):ml(c,l.child,g,x)}function K1(l,c,g,x,E){g=g.render;var b=c.ref;return fl(c,E),x=U0(l,c,g,x,b,E),g=O0(),l!==null&&!$i?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~E,Ps(l,c,E)):(dn&&g&&T0(c),c.flags|=1,Si(l,c,x,E),c.child)}function Q1(l,c,g,x,E){if(l===null){var b=g.type;return typeof b=="function"&&!fv(b)&&b.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(c.tag=15,c.type=b,$1(l,c,b,x,E)):(l=pd(g.type,null,x,c,c.mode,E),l.ref=c.ref,l.return=c,c.child=l)}if(b=l.child,!(l.lanes&E)){var W=b.memoizedProps;if(g=g.compare,g=g!==null?g:Ch,g(W,x)&&l.ref===c.ref)return Ps(l,c,E)}return c.flags|=1,l=oo(b,x),l.ref=c.ref,l.return=c,c.child=l}function $1(l,c,g,x,E){if(l!==null&&Ch(l.memoizedProps,x)&&l.ref===c.ref)if($i=!1,(l.lanes&E)!==0)l.flags&131072&&($i=!0);else return c.lanes=l.lanes,Ps(l,c,E);return G0(l,c,g,x,E)}function J1(l,c,g){var x=c.pendingProps,E=x.children,b=l!==null?l.memoizedState:null;if(x.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null},qe(_l,Ji),Ji|=g;else if(g&1073741824)c.memoizedState={baseLanes:0,cachePool:null},x=b!==null?b.baseLanes:g,qe(_l,Ji),Ji|=x;else return l=b!==null?b.baseLanes|g:g,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null},c.updateQueue=null,qe(_l,Ji),Ji|=l,null;else b!==null?(x=b.baseLanes|g,c.memoizedState=null):x=g,qe(_l,Ji),Ji|=x;return Si(l,c,E,g),c.child}function eM(l,c){var g=c.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(c.flags|=512,c.flags|=2097152)}function G0(l,c,g,x,E){var b=Ht(g)?kt:wt.current;return b=mn(c,b),fl(c,E),g=U0(l,c,g,x,b,E),x=O0(),l!==null&&!$i?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~E,Ps(l,c,E)):(dn&&x&&T0(c),c.flags|=1,Si(l,c,g,E),c.child)}function tM(l,c,g,x,E){if(Ht(g)){var b=!0;Vt(c)}else b=!1;if(fl(c,E),c.stateNode===null)l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),m1(c,g,x),E0(c,g,x,E),x=!0;else if(l===null){var W=c.stateNode,re=c.memoizedProps;W.props=re;var ve=W.context,ze=g.contextType;typeof ze=="object"&&ze!==null?ze=hr(ze):(ze=Ht(g)?kt:wt.current,ze=mn(c,ze));var ot=g.getDerivedStateFromProps,Tt=typeof ot=="function"||typeof W.getSnapshotBeforeUpdate=="function";Tt||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(re!==x||ve!==ze)&&g1(c,W,x,ze),eo=!1;var xt=c.memoizedState;W.state=xt,Nh(c,x,W,E),ve=c.memoizedState,re!==x||xt!==ve||tt.current||eo?(typeof ot=="function"&&(w0(c,g,ot,x),ve=c.memoizedState),(re=eo||p1(c,g,re,x,xt,ve,ze))?(Tt||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount()),typeof W.componentDidMount=="function"&&(c.flags|=4194308)):(typeof W.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=x,c.memoizedState=ve),W.props=x,W.state=ve,W.context=ze,x=re):(typeof W.componentDidMount=="function"&&(c.flags|=4194308),x=!1)}else{W=c.stateNode,u1(l,c),re=c.memoizedProps,ze=c.type===c.elementType?re:Nr(c.type,re),W.props=ze,Tt=c.pendingProps,xt=W.context,ve=g.contextType,typeof ve=="object"&&ve!==null?ve=hr(ve):(ve=Ht(g)?kt:wt.current,ve=mn(c,ve));var rn=g.getDerivedStateFromProps;(ot=typeof rn=="function"||typeof W.getSnapshotBeforeUpdate=="function")||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(re!==Tt||xt!==ve)&&g1(c,W,x,ve),eo=!1,xt=c.memoizedState,W.state=xt,Nh(c,x,W,E);var vt=c.memoizedState;re!==Tt||xt!==vt||tt.current||eo?(typeof rn=="function"&&(w0(c,g,rn,x),vt=c.memoizedState),(ze=eo||p1(c,g,ze,x,xt,vt,ve)||!1)?(ot||typeof W.UNSAFE_componentWillUpdate!="function"&&typeof W.componentWillUpdate!="function"||(typeof W.componentWillUpdate=="function"&&W.componentWillUpdate(x,vt,ve),typeof W.UNSAFE_componentWillUpdate=="function"&&W.UNSAFE_componentWillUpdate(x,vt,ve)),typeof W.componentDidUpdate=="function"&&(c.flags|=4),typeof W.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof W.componentDidUpdate!="function"||re===l.memoizedProps&&xt===l.memoizedState||(c.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||re===l.memoizedProps&&xt===l.memoizedState||(c.flags|=1024),c.memoizedProps=x,c.memoizedState=vt),W.props=x,W.state=vt,W.context=ve,x=ze):(typeof W.componentDidUpdate!="function"||re===l.memoizedProps&&xt===l.memoizedState||(c.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||re===l.memoizedProps&&xt===l.memoizedState||(c.flags|=1024),x=!1)}return V0(l,c,g,x,b,E)}function V0(l,c,g,x,E,b){eM(l,c);var W=(c.flags&128)!==0;if(!x&&!W)return E&&Et(c,g,!1),Ps(l,c,b);x=c.stateNode,KP.current=c;var re=W&&typeof g.getDerivedStateFromError!="function"?null:x.render();return c.flags|=1,l!==null&&W?(c.child=ml(c,l.child,null,b),c.child=ml(c,null,re,b)):Si(l,c,re,b),c.memoizedState=x.state,E&&Et(c,g,!0),c.child}function nM(l){var c=l.stateNode;c.pendingContext?_t(l,c.pendingContext,c.pendingContext!==c.context):c.context&&_t(l,c.context,!1),P0(l,c.containerInfo)}function iM(l,c,g,x,E){return pl(),C0(E),c.flags|=256,Si(l,c,g,x),c.child}var qh={dehydrated:null,treeContext:null,retryLane:0};function Zh(l){return{baseLanes:l,cachePool:null}}function rM(l,c,g){var x=c.pendingProps,E=gn.current,b=!1,W=(c.flags&128)!==0,re;if((re=W)||(re=l!==null&&l.memoizedState===null?!1:(E&2)!==0),re?(b=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(E|=1),qe(gn,E&1),l===null)return R0(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(c.mode&1?Js(l)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(E=x.children,l=x.fallback,b?(x=c.mode,b=c.child,E={mode:"hidden",children:E},!(x&1)&&b!==null?(b.childLanes=0,b.pendingProps=E):b=md(E,x,0,null),l=oa(l,x,g,null),b.return=c,l.return=c,b.sibling=l,c.child=b,c.child.memoizedState=Zh(g),c.memoizedState=qh,l):W0(c,E));if(E=l.memoizedState,E!==null){if(re=E.dehydrated,re!==null){if(W)return c.flags&256?(c.flags&=-257,Kh(l,c,g,Error(o(422)))):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(b=x.fallback,E=c.mode,x=md({mode:"visible",children:x.children},E,0,null),b=oa(b,E,g,null),b.flags|=2,x.return=c,b.return=c,x.sibling=b,c.child=x,c.mode&1&&ml(c,l.child,null,g),c.child.memoizedState=Zh(g),c.memoizedState=qh,b);if(!(c.mode&1))c=Kh(l,c,g,null);else if(Js(re))c=Kh(l,c,g,Error(o(419)));else if(x=(g&l.childLanes)!==0,$i||x){if(x=Nn,x!==null){switch(g&-g){case 4:b=2;break;case 16:b=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:b=32;break;case 536870912:b=268435456;break;default:b=0}x=b&(x.suspendedLanes|g)?0:b,x!==0&&x!==E.retryLane&&(E.retryLane=x,vr(l,x,-1))}uv(),c=Kh(l,c,g,Error(o(421)))}else Ir(re)?(c.flags|=128,c.child=l.child,c=cI.bind(null,l),es(re,c),c=null):(g=E.treeContext,G&&(Qi=cl(re),Ki=c,dn=!0,Dr=null,Yc=!1,g!==null&&(dr[pr++]=bs,dr[pr++]=Rs,dr[pr++]=$o,bs=g.id,Rs=g.overflow,$o=c)),c=W0(c,c.pendingProps.children),c.flags|=4096);return c}return b?(x=oM(l,c,x.children,x.fallback,g),b=c.child,E=l.child.memoizedState,b.memoizedState=E===null?Zh(g):{baseLanes:E.baseLanes|g,cachePool:null},b.childLanes=l.childLanes&~g,c.memoizedState=qh,x):(g=sM(l,c,x.children,g),c.memoizedState=null,g)}return b?(x=oM(l,c,x.children,x.fallback,g),b=c.child,E=l.child.memoizedState,b.memoizedState=E===null?Zh(g):{baseLanes:E.baseLanes|g,cachePool:null},b.childLanes=l.childLanes&~g,c.memoizedState=qh,x):(g=sM(l,c,x.children,g),c.memoizedState=null,g)}function W0(l,c){return c=md({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function sM(l,c,g,x){var E=l.child;return l=E.sibling,g=oo(E,{mode:"visible",children:g}),!(c.mode&1)&&(g.lanes=x),g.return=c,g.sibling=null,l!==null&&(x=c.deletions,x===null?(c.deletions=[l],c.flags|=16):x.push(l)),c.child=g}function oM(l,c,g,x,E){var b=c.mode;l=l.child;var W=l.sibling,re={mode:"hidden",children:g};return!(b&1)&&c.child!==l?(g=c.child,g.childLanes=0,g.pendingProps=re,c.deletions=null):(g=oo(l,re),g.subtreeFlags=l.subtreeFlags&14680064),W!==null?x=oo(W,x):(x=oa(x,b,E,null),x.flags|=2),x.return=c,g.return=c,g.sibling=x,c.child=g,x}function Kh(l,c,g,x){return x!==null&&C0(x),ml(c,l.child,null,g),l=W0(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function aM(l,c,g){l.lanes|=c;var x=l.alternate;x!==null&&(x.lanes|=c),S0(l.return,c,g)}function X0(l,c,g,x,E){var b=l.memoizedState;b===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:E}:(b.isBackwards=c,b.rendering=null,b.renderingStartTime=0,b.last=x,b.tail=g,b.tailMode=E)}function lM(l,c,g){var x=c.pendingProps,E=x.revealOrder,b=x.tail;if(Si(l,c,x.children,g),x=gn.current,x&2)x=x&1|2,c.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&aM(l,g,c);else if(l.tag===19)aM(l,g,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}x&=1}if(qe(gn,x),!(c.mode&1))c.memoizedState=null;else switch(E){case"forwards":for(g=c.child,E=null;g!==null;)l=g.alternate,l!==null&&kh(l)===null&&(E=g),g=g.sibling;g=E,g===null?(E=c.child,c.child=null):(E=g.sibling,g.sibling=null),X0(c,!1,E,g,b);break;case"backwards":for(g=null,E=c.child,c.child=null;E!==null;){if(l=E.alternate,l!==null&&kh(l)===null){c.child=E;break}l=E.sibling,E.sibling=g,g=E,E=l}X0(c,!0,g,null,b);break;case"together":X0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Ps(l,c,g){if(l!==null&&(c.dependencies=l.dependencies),xl|=c.lanes,!(g&c.childLanes))return null;if(l!==null&&c.child!==l.child)throw Error(o(153));if(c.child!==null){for(l=c.child,g=oo(l,l.pendingProps),c.child=g,g.return=c;l.sibling!==null;)l=l.sibling,g=g.sibling=oo(l,l.pendingProps),g.return=c;g.sibling=null}return c.child}function QP(l,c,g){switch(c.tag){case 3:nM(c),pl();break;case 5:E1(c);break;case 1:Ht(c.type)&&Vt(c);break;case 4:P0(c,c.stateNode.containerInfo);break;case 10:c1(c,c.type._context,c.memoizedProps.value);break;case 13:var x=c.memoizedState;if(x!==null)return x.dehydrated!==null?(qe(gn,gn.current&1),c.flags|=128,null):g&c.child.childLanes?rM(l,c,g):(qe(gn,gn.current&1),l=Ps(l,c,g),l!==null?l.sibling:null);qe(gn,gn.current&1);break;case 19:if(x=(g&c.childLanes)!==0,l.flags&128){if(x)return lM(l,c,g);c.flags|=128}var E=c.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),qe(gn,gn.current),x)break;return null;case 22:case 23:return c.lanes=0,J1(l,c,g)}return Ps(l,c,g)}function $P(l,c){switch(A0(c),c.tag){case 1:return Ht(c.type)&&Rn(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return vl(),ht(tt),ht(wt),N0(),l=c.flags,l&65536&&!(l&128)?(c.flags=l&-65537|128,c):null;case 5:return I0(c),null;case 13:if(ht(gn),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(o(340));pl()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return ht(gn),null;case 4:return vl(),null;case 10:return x0(c.type._context),null;case 22:case 23:return cv(),null;case 24:return null;default:return null}}var Qh=!1,ta=!1,JP=typeof WeakSet=="function"?WeakSet:Set,je=null;function $h(l,c){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(x){zi(l,c,x)}else g.current=null}function j0(l,c,g){try{g()}catch(x){zi(l,c,x)}}var cM=!1;function eI(l,c){for(ie(l.containerInfo),je=c;je!==null;)if(l=je,c=l.child,(l.subtreeFlags&1028)!==0&&c!==null)c.return=l,je=c;else for(;je!==null;){l=je;try{var g=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var x=g.memoizedProps,E=g.memoizedState,b=l.stateNode,W=b.getSnapshotBeforeUpdate(l.elementType===l.type?x:Nr(l.type,x),E);b.__reactInternalSnapshotBeforeUpdate=W}break;case 3:nt&&Ye(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(re){zi(l,l.return,re)}if(c=l.sibling,c!==null){c.return=l.return,je=c;break}je=l.return}return g=cM,cM=!1,g}function na(l,c,g){var x=c.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var E=x=x.next;do{if((E.tag&l)===l){var b=E.destroy;E.destroy=void 0,b!==void 0&&j0(c,g,b)}E=E.next}while(E!==x)}}function su(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var g=c=c.next;do{if((g.tag&l)===l){var x=g.create;g.destroy=x()}g=g.next}while(g!==c)}}function Y0(l){var c=l.ref;if(c!==null){var g=l.stateNode;switch(l.tag){case 5:l=Q(g);break;default:l=g}typeof c=="function"?c(l):c.current=l}}function uM(l,c,g){if(ns&&typeof ns.onCommitFiberUnmount=="function")try{ns.onCommitFiberUnmount(bh,c)}catch{}switch(c.tag){case 0:case 11:case 14:case 15:if(l=c.updateQueue,l!==null&&(l=l.lastEffect,l!==null)){var x=l=l.next;do{var E=x,b=E.destroy;E=E.tag,b!==void 0&&(E&2||E&4)&&j0(c,g,b),x=x.next}while(x!==l)}break;case 1:if($h(c,g),l=c.stateNode,typeof l.componentWillUnmount=="function")try{l.props=c.memoizedProps,l.state=c.memoizedState,l.componentWillUnmount()}catch(W){zi(c,g,W)}break;case 5:$h(c,g);break;case 4:nt?gM(l,c,g):xe&&xe&&(c=c.stateNode.containerInfo,g=Ft(c),Bt(c,g))}}function fM(l,c,g){for(var x=c;;)if(uM(l,x,g),x.child===null||nt&&x.tag===4){if(x===c)break;for(;x.sibling===null;){if(x.return===null||x.return===c)return;x=x.return}x.sibling.return=x.return,x=x.sibling}else x.child.return=x,x=x.child}function hM(l){var c=l.alternate;c!==null&&(l.alternate=null,hM(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&He(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function dM(l){return l.tag===5||l.tag===3||l.tag===4}function pM(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||dM(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function mM(l){if(nt){e:{for(var c=l.return;c!==null;){if(dM(c))break e;c=c.return}throw Error(o(160))}var g=c;switch(g.tag){case 5:c=g.stateNode,g.flags&32&&(bt(c),g.flags&=-33),g=pM(l),Z0(l,g,c);break;case 3:case 4:c=g.stateNode.containerInfo,g=pM(l),q0(l,g,c);break;default:throw Error(o(161))}}}function q0(l,c,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,c?Ge(g,l,c):It(g,l);else if(x!==4&&(l=l.child,l!==null))for(q0(l,c,g),l=l.sibling;l!==null;)q0(l,c,g),l=l.sibling}function Z0(l,c,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,c?yt(g,l,c):$e(g,l);else if(x!==4&&(l=l.child,l!==null))for(Z0(l,c,g),l=l.sibling;l!==null;)Z0(l,c,g),l=l.sibling}function gM(l,c,g){for(var x=c,E=!1,b,W;;){if(!E){E=x.return;e:for(;;){if(E===null)throw Error(o(160));switch(b=E.stateNode,E.tag){case 5:W=!1;break e;case 3:b=b.containerInfo,W=!0;break e;case 4:b=b.containerInfo,W=!0;break e}E=E.return}E=!0}if(x.tag===5||x.tag===6)fM(l,x,g),W?St(b,x.stateNode):Ut(b,x.stateNode);else if(x.tag===18)W?q(b,x.stateNode):K(b,x.stateNode);else if(x.tag===4){if(x.child!==null){b=x.stateNode.containerInfo,W=!0,x.child.return=x,x=x.child;continue}}else if(uM(l,x,g),x.child!==null){x.child.return=x,x=x.child;continue}if(x===c)break;for(;x.sibling===null;){if(x.return===null||x.return===c)return;x=x.return,x.tag===4&&(E=!1)}x.sibling.return=x.return,x=x.sibling}}function K0(l,c){if(nt){switch(c.tag){case 0:case 11:case 14:case 15:na(3,c,c.return),su(3,c),na(5,c,c.return);return;case 1:return;case 5:var g=c.stateNode;if(g!=null){var x=c.memoizedProps;l=l!==null?l.memoizedProps:x;var E=c.type,b=c.updateQueue;c.updateQueue=null,b!==null&&Mt(g,b,E,l,x,c)}return;case 6:if(c.stateNode===null)throw Error(o(162));g=c.memoizedProps,Ne(c.stateNode,l!==null?l.memoizedProps:g,g);return;case 3:G&&l!==null&&l.memoizedState.isDehydrated&&P(c.stateNode.containerInfo);return;case 12:return;case 13:Jh(c);return;case 19:Jh(c);return;case 17:return}throw Error(o(163))}switch(c.tag){case 0:case 11:case 14:case 15:na(3,c,c.return),su(3,c),na(5,c,c.return);return;case 12:return;case 13:Jh(c);return;case 19:Jh(c);return;case 3:G&&l!==null&&l.memoizedState.isDehydrated&&P(c.stateNode.containerInfo);break;case 22:case 23:return}e:if(xe){switch(c.tag){case 1:case 5:case 6:break e;case 3:case 4:c=c.stateNode,Bt(c.containerInfo,c.pendingChildren);break e}throw Error(o(163))}}function Jh(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new JP),c.forEach(function(x){var E=uI.bind(null,l,x);g.has(x)||(g.add(x),x.then(E,E))})}}function tI(l,c){for(je=c;je!==null;){c=je;var g=c.deletions;if(g!==null)for(var x=0;x<g.length;x++){var E=g[x];try{var b=l;nt?gM(b,E,c):fM(b,E,c);var W=E.alternate;W!==null&&(W.return=null),E.return=null}catch(pt){zi(E,c,pt)}}if(g=c.child,c.subtreeFlags&12854&&g!==null)g.return=c,je=g;else for(;je!==null;){c=je;try{var re=c.flags;if(re&32&&nt&&bt(c.stateNode),re&512){var ve=c.alternate;if(ve!==null){var ze=ve.ref;ze!==null&&(typeof ze=="function"?ze(null):ze.current=null)}}if(re&8192)switch(c.tag){case 13:if(c.memoizedState!==null){var ot=c.alternate;(ot===null||ot.memoizedState===null)&&(iv=Yn())}break;case 22:var Tt=c.memoizedState!==null,xt=c.alternate,rn=xt!==null&&xt.memoizedState!==null;if(g=c,nt){e:if(x=g,E=Tt,b=null,nt)for(var vt=x;;){if(vt.tag===5){if(b===null){b=vt;var fi=vt.stateNode;E?te(fi):ne(vt.stateNode,vt.memoizedProps)}}else if(vt.tag===6){if(b===null){var _r=vt.stateNode;E?Je(_r):Te(_r,vt.memoizedProps)}}else if((vt.tag!==22&&vt.tag!==23||vt.memoizedState===null||vt===x)&&vt.child!==null){vt.child.return=vt,vt=vt.child;continue}if(vt===x)break;for(;vt.sibling===null;){if(vt.return===null||vt.return===x)break e;b===vt&&(b=null),vt=vt.return}b===vt&&(b=null),vt.sibling.return=vt.return,vt=vt.sibling}}if(Tt&&!rn&&g.mode&1){je=g;for(var he=g.child;he!==null;){for(g=je=he;je!==null;){x=je;var se=x.child;switch(x.tag){case 0:case 11:case 14:case 15:na(4,x,x.return);break;case 1:$h(x,x.return);var ge=x.stateNode;if(typeof ge.componentWillUnmount=="function"){var Ke=x.return;try{ge.props=x.memoizedProps,ge.state=x.memoizedState,ge.componentWillUnmount()}catch(pt){zi(x,Ke,pt)}}break;case 5:$h(x,x.return);break;case 22:if(x.memoizedState!==null){_M(g);continue}}se!==null?(se.return=x,je=se):_M(g)}he=he.sibling}}}switch(re&4102){case 2:mM(c),c.flags&=-3;break;case 6:mM(c),c.flags&=-3,K0(c.alternate,c);break;case 4096:c.flags&=-4097;break;case 4100:c.flags&=-4097,K0(c.alternate,c);break;case 4:K0(c.alternate,c)}}catch(pt){zi(c,c.return,pt)}if(g=c.sibling,g!==null){g.return=c.return,je=g;break}je=c.return}}}function nI(l,c,g){je=l,vM(l)}function vM(l,c,g){for(var x=(l.mode&1)!==0;je!==null;){var E=je,b=E.child;if(E.tag===22&&x){var W=E.memoizedState!==null||Qh;if(!W){var re=E.alternate,ve=re!==null&&re.memoizedState!==null||ta;re=Qh;var ze=ta;if(Qh=W,(ta=ve)&&!ze)for(je=E;je!==null;)W=je,ve=W.child,W.tag===22&&W.memoizedState!==null?xM(E):ve!==null?(ve.return=W,je=ve):xM(E);for(;b!==null;)je=b,vM(b),b=b.sibling;je=E,Qh=re,ta=ze}yM(l)}else E.subtreeFlags&8772&&b!==null?(b.return=E,je=b):yM(l)}}function yM(l){for(;je!==null;){var c=je;if(c.flags&8772){var g=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:ta||su(5,c);break;case 1:var x=c.stateNode;if(c.flags&4&&!ta)if(g===null)x.componentDidMount();else{var E=c.elementType===c.type?g.memoizedProps:Nr(c.type,g.memoizedProps);x.componentDidUpdate(E,g.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var b=c.updateQueue;b!==null&&h1(c,b,x);break;case 3:var W=c.updateQueue;if(W!==null){if(g=null,c.child!==null)switch(c.child.tag){case 5:g=Q(c.child.stateNode);break;case 1:g=c.child.stateNode}h1(c,W,g)}break;case 5:var re=c.stateNode;g===null&&c.flags&4&&it(re,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(G&&c.memoizedState===null){var ve=c.alternate;if(ve!==null){var ze=ve.memoizedState;if(ze!==null){var ot=ze.dehydrated;ot!==null&&F(ot)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}ta||c.flags&512&&Y0(c)}catch(Tt){zi(c,c.return,Tt)}}if(c===l){je=null;break}if(g=c.sibling,g!==null){g.return=c.return,je=g;break}je=c.return}}function _M(l){for(;je!==null;){var c=je;if(c===l){je=null;break}var g=c.sibling;if(g!==null){g.return=c.return,je=g;break}je=c.return}}function xM(l){for(;je!==null;){var c=je;try{switch(c.tag){case 0:case 11:case 15:var g=c.return;try{su(4,c)}catch(ve){zi(c,g,ve)}break;case 1:var x=c.stateNode;if(typeof x.componentDidMount=="function"){var E=c.return;try{x.componentDidMount()}catch(ve){zi(c,E,ve)}}var b=c.return;try{Y0(c)}catch(ve){zi(c,b,ve)}break;case 5:var W=c.return;try{Y0(c)}catch(ve){zi(c,W,ve)}}}catch(ve){zi(c,c.return,ve)}if(c===l){je=null;break}var re=c.sibling;if(re!==null){re.return=c.return,je=re;break}je=c.return}}var ed=0,td=1,nd=2,id=3,rd=4;if(typeof Symbol=="function"&&Symbol.for){var ou=Symbol.for;ed=ou("selector.component"),td=ou("selector.has_pseudo_class"),nd=ou("selector.role"),id=ou("selector.test_id"),rd=ou("selector.text")}function Q0(l){var c=Oe(l);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(l=U(l),l===null)throw Error(o(362));return l.stateNode.current}function $0(l,c){switch(c.$$typeof){case ed:if(l.type===c.value)return!0;break;case td:e:{c=c.value,l=[l,0];for(var g=0;g<l.length;){var x=l[g++],E=l[g++],b=c[E];if(x.tag!==5||!Ee(x)){for(;b!=null&&$0(x,b);)E++,b=c[E];if(E===c.length){c=!0;break e}else for(x=x.child;x!==null;)l.push(x,E),x=x.sibling}}c=!1}return c;case nd:if(l.tag===5&&_e(l.stateNode,c.value))return!0;break;case rd:if((l.tag===5||l.tag===6)&&(l=Se(l),l!==null&&0<=l.indexOf(c.value)))return!0;break;case id:if(l.tag===5&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function J0(l){switch(l.$$typeof){case ed:return"<"+(L(l.value)||"Unknown")+">";case td:return":has("+(J0(l)||"")+")";case nd:return'[role="'+l.value+'"]';case rd:return'"'+l.value+'"';case id:return'[data-testname="'+l.value+'"]';default:throw Error(o(365))}}function SM(l,c){var g=[];l=[l,0];for(var x=0;x<l.length;){var E=l[x++],b=l[x++],W=c[b];if(E.tag!==5||!Ee(E)){for(;W!=null&&$0(E,W);)b++,W=c[b];if(b===c.length)g.push(E);else for(E=E.child;E!==null;)l.push(E,b),E=E.sibling}}return g}function ev(l,c){if(!V)throw Error(o(363));l=Q0(l),l=SM(l,c),c=[],l=Array.from(l);for(var g=0;g<l.length;){var x=l[g++];if(x.tag===5)Ee(x)||c.push(x.stateNode);else for(x=x.child;x!==null;)l.push(x),x=x.sibling}return c}var iI=Math.ceil,sd=a.ReactCurrentDispatcher,tv=a.ReactCurrentOwner,Cn=a.ReactCurrentBatchConfig,Ot=0,Nn=null,Dn=null,ii=0,Ji=0,_l=dt(0),zn=0,au=null,xl=0,od=0,nv=0,lu=null,Fi=null,iv=0,rv=1/0;function Sl(){rv=Yn()+500}var ad=!1,sv=null,no=null,ld=!1,io=null,cd=0,cu=0,ov=null,ud=-1,fd=0;function Mi(){return Ot&6?Yn():ud!==-1?ud:ud=Yn()}function ro(l){return l.mode&1?Ot&2&&ii!==0?ii&-ii:zP.transition!==null?(fd===0&&(l=Eh,Eh<<=1,!(Eh&4194240)&&(Eh=64),fd=l),fd):(l=Yt,l!==0?l:Ie()):1}function vr(l,c,g){if(50<cu)throw cu=0,ov=null,Error(o(185));var x=hd(l,c);return x===null?null:(jc(x,c,g),(!(Ot&2)||x!==Nn)&&(x===Nn&&(!(Ot&2)&&(od|=c),zn===4&&so(x,ii)),ki(x,g),c===1&&Ot===0&&!(l.mode&1)&&(Sl(),Rh&&rs())),x)}function hd(l,c){l.lanes|=c;var g=l.alternate;for(g!==null&&(g.lanes|=c),g=l,l=l.return;l!==null;)l.childLanes|=c,g=l.alternate,g!==null&&(g.childLanes|=c),g=l,l=l.return;return g.tag===3?g.stateNode:null}function ki(l,c){var g=l.callbackNode;PP(l,c);var x=Ah(l,l===Nn?ii:0);if(x===0)g!==null&&a1(g),l.callbackNode=null,l.callbackPriority=0;else if(c=x&-x,l.callbackPriority!==c){if(g!=null&&a1(g),c===1)l.tag===0?kP(wM.bind(null,l)):l1(wM.bind(null,l)),ft?Qe(function(){Ot===0&&rs()}):p0(m0,rs),g=null;else{switch(o1(x)){case 1:g=m0;break;case 4:g=DP;break;case 16:g=g0;break;case 536870912:g=UP;break;default:g=g0}g=LM(g,MM.bind(null,l))}l.callbackPriority=c,l.callbackNode=g}}function MM(l,c){if(ud=-1,fd=0,Ot&6)throw Error(o(327));var g=l.callbackNode;if(sa()&&l.callbackNode!==g)return null;var x=Ah(l,l===Nn?ii:0);if(x===0)return null;if(x&30||x&l.expiredLanes||c)c=dd(l,x);else{c=x;var E=Ot;Ot|=2;var b=AM();(Nn!==l||ii!==c)&&(Sl(),ia(l,c));do try{oI();break}catch(re){TM(l,re)}while(!0);_0(),sd.current=b,Ot=E,Dn!==null?c=0:(Nn=null,ii=0,c=zn)}if(c!==0){if(c===2&&(E=f0(l),E!==0&&(x=E,c=av(l,E))),c===1)throw g=au,ia(l,0),so(l,x),ki(l,Yn()),g;if(c===6)so(l,x);else{if(E=l.current.alternate,!(x&30)&&!rI(E)&&(c=dd(l,x),c===2&&(b=f0(l),b!==0&&(x=b,c=av(l,b))),c===1))throw g=au,ia(l,0),so(l,x),ki(l,Yn()),g;switch(l.finishedWork=E,l.finishedLanes=x,c){case 0:case 1:throw Error(o(345));case 2:ra(l,Fi);break;case 3:if(so(l,x),(x&130023424)===x&&(c=iv+500-Yn(),10<c)){if(Ah(l,0)!==0)break;if(E=l.suspendedLanes,(E&x)!==x){Mi(),l.pingedLanes|=l.suspendedLanes&E;break}l.timeoutHandle=Ce(ra.bind(null,l,Fi),c);break}ra(l,Fi);break;case 4:if(so(l,x),(x&4194240)===x)break;for(c=l.eventTimes,E=-1;0<x;){var W=31-tn(x);b=1<<W,W=c[W],W>E&&(E=W),x&=~b}if(x=E,x=Yn()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*iI(x/1960))-x,10<x){l.timeoutHandle=Ce(ra.bind(null,l,Fi),x);break}ra(l,Fi);break;case 5:ra(l,Fi);break;default:throw Error(o(329))}}}return ki(l,Yn()),l.callbackNode===g?MM.bind(null,l):null}function av(l,c){var g=lu;return l.current.memoizedState.isDehydrated&&(ia(l,c).flags|=256),l=dd(l,c),l!==2&&(c=Fi,Fi=g,c!==null&&lv(c)),l}function lv(l){Fi===null?Fi=l:Fi.push.apply(Fi,l)}function rI(l){for(var c=l;;){if(c.flags&16384){var g=c.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var x=0;x<g.length;x++){var E=g[x],b=E.getSnapshot;E=E.value;try{if(!is(b(),E))return!1}catch{return!1}}}if(g=c.child,c.subtreeFlags&16384&&g!==null)g.return=c,c=g;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function so(l,c){for(c&=~nv,c&=~od,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var g=31-tn(c),x=1<<g;l[g]=-1,c&=~x}}function wM(l){if(Ot&6)throw Error(o(327));sa();var c=Ah(l,0);if(!(c&1))return ki(l,Yn()),null;var g=dd(l,c);if(l.tag!==0&&g===2){var x=f0(l);x!==0&&(c=x,g=av(l,x))}if(g===1)throw g=au,ia(l,0),so(l,c),ki(l,Yn()),g;if(g===6)throw Error(o(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,ra(l,Fi),ki(l,Yn()),null}function EM(l){io!==null&&io.tag===0&&!(Ot&6)&&sa();var c=Ot;Ot|=1;var g=Cn.transition,x=Yt;try{if(Cn.transition=null,Yt=1,l)return l()}finally{Yt=x,Cn.transition=g,Ot=c,!(Ot&6)&&rs()}}function cv(){Ji=_l.current,ht(_l)}function ia(l,c){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==gt&&(l.timeoutHandle=gt,ct(g)),Dn!==null)for(g=Dn.return;g!==null;){var x=g;switch(A0(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Rn();break;case 3:vl(),ht(tt),ht(wt),N0();break;case 5:I0(x);break;case 4:vl();break;case 13:ht(gn);break;case 19:ht(gn);break;case 10:x0(x.type._context);break;case 22:case 23:cv()}g=g.return}if(Nn=l,Dn=l=oo(l.current,null),ii=Ji=c,zn=0,au=null,nv=od=xl=0,Fi=lu=null,ss!==null){for(c=0;c<ss.length;c++)if(g=ss[c],x=g.interleaved,x!==null){g.interleaved=null;var E=x.next,b=g.pending;if(b!==null){var W=b.next;b.next=E,x.next=W}g.pending=x}ss=null}return l}function TM(l,c){do{var g=Dn;try{if(_0(),zh.current=Xh,Bh){for(var x=wn.memoizedState;x!==null;){var E=x.queue;E!==null&&(E.pending=null),x=x.next}Bh=!1}if(yl=0,qn=li=wn=null,$c=!1,Jc=0,tv.current=null,g===null||g.return===null){zn=1,au=c,Dn=null;break}e:{var b=l,W=g.return,re=g,ve=c;if(c=ii,re.flags|=32768,ve!==null&&typeof ve=="object"&&typeof ve.then=="function"){var ze=ve,ot=re,Tt=ot.tag;if(!(ot.mode&1)&&(Tt===0||Tt===11||Tt===15)){var xt=ot.alternate;xt?(ot.updateQueue=xt.updateQueue,ot.memoizedState=xt.memoizedState,ot.lanes=xt.lanes):(ot.updateQueue=null,ot.memoizedState=null)}var rn=j1(W);if(rn!==null){rn.flags&=-257,Y1(rn,W,re,b,c),rn.mode&1&&X1(b,ze,c),c=rn,ve=ze;var vt=c.updateQueue;if(vt===null){var fi=new Set;fi.add(ve),c.updateQueue=fi}else vt.add(ve);break e}else{if(!(c&1)){X1(b,ze,c),uv();break e}ve=Error(o(426))}}else if(dn&&re.mode&1){var _r=j1(W);if(_r!==null){!(_r.flags&65536)&&(_r.flags|=256),Y1(_r,W,re,b,c),C0(ve);break e}}b=ve,zn!==4&&(zn=2),lu===null?lu=[b]:lu.push(b),ve=B0(ve,re),re=W;do{switch(re.tag){case 3:re.flags|=65536,c&=-c,re.lanes|=c;var he=V1(re,ve,c);f1(re,he);break e;case 1:b=ve;var se=re.type,ge=re.stateNode;if(!(re.flags&128)&&(typeof se.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(no===null||!no.has(ge)))){re.flags|=65536,c&=-c,re.lanes|=c;var Ke=W1(re,b,c);f1(re,Ke);break e}}re=re.return}while(re!==null)}RM(g)}catch(pt){c=pt,Dn===g&&g!==null&&(Dn=g=g.return);continue}break}while(!0)}function AM(){var l=sd.current;return sd.current=Xh,l===null?Xh:l}function uv(){(zn===0||zn===3||zn===2)&&(zn=4),Nn===null||!(xl&268435455)&&!(od&268435455)||so(Nn,ii)}function dd(l,c){var g=Ot;Ot|=2;var x=AM();Nn===l&&ii===c||ia(l,c);do try{sI();break}catch(E){TM(l,E)}while(!0);if(_0(),Ot=g,sd.current=x,Dn!==null)throw Error(o(261));return Nn=null,ii=0,zn}function sI(){for(;Dn!==null;)bM(Dn)}function oI(){for(;Dn!==null&&!LP();)bM(Dn)}function bM(l){var c=IM(l.alternate,l,Ji);l.memoizedProps=l.pendingProps,c===null?RM(l):Dn=c,tv.current=null}function RM(l){var c=l;do{var g=c.alternate;if(l=c.return,c.flags&32768){if(g=$P(g,c),g!==null){g.flags&=32767,Dn=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{zn=6,Dn=null;return}}else if(g=ZP(g,c,Ji),g!==null){Dn=g;return}if(c=c.sibling,c!==null){Dn=c;return}Dn=c=l}while(c!==null);zn===0&&(zn=5)}function ra(l,c){var g=Yt,x=Cn.transition;try{Cn.transition=null,Yt=1,aI(l,c,g)}finally{Cn.transition=x,Yt=g}return null}function aI(l,c,g){do sa();while(io!==null);if(Ot&6)throw Error(o(327));var x=l.finishedWork,E=l.finishedLanes;if(x===null)return null;if(l.finishedWork=null,l.finishedLanes=0,x===l.current)throw Error(o(177));l.callbackNode=null,l.callbackPriority=0;var b=x.lanes|x.childLanes;if(IP(l,b),l===Nn&&(Dn=Nn=null,ii=0),!(x.subtreeFlags&2064)&&!(x.flags&2064)||ld||(ld=!0,LM(g0,function(){return sa(),null})),b=(x.flags&15990)!==0,x.subtreeFlags&15990||b){b=Cn.transition,Cn.transition=null;var W=Yt;Yt=1;var re=Ot;Ot|=4,tv.current=null,eI(l,x),tI(l,x),$(l.containerInfo),l.current=x,nI(x),NP(),Ot=re,Yt=W,Cn.transition=b}else l.current=x;if(ld&&(ld=!1,io=l,cd=E),b=l.pendingLanes,b===0&&(no=null),OP(x.stateNode),ki(l,Yn()),c!==null)for(g=l.onRecoverableError,x=0;x<c.length;x++)g(c[x]);if(ad)throw ad=!1,l=sv,sv=null,l;return cd&1&&l.tag!==0&&sa(),b=l.pendingLanes,b&1?l===ov?cu++:(cu=0,ov=l):cu=0,rs(),null}function sa(){if(io!==null){var l=o1(cd),c=Cn.transition,g=Yt;try{if(Cn.transition=null,Yt=16>l?16:l,io===null)var x=!1;else{if(l=io,io=null,cd=0,Ot&6)throw Error(o(331));var E=Ot;for(Ot|=4,je=l.current;je!==null;){var b=je,W=b.child;if(je.flags&16){var re=b.deletions;if(re!==null){for(var ve=0;ve<re.length;ve++){var ze=re[ve];for(je=ze;je!==null;){var ot=je;switch(ot.tag){case 0:case 11:case 15:na(8,ot,b)}var Tt=ot.child;if(Tt!==null)Tt.return=ot,je=Tt;else for(;je!==null;){ot=je;var xt=ot.sibling,rn=ot.return;if(hM(ot),ot===ze){je=null;break}if(xt!==null){xt.return=rn,je=xt;break}je=rn}}}var vt=b.alternate;if(vt!==null){var fi=vt.child;if(fi!==null){vt.child=null;do{var _r=fi.sibling;fi.sibling=null,fi=_r}while(fi!==null)}}je=b}}if(b.subtreeFlags&2064&&W!==null)W.return=b,je=W;else e:for(;je!==null;){if(b=je,b.flags&2048)switch(b.tag){case 0:case 11:case 15:na(9,b,b.return)}var he=b.sibling;if(he!==null){he.return=b.return,je=he;break e}je=b.return}}var se=l.current;for(je=se;je!==null;){W=je;var ge=W.child;if(W.subtreeFlags&2064&&ge!==null)ge.return=W,je=ge;else e:for(W=se;je!==null;){if(re=je,re.flags&2048)try{switch(re.tag){case 0:case 11:case 15:su(9,re)}}catch(pt){zi(re,re.return,pt)}if(re===W){je=null;break e}var Ke=re.sibling;if(Ke!==null){Ke.return=re.return,je=Ke;break e}je=re.return}}if(Ot=E,rs(),ns&&typeof ns.onPostCommitFiberRoot=="function")try{ns.onPostCommitFiberRoot(bh,l)}catch{}x=!0}return x}finally{Yt=g,Cn.transition=c}}return!1}function CM(l,c,g){c=B0(g,c),c=V1(l,c,1),to(l,c),c=Mi(),l=hd(l,1),l!==null&&(jc(l,1,c),ki(l,c))}function zi(l,c,g){if(l.tag===3)CM(l,l,g);else for(;c!==null;){if(c.tag===3){CM(c,l,g);break}else if(c.tag===1){var x=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(no===null||!no.has(x))){l=B0(g,l),l=W1(c,l,1),to(c,l),l=Mi(),c=hd(c,1),c!==null&&(jc(c,1,l),ki(c,l));break}}c=c.return}}function lI(l,c,g){var x=l.pingCache;x!==null&&x.delete(c),c=Mi(),l.pingedLanes|=l.suspendedLanes&g,Nn===l&&(ii&g)===g&&(zn===4||zn===3&&(ii&130023424)===ii&&500>Yn()-iv?ia(l,0):nv|=g),ki(l,c)}function PM(l,c){c===0&&(l.mode&1?(c=Th,Th<<=1,!(Th&130023424)&&(Th=4194304)):c=1);var g=Mi();l=hd(l,c),l!==null&&(jc(l,c,g),ki(l,g))}function cI(l){var c=l.memoizedState,g=0;c!==null&&(g=c.retryLane),PM(l,g)}function uI(l,c){var g=0;switch(l.tag){case 13:var x=l.stateNode,E=l.memoizedState;E!==null&&(g=E.retryLane);break;case 19:x=l.stateNode;break;default:throw Error(o(314))}x!==null&&x.delete(c),PM(l,g)}var IM;IM=function(l,c,g){if(l!==null)if(l.memoizedProps!==c.pendingProps||tt.current)$i=!0;else{if(!(l.lanes&g)&&!(c.flags&128))return $i=!1,QP(l,c,g);$i=!!(l.flags&131072)}else $i=!1,dn&&c.flags&1048576&&v1(c,Oh,c.index);switch(c.lanes=0,c.tag){case 2:var x=c.type;l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),l=c.pendingProps;var E=mn(c,wt.current);fl(c,g),E=U0(null,c,x,l,E,g);var b=O0();return c.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Ht(x)?(b=!0,Vt(c)):b=!1,c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,M0(c),E.updater=Dh,c.stateNode=E,E._reactInternals=c,E0(c,x,l,g),c=V0(null,c,x,!0,b,g)):(c.tag=0,dn&&b&&T0(c),Si(null,c,E,g),c=c.child),c;case 16:x=c.elementType;e:{switch(l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),l=c.pendingProps,E=x._init,x=E(x._payload),c.type=x,E=c.tag=hI(x),l=Nr(x,l),E){case 0:c=G0(null,c,x,l,g);break e;case 1:c=tM(null,c,x,l,g);break e;case 11:c=K1(null,c,x,l,g);break e;case 14:c=Q1(null,c,x,Nr(x.type,l),g);break e}throw Error(o(306,x,""))}return c;case 0:return x=c.type,E=c.pendingProps,E=c.elementType===x?E:Nr(x,E),G0(l,c,x,E,g);case 1:return x=c.type,E=c.pendingProps,E=c.elementType===x?E:Nr(x,E),tM(l,c,x,E,g);case 3:e:{if(nM(c),l===null)throw Error(o(387));x=c.pendingProps,b=c.memoizedState,E=b.element,u1(l,c),Nh(c,x,null,g);var W=c.memoizedState;if(x=W.element,G&&b.isDehydrated)if(b={element:x,isDehydrated:!1,cache:W.cache,transitions:W.transitions},c.updateQueue.baseState=b,c.memoizedState=b,c.flags&256){E=Error(o(423)),c=iM(l,c,x,g,E);break e}else if(x!==E){E=Error(o(424)),c=iM(l,c,x,g,E);break e}else for(G&&(Qi=Es(c.stateNode.containerInfo),Ki=c,dn=!0,Dr=null,Yc=!1),g=w1(c,null,x,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(pl(),x===E){c=Ps(l,c,g);break e}Si(l,c,x,g)}c=c.child}return c;case 5:return E1(c),l===null&&R0(c),x=c.type,E=c.pendingProps,b=l!==null?l.memoizedProps:null,W=E.children,Me(x,E)?W=null:b!==null&&Me(x,b)&&(c.flags|=32),eM(l,c),Si(l,c,W,g),c.child;case 6:return l===null&&R0(c),null;case 13:return rM(l,c,g);case 4:return P0(c,c.stateNode.containerInfo),x=c.pendingProps,l===null?c.child=ml(c,null,x,g):Si(l,c,x,g),c.child;case 11:return x=c.type,E=c.pendingProps,E=c.elementType===x?E:Nr(x,E),K1(l,c,x,E,g);case 7:return Si(l,c,c.pendingProps,g),c.child;case 8:return Si(l,c,c.pendingProps.children,g),c.child;case 12:return Si(l,c,c.pendingProps.children,g),c.child;case 10:e:{if(x=c.type._context,E=c.pendingProps,b=c.memoizedProps,W=E.value,c1(c,x,W),b!==null)if(is(b.value,W)){if(b.children===E.children&&!tt.current){c=Ps(l,c,g);break e}}else for(b=c.child,b!==null&&(b.return=c);b!==null;){var re=b.dependencies;if(re!==null){W=b.child;for(var ve=re.firstContext;ve!==null;){if(ve.context===x){if(b.tag===1){ve=As(-1,g&-g),ve.tag=2;var ze=b.updateQueue;if(ze!==null){ze=ze.shared;var ot=ze.pending;ot===null?ve.next=ve:(ve.next=ot.next,ot.next=ve),ze.pending=ve}}b.lanes|=g,ve=b.alternate,ve!==null&&(ve.lanes|=g),S0(b.return,g,c),re.lanes|=g;break}ve=ve.next}}else if(b.tag===10)W=b.type===c.type?null:b.child;else if(b.tag===18){if(W=b.return,W===null)throw Error(o(341));W.lanes|=g,re=W.alternate,re!==null&&(re.lanes|=g),S0(W,g,c),W=b.sibling}else W=b.child;if(W!==null)W.return=b;else for(W=b;W!==null;){if(W===c){W=null;break}if(b=W.sibling,b!==null){b.return=W.return,W=b;break}W=W.return}b=W}Si(l,c,E.children,g),c=c.child}return c;case 9:return E=c.type,x=c.pendingProps.children,fl(c,g),E=hr(E),x=x(E),c.flags|=1,Si(l,c,x,g),c.child;case 14:return x=c.type,E=Nr(x,c.pendingProps),E=Nr(x.type,E),Q1(l,c,x,E,g);case 15:return $1(l,c,c.type,c.pendingProps,g);case 17:return x=c.type,E=c.pendingProps,E=c.elementType===x?E:Nr(x,E),l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),c.tag=1,Ht(x)?(l=!0,Vt(c)):l=!1,fl(c,g),m1(c,x,E),E0(c,x,E,g),V0(null,c,x,!0,l,g);case 19:return lM(l,c,g);case 22:return J1(l,c,g)}throw Error(o(156,c.tag))};function LM(l,c){return p0(l,c)}function fI(l,c,g,x){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yr(l,c,g,x){return new fI(l,c,g,x)}function fv(l){return l=l.prototype,!(!l||!l.isReactComponent)}function hI(l){if(typeof l=="function")return fv(l)?1:0;if(l!=null){if(l=l.$$typeof,l===w)return 11;if(l===S)return 14}return 2}function oo(l,c){var g=l.alternate;return g===null?(g=yr(l.tag,c,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=c,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,c=l.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function pd(l,c,g,x,E,b){var W=2;if(x=l,typeof l=="function")fv(l)&&(W=1);else if(typeof l=="string")W=5;else e:switch(l){case h:return oa(g.children,E,b,c);case d:W=8,E|=8;break;case p:return l=yr(12,g,c,E|2),l.elementType=p,l.lanes=b,l;case _:return l=yr(13,g,c,E),l.elementType=_,l.lanes=b,l;case v:return l=yr(19,g,c,E),l.elementType=v,l.lanes=b,l;case T:return md(g,E,b,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case m:W=10;break e;case y:W=9;break e;case w:W=11;break e;case S:W=14;break e;case M:W=16,x=null;break e}throw Error(o(130,l==null?l:typeof l,""))}return c=yr(W,g,c,E),c.elementType=l,c.type=x,c.lanes=b,c}function oa(l,c,g,x){return l=yr(7,l,x,c),l.lanes=g,l}function md(l,c,g,x){return l=yr(22,l,x,c),l.elementType=T,l.lanes=g,l.stateNode={},l}function hv(l,c,g){return l=yr(6,l,null,c),l.lanes=g,l}function dv(l,c,g){return c=yr(4,l.children!==null?l.children:[],l.key,c),c.lanes=g,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function dI(l,c,g,x,E){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=gt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=h0(0),this.expirationTimes=h0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=h0(0),this.identifierPrefix=x,this.onRecoverableError=E,G&&(this.mutableSourceEagerHydrationData=null)}function NM(l,c,g,x,E,b,W,re,ve){return l=new dI(l,c,g,re,ve),c===1?(c=1,b===!0&&(c|=8)):c=0,b=yr(3,null,null,c),l.current=b,b.stateNode=l,b.memoizedState={element:x,isDehydrated:g,cache:null,transitions:null},M0(b),l}function DM(l){if(!l)return Ue;l=l._reactInternals;e:{if(B(l)!==l||l.tag!==1)throw Error(o(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Ht(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(l.tag===1){var g=l.type;if(Ht(g))return en(l,g,c)}return c}function UM(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(o(188)):(l=Object.keys(l).join(","),Error(o(268,l)));return l=j(c),l===null?null:l.stateNode}function OM(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<c?g:c}}function pv(l,c){OM(l,c),(l=l.alternate)&&OM(l,c)}function pI(l){return l=j(l),l===null?null:l.stateNode}function mI(){return null}return t.attemptContinuousHydration=function(l){if(l.tag===13){var c=Mi();vr(l,134217728,c),pv(l,134217728)}},t.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var c=Mi(),g=ro(l);vr(l,g,c),pv(l,g)}},t.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var g=Xc(c.pendingLanes);g!==0&&(d0(c,g|1),ki(c,Yn()),!(Ot&6)&&(Sl(),rs()))}break;case 13:var x=Mi();EM(function(){return vr(l,1,x)}),pv(l,1)}},t.batchedUpdates=function(l,c){var g=Ot;Ot|=1;try{return l(c)}finally{Ot=g,Ot===0&&(Sl(),Rh&&rs())}},t.createComponentSelector=function(l){return{$$typeof:ed,value:l}},t.createContainer=function(l,c,g,x,E,b,W){return NM(l,c,!1,null,g,x,E,b,W)},t.createHasPseudoClassSelector=function(l){return{$$typeof:td,value:l}},t.createHydrationContainer=function(l,c,g,x,E,b,W,re,ve){return l=NM(g,x,!0,l,E,b,W,re,ve),l.context=DM(null),g=l.current,x=Mi(),E=ro(g),b=As(x,E),b.callback=c??null,to(g,b),l.current.lanes=E,jc(l,E,x),ki(l,x),l},t.createPortal=function(l,c,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:x==null?null:""+x,children:l,containerInfo:c,implementation:g}},t.createRoleSelector=function(l){return{$$typeof:nd,value:l}},t.createTestNameSelector=function(l){return{$$typeof:id,value:l}},t.createTextSelector=function(l){return{$$typeof:rd,value:l}},t.deferredUpdates=function(l){var c=Yt,g=Cn.transition;try{return Cn.transition=null,Yt=16,l()}finally{Yt=c,Cn.transition=g}},t.discreteUpdates=function(l,c,g,x,E){var b=Yt,W=Cn.transition;try{return Cn.transition=null,Yt=1,l(c,g,x,E)}finally{Yt=b,Cn.transition=W,Ot===0&&Sl()}},t.findAllNodes=ev,t.findBoundingRects=function(l,c){if(!V)throw Error(o(363));c=ev(l,c),l=[];for(var g=0;g<c.length;g++)l.push(ce(c[g]));for(c=l.length-1;0<c;c--){g=l[c];for(var x=g.x,E=x+g.width,b=g.y,W=b+g.height,re=c-1;0<=re;re--)if(c!==re){var ve=l[re],ze=ve.x,ot=ze+ve.width,Tt=ve.y,xt=Tt+ve.height;if(x>=ze&&b>=Tt&&E<=ot&&W<=xt){l.splice(c,1);break}else if(x!==ze||g.width!==ve.width||xt<b||Tt>W){if(!(b!==Tt||g.height!==ve.height||ot<x||ze>E)){ze>x&&(ve.width+=ze-x,ve.x=x),ot<E&&(ve.width=E-ze),l.splice(c,1);break}}else{Tt>b&&(ve.height+=Tt-b,ve.y=b),xt<W&&(ve.height=W-Tt),l.splice(c,1);break}}}return l},t.findHostInstance=UM,t.findHostInstanceWithNoPortals=function(l){return l=R(l),l=l!==null?Z(l):null,l===null?null:l.stateNode},t.findHostInstanceWithWarning=function(l){return UM(l)},t.flushControlled=function(l){var c=Ot;Ot|=1;var g=Cn.transition,x=Yt;try{Cn.transition=null,Yt=1,l()}finally{Yt=x,Cn.transition=g,Ot=c,Ot===0&&(Sl(),rs())}},t.flushPassiveEffects=sa,t.flushSync=EM,t.focusWithin=function(l,c){if(!V)throw Error(o(363));for(l=Q0(l),c=SM(l,c),c=Array.from(c),l=0;l<c.length;){var g=c[l++];if(!Ee(g)){if(g.tag===5&&at(g.stateNode))return!0;for(g=g.child;g!==null;)c.push(g),g=g.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Yt},t.getFindAllNodesFailureDescription=function(l,c){if(!V)throw Error(o(363));var g=0,x=[];l=[Q0(l),0];for(var E=0;E<l.length;){var b=l[E++],W=l[E++],re=c[W];if((b.tag!==5||!Ee(b))&&($0(b,re)&&(x.push(J0(re)),W++,W>g&&(g=W)),W<c.length))for(b=b.child;b!==null;)l.push(b,W),b=b.sibling}if(g<c.length){for(l=[];g<c.length;g++)l.push(J0(c[g]));return`findAllNodes was able to match part of the selector: 3909 `+(x.join(" > ")+` 3910 3911No matching component was found for: 3912 `)+l.join(" > ")}return null},t.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return Q(l.child.stateNode);default:return l.child.stateNode}},t.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:pI,findFiberByHostInstance:l.findFiberByHostInstance||mI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{bh=c.inject(l),ns=c}catch{}l=!!c.checkDCE}}return l},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(l,c,g,x){if(!V)throw Error(o(363));l=ev(l,c);var E=Ve(l,g,x).disconnect;return{disconnect:function(){E()}}},t.registerMutableSourceForHydration=function(l,c){var g=c._getVersion;g=g(c._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[c,g]:l.mutableSourceEagerHydrationData.push(c,g)},t.runWithPriority=function(l,c){var g=Yt;try{return Yt=l,c()}finally{Yt=g}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(l,c,g,x){var E=c.current,b=Mi(),W=ro(E);return g=DM(g),c.context===null?c.context=g:c.pendingContext=g,c=As(b,W),c.payload={element:l},x=x===void 0?null:x,x!==null&&(c.callback=x),to(E,c),l=vr(E,W,b),l!==null&&Lh(l,E,W),W},t};EC.exports=oB;var aB=EC.exports;const lB=_I(aB),WS={},bC=n=>void Object.assign(WS,n);function cB(n,e){function t(h,{args:d=[],attach:p,...m},y){let w=`${h[0].toUpperCase()}${h.slice(1)}`,_;if(h==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const v=m.object;_=Vl(v,{type:h,root:y,attach:p,primitive:!0})}else{const v=WS[w];if(!v)throw new Error(`R3F: ${w} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");_=Vl(new v(...d),{type:h,root:y,attach:p,memoizedProps:{args:d}})}return _.__r3f.attach===void 0&&(_.isBufferGeometry?_.__r3f.attach="geometry":_.isMaterial&&(_.__r3f.attach="material")),w!=="inject"&&Ly(_,m),_}function i(h,d){let p=!1;if(d){var m,y;(m=d.__r3f)!=null&&m.attach?Iy(h,d,d.__r3f.attach):d.isObject3D&&h.isObject3D&&(h.add(d),p=!0),p||(y=h.__r3f)==null||y.objects.push(d),d.__r3f||Vl(d,{}),d.__r3f.parent=h,ex(d),Wl(d)}}function r(h,d,p){let m=!1;if(d){var y,w;if((y=d.__r3f)!=null&&y.attach)Iy(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"}),h.dispatchEvent({type:"childadded",child:d});const _=h.children.filter(S=>S!==d),v=_.indexOf(p);h.children=[..._.slice(0,v),d,..._.slice(v)],m=!0}m||(w=h.__r3f)==null||w.objects.push(d),d.__r3f||Vl(d,{}),d.__r3f.parent=h,ex(d),Wl(d)}}function s(h,d,p=!1){h&&[...h].forEach(m=>o(d,m,p))}function o(h,d,p){if(d){var m,y,w;if(d.__r3f&&(d.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(T=>T!==d)),(y=d.__r3f)!=null&&y.attach)RT(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var _;h.remove(d),(_=d.__r3f)!=null&&_.root&&gB(Vp(d),d)}const S=(w=d.__r3f)==null?void 0:w.primitive,M=!S&&(p===void 0?d.dispose!==null:p);if(!S){var v;s((v=d.__r3f)==null?void 0:v.objects,d,M),s(d.children,d,M)}if(delete d.__r3f,M&&d.dispose&&d.type!=="Scene"){const T=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?$_.unstable_scheduleCallback($_.unstable_IdlePriority,T):T()}Wl(h)}}function a(h,d,p,m){var y;const w=(y=h.__r3f)==null?void 0:y.parent;if(!w)return;const _=t(d,p,h.__r3f.root);if(h.children){for(const v of h.children)v.__r3f&&i(_,v);h.children=h.children.filter(v=>!v.__r3f)}h.__r3f.objects.forEach(v=>i(_,v)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||o(w,h),_.parent&&(_.__r3f.autoRemovedBeforeAppend=!0),i(w,_),_.raycast&&_.__r3f.eventCount&&Vp(_).getState().internal.interaction.push(_),[m,m.alternate].forEach(v=>{v!==null&&(v.stateNode=_,v.ref&&(typeof v.ref=="function"?v.ref(_):v.ref.current=_))})}const u=()=>{};return{reconciler:lB({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,d)=>{if(!d)return;const p=h.getState().scene;p.__r3f&&(p.__r3f.root=h,i(p,d))},removeChildFromContainer:(h,d)=>{d&&o(h.getState().scene,d)},insertInContainerBefore:(h,d,p)=>{if(!d||!p)return;const m=h.getState().scene;m.__r3f&&r(m,d,p)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var d;return!!((d=h==null?void 0:h.__r3f)!=null?d:{}).handlers},prepareUpdate(h,d,p,m){var y;if(((y=h==null?void 0:h.__r3f)!=null?y:{}).primitive&&m.object&&m.object!==h)return[!0];{const{args:_=[],children:v,...S}=m,{args:M=[],children:T,...I}=p;if(!Array.isArray(_))throw new Error("R3F: the args prop must be an array!");if(_.some((L,N)=>L!==M[N]))return[!0];const C=DC(h,S,I,!0);return C.changes.length?[!1,C]:null}},commitUpdate(h,[d,p],m,y,w,_){d?a(h,m,w,_):Ly(h,p)},commitMount(h,d,p,m){var y;const w=(y=h.__r3f)!=null?y:{};h.raycast&&w.handlers&&w.eventCount&&Vp(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>Vl(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:p,parent:m}=(d=h.__r3f)!=null?d:{};p&&m&&RT(m,h,p),h.isObject3D&&(h.visible=!1),Wl(h)},unhideInstance(h,d){var p;const{attach:m,parent:y}=(p=h.__r3f)!=null?p:{};m&&y&&Iy(y,h,m),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),Wl(h)},createTextInstance:u,hideTextInstance:u,unhideTextInstance:u,getCurrentEventPriority:()=>e?e():lc.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&on.fun(performance.now)?performance.now:on.fun(Date.now)?Date.now:()=>0,scheduleTimeout:on.fun(setTimeout)?setTimeout:void 0,cancelTimeout:on.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Ly}}var ET,TT;const Py=n=>"colorSpace"in n||"outputColorSpace"in n,RC=()=>{var n;return(n=WS.ColorManagement)!=null?n:null},CC=n=>n&&n.isOrthographicCamera,uB=n=>n&&n.hasOwnProperty("current"),vh=typeof window<"u"&&((ET=window.document)!=null&&ET.createElement||((TT=window.navigator)==null?void 0:TT.product)==="ReactNative")?ee.useLayoutEffect:ee.useEffect;function PC(n){const e=ee.useRef(n);return vh(()=>void(e.current=n),[n]),e}function fB({set:n}){return vh(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class IC extends ee.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}IC.getDerivedStateFromError=()=>({error:!0});const LC="__default",AT=new Map,hB=n=>n&&!!n.memoized&&!!n.changes;function NC(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 Iu=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Vp(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const on={obj:n=>n===Object(n)&&!on.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(on.str(n)||on.num(n)||on.boo(n))return n===e;const s=on.obj(n);if(s&&i==="reference")return n===e;const o=on.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(!on.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(on.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 dB(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 pB(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Vl(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function J_(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const bT=/-\d+$/;function Iy(n,e,t){if(on.str(t)){if(bT.test(t)){const s=t.replace(bT,""),{target:o,key:a}=J_(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=J_(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function RT(n,e,t){var i,r;if(on.str(t)){const{target:s,key:o}=J_(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function DC(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...u}={},f=!1){const h=n.__r3f,d=Object.entries(r),p=[];if(f){const y=Object.keys(u);for(let w=0;w<y.length;w++)r.hasOwnProperty(y[w])||d.unshift([y[w],LC+"remove"])}d.forEach(([y,w])=>{var _;if((_=n.__r3f)!=null&&_.primitive&&y==="object"||on.equ(w,u[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return p.push([y,w,!0,[]]);let v=[];y.includes("-")&&(v=y.split("-")),p.push([y,w,!1,v]);for(const S in r){const M=r[S];S.startsWith(`${y}-`)&&p.push([S,M,!1,S.split("-")])}});const m={...r};return h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.args&&(m.args=h.memoizedProps.args),h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.attach&&(m.attach=h.memoizedProps.attach),{memoized:m,changes:p}}function Ly(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}=hB(e)?e:DC(n,e),u=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let p=0;p<a.length;p++){let[m,y,w,_]=a[p];if(Py(n)){const T="srgb",I="srgb-linear";m==="encoding"?(m="colorSpace",y=y===3001?T:I):m==="outputEncoding"&&(m="outputColorSpace",y=y===3001?T:I)}let v=n,S=v[m];if(_.length&&(S=_.reduce((M,T)=>M[T],n),!(S&&S.set))){const[M,...T]=_.reverse();v=T.reverse().reduce((I,C)=>I[C],n),m=M}if(y===LC+"remove")if(v.constructor){let M=AT.get(v.constructor);M||(M=new v.constructor,AT.set(v.constructor,M)),y=M[m]}else y=0;if(w&&i)y?i.handlers[m]=y:delete i.handlers[m],i.eventCount=Object.keys(i.handlers).length;else if(S&&S.set&&(S.copy||S instanceof za)){if(Array.isArray(y))S.fromArray?S.fromArray(y):S.set(...y);else if(S.copy&&y&&y.constructor&&S.constructor===y.constructor)S.copy(y);else if(y!==void 0){var f;const M=(f=S)==null?void 0:f.isColor;!M&&S.setScalar?S.setScalar(y):S instanceof za&&y instanceof za?S.mask=y.mask:S.set(y),!RC()&&s&&!s.linear&&M&&S.convertSRGBToLinear()}}else{var h;if(v[m]=y,(h=v[m])!=null&&h.isTexture&&v[m].format===Ln&&v[m].type===Yi&&s){const M=v[m];Py(M)&&Py(s.gl)?M.colorSpace=s.gl.outputColorSpace:M.encoding=s.gl.outputEncoding}}Wl(n)}if(i&&i.parent&&n.raycast&&u!==i.eventCount){const p=Vp(n).getState().internal,m=p.interaction.indexOf(n);m>-1&&p.interaction.splice(m,1),i.eventCount&&p.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&ex(n),n}function Wl(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 ex(n){n.onUpdate==null||n.onUpdate(n)}function UC(n,e){n.manual||(CC(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 Ep(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function mB(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return lc.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return lc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return lc.ContinuousEventPriority;default:return lc.DefaultEventPriority}}function OC(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function gB(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)=>{OC(t.capturedMap,e,i,r)})}function vB(n){function e(u){const{internal:f}=n.getState(),h=u.offsetX-f.initialClick[0],d=u.offsetY-f.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(u){return u.filter(f=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=f.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(u,f){const h=n.getState(),d=new Set,p=[],m=f?f(h.internal.interaction):h.internal.interaction;for(let v=0;v<m.length;v++){const S=Iu(m[v]);S&&(S.raycaster.camera=void 0)}h.previousRoot||h.events.compute==null||h.events.compute(u,h);function y(v){const S=Iu(v);if(!S||!S.events.enabled||S.raycaster.camera===null)return[];if(S.raycaster.camera===void 0){var M;S.events.compute==null||S.events.compute(u,S,(M=S.previousRoot)==null?void 0:M.getState()),S.raycaster.camera===void 0&&(S.raycaster.camera=null)}return S.raycaster.camera?S.raycaster.intersectObject(v,!0):[]}let w=m.flatMap(y).sort((v,S)=>{const M=Iu(v.object),T=Iu(S.object);return!M||!T?v.distance-S.distance:T.events.priority-M.events.priority||v.distance-S.distance}).filter(v=>{const S=Ep(v);return d.has(S)?!1:(d.add(S),!0)});h.events.filter&&(w=h.events.filter(w,h));for(const v of w){let S=v.object;for(;S;){var _;(_=S.__r3f)!=null&&_.eventCount&&p.push({...v,eventObject:S}),S=S.parent}}if("pointerId"in u&&h.internal.capturedMap.has(u.pointerId))for(let v of h.internal.capturedMap.get(u.pointerId).values())d.has(Ep(v.intersection))||p.push(v.intersection);return p}function r(u,f,h,d){const p=n.getState();if(u.length){const m={stopped:!1};for(const y of u){const w=Iu(y.object)||p,{raycaster:_,pointer:v,camera:S,internal:M}=w,T=new k(v.x,v.y,0).unproject(S),I=A=>{var R,j;return(R=(j=M.capturedMap.get(A))==null?void 0:j.has(y.eventObject))!=null?R:!1},C=A=>{const R={intersection:y,target:f.target};M.capturedMap.has(A)?M.capturedMap.get(A).set(y.eventObject,R):M.capturedMap.set(A,new Map([[y.eventObject,R]])),f.target.setPointerCapture(A)},L=A=>{const R=M.capturedMap.get(A);R&&OC(M.capturedMap,y.eventObject,R,A)};let N={};for(let A in f){let R=f[A];typeof R!="function"&&(N[A]=R)}let B={...y,...N,pointer:v,intersections:u,stopped:m.stopped,delta:h,unprojectedPoint:T,ray:_.ray,camera:S,stopPropagation(){const A="pointerId"in f&&M.capturedMap.get(f.pointerId);if((!A||A.has(y.eventObject))&&(B.stopped=m.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(R=>R.eventObject===y.eventObject))){const R=u.slice(0,u.indexOf(y));s([...R,y])}},target:{hasPointerCapture:I,setPointerCapture:C,releasePointerCapture:L},currentTarget:{hasPointerCapture:I,setPointerCapture:C,releasePointerCapture:L},nativeEvent:f};if(d(B),m.stopped===!0)break}}return u}function s(u){const{internal:f}=n.getState();for(const h of f.hovered.values())if(!u.length||!u.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f,m=p==null?void 0:p.handlers;if(f.hovered.delete(Ep(h)),p!=null&&p.eventCount){const y={...h,intersections:u};m.onPointerOut==null||m.onPointerOut(y),m.onPointerLeave==null||m.onPointerLeave(y)}}}function o(u,f){for(let h=0;h<f.length;h++){const d=f[h].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(u)}}function a(u){switch(u){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return f=>{const{internal:h}=n.getState();"pointerId"in f&&h.capturedMap.has(f.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(f.pointerId)&&(h.capturedMap.delete(f.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=h;const m=u==="onPointerMove",y=u==="onClick"||u==="onContextMenu"||u==="onDoubleClick",_=i(h,m?t:void 0),v=y?e(h):0;u==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=_.map(M=>M.eventObject)),y&&!_.length&&v<=2&&(o(h,p.interaction),d&&d(h)),m&&s(_);function S(M){const T=M.eventObject,I=T.__r3f,C=I==null?void 0:I.handlers;if(I!=null&&I.eventCount)if(m){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){const L=Ep(M),N=p.hovered.get(L);N?N.stopped&&M.stopPropagation():(p.hovered.set(L,M),C.onPointerOver==null||C.onPointerOver(M),C.onPointerEnter==null||C.onPointerEnter(M))}C.onPointerMove==null||C.onPointerMove(M)}else{const L=C[u];L?(!y||p.initialHits.includes(T))&&(o(h,p.interaction.filter(N=>!p.initialHits.includes(N))),L(M)):y&&p.initialHits.includes(T)&&o(h,p.interaction.filter(N=>!p.initialHits.includes(N)))}}r(_,h,v,S)}}return{handlePointer:a}}const yB=["set","get","setSize","setFrameloop","setDpr","events","invali
3912date","advance","size","viewport"],FC=n=>!!(n!=null&&n.render),XS=ee.createContext(null),_B=(n,e)=>{const t=SC((a,u)=>{const f=new k,h=new k,d=new k;function p(v=u().camera,S=h,M=u().size){const{width:T,height:I,top:C,left:L}=M,N=T/I;S.isVector3?d.copy(S):d.set(...S);const B=v.getWorldPosition(f).distanceTo(d);if(CC(v))return{width:T/v.zoom,height:I/v.zoom,top:C,left:L,factor:1,distance:B,aspect:N};{const A=v.fov*Math.PI/180,R=2*Math.tan(A/2)*B,j=R*(T/I);return{width:j,height:R,top:C,left:L,factor:T/j,distance:B,aspect:N}}}let m;const y=v=>a(S=>({performance:{...S.performance,current:v}})),w=new be;return{set:a,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(v=1)=>n(u(),v),advance:(v,S)=>e(v,S,u()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new kS,pointer:w,mouse:w,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const v=u();m&&clearTimeout(m),v.performance.current!==v.performance.min&&y(v.performance.min),m=setTimeout(()=>y(u().performance.max),v.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:v=>a(S=>({...S,events:{...S.events,...v}})),setSize:(v,S,M,T,I)=>{const C=u().camera,L={width:v,height:S,top:T||0,left:I||0,updateStyle:M};a(N=>({size:L,viewport:{...N.viewport,...p(C,h,L)}}))},setDpr:v=>a(S=>{const M=NC(v);return{viewport:{...S.viewport,dpr:M,initialDpr:S.viewport.initialDpr||M}}}),setFrameloop:(v="always")=>{const S=u().clock;S.stop(),S.elapsedTime=0,v!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:v}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:ee.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(v,S,M)=>{const T=u().internal;return T.priority=T.priority+(S>0?1:0),T.subscribers.push({ref:v,priority:S,store:M}),T.subscribers=T.subscribers.sort((I,C)=>I.priority-C.priority),()=>{const I=u().internal;I!=null&&I.subscribers&&(I.priority=I.priority-(S>0?1:0),I.subscribers=I.subscribers.filter(C=>C.ref!==v))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:u,viewport:f,gl:h,set:d}=t.getState();if(u.width!==r.width||u.height!==r.height||f.dpr!==s){var p;r=u,s=f.dpr,UC(a,u),h.setPixelRatio(f.dpr);const m=(p=u.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(u.width,u.height,m)}a!==o&&(o=a,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Tp,xB=new Set,SB=new Set,MB=new Set;function Ny(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Lu(n,e){switch(n){case"before":return Ny(xB,e);case"after":return Ny(SB,e);case"tail":return Ny(MB,e)}}let Dy,Uy;function Oy(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Dy=e.internal.subscribers,Tp=0;Tp<Dy.length;Tp++)Uy=Dy[Tp],Uy.ref.current(Uy.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 wB(n){let e=!1,t=!1,i,r,s;function o(f){r=requestAnimationFrame(o),e=!0,i=0,Lu("before",f),t=!0;for(const d of n.values()){var h;s=d.store.getState(),s.internal.active&&(s.frameloop==="always"||s.internal.frames>0)&&!((h=s.gl.xr)!=null&&h.isPresenting)&&(i+=Oy(f,s))}if(t=!1,Lu("after",f),i===0)return Lu("tail",f),e=!1,cancelAnimationFrame(r)}function a(f,h=1){var d;if(!f)return n.forEach(p=>a(p.store.getState(),h));(d=f.gl.xr)!=null&&d.isPresenting||!f.internal.active||f.frameloop==="never"||(h>1?f.internal.frames=Math.min(60,f.internal.frames+h):t?f.internal.frames=2:f.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function u(f,h=!0,d,p){if(h&&Lu("before",f),d)Oy(f,d,p);else for(const m of n.values())Oy(f,m.store.getState());h&&Lu("after",f)}return{loop:o,invalidate:a,advance:u}}function jS(){const n=ee.useContext(XS);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Cc(n=t=>t,e){return jS()(n,e)}function Qr(n,e=0){const t=jS(),i=t.getState().internal.subscribe,r=PC(n);return vh(()=>i(r,e,t),[e,i,t]),null}const CT=new WeakMap;function kC(n,e){return function(t,...i){let r=CT.get(t);return r||(r=new t,CT.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,u=>{u.scene&&Object.assign(u,dB(u.scene)),o(u)},e,u=>a(new Error(`Could not load ${s}: ${u==null?void 0:u.message}`))))))}}function Pc(n,e,t,i){const r=Array.isArray(e)?e:[e],s=iB(kC(t,i),[n,...r],{equal:on.equ});
vendor: 44,781 bytes, lines 3912-3997
3912return Array.isArray(e)?s:s[0]}Pc.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return rB(kC(t),[n,...i])};Pc.clear=function(n,e){const t=Array.isArray(e)?e:[e];return sB([n,...t])};const Ic=new Map,{invalidate:PT,advance:IT}=wB(Ic),{reconciler:jf,applyProps:Mo}=cB(Ic,mB),Hl={objects:"shallow",strict:!1},EB=(n,e)=>{const t=typeof n=="function"?n(e):n;return FC(t)?t:new SS({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function TB(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 AB(n){const e=Ic.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||_B(PT,IT),o=t||jf.createContainer(s,lc.ConcurrentRoot,null,!1,null,"",r,null);e||Ic.set(n,{fiber:o,store:s});let a,u=!1,f;return{configure(h={}){let{gl:d,size:p,scene:m,events:y,onCreated:w,shadows:_=!1,linear:v=!1,flat:S=!1,legacy:M=!1,orthographic:T=!1,frameloop:I="always",dpr:C=[1,2],performance:L,raycaster:N,camera:B,onPointerMissed:A}=h,R=s.getState(),j=R.gl;R.gl||R.set({gl:j=EB(d,n)});let Y=R.raycaster;Y||R.set({raycaster:Y=new GS});const{params:Z,...ae}=N||{};if(on.equ(ae,Y,Hl)||Mo(Y,{...ae}),on.equ(Z,Y.params,Hl)||Mo(Y,{params:{...Y.params,...Z}}),!R.camera||R.camera===f&&!on.equ(f,B,Hl)){f=B;const $=B instanceof ah,le=$?B:T?new Bc(0,0,0,0,.1,1e3):new $n(75,0,.1,1e3);$||(le.position.z=5,B&&(Mo(le,B),("aspect"in B||"left"in B||"right"in B||"bottom"in B||"top"in B)&&(le.manual=!0,le.updateProjectionMatrix())),!R.camera&&!(B!=null&&B.rotation)&&le.lookAt(0,0,0)),R.set({camera:le}),Y.camera=le}if(!R.scene){let $;m!=null&&m.isScene?$=m:($=new uh,m&&Mo($,m)),R.set({scene:Vl($)})}if(!R.xr){var Q;const $=(De,ue)=>{const Me=s.getState();Me.frameloop!=="never"&&IT(De,!0,Me,ue)},le=()=>{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||PT(De)},ye={connect(){const De=s.getState().gl;De.xr.addEventListener("sessionstart",le),De.xr.addEventListener("sessionend",le)},disconnect(){const De=s.getState().gl;De.xr.removeEventListener("sessionstart",le),De.xr.removeEventListener("sessionend",le)}};typeof((Q=j.xr)==null?void 0:Q.addEventListener)=="function"&&ye.connect(),R.set({xr:ye})}if(j.shadowMap){const $=j.shadowMap.enabled,le=j.shadowMap.type;if(j.shadowMap.enabled=!!_,on.boo(_))j.shadowMap.type=Qu;else if(on.str(_)){var pe;const ye={basic:Tb,percentage:wg,soft:Qu,variance:Hr};j.shadowMap.type=(pe=ye[_])!=null?pe:Qu}else on.obj(_)&&Object.assign(j.shadowMap,_);($!==j.shadowMap.enabled||le!==j.shadowMap.type)&&(j.shadowMap.needsUpdate=!0)}const z=RC();z&&("enabled"in z?z.enabled=!M:"legacyMode"in z&&(z.legacyMode=M)),u||Mo(j,{outputEncoding:v?3e3:3001,toneMapping:S?vs:nh}),R.legacy!==M&&R.set(()=>({legacy:M})),R.linear!==v&&R.set(()=>({linear:v})),R.flat!==S&&R.set(()=>({flat:S})),d&&!on.fun(d)&&!FC(d)&&!on.equ(d,j,Hl)&&Mo(j,d),y&&!R.events.handlers&&R.set({events:y(s)});const ie=TB(n,p);return on.equ(ie,R.size,Hl)||R.setSize(ie.width,ie.height,ie.updateStyle,ie.top,ie.left),C&&R.viewport.dpr!==NC(C)&&R.setDpr(C),R.frameloop!==I&&R.setFrameloop(I),R.onPointerMissed||R.set({onPointerMissed:A}),L&&!on.equ(L,R.performance,Hl)&&R.set($=>({performance:{...$.performance,...L}})),a=w,u=!0,this},render(h){return u||this.configure(),jf.updateContainer(H.jsx(bB,{store:s,children:h,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){zC(n)}}}function bB({store:n,children:e,onCreated:t,rootElement:i}){return vh(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),H.jsx(XS.Provider,{value:n,children:e})}function zC(n,e){const t=Ic.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),jf.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,u;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(u=r.gl)!=null&&u.xr&&r.xr.disconnect(),pB(r),Ic.delete(n)}catch{}},500)})}}function RB(n,e,t){return H.jsx(CB,{children:n,container:e,state:t},e.uuid)}function CB({state:n={},children:e,container:t}){const{events:i,size:r,...s}=n,o=jS(),[a]=ee.useState(()=>new GS),[u]=ee.useState(()=>new be),f=ee.useCallback((d,p)=>{const m={...d};Object.keys(d).forEach(w=>{(yB.includes(w)||d[w]!==p[w]&&p[w])&&delete m[w]});let y;if(p&&r){const w=p.camera;y=d.viewport.getCurrentViewport(w,new k,r),w!==d.camera&&UC(w,r)}return{...m,scene:t,raycaster:a,pointer:u,mouse:u,previousRoot:o,events:{...d.events,...p==null?void 0:p.events,...i},size:{...d.size,...r},viewport:{...d.viewport,...y},...s}},[n]),[h]=ee.useState(()=>{const d=o.getState();return SC((m,y)=>({...d,scene:t,raycaster:a,pointer:u,mouse:u,previousRoot:o,events:{...d.events,...i},size:{...d.size,...r},...s,set:m,get:y,setEvents:w=>m(_=>({..._,events:{..._.events,...w}}))}))});return ee.useEffect(()=>{const d=o.subscribe(p=>h.setState(m=>f(p,m)));return()=>{d()}},[f]),ee.useEffect(()=>{h.setState(d=>f(o.getState(),d))},[f]),ee.useEffect(()=>()=>{h.destroy()},[]),H.jsx(H.Fragment,{children:jf.createPortal(H.jsx(XS.Provider,{value:h,children:e}),h,null)})}jf.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:ee.version});const Fy={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 PB(n){const{handlePointer:e}=vB(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(Fy).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[u,f]=Fy[o];t.addEventListener(u,a,{passive:f})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=Fy[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function LT(n,e){let t;return(...i)=>{window.clearTimeout(t),t=window.setTimeout(()=>n(...i),e)}}function IB({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=ee.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=ee.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),u=n?typeof n=="number"?n:n.scroll:null,f=n?typeof n=="number"?n:n.resize:null,h=ee.useRef(!1);ee.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[d,p,m]=ee.useMemo(()=>{const v=()=>{if(!a.current.element)return;const{left:S,top:M,width:T,height:I,bottom:C,right:L,x:N,y:B}=a.current.element.getBoundingClientRect(),A={left:S,top:M,width:T,height:I,bottom:C,right:L,x:N,y:B};a.current.element instanceof HTMLElement&&i&&(A.height=a.current.element.offsetHeight,A.width=a.current.element.offsetWidth),Object.freeze(A),h.current&&!UB(a.current.lastBounds,A)&&o(a.current.lastBounds=A)};return[v,f?LT(v,f):v,u?LT(v,u):v]},[o,i,u,f]);function y(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(v=>v.removeEventListener("scroll",m,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function w(){a.current.element&&(a.current.resizeObserver=new r(m),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(v=>v.addEventListener("scroll",m,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const _=v=>{!v||v===a.current.element||(y(),a.current.element=v,a.current.scrollContainers=BC(v),w())};return NB(m,!!e),LB(p),ee.useEffect(()=>{y(),w()},[e,m,p]),ee.useEffect(()=>y,[]),[_,s,d]}function LB(n){ee.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function NB(n,e){ee.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function BC(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,...BC(n.parentElement)]}const DB=["x","y","top","bottom","left","right","width","height"],UB=(n,e)=>DB.every(t=>n[t]===e[t]);var OB=Object.defineProperty,FB=Object.defineProperties,kB=Object.getOwnPropertyDescriptors,NT=Object.getOwnPropertySymbols,zB=Object.prototype.hasOwnProperty,BB=Object.prototype.propertyIsEnumerable,DT=(n,e,t)=>e in n?OB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,UT=(n,e)=>{for(var t in e||(e={}))zB.call(e,t)&&DT(n,t,e[t]);if(NT)for(var t of NT(e))BB.call(e,t)&&DT(n,t,e[t]);return n},HB=(n,e)=>FB(n,kB(e)),OT,FT;typeof window<"u"&&((OT=window.document)!=null&&OT.createElement||((FT=window.navigator)==null?void 0:FT.product)==="ReactNative")?ee.useLayoutEffect:ee.useEffect;function HC(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=HC(i,e,t);if(r)return r;i=i.sibling}}function GC(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const kT=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=kT;return}return kT.apply(this,arguments)};const YS=GC(ee.createContext(null));class VC extends ee.Component{render(){return ee.createElement(YS.Provider,{value:this._reactInternals},this.props.children)}}function GB(){const n=ee.useContext(YS);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=ee.useId();return ee.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=HC(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 VB(){const n=GB(),[e]=ee.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!==YS&&!e.has(r)&&e.set(r,ee.useContext(GC(r)))}t=t.return}return e}function WB(){const n=VB();return ee.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>ee.createElement(e,null,ee.createElement(t.Provider,HB(UT({},i),{value:n.get(t)}))),e=>ee.createElement(VC,UT({},e))),[n])}const XB=ee.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=PB,eventSource:a,eventPrefix:u,shadows:f,linear:h,flat:d,legacy:p,orthographic:m,frameloop:y,dpr:w,performance:_,raycaster:v,camera:S,scene:M,onPointerMissed:T,onCreated:I,...C},L){ee.useMemo(()=>bC(Jz),[]);const N=WB(),[B,A]=IB({scroll:!0,debounce:{scroll:50,resize:0},...i}),R=ee.useRef(null),j=ee.useRef(null);ee.useImperativeHandle(L,()=>R.current);const Y=PC(T),[Z,ae]=ee.useState(!1),[Q,pe]=ee.useState(!1);if(Z)throw Z;if(Q)throw Q;const z=ee.useRef(null);vh(()=>{const $=R.current;A.width>0&&A.height>0&&$&&(z.current||(z.current=AB($)),z.current.configure({gl:s,events:o,shadows:f,linear:h,flat:d,legacy:p,orthographic:m,frameloop:y,dpr:w,performance:_,raycaster:v,camera:S,scene:M,size:A,onPointerMissed:(...le)=>Y.current==null?void 0:Y.current(...le),onCreated:le=>{le.events.connect==null||le.events.connect(a?uB(a)?a.current:a:j.current),u&&le.setEvents({compute:(ye,De)=>{const ue=ye[u+"X"],Me=ye[u+"Y"];De.pointer.set(ue/De.size.width*2-1,-(Me/De.size.height)*2+1),De.raycaster.setFromCamera(De.pointer,De.camera)}}),I==null||I(le)}}),z.current.render(H.jsx(N,{children:H.jsx(IC,{set:pe,children:H.jsx(ee.Suspense,{fallback:H.jsx(fB,{set:ae}),children:e??null})})})))}),ee.useEffect(()=>{const $=R.current;if($)return()=>zC($)},[]);const ie=a?"none":"auto";return H.jsx("div",{ref:j,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:ie,...r},...C,children:H.jsx("div",{ref:B,style:{width:"100%",height:"100%"},children:H.jsx("canvas",{ref:R,style:{display:"block"},children:t})})})}),WC=ee.forwardRef(function(e,t){return H.jsx(VC,{children:H.jsx(XB,{...e,ref:t})})});function tx(){return tx=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},tx.apply(null,arguments)}const XC=parseInt(eh.replace(/\D+/g,""));var Er=Uint8Array,Ro=Uint16Array,nx=Uint32Array,jC=new Er([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),YC=new Er([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jB=new Er([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qC=function(n,e){for(var t=new Ro(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];for(var r=new nx(t[30]),i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},ZC=qC(jC,2),KC=ZC[0],YB=ZC[1];KC[28]=258,YB[258]=28;var qB=qC(YC,0),ZB=qB[0],ix=new Ro(32768);for(var fn=0;fn<32768;++fn){var yo=(fn&43690)>>>1|(fn&21845)<<1;yo=(yo&52428)>>>2|(yo&13107)<<2,yo=(yo&61680)>>>4|(yo&3855)<<4,ix[fn]=((yo&65280)>>>8|(yo&255)<<8)>>>1}var lf=function(n,e,t){for(var i=n.length,r=0,s=new Ro(e);r<i;++r)++s[n[r]-1];var o=new Ro(e);for(r=0;r<e;++r)o[r]=o[r-1]+s[r-1]<<1;var a;if(t){a=new Ro(1<<e);var u=15-e;for(r=0;r<i;++r)if(n[r])for(var f=r<<4|n[r],h=e-n[r],d=o[n[r]-1]++<<h,p=d|(1<<h)-1;d<=p;++d)a[ix[d]>>>u]=f}else for(a=new Ro(i),r=0;r<i;++r)n[r]&&(a[r]=ix[o[n[r]-1]++]>>>15-n[r]);return a},yh=new Er(288);for(var fn=0;fn<144;++fn)yh[fn]=8;for(var fn=144;fn<256;++fn)yh[fn]=9;for(var fn=256;fn<280;++fn)yh[fn]=7;for(var fn=280;fn<288;++fn)yh[fn]=8;var QC=new Er(32);for(var fn=0;fn<32;++fn)QC[fn]=5;var KB=lf(yh,9,1),QB=lf(QC,5,1),ky=function(n){for(var e=n[0],t=1;t<n.length;++t)n[t]>e&&(e=n[t]);return e},zr=function(n,e,t){var i=e/8|0;return(n[i]|n[i+1]<<8)>>(e&7)&t},zy=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},$B=function(n){return(n/8|0)+(n&7&&1)},JB=function(n,e,t){(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof Ro?Ro:n instanceof nx?nx:Er)(t-e);return i.set(n.subarray(e,t)),i},e4=function(n,e,t){var i=n.length;if(!i||t&&!t.l&&i<5)return e||new Er(0);var r=!e||t,s=!t||t.i;t||(t={}),e||(e=new Er(i*3));var o=function(we){var Ce=e.length;if(we>Ce){var ct=new Er(Math.max(Ce*2,we));ct.set(e),e=ct}},a=t.f||0,u=t.p||0,f=t.b||0,h=t.l,d=t.d,p=t.m,m=t.n,y=i*8;do{if(!h){t.f=a=zr(n,u,1);var w=zr(n,u+1,3);if(u+=3,w)if(w==1)h=KB,d=QB,p=9,m=5;else if(w==2){var M=zr(n,u,31)+257,T=zr(n,u+10,15)+4,I=M+zr(n,u+5,31)+1;u+=14;for(var C=new Er(I),L=new Er(19),N=0;N<T;++N)L[jB[N]]=zr(n,u+N*3,7);u+=T*3;for(var B=ky(L),A=(1<<B)-1,R=lf(L,B,1),N=0;N<I;){var j=R[zr(n,u,A)];u+=j&15;var _=j>>>4;if(_<16)C[N++]=_;else{var Y=0,Z=0;for(_==16?(Z=3+zr(n,u,3),u+=2,Y=C[N-1]):_==17?(Z=3+zr(n,u,7),u+=3):_==18&&(Z=11+zr(n,u,127),u+=7);Z--;)C[N++]=Y}}var ae=C.subarray(0,M),Q=C.subarray(M);p=ky(ae),m=ky(Q),h=lf(ae,p,1),d=lf(Q,m,1)}else throw"invalid block type";else{var _=$B(u)+4,v=n[_-4]|n[_-3]<<8,S=_+v;if(S>i){if(s)throw"unexpected EOF";break}r&&o(f+v),e.set(n.subarray(_,S),f),t.b=f+=v,t.p=u=S*8;continue}if(u>y){if(s)throw"unexpected EOF";break}}r&&o(f+131072);for(var pe=(1<<p)-1,z=(1<<m)-1,ie=u;;ie=u){var Y=h[zy(n,u)&pe],$=Y>>>4;if(u+=Y&15,u>y){if(s)throw"unexpected EOF";break}if(!Y)throw"invalid length/literal";if($<256)e[f++]=$;else if($==256){ie=u,h=null;break}else{var le=$-254;if($>264){var N=$-257,ye=jC[N];le=zr(n,u,(1<<ye)-1)+KC[N],u+=ye}var De=d[zy(n,u)&z],ue=De>>>4;if(!De)throw"invalid distance";u+=De&15;var Q=ZB[ue];if(ue>3){var ye=YC[ue];Q+=zy(n,u)&(1<<ye)-1,u+=ye}if(u>y){if(s)throw"unexpected EOF";break}r&&o(f+131072);for(var Me=f+le;f<Me;f+=4)e[f]=e[f-Q],e[f+1]=e[f+1-Q],e[f+2]=e[f+2-Q],e[f+3]=e[f+3-Q];f=Me}}t.l=h,t.p=ie,t.b=f,h&&(a=1,t.m=p,t.d=d,t.n=m)}while(!a);return f==e.length?e:JB(e,0,f)},t4=new Er(0),n4=function(n){if((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)throw"invalid zlib data";if(n[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Ap(n,e){return e4((n4(n),n.subarray(2,-4)),e)}var i4=typeof TextDecoder<"u"&&new TextDecoder,r4=0;try{i4.decode(t4,{stream:!0}),r4=1}catch{}const s4=n=>n&&n.isCubeTexture;class o4 extends xn{constructor(e,t){var i,r;const s=s4(e),a=((r=s?(i=e.image[0])==null?void 0:i.width:e.image.width)!=null?r:1024)/4,u=Math.floor(Math.log2(a)),f=Math.pow(2,u),h=3*Math.max(f,16*7),d=4*f,p=[s?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/h}`,`#define CUBEUV_TEXEL_HEIGHT ${1/d}`,`#define CUBEUV_MAX_MIP ${u}.0`],m=` 3913 varying vec3 vWorldPosition; 3914 void main() 3915 { 3916 vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) ); 3917 vWorldPosition = worldPosition.xyz; 3918 3919 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 3920 } 3921 `,y=p.join(` 3922`)+` 3923 #define ENVMAP_TYPE_CUBE_UV 3924 varying vec3 vWorldPosition; 3925 uniform float radius; 3926 uniform float height; 3927 uniform float angle; 3928 #ifdef ENVMAP_TYPE_CUBE 3929 uniform samplerCube map; 3930 #else 3931 uniform sampler2D map; 3932 #endif 3933 // From: https://www.shadertoy.com/view/4tsBD7 3934 float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) 3935 { 3936 float d = dot ( rd, n ); 3937 3938 if( d > 0.0 ) { return 1e6; } 3939 3940 vec3 o = ro - c; 3941 float t = - dot( n, o ) / d; 3942 vec3 q = o + rd * t; 3943 3944 return ( dot( q, q ) < r * r ) ? t : 1e6; 3945 } 3946 // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm 3947 float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) 3948 { 3949 vec3 oc = ro - ce; 3950 float b = dot( oc, rd ); 3951 float c = dot( oc, oc ) - ra * ra; 3952 float h = b * b - c; 3953 3954 if( h < 0.0 ) { return -1.0; } 3955 3956 h = sqrt( h ); 3957 3958 return - b + h; 3959 } 3960 vec3 project() 3961 { 3962 vec3 p = normalize( vWorldPosition ); 3963 vec3 camPos = cameraPosition; 3964 camPos.y -= height; 3965 float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius ); 3966 if( intersection > 0.0 ) { 3967 3968 vec3 h = vec3( 0.0, - height, 0.0 ); 3969 float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius ); 3970 p = ( camPos + min( intersection, intersection2 ) * p ) / radius; 3971 } else { 3972 p = vec3( 0.0, 1.0, 0.0 ); 3973 } 3974 return p; 3975 } 3976 #include <common> 3977 #include <cube_uv_reflection_fragment> 3978 void main() 3979 { 3980 vec3 projectedWorldPosition = project(); 3981 3982 #ifdef ENVMAP_TYPE_CUBE 3983 vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb; 3984 #else 3985 vec3 direction = normalize( projectedWorldPosition ); 3986 vec2 uv = equirectUv( direction ); 3987 vec3 outcolor = texture2D( map, uv ).rgb; 3988 #endif 3989 gl_FragColor = vec4( outcolor, 1.0 ); 3990 #include <tonemapping_fragment> 3991 #include <${XC>=154?"colorspace_fragment":"encodings_fragment"}> 3992 } 3993 `,w={map:{value:e},height:{value:(t==null?void 0:t.height)||15},radius:{value:(t==null?void 0:t.radius)||100}},_=new hh(1,16),v=new qi({uniforms:w,fragmentShader:y,vertexShader:m,side:jr});super(_,v)}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}class a4 extends US{constructor(e){super(e),this.type=ei}parse(e){const o=function(N,B){switch(N){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(B||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(B||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(B||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(B||""))}},h=` 3994`,d=function(N,B,A){B=B||1024;let j=N.pos,Y=-1,Z=0,ae="",Q=String.fromCharCode.apply(null,new Uint16Array(N.subarray(j,j+128)));for(;0>(Y=Q.indexOf(h))&&Z<B&&j<N.byteLength;)ae+=Q,Z+=Q.length,j+=128,Q+=String.fromCharCode.apply(null,new Uint16Array(N.subarray(j,j+128)));return-1<Y?(N.pos+=Z+Y+1,ae+Q.slice(0,Y)):!1},p=function(N){const B=/^#\?(\S+)/,A=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,R=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,j=/^\s*FORMAT=(\S+)\s*$/,Y=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,Z={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let ae,Q;for((N.pos>=N.byteLength||!(ae=d(N)))&&o(1,"no header found"),(Q=ae.match(B))||o(3,"bad initial token"),Z.valid|=1,Z.programtype=Q[1],Z.string+=ae+` 3995`;ae=d(N),ae!==!1;){if(Z.string+=ae+` 3996`,ae.charAt(0)==="#"){Z.comments+=ae+` 3997`;continue}if((Q=ae.match(A))&&(Z.gamma=parseFloat(Q[1])),(Q=ae.match(R))&&(Z.exposure=parseFloat(Q[1])),(Q=ae.match(j))&&(Z.valid|=2,Z.format=Q[1]),(Q=ae.match(Y))&&(Z.valid|=4,Z.height=parseInt(Q[1],10),Z.width=parseInt(Q[2],10)),Z.valid&2&&Z.valid&4)break}return Z.valid&2||o(3,"missing format specifier"),Z.valid&4||o(3,"missing image size specifier"),Z},m=function(N,B,A){const R=B;if(R<8||R>32767||N[0]!==2||N[1]!==2||N[2]&128)return new Uint8Array(N);R!==(N[2]<<8|N[3])&&o(3,"wrong scanline width");const j=new Uint8Array(4*B*A);j.length||o(4,"unable to allocate buffer space");let Y=0,Z=0;const ae=4*R,Q=new Uint8Array(4),pe=new Uint8Array(ae);let z=A;for(;z>0&&Z<N.byteLength;){Z+4>N.byteLength&&o(1),Q[0]=N[Z++],Q[1]=N[Z++],Q[2]=N[Z++],Q[3]=N[Z++],(Q[0]!=2||Q[1]!=2||(Q[2]<<8|Q[3])!=R)&&o(3,"bad rgbe scanline format");let ie=0,$;for(;ie<ae&&Z<N.byteLength;){$=N[Z++];const ye=$>128;if(ye&&($-=128),($===0||ie+$>ae)&&o(3,"bad scanline data"),ye){const De=N[Z++];for(let ue=0;ue<$;ue++)pe[ie++]=De}else pe.set(N.subarray(Z,Z+$),ie),ie+=$,Z+=$}const le=R;for(let ye=0;ye<le;ye++){let De=0;j[Y]=pe[ye+De],De+=R,j[Y+1]=pe[ye+De],De+=R,j[Y+2]=pe[ye+De],De+=R,j[Y+3]=pe[ye+De],Y+=4}z--}return j},y=function(N,B,A,R){const j=N[B+3],Y=Math.pow(2,j-128)/255;A[R+0]=N[B+0]*Y,A[R+1]=N[B+1]*Y,A[R+2]=N[B+2]*Y,A[R+3]=1},w=function(N,B,A,R){const j=N[B+3],Y=Math.pow(2,j-128)/255;A[R+0]=Pa.toHalfFloat(Math.min(N[B+0]*Y,65504)),A[R+1]=Pa.toHalfFloat(Math.min(N[B+1]*Y,65504)),A[R+2]=Pa.toHalfFloat(Math.min(N[B+2]*Y,65504)),A[R+3]=Pa.toHalfFloat(1)},_=new Uint8Array(e);_.pos=0;const v=p(_),S=v.width,M=v.height,T=m(_.subarray(_.pos),S,M);let I,C,L;switch(this.type){case _n:L=T.length/4;const N=new Float32Array(L*4);for(let A=0;A<L;A++)y(T,A*4,N,A*4);I=N,C=_n;break;case ei:L=T.length/4;const B=new Uint16Array(L*4);for(let A=0;A<L;A++)w(T,A*4,B,A*4);I=B,C=ei;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:S,height:M,data:I,header:v.string,gamma:v.gamma,exposure:v.exposure,type:C}}setDataType(e){return this.type=e,this}load(e,t,i,r){function s(o,a){switch(o.type){case _n:case ei:"colorSpace"in o?o.colorSpace="srgb-linear":o.encoding=3e3,o.minFilter=Qt,o.magFilter=Qt,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,a)}return super.load(e,s,i,r)}}const Nu=XC>=152;class l4 extends US{constructor(e){super(e),this.type=ei}parse(e){const B=Math.pow(2.7182818,2.2);function A(D,O){for(var J=0,de=0;de<65536;++de)(de==0||D[de>>3]&1<<(de&7))&&(O[J++]=de);for(var P=J-1;J<65536;)O[J++]=0;return P}function R(D){for(var O=0;O<16384;O++)D[O]={},D[O].len=0,D[O].lit=0,D[O].p=null}const j={l:0,c:0,lc:0};function Y(D,O,J,de,P){for(;J<D;)O=O<<8|Ut(de,P),J+=8;J-=D,j.l=O>>J&(1<<D)-1,j.c=O,j.lc=J}const Z=new Array(59);function ae(D){for(var O=0;O<=58;++O)Z[O]=0;for(var O=0;O<65537;++O)Z[D[O]]+=1;for(var J=0,O=58;O>0;--O){var de=J+Z[O]>>1;Z[O]=J,J=de}for(var O=0;O<65537;++O){var P=D[O];P>0&&(D[O]=P|Z[P]++<<6)}}function Q(D,O,J,de,P,F,K){for(var q=J,X=0,oe=0;P<=F;P++){if(q.value-J.value>de)return!1;Y(6,X,oe,D,q);var fe=j.l;if(X=j.c,oe=j.lc,K[P]=fe,fe==63){if(q.value-J.value>de)throw"Something wrong with hufUnpackEncTable";Y(8,X,oe,D,q);var me=j.l+6;if(X=j.c,oe=j.lc,P+me>F+1)throw"Something wrong with hufUnpackEncTable";for(;me--;)K[P++]=0;P--}else if(fe>=59){var me=fe-59+2;if(P+me>F+1)throw"Something wrong with hufUnpackEncTable";for(;me--;)K[P++]=0;P--}}ae(K)}function pe(D){return D&63}function z(D){return D>>6}function ie(D,O,J,de){for(;O<=J;O++){var P=z(D[O]),F=pe(D[O]);if(P>>F)throw"Invalid table entry";if(F>14){var K=de[P>>F-14];if(K.len)throw"Invalid table entry";if(K.lit++,K.p){var q=K.p;K.p=new Array(K.lit);for(var X=0;X<K.lit-1;++X)K.p[X]=q[X]}else K.p=new Array(1);K.p[K.lit-1]=O}else if(F)for(var oe=0,X=1<<14-F;X>0;X--){var K=de[(P<<14-F)+oe];if(K.len||K.p)throw"Invalid table entry";K.len=F,K.lit=O,oe++}}return!0}const $={c:0,lc:0};function le(D,O,J,de){D=D<<8|Ut(J,de),O+=8,$.c=D,$.lc=O}const ye={c:0,lc:0};function De(D,O,J,de,P,F,K,q,X,oe){if(D==O){de<8&&(le(J,de,P,K),J=$.c,de=$.lc),de-=8;var fe=J>>de,fe=new Uint8Array([fe])[0];if(X.value+fe>oe)return!1;for(var me=q[X.value-1];fe-- >0;)q[X.value++]=me}else if(X.value<oe)q[X.value++]=D;else return!1;ye.c=J,ye.lc=de}function ue(D){return D&65535}function Me(D){var O=ue(D);return O>32767?O-65536:O}const we={a:0,b:0};function Ce(D,O){var J=Me(D),de=Me(O),P=de,F=J+(P&1)+(P>>1),K=F,q=F-P;we.a=K,we.b=q}function ct(D,O){var J=ue(D),de=ue(O),P=J-(de>>1)&65535,F=de+P-32768&65535;we.a=F,we.b=P}function gt(D,O,J,de,P,F,K){for(var q=K<16384,X=J>P?P:J,oe=1,fe;oe<=X;)oe<<=1;for(oe>>=1,fe=oe,oe>>=1;oe>=1;){for(var me=0,ke=me+F*(P-fe),Ae=F*oe,Re=F*fe,Pe=de*oe,Ze=de*fe,ut,dt,ht,qe;me<=ke;me+=Re){for(var Ue=me,wt=me+de*(J-fe);Ue<=wt;Ue+=Ze){var tt=Ue+Pe,kt=Ue+Ae,mn=kt+Pe;q?(Ce(D[Ue+O],D[kt+O]),ut=we.a,ht=we.b,Ce(D[tt+O],D[mn+O]),dt=we.a,qe=we.b,Ce(ut,dt),D[Ue+O]=we.a,D[tt+O]=we.b,Ce(ht,qe),D[kt+O]=we.a,D[mn+O]=we.b):(ct(D[Ue+O],D[kt+O]),ut=we.a,ht=we.b,ct(D[tt+O],D[mn+O]),dt=we.a,qe=we.b,ct(ut,dt),D[Ue+O]=we.a,D[tt+O]=we.b,ct(ht,qe),D[kt+O]=we.a,D[mn+O]=we.b)}if(J&oe){var kt=Ue+Ae;q?Ce(D[Ue+O],D[kt+O]):ct(D[Ue+O],D[kt+O]),ut=we.a,D[kt+O]=we.b,D[Ue+O]=ut}}if(P&oe)for(var Ue=me,wt=me+de*(J-fe);Ue<=wt;Ue+=Ze){var tt=Ue+Pe;q?Ce(D[Ue+O],D[tt+O]):ct(D[Ue+O],D[tt+O]),ut=we.a,D[tt+O]=we.b,D[Ue+O]=ut}fe=oe,oe>>=1}return me}function We(D,O,J,de,P,F,K,q,X,oe){for(var fe=0,me=0,ke=q,Ae=Math.trunc(P.value+(F+7)/8);P.value<Ae;)for(le(fe,me,J,P),fe=$.c,me=$.lc;me>=14;){var Re=fe>>me-14&16383,Pe=O[Re];if(Pe.len)me-=Pe.len,De(Pe.lit,K,fe,me,J,de,P,X,oe,ke),fe=ye.c,me=ye.lc;else{if(!Pe.p)throw"hufDecode issues";var Ze;for(Ze=0;Ze<Pe.lit;Ze++){for(var ut=pe(D[Pe.p[Ze]]);me<ut&&P.value<Ae;)le(fe,me,J,P),fe=$.c,me=$.lc;if(me>=ut&&z(D[Pe.p[Ze]])==(fe>>me-ut&(1<<ut)-1)){me-=ut,De(Pe.p[Ze],K,fe,me,J,de,P,X,oe,ke),fe=ye.c,me=ye.lc;break}}if(Ze==Pe.lit)throw"hufDecode issues"}}var dt=8-F&7;for(fe>>=dt,me-=dt;me>0;){var Pe=O[fe<<14-me&16383];if(Pe.len)me-=Pe.len,De(Pe.lit,K,fe,me,J,de,P,X,oe,ke),fe=ye.c,me=ye.lc;else throw"hufDecode issues"}return!0}function nt(D,O,J,de,P,F){var K={value:0},q=J.value,X=Ge(O,J),oe=Ge(O,J);J.value+=4;var fe=Ge(O,J);if(J.value+=4,X<0||X>=65537||oe<0||oe>=65537)throw"Something wrong with HUF_ENCSIZE";var me=new Array(65537),ke=new Array(16384);R(ke);var Ae=de-(J.value-q);if(Q(D,O,J,Ae,X,oe,me),fe>8*(de-(J.value-q)))throw"Something wrong with hufUncompress";ie(me,X,oe,ke),We(me,ke,D,O,J,fe,oe,F,P,K)}function xe(D,O,J){for(var de=0;de<J;++de)O[de]=D[O[de]]}function G(D){for(var O=1;O<D.length;O++){var J=D[O-1]+D[O]-128;D[O]=J}}function Oe(D,O){for(var J=0,de=Math.floor((D.length+1)/2),P=0,F=D.length-1;!(P>F||(O[P++]=D[J++],P>F));)O[P++]=D[de++]}function Fe(D){for(var O=D.byteLength,J=new Array,de=0,P=new DataView(D);O>0;){var F=P.getInt8(de++);if(F<0){var K=-F;O-=K+1;for(var q=0;q<K;q++)J.push(P.getUint8(de++))}else{var K=F;O-=2;for(var X=P.getUint8(de++),q=0;q<K+1;q++)J.push(X)}}return J}function Ie(D,O,J,de,P,F){var tt=new DataView(F.buffer),K=J[D.idx[0]].width,q=J[D.idx[0]].height,X=3,oe=Math.floor(K/8),fe=Math.ceil(K/8),me=Math.ceil(q/8),ke=K-(fe-1)*8,Ae=q-(me-1)*8,Re={value:0},Pe=new Array(X),Ze=new Array(X),ut=new Array(X),dt=new Array(X),ht=new Array(X);for(let _t=0;_t<X;++_t)ht[_t]=O[D.idx[_t]],Pe[_t]=_t<1?0:Pe[_t-1]+fe*me,Ze[_t]=new Float32Array(64),ut[_t]=new Uint16Array(64),dt[_t]=new Uint16Array(fe*64);for(let _t=0;_t<me;++_t){var qe=8;_t==me-1&&(qe=Ae);var Ue=8;for(let Vt=0;Vt<fe;++Vt){Vt==fe-1&&(Ue=ke);for(let Et=0;Et<X;++Et)ut[Et].fill(0),ut[Et][0]=P[Pe[Et]++],He(Re,de,ut[Et]),ft(ut[Et],Ze[Et]),Qe(Ze[Et]);V(Ze);for(let Et=0;Et<X;++Et)U(Ze[Et],dt[Et],Vt*64)}let en=0;for(let Vt=0;Vt<X;++Vt){const Et=J[D.idx[Vt]].type;for(let tn=8*_t;tn<8*_t+qe;++tn){en=ht[Vt][tn];for(let Lr=0;Lr<oe;++Lr){const jn=Lr*64+(tn&7)*8;tt.setUint16(en+0*2*Et,dt[Vt][jn+0],!0),tt.setUint16(en+1*2*Et,dt[Vt][jn+1],!0),tt.setUint16(en+2*2*Et,dt[Vt][jn+2],!0),tt.setUint16(en+3*2*Et,dt[Vt][jn+3],!0),tt.setUint16(en+4*2*Et,dt[Vt][jn+4],!0),tt.setUint16(en+5*2*Et,dt[Vt][jn+5],!0),tt.setUint16(en+6*2*Et,dt[Vt][jn+6],!0),tt.setUint16(en+7*2*Et,dt[Vt][jn+7],!0),en+=8*2*Et}}if(oe!=fe)for(let tn=8*_t;tn<8*_t+qe;++tn){const Lr=ht[Vt][tn]+8*oe*2*Et,jn=oe*64+(tn&7)*8;for(let ts=0;ts<Ue;++ts)tt.setUint16(Lr+ts*2*Et,dt[Vt][jn+ts],!0)}}}for(var wt=new Uint16Array(K),tt=new DataView(F.buffer),kt=0;kt<X;++kt){J[D.idx[kt]].decoded=!0;var mn=J[D.idx[kt]].type;if(J[kt].type==2)for(var Ht=0;Ht<q;++Ht){const _t=ht[kt][Ht];for(var Rn=0;Rn<K;++Rn)wt[Rn]=tt.getUint16(_t+Rn*2*mn,!0);for(var Rn=0;Rn<K;++Rn)tt.setFloat32(_t+Rn*2*mn,ne(wt[Rn]),!0)}}}function He(D,O,J){for(var de,P=1;P<64;)de=O[D.value],de==65280?P=64:de>>8==255?P+=de&255:(J[P]=de,P++),D.value++}function ft(D,O){O[0]=ne(D[0]),O[1]=ne(D[1]),O[2]=ne(D[5]),O[3]=ne(D[6]),O[4]=ne(D[14]),O[5]=ne(D[15]),O[6]=ne(D[27]),O[7]=ne(D[28]),O[8]=ne(D[2]),O[9]=ne(D[4]),O[10]=ne(D[7]),O[11]=ne(D[13]),O[12]=ne(D[16]),O[13]=ne(D[26]),O[14]=ne(D[29]),O[15]=ne(D[42]),O[16]=ne(D[3]),O[17]=ne(D[8]),O[18]=ne(D[12]),O[19]=ne(D[17]),O[20]=ne(D[25]),O[21]=ne(D[30]),O[22]=ne(D[41]),O[23]=ne(D[43]),O[24]=ne(D[9]),O[25]=ne(D[11]),O[26]=ne(D[18]),O[27]=ne(D[24]),O[28]=ne(D[31]),O[29]=ne(D[40]),O[30]=ne(D[44]),O[31]=ne(D[53]),O[32]=ne(D[10]),O[33]=ne(D[19]),O[34]=ne(D[23]),O[35]=ne(D[32]),O[36]=ne(D[39]),O[37]=ne(D[45]),O[38]=ne(D[52]),O[39]=ne(D[54]),O[40]=ne(D[20]),O[41]=ne(D[22]),O[42]=ne(D[33]),O[43]=ne(D[38]),O[44]=ne(D[46]),O[45]=ne(D[51]),O[46]=ne(D[55]),O[47]=ne(D[60]),O[48]=ne(D[21]),O[49]=ne(D[34]),O[50]=ne(D[37]),O[51]=ne(D[47]),O[52]=ne(D[50]),O[53]=ne(D[56]),O[54]=ne(D[59]),O[55]=ne(D[61]),O[56]=ne(D[35]),O[57]=ne(D[36]),O[58]=ne(D[48]),O[59]=ne(D[49]),O[60]=ne(D[57]),O[61]=ne(D[58]),O[62]=ne(D[62]),O[63]=ne(D[63])}function Qe(D){const O=.5*Math.cos(.7853975),J=.5*Math.cos(3.14159/16),de=.5*Math.cos(3.14159/8),P=.5*Math.cos(3*3.14159/16),F=.5*Math.cos(5*3.14159/16),K=.5*Math.cos(3*3.14159/8),q=.5*Math.cos(7*3.14159/16);for(var X=new Array(4),oe=new Array(4),fe=new Array(4),me=new Array(4),ke=0;ke<8;++ke){var Ae=ke*8;X[0]=de*D[Ae+2],X[1]=K*D[Ae+2],X[2]=de*D[Ae+6],X[3]=K*D[Ae+6],oe[0]=J*D[Ae+1]+P*D[Ae+3]+F*D[Ae+5]+q*D[Ae+7],oe[1]=P*D[Ae+1]-q*D[Ae+3]-J*D[Ae+5]-F*D[Ae+7],oe[2]=F*D[Ae+1]-J*D[Ae+3]+q*D[Ae+5]+P*D[Ae+7],oe[3]=q*D[Ae+1]-F*D[Ae+3]+P*D[Ae+5]-J*D[Ae+7],fe[0]=O*(D[Ae+0]+D[Ae+4]),fe[3]=O*(D[Ae+0]-D[Ae+4]),fe[1]=X[0]+X[3],fe[2]=X[1]-X[2],me[0]=fe[0]+fe[1],me[1]=fe[3]+fe[2],me[2]=fe[3]-fe[2],me[3]=fe[0]-fe[1],D[Ae+0]=me[0]+oe[0],D[Ae+1]=me[1]+oe[1],D[Ae+2]=me[2]+oe[2],D[Ae+3]=me[3]+oe[3],D[Ae+4]=me[3]-oe[3],D[Ae+5]=me[2]-oe[2],D[Ae+6]=me[1]-oe[1],D[Ae+7]=me[0]-oe[0]}for(var Re=0;Re<8;++Re)X[0]=de*D[16+Re],X[1]=K*D[16+Re],X[2]=de*D[48+Re],X[3]=K*D[48+Re],oe[0]=J*D[8+Re]+P*D[24+Re]+F*D[40+Re]+q*D[56+Re],oe[1]=P*D[8+Re]-q*D[24+Re]-J*D[40+Re]-F*D[56+Re],oe[2]=F*D[8+Re]-J*D[24+Re]+q*D[40+Re]+P*D[56+Re],oe[3]=q*D[8+Re]-F*D[24+Re]+P*D[40+Re]-J*D[56+Re],fe[0]=O*(D[Re]+D[32+Re]),fe[3]=O*(D[Re]-D[32+Re]),fe[1]=X[0]+X[3],fe[2]=X[1]-X[2],me[0]=fe[0]+fe[1],me[1]=fe[3]+fe[2],me[2]=fe[3]-fe[2],me[3]=fe[0]-fe[1],D[0+Re]=me[0]+oe[0],D[8+Re]=me[1]+oe[1],D[16+Re]=me[2]+oe[2],D[24+Re]=me[3]+oe[3],D[32+Re]=me[3]-oe[3],D[40+Re]=me[2]-oe[2],D[48+Re]=me[1]-oe[1],D[56+Re]=me[0]-oe[0]}function V(D){for(var O=0;O<64;++O){var J=D[0][O],de=D[1][O],P=D[2][O];D[0][O]=J+1.5747*P,D[1][O]=J-.1873*de-.4682*P,D[2][O]=J+1.8556*de}}function U(D,O,J){for(var de=0;de<64;++de)O[J+de]=Pa.toHalfFloat(ce(D[de]))}function ce(D){return D<=1?Math.sign(D)*Math.pow(Math.abs(D),2.2):Math.sign(D)*Math.pow(B,Math.abs(D)-1)}function Se(D){return new DataView(D.array.buffer,D.offset.value,D.size)}function Ee(D){var O=D.viewer.buffer.slice(D.offset.value,D.offset.value+D.size),J=new Uint8Array(Fe(O)),de=new Uint8Array(J.length);return G(J),Oe(J,de),new DataView(de.buffer)}function _e(D){var O=D.array.slice(D.offset.value,D.offset.value+D.size),J=Ap(O),de=new Uint8Array(J.length);return G(J),Oe(J,de),new DataView(de.buffer)}function at(D){for(var O=D.viewer,J={value:D.offset.value},de=new Uint16Array(D.width*D.scanlineBlockSize*(D.channels*D.type)),P=new Uint8Array(8192),F=0,K=new Array(D.channels),q=0;q<D.channels;q++)K[q]={},K[q].start=F,K[q].end=K[q].start,K[q].nx=D.width,K[q].ny=D.lines,K[q].size=D.type,F+=K[q].nx*K[q].ny*K[q].size;var X=Te(O,J),oe=Te(O,J);if(oe>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(X<=oe)for(var q=0;q<oe-X+1;q++)P[q+X]=St(O,J);var fe=new Uint16Array(65536),me=A(P,fe),ke=Ge(O,J);nt(D.array,O,J,ke,de,F);for(var q=0;q<D.channels;++q)for(var Ae=K[q],Re=0;Re<K[q].size;++Re)gt(de,Ae.start+Re,Ae.nx,Ae.size,Ae.ny,Ae.nx*Ae.size,me);xe(fe,de,F);for(var Pe=0,Ze=new Uint8Array(de.buffer.byteLength),ut=0;ut<D.lines;ut++)for(var dt=0;dt<D.channels;dt++){var Ae=K[dt],ht=Ae.nx*Ae.size,qe=new Uint8Array(de.buffer,Ae.end*2,ht*2);Ze.set(qe,Pe),Pe+=ht*2,Ae.end+=ht}return new DataView(Ze.buffer)}function Ve(D){var O=D.array.slice(D.offset.value,D.offset.value+D.size),J=Ap(O);const de=D.lines*D.channels*D.width,P=D.type==1?new Uint16Array(de):new Uint32Array(de);let F=0,K=0;const q=new Array(4);for(let X=0;X<D.lines;X++)for(let oe=0;oe<D.channels;oe++){let fe=0;switch(D.type){case 1:q[0]=F,q[1]=q[0]+D.width,F=q[1]+D.width;for(let me=0;me<D.width;++me){const ke=J[q[0]++]<<8|J[q[1]++];fe+=ke,P[K]=fe,K++}break;case 2:q[0]=F,q[1]=q[0]+D.width,q[2]=q[1]+D.width,F=q[2]+D.width;for(let me=0;me<D.width;++me){const ke=J[q[0]++]<<24|J[q[1]++]<<16|J[q[2]++]<<8;fe+=ke,P[K]=fe,K++}break}}return new DataView(P.buffer)}function $e(D){var O=D.viewer,J={value:D.offset.value},de=new Uint8Array(D.width*D.lines*(D.channels*D.type*2)),P={version:bt(O,J),unknownUncompressedSize:bt(O,J),unknownCompressedSize:bt(O,J),acCompressedSize:bt(O,J),dcCompressedSize:bt(O,J),rleCompressedSize:bt(O,J),rleUncompressedSize:bt(O,J),rleRawSize:bt(O,J),totalAcUncompressedCount:bt(O,J),totalDcUncompressedCount:bt(O,J),acCompression:bt(O,J)};if(P.version<2)throw"EXRLoader.parse: "+ai.compression+" version "+P.version+" is unsupported";for(var F=new Array,K=Te(O,J)-2;K>0;){var q=It(O.buffer,J),X=St(O,J),oe=X>>2&3,fe=(X>>4)-1,me=new Int8Array([fe])[0],ke=St(O,J);F.push({name:q,index:me,type:ke,compression:oe}),K-=q.length+3}for(var Ae=ai.channels,Re=new Array(D.channels),Pe=0;Pe<D.channels;++Pe){var Ze=Re[Pe]={},ut=Ae[Pe];Ze.name=ut.name,Ze.compression=0,Ze.decoded=!1,Ze.type=ut.pixelType,Ze.pLinear=ut.pLinear,Ze.width=D.width,Ze.height=D.lines}for(var dt={idx:new Array(3)},ht=0;ht<D.channels;++ht)for(var Ze=Re[ht],Pe=0;Pe<F.length;++Pe){var qe=F[Pe];Ze.name==qe.name&&(Ze.compression=qe.compression,qe.index>=0&&(dt.idx[qe.index]=ht),Ze.offset=ht)}if(P.acCompressedSize>0)switch(P.acCompression){case 0:var tt=new Uint16Array(P.totalAcUncompressedCount);nt(D.array,O,J,P.acCompressedSize,tt,P.totalAcUncompressedCount);break;case 1:var Ue=D.array.slice(J.value,J.value+P.totalAcUncompressedCount),wt=Ap(Ue),tt=new Uint16Array(wt.buffer);J.value+=P.totalAcUncompressedCount;break}if(P.dcCompressedSize>0){var kt={array:D.array,offset:J,size:P.dcCompressedSize},mn=new Uint16Array(_e(kt).buffer);J.value+=P.dcCompressedSize}if(P.rleRawSize>0){var Ue=D.array.slice(J.value,J.value+P.rleCompressedSize),wt=Ap(Ue),Ht=Fe(wt.buffer);J.value+=P.rleCompressedSize}for(var Rn=0,_t=new Array(Re.length),Pe=0;Pe<_t.length;++Pe)_t[Pe]=new Array;for(var en=0;en<D.lines;++en)for(var Vt=0;Vt<Re.length;++Vt)_t[Vt].push(Rn),Rn+=Re[Vt].width*D.type*2;Ie(dt,_t,Re,tt,mn,de);for(var Pe=0;Pe<Re.length;++Pe){var Ze=Re[Pe];if(!Ze.decoded)switch(Ze.compression){case 2:for(var Et=0,tn=0,en=0;en<D.lines;++en){for(var Lr=_t[Pe][Et],jn=0;jn<Ze.width;++jn){for(var ts=0;ts<2*Ze.type;++ts)de[Lr++]=Ht[tn+ts*Ze.width*Ze.height];tn++}Et++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(de.buffer)}function It(D,O){for(var J=new Uint8Array(D),de=0;J[O.value+de]!=0;)de+=1;var P=new TextDecoder().decode(J.slice(O.value,O.value+de));return O.value=O.value+de+1,P}function Ne(D,O,J){var de=new TextDecoder().decode(new Uint8Array(D).slice(O.value,O.value+J));return O.value=O.value+J,de}function it(D,O){var J=yt(D,O),de=Ge(D,O);return[J,de]}function Mt(D,O){var J=Ge(D,O),de=Ge(D,O);return[J,de]}function yt(D,O){var J=D.getInt32(O.value,!0);return O.value=O.value+4,J}function Ge(D,O){var J=D.getUint32(O.value,!0);return O.value=O.value+4,J}function Ut(D,O){var J=D[O.value];return O.value=O.value+1,J}function St(D,O){var J=D.getUint8(O.value);return O.value=O.value+1,J}const bt=function(D,O){let J;return"getBigInt64"in DataView.prototype?J=Number(D.getBigInt64(O.value,!0)):J=D.getUint32(O.value+4,!0)+Number(D.getUint32(O.value,!0)<<32),O.value+=8,J};function te(D,O){var J=D.getFloat32(O.value,!0);return O.value+=4,J}function Je(D,O){return Pa.toHalfFloat(te(D,O))}function ne(D){var O=(D&31744)>>10,J=D&1023;return(D>>15?-1:1)*(O?O===31?J?NaN:1/0:Math.pow(2,O-15)*(1+J/1024):6103515625e-14*(J/1024))}function Te(D,O){var J=D.getUint16(O.value,!0);return O.value+=2,J}function Ye(D,O){return ne(Te(D,O))}function et(D,O,J,de){for(var P=J.value,F=[];J.value<P+de-1;){var K=It(O,J),q=yt(D,J),X=St(D,J);J.value+=3;var oe=yt(D,J),fe=yt(D,J);F.push({name:K,pixelType:q,pLinear:X,xSampling:oe,ySampling:fe})}return J.value+=1,F}function Ft(D,O){var J=te(D,O),de=te(D,O),P=te(D,O),F=te(D,O),K=te(D,O),q=te(D,O),X=te(D,O),oe=te(D,O);return{redX:J,redY:de,greenX:P,greenY:F,blueX:K,blueY:q,whiteX:X,whiteY:oe}}function ln(D,O){var J=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],de=St(D,O);return J[de]}function Xn(D,O){var J=Ge(D,O),de=Ge(D,O),P=Ge(D,O),F=Ge(D,O);return{xMin:J,yMin:de,xMax:P,yMax:F}}function Bt(D,O){var J=["INCREASING_Y"],de=St(D,O);return J[de]}function kn(D,O){var J=te(D,O),de=te(D,O);return[J,de]}function Oi(D,O){var J=te(D,O),de=te(D,O),P=te(D,O);return[J,de,P]}function al(D,O,J,de,P){if(de==="string"||de==="stringvector"||de==="iccProfile")return Ne(O,J,P);if(de==="chlist")return et(D,O,J,P);if(de==="chromaticities")return Ft(D,J);if(de==="compression")return ln(D,J);if(de==="box2i")return Xn(D,J);if(de==="lineOrder")return Bt(D,J);if(de==="float")return te(D,J);if(de==="v2f")return kn(D,J);if(de==="v3f")return Oi(D,J);if(de==="int")return yt(D,J);if(de==="rational")return it(D,J);if(de==="timecode")return Mt(D,J);if(de==="preview")return J.value+=P,"skipped";J.value+=P}function ll(D,O,J){const de={};if(D.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";de.version=D.getUint8(4);const P=D.getUint8(5);de.spec={singleTile:!!(P&2),longName:!!(P&4),deepFormat:!!(P&8),multiPart:!!(P&16)},J.value=8;for(var F=!0;F;){var K=It(O,J);if(K==0)F=!1;else{var q=It(O,J),X=Ge(D,J),oe=al(D,O,J,q,X);oe===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${q}'.`):de[K]=oe}}if(P&-5)throw console.error("EXRHeader:",de),"THREE.EXRLoader: provided file is currently unsupported.";return de}function Pr(D,O,J,de,P){const F={size:0,viewer:O,array:J,offset:de,width:D.dataWindow.xMax-D.dataWindow.xMin+1,height:D.dataWindow.yMax-D.dataWindow.yMin+1,channels:D.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:D.channels[0].pixelType,uncompress:null,getter:null,format:null,[Nu?"colorSpace":"encoding"]:null};switch(D.compression){case"NO_COMPRESSION":F.lines=1,F.uncompress=Se;break;case"RLE_COMPRESSION":F.lines=1,F.uncompress=Ee;break;case"ZIPS_COMPRESSION":F.lines=1,F.uncompress=_e;break;case"ZIP_COMPRESSION":F.lines=16,F.uncompress=_e;break;case"PIZ_COMPRESSION":F.lines=32,F.uncompress=at;break;case"PXR24_COMPRESSION":F.lines=16,F.uncompress=Ve;break;case"DWAA_COMPRESSION":F.lines=32,F.uncompress=$e;break;case"DWAB_COMPRESSION":F.lines=256,F.uncompress=$e;break;default:throw"EXRLoader.parse: "+D.compression+" is unsupported"}if(F.scanlineBlockSize=F.lines,F.type==1)switch(P){case _n:F.getter=Ye,F.inputSize=2;break;case ei:F.getter=Te,F.inputSize=2;break}else if(F.type==2)switch(P){case _n:F.getter=te,F.inputSize=4;break;case ei:F.getter=Je,F.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+F.type+" for "+D.compression+".";F.blockCount=(D.dataWindow.yMax+1)/F.scanlineBlockSize;for(var K=0;K<F.blockCount;K++)bt(O,de);F.outputChannels=F.channels==3?4:F.channels;const q=F.width*F.height*F.outputChannels;switch(P){case _n:F.byteArray=new Float32Array(q),F.channels<F.outputChannels&&F.byteArray.fill(1,0,q);break;case ei:F.byteArray=new Uint16Array(q),F.channels<F.outputChannels&&F.byteArray.fill(15360,0,q);break;default:console.error("THREE.EXRLoader: unsupported type: ",P);break}return F.bytesPerLine=F.width*F.inputSize*F.channels,F.outputChannels==4?F.format=Ln:F.format=rh,Nu?F.colorSpace="srgb-linear":F.encoding=3e3,F}const Ir=new DataView(e),Js=new Uint8Array(e),es={value:0},ai=ll(Ir,e,es),Nt=Pr(ai,Ir,Js,es,this.type),Es={value:0},cl={R:0,G:1,B:2,A:3,Y:0};for(let D=0;D<Nt.height/Nt.scanlineBlockSize;D++){const O=Ge(Ir,es);Nt.size=Ge(Ir,es),Nt.lines=O+Nt.scanlineBlockSize>Nt.height?Nt.height-O:Nt.scanlineBlockSize;const de=Nt.size<Nt.lines*Nt.bytesPerLine?Nt.uncompress(Nt):Se(Nt);es.value+=Nt.size;for(let P=0;P<Nt.scanlineBlockSize;P++){const F=P+D*Nt.scanlineBlockSize;if(F>=Nt.height)break;for(let K=0;K<Nt.channels;K++){const q=cl[ai.channels[K].name];for(let X=0;X<Nt.width;X++){Es.value=(P*(Nt.channels*Nt.width)+K*Nt.width+X)*Nt.inputSize;const oe=(Nt.height-1-F)*(Nt.width*Nt.outputChannels)+X*Nt.outputChannels+q;Nt.byteArray[oe]=Nt.getter(de,Es)}}}}return{header:ai,width:Nt.width,height:Nt.height,data:Nt.byteArray,format:Nt.format,[Nu?"colorSpace":"encoding"]:Nt[Nu?"colorSpace":"encoding"],type:this.t
3997ype}}setDataType(e){return this.type=e,this}load(e,t,i,r){function s(o,a){Nu?o.colorSpace=a.colorSpace:o.encoding=a.encoding,o.minFilter=Qt,o.magFilter=Qt,o.generateMipmaps=!1,o.flipY=!1,t&&t(o,a)}return super.load(e,s,i,r)}}const c4=3e3,u4=3001,$C=(n,e,t)=>{let i;switch(n){case Yi:i=new Uint8ClampedArray(e*t*4);break;case ei:i=new Uint16Array(e*t*4);break;case xs:i=new Uint32Array(e*t*4);break;case Eg:i=new Int8Array(e*t*4);break;case Tg:i=new Int16Array(e*t*4);break;case ih:i=new Int32Array(e*t*4);break;case _n:i=new Float32Array(e*t*4);break;default:throw new Error("Unsupported data type")}return i};let bp;const f4=(n,e,t,i)=>{if(bp!==void 0)return bp;const r=new cr(1,1,i);e.setRenderTarget(r);const s=new xn(new Zo,new $s({color:16777215}));e.render(s,t),e.setRenderTarget(null);const o=$C(n,r.width,r.height);return e.readRenderTargetPixels(r,0,0,r.width,r.height,o),r.dispose(),s.geometry.dispose(),s.material.dispose(),bp=o[0]!==0,bp};class qS{constructor(e){En(this,"_renderer");En(this,"_rendererIsDisposable",!1);En(this,"_material");En(this,"_scene");En(this,"_camera");En(this,"_quad");En(this,"_renderTarget");En(this,"_width");En(this,"_height");En(this,"_type");En(this,"_colorSpace");En(this,"_supportsReadPixels",!0);En(this,"render",()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)});var i,r,s,o,a,u,f,h,d,p,m,y,w,_,v,S;this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace
vendor: 5,187 bytes, line 3997
3997=e.colorSpace;const t={format:Ln,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((i=e.renderTargetOptions)==null?void 0:i.anisotropy)!==void 0?(r=e.renderTargetOptions)==null?void 0:r.anisotropy:1,generateMipmaps:((s=e.renderTargetOptions)==null?void 0:s.generateMipmaps)!==void 0?(o=e.renderTargetOptions)==null?void 0:o.generateMipmaps:!1,magFilter:((a=e.renderTargetOptions)==null?void 0:a.magFilter)!==void 0?(u=e.renderTargetOptions)==null?void 0:u.magFilter:Qt,minFilter:((f=e.renderTargetOptions)==null?void 0:f.minFilter)!==void 0?(h=e.renderTargetOptions)==null?void 0:h.minFilter:Qt,samples:((d=e.renderTargetOptions)==null?void 0:d.samples)!==void 0?(p=e.renderTargetOptions)==null?void 0:p.samples:void 0,wrapS:((m=e.renderTargetOptions)==null?void 0:m.wrapS)!==void 0?(y=e.renderTargetOptions)==null?void 0:y.wrapS:Fn,wrapT:((w=e.renderTargetOptions)==null?void 0:w.wrapT)!==void 0?(_=e.renderTargetOptions)==null?void 0:_.wrapT:Fn};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=qS.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new uh,this._camera=new Bc,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!f4(this._type,this._renderer,this._camera,t)){let M;switch(this._type){case ei:M=this._renderer.extensions.has("EXT_color_buffer_float")?_n:void 0;break}M!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${_n}`),this._type=M):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new xn(new Zo,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new cr(this.width,this.height,t),this._renderTarget.texture.mapping=((v=e.renderTargetOptions)==null?void 0:v.mapping)!==void 0?(S=e.renderTargetOptions)==null?void 0:S.mapping:Bo}static instantiateRenderer(){const e=new SS;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=$C(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const t=new Zr(this.toArray(),this.width,this.height,Ln,this._type,(e==null?void 0:e.mapping)||Bo,(e==null?void 0:e.wrapS)||Fn,(e==null?void 0:e.wrapT)||Fn,(e==null?void 0:e.magFilter)||Qt,(e==null?void 0:e.minFilter)||Qt,(e==null?void 0:e.anisotropy)||1,Cr);return t.generateMipmaps=(e==null?void 0:e.generateMipmaps)!==void 0?e==null?void 0:e.generateMipmaps:!1,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof qi&&Object.values(this.material.uniforms).forEach(t=>{t.value instanceof nn&&t.value.dispose()}),Object.values(this.material).forEach(t=>{t instanceof nn&&t.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}class JC extends Error{}class eP extends Error{}const Du=(n,e,t)=>{const i=new RegExp(`${e}="([^"]*)"`,"i").exec(n);if(i)return i[1];const r=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(n);if(r){const s=r[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return s&&s.length===3?s.map(o=>o.replace(/<\/?rdf:li>/g,"")):r[1].trim()}if(t!==void 0)return t;throw new Error(`Can't find ${e} in gainmap metadata`)},h4=n=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(n):e=n.toString();let t=e.indexOf("<x:xmpmeta");for(;t!==-1;){const i=e.indexOf("x:xmpmeta>",t),r=e.slice(t,i+10);try{const s=Du(r,"hdrgm:GainMapMin","0"),o=Du(r,"hdrgm:GainMapMax"),a=Du(r,"hdrgm:Gamma","1"),u=Du(r,"hdrgm:OffsetSDR","0.015625"),f=Du(r,"hdrgm:OffsetHDR","0.015625"),h=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(r),d=h?h[1]:"0",p=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(r);if(!p)throw new Error("Incomplete gainmap metadata");const m=p[1];return{gainMapMin:Array.isArray(s)?s.map(y=>parseFloat(y)):[parseFloat(s),parseFloat(s),parseFloat(s)],gainMapMax:Array.isArray(o)?o.map(y=>parseFloat(y)):[parseFloat(o),parseFloat(o),parseFloat(o)],gamma:Array.isArray(a)?a.map(y=>parseFloat(y)):[parseFloat(a),parseFloat(a),parseFloat(a)],offsetSdr:Array.isArray(u)?u.map(y=>parseFloat(y)):[parseFloat(u),parseFloat(u),parseFloat(u)],offsetHdr:Array.isArray(f)?f.map(y=>parseFloat(y)):[parseFloat(f),parseFloat(f),parseFloat(f)],hdrCapacityMin:parseFloat(d),hdrCapacityMax:p
vendor: 4,549 bytes, lines 3997-4002
3997arseFloat(m)}}catch{}t=e.indexOf("<x:xmpmeta",i)}};class d4{constructor(e){En(this,"options");this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((t,i)=>{const r=this.options.debug,s=new DataView(e.buffer);if(s.getUint16(0)!==65496){i(new Error("Not a valid jpeg"));return}const o=s.byteLength;let a=2,u=0,f;for(;a<o;){if(++u>250){i(new Error(`Found no marker after ${u} loops ðµ`));return}if(s.getUint8(a)!==255){i(new Error(`Not a valid marker at offset 0x${a.toString(16)}, found: 0x${s.getUint8(a).toString(16)}`));return}if(f=s.getUint8(a+1),r&&console.log(`Marker: ${f.toString(16)}`),f===226){r&&console.log("Found APP2 marker (0xffe2)");const h=a+4;if(s.getUint32(h)===1297106432){const d=h+4;let p;if(s.getUint16(d)===18761)p=!1;else if(s.getUint16(d)===19789)p=!0;else{i(new Error("No valid endianness marker found in TIFF header"));return}if(s.getUint16(d+2,!p)!==42){i(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const m=s.getUint32(d+4,!p);if(m<8){i(new Error("Not valid TIFF data! (First offset less than 8)"));return}const y=d+m,w=s.getUint16(y,!p),_=y+2;let v=0;for(let I=_;I<_+12*w;I+=12)s.getUint16(I,!p)===45057&&(v=s.getUint32(I+8,!p));const M=y+2+w*12+4,T=[];for(let I=M;I<M+v*16;I+=16){const C={MPType:s.getUint32(I,!p),size:s.getUint32(I+4,!p),dataOffset:s.getUint32(I+8,!p),dependantImages:s.getUint32(I+12,!p),start:-1,end:-1,isFII:!1};C.dataOffset?(C.start=d+C.dataOffset,C.isFII=!1):(C.start=0,C.isFII=!0),C.end=C.start+C.size,T.push(C)}if(this.options.extractNonFII&&T.length){const I=new Blob([s]),C=[];for(const L of T){if(L.isFII&&!this.options.extractFII)continue;const N=I.slice(L.start,L.end+1,"image/jpeg");C.push(N)}t(C)}}}a+=2+s.getUint16(a+2)}})}}const p4=async n=>{const e=h4(n);if(!e)throw new eP("Gain map XMP metadata not found");const i=await new d4({extractFII:!0,extractNonFII:!0}).extract(n);if(i.length!==2)throw new JC("Gain map recovery image not found");return{sdr:new Uint8Array(await i[0].arrayBuffer()),gainMap:new Uint8Array(await i[1].arrayBuffer()),metadata:e}},zT=n=>new Promise((e,t)=>{const i=document.createElement("img");i.onload=()=>{e(i)},i.onerror=r=>{t(r)},i.src=URL.createObjectURL(n)});class m4 extends Ui{constructor(t,i){super(i);En(this,"_renderer");En(this,"_renderTargetOptions");En(this,"_internalLoadingManager");En(this,"_config");this._config=t,t.renderer&&(this._renderer=t.renderer),this._internalLoadingManager=new $g}setRenderer(t){return this._renderer=t,this}setRenderTargetOptions(t){return this._renderTargetOptions=t,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const t=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new nn,sdr:new nn});return this._config.createQuadRenderer({width:16,height:16,type:ei,colorSpace:Cr,material:t,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(t,i,r){const s=i?new Blob([i],{type:"image/jpeg"}):void 0,o=new Blob([t],{type:"image/jpeg"});let a,u,f=!1;if(typeof createImageBitmap>"u"){const h=await Promise.all([s?zT(s):Promise.resolve(void 0),zT(o)]);u=h[0],a=h[1],f=r==="flipY"}else{const h=await Promise.all([s?createImageBitmap(s,{imageOrientation:r||"flipY"}):Promise.resolve(void 0),createImageBitmap(o,{imageOrientation:r||"flipY"})]);u=h[0],a=h[1]}return{sdrImage:a,gainMapImage:u,needsFlip:f}}createTextures(t,i,r){const s=new nn(i||new ImageData(2,2),Bo,Fn,Fn,Qt,B_,Ln,Yi,1,Cr);s.flipY=r,s.needsUpdate=!0;const o=new nn(t,Bo,Fn,Fn,Qt,B_,Ln,Yi,1,ir);return o.flipY=r,o.needsUpdate=!0,{gainMap:s,sdr:o}}updateQuadRenderer(t,i,r,s,o){t.width=i.width,t.height=i.height,t.material.gainMap=r,t.material.sdr=s,t.material.gainMapMin=o.gainMapMin,t.material.gainMapMax=o.gainMapMax,t.material.offsetHdr=o.offsetHdr,t.material.offsetSdr=o.offsetSdr,t.material.gamma=o.gamma,t.material.hdrCapacityMin=o.hdrCapacityMin,t.material.hdrCapacityMax=o.hdrCapacityMax,t.material.maxDisplayBoost=Math.pow(2,o.hdrCapacityMax),t.material.needsUpdate=!0}}const g4=` 3998varying vec2 vUv; 3999 4000void main() { 4001 vUv = uv; 4002 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
4002); 4003} 4004`,v4=` 4005// min half float value 4006#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 ) 4007// max half float value 4008#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 ) 4009 4010uniform sampler2D sdr; 4011uniform sampler2D gainMap; 4012uniform vec3 gamma; 4013uniform vec3 offsetHdr; 4014uniform vec3 offsetSdr; 4015uniform vec3 gainMapMin; 4016uniform vec3 gainMapMax; 4017uniform float weightFactor; 4018 4019varying vec2 vUv; 4020 4021void main() { 4022 vec3 rgb = texture2D( sdr, vUv ).rgb; 4023 vec3 recovery = texture2D( gainMap, vUv ).rgb; 4024 vec3 logRecovery = pow( recovery, gamma ); 4025 vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery; 4026 vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr; 4027 vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor )); 4028 gl_FragColor = vec4( clampedHdrColor , 1.0 ); 4029} 4030`;class y4 extends qi{constructor({gamma:t,offsetHdr:i,offsetSdr:r,gainMapMin:s,gainMapMax:o,maxDisplayBoost:a,hdrCapacityMin:u,hdrCapacityMax:f,sdr:h,gainMap:d}){super({name:"GainMapDecoderMaterial",vertexShader:g4,fragmentShader:v4,uniforms:{sdr:{value:h},gainMap:{value:d},gamma:{value:new k(1/t[0],1/t[1],1/t[2])},offsetHdr:{value:new k().fromArray(i)},offsetSdr:{value:new k().fromArray(r)},gainMapMin:{value:new k().fromArray(s)},gainMapMax:{value:new k().fromArray(o)},weightFactor:{value:(Math.log2(a)-u)/(f-u)}},blending:gs,depthTest:!1,depthWrite:!1});En(this,"_maxDisplayBoost");En(this,"_hdrCapacityMin");En(this,"_hdrCapacityMax");this._maxDisplayBoost=a,this._hdrCapacityMin=u,this._hdrCapacityMax=f,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(t){this.uniforms.sdr.value=t}get gainMap(){return this.uniforms.gainMap.value}set gainMap(t){this.uniforms.gainMap.value=t}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(t){this.uniforms.offsetHdr.value.fromArray(t)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(t){this.uniforms.offsetSdr.value.fromArray(t)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(t){this.uniforms.gainMapMin.value.fromArray(t)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(t){this.uniforms.gainMapMax.value.fromArray(t)}get gamma(){const t=this.uniforms.gamma.value;return[1/t.x,1/t.y,1/t.z]}set gamma(t){const i=this.uniforms.gamma.value;i.x=1/t[0],i.y=1/t[1],i.z=1/t[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(t){this._hdrCapacityMin=t,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(t){this._hdrCapacityMax=t,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(t){this._maxDisplayBoost=Math.max(1,Math.min(65504,t)),this.calculateWeight()}calculateWeight(){const t=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,t))}}class tP extends m4{constructor(e,t){super({renderer:e,createMaterial:i=>new y4(i),createQuadRenderer:i=>new qS(i)},t)}async render(e,t,i,r){const{sdrImage:s,gainMapImage:o,needsFlip:a}=await this.processImages(i,r,"flipY"),{gainMap:u,sdr:f}=this.createTextures(s,o,a);this.updateQuadRenderer(e,s,u,f,t),e.render()}}class _4 extends tP{load([e,t,i],r,s,o){const a=this.prepareQuadRenderer();let u,f,h;const d=async()=>{if(u&&f&&h){try{await this.render(a,h,u,f)}catch(B){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(i),typeof o=="function"&&o(B),a.disposeOnDemandRenderer();return}typeof r=="function"&&r(a),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(i),a.disposeOnDemandRenderer()}};let p=!0,m=0,y=0,w=!0,_=0,v=0,S=!0,M=0,T=0;const I=()=>{if(typeof s=="function"){const B=m+_+M,A=y+v+T,R=p&&w&&S;s(new ProgressEvent("progress",{lengthComputable:R,loaded:A,total:B}))}};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(i);const C=new ar(this._internalLoadingManager);C.setResponseType("arraybuffer"),C.setRequestHeader(this.requestHeader),C.setPath(this.path),C.setWithCredentials(this.withCredentials),C.load(e,async B=>
4030{if(typeof B=="string")throw new Error("Invalid sdr buffer");u=B,await d()},B=>{p=B.lengthComputable,y=B.loaded,m=B.total,I()},B=>{this.manager.itemError(e),typeof o=="function"&&o(B)});const L=new ar(this._internalLoadingManager);L.setResponseType("arraybuffer"),L.setRequestHeader(this.requestHeader),L.setPath(this.path),L.setWithCredentials(this.withCredentials),L.load(t,async B=>{if(typeof B=="string")throw new Error("Invalid gainmap buffer");f=B,await d()},B=>{w=B.lengthComputable,v=B.loaded,_=B.total,I()},B=>{this.manager.itemError(t),typeof o=="function"&&o(B)});const N=new ar(this._internalLoadingManager);return N.setRequestHeader(this.requestHeader),N.setPath(this.path),N.setWithCredentials(this.withCredentials),N.load(i,async B=>{if(typeof B!="string")throw new Error("Invalid metadata string");h=JSON.parse(B),await d()},B=>{S=B.lengthComputable,T=B.loaded,M=B.total,I()},B=>{this.manager.itemError(i),typeof o=="function"&&o(B)}),a}}class x4 extends tP{load(e,t,i,r){const s=this.prepareQuadRenderer(),o=new ar(this._internalLoadingManager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(this.withCredentials),this.manager.itemStart(e),o.load(e,async a=>{if(typeof a=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const u=new Uint8Array(a);let f,h,d;try{const p=await p4(u);f=p.sdr,h=p.gainMap,d=p.metadata}catch(p){if(p instanceof eP||p instanceof JC)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),d={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},f=u;else throw p}try{await this.render(s,d,f.buffer,h==null?void 0:h.buffer)}catch(p){this.manager.itemError(e),typeof r=="function"&&r(p),s.disposeOnDemandRenderer();return}typeof t=="function"&&t(s),this.manager.itemEnd(e),s.disposeOnDemandRenderer()},i,a=>{this.manager.itemError(e),typeof r=="function"&&r(a)}),s}}const Yf={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},nP="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",gc=n=>Array.isArray(n),ZS=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function e0({files:n=ZS,path:e="",preset:t=void 0,encoding:i=void 0,extensions:r}={}){let s=null,o=!1;t&&(KS(t),n=Yf[t],e=nP),o=gc(n);const{extension:a,isCubemap:u}=QS(n);if(s=$S(a),!s)throw new Error("useEnvironment: Unrecognized file extension: "+n);const f=Cc(m=>m.gl);ee.useLayoutEffect(()=>{if(a!=="webp"&&a!=="jpg"&&a!=="jpeg")return;function m(){Pc.clear(s,o?[n]:n)}f.domElement.addEventListener("webglcontextlost",m,{once:!0})},[n,f.domElement]);const h=Pc(s,o?[n]:n,m=>{(a==="webp"||a==="jpg"||a==="jpeg")&&m.setRenderer(f),m.setPath==null||m.setPath(e),r&&r(m)});let d=o?h[0]:h;if(a==="jpg"||a==="jpeg"||a==="webp"){var p;d=(p=d.renderTarget)==null?void 0:p.texture}return d.mapping=u?_s:Ec,"colorSpace"in d?d.colorSpace=i??u?"srgb":"srgb-linear":d.encoding=i??u?u4:c4,d}const S4={files:ZS,path:"",preset:void 0,extensions:void 0};e0.preload=n=>{const e={...S4,...n};let{files:t,path:i=""}=e;
4030const{preset:r,extensions:s}=e;r&&(KS(r),t=Yf[r],i=nP);const{extension:o}=QS(t);if(o==="webp"||o==="jpg"||o==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const a=$S(o);if(!a)throw new Error("useEnvironment: Unrecognized file extension: "+t);Pc.preload(a,gc(t)?[t]:t,u=>{u.setPath==null||u.setPath(i),s&&s(u)})};const M4={files:ZS,preset:void 0};e0.clear=n=>{const e={...M4,...n};let{files:t}=e;const{preset:i}=e;i&&(KS(i),t=Yf[i]);const{extension:r}=QS(t),s=$S(r);if(!s)throw new Error("useEnvironment: Unrecognized file extension: "+t);Pc.clear(s,gc(t)?[t]:t)};function KS(n){if(!(n in Yf))throw new Error("Preset must be one of: "+Object.keys(Yf).join(", "))}function QS(n){var e;const t=gc(n)&&n.length===6,i=gc(n)&&n.length===3&&n.some(o=>o.endsWith("json")),r=gc(n)?n[0]:n;return{extension:t?"cube":i?"webp":r.startsWith("data:application/exr")?"exr":r.startsWith("data:application/hdr")?"hdr":r.startsWith("data:image/jpeg")?"jpg":(e=r.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:t,isGainmap:i}}function $S(n){return n==="cube"?sC:n==="hdr"?a4:n==="exr"?l4:n==="jpg"||n==="jpeg"?x4:n==="webp"?_4:null}const w4=n=>n.current&&n.current.isScene,E4=n=>w4(n)?n.current:n;function JS(n,e,t,i,r={}){var s,o,a,u;r={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...r};const f=E4(e||t),h=f.background,d=f.environment,p={backgroundBlurriness:f.backgroundBlurriness,backgroundIntensity:f.backgroundIntensity,backgroundRotation:(s=(o=f.backgroundRotation)==null||o.clone==null?void 0:o.clone())!==null&&s!==void 0?s:[0,0,0],environmentIntensity:f.environmentIntensity,environmentRotation:(a=(u=f.environmentRotation)==null||u.clone==null?void 0:u.clone())!==null&&a!==void 0?a:[0,0,0]};return n!=="only"&&(f.environment=i),n&&(f.background=i),Mo(f,r),()=>{n!=="only"&&(f.environment=d),n&&(f.background=h),Mo(f,p)}}function e1({scene:n,background:e=!1,map:t,...i}){const r=Cc(s=>s.scene);return ee.useLayoutEffect(()=>{if(t)return JS(e,n,r,t,i)}),null}function iP({background:n=!1,scene:e,blur:t,backgroundBlurriness:i,backgroundIntensity:r,backgroundRotation:s,environmentIntensity:o,environmentRotation:a,...u}){const f=e0(u),h=Cc(d=>d.scene);return ee.useLayoutEffect(()=>JS(n,e,h,f,{backgroundBlurriness:t??i,backgroundIntensity:r,backgroundRotation:s,environmentIntensity:o,environmentRotation:a})),ee.useEffect(()=>()=>{f.dispose()},[f]),null}function T4({children:n,near:e=.1,far:t=1e3,resolution:i=256,frames:r=1,map:s,background:o=!1,blur:a,backgroundBlurriness:u,backgroundIntensity:f,backgroundRotation:h,environmentIntensity:d,environmentRotation:p,scene:m,files:y,path:w,preset:_=void 0,extensions:v}){const S=Cc(N=>N.gl),M=Cc(N=>N.scene),T=ee.useRef(null),[I]=ee.useState(()=>new uh),C=ee.useMemo(()=>{const N=new gS(i);return N.texture.type=ei,N},[i]);ee.useEffect(()=>()=>{C.dispose()},[C]),ee.useLayoutEffect(()=>{if(r===1){const N=S.autoClear;S.autoClear=!0,T.current.update(S,I),S.autoClear=N}return JS(o,m,M,C.texture,{backgroundBlurriness:a??u,backgroundIntensity:f,backgroundRotation:h,environmentIntensity:d,environmentRotation:p})},[n,I,C.texture,m,M,o,r,S]);let L=1;return Qr(()=>{if(r===1/0||L<r){const N=S.autoClear;S.autoClear=!0,T.current.update(S,I),S.autoClear=N,L++}}),ee.createElement(ee.Fragment,null,RB(ee.createElement(ee.Fragment,null,n,ee.createElement("cubeCamera",{ref:T,args:[e,t,C]}),y||_?ee.createElement(iP,{background:!0,files:y,preset:_,path:w,extensions:v}):s?ee.createElement(e1,{background:!0,map:s,extensions:v}):null),I))}function A4(n){var e,t,i,r;const s=e0(n),o=n.map||s;ee.useMemo(()=>bC({GroundProjectedEnvImpl:o4}),[]),ee.useEffect(()=>()=>{s.dispose()},[s]);const a=ee.useMemo(()=>[o],[o]),u=(e=n.ground)==null?void 0:e.height,f=(t=n.ground)==null?void 0:t.radius,h=(i=(r=n.ground)==null?void 0:r.scale)!==null&&i!==void 0?i:1e3;return ee.createElement(ee.Fragment,null,ee.createElement(e1,tx({},n,{map:o})),ee.createElement("groundProjectedEnvImpl",{args:a,scale:h,height:u,radius:f}))}function b4(n){return n.ground?ee.createElement(A4,n):n.map?ee.createElement(e1,n):n.children?ee.createElement(T4,n):ee.createElement(iP,n)}const t0=6,n0=2.3,_h=.2,xh=.035,ol=.01,bi=ol/2,ti=.15,rP=.01,R4=rP/2,Wp=.2,i0=.4,t1=.03,Fo=8,Xp=2,sP=.007,oP=.005,Vo=-_h/2+xh+bi,Wo=_h/2-xh-2*ol+bi,qf=Vo+ol,jp=Wo-qf,Vc=t0-2*xh,Lc=n0-2*xh,Be={BOTTOM_MAT:[.38,.43],SPACERS:[.43,.47],STIRRUPS:[.47,.53],CORNER_BARS:[.53,.55],TOP_MAT:[.55,.58],PROBLEM_TILES:[.58,.7],STEEL_FADE:[.66,.86],LATTICE:[.66,.86],PAUSE:[.86,.94],EXPLAIN:[.94,1.05],BENEFIT_TILES:[.94,1.05],OUTRO:[1.05,1.14]},BT=[{index:"01",stat:{de:"19 h",en:"19 h"},label:{de:"Handarbeit pro Tonne Bewehrung",en:"of hand labor per ton of rebar"}
4030,detail:{de:"Jede Tonne wird Stab für Stab gebogen, geschnitten und gebunden, auf jeder Baustelle neu.",en:"Every ton is bent, cut and tied bar by bar, fresh on every site."}},{index:"02",stat:{de:"50 %",en:"50 %"},label:{de:"der Baukosten sind Lohn",en:"of construction cost is labor"},detail:{de:"Bewehren ist die gröÃte verbliebene Handarbeit im Rohbau.",en:"Reinforcement is the largest piece of hand labor left in the build."}},{index:"03",stat:{de:"+909 %",en:"+909 %"},label:{de:"Anstieg der Baukosten in 30 Jahren, die Produktivität nur um 3 %",en:"rise in construction cost over 30 years, while productivity grew just 3 %"},detail:{de:"Während andere Industrien automatisierten, blieb der Bau stehen. Die Schere geht weiter auf.",en:"While other industries automated, construction stood still. The gap keeps widening."}},{index:"04",stat:{de:"1 / 3",en:"1 / 3"},label:{de:"Brücken marode durch Korrosion",en:"bridges failing from corrosion"},detail:{de:"Stahl im Beton rostet über die Lebensdauer und treibt den Sanierungsstau.",en:"Steel in concrete rusts over its lifetime and drives the repair backlog."}},{index:"05",stat:{de:"100 Mrd. â¬",en:"⬠100 bn"},label:{de:"Sanierungsstau Brücken, vor allem Korrosion",en:"bridge repair backlog, mostly corrosion"},detail:{de:"Bezifferter Schaden allein an Deutschlands Brücken. Treiber: rostender Stahl im Beton.",en:"Quantified damage on Germany's bridges alone. Driver: rusting steel in concrete."}}],HT=[{index:"01",stat:{de:"â40 %",en:"â40 %"},label:{de:"Gesamtkosten am fertigen Bauteil",en:"total cost on the finished element"},detail:{de:"Der gröÃte Teil der Ersparnis entsteht durch den Wegfall der manuellen Bewehrungsarbeit. Schlankere, korrosionsfreie Bauteile senken zusätzlich den Beton- und Materialeinsatz.",en:"Most of the saving comes from removing manual reinfor
4030cement work. Slimmer, corrosion-free elements reduce concrete and material use on top of that."}},{index:"02",stat:{de:"20 Ã",en:"20 Ã"},label:{de:"schneller verlegt am Bau",en:"faster to place on site"},detail:{de:"Ein vorgefertigtes Modul ersetzt einen kompletten von Hand gebundenen Bewehrungskorb und verkürzt den Einbau von Tagen Handarbeit auf einen Setzvorgang.",en:"A single prefabricated module replaces a complete hand-tied reinforcement cage, reducing installation from days of manual work to one placement step."}},{index:"03",stat:{de:"â80 %",en:"â80 %"},label:{de:"eingebetteter COâ-Footprint",en:"embedded COâ footprint"},detail:{de:"Faser korrodiert nicht, daher kann die Betondeckung reduziert werden. Zusammen mit deutlich weniger Stahl und weiterer Geometrieoptimierung sinkt der COâ-FuÃabdruck um bis zu 80 Prozent.",en:"Fiber does not corrode, so the protective concrete cover can be reduced. Together with far less steel and further geometry optimisation, the embodied COâ footprint drops by up to 80 percent."}},{index:"04",stat:{de:"0 %",en:"0 %"},label:{de:"Korrosion über die Lebensdauer",en:"corrosion across the lifetime"},detail:{de:"Faserbewehrung rostet nicht. Bauwerke sparen die Sanierungszyklen und den Korrosionsschutz, die Stahl erfordert, und damit Kosten über die gesamte Lebensdauer.",en:"Fiber reinforcement does not rust. Structures avoid the repair cycles and corrosion protection that steel requires, lowering cost across the full service life."}}],aP={pos:[8,5,9],target:[0,-.05,0]},r0="#bdc0c6",s0=.85,o0=.32,ig="#6f7479",n1=.55,i1=.32,lP=.55,cP=18,GT="#ff8a1a",uP=.03,C4=Math.floor((t0-2*xh)/Wp)+1,rx=C4*2,sx=8,P4=7850,a0=n=>Math.PI*(n/2)**2*P4;let Sh=1;const fP=a0(ol),I4=a0(rP),L4=a0(sP),N4=a0(oP),r1=Math.floor(Vc/ti)+1,s1=Math.floor(Lc/ti)+1,hP=(r1-1)*ti+2*uP,dP=(s1-1)*ti+2*uP,pP=(s1*hP+r1*dP)*fP,mP=Xp*(3*L4+1.7*N4),D4=Wo+ol-Vo,U4=2*i0+2*D4+Math.PI*t1,gP=U4*I4,vP=Vc*fP,O4=2*pP+Fo*mP+rx*gP+sx*vP;Sh=1e3/O4;const VT=pP*Sh,F4=mP*Sh,k4=gP*Sh,z4=vP*Sh,WT=24,XT=12,B4=.008,jT=B4/2,H4=45*Math.PI/180,G4=.008,V4=G4/2,cf=.02,rg=2*(n0-2*cf+(_h-2*cf))+2*Math.PI*cf,W4=1,X4=30,j4=hP,Y4=dP,YT=r1,Nc=s1,un={current:0,velocity:0,scrollTo:()=>{}},q4=1.14;typeof window<"u"&&(window.__scroll=un);function Z4(n){const e=Math.clamp(n,0,1);return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}Math.clamp=(n,e,t)=>Math.max(e,Math.min(t,n));function wr(n,e,t){return Math.clamp((n-e)/(t-e),0,1)}function Wc(n,e,t){return 1-Math.clamp((n-e)/(t-e),0,1)}function Ha(n,e,t,i=1.5){const r=1/(t+i-1);return Math.clamp((n-e*r)/(r*i),0,1)}function l0(n,e,t=0){const i=Math.clamp(e,0,1),r=(1-i)*(1-i),s=Math.clamp(t*2,0,1);return n*r*(1+.5*s)}const By=96;function yP(n,e,t,i){const r=2*(e-2*i+(t-2*i))+2*Math.PI*i;if(r<=0)return[0,0];let s=n%r;s<0&&(s+=r);const o=Math.max(0,e-2*i),a=Math.max(0,t-2*i),u=Math.PI*i/2;let f,h;if(s<o)f=-e/2+i+s,h=-t/2;else if(s<o+u){const d=(s-o)/i;f=e/2-i+i*Math.sin(d),h=-t/2+i-i*Math.cos(d)}else if(s<o+u+a)f=e/2,h=-t/2+i+(s-o-u);else if(s<o+2*u+a){const d=(s-o-u-a)/i;f=e/2-i+i*Math.cos(d),h=t/2-i+i*Math.sin(d)}else if(s<2*o+2*u+a)f=e/2-i-(s-o-2*u-a),h=t/2;else if(s<2*o+3*u+a){const d=(s-2*o-2*u-a)/i;f=-e/2+i-i*Math.sin(d),h=t/2-i+i*Math.cos(d)}else if(s<2*o+3*u+2*a)f=-e/2,h=t/2-i-(s-2*o-3*u-a);else{const d=(s-2*o-3*u-2*a)/i;f=-e/2+i-i*Math.cos(d),h=-t/2+i-i*Math.sin(d)}return[f,h]}const K4=Math.tan(H4)/rg;function Q4(n,e){const t=[],i=t0;for(let s=0;s<=By;s++){const o=s/By,a=-i/2+o*i,u=n+e*(a+i/2)*K4*rg,[f,h]=yP(u,n0,_h,cf);t.push(new k(a,h,f))}const r=new Bg(t,!1,"catmullrom",0);return new Gc(r,By,V4,6,!1)}function $4({scrollProgress:n,phaseStart:e,phaseEnd:t,fadeOutStart:i,fadeOutEnd:r}){const s=ee.useMemo(()=>{const u=[],f=rg/WT;for(let d=0;d<WT;d++)for(const p of[1,-1])u.push(Q4(f*d,p));const h=rg/XT;for(let d=0;d<XT;d++){const p=d*h,[m,y]=yP(p,n0,_h,cf),w=new Ss(jT,jT,t0,6,1);w.applyMatrix4(new mt().makeRotationZ(Math.PI/2)),w.applyMatrix4(new mt().makeTranslation(0,y,m)),u.push(w)}return u},[]),o=ee.useRef(null),a=ee.useRef([]);return Qr(()=>{const u=n.current,f=wr(u,e,t),h=s.length,d=.35,p=1/(h+d-1);let m=1;if(i!==void 0){const v=r??i+.04;m=1-Math.max(0,Math.min(1,(u-i)/(v-i)))}const y=Math.max(0,Math.min(1,(u-Be.OUTRO[0])/(Be.OUTRO[1]-Be.OUTRO[0]))),w=Z4(y)*13,_=y<.55?1:1-(y-.55)
4030/.45;o.current&&(o.current.rotation.y=Math.max(0,u-lP)*cP,o.current.position.y=w,o.current.visible=f>0&&m*_>.005);for(let v=0;v<h;v++){const S=a.current[v];if(!S)continue;const M=Math.max(0,Math.min(1,(f-v*p)/(p*d)));S.opacity=M*m*_}}),H.jsx("group",{ref:o,children:s.map((u,f)=>H.jsx("mesh",{geometry:u,castShadow:!1,children:H.jsx("meshStandardMaterial",{ref:h=>{a.current[f]=h},color:ig,metalness:n1,roughness:i1,transparent:!0,opacity:0})},f))})}function Ks(n,e){const t=n.length;if(t<3)return[];const i=new Array(t).fill(e);for(let a=0;a<t;a++){const u=n[(a-1+t)%t],f=n[a],h=n[(a+1)%t],d=Math.hypot(f[0]-u[0],f[1]-u[1]),p=Math.hypot(f[0]-h[0],f[1]-h[1]),m=u[0]-f[0],y=u[1]-f[1],w=h[0]-f[0],_=h[1]-f[1],v=(m*w+y*_)/(Math.hypot(m,y)*Math.hypot(w,_)),S=Math.acos(Math.max(-1,Math.min(1,v))),M=(Math.PI-S)/2,T=Math.tan(M),I=Math.min(d,p)/2;T>1e-9&&(i[a]=Math.min(e,I/T))}const r=new Array(t);for(let a=0;a<t;a++)r[a]=Math.max(0,Math.min(e,i[a]));const s=[];for(let a=0;a<t;a++){const u=n[(a-1+t)%t],f=n[a],h=n[(a+1)%t],d=u[0]-f[0],p=u[1]-f[1],m=Math.hypot(d,p),y=d/m,w=p/m,_=h[0]-f[0],v=h[1]-f[1],S=Math.hypot(_,v),M=_/S,T=v/S,I=y*M+w*T,C=Math.acos(Math.max(-1,Math.min(1,I))),L=r[a],N=(Math.PI-C)/2,B=Math.tan(N),A=L*B,R=f[0]+y*A,j=f[1]+w*A,Y=f[0]+M*A,Z=f[1]+T*A;s.push({__isEdgeToCorner:!0,cornerIdx:a,tangentInX:R,tangentInY:j,tangentOutX:Y,tangentOutY:Z,cornerX:f[0],cornerY:f[1],r:L})}const o=[];for(let a=0;a<t;a++){const u=s[(a-1+t)%t],f=s[a],h=u.tangentOutX,d=u.tangentOutY,p=f.tangentInX,m=f.tangentInY,y=p-h,w=m-d,_=Math.hypot(y,w);if(_>1e-6){const v=y/_,S=w/_;o.push({len:_,fn:M=>[h+v*M,d+S*M]})}if(f.r>1e-6){const v=n[a],S=n[(a-1+t)%t],M=n[(a+1)%t],T=(S[0]-v[0])/Math.hypot(S[0]-v[0],S[1]-v[1]),I=(S[1]-v[1])/Math.hypot(S[0]-v[0],S[1]-v[1]),C=(M[0]-v[0])/Math.hypot(M[0]-v[0],M[1]-v[1]),L=(M[1]-v[1])/Math.hypot(M[0]-v[0],M[1]-v[1]),N=T+C,B=I+L,A=Math.hypot(N,B),R=N/A,j=B/A,Y=T*C+I*L,Z=Math.acos(Math.max(-1,Math.min(1,Y))),ae=f.r/Math.sin(Z/2),Q=v[0]+R*ae,pe=v[1]+j*ae,z=Math.atan2(f.tangentInY-pe,f.tangentInX-Q),ie=Math.atan2(f.tangentOutY-pe,f.tangentOutX-Q),$=T*L-I*C;let le=ie-z;if($<0)for(;le<=0;)le+=2*Math.PI;else for(;le>=0;)le-=2*Math.PI;const ye=Math.abs(le)*f.r,De=f.r;o.push({len:ye,fn:ue=>{const Me=ue/ye,we=z+le*Me;return[Q+De*Math.cos(we),pe+De*Math.sin(we)]}})}}return o}function J4(n){return n.reduce((e,t)=>e+Math.max(0,t.len),0)}function qT(n,e,t){if(t<=0)return[0,0];let i=(n%t+t)%t;for(const s of e)if(!(s.len<=0)){if(i<=s.len)return s.fn(i);i-=s.len}const r=e[e.length-1];return r.fn(r.len)}function eH(n){const e=Math.max(20,n.width),t=Math.max(20,n.height),i=Math.max(0,n.cornerR||0);return Ks([[-e/2,-t/2],[e/2,-t/2],[e/2,t/2],[-e/2,t/2]],i)}function tH(n){const e=Math.max(20,n.bottomW),t=Math.max(0,n.topW),i=Math.max(20,n.height),r=Math.max(0,n.cornerR||0);return t<1?Ks([[-i/2,-e/2],[i/2,0],[-i/2,e/2]],r):Ks([[-i/2,-e/2],[i/2,-t/2],[i/2,t/2],[-i/2,e/2]],r)}function nH(n){const e=Math.max(80,n.flangeW),t=Math.max(80,n.totalH),i=Math.max(20,Math.min(n.flangeH,t-20)),r=Math.max(30,Math.min(n.webW,e-40)),s=Math.max(0,n.cornerR||0);return Ks([[-r/2,-t/2],[r/2,-t/2],[r/2,t/2-i],[e/2,t/2-i],[e/2,t/2],[-e/2,t/2],[-e/2,t/2-i],[-r/2,t/2-i]],s)}function iH(n){const e=Math.max(80,n.flangeW),t=Math.max(100,n.totalH),i=Math.max(15,Math.min(n.flangeH,t/2-10)),r=Math.max(20,Math.min(n.webW,e-40)),s=Math.max(0,n.cornerR||0);return Ks([[-e/2,-t/2],[e/2,-t/2],[e/2,-t/2+i],[r/2,-t/2+i],[r/2,t/2-i],[e/2,t/2-i],[e/2,t/2],[-e/2,t/2],[-e/2,t/2-i],[-r/2,t/2-i],[-r/2,-t/2+i],[-e/2,-t/2+i]],s)}function rH(n){const e=Math.max(100,n.legW),t=Math.max(100,n.legH),i=Math.max(20,Math.min(n.thickness,e-30,t-30)),r=Math.max(0,n.cornerR||0);return Ks([[-e/2,-t/2],[e/2,-t/2],[e/2,-t/2+i],[-e/2+i,-t/2+i],[-e/2+i,t/2],[-e/2,t/2]],r)}function sH(n){const e=Math.max(150,n.width),t=Math.max(80,n.height),i=Math.max(20,Math.min(n.thickness,e/2-30,t-30)),r=Math.max(0,n.cornerR||0);return Ks([[-e/2,-t/2],[e/2,-t/2],[e/2,t/2],[e/2-i,t/2],[e/2-i,-t/2+i],[-e/2+i,-t/2+i],[-e/2+i,t/2],[-e/2,t/2]],r)}function oH(n){const e=Math.max(50,n.baseW),t=Math.max(50,n.height),i=Math.max(0,n.cornerR||0);return Ks([[-e/2,-t/2],[e/2,-t/2],[0,t/2]],i)}function aH(n){const e=Math.max(3,Math.min(16,Math.round(n.sides))),t=Math.max(20,n.radius),i=Math.max(0,n.cornerR||0),r=[];for(let s=0;s<e;s++){const o=2*Math.PI*s/e-Math.PI/2;r.push([t*Math.cos(o),t*Math.sin(o)])}return Ks(r,i)}function lH(n){const e=Math.max(20,n.radius);return[{len:2*Math.PI*e,fn:t=>{const i=t/e;return[e*Math.cos(i),e*Math.sin(i)]}}]}function cH(n){const e=Math.max(20,n.radius);return[{len:2*e,fn:t=>[-e+t,0]},{len:Math.PI*e,fn:t=>{const i=t/e;return[e*Math.cos(i),e*Math.sin(i)]}}]}function uH(n){const e=Math.max(20,n.a),t=Math.max(20,n.b),i=Math.pow((e-t)/(e+t),2),r=Math.PI*(e+t)*(1+3*i/(10+Math.sqrt(4-3*i)));return[{len:r,fn:s=>{const o=2*Math.PI*s/r;return[e*Math.cos(o),t*Math.sin(o)]}}]}const ZT={rect:{label:"Rechteck",segments:eH,bounds:n=>({w:n.width,h:n.height})},trapez:{label:"Trapez",segments:tH,bounds:n=>({w:Math.max(n.bottomW,n.topW||0),h:n.height})},tProfile:{label:"T-Profil",segments:nH,bounds:n=>({w:n.flangeW,h:n.totalH})},iProfile:{label:"Doppel-T-Profil",segments:iH,bounds:n=>({w:n.flangeW,h:n.totalH})},lProfile:{label:"L-Profil",segments:rH,bounds:n=>({w:n.legW,h:n.legH})},uProfile:{label:"U-Profil",segments:sH,bounds:n=>({w:n.width,h:n.height})},triangle:{label:"Dreieck",segments:oH,bounds:n=>({w:n.baseW,h:n.height})},polygon:{label:"RegelmäÃiges n-Eck",segments:aH,bounds:n=>({w:2*n.radius,h:2*n.radius})},circle:{label:"Kreis",segments:lH,bounds:n=>({w:2*n.radius,h:2*n.radius})},semicircle:{label:"Halbkreis",segments:cH,bounds:n=>({w:2*n.radius,h:n.radius})},ellipse:{label:"Ellipse",segments:uH,bounds:n=>({w:2*n.a,h:2*n.b})}},fH={length:6e3,rodCount:24,helixAngle:45,helixDiam:8,longCount:12,longDiam:8};function _P(n){const e=n.shape,t=n.params,i={...fH,...n.lattice||{}};if(!ZT[e])throw new Error(`Unknown shape: ${e}`);const r=ZT[e],s=r.segments(t),o=J4(s),a=r.bounds(t),{length:u,rodCount:f,helixAngle:h,helixDiam:d,longCount:p,longDiam:m}=i,y=[],w=[];let _=0;const v=i.helixRingSegs??8,S=i.pointsPerRod??180;if(f>0&&d>0){const I=o/f,C=i.helixAngles,L=i.helixAngleStart,N=i.helixAngleMid,B=i.helixAngleEnd,A=i.helixTurns,R=L!=null&&B!=null,j=R&&A!=null,Y=d/2,Z=Q=>N!=null?Q<.5?L+(N-L)*(Q*2):N+(B-N)*((Q-.5)*2):L+(B-L)*Q;let ae=null;if(j){const Q=[0];for(let z=1;z<=S;z++){const ie=(z-.5)/S;Q[z]=Q[z-1]+Math.tan(Z(ie)*Math.PI/180)/S}const pe=Q[S]||1;ae=Q.map(z=>z/pe)}for(let Q=0;Q<f;Q++){const pe=Array.isArray(C)?C[Q%C.length]:h,z=Math.tan(pe*Math.PI/180)/o;for(const ie of[1,-1]){const $=I*Q,le=[];let ye=$,De=0;for(let We=0;We<=S;We++){const nt=We/S,xe=-u/2+nt*u;j?ye=$+ie*A*ae[We]*o:R?(ye+=ie*Math.tan(Z(nt)*Math.PI/180)*(nt-De)*u,De=nt):ye=$+ie*(xe+u/2)*z*o;const[G,Oe]=qT(ye,s,o);le.push([G,Oe,xe,ye])}const ue=_;for(let We=0;We<le.length;We++){const[nt,xe,G]=le[We];for(let Oe=0;Oe<v;Oe++){const Fe=2*Math.PI*Oe/v,Ie=nt+Y*Math.cos(Fe),He=xe+Y*Math.sin(Fe);y.push(G,Ie,He)}}for(let We=0;We<le.length-1;We++)for(let nt=0;nt<v;nt++){const xe=(nt+1)%v,G=ue+We*v+nt,Oe=ue+We*v+xe,Fe=ue+(We+1)*v+xe,Ie=ue+(We+1)*v+nt;w.push(G,Oe,Fe,G,Fe,Ie)}_=y.length/3;const Me=le[0],we=_;y.push(Me[2],Me[0],Me[1]),_++;for(let We=0;We<v;We++){const nt=(We+1)%v;w.push(we,ue+nt,ue+We)}const Ce=le[le.length-1],ct=_;y.push(Ce[2],Ce[0],Ce[1]),_++;const gt=ue+(le.length-1)*v;for(let We=0;We<v;We++){const nt=(We+1)%v;w.push(ct,gt+We,gt+nt)}}}}const M=12;if(p>0&&m>0){const I=m/2;for(let C=0;C<p;C++){const L=C*o/p,[N,B]=qT(L,s,o),A=_;for(let Y=0;Y<M;Y++){const Z=2*Math.PI*Y/M;y.push(-u/2,N+I*Math.cos(Z),B+I*Math.sin(Z))}for(let Y=0;Y<M;Y++){const Z=2*Math.PI*Y/M;y.push(u/2,N+I*Math.cos(Z),B+I*Math.sin(Z))}for(let Y=0;Y<M;Y++){const Z=(Y+1)%M,ae=A+Y,Q=A+Z,pe=A+M+Z,z=A+M+Y;w.push(ae,Q,pe,ae,pe,z)}_=y.length/3;const R=_;y.push(-u/2,N,B),_++;for(let Y=0;Y<M;Y++){const Z=(Y+1)%M;w.push(R,A+Z,A+Y)}const j=_;y.push(u/2,N,B),_++;for(let Y=0;Y<M;Y++){const Z=(Y+1)%M;w.push(j,A+M+Y,A+M+Z)}}}const T=new Pt;
4030return T.setAttribute("position",new lt(y,3)),T.setIndex(w),T.computeVertexNormals(),{geometry:T,info:{shape:e,label:r.label,bounds:a,perimeter:o,vertexCount:y.length/3,latticeParams:i}}}const hH={rodCount:18,longCount:10,helixDiam:8,longDiam:8,pointsPerRod:56,helixRingSegs:6},dH=4200,pH=45,KT=[{shape:"rect",params:{width:2100,height:700,cornerR:60}},{shape:"rect",params:{width:1400,height:1400,cornerR:90}},{shape:"rect",params:{width:700,height:2100,cornerR:60}},{shape:"polygon",params:{sides:6,radius:933,cornerR:70}},{shape:"trapez",params:{bottomW:1e3,topW:1800,height:1300,cornerR:60}},{shape:"tProfile",params:{flangeW:1500,flangeH:250,webW:450,totalH:1300,cornerR:50}},{shape:"lProfile",params:{legW:1400,legH:1400,thickness:350,cornerR:50}}];function mH(n){return n*n*(3-2*n)}function gH({scrollProgress:n}){const e=ee.useRef(null),t=ee.useRef(null),i=ee.useRef(0),{liveGeo:r,positionSets:s,scale:o}=ee.useMemo(()=>{const a=KT.map(m=>_P({shape:m.shape,params:m.params,lattice:{length:dH,helixAngle:pH,...hH}}).geometry),u=a.map(m=>m.getAttribute("position").array),f=a[0].clone();f.computeBoundingBox();const h=new k;f.boundingBox.getSize(h);const d=Math.max(h.x,h.y,h.z),p=d>0?6.96/d:1;return{liveGeo:f,positionSets:u,scale:p}},[]);return Qr((a,u)=>{i.current+=u;const f=6,h=30,d=KT.length,p=(i.current/f+n.current*h)%d,m=Math.floor(p),y=mH(p-m),w=s[m],_=s[(m+1)%d],v=r.getAttribute("position"),S=v.array;for(let I=0;I<S.length;I++)S[I]=w[I]+(_[I]-w[I])*y;v.needsUpdate=!0,r.computeVertexNormals(),e.current&&(e.current.rotation.y+=u*.11);const M=n.current,T=M<=.14?1:Math.max(0,1-(M-.14)/.08);t.current&&(t.current.opacity=T),e.current&&(e.current.visible=T>.01)}),H.jsx("group",{ref:e,scale:o,children:H.jsx("mesh",{geometry:r,children:H.jsx("meshStandardMaterial",{ref:t,color:ig,metalness:n1,roughness:i1,transparent:!0,opacity:1})})})}function xP(n,e=!1){const t=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),r=new Set(Object.keys(n[0].morphAttributes)),s={},o={},a=n[0].morphTargetsRelative,u=new Pt;let f=0;for(let h=0;h<n.length;++h){const d=n[h];let p=0;if(t!==(d.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const m in d.attributes){if(!i.has(m))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;s[m]===void 0&&(s[m]=[]),s[m].push(d.attributes[m]),p++}if(p!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(a!==d.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const m in d.morphAttributes){if(!r.has(m))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;o[m]===void 0&&(o[m]=[]),o[m].push(d.morphAttributes[m])}if(e){let m;if(t)m=d.index.count;else if(d.attributes.position!==void 0)m=d.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;u.addGroup(f,m,h),f+=m}}if(t){let h=0;const d=[];for(let p=0;p<n.length;++p){const m=n[p].index;for(let y=0;y<m.count;++y)d.push(m.getX(y)+h);h+=n[p].attributes.position.count}u.setIndex(d)}for(const h in s){const d=QT(s[h]);if(!d)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;u.setAttribute(h,d)}for(const h in o){const d=o[h][0].length;if(d===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[h]=[];for(let p=0;p<d;++p){const m=[];for(let w=0;w<o[h].length;++w)m.push(o[h][w][p]);const y=QT(m);
4030if(!y)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;u.morphAttributes[h].push(y)}}return u}function QT(n){let e,t,i,r=-1,s=0;for(let f=0;f<n.length;++f){const h=n[f];if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=h.itemSize),t!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=h.normalized),i!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(r===-1&&(r=h.gpuType),r!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=h.count*t}const o=new e(s),a=new Jt(o,t,i);let u=0;for(let f=0;f<n.length;++f){const h=n[f];if(h.isInterleavedBufferAttribute){const d=u/t;for(let p=0,m=h.count;p<m;p++)for(let y=0;y<t;y++){const w=h.getComponent(p,y);a.setComponent(p+d,y,w)}}else o.set(h.array,u);u+=h.count*t}return r!==void 0&&(a.gpuType=r),a}function vH(){const n=[],e=-((Nc-1)*ti)/2;for(let i=0;i<Nc;i++){const r=e+i*ti,s=new Ss(bi,bi,j4,8,1);s.applyMatrix4(new mt().makeRotationZ(Math.PI/2)),s.applyMatrix4(new mt().makeTranslation(0,0,r)),n.push(s)}const t=-((YT-1)*ti)/2;for(let i=0;i<YT;i++){const r=t+i*ti,s=new Ss(bi,bi,Y4,8,1);s.applyMatrix4(new mt().makeRotationX(Math.PI/2)),s.applyMatrix4(new mt().makeTranslation(r,bi*2,0)),n.push(s)}return xP(n,!1)}function $T({which:n,scrollProgress:e,phaseStart:t,phaseEnd:i}){const r=ee.useRef(null),s=ee.useRef(null),o=n==="bottom"?Vo:Wo,a=ee.useMemo(()=>vH(),[]);return Qr(()=>{if(!r.current||!s.current)return;const u=wr(e.current,t,i),f=e.velocity,h=Wc(e.current,Be.STEEL_FADE[0],Be.STEEL_FADE[1]),d=n==="bottom"?4.2:2.4,m=Math.min(1,u*(n==="bottom"?2.4:1.6))*h;s.current.opacity=m,r.current.castShadow=m>.05,r.current.position.y=o+l0(d,u,f)}),H.jsx("mesh",{ref:r,geometry:a,position:[0,o,0],castShadow:!1,receiveShadow:!1,children:H.jsx("meshStandardMaterial",{ref:s,color:r0,metalness:s0,roughness:o0,transparent:!0,opacity:0})})}const Hy=sP/2,yH=oP/2,Gl=.08;function _H(){const n=[],e=Xp/2,t=(s,o,a)=>{const u=new k().subVectors(o,s),f=u.length(),h=new Ss(a,a,f,6,1),d=new k().addVectors(s,o).multiplyScalar(.5),p=new Gn().setFromUnitVectors(new k(0,1,0),u.clone().normalize()),m=new mt().compose(d,p,new k(1,1,1));h.applyMatrix4(m),n.push(h)};t(new k(-Gl/2,0,-e),new k(-Gl/2,0,e),Hy),t(new k(Gl/2,0,-e),new k(Gl/2,0,e),Hy),t(new k(0,jp,-e),new k(0,jp,e),Hy);const i=Math.max(6,Math.floor(Xp/.12)),r=[];for(let s=0;s<=i;s++){const o=-e+s/i*Xp,a=s%2===1,u=a?0:Math.floor(s/2)%2===0?-Gl/2:Gl/2,f=a?jp:0;r.push(new k(u,f,o))}for(let s=0;s<r.length-1;s++)t(r[s],r[s+1],yH);return xP(n,!1)}function xH({scrollProgress:n,phaseStart:e,phaseEnd:t}){const i=ee.useMemo(()=>_H(),[]),r=ee.useMemo(()=>{const a=Math.floor(Vc/ti)+1,u=-((a-1)*ti)/2,f=Math.floor(a/(Fo+1));return Array.from({length:Fo},(h,d)=>u+(d+1)*f*ti)},[]),s=ee.useRef([]),o=ee.useRef([]);return Qr(()=>{const a=wr(n.current,e,t),u=n.velocity,f=Wc(n.current,Be.STEEL_FADE[0],Be.STEEL_FADE[1]);r.forEach((h,d)=>{const p=s.current[d],m=o.current[d];if(!p||!m)return;const y=Ha(a,d,Fo,1);m.opacity=y*f,p.castShadow=y>.05,p.position.set(h,qf+l0(1.8,y,u),0)})}),H.jsx(H.Fragment,{children:r.map((a,u)=>H.jsx("mesh",{ref:f=>{s.current[u]=f},geometry:i,position:[a,qf,0],castShadow:!1,children:H.jsx("meshStandardMaterial",{ref:f=>{o.current[u]=f},color:r0,metalness:s0,roughness:o0,transparent:!0,opacity:0})},u))})}function SP(){const n=Math.floor(Vc/ti)+1,e=-((n-1)*ti)/2,t=Math.floor(n/(Fo+1));return Array.from({length:Fo},(i,r)=>e+(r+1)*t*ti)}function SH(){const n=Wo+ol-Vo,e=t1,t=i0,i=12,r=[],s=n/2,o=-n/2;r.push(new k(0,s,0)),r.push(new k(t-e,s,0));for(let a=1;a<=i;a++){const u=Math.PI/2*(1-a/i);
4030r.push(new k(t-e+e*Math.cos(u),s-e+e*Math.sin(u),0))}r.push(new k(t,o+e,0));for(let a=1;a<=i;a++){const u=-(Math.PI/2)*(a/i);r.push(new k(t-e+e*Math.cos(u),o+e+e*Math.sin(u),0))}return r.push(new k(0,o,0)),r}function MH(){const n=SH(),e=new Bg(n,!1,"catmullrom",0);return new Gc(e,n.length*4,R4,6,!1)}function c0(){const n=Math.floor(Vc/Wp)+1,e=-((n-1)*Wp)/2,t=[];for(let i=0;i<n;i++){const r=e+i*Wp;t.push({x:r,zSide:1,idx:i*2}),t.push({x:r,zSide:-1,idx:i*2+1})}return t}function wH({scrollProgress:n,phaseStart:e,phaseEnd:t}){const i=ee.useMemo(()=>MH(),[]),r=ee.useMemo(()=>c0(),[]),s=ee.useRef([]),o=ee.useRef([]),a=(Vo+Wo)/2;return Qr(()=>{const u=wr(n.current,e,t),f=n.velocity,h=Wc(n.current,Be.STEEL_FADE[0],Be.STEEL_FADE[1]);r.forEach((d,p)=>{const m=s.current[p],y=o.current[p];if(!m||!y)return;const w=Ha(u,p,r.length,1);y.opacity=w*h,m.castShadow=w>.05,m.position.y=a+l0(1.6,w,f)})}),H.jsx(H.Fragment,{children:r.map(({x:u,zSide:f,idx:h},d)=>{const p=f*(Lc/2-i0),m=f>0?-Math.PI/2:Math.PI/2;return H.jsx("mesh",{ref:y=>{s.current[d]=y},geometry:i,position:[u,a,p],rotation:[0,m,0],castShadow:!1,children:H.jsx("meshStandardMaterial",{ref:y=>{o.current[d]=y},color:r0,metalness:s0,roughness:o0,transparent:!0,opacity:0})},h)})})}function MP(){const n=Wo+ol-Vo,e=t1,t=(Vo+Wo)/2,i=t+n/2-e-bi,r=t-n/2+e+bi,s=[];for(const o of[1,-1]){const a=o*(Lc/2-e-bi),u=o*(Lc/2-i0+e+bi);s.push({y:i,z:a}),s.push({y:r,z:a}),s.push({y:i,z:u}),s.push({y:r,z:u})}return s}function EH({scrollProgress:n,phaseStart:e,phaseEnd:t}){const i=ee.useMemo(()=>MP(),[]),r=ee.useRef([]),s=ee.useRef([]);return Qr(()=>{const o=wr(n.current,e,t),a=n.velocity,u=Wc(n.current,Be.STEEL_FADE[0],Be.STEEL_FADE[1]);i.forEach((f,h)=>{const d=r.current[h],p=s.current[h];if(!d||!p)return;const m=Ha(o,h,i.length,1);p.opacity=m*u,d.castShadow=m>.05,d.position.y=f.y+l0(1.5,m,a)})}),H.jsx(H.Fragment,{children:i.map((o,a)=>H.jsxs("mesh",{ref:u=>{r.current[a]=u},position:[0,o.y,o.z],rotation:[0,0,Math.PI/2],castShadow:!1,children:[H.jsx("cylinderGeometry",{args:[bi,bi,Vc,8,1]}),H.jsx("meshStandardMaterial",{ref:u=>{s.current[a]=u},color:r0,metalness:s0,roughness:o0,transparent:!0,opacity:0})]},a))})}const TH=.022,AH=.005;function Mh(n){return new Ii(Math.PI/2+n*13%7*.05,n*7%5*.1,n*11%9*.1)}function wh({ties:n,scrollProgress:e,phaseStart:t,phaseEnd:i,phaseOffset:r=.4}){const s=ee.useRef(null),o=ee.useRef(null),a=ee.useMemo(()=>new Gt,[]),u=ee.useMemo(()=>{const f=Array.from({length:n.length},(d,p)=>p);let h=2166136261;for(let d=f.length-1;d>0;d--){h=h*16777619>>>0;const p=h%(d+1);[f[d],f[p]]=[f[p],f[d]]}return f},[n.length]);return Qr(()=>{if(!s.current)return;const f=e.current,h=wr(f,t,i),d=Wc(f,Be.STEEL_FADE[0],Be.STEEL_FADE[1]),p=Math.max(.001,1-r),m=Math.max(0,Math.min(1,(h-r)/p));for(let y=0;y<n.length;y++){const w=u[y],_=Ha(m,y,n.length,1);a.position.copy(n[w].pos),a.rotation.copy(n[w].rot),a.scale.setScalar(_*d),a.updateMatrix(),s.current.setMatrixAt(w,a.matrix)}s.current.instanceMatrix.needsUpdate=!0,o.current&&(o.current.opacity=d)}),n.length===0?null:H.jsxs("instancedMesh",{ref:s,args:[void 0,void 0,n.length],castShadow:!1,children:[H.jsx("torusGeometry",{args:[TH,AH,6,16]}),H.jsx("meshStandardMaterial",{ref:o,color:GT,metalness:.4,roughness:.5,emissive:GT,emissiveIntensity:.9})]})}function bH(){const n=SP(),e=[],t=-((Nc-1)*ti)/2;let i=0;return n.forEach((r,s)=>{for(let o=0;o<Nc;o++){const a=t+o*ti;Math.abs(a)>1||e.push({pos:new k(r,qf,a),parent:s,rot:Mh(i++)})}}),e}function RH(n){const e=ee.useMemo(()=>bH(),[]);return H.jsx(wh,{ties:e,phaseOffset:.3,...n})}function CH(){const n=c0(),e=[];let t=100;return n.forEach((i,r)=>{const s=i.zSide*(Lc/2-bi-.02);e.push({pos:new k(i.x,Vo,s),parent:r,rot:Mh(t++)})}),e}function PH(){const n=c0(),e=[];let t=200;return n.forEach((i,r)=>{const s=i.zSide*(Lc/2-.05);e.push({pos:new k(i.x,Wo,s),parent:r,rot:Mh(t++)})}),e}function IH(n){const e=ee.useMemo(()=>CH(),[]);return H.jsx(wh,{ties:e,phaseOffset:.35,...n})}function LH(n){const e=ee.useMemo(()=>PH(),[]);return H.jsx(wh,{ties:e,phaseOffset:.55,...n})}function NH(){const n=MP(),e=c0(),t=[];let i=1e3;
4030return n.forEach((r,s)=>{e.forEach(o=>{Math.sign(o.zSide)===Math.sign(r.z)&&t.push({pos:new k(o.x,r.y,r.z),parent:s,rot:Mh(i++)})})}),t}function DH(n){const e=ee.useMemo(()=>NH(),[]);return H.jsx(wh,{ties:e,phaseOffset:.35,...n})}function UH(){const n=SP(),e=[],t=qf+jp+bi;let i=5e3;return n.forEach(r=>{const s=-((Nc-1)*ti)/2;for(let o=0;o<Nc;o+=2){const a=s+o*ti;Math.abs(a)>1||e.push({pos:new k(r,t,a),parent:0,rot:Mh(i++)})}}),e}function OH(n){const e=ee.useMemo(()=>UH(),[]);return H.jsx(wh,{ties:e,phaseOffset:.35,...n})}const FH=new k(...aP.pos),kH=new k(...aP.target),zH=new k(0,15,7),BH=new k(0,0,0),HH=9;function Gy(n){const e=Math.max(0,Math.min(1,n));return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function GH(){const{camera:n}=Cc(),e=ee.useRef(new k).current,t=ee.useRef(new k).current,i=ee.useRef(null);return Qr(()=>{const r=un.current,s=Be.BOTTOM_MAT[0],o=(Be.BOTTOM_MAT[0]+Be.TOP_MAT[1])/2;let a;if(r<.22?a=0:r<s?a=Gy((r-.22)/(s-.22)):r<o?a=1-Gy((r-s)/(o-s)):a=0,e.lerpVectors(FH,zH,a),t.lerpVectors(kH,BH,a),n.position.copy(e),n.lookAt(t),i.current){const u=Math.max(0,Math.min(1,(r-Be.BOTTOM_MAT[0])/(Be.BOTTOM_MAT[1]-Be.BOTTOM_MAT[0])));i.current.position.z=(1-Gy(u))*HH,i.current.rotation.y=Math.max(0,r-lP)*cP}}),H.jsxs(H.Fragment,{children:[H.jsx("fog",{attach:"fog",args:["#000000",16,38]}),H.jsx("color",{attach:"background",args:["#000000"]}),H.jsx(b4,{files:"/hdri/warehouse_1k.hdr",environmentIntensity:.45}),H.jsx("ambientLight",{intensity:.34}),H.jsx("directionalLight",{position:[7,11,5],intensity:2,castShadow:!0,"shadow-mapSize":[1024,1024],"shadow-camera-far":28,"shadow-camera-left":-7,"shadow-camera-right":7,"shadow-camera-top":5,"shadow-camera-bottom":-5,"shadow-bias":-2e-4}),H.jsx("directionalLight",{position:[-6,4,-5],intensity:.7,color:"#9fb3d9"}),H.jsx("pointLight",{position:[0,2.5,4],intensity:1,color:"#ffd49a"}),H.jsx("directionalLight",{position:[-4,2,6],intensity:.9,color:"#cfd8ff"}),H.jsx("directionalLight",{position:[5,6,2],intensity:.55,color:"#ffe2b8"}),H.jsx("pointLight",{position:[0,-.4,1.5],intensity:.75,color:"#ffffff",distance:6}),H.jsx(gH,{scrollProgress:un}),H.jsxs("group",{ref:i,children:[H.jsx($T,{which:"bottom",scrollProgress:un,phaseStart:Be.BOTTOM_MAT[0],phaseEnd:Be.BOTTOM_MAT[1]}),H.jsx(xH,{scrollProgress:un,phaseStart:Be.SPACERS[0],phaseEnd:Be.SPACERS[1]}),H.jsx(RH,{scrollProgress:un,phaseStart:Be.SPACERS[0],phaseEnd:Be.SPACERS[1]}),H.jsx(wH,{scrollProgress:un,phaseStart:Be.STIRRUPS[0],phaseEnd:Be.STIRRUPS[1]}),H.jsx(IH,{scrollProgress:un,phaseStart:Be.STIRRUPS[0],phaseEnd:Be.STIRRUPS[1]}),H.jsx(EH,{scrollProgress:un,phaseStart:Be.CORNER_BARS[0],phaseEnd:Be.CORNER_BARS[1]}),H.jsx(DH,{scrollProgress:un,phaseStart:Be.CORNER_BARS[0],phaseEnd:Be.CORNER_BARS[1]}),H.jsx($T,{which:"top",scrollProgress:un,phaseStart:Be.TOP_MAT[0],phaseEnd:Be.TOP_MAT[1]}),H.jsx(OH,{scrollProgress:un,phaseStart:Be.TOP_MAT[0],phaseEnd:Be.TOP_MAT[1]}),H.jsx(LH,{scrollProgress:un,phaseStart:Be.TOP_MAT[0],phaseEnd:Be.TOP_MAT[1]})]}),H.jsx($4,{scrollProgress:un,phaseStart:Be.LATTICE[0],phaseEnd:Be.LATTICE[1]})]})}const wP="soc-lang",JT="en";function VH(){if(typeof window>"u")return JT;try{const n=window.localStorage.getItem(wP);if(n==="de"||n==="en")return n}catch{}return JT}function EP(n){typeof document<"u"&&(document.documentElement.lang=n)}const Ga={current:VH(),subscribers:new Set};EP(Ga.current);function WH(n){return Ga.subscribers.add(n),()=>{Ga.subscribers.delete(n)}}function e2(){return Ga.current}function t2(n){if(Ga.current!==n){Ga.current=n,EP(n);try{typeof window<"u"&&window.localStorage.setItem(wP,n)}catch{}Ga.subscribers.forEach(e=>e())}}function Zi(){return ee.useSyncExternalStore(WH,e2,e2)}function Ja(n=640){const e=()=>typeof window<"u"&&window.innerWidth<=n,[t,i]=ee.useState(e);return ee.useEffect(()=>{const r=()=>i(e());return r(),window.addEventListener("resize",r,{passive:!0}),window.addEventListener("orientationchange",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[n]),t}function u0(n=600){const e=()=>typeof window<"u"&&Math.min(window.innerWidth,window.innerHeight)<=n,[t,i]=ee.useState(e);return ee.useEffect(()=>{const r=()=>i(e());return r(),window.addEventListener("resize",r,{passive:!0}),window.addEventListener("orientationchange",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[n]),t}const Na=[];let ox=!1;const XH="opacity(0.45) blur(1.2px)",n2=6,jH=50;let i2=0;function Yp(n){if(!Na.length){ox=!1;return}const e=n??0;if(e-i2<jH){requestAnimationFrame(Yp);return}if(i2=e,!(Math.min(window.innerWidth,window.innerHeight)<=600)){for(const s of Na)s.el.style.filter&&(s.el.style.filter="");requestAnimationFrame(Yp);return}const i=[];for(const s of Na){if(parseFloat(getComputedStyle(s.el).opacity||"1")<=.05)continue;const a=s.el.getBoundingClientRect();a.width<=0||a.height<=0||i.push({el:s.el,z:s.z,canRecede:s.canRecede,r:a})}const r=new Set;for(let s=0;s<i.length;s++){const o=i[s];if(o.canRecede)for(let a=0;a<i.length;a++){if(s===a)continue;const u=i[a];if(o.z>=u.z)continue;const f=Math.min(o.r.right,u.r.right)-Math.max(o.r.left,u.r.left),h=Math.min(o.r.bottom,u.r.bottom)-Math.max(o.r.top,u.r.top);if(f>n2&&h>n2){r.add(o.el);break}}}for(const s of Na){const o=r.has(s.el)?XH:"";s.el.style.filter!==o&&(s.el.style.filter=o)}requestAnimationFrame(Yp)}function Dc(n,e,t={}){const i={el:n,z:e,canRecede:t.canRecede!==!1};return Na.push(i),ox||(ox=!0,requestAnimationFrame(Yp)),()=>{const r=Na.indexOf(i);r>=0&&Na.splice(r,1),n.style.filter=""}}const YH={de:{material:{steel:"STAHL",carbon:"CARBON"},pieces:"Einzelteile",weight:"Gewicht",note:"* schematisch"},en:{material:{steel:"STEEL",carbon:"CARBON"},pieces:"Parts",weight:"Weight",note:"* schematic"}};function qH(n,e=0){let t=0,i=0;const r=wr(n,Be.BOTTOM_MAT[0],Be.BOTTOM_MAT[1]);t+=r,i+=r*VT;
4030const s=wr(n,Be.SPACERS[0],Be.SPACERS[1]);for(let m=0;m<Fo;m++){const y=Ha(s,m,Fo,1);t+=y,i+=y*F4}const o=wr(n,Be.STIRRUPS[0],Be.STIRRUPS[1]);for(let m=0;m<rx;m++){const y=Ha(o,m,rx,1);t+=y,i+=y*k4}const a=wr(n,Be.CORNER_BARS[0],Be.CORNER_BARS[1]);for(let m=0;m<sx;m++){const y=Ha(a,m,sx,1);t+=y,i+=y*z4}const u=wr(n,Be.TOP_MAT[0],Be.TOP_MAT[1]);t+=u,i+=u*VT;const f=Wc(n,Be.STEEL_FADE[0]+e,Be.STEEL_FADE[1]+e);t*=f,i*=f;const h=wr(n,Be.LATTICE[0]+e,Be.LATTICE[1]+e),d=h*W4,p=h*X4;return{pieces:t+d,weight:i+p}}const r2=new Intl.NumberFormat("de-DE",{minimumFractionDigits:0,maximumFractionDigits:0});function ZH({scrollProgress:n}){const e=ee.useRef(null),t=ee.useRef(null),i=ee.useRef(null),r=ee.useRef(null),s=ee.useRef(0),o=Zi(),a=u0(600),u=YH[o];return ee.useEffect(()=>{const h=a?.06:0,d=()=>{const p=n.current,{pieces:m,weight:y}=qH(p,h);t.current&&(t.current.textContent=r2.format(Math.round(m))),i.current&&(i.current.textContent=r2.format(Math.round(y)));const w=(Be.STEEL_FADE[0]+Be.LATTICE[1])/2+h;if(r.current&&(r.current.textContent=p>=w?u.material.carbon:u.material.steel),e.current){const _=Math.max(0,Be.BOTTOM_MAT[0]-.015),v=Be.BOTTOM_MAT[0],S=Be.OUTRO[0],M=Be.OUTRO[0]+.06;let T=0;p<_?T=0:p<v?T=(p-_)/(v-_):p<S?T=1:p<M?T=1-(p-S)/(M-S):T=0,e.current.style.opacity=String(Math.max(0,Math.min(1,T)))}s.current=requestAnimationFrame(d)};return s.current=requestAnimationFrame(d),()=>cancelAnimationFrame(s.current)},[n,u,a]),ee.useEffect(()=>{if(e.current)return Dc(e.current,100,{canRecede:!1})},[]),H.jsxs("div",{ref:e,style:{position:"fixed",bottom:28,left:"max(6vw, 32px)",pointerEvents:"none",userSelect:"none",zIndex:100,color:"#cfd1d6",fontFamily:'"Geist Mono", "JetBrains Mono", "SF Mono", ui-monospace, monospace',textAlign:"left",lineHeight:1.3,opacity:0,transition:"opacity 0.2s linear",padding:"16px 22px 14px",borderLeft:"1px solid rgba(255,255,255,0.25)",background:"linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0) 60%)",minWidth:220},children:[H.jsx("div",{ref:r,style:{fontSize:11,letterSpacing:"0.30em",color:"rgba(255,255,255,0.55)",marginBottom:14},children:"STAHL"}),H.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:14,alignItems:"baseline",paddingBottom:6,borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[H.jsx("span",{ref:t,style:{fontSize:28,fontWeight:400,color:"#fff",fontVariantNumeric:"tabular-nums",letterSpacing:"-0.02em",minWidth:48,display:"inline-block"},children:"0"}),H.jsx("span",{style:{fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.5)"},children:u.pieces})]}),H.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:14,alignItems:"baseline",paddingTop:6},children:[H.jsx("span",{ref:i,style:{fontSize:28,fontWeight:400,color:"#fff",fontVariantNumeric:"tabular-nums",letterSpacing:"-0.02em",minWidth:48,display:"inline-block"},children:"0"}),H.jsxs("span",{style:{fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.5)"},children:[u.weight," ",H.jsx("span",{style:{opacity:.6},children:"kg"})]})]})]})}const KH={de:{prefix:"Wir machen",phraseA:"korrodierenden Stahl",phraseB:"manuelle Arbeit",suffix:` 4031im Beton überflüssig.`,intro:"Bewehrung ist die letzte Schicht im Bau, die noch von Hand entsteht. Wir ersetzen die tausenden Stahlstäbe in jedem Bauteil durch ein einziges automatisiertes, korrosionsfreies Modul. Aus einem 150 Jahre alten Handwerk wird ein Produkt.",scroll:"scroll"},en:{prefix:"Making",phraseA:"corroding steel",phraseB:"manual labor",suffix:` 4032obsolete in concrete.`,intro:"Reinforcement is the last layer of construction still built by hand. We replace the thousands of steel bars inside every structure with one automated, corrosion-free module. A 150-year-old trade becomes a product.",scroll:"scroll"}},ax=n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,Vr={delay:1.8,holdA:2.6,tr:.85,holdB:1.9},QH=Vr.holdA+Vr.tr+Vr.holdB+Vr.tr;function $H(n){if(n<Vr.delay)return 0;const e=(n-Vr.delay)%QH,t=Vr.holdA,i=t+Vr.tr,r=i+Vr.holdB;return e<t?0:e<i?ax((e-t)/Vr.tr):e<r?1:1-ax((e-r)/Vr.tr)}function JH({scrollProgress:n}){const e=ee.useRef(null),t=ee.useRef(null),i=ee.useRef(null),r=ee.useRef(null),s=ee.useRef(null),o=ee.useRef(null),a=ee.useRef(0),u=ee.useRef(!1),f=ee.useRef(null),h=Zi(),d=KH[h],p=Ja(600);ee.useEffect(()=>{const y=o.current;y&&(y.style.opacity="0",y.style.transform="translateY(20px)",window.setTimeout(()=>{y.style.transition="opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1)",y.style.opacity="1",y.style.transform="translateY(0)"},180))},[]),ee.useEffect(()=>{const T=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1,I=()=>
4032{const C=n.current;f.current==null&&(f.current=performance.now());let L=1,N=0;if(C>.34){const Z=Math.max(0,Math.min(1,(C-.34)/.06));L=1-Z,N=Z*60}e.current&&(e.current.style.opacity=String(L),e.current.style.transform=`translateY(${-N}px)`,e.current.style.visibility=L<=.001?"hidden":"visible");let B=1;C>.005&&(B=1-(C-.005)/(.04-.005),B=Math.max(0,Math.min(1,B))),s.current&&(s.current.style.opacity=String(B));let A=0;C<.1?A=0:C>.16?A=1:A=(C-.1)/(.16-.1);const R=ax(A);C>.05&&(u.current=!0);let j=0;if(!T&&!u.current){const Z=Math.max(0,Math.min(1,C/.02));if(Z<1){const ae=(performance.now()-(f.current??0))/1e3;j=$H(ae)*(1-Z)}}const Y=Math.min(1,R+j);t.current&&(t.current.style.transform=`translateY(${-Y*100}%)`),i.current&&(i.current.style.opacity=String(1-Y)),r.current&&(r.current.style.opacity=String(Y)),a.current=requestAnimationFrame(I)};return a.current=requestAnimationFrame(I),()=>cancelAnimationFrame(a.current)},[n]);const m=d.suffix.split(` 4033`);return H.jsxs(H.Fragment,{children:[H.jsx("div",{ref:e,style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:45},children:H.jsxs("div",{ref:o,style:{position:"absolute",left:"max(6vw, 32px)",right:"max(6vw, 32px)",bottom:"max(20vh, 200px)",color:"rgba(255,255,255,0.95)",fontFamily:'"Geist", "Inter Tight", "Inter", system-ui, sans-serif',textShadow:"0 4px 24px rgba(0,0,0,0.6)",maxWidth:"min(1100px, 92vw)"},children:[H.jsxs("h1",{style:{margin:0,fontWeight:400,fontSize:p?"clamp(28px, 7.2vw, 46px)":"clamp(44px, 5.6vw, 88px)",lineHeight:1.08,letterSpacing:"-0.025em"},children:[H.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline"},children:[H.jsx("span",{style:{marginRight:"0.28em"},children:d.prefix.trim()}),H.jsxs("span",{"aria-label":`${d.phraseA} â ${d.phraseB}`,style:{display:"inline-block",position:"relative",overflow:"hidden",height:"1.08em",verticalAlign:"bottom",flexShrink:0},children:[H.jsx("span",{"aria-hidden":!0,style:{display:"inline-block",visibility:"hidden",whiteSpace:"nowrap"},children:d.phraseA.length>=d.phraseB.length?d.phraseA:d.phraseB}),H.jsxs("span",{ref:t,style:{position:"absolute",inset:0,willChange:"transform"},children:[H.jsx("span",{ref:i,style:{display:"block",height:"1.08em",whiteSpace:"nowrap",willChange:"opacity"},children:d.phraseA}),H.jsx("span",{ref:r,style:{display:"block",height:"1.08em",whiteSpace:"nowrap",opacity:0,willChange:"opacity"},children:d.phraseB})]})]})]}),m.map((y,w)=>H.jsx("div",{children:y},w))]}),H.jsx("div",{style:{marginTop:28,maxWidth:560,paddingTop:22,borderTop:"1px solid rgba(255,255,255,0.18)",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',fontWeight:400,fontSize:"clamp(14px, 1.1vw, 16px)",lineHeight:1.55,color:"rgba(255,255,255,0.78)",letterSpacing:"-0.003em"},children:d.intro})]})}),H.jsxs("div",{ref:s,style:{position:"fixed",bottom:"3.2vh",left:"50%",transform:"translateX(-50%)",zIndex:46,pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"center",gap:10},children:[H.jsx("span",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)"},children:d.scroll}),H.jsx("div",{style:{position:"relative",width:1,height:44,background:"rgba(255,255,255,0.18)",overflow:"hidden"},children:H.jsx("div",{className:"scrollHintDot",style:{position:"absolute",top:0,left:0,width:1,height:12,background:"#ffffff",animation:"scrollHint 1.6s ease-in-out infinite"}})}),H.jsx("style",{children:` 4034 @keyframes scrollHint { 4035 0% { transform: translateY(-12px); opacity: 0; } 4036 25% { opacity: 1; } 4037 75% { opacity: 1; } 4038 100% { transform: translateY(44px); opacity: 0; } 4039 } 4040 @media (prefers-reduced-motion: reduce) { 4041 .scrollHintDot { animation: none !important; opacity: 0.6; } 4042 } 4043 `})]})]})}const e6={de:{headline:`So bauen wir 4044noch heute.`},en:{headline:`This is how 4045we still build.`}};function t6({scrollProgress:n}){const e=ee.useRef(null),t=ee.useRef(0),i=Zi(),r=e6[i];return ee.useEffect(()=>{const s=Be.BOTTOM_MAT[0]+.015,o=Be.BOTTOM_MAT[0]+.055,a=Be.STEEL_FADE[0],u=Be.STEEL_FADE[0]+.06,f=()=>{const h=n.current;let d=0;h<s?d=0:h<o?d=(h-s)/(o-s):h<a?d=1:h<u?d=1-(h-a)/(u-a):d=0,e.current&&(e.current.style.opacity=String(Math.max(0,Math.min(1,d))),e.current.style.visibility=d<=.001?"hidden":"visible"),t.current=requestAnimationFrame(f)};return t.current=requestAnimationFrame(f),()=>cancelAnimationFrame(t.current)},[n]),ee.useEffect(()=>{if(e.current)return Dc(e.current,50)},[]),H.jsx("div",{ref:e,style:{position:"fixed",left:"max(6vw, 32px)",top:"max(16vh, 120px)",zIndex:50,opacity:0,pointerEvents:"none",userSelect:"none",color:"rgba(255,255,255,0.95)",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',fontWeight:300,fontSize:"clamp(34px, 4.4vw, 64px)",lineHeight:1.04,letterSpacing:"-0.03em",whiteSpace:"pre-line",textShadow:"0 2px 20px rgba(0,0,0,0.65)",maxWidth:"min(760px, 72vw)"},children:r.headline})}const n6={de:{eyebrow:"Status quo",body:"Stahlbewehrung wird noch immer von Hand geschnitten, gebogen und gebunden, Stab für Stab. Rund neunzehn Stunden Arbeit stecken in jeder Tonne."}
4045,en:{eyebrow:"Status quo",body:"Steel reinforcement is still cut, bent and tied together by hand, bar by bar. Around nineteen hours of labor go into every ton."}};function i6({scrollProgress:n}){const e=ee.useRef(null),t=ee.useRef(0),i=Zi(),r=n6[i],s=u0(600);return ee.useEffect(()=>{const o=Be.STIRRUPS[0],a=Be.STIRRUPS[0]+.02,u=Be.STEEL_FADE[0]-.02,f=Be.STEEL_FADE[0],h=()=>{const d=n.current;let p=0;d<o?p=0:d<a?p=(d-o)/(a-o):d<u?p=1:d<f?p=1-(d-u)/(f-u):p=0,e.current&&(e.current.style.opacity=String(Math.max(0,Math.min(1,p))),e.current.style.visibility=p<=.001?"hidden":"visible"),t.current=requestAnimationFrame(h)};return t.current=requestAnimationFrame(h),()=>cancelAnimationFrame(t.current)},[n]),ee.useEffect(()=>{if(e.current)return Dc(e.current,50)},[]),H.jsxs("div",{ref:e,style:{position:"fixed",right:"max(6vw, 32px)",bottom:s?"max(16vh, 200px)":"max(14vh, 140px)",zIndex:50,opacity:0,pointerEvents:"none",userSelect:"none",maxWidth:"min(360px, calc(100vw - 64px))",color:"rgba(255,255,255,0.92)",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',textShadow:"0 2px 16px rgba(0,0,0,0.6)",textAlign:"right"},children:[H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.30em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)",marginBottom:14,paddingBottom:10,borderBottom:"1px solid rgba(255,255,255,0.18)"},children:r.eyebrow}),H.jsx("p",{style:{margin:0,fontSize:14,fontWeight:400,lineHeight:1.5,letterSpacing:"-0.003em",color:"rgba(255,255,255,0.88)"},children:r.body})]})}const r6={de:{problemEyebrow:"STATUS QUO",benefitEyebrow:"MIT SOUL",expandHint:"+"},en:{problemEyebrow:"STATUS QUO",benefitEyebrow:"WITH SOUL",expandHint:"+"}};function s6({scrollProgress:n}){const e=ee.useRef(null),t=ee.useRef(null),i=ee.useRef(null),r=ee.useRef(null),s=ee.useRef(null),o=ee.useRef([]),a=ee.useRef([]),u=ee.useRef(0),f=Zi(),h=r6[f],d=Ja(640),p=u0(600),[m,y]=ee.useState(null);ee.useEffect(()=>{const _=Be.PROBLEM_TILES[0]+(p?.025:0),v=Be.PROBLEM_TILES[1],S=Be.PROBLEM_TILES[1]+.02,M=Be.BENEFIT_TILES[0]+(p?.03:0),T=Be.OUTRO[0],I=Be.OUTRO[0]+.04,C=p?.005:.018,L=p?.016:.025,N=(R,j,Y)=>Math.max(0,Math.min(1,(R-j)/Y)),B=(R,j,Y)=>1-Math.max(0,Math.min(1,(R-j)/(Y-j))),A=()=>{const R=n.current,j=R>=_&&R<S,Y=R>=M&&R<I;e.current&&(e.current.style.opacity=j||Y?"1":"0");let Z=1;R<_?Z=0:R>=v&&(Z=B(R,v,S)),t.current&&(t.current.style.opacity=String(Z),t.current.style.pointerEvents=Z>.05?"auto":"none"),r.current&&(r.current.style.opacity=String(Z));let ae=0;R<M?ae=0:R<T?ae=N(R,M,.02):ae=B(R,T,I),i.current&&(i.current.style.opacity=String(ae),i.current.style.pointerEvents=ae>.05?"auto":"none"),s.current&&(s.current.style.opacity=String(ae));for(let Q=0;Q<BT.length;Q++){const pe=o.current[Q];if(!pe)continue;const z=_+Q*C,ie=z+L;let $=0;R<z?$=0:R>ie?$=1:$=(R-z)/(ie-z);const le=(1-$)*32;pe.style.opacity=String(Math.max(0,Math.min(1,$))),pe.style.transform=`translateX(${le}px)`}for(let Q=0;Q<HT.length;Q++){const pe=a.current[Q];if(!pe)continue;const z=M+Q*C,ie=z+L;let $=0;R<z?$=0:R>ie?$=1:$=(R-z)/(ie-z);const le=(1-$)*32;pe.style.opacity=String(Math.max(0,Math.min(1,$))),pe.style.transform=`translateX(${le}px)`}u.current=requestAnimationFrame(A)};return u.current=requestAnimationFrame(A),()=>cancelAnimationFrame(u.current)},[n,p]),ee.useEffect(()=>{if(e.current)return Dc(e.current,55,{canRecede:!1})},[]);const w=(_,v,S)=>{const M=(m==null?void 0:m.kind)===v&&m.i===S;return H.jsxs("button",{type:"button","aria-expanded":M,ref:T=>{(v==="p"?o:a).current[S]=T},onClick:()=>y(M?null:{kind:v,i:S}),style:{appearance:"none",display:"block",width:"100%",textAlign:"left",font:"inherit",color:"inherit",background:"rgba(0,0,0,0.55)",border:"1px solid rgba(255,255,255,0.14)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",padding:"14px 16px",cursor:"pointer",transition:"border-color 0.25s ease, background 0.25s ease"},onMouseEnter:T=>{T.currentTarget.style.borderColor="rgba(255,255,255,0.32)",T.currentTarget.style.background="rgba(8,10,14,0.65)"},onMouseLeave:T=>{T.currentTarget.style.borderColor="rgba(255,255,255,0.14)",T.currentTarget.style.background="rgba(0,0,0,0.55)"},children:[H.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:6},children:[H.jsx("span",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",color:"rgba(255,255,255,0.5)"},children:_.index}),H.jsx("span",{"aria-hidden":"true",style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,color:M?"#fff":"rgba(255,255,255,0.55)",transform:M?"rotate(45deg)":"rotate(0)",transformOrigin:"center",display:"inline-block",transition:"transform 0.25s ease, color 0.2s ease"},children:h.expandHint})]}),H.jsx("span",{style:{display:"flex",alignItems:"baseline",gap:12,marginBottom:8},children:H.jsx("span",{style:{display:"block",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',fontSize:"clamp(22px, 2.3vw, 32px)",fontWeight:400,letterSpacing:"-0.025em",lineHeight:1,color:"#fff",fontVariantNumeric:"tabular-nums"},children:_.stat[f]})}),H.jsx("span",{style:{display:"block",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',fontSize:12,fontWeight:400,lineHeight:1.4,color:"rgba(255,255,255,0.78)",maxWidth:220},children:_.label[f]}),H.jsx("span",{"aria-hidden":!M,style:{display:"block",overflow:"hidden",maxHeight:M?400:0,opacity:M?1:0,marginTop:M?10:0,paddingTop:M?10:0,borderTop:M?"1px solid rgba(255,255,255,0.10)":"none",transition:"max-height 0.35s ease, opacity 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',fontSize:12,fontWeight:400,lineHeight:1.5,color:"rgba(255,255,255,0.72)"},children:_.detail[f]})]},`${v}-${_.index}`)};return H.jsxs("div",{ref:e,style:{position:"fixed",right:"max(6vw, 32px)",top:"50%",transform:"translateY(-50%)",zIndex:55,opacity:0,pointerEvents:"none",width:d?"min(240px, 54vw)":270,display:"flex",flexDirection:"column",gap:8,transition:"opacity 0.25s linear"},children:[H.jsxs("div",{style:{position:"relative",height:18,marginBottom:6}
4045,children:[H.jsx("div",{ref:r,style:{position:"absolute",inset:0,fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.30em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)"},children:h.problemEyebrow}),H.jsx("div",{ref:s,style:{position:"absolute",inset:0,opacity:0,fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.30em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)"},children:h.benefitEyebrow})]}),H.jsxs("div",{style:{position:"relative"},children:[H.jsx("div",{ref:t,style:{display:"flex",flexDirection:"column",gap:8},children:BT.map((_,v)=>w(_,"p",v))}),H.jsx("div",{ref:i,style:{position:"absolute",inset:0,opacity:0,display:"flex",flexDirection:"column",gap:8},children:HT.map((_,v)=>w(_,"b",v))})]})]})}const o6={de:{headline:`Der ganze Bewehrungskorb. 4046Ein Modul: SOUL.`,body:"SOUL ist eine dreidimensionale, fasergewickelte Bewehrung aus automatisierter Produktion. Sie kommt als fertiges Modul auf die Baustelle und wird in einem Schritt eingesetzt. Sie korrodiert nicht und lässt sich aus jeder Faser fertigen: Carbon, Basalt, Aramid, Glas oder Naturfaser."},en:{headline:`The whole reinforcement cage. 4047One module: SOUL.`,body:"SOUL is a three-dimensional, fiber-wound reinforcement made on an automated line. It arrives as a finished module and is set in a single step on site. It does not corrode, and it can be produced from any fiber: carbon, basalt, aramid, glass or natural fiber."}};function a6({scrollProgress:n}){const e=ee.useRef(null),t=ee.useRef(null),i=ee.useRef(0),r=Zi(),s=u0(600),o=o6[r];return ee.useEffect(()=>{const a=Be.LATTICE[1],u=Be.LATTICE[1]+.05,f=Be.OUTRO[1]-.08,h=Be.OUTRO[1],d=s?Be.PAUSE[0]+.02:Be.EXPLAIN[0]+.005,p=d+.025,m=Be.OUTRO[0],y=Be.OUTRO[0]+.06,w=(v,S,M,T,I)=>v<S?0:v<M?(v-S)/(M-S):v<T?1:v<I?1-(v-T)/(I-T):0,_=()=>{const v=n.current;e.current&&(e.current.style.opacity=String(Math.max(0,Math.min(1,w(v,a,u,f,h))))),t.current&&(t.current.style.opacity=String(Math.max(0,Math.min(1,w(v,d,p,m,y))))),i.current=requestAnimationFrame(_)};return i.current=requestAnimationFrame(_),()=>cancelAnimationFrame(i.current)},[n,s]),ee.useEffect(()=>{const a=[];return e.current&&a.push(Dc(e.current,50)),t.current&&a.push(Dc(t.current,50)),()=>a.forEach(u=>u())},[]),H.jsxs("div",{style:{position:"fixed",left:"max(6vw, 32px)",top:"max(16vh, 112px)",zIndex:50,pointerEvents:"none",userSelect:"none",color:"rgba(255,255,255,0.92)",textShadow:"0 2px 16px rgba(0,0,0,0.6)",maxWidth:"min(560px, calc(100vw - 2 * max(6vw, 32px)))"},children:[H.jsx("div",{ref:e,style:{opacity:0,fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',fontWeight:400,fontSize:"clamp(22px, 2.6vw, 36px)",letterSpacing:"-0.02em",lineHeight:1.18,whiteSpace:"pre-line",marginBottom:24,transition:"opacity 0.25s linear"},children:o.headline}),H.jsx("div",{ref:t,style:{opacity:0,maxWidth:460,fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',fontSize:14,fontWeight:400,lineHeight:1.55,color:"rgba(255,255,255,0.78)",transition:"opacity 0.25s linear"},children:o.body})]})}const l6=[{label:{de:"01 · Geschützt",en:"01 · Protected"},mainStat:{de:"EP 3 705 657 B1",en:"EP 3 705 657 B1"},mainStatMono:!0,title:{de:"Patentgeschützte Bewehrungsarchitektur",en:"Patent protected reinforcement architecture"},body:{de:"Die Bewehrung basiert auf einem europäischen Patent, validiert in Deutschland, Ãsterreich und der Schweiz. Drei weitere europäische Patente sind in Anmeldung und erweitern den Schutz auf Produktionsverfahren, Modulgeometrie und Anwendungslogik.",en:"The reinfor
4047cement is based on a European patent validated in Germany, Austria and Switzerland. Three additional European patents are pending, extending protection to production process, module geometry and application logic."},footer:{de:"1 erteilt · 3 angemeldet · DE · AT · CH",en:"1 granted · 3 pending · DE · AT · CH"}},{label:{de:"02 · Validiert",en:"02 · Validated"},mainStat:{de:"Validiert",en:"Validated"},title:{de:"Experimentell validiert",en:"Experimentally validated"},body:{de:"Die zugrunde liegende Technologie ist experimentell validiert, in Klein- und GroÃversuchen unter kontrollierten Forschungsbedingungen.",en:"The underlying technology has been experimentally validated across small-scale and large-scale structural tests under controlled research conditions."},footer:{de:"Kleinversuch · GroÃversuch · Kontrollierte Bedingungen",en:"Small scale · Large scale · Controlled conditions"}},{label:{de:"03 · Pilotreif",en:"03 · Pilot-ready"},mainStat:{de:"Pilotreif",en:"Pilot-ready"},title:{de:"Bereit für erste Pilotprojekte",en:"Ready for first pilots"},body:{de:"Die Technologie ist bereit, vom Labor in reale Bauteile zu gehen. Wir wählen Entwicklungspartner für die ersten Pilotprojekte aus.",en:"The technology is ready to move from the lab into real structures. We are selecting development partners for the first pilots."},footer:{de:"Erste Pilotprojekte · 2026 â 2027",en:"First pilots · 2026 â 2027"}}],c6={de:{eyebrow:"04 · Status",title:"Wo die Technologie heute steht.",sub:"Geschützt durch ein europäisches Patent und experimentell validiert. Die Technologie ist bereit für erste Pilotprojekte."},en:{eyebrow:"04 · Status",title:"Where the technology stands today.",sub:"Protected by a European patent and experimentally validated. The technology is ready for its first real-world pilots."}},u6="rgba(212,168,67,0.45)";function f6(){const n=Zi(),e=c6[n],t=ee.useRef(null),[i,r]=ee.useState(!1);return ee.useEffect(()=>{const s=t.current;if(!s)return;const o=new IntersectionObserver(a=>{a.forEach(u=>{u.isIntersecting&&(r(!0),o.disconnect())})},{threshold:.12,rootMargin:"-40px 0px"});return o.observe(s),()=>o.disconnect()},[]),H.jsx("section",{ref:t,id:"proof",style:{position:"relative",background:"#000",color:"#fff",padding:"140px 0 120px",fontFamily:'"Geist", "Inter Tight", "Inter", system-ui, sans-serif',borderTop:"1px solid rgba(255,255,255,0.06)"},children:H.jsxs("div",{style:{maxWidth:1500,margin:"0 auto",padding:"0 max(6vw, 32px)"},children:[H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.30em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)",marginBottom:28},children:e.eyebrow}),H.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:64,alignItems:"end",marginBottom:72},children:[H.jsx("h2",{style:{fontSize:"clamp(28px, 3.2vw, 46px)",fontWeight:300,letterSpacing:"-0.025em",lineHeight:1.1,margin:0,color:"rgba(255,255,255,0.95)",maxWidth:720},children:e.title}),H.jsx("p",{style:{fontSize:15,lineHeight:1.6,color:"rgba(255,255,255,0.55)",maxWidth:420,margin:0},children:e.sub})]}),H.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:1,background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.06)"},children:l6.map((s,o)=>H.jsxs("article",{style:{background:"#08090c",padding:36,minHeight:320,display:"flex",flexDirection:"column",position:"relative",transition:"background 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease",border:"1px solid transparent",opacity:i?1:0,transform:i?"translateY(0)":"translateY(24px)",transitionDelay:`${o*120}ms`,willChange:"opacity, transform"},onMouseEnter:a=>{a.currentTarget.style.background="#0e1014",a.currentTarget.style.borderColor=u6,a.currentTarget.style.transform="translateY(-4px)"},onMouseLeave:a=>{a.currentTarget.style.background="#08090c",a.currentTarget.style.borderColor="transparent",a.currentTarget.style.transform="translateY(0)"},children:[H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.5)",marginBottom:32},children:s.label[n]}),H.jsx("div",{style:{fontFamily:s.mainStatMono?'"Geist Mono", ui-monospace, monospace':'"Geist", "Inter Tight", system-ui, sans-serif',fontSize:s.mainStatMono?"clamp(16px, 1.6vw, 20px)":"clamp(22px, 2.4vw, 32px)",fontWeight:s.mainStatMono?500:300,letterSpacing:s.mainStatMono?"0":"-0.025em",lineHeight:1.1,color:"#ffffff",marginBottom:20},children:s.mainStat[n]}),H.jsx("h3",{style:{fontSize:15,fontWeight:400,letterSpacing:"-0.005em",lineHeight:1.35,margin:0,marginBottom:12,color:"rgba(255,255,255,0.92)"},children:s.title[n]}),H.jsx("p",{style:{fontSize:13,lineHeight:1.55,color:"rgba(255,255,255,0.58)",margin:0},children:s.body[n]}),H.jsx("div",{style:{flex:1}}),H.jsx("div",{style:{marginTop:28,paddingTop:18,borderTop:"1px solid rgba(255,255,255,0.08)",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.5)"},children:s.footer[n]})]},o))})]})})}const h6={rodCount:16,longCount:10,helixDiam:8,longDiam:8,pointsPerRod:52,helixRingSegs:6},d6=4200,p6=45,m6=40,g6=62,v6=.9,TP=.32,AP=.15,y6=.38,_6=.44,x6=2.2,S6=2.2,bP=.3,M6=.24,s2=.1,w6=TP+AP+bP*.5,E6=typeof window<"u"&&Math.min(window.innerWidth,window.innerHeight)<600?1.5:2,o2=[{shape:"rect",params:{width:2100,height:700,cornerR:60},len:4800},{shape:"rect",params:{width:2300,height:480,cornerR:40}
4047,len:5200},{shape:"rect",params:{width:1400,height:1400,cornerR:90},len:3600},{shape:"rect",params:{width:460,height:2100,cornerR:40},len:4300},{shape:"circle",params:{radius:850},len:5200},{shape:"polygon",params:{sides:6,radius:933,cornerR:70},len:4e3},{shape:"trapez",params:{bottomW:1e3,topW:1800,height:1300,cornerR:60},len:4600},{shape:"tProfile",params:{flangeW:1500,flangeH:250,webW:450,totalH:1300,cornerR:50},len:3700},{shape:"iProfile",params:{flangeW:1400,flangeH:240,webW:300,totalH:1500,cornerR:45},len:4200},{shape:"lProfile",params:{legW:1400,legH:1400,thickness:350,cornerR:50},len:4400},{shape:"polygon",params:{sides:8,radius:820,cornerR:50},len:5e3},{shape:"trapez",params:{bottomW:1900,topW:500,height:1200,cornerR:50},len:3900}];function T6(n){return n*n*(3-2*n)}function A6({progress:n,mouse:e}){const{liveGeo:t,positionSets:i,scale:r}=ee.useMemo(()=>{const u=o2.map(S=>_P({shape:S.shape,params:S.params,lattice:{length:S.len??d6,helixAngle:p6,helixAngleStart:m6,helixAngleEnd:g6,helixTurns:v6,...h6}}).geometry),f=u.map(S=>S.getAttribute("position").array);let h=0,d=0;for(const S of f){let M=1/0,T=1/0,I=1/0,C=-1/0,L=-1/0,N=-1/0;for(let j=0;j<S.length;j+=3)M=Math.min(M,S[j]),C=Math.max(C,S[j]),T=Math.min(T,S[j+1]),L=Math.max(L,S[j+1]),I=Math.min(I,S[j+2]),N=Math.max(N,S[j+2]);const B=(M+C)/2,A=(T+L)/2,R=(I+N)/2;for(let j=0;j<S.length;j+=3){S[j]-=B,S[j+1]-=A,S[j+2]-=R;const Y=Math.hypot(S[j+1],S[j+2]);Y>h&&(h=Y);const Z=Math.abs(S[j]);Z>d&&(d=Z)}}const p=u[0].clone();p.computeVertexNormals();const m=Math.hypot(4,2.2,4),y=30*Math.PI/180/2,w=m*Math.tan(y)*.93,_=h+d*Math.sin(w6),v=_>0?w/_:1;return{liveGeo:p,positionSets:f,scale:v}},[]);Qr(u=>{const f=o2.length,d=((u.clock.elapsedTime*y6+n.current*x6)%f+f)%f,p=Math.floor(d)%f,m=T6(d-Math.floor(d)),y=i[p],w=i[(p+1)%f],_=t.getAttribute("position"),v=_.array;for(let S=0;S<v.length;S++)v[S]=y[S]+(w[S]-y[S])*m;_.needsUpdate=!0,t.computeVertexNormals()});const s=ee.useRef(null),o=ee.useRef({x:0,y:0}),a=ee.useMemo(()=>({xAxis:new k(1,0,0),yAxis:new k(0,1,0),dir:new k,baseQ:new Gn,swayQ:new Gn,rollQ:new Gn,parallaxQ:new Gn,parallaxE:new Ii}),[]);return Qr(u=>{if(!s.current)return;const f=u.clock.elapsedTime;o.current.x+=(e.current.x-o.current.x)*s2,o.current.y+=(e.current.y-o.current.y)*s2,a.dir.copy(u.camera.position).normalize(),a.baseQ.setFromUnitVectors(a.xAxis,a.dir),a.swayQ.setFromAxisAngle(a.yAxis,TP+Math.sin(f*.4)*AP),a.rollQ.setFromAxisAngle(a.xAxis,f*_6+n.current*S6),a.parallaxE.set(o.current.y*M6,o.current.x*bP,0),a.parallaxQ.setFromEuler(a.parallaxE),s.current.quaternion.copy(a.parallaxQ).multiply(a.baseQ).multiply(a.swayQ).multiply(a.rollQ)}),H.jsx("group",{ref:s,scale:r,children:H.jsx("mesh",{geometry:t,children:H.jsx("meshStandardMaterial",{color:ig,metalness:n1,roughness:i1,emissive:ig,emissiveIntensity:.22})})})}function b6(){const n=ee.useRef(0),e=ee.useRef({x:0,y:0}),t=ee.useRef(null),[i,r]=ee.useState(!1);return ee.useEffect(()=>{const s=t.current;if(!s)return;if(typeof IntersectionObserver>"u"){r(!0);return}const o=new IntersectionObserver(a=>r(a.some(u=>u.isIntersecting)),{rootMargin:"200px 0px"});return o.observe(s),()=>o.disconnect()},[]),ee.useEffect(()=>{const s=()=>{const a=t.current;if(!a)return;const u=a.getBoundingClientRect(),f=window.innerHeight,h=u.height+f,d=f-u.top;n.current=h>0?Math.max(0,Math.min(1,d/h)):0};s();const o=a=>{e.current.x=a.clientX/window.innerWidth*2-1,e.current.y=a.clientY/window.innerHeight*2-1};return window.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s),window.addEventListener("mousemove",o,{passive:!0}),()=>{window.removeEventListener("scroll",s),window.removeEventListener("resize",s),window.removeEventListener("mousemove",o)}},[]),H.jsx("div",{ref:t,style:{width:"100%",aspectRatio:"1 / 1",maxWidth:760},children:H.jsxs(WC,{frameloop:i?"always":"never",dpr:[1,E6],gl:{antialias:!0,toneMapping:nh,toneMappingExposure:1.12,alpha:!0},camera:{position:[4,2.2,4],fov:30,near:.1,far:60},onCreated:({camera:s})=>s.lookAt(0,0,0),style:{width:"100%",height:"100%",display:"block",background:"transparent"},children:[H.jsx("ambientLight",{intensity:.9}),H.jsx("directionalLight",{position:[6,7,4],intensity:2.6,color:"#ffffff"}),H.jsx("directionalLight",{position:[-4,2,-3],intensity:.9,color:"#9fb3d9"}),H.jsx("pointLight",{position:[0,-2,3],intensity:.6,color:"#ffd49a"}),H.jsx(A6,{progress:n,mouse:e})]})})}const a2=[{index:"01",label:{de:"Standardteile",en:"Standard parts"},headline:{de:"Wiederkehrende Geometrien aus laufender Produktion.",en:"Recurring geometries from continuous production."},body:{de:"Hochfrequente Querschnitte für tragende Bauteile im Hoch-, Tief- und Infrastrukturbau. Planbare Lieferzeiten und reproduzierbare Qualität.",en:"High-frequency cross-sections for load-bearing components across building, civil and infrastru
4047cture work. Predictable lead times and reproducible quality."},useCases:{de:"Balken · Stützen · Streifenfundamente · Pfähle · Wand- und Deckenelemente",en:"Beams · Columns · Strip foundations · Piles · Wall and slab elements"}},{index:"02",label:{de:"Spezialteile",en:"Special parts"},headline:{de:"Projektspezifische Geometrien, geformt nach dem Bauteil.",en:"Project-specific geometries, shaped to the structure."},body:{de:"Braucht ein Bauteil einen anderen Querschnitt, entsteht er auf derselben Anlage. Die Bewehrung folgt den Kräften im Bauteil, statt das Bauteil an einen festen Korb anzupassen. Form folgt Kraft.",en:"When a component needs a different section, the same line produces it. The reinforcement follows the forces in the part rather than forcing the design to fit a fixed cage. Form follows force."},useCases:{de:"Plattenbalken · Randelemente · Tunnelsegmente · Brückenbauteile · Sondergeometrien",en:"Composite beams · Edge elements · Tunnel segments · Bridge components · Custom geometries"}}],R6={de:{eyebrow:"05 · Anwendung",title:`Eine Anlage. 4048Für alles, was tragen muss.`,sub:"Vom Fertigteil über den Hochbau bis zu Brücken und Infrastruktur entsteht jedes Bauteil auf derselben automatisierten Anlage. Die Geometrie passt sich dem Bauteil an, sodass die Bewehrung den Kräften folgt."},en:{eyebrow:"05 · Capability",title:`One line. 4049For everything that carries load.`,sub:"From prefab elements to buildings, bridges and civil infrastructure, every part comes off the same automated line. The geometry adapts to the component, so the reinforcement follows the forces."}};function C6(){const n=Zi(),e=R6[n],t=Ja(760),i=ee.useRef(null),r=ee.useRef(null),[s,o]=ee.useState(!1),[a,u]=ee.useState(!1);return ee.useEffect(()=>{const f=i.current;if(!f)return;const h=new IntersectionObserver(d=>d.forEach(p=>{p.isIntersecting&&(o(!0),h.disconnect())}),{threshold:.12,rootMargin:"-40px 0px"});return h.observe(f),()=>h.disconnect()},[]),ee.useEffect(()=>{const f=r.current;if(!f)return;if(typeof IntersectionObserver>"u"){u(!0);return}let h=!1;const d=800;function p(){y.disconnect(),window.removeEventListener("scroll",m),window.removeEventListener("resize",m)}function m(){if(h||!f)return;const w=f.getBoundingClientRect();w.top<window.innerHeight+d&&w.bottom>-d&&(h=!0,u(!0),p())}const y=new IntersectionObserver(w=>w.forEach(_=>{_.isIntersecting&&m()}),{rootMargin:`${d}px 0px`});return y.observe(f),window.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",m,{passive:!0}),m(),p},[]),H.jsx("section",{ref:i,id:"capability",style:{position:"relative",background:"#000",color:"#fff",padding:"140px 0 120px",fontFamily:'"Geist", "Inter Tight", "Inter", system-ui, sans-serif',borderTop:"1px solid rgba(255,255,255,0.06)"},children:H.jsxs("div",{style:{maxWidth:1500,margin:"0 auto",padding:"0 max(6vw, 32px)"},children:[H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.30em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)",marginBottom:28},children:e.eyebrow}),H.jsxs("div",{style:{display:"grid",gridTemplateColumns:t?"1fr":"minmax(0, 0.8fr) minmax(0, 1.2fr)",gap:t?56:72,alignItems:"center"},children:[H.jsxs("div",{children:[H.jsx("h2",{style:{margin:0,fontSize:"clamp(28px, 3.2vw, 46px)",fontWeight:300,letterSpacing:"-0.025em",lineHeight:1.04,whiteSpace:"pre-line",color:"rgba(255,255,255,0.95)",marginBottom:24},children:e.title}),H.jsx("p",{style:{margin:0,fontSize:15,lineHeight:1.6,fontWeight:400,color:"rgba(255,255,255,0.6)",maxWidth:520,marginBottom:48},children:e.sub}),H.jsx("div",{style:{display:"flex",flexDirection:"column"},children:a2.map((f,h)=>H.jsxs("div",{style:{padding:"28px 0",borderTop:"1px solid rgba(255,255,255,0.12)",borderBottom:h===a2.length-1?"1px solid rgba(255,255,255,0.12)":"none",opacity:s?1:0,transform:s?"translateY(0)":"translateY(20px)",transition:"opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1)",transitionDelay:`${h*120}ms`},children:[H.jsxs("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.5)",marginBottom:12},children:[f.index," · ",f.label[n]]}),H.jsx("h3",{style:{margin:0,fontSize:"clamp(17px, 1.4vw, 20px)",fontWeight:400,letterSpacing:"-0.015em",lineHeight:1.3,color:"rgba(255,255,255,0.95)",marginBottom:12},children:f.headline[n]}),H.jsx("p",{style:{margin:0,fontSize:13,lineHeight:1.55,fontWeight:400,color:"rgba(255,255,255,0.65)",marginBottom:14},children:f.body[n]}),H.jsx("div",{style:{fontSize:13,lineHeight:1.5,color:"rgba(255,255,255,0.78)"},children:f.useCases[n]})]},f.index))})]}
4049),H.jsx("div",{ref:r,style:{display:"flex",justifyContent:"center"},children:a?H.jsx(b6,{}):H.jsx("div",{style:{width:"100%",aspectRatio:"1 / 1",maxWidth:620},"aria-hidden":"true"})})]})]})})}const l2=[{initials:"MC",photo:"/team/curbach.jpg",name:{de:"Prof. Dr.-Ing. Manfred Curbach",en:"Prof. Dr.-Ing. Manfred Curbach"},credential:{de:"Nobel Sustainability Award 2025 · Deutscher Zukunftspreis · 30 Jahre Carbonbeton-Forschung",en:"Nobel Sustainability Award 2025 · German Future Prize · 30 years of carbon-concrete research"},linkedin:"https://www.linkedin.com/in/manfred-curbach/"},{initials:"AS",photo:"/team/schumann.jpg",name:{de:"Prof. Alexander Schumann",en:"Prof. Alexander Schumann"},credential:{de:"Co-Erfinder im industriellen Carbonbeton-Sektor",en:"Co-inventor in the industrial carbon-concrete sector"},linkedin:"https://www.linkedin.com/in/alexander-schumann-7522b915b/?locale=en"},{initials:"KR",photo:"/team/klaus-raps.jpg",name:{de:"Prof. Klaus Raps",en:"Prof. Klaus Raps"},credential:{de:"Ehem. Vorstand Bilfinger Berger SE",en:"Former Executive Board, Bilfinger Berger SE"},linkedin:"https://www.linkedin.com/in/klaus-raps/"},{initials:"LR",photo:"/team/ludwig-raps.jpg",name:{de:"Ludwig Raps",en:"Ludwig Raps"},credential:{de:"Geschäftsführer, Soul of Concrete",en:"Managing Director, Soul of Concrete"},linkedin:"https://www.linkedin.com/in/ludwigraps/"}],P6={de:{eyebrow:"06 · Team",headline:"Das Team hinter SOUL.",linkedin:"LinkedIn"},en:{eyebrow:"06 · Team",headline:"The team behind SOUL.",linkedin:"LinkedIn"}};function I6(){const n=Zi(),e=P6[n];return H.jsxs("section",{id:"team",style:{position:"relative",background:"#000",color:"#fff",padding:"clamp(72px, 12vw, 140px) 0 clamp(64px, 10vw, 120px)",fontFamily:'"Geist", "Inter Tight", "Inter", system-ui, sans-serif',borderTop:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[H.jsxs("div",{style:{padding:"0 max(6vw, 32px)",maxWidth:1400,margin:"0 auto"},children:[H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.30em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)",marginBottom:28},children:e.eyebrow}),H.jsx("div",{style:{marginBottom:72},children:H.jsx("h2",{style:{fontSize:"clamp(28px, 3.2vw, 46px)",fontWeight:300,letterSpacing:"-0.025em",lineHeight:1.1,margin:0,color:"rgba(255,255,255,0.95)",maxWidth:720},children:e.headline})})]}),H.jsx("div",{style:{position:"relative",paddingLeft:"max(6vw, 32px)"},children:H.jsx("div",{style:{display:"flex",alignItems:"stretch",gap:24,overflowX:"auto",paddingRight:"max(6vw, 32px)",paddingBottom:24,scrollSnapType:"x mandatory",scrollbarWidth:"thin",WebkitOverflowScrolling:"touch"},children:l2.map((t,i)=>H.jsxs("article",{style:{flex:"0 0 auto",width:"min(320px, 82vw)",scrollSnapAlign:"start",background:t.accent?"#0c0d10":"#08090c",border:`1px solid ${t.accent?"rgba(255,255,255,0.22)":"rgba(255,255,255,0.08)"}`,borderRadius:2,display:"flex",flexDirection:"column",transition:"border-color 0.25s ease, background 0.25s ease"},children:[H.jsxs("div",{style:{aspectRatio:"4 / 5",position:"relative",background:`linear-gradient(180deg, ${t.accent?"#181a1f":"#101218"} 0%, #050608 100%)`,overflow:"hidden",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[H.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:H.jsx("div",{style:{fontFamily:'"Geist", system-ui, sans-serif',fontSize:"clamp(72px, 8vw, 110px)",fontWeight:300,letterSpacing:"-0.04em",color:t.accent?"rgba(255,255,255,0.85)":"rgba(255,255,255,0.45)",lineHeight:1,userSelect:"none"},children:t.initials})}),H.jsx("img",{src:t.photo,alt:t.name[n],loading:"lazy",onError:r=>{r.currentTarget.style.display="none"},style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",objectPosition:"50% 25%",filter:"saturate(0.95) contrast(1.02)",display:"block"}}),H.jsx("div",{style:{position:"absolute",left:0,right:0,bottom:0,height:"38%",background:"linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%)",pointerEvents:"none"}}),H.jsxs("div",{style:{position:"absolute",top:18,left:18,zIndex:2,fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.7)",textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:[String(i+1).padStart(2,"0")," / ",String(l2.length).padStart(2,"0")]})]}),H.jsxs("div",{style:{padding:24,display:"flex",flexDirection:"column",gap:12,flex:1},children:[H.jsx("div",{style:{fontSize:"clamp(17px, 1.4vw, 20px)",fontWeight:400,letterSpacing:"-0.015em",lineHeight:1.2},children:t.name[n]}),H.jsx("div",{style:{fontSize:13,lineHeight:1.5,color:"rgba(255,255,255,0.62)"},children:t.credential[n]}),H.jsxs("a",{href:t.linkedin,target:"_blank",rel:"noopener noreferrer","aria-label":`${t.name[n]} â LinkedIn (${n==="de"?"öffnet in neuem Tab":"opens in a new tab"})`,style:{marginTop:"auto",paddingTop:16,paddingBottom:6,minHeight:44,boxSizing:"border-box",borderTop:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",gap:8,fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)",textDecoration:"none",transition:"color 0.2s ease"},onMouseEnter:r=>{r.currentTarget.style.color="#ffffff"},onMouseLeave:r=>{r.currentTarget.style.color="rgba(255,255,255,0.55)"},children:[e.linkedin," ",H.jsx("span",{"aria-hidden":"true",children:"â"})]})]})]},i))})})]})}const L6={press:{de:"Presse",en:"Press"},ip:{de:"Patent · IP",en:"Patent · IP"},regulatory:{de:"Zulassung",en:"Regulatory"},research:{de:"Forschung",en:"Research"},event:{de:"Vortrag",en:"Event"},hiring:{de:"Team",en:"Hiring"}},N6=[{date:"2026-08-24",category:"press",source:"ULI Germany",title:{de:"Gewinner der ULI PropTech Innovation Challenge 2026 in Deutschland",en:"Winner, ULI PropTech Innovation Challenge 2026 â Germany"},preview:{de:"Sieg in der deutschen Runde der PropTech Innovation Challenge von ULI Germany, Austria & Switzerland, Thema 2026: Resilienz. Das europäische Finale wird am 5. November 2026 in Dublin entschieden.",en:"Won the German round of the PropTech Innovation Challenge by ULI Germany, Austria & Switzerland, 2026 theme: resilience. The European final is decided on 5 November 2026 in Dublin."},href:"https://www.domblick.eu/2026/08/24/uli-germany-soul-of-concrete-gewinnt-proptech-innovation-challenge-2026/"},{date:"2026-07-27",category:"press",source:"b4b Schwaben",title:{de:"Münchener Businessplan-Wettbewerb 2026: Einzug ins Finale",en:"Munich Business Plan Competition 2026: reaching the final"},preview:{de:"Nach dem ersten Platz in Phase 2 steht Soul of Concrete im Finale des Münchener Businessplan-Wettbewerbs 2026 von BayStartup.",en:"After first place in Phase 2, Soul of Concrete is in the final of the 2026 Munich Business Plan Competition run by BayStartup."}
4049,href:"https://www.b4bschwaben.de/b4b-nachrichten/donau-ries_artikel,-startup-aus-noerdlingen-im-finale-des-muenchener-businessplan-wettbewerbs-_arid,275401.html"},{date:"2026-07-22",category:"press",source:"deutsche-startups.de",title:{de:"Eines von fünf neuen Startups, die man in Deutschland kennen muss",en:"One of five new German startups you should know"},preview:{de:"Redaktionell ausgewählt für die Reihe â5 neue Startupsâ von deutsche-startups.de, gemeinsam mit TaxGraph, Ampelo, re_source und Ora Computing.",en:"Editorially selected for the â5 new startupsâ series of deutsche-startups.de, alongside TaxGraph, Ampelo, re_source and Ora Computing."},href:"https://www.deutsche-startups.de/2026/07/22/5-neue-startups-taxgraph-ampelo-re_source-ora-computing-soul-of-concrete/"},{date:"2025-10-16",category:"press",source:"Nobel Sustainability Trust",title:{de:"Nobel Sustainability Award 2025 für Mitgründer Prof. Manfred Curbach",en:"Nobel Sustainability Award 2025 for co-founder Prof. Manfred Curbach"},preview:{de:'Ausgezeichnet für âLeadership in the Implementation of Sustainability" â verliehen vom Nobel Sustainability Trust gemeinsam mit der TU München.',en:'Honored for "Leadership in the Implementation of Sustainability" â awarded by the Nobel Sustainability Trust together with TU Munich.'},href:"https://www.nobelsustainabilitytrust.org/the-sustainability-award-2025"},{date:"2025-06-26",category:"press",source:"Freistaat Sachsen",title:{de:'Gewinner Sächsischer Gründerpreis: âSkalierung & gesellschaftlicher Impact"',en:'Winner, Saxon Founders Award: "Scaling & Societal Impact"'},preview:{de:"Ausgezeichnet mit dem Sächsischen Staatspreis für Gründen in der Kategorie Skalierung und gesellschaftlicher Impact.",en:"Awarded the Saxon State Prize for founders in the Scaling and Societal Impact category."},href:"https://www.smwa.sachsen.de/blog/2025/06/26/das-sind-die-preistraeger-der-saechsischen-staatspreise-fuer-gruenden-transfer-und-innovation-2025/"},{date:"2025-04-11",category:"press",source:"FutureSAX",title:{de:"Sächsischer Gründerpreis 2025: Soul of Concrete nominiert",en:"Saxon Founders Award 2025: Soul of Concrete nominated"},preview:{de:"Anerkennung als eines der vielversprechendsten jungen Unternehmen Sachsens.",en:"Recognized among the most promising young companies in Saxony."},href:"https://www.futuresax.de/gruenden/saechsischer-gruenderpreis/saechsischer-gruenderpreis-2025/"},{date:"2026-05-21",category:"press",source:"BayStartup",title:{de:"Münchener Businessplan-Wettbewerb 2026: 1. Platz in Phase 2",en:"Munich Business Plan Competition 2026: 1st place in Phase 2"},preview:{de:"Erster Platz unter den Sieger-Startups der Phase 2 des Münchener Businessplan-Wettbewerbs.",en:"First place among the winning startups in Phase 2 of the Munich Business Plan Competition."},href:"https://www.baystartup.de/startupdate/sieger-startups-aus-phase-2-im-muenchener-businessplan-wettbewerb-2026"},{date:"2026-05-12",category:"press",source:"BayStartup",title:{de:"Münchener Businessplan-Wettbewerb 2026: Soul of Concrete nominiert",en:"Munich Business Plan Competition 2026: Soul of Concrete nominated"},preview:{de:"Nominiert in Phase 2 des Münchener Businessplan-Wettbewerbs.",en:"Nominated in Phase 2 of the Munich Business Plan Competition."},href:"https://www.baystartup.de/startupdate/die-nominierten-im-muenchener-businessplan-wettbewerb-2026-phase-2"},{date:"2024-07-06",category:"research",source:"Beton- und Stahlbetonbau",title:{de:"Neuartige 3D-Bewehrungen für den Betonbau, Teil 1",en:"Novel 3D reinforcements for concrete, Part 1"},preview:{de:"Peer-Review-Beitrag zu Hintergründen, Entwicklung und Potenzialen unserer Technologie.",en:"Peer-reviewed paper on the background, development and potential of our technology."},href:"https://onlinelibrary.wiley.com/doi/10.1002/best.202400028"},{date:"2025-05-27",category:"research",source:"Beton- und Stahlbetonbau",title:{de:"Neuartige 3D-Bewehrungen für den Betonbau, Teil 2",en:"Novel 3D reinforcements for concrete, Part 2"},preview:{de:"Peer-Review-Beitrag zur Entwicklung des Bewehrungsmaterials.",en:"Peer-reviewed paper on the development of the reinfor
4049cement material."},href:"https://onlinelibrary.wiley.com/doi/abs/10.1002/best.202500015"}],D6={de:{eyebrow:"07 · Aktuelles",headline:"Presse & Auszeichnungen.",upcomingTag:"Upcoming",prev:"Vorherige Meldung",next:"Nächste Meldung"},en:{eyebrow:"07 · News",headline:"Press & recognition.",upcomingTag:"Upcoming",prev:"Previous item",next:"Next item"}};function U6(n,e){if(n.includes("Q"))return n;const[t,i,r]=n.split("-").map(Number);return!t||!i||!r?n:new Date(Date.UTC(t,i-1,r)).toLocaleDateString(e==="de"?"de-DE":"en-US",{year:"numeric",month:"short",day:"numeric"})}const Uu=n=>String(n).padStart(2,"0"),c2=n=>({display:"-webkit-box",WebkitLineClamp:n,WebkitBoxOrient:"vertical",overflow:"hidden"});function O6(){const n=Zi(),e=Ja(640),t=Ja(1e3),i=D6[n],r=[...N6].sort((I,C)=>C.date.localeCompare(I.date)),s=r.length,o=e?1:t?2:4,a=1,u=e?"85%":`calc((100% - ${(o-1)*a}px) / ${o})`,f=ee.useRef(null),[h,d]=ee.useState(0),[p,m]=ee.useState(!0),[y,w]=ee.useState(!1),_=ee.useCallback(()=>{var C;const I=(C=f.current)==null?void 0:C.firstElementChild;return I?I.offsetWidth+a:0},[]);ee.useEffect(()=>{const I=f.current;if(!I)return;let C=0;const L=()=>{C=0;const B=_(),A=I.scrollWidth-I.clientWidth;d(B>0?Math.min(s-1,Math.round(I.scrollLeft/B)):0),m(I.scrollLeft<=2),w(I.scrollLeft>=A-2)},N=()=>{C||(C=requestAnimationFrame(L))};return L(),I.addEventListener("scroll",N,{passive:!0}),window.addEventListener("resize",N),()=>{I.removeEventListener("scroll",N),window.removeEventListener("resize",N),C&&cancelAnimationFrame(C)}},[s,o,_]);const v=I=>{var R;const C=f.current,L=_();if(!C||!L)return;const N=C.scrollWidth-C.clientWidth,B=Math.max(0,Math.min(N,(Math.round(C.scrollLeft/L)+I)*L)),A=(R=window.matchMedia)==null?void 0:R.call(window,"(prefers-reduced-motion: reduce)").matches;C.scrollTo({left:B,behavior:A?"auto":"smooth"})},S=Math.min(s,h+o),M=o===1?`${Uu(h+1)} / ${Uu(s)}`:`${Uu(h+1)}â${Uu(S)} / ${Uu(s)}`,T=I=>({width:44,height:44,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"1px solid rgba(255,255,255,0.18)",color:"#fff",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:14,cursor:I?"default":"pointer",opacity:I?.3:1,transition:"border-color 0.2s ease, opacity 0.2s ease"});return H.jsxs("section",{id:"press",style:{position:"relative",background:"#000",color:"#fff",padding:"clamp(72px, 12vw, 140px) max(6vw, 32px) clamp(64px, 10vw, 120px)",fontFamily:'"Geist", "Inter Tight", "Inter", system-ui, sans-serif',borderTop:"1px solid rgba(255,255,255,0.06)"},children:[H.jsx("style",{children:".press-track::-webkit-scrollbar { display: none; }"}),H.jsxs("div",{style:{maxWidth:1400,margin:"0 auto"},children:[H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.30em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)",marginBottom:28},children:i.eyebrow}),H.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"20px 24px",marginBottom:40},children:[H.jsx("h2",{style:{fontSize:"clamp(28px, 3.2vw, 46px)",fontWeight:300,letterSpacing:"-0.025em",lineHeight:1.1,margin:0,color:"rgba(255,255,255,0.95)"},children:i.headline}),H.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[H.jsx("span",{"aria-live":"polite",style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",color:"rgba(255,255,255,0.5)",fontVariantNumeric:"tabular-nums"},children:M}),H.jsxs("div",{style:{display:"flex",gap:8},children:[H.jsx("button",{type:"button","aria-label":i.prev,disabled:p,onClick:()=>v(-1),style:T(p),onMouseEnter:I=>{p||(I.currentTarget.style.borderColor="#fff")},onMouseLeave:I=>{I.currentTarget.style.borderColor="rgba(255,255,255,0.18)"},children:H.jsx("span",{"aria-hidden":"true",children:"â"})}),H.jsx("button",{type:"button","aria-label":i.next,disabled:y,onClick:()=>v(1),style:T(y),onMouseEnter:I=>{y||(I.currentTarget.style.borderColor="#fff")},onMouseLeave:I=>{I.currentTarget.style.borderColor="rgba(255,255,255,0.18)"},children:H.jsx("span",{"aria-hidden":"true",children:"â"})})]})]})]}),H.jsx("div",{ref:f,className:"press-track",style:{display:"flex",gap:a,overflowX:"auto",scrollSnapType:"x mandatory",overscrollBehaviorX:"contain",scrollbarWidth:"none",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.06)"},children:r.map((I,C)=>{const L=L6[I.category][n],N=U6(I.date,n),B=!!I.href,A=H.jsxs(H.Fragment,{children:[H.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",marginBottom:26},children:[H.jsxs("span",{style:{color:I.upcoming?"rgba(255,255,255,0.4)":"rgba(255,255,255,0.85)",display:"inline-flex",alignItems:"center",gap:8},children:[H.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:I.upcoming?"rgba(255,255,255,0.3)":"#ffffff",display:"inline-block"}}),L]}),H.jsx("span",{style:{color:"rgba(255,255,255,0.5)",whiteSpace:"nowrap"},children:N})]}),H.jsx("div",{style:{fontSize:15,fontWeight:400,letterSpacing:"-0.01em",lineHeight:1.35,marginBottom:12,color:"rgba(255,255,255,0.95)",...c2(3)},children:I.title[n]}),H.jsx("div",{style:{flex:1}}),H.jsx("div",{style:{fontSize:13,lineHeight:1.5,color:"rgba(255,255,255,0.58)",marginBottom:18,...c2(4)},children:I.preview[n]}),H.jsxs("div",{style:{paddingTop:14,borderTop:"1px solid rgba(255,255,255,0.06)",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.5)"},children:[H.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:I.source}),I.upcoming?H.jsx("span",{style:{padding:"3px 8px",border:"1px solid rgba(255,255,255,0.18)",color:"rgba(255,255,255,0.55)",fontSize:10,letterSpacing:"0.22em"},children:i.upcomingTag}):H.jsx("span",{"aria-hidden":"true",style:{color:"rgba(255,255,255,0.85)"},children:"â"})]})]}),R={flex:`0 0 ${u}`,minWidth:0,scrollSnapAlign:"start",padding:"22px 22px 20px",background:"#08090c",display:"flex",flexDirection:"column",minHeight:240,boxSizing:"border-box",cursor:B?"pointer":"default",textDecoration:"none",color:"inherit",transition:"background 0.2s ease"},j=Z=>{Z.style.background="#0e1014"},Y=Z=>{Z.style.background="#08090c"};return B?H.jsx("a",{href:I.href,target:"_blank",rel:"noopener noreferrer",style:R,onMouseEnter:Z=>j(Z.currentTarget),onMouseLeave:Z=>Y(Z.currentTarget),children:A},C):H.jsx("div",{style:R,onMouseEnter:Z=>j(Z.currentTarget),onMouseLeave:Z=>Y(Z.currentTarget),children:A},C)})})]})]})}
4049const sg="[email protected]",F6=[{index:"01",audience:{de:"Bauen & Pilotprojekte",en:"Builders & pilots"},pitch:{de:"Setze das Modul in einem realen Projekt ein â mit Fokus auf Fertigteil-/Prefab-Anwendungen. Wir wählen erste Pilotpartner aus.",en:"Run the module on a real project â with a focus on precast/prefab applications. We are selecting first pilot partners."},cta:{de:"Pilot anfragen",en:"Start a pilot"},href:`mailto:${sg}?subject=Pilot%20inquiry`},{index:"02",audience:{de:"Partner & Investoren",en:"Partners & investors"},pitch:{de:"Wir öffnen ausgewählte Gespräche und teilen Material auf Anfrage.",en:"We open selected conversations and share material on request."},cta:{de:"Gespräch anfragen",en:"Request a conversation"},href:`mailto:${sg}?subject=Partnership%20conversation`},{index:"03",audience:{de:"Mitarbeiten",en:"Join the team"},pitch:{de:"Wir stellen opportunistisch in Entwicklung, Produktion und Betrieb in Dresden ein.",en:"We hire opportunistically across engineering, production and operations in Dresden."},cta:{de:"Offene Stellen",en:"See open roles"},href:"/careers.html"}],k6={de:{eyebrow:"08 · Kontakt",headline:"Lass uns bauen, was als Nächstes kommt.",sub:"Drei Wege, mitzumachen.",fallbackPre:"Oder schreib uns direkt:"},en:{eyebrow:"08 · Contact",headline:"Let's build what comes next.",sub:"Three ways to get involved.",fallbackPre:"Or write to us directly:"}};function z6(){const n=Zi(),e=k6[n];return H.jsx("section",{id:"contact",style:{position:"relative",background:"#000",color:"#fff",padding:"90px max(6vw, 32px) 80px",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',borderTop:"1px solid rgba(255,255,255,0.06)"},children:H.jsxs("div",{style:{maxWidth:1400,margin:"0 auto"},children:[H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.30em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)",marginBottom:28},children:e.eyebrow}),H.jsxs("div",{style:{marginBottom:40},children:[H.jsx("h2",{style:{fontSize:"clamp(28px, 3.2vw, 46px)",fontWeight:300,letterSpacing:"-0.025em",lineHeight:1.1,margin:0,color:"rgba(255,255,255,0.95)",maxWidth:900},children:e.headline}),H.jsx("p",{style:{fontSize:15,lineHeight:1.6,color:"rgba(255,255,255,0.55)",maxWidth:380,margin:0,marginTop:14},children:e.sub})]}),H.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(300px, 100%), 1fr))",gap:1,background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.06)"},children:F6.map((t,i)=>H.jsxs("a",{href:t.href,style:{display:"flex",flexDirection:"column",background:"#08090c",padding:"24px 22px 22px",textDecoration:"none",color:"inherit",minHeight:220,transition:"background 0.25s ease",position:"relative"},onMouseEnter:r=>{r.currentTarget.style.background="#0e1014";const s=r.currentTarget.querySelector(".cta-arrow");s&&(s.style.transform="translateX(4px)");const o=r.currentTarget.querySelector(".cta-label");o&&(o.style.color="#ffffff")},onMouseLeave:r=>{r.currentTarget.style.background="#08090c";const s=r.currentTarget.querySelector(".cta-arrow");s&&(s.style.transform="translateX(0)");const o=r.currentTarget.querySelector(".cta-label");o&&(o.style.color="#fff")},children:[H.jsx("div",{style:{position:"absolute",top:18,right:20,fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",color:"rgba(255,255,255,0.3)"},children:t.index}),H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.55)",marginBottom:18},children:t.audience[n]}),H.jsx("div",{style:{fontSize:13,fontWeight:400,lineHeight:1.5,color:"rgba(255,255,255,0.85)",marginBottom:18},children:t.pitch[n]}),H.jsx("div",{style:{flex:1}}),H.jsxs("div",{style:{paddingTop:12,borderTop:"1px solid rgba(255,255,255,0.08)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[H.jsx("span",{className:"cta-label",style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"#fff",transition:"color 0.25s ease"},children:t.cta[n]}),H.jsx("span",{className:"cta-arrow",style:{fontSize:14,color:"#ffffff",transition:"transform 0.25s ease",display:"inline-block"},children:"â"})]})]},i))}),H.jsxs("div",{style:{marginTop:36,display:"flex",alignItems:"baseline",gap:14,flexWrap:"wrap",paddingTop:20,borderTop:"1px solid rgba(255,255,255,0.06)"},children:[H.jsx("span",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.5)"},children:e.fallbackPre}),H.jsx("a",{href:`mailto:${sg}`,style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:13,color:"#fff",textDecoration:"none",borderBottom:"1px solid rgba(255,255,255,0.25)",paddingBottom:2,transition:"color 0.2s ease, border-color 0.2s ease"},onMouseEnter:t=>{t.currentTarget.style.color="#ffffff",t.currentTarget.style.borderBottomColor="#ffffff"},onMouseLeave:t=>{t.currentTarget.style.color="#fff",t.currentTarget.style.borderBottomColor="rgba(255,255,255,0.25)"},children:sg})]})]})})}const B6={de:{bigMark:"soul of concrete",close:{prefix:"Wir machen",phraseA:"korrodierenden Stahl",conj:" und ",phraseB:"manuelle Arbeit",suffix:" im Beton überflüssig."},patent:"EP 3 705 657. Patentierte Technologie.",company:"Soul of Concrete GmbH",locations:[{label:"Büro & F&E",lines:["Mohorner Str. 13","01159 Dresden"]},{label:"Produktion",lines:["Bräugasse 3","86720 Nördlingen"]}],columns:[{title:"Rechtliches",items:[{label:"Impressum",href:"/impressum.html"},{label:"Datenschutz",href:"/datenschutz.html"}]}],copyright:"© 2026 Soul of Concrete GmbH"},en:{bigMark:"soul of concrete",close:{prefix:"Making",phraseA:"corroding steel",conj:" and ",phraseB:"manual labor",suffix:" obsolete in concrete."},patent:"EP 3 705 657. Patented technology.",company:"Soul of Concrete GmbH",locations:[{label:"Office & R&D",lines:["Mohorner Str. 13","01159 Dresden"]},{label:"Production",lines:["Bräugasse 3","86720 Nördlingen"]}],columns:[{title:"Legal",items:[{label:"Imprint",href:"/impressum.html"},{label:"Privacy",href:"/datenschutz.html"}]}],copyright:"© 2026 Soul of Concrete GmbH"}};function H6(){const n=Zi(),e=B6[n];return H.jsxs("footer",{style:{position:"relative",background:"#000",color:"#fff",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',borderTop:"1px solid rgba(255,255,255,0.10)"},children:[H.jsx("div",{style:{padding:"80px max(6vw, 32px) 56px",maxWidth:1500,margin:"0 auto",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:H.jsxs("div",{style:{fontSize:"clamp(28px, 3.2vw, 46px)",fontWeight:300,letterSpacing:"-0.025em",lineHeight:1.12,color:"rgba(255,255,255,0.95)",maxWidth:860},children:[e.close.prefix," ",e.close.phraseA,e.close.conj,e.close.phraseB,e.close.suffix]})}),H.jsxs("div",{style:{padding:"64px max(6vw, 32px)",maxWidth:1500,margin:"0 auto",display:"flex",justifyContent:"space-between",gap:48,flexWrap:"wrap"},children:[H.jsxs("div",{style:{paddingRight:24},children:[H.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:20},children:[H.jsx("img",{src:"/soc-mark.svg",alt:"",width:28,height:28,style:{display:"block",opacity:.95}}),H.jsx("span",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:12,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.85)"},children:e.bigMark})]}),H.jsxs("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.02em",color:"rgba(255,255,255,0.5)",lineHeight:1.7},children:[H.jsx("div",{style:{color:"rgba(255,255,255,0.7)",marginBottom:14},children:e.company}),H.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"20px 40px"},children:e.locations.map((t,i)=>H.jsxs("div",{children:[H.jsx("div",{style:{textTransform:"uppercase",letterSpacing:"0.22em",fontSize:10,
4049color:"rgba(255,255,255,0.5)",marginBottom:6},children:t.label}),t.lines.map((r,s)=>H.jsx("div",{children:r},s))]},i))})]}),H.jsx("a",{href:"https://www.linkedin.com/company/soulofconcrete",target:"_blank",rel:"noopener noreferrer","aria-label":"Soul of Concrete auf LinkedIn (öffnet in neuem Tab)",style:{display:"inline-flex",alignItems:"center",marginTop:20,padding:"11px 16px",minHeight:44,boxSizing:"border-box",border:"1px solid rgba(255,255,255,0.15)",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,color:"rgba(255,255,255,0.7)",textDecoration:"none",letterSpacing:"0.22em",textTransform:"uppercase",transition:"color 0.2s ease, border-color 0.2s ease"},onMouseEnter:t=>{t.currentTarget.style.color="#ffffff",t.currentTarget.style.borderColor="#ffffff"},onMouseLeave:t=>{t.currentTarget.style.color="rgba(255,255,255,0.7)",t.currentTarget.style.borderColor="rgba(255,255,255,0.15)"},children:"LinkedIn â"})]}),e.columns.map((t,i)=>H.jsxs("div",{children:[H.jsx("div",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.4)",marginBottom:22},children:t.title}),H.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:12},children:t.items.map((r,s)=>H.jsx("li",{children:H.jsx("a",{href:r.href,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",padding:"8px 0",fontFamily:'"Geist", "Inter Tight", system-ui, sans-serif',fontSize:13,color:"rgba(255,255,255,0.72)",textDecoration:"none",transition:"color 0.2s ease"},onMouseEnter:o=>{o.currentTarget.style.color="#ffffff"},onMouseLeave:o=>{o.currentTarget.style.color="rgba(255,255,255,0.72)"},children:r.label})},s))})]},i))]}),H.jsx("div",{style:{padding:"28px max(6vw, 32px) 36px",maxWidth:1500,margin:"0 auto",borderTop:"1px solid rgba(255,255,255,0.06)",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.02em",color:"rgba(255,255,255,0.5)"},children:H.jsx("div",{children:e.copyright})})]})}const og=[{id:"top",de:"Start",en:"Start"},{id:"proof",sectionId:"proof",de:"Status",en:"Status"},{id:"capability",sectionId:"capability",de:"Anwendung",en:"Capability"},{id:"team",sectionId:"team",de:"Team",en:"Team"},{id:"press",sectionId:"press",de:"Presse",en:"Press"},{id:"contact",sectionId:"contact",de:"Kontakt",en:"Contact"}];function RP(n){var e;n.sectionId?(e=document.getElementById(n.sectionId))==null||e.scrollIntoView({behavior:"smooth",block:"start"}):window.scrollTo({top:0,behavior:"smooth"})}function G6(){const n=window.innerHeight/2;let e=-1;for(let t=0;t<og.length;t++){const i=og[t];if(!i.sectionId)continue;const r=document.getElementById(i.sectionId);if(!r)continue;const s=r.getBoundingClientRect();if(s.top<=n&&s.bottom>n)return t;s.top<=n&&(e=t)}return e>=0?e:0}function V6({scrollProgress:n}){const e=Zi(),t=Ja(640),[i,r]=ee.useState(0),[s,o]=ee.useState(null),[a,u]=ee.useState(!1);return ee.useEffect(()=>{if(t)return;const f=140,h=()=>{r(G6());const p=document.getElementById("proof"),m=p?p.getBoundingClientRect().top<window.innerHeight*.7:!1;u(m)};h();const d=window.setInterval(h,f);return()=>window.clearInterval(d)},[t]),t?null:H.jsx("nav",{"aria-hidden":!a,style:{position:"fixed",top:"50%",right:28,transform:"translateY(-50%)",zIndex:95,display:"flex",flexDirection:"column",gap:18,alignItems:"flex-end",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",opacity:a?1:0,pointerEvents:a?"auto":"none",transition:"opacity 0.3s ease"},children:og.map((f,h)=>{const d=h===i,p=h===s;return H.jsxs("button",{tabIndex:a?0:-1,onClick:()=>RP(f),onMouseEnter:()=>o(h),onMouseLeave:()=>o(null),onFocus:()=>o(h),onBlur:()=>o(null),style:{appearance:"none",background:"none",border:"none",padding:"4px 0 4px 14px",margin:0,cursor:"pointer",color:d?"#ffffff":"rgba(255,255,255,0.35)",fontFamily:"inherit",fontSize:"inherit",letterSpacing:"inherit",textTransform:"inherit",display:"flex",alignItems:"center",gap:12,transition:"color 0.2s ease, opacity 0.2s ease",opacity:d||p?1:.6},children:[H.jsx("span",{style:{opacity:d||p?1:0,transform:`translateX(${d||p?0:6}px)`,transition:"opacity 0.2s ease, transform 0.2s ease",whiteSpace:"nowrap"},children:e==="de"?f.de:f.en}),H.jsx("span",{"aria-hidden":!0,style:{display:"inline-block",width:d?18:10,height:1.5,background:d?"#ffffff"
4049:"rgba(255,255,255,0.45)",transition:"width 0.25s ease, background 0.25s ease"}})]},f.id)})})}const W6=og.find(n=>n.id==="contact");function X6(){const n=ee.useRef(null),e=Zi(),t=Ja(600);ee.useEffect(()=>{let r=0,s=-1;const o=()=>{const a=window.scrollY,u=window.innerHeight*.6,f=Math.round(Math.max(0,Math.min(1,a/u))*100)/100;n.current&&f!==s&&(s=f,n.current.style.background=`rgba(0,0,0,${.55+f*.35})`,n.current.style.borderBottomColor=`rgba(255,255,255,${.04+f*.06})`,n.current.style.backdropFilter=f>.05?"blur(12px)":"none",n.current.style.webkitBackdropFilter=f>.05?"blur(12px)":"none"),r=requestAnimationFrame(o)};return r=requestAnimationFrame(o),()=>cancelAnimationFrame(r)},[]);const i=r=>({background:"none",border:"none",padding:t?"12px 8px":0,margin:t?"-12px -4px":0,minHeight:t?44:void 0,cursor:"pointer",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.22em",color:e===r?"#ffffff":"rgba(255,255,255,0.5)",transition:"color 0.2s ease"});return H.jsxs("header",{ref:n,style:{position:"fixed",top:0,left:0,right:0,zIndex:120,background:"rgba(0,0,0,0)",borderBottom:"1px solid rgba(255,255,255,0)",transition:"background 0.25s ease, border-color 0.25s ease",padding:t?"16px max(4vw, 16px)":"18px max(6vw, 32px)",paddingTop:`calc(${t?16:18}px + env(safe-area-inset-top, 0px))`,display:"grid",gridTemplateColumns:"auto 1fr auto",alignItems:"center",gap:t?12:24,color:"#fff"},children:[H.jsxs("a",{href:"/","aria-label":"Soul of Concrete â home",style:{display:"flex",alignItems:"center",gap:12,textDecoration:"none",color:"#fff"},children:[H.jsx("img",{src:"/soc-mark.svg",alt:"",width:28,height:28,style:{display:"block",opacity:.95}}),!t&&H.jsx("span",{style:{fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:12,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.92)",whiteSpace:"nowrap"},children:"Soul of Concrete"})]}),H.jsx("div",{}),H.jsxs("div",{style:{display:"flex",gap:t?12:24,alignItems:"center",justifyContent:"flex-end"},children:[H.jsx("button",{onClick:()=>RP(W6),style:{appearance:"none",background:"none",border:"none",padding:t?"12px 8px":0,margin:t?"-12px -4px":0,minHeight:t?44:void 0,cursor:"pointer",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(255,255,255,0.85)",transition:"color 0.2s ease"},onMouseEnter:r=>{r.currentTarget.style.color="#ffffff"},onMouseLeave:r=>{r.currentTarget.style.color="rgba(255,255,255,0.85)"},children:e==="de"?"Kontakt":"Contact"}),H.jsx("span",{style:{color:"rgba(255,255,255,0.18)",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11},children:"|"}),H.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[H.jsx("button",{style:i("de"),onClick:()=>t2("de"),"aria-pressed":e==="de","aria-label":"Deutsch",children:"DE"}),H.jsx("span",{style:{color:"rgba(255,255,255,0.18)",fontFamily:'"Geist Mono", ui-monospace, monospace',fontSize:11},children:"/"}),H.jsx("button",{style:i("en"),onClick:()=>t2("en"),"aria-pressed":e==="en","aria-label":"English",children:"EN"})]})]})]})}const j6=typeof window<"u"&&Math.min(window.innerWidth,window.innerHeight)<600,Y6=j6?620:990,q6=typeof window<"u"&&Math.min(window.innerWidth,window.innerHeight)<600?1.5:2;function Z6(){const n=ee.useRef(null);return ee.useEffect(()=>{let e=0,t=performance.now()/1e3;const i=()=>{const r=n.current;if(!r)return;const s=r.getBoundingClientRect(),o=r.offsetHeight-window.innerHeight,a=Math.max(0,-s.top),f=(o>0?Math.max(0,Math.min(1,a/o)):0)*q4,h=performance.now()/1e3,d=Math.max(1/240,h-t),p=Math.abs(f-e)/d,m=.18;un.velocity=un.velocity*(1-m)+p*m,un.current=f,e=f,t=h};return un.scrollTo=(r,s="smooth")=>{const o=document.documentElement.scrollHeight-window.innerHeight;window.scrollTo({top:Math.max(0,Math.min(1,r))*o,behavior:s})},i(),window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[]),H.jsxs("div",{style:{background:"#000",color:"#fff",overflowX:"hidden",position:"relative"},children:[H.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:0,pointerEvents:"none"},children:H.jsx(WC,{shadows:!0,dpr:[1,q6],frameloop:"always",gl:{antialias:!0,toneMapping:nh,toneMappingExposure:1.15},camera:{position:[0,14,.2],fov:38,near:.1,far:100},style:{width:"100%",height:"100%",display:"block"},children:H.jsx(GH,{})})}),H.jsxs("div",{ref:n,"data-cinematic":!0,style:{position:"relative",height:`${Y6}vh`,zIndex:1,pointerEvents:"none"},children:[H.jsx(JH,{scrollProgress:un}),H.jsx(t6,{scrollProgress:un}),H.jsx(i6,{scrollProgress:un}),H.jsx(s6,{scrollProgress:un}),H.jsx(a6,{scrollProgress:un}),H.jsx(ZH,{scrollProgress:un})]}),H.jsxs("main",{style:{position:"relative",zIndex:2,background:"#000"},children:[H.jsx(f6,{}),H.jsx(C6,{}),H.jsx(I6,{}),H.jsx(O6,{}),H.jsx(z6,{}),H.jsx(H6,{})]}),H.jsx(X6,{}),H.jsx(V6,{scrollProgress:un})]})}Mb(document.getElementById("root")).render(H.jsx(ee.StrictMode,{children:H.jsx(Z6,{})}));
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.