vendor: 5,329 bytes, lines 1-9
1(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();function Aw(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var jv={exports:{}},gh={},Wv={exports:{}},mn={};/** 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 P_;function jE(){if(P_)return mn;P_=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=m&&O[m]||O["@@iterator"],typeof O=="function"?O:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,M={};function S(O,j,re){this.props=O,this.context=j,this.refs=M,this.updater=re||y}S.prototype.isReactComponent={},S.prototype.setState=function(O,j){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,j,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function w(){}w.prototype=S.prototype;function A(O,j,re){this.props=O,this.context=j,this.refs=M,this.updater=re||y}var T=A.prototype=new w;T.constructor=A,x(T,S.prototype),T.isPureReactComponent=!0;var R=Array.isArray,U=Object.prototype.hasOwnProperty,k={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function H(O,j,re){var ne,ie={},he=null,le=null;if(j!=null)for(ne in j.ref!==void 0&&(le=j.ref),j.key!==void 0&&(he=""+j.key),j)U.call(j,ne)&&!N.hasOwnProperty(ne)&&(ie[ne]=j[ne]);var ye=arguments.length-2;if(ye===1)ie.children=re;else if(1<ye){for(var ze=Array(ye),Xe=0;Xe<ye;Xe++)ze[Xe]=arguments[Xe+2];ie.children=ze}if(O&&O.defaultProps)for(ne in ye=O.defaultProps,ye)ie[ne]===void 0&&(ie[ne]=ye[ne]);return{$$typeof:r,type:O,key:he,ref:le,props:ie,_owner:k.current}}function F(O,j){return{$$typeof:r,type:O.type,key:j,ref:O.ref,props:O.props,_owner:O._owner}}function I(O){return typeof O=="object"&&O!==null&&O.$$typeof===r}function G(O){var j={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(re){return j[re]})}var W=/\/+/g;function X(O,j){return typeof O=="object"&&O!==null&&O.key!=null?G(""+O.key):j.toString(36)}function J(O,j,re,ne,ie){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var le=!1;if(O===null)le=!0;else switch(he){case"string":case"number":le=!0;break;case"object":switch(O.$$typeof){case r:case e:le=!0}}if(le)return le=O,ie=ie(le),O=ne===""?"."+X(le,0):ne,R(ie)?(re="",O!=null&&(re=O.replace(W,"$&/")+"/"),J(ie,j,re,"",function(Xe){return Xe})):ie!=null&&(I(ie)&&(ie=F(ie,re+(!ie.key||le&&le.key===ie.key?"":(""+ie.key).replace(W,"$&/")+"/")+O)),j.push(ie)),1;if(le=0,ne=ne===""?".":ne+":",R(O))for(var ye=0;ye<O.length;ye++){he=O[ye];var ze=ne+X(he,ye);le+=J(he,j,re,ze,ie)}else if(ze=v(O),typeof ze=="function")for(O=ze.call(O),ye=0;!(he=O.next()).done;)he=he.value,ze=ne+X(he,ye++),le+=J(he,j,re,ze,ie);else if(he==="object")throw j=String(O),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return le}function oe(O,j,re){if(O==null)return O;var ne=[],ie=0;return J(O,ne,"","",function(he){return j.call(re,he,ie++)}),ne}function se(O){if(O._status===-1){var j=O._result;j=j(),j.then(function(re){(O._status===0||O._status===-1)&&(O._status=1,O._result=re)},function(re){(O._status===0||O._status===-1)&&(O._status=2,O._result=re)}),O._status===-1&&(O._status=0,O._result=j)}if(O._status===1)return O._result.default;throw O._result}var fe={current:null},V={transition:null},$={ReactCurrentDispatcher:fe,ReactCurrentBatchConfig:V,ReactCurrentOwner:k};function Z(){throw Error("act(...) is not supported in production builds of React.")}return mn.Children={map:oe,forEach:function(O,j,re){oe(O,function(){j.apply(this,arguments)},re)},count:function(O){var j=0;return oe(O,function(){j++}),j},toArray:function(O){return oe(O,function(j){return j})||[]},only:function(O){if(!I(O))throw Error("React.Children.only expected to receive a single React element child.");return O}}
vendor: 3,411 bytes, lines 9-17
9,mn.Component=S,mn.Fragment=t,mn.Profiler=i,mn.PureComponent=A,mn.StrictMode=n,mn.Suspense=u,mn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,mn.act=Z,mn.cloneElement=function(O,j,re){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var ne=x({},O.props),ie=O.key,he=O.ref,le=O._owner;if(j!=null){if(j.ref!==void 0&&(he=j.ref,le=k.current),j.key!==void 0&&(ie=""+j.key),O.type&&O.type.defaultProps)var ye=O.type.defaultProps;for(ze in j)U.call(j,ze)&&!N.hasOwnProperty(ze)&&(ne[ze]=j[ze]===void 0&&ye!==void 0?ye[ze]:j[ze])}var ze=arguments.length-2;if(ze===1)ne.children=re;else if(1<ze){ye=Array(ze);for(var Xe=0;Xe<ze;Xe++)ye[Xe]=arguments[Xe+2];ne.children=ye}return{$$typeof:r,type:O.type,key:ie,ref:he,props:ne,_owner:le}},mn.createContext=function(O){return O={$$typeof:o,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:s,_context:O},O.Consumer=O},mn.createElement=H,mn.createFactory=function(O){var j=H.bind(null,O);return j.type=O,j},mn.createRef=function(){return{current:null}},mn.forwardRef=function(O){return{$$typeof:l,render:O}},mn.isValidElement=I,mn.lazy=function(O){return{$$typeof:p,_payload:{_status:-1,_result:O},_init:se}},mn.memo=function(O,j){return{$$typeof:d,type:O,compare:j===void 0?null:j}},mn.startTransition=function(O){var j=V.transition;V.transition={};try{O()}finally{V.transition=j}},mn.unstable_act=Z,mn.useCallback=function(O,j){return fe.current.useCallback(O,j)},mn.useContext=function(O){return fe.current.useContext(O)},mn.useDebugValue=function(){},mn.useDeferredValue=function(O){return fe.current.useDeferredValue(O)},mn.useEffect=function(O,j){return fe.current.useEffect(O,j)},mn.useId=function(){return fe.current.useId()},mn.useImperativeHandle=function(O,j,re){return fe.current.useImperativeHandle(O,j,re)},mn.useInsertionEffect=function(O,j){return fe.current.useInsertionEffect(O,j)},mn.useLayoutEffect=function(O,j){return fe.current.useLayoutEffect(O,j)},mn.useMemo=function(O,j){return fe.current.useMemo(O,j)},mn.useReducer=function(O,j,re){return fe.current.useReducer(O,j,re)},mn.useRef=function(O){return fe.current.useRef(O)},mn.useState=function(O){return fe.current.useState(O)},mn.useSyncExternalStore=function(O,j,re){return fe.current.useSyncExternalStore(O,j,re)},mn.useTransition=function(){return fe.current.useTransition()},mn.version="18.3.1",mn}var I_;function A0(){return I_||(I_=1,Wv.exports=jE()),Wv.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 L_;function WE(){if(L_)return gh;L_=1;var r=A0(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var p,m={},v=null,y=null;d!==void 0&&(v=""+d),u.key!==void 0&&(v=""+u.key),u.ref!==void 0&&(y=u.ref);for(p in u)n.call(u,p)&&!s.hasOwnProperty(p)&&(m[p]=u[p]);if(l&&l.defaultProps)for(p in u=l.defaultProps,u)m[p]===void 0&&(m[p]=u[p]);return{$$typeof:e,type:l,key:v,ref:y,props:m,_owner:i.current}}return gh.Fragment=t,gh.jsx=o,gh.jsxs=o,gh}var D_;
vendor: 53,352 bytes, lines 17-38
17function XE(){return D_||(D_=1,jv.exports=WE()),jv.exports}var E=XE(),K=A0();const YE=Aw(K);var Um={},Xv={exports:{}},Ns={},Yv={exports:{}},qv={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */var U_;function qE(){return U_||(U_=1,(function(r){function e(V,$){var Z=V.length;V.push($);e:for(;0<Z;){var O=Z-1>>>1,j=V[O];if(0<i(j,$))V[O]=$,V[Z]=j,Z=O;else break e}}function t(V){return V.length===0?null:V[0]}function n(V){if(V.length===0)return null;var $=V[0],Z=V.pop();if(Z!==$){V[0]=Z;e:for(var O=0,j=V.length,re=j>>>1;O<re;){var ne=2*(O+1)-1,ie=V[ne],he=ne+1,le=V[he];if(0>i(ie,Z))he<j&&0>i(le,ie)?(V[O]=le,V[he]=Z,O=he):(V[O]=ie,V[ne]=Z,O=ne);else if(he<j&&0>i(le,Z))V[O]=le,V[he]=Z,O=he;else break e}}return $}function i(V,$){var Z=V.sortIndex-$.sortIndex;return Z!==0?Z:V.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();r.unstable_now=function(){return o.now()-l}}var u=[],d=[],p=1,m=null,v=3,y=!1,x=!1,M=!1,S=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(V){for(var $=t(d);$!==null;){if($.callback===null)n(d);else if($.startTime<=V)n(d),$.sortIndex=$.expirationTime,e(u,$);else break;$=t(d)}}function R(V){if(M=!1,T(V),!x)if(t(u)!==null)x=!0,se(U);else{var $=t(d);$!==null&&fe(R,$.startTime-V)}}function U(V,$){x=!1,M&&(M=!1,w(H),H=-1),y=!0;var Z=v;try{for(T($),m=t(u);m!==null&&(!(m.expirationTime>$)||V&&!G());){var O=m.callback;if(typeof O=="function"){m.callback=null,v=m.priorityLevel;var j=O(m.expirationTime<=$);$=r.unstable_now(),typeof j=="function"?m.callback=j:m===t(u)&&n(u),T($)}else n(u);m=t(u)}if(m!==null)var re=!0;else{var ne=t(d);ne!==null&&fe(R,ne.startTime-$),re=!1}return re}finally{m=null,v=Z,y=!1}}var k=!1,N=null,H=-1,F=5,I=-1;function G(){return!(r.unstable_now()-I<F)}function W(){if(N!==null){var V=r.unstable_now();I=V;var $=!0;try{$=N(!0,V)}finally{$?X():(k=!1,N=null)}}else k=!1}var X;if(typeof A=="function")X=function(){A(W)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,oe=J.port2;J.port1.onmessage=W,X=function(){oe.postMessage(null)}}else X=function(){S(W,0)};function se(V){N=V,k||(k=!0,X())}function fe(V,$){H=S(function(){V(r.unstable_now())},$)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(V){V.callback=null},r.unstable_continueExecution=function(){x||y||(x=!0,se(U))},r.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<V?Math.floor(1e3/V):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_getFirstCallbackNode=function(){return t(u)},r.unstable_next=function(V){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var Z=v;v=$;try{return V()}finally{v=Z}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(V,$){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var Z=v;v=V;try{return $()}finally{v=Z}},r.unstable_scheduleCallback=function(V,$,Z){var O=r.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?O+Z:O):Z=O,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,V={id:p++,callback:$,priorityLevel:V,startTime:Z,expirationTime:j,sortIndex:-1},Z>O?(V.sortIndex=Z,e(d,V),t(u)===null&&V===t(d)&&(M?(w(H),H=-1):M=!0,fe(R,Z-O))):(V.sortIndex=j,e(u,V),x||y||(x=!0,se(U))),V},r.unstable_shouldYield=G,r.unstable_wrapCallback=function(V){var $=v;return function(){var Z=v;v=$;try{return V.apply(this,arguments)}finally{v=Z}}}})(qv)),qv}var k_;function KE(){return k_||(k_=1,Yv.exports=qE()),Yv.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 F_;function ZE(){if(F_)return Ns;F_=1;var r=A0(),e=KE();function t(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,g=1;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function s(a,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(i[a]=c,a=0;a<c.length;a++)n.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function v(a){return u.call(m,a)?!0:u.call(p,a)?!1:d.test(a)?m[a]=!0:(p[a]=!0,!1)}function y(a,c,g,b){if(g!==null&&g.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return b?!1:g!==null?!g.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function x(a,c,g,b){if(c===null||typeof c>"u"||y(a,c,g,b))return!0;if(b)return!1;if(g!==null)switch(g.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function M(a,c,g,b,P,D,q){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=b,this.attributeNamespace=P,this.mustUseProperty=g,this.propertyName=a,this.type=c,this.sanitizeURL=D,this.removeEmptyString=q}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){S[a]=new M(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];S[c]=new M(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){S[a]=new M(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){S[a]=new M(a,2,!1,a,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(a){S[a]=new M(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){S[a]=new M(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){S[a]=new M(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){S[a]=new M(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){S[a]=new M(a,5,!1,a.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function A(a){return a[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(a){var c=a.replace(w,A);S[c]=new M(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(w,A);S[c]=new M(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(w,A);S[c]=new M(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){S[a]=new M(a,1,!1,a.toLowerCase(),null,!1,!1)}),S.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){S[a]=new M(a,1,!1,a.toLowerCase(),null,!0,!0)});function T(a,c,g,b){var P=S.hasOwnProperty(c)?S[c]:null;(P!==null?P.type!==0:b||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(x(c,g,P,b)&&(g=null),b||P===null?v(c)&&(g===null?a.removeAttribute(c):a.setAttribute(c,""+g)):P.mustUseProperty?a[P.propertyName]=g===null?P.type===3?!1:"":g:(c=P.attributeName,b=P.attributeNamespace,g===null?a.removeAttribute(c):(P=P.type,g=P===3||P===4&&g===!0?"":""+g,b?a.setAttributeNS(b,c,g):a.setAttribute(c,g))))}var R=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,U=Symbol.for("react.element"),k=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),G=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),fe=Symbol.for("react.offscreen"),V=Symbol.iterator;function $(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var Z=Object.assign,O;function j(a){if(O===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);O=c&&c[1]||""}return` 34`+O+a}var re=!1;function ne(a,c){if(!a||re)return"";re=!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(Ve){var b=Ve}Reflect.construct(a,[],c)}else{try{c.call()}catch(Ve){b=Ve}a.call(c.prototype)}else{try{throw Error()}catch(Ve){b=Ve}a()}}catch(Ve){if(Ve&&b&&typeof Ve.stack=="string"){for(var P=Ve.stack.split(` 35`),D=b.stack.split(` 36`),q=P.length-1,de=D.length-1;1<=q&&0<=de&&P[q]!==D[de];)de--;for(;1<=q&&0<=de;q--,de--)if(P[q]!==D[de]){if(q!==1||de!==1)do if(q--,de--,0>de||P[q]!==D[de]){var me=` 37`+P[q].replace(" at new "," at ");return a.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",a.displayName)),me}while(1<=q&&0<=de);break}}}finally{re=!1,Error.prepareStackTrace=g}return(a=a?a.displayName||a.name:"")?j(a):""}function ie(a){switch(a.tag){case 5:return j(a.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return a=ne(a.type,!1),a;case 11:return a=ne(a.type.render,!1),a;case 1:return a=ne(a.type,!0),a;default:return""}}function he(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case N:return"Fragment";case k:return"Portal";case F:return"Profiler";case H:return"StrictMode";case X:return"Suspense";case J:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case G:return(a.displayName||"Context")+".Consumer";case I:return(a._context.displayName||"Context")+".Provider";case W:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case oe:return c=a.displayName||null,c!==null?c:he(a.type)||"Memo";case se:c=a._payload,a=a._init;try{return he(a(c))}catch{}}return null}function le(a){var c=a.type;switch(a.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 a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(c);case 8:return c===H?"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 ye(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ze(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Xe(a){var c=ze(a)?"checked":"value",g=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),b=""+a[c];if(!a.hasOwnProperty(c)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var P=g.get,D=g.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return P.call(this)},set:function(q){b=""+q,D.call(this,q)}}),Object.defineProperty(a,c,{enumerable:g.enumerable}),{getValue:function(){return b},setValue:function(q){b=""+q},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Ie(a){a._valueTracker||(a._valueTracker=Xe(a))}function Y(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var g=c.getValue(),b="";return a&&(b=ze(a)?a.checked?"true":"false":a.value),a=b,a!==g?(c.setValue(a),!0):!1}function Ce(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Le(a,c){var g=c.checked;return Z({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??a._wrapperState.initialChecked})}function Ge(a,c){var g=c.defaultValue==null?"":c.defaultValue,b=c.checked!=null?c.checked:c.defaultChecked;g=ye(c.value!=null?c.value:g),a._wrapperState={initialChecked:b,initialValue:g,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Ae(a,c){c=c.checked,c!=null&&T(a,"checked",c,!1)}function $e(a,c){Ae(a,c);var g=ye(c.value),b=c.type;if(g!=null)b==="number"?(g===0&&a.value===""||a.value!=g)&&(a.value=""+g):a.value!==""+g&&(a.value=""+g);else if(b==="submit"||b==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?He(a,c.type,g):c.hasOwnProperty("defaultValue")&&He(a,c.type,ye(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function Re(a,c,g){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var b=c.type;if(!(b!=="submit"&&b!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,g||c===a.value||(a.value=c),a.defaultValue=c}g=a.name,g!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,g!==""&&(a.name=g)}function He(a,c,g){(c!=="number"||Ce(a.ownerDocument)!==a)&&(g==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+g&&(a.defaultValue=""+g))}var Q=Array.isArray;function B(a,c,g,b){if(a=a.options,c){c={};for(var P=0;P<g.length;P++)c["$"+g[P]]=!0;for(g=0;g<a.length;g++)P=c.hasOwnProperty("$"+a[g].value),a[g].selected!==P&&(a[g].selected=P),P&&b&&(a[g].defaultSelected=!0)}else{for(g=""+ye(g),c=null,P=0;P<a.length;P++){if(a[P].value===g){a[P].selected=!0,b&&(a[P].defaultSelected=!0);return}c!==null||a[P].disabled||(c=a[P])}c!==null&&(c.selected=!0)}}function pe(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(t(91));return Z({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function ge(a,c){var g=c.value;if(g==null){if(g=c.children,c=c.defaultValue,g!=null){if(c!=null)throw Error(t(92));if(Q(g)){if(1<g.length)throw Error(t(93));g=g[0]}c=g}c==null&&(c=""),g=c}a._wrapperState={initialValue:ye(g)}}function ve(a,c){var g=ye(c.value),b=ye(c.defaultValue);g!=null&&(g=""+g,g!==a.value&&(a.value=g),c.defaultValue==null&&a.defaultValue!==g&&(a.defaultValue=g)),b!=null&&(a.defaultValue=""+b)}function we(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function ut(a){switch(a){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 Oe(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?ut(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Qe,at=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,g,b,P){MSApp.execUnsafeLocalFunction(function(){return a(c,g,b,P)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Qe=Qe||document.createElement("div"),Qe.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Qe.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Ke(a,c){if(c){var g=a.firstChild;if(g&&g===a.lastChild&&g.nodeType===3){g.nodeValue=c;return}}a.textContent=c}var tt={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},wt=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(a){wt.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),tt[c]=tt[a]})});function nt(a,c,g){return c==null||typeof c=="boolean"||c===""?"":g||typeof c!="number"||c===0||tt.hasOwnProperty(a)&&tt[a]?(""+c).trim():c+"px"}function et(a,c){a=a.style;for(var g in c)if(c.hasOwnProperty(g)){var b=g.indexOf("--")===0,P=nt(g,c[g],b);g==="float"&&(g="cssFloat"),b?a.setProperty(g,P):a[g]=P}}var it=Z({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 ue(a,c){if(c){if(it[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(t(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(t(61))}if(c.style!=null&&typeof c.style!="object")throw Error(t(62))}}function qe(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){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 ce=null;function Fe(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var xe=null,De=null,rt=null;function mt(a){if(a=Lo(a)){if(typeof xe!="function")throw Error(t(280));var c=a.stateNode;c&&(c=dd(c),xe(a.stateNode,a.type,c))}}function vt(a){De?rt?rt.push(a):rt=[a]:De=a}function kt(){if(De){var a=De,c=rt;if(rt=De=null,mt(a),c)for(a=0;a<c.length;a++)mt(c[a])}}function Ft(a,c){return a(c)}function pt(){}var Kt=!1;function dn(a,c,g){if(Kt)return a(c,g);Kt=!0;try{return Ft(a,c,g)}finally{Kt=!1,(De!==null||rt!==null)&&(pt(),kt())}}function Sn(a,c){var g=a.stateNode;if(g===null)return null;var b=dd(g);if(b===null)return null;g=b[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(a=a.type,b=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!b;break e;default:a=!1}if(a)return null;if(g&&typeof g!="function")throw Error(t(231,c,typeof g));return g}var bn=!1;if(l)try{var ii={};Object.defineProperty(ii,"passive",{get:function(){bn=!0}}),window.addEventListener("test",ii,ii),window.removeEventListener("test",ii,ii)}catch{bn=!1}function vr(a,c,g,b,P,D,q,de,me){var Ve=Array.prototype.slice.call(arguments,3);try{c.apply(g,Ve)}catch(ot){this.onError(ot)}}var fi=!1,Ai=null,_i=!1,Si=null,hi={onError:function(a){fi=!0,Ai=a}};function Pr(a,c,g,b,P,D,q,de,me){fi=!1,Ai=null,vr.apply(hi,arguments)}function xo(a,c,g,b,P,D,q,de,me){if(Pr.apply(this,arguments),fi){if(fi){var Ve=Ai;fi=!1,Ai=null}else throw Error(t(198));_i||(_i=!0,Si=Ve)}}function Vn(a){var c=a,g=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(g=c.return),a=c.return;while(a)}return c.tag===3?g:null}function Hs(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function ee(a){if(Vn(a)!==a)throw Error(t(188))}function Se(a){var c=a.alternate;if(!c){if(c=Vn(a),c===null)throw Error(t(188));return c!==a?null:a}for(var g=a,b=c;;){var P=g.return;if(P===null)break;var D=P.alternate;if(D===null){if(b=P.return,b!==null){g=b;continue}break}if(P.child===D.child){for(D=P.child;D;){if(D===g)return ee(P),a;if(D===b)return ee(P),c;D=D.sibling}throw Error(t(188))}if(g.return!==b.return)g=P,b=D;else{for(var q=!1,de=P.child;de;){if(de===g){q=!0,g=P,b=D;break}if(de===b){q=!0,b=P,g=D;break}de=de.sibling}if(!q){for(de=D.child;de;){if(de===g){q=!0,g=D,b=P;break}if(de===b){q=!0,b=D,g=P;break}de=de.sibling}if(!q)throw Error(t(189))}}if(g.alternate!==b)throw Error(t(190))}if(g.tag!==3)throw Error(t(188));return g.stateNode.current===g?a:c}function Ue(a){return a=Se(a),a!==null?ke(a):null}function ke(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=ke(a);if(c!==null)return c;a=a.sibling}return null}var Te=e.unstable_scheduleCallback,lt=e.unstable_cancelCallback,yt=e.unstable_shouldYield,Tt=e.unstable_requestPaint,je=e.unstable_now,Lt=e.unstable_getCurrentPriorityLevel,Ot=e.unstable_ImmediatePriority,xt=e.unstable_UserBlockingPriority,Zt=e.unstable_NormalPriority,wn=e.unstable_LowPriority,pn=e.unstable_IdlePriority,En=null,Mt=null;function ft(a){if(Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(En,a,void 0,(a.current.flags&128)===128)}catch{}}var Qt=Math.clz32?Math.clz32:ri,zt=Math.log,xn=Math.LN2;function ri(a){return a>>>=0,a===0?32:31-(zt(a)/xn|0)|0}var Tn=64,Hn=4194304;function an(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ci(a,c){var g=a.pendingLanes;if(g===0)return 0;var b=0,P=a.suspendedLanes,D=a.pingedLanes,q=g&268435455;if(q!==0){var de=q&~P;de!==0?b=an(de):(D&=q,D!==0&&(b=an(D)))}else q=g&~P,q!==0?b=an(q):D!==0&&(b=an(D));if(b===0)return 0;if(c!==0&&c!==b&&(c&P)===0&&(P=b&-b,D=c&-c,P>=D||P===16&&(D&4194240)!==0))return c;if((b&4)!==0&&(b|=g&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=b;0<c;)g=31-Qt(c),P=1<<g,b|=a[g],c&=~P;return b}function fs(a,c){switch(a){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 Jn(a,c){for(var g=a.suspendedLanes,b=a.pingedLanes,P=a.expirationTimes,D=a.pendingLanes;0<D;){var q=31-Qt(D),de=1<<q,me=P[q];me===-1?((de&g)===0||(de&b)!==0)&&(P[q]=fs(de,c)):me<=c&&(a.expiredLanes|=de),D&=~de}}function pi(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Ni(){var a=Tn;return Tn<<=1,(Tn&4194240)===0&&(Tn=64),a}function Yr(a){for(var c=[],g=0;31>g;g++)c.push(a);return c}function qr(a,c,g){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Qt(c),a[c]=g}function Ua(a,c){var g=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var b=a.eventTimes;for(a=a.expirationTimes;0<g;){var P=31-Qt(g),D=1<<P;c[P]=0,b[P]=-1,a[P]=-1,g&=~D}}function Ee(a,c){var g=a.entangledLanes|=c;for(a=a.entanglements;g;){var b=31-Qt(g),P=1<<b;P&c|a[b]&c&&(a[b]|=c),g&=~P}}var Ze=0;function Ht(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Jt,yr,Qn,hs,so,Ir=!1,Kr=[],Ri=null,Yt=null,An=null,Ln=new Map,gn=new Map,jn=[],_o="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 Wn(a,c){switch(a){case"focusin":case"focusout":Ri=null;break;case"dragenter":case"dragleave":Yt=null;break;case"mouseover":case"mouseout":An=null;break;case"pointerover":case"pointerout":Ln.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":gn.delete(c.pointerId)}}function Gs(a,c,g,b,P,D){return a===null||a.nativeEvent!==D?(a={blockedOn:c,domEventName:g,eventSystemFlags:b,nativeEvent:D,targetContainers:[P]},c!==null&&(c=Lo(c),c!==null&&yr(c)),a):(a.eventSystemFlags|=b,c=a.targetContainers,P!==null&&c.indexOf(P)===-1&&c.push(P),a)}function Hu(a,c,g,b,P){switch(c){case"focusin":return Ri=Gs(Ri,a,c,g,b,P),!0;case"dragenter":return Yt=Gs(Yt,a,c,g,b,P),!0;case"mouseover":return An=Gs(An,a,c,g,b,P),!0;case"pointerover":var D=P.pointerId;return Ln.set(D,Gs(Ln.get(D)||null,a,c,g,b,P)),!0;case"gotpointercapture":return D=P.pointerId,gn.set(D,Gs(gn.get(D)||null,a,c,g,b,P)),!0}return!1}function xr(a){var c=ya(a.target);if(c!==null){var g=Vn(c);if(g!==null){if(c=g.tag,c===13){if(c=Hs(g),c!==null){a.blockedOn=c,so(a.priority,function(){Qn(g)});return}}else if(c===3&&g.stateNode.current.memoizedState.isDehydrated){a.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}a.blockedOn=null}function aa(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var g=_r(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(g===null){g=a.nativeEvent;var b=new g.constructor(g.type,g);ce=b,g.target.dispatchEvent(b),ce=null}else return c=Lo(g),c!==null&&yr(c),a.blockedOn=g,!1;c.shift()}return!0}function la(a,c,g){aa(a)&&g.delete(c)}function ps(){Ir=!1,Ri!==null&&aa(Ri)&&(Ri=null),Yt!==null&&aa(Yt)&&(Yt=null),An!==null&&aa(An)&&(An=null),Ln.forEach(la),gn.forEach(la)}function So(a,c){a.blockedOn===c&&(a.blockedOn=null,Ir||(Ir=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ps)))}function ca(a){function c(P){return So(P,a)}if(0<Kr.length){So(Kr[0],a);for(var g=1;g<Kr.length;g++){var b=Kr[g];b.blockedOn===a&&(b.blockedOn=null)}}for(Ri!==null&&So(Ri,a),Yt!==null&&So(Yt,a),An!==null&&So(An,a),Ln.forEach(c),gn.forEach(c),g=0;g<jn.length;g++)b=jn[g],b.blockedOn===a&&(b.blockedOn=null);for(;0<jn.length&&(g=jn[0],g.blockedOn===null);)xr(g),g.blockedOn===null&&jn.shift()}var ji=R.ReactCurrentBatchConfig,Wi=!0;function oo(a,c,g,b){var P=Ze,D=ji.transition;ji.transition=null;try{Ze=1,ka(a,c,g,b)}finally{Ze=P,ji.transition=D}}function Cs(a,c,g,b){var P=Ze,D=ji.transition;ji.transition=null;try{Ze=4,ka(a,c,g,b)}finally{Ze=P,ji.transition=D}}function ka(a,c,g,b){if(Wi){var P=_r(a,c,g,b);if(P===null)sd(a,c,b,ua,g),Wn(a,b);else if(Hu(P,a,c,g,b))b.stopPropagation();else if(Wn(a,b),c&4&&-1<_o.indexOf(a)){for(;P!==null;){var D=Lo(P);if(D!==null&&Jt(D),D=_r(a,c,g,b),D===null&&sd(a,c,b,ua,g),D===P)break;P=D}P!==null&&b.stopPropagation()}else sd(a,c,b,null,g)}}var ua=null;function _r(a,c,g,b){if(ua=null,a=Fe(b),a=ya(a),a!==null)if(c=Vn(a),c===null)a=null;else if(g=c.tag,g===13){if(a=Hs(c),a!==null)return a;a=null}else if(g===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return ua=a,null}function da(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Lt()){case Ot:return 1;case xt:return 4;case Zt:case wn:return 16;case pn:return 536870912;default:return 16}default:return 16}}var Zr=null,bo=null,Xi=null;function Oi(){if(Xi)return Xi;var a,c=bo,g=c.length,b,P="value"in Zr?Zr.value:Zr.textContent,D=P.length;for(a=0;a<g&&c[a]===P[a];a++);var q=g-a;for(b=1;b<=q&&c[g-b]===P[D-b];b++);return Xi=P.slice(a,1<b?1-b:void 0)}function wo(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Jr(){return!0}function Mo(){return!1}function Yi(a){function c(g,b,P,D,q){this._reactName=g,this._targetInst=P,this.type=b,this.nativeEvent=D,this.target=q,this.currentTarget=null;for(var de in a)a.hasOwnProperty(de)&&(g=a[de],this[de]=g?g(D):D[de]);return this.isDefaultPrevented=(D.defaultPrevented!=null?D.defaultPrevented:D.returnValue===!1)?Jr:Mo,this.isPropagationStopped=Mo,this}return Z(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=Jr)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=Jr)},persist:function(){},isPersistent:Jr}),c}var Eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pi=Yi(Eo),Bi=Z({},Eo,{view:0,detail:0}),bi=Yi(Bi),si,Lr,Rs,wl=Z({},Bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ha,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Rs&&(Rs&&a.type==="mousemove"?(si=a.screenX-Rs.screenX,Lr=a.screenY-Rs.screenY):Lr=si=0,Rs=a),si)},movementY:function(a){return"movementY"in a?a.movementY:Lr}}),Ef=Yi(wl),To=Z({},wl,{dataTransfer:0}),fa=Yi(To),Gu=Z({},Bi,{relatedTarget:0}),Vu=Yi(Gu),ju=Z({},Eo,{animationName:0,elapsedTime:0,pseudoElement:0}),jp=Yi(ju),Wp=Z({},Eo,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Tf=Yi(Wp),Wu=Z({},Eo,{data:0}),Af=Yi(Wu),Xp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yp={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"},Cf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ml(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=Cf[a])?!!c[a]:!1}function ha(){return Ml}var Xu=Z({},Bi,{key:function(a){if(a.key){var c=Xp[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=wo(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Yp[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ha,charCode:function(a){return a.type==="keypress"?wo(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?wo(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Yu=Yi(Xu),Ps=Z({},wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ms=Yi(Ps),Fa=Z({},Bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ha}),Ao=Yi(Fa),Co=Z({},Eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Na=Yi(Co),qp=Z({},wl,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Rf=Yi(qp),Pf=[9,13,27,32],Dr=l&&"CompositionEvent"in window,rr=null;l&&"documentMode"in document&&(rr=document.documentMode);var $n=l&&"TextEvent"in window&&!rr,El=l&&(!Dr||rr&&8<rr&&11>=rr),Is=" ",If=!1;function Lf(a,c){switch(a){case"keyup":return Pf.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qu(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var pa=!1;function Kp(a,c){switch(a){case"compositionend":return qu(c);case"keypress":return c.which!==32?null:(If=!0,Is);case"textInput":return a=c.data,a===Is&&If?null:a;default:return null}}function Sc(a,c){if(pa)return a==="compositionend"||!Dr&&Lf(a,c)?(a=Oi(),Xi=bo=Zr=null,pa=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return El&&c.locale!=="ko"?null:c.data;default:return null}}var Tl={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 Ku(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!Tl[a.type]:c==="textarea"}function Al(a,c,g,b){vt(b),c=od(c,"onChange"),0<c.length&&(g=new Pi("onChange","change",null,g,b),a.push({event:g,listeners:c}))}var ma=null,Cl=null;function Zp(a){Ll(a,0)}function Ro(a){var c=wi(a);if(Y(c))return a}function Jp(a,c){if(a==="change")return c}var Rl=!1;if(l){var Qr;if(l){var Oa="oninput"in document;if(!Oa){var Ba=document.createElement("div");Ba.setAttribute("oninput","return;"),Oa=typeof Ba.oninput=="function"}Qr=Oa}else Qr=!1;Rl=Qr&&(!document.documentMode||9<document.documentMode)}function Vs(){ma&&(ma.detachEvent("onpropertychange",Zu),Cl=ma=null)}function Zu(a){if(a.propertyName==="value"&&Ro(Cl)){var c=[];Al(c,Cl,a,Fe(a)),dn(Zp,c)}}function Pl(a,c,g){a==="focusin"?(Vs(),ma=c,Cl=g,ma.attachEvent("onpropertychange",Zu)):a==="focusout"&&Vs()}function Qp(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ro(Cl)}function Df(a,c){if(a==="click")return Ro(c)}function oi(a,c){if(a==="input"||a==="change")return Ro(c)}function Ju(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var gs=typeof Object.is=="function"?Object.is:Ju;function za(a,c){if(gs(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var g=Object.keys(a),b=Object.keys(c);if(g.length!==b.length)return!1;for(b=0;b<g.length;b++){var P=g[b];if(!u.call(c,P)||!gs(a[P],c[P]))return!1}return!0}function bc(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vs(a,c){var g=bc(a);a=0;for(var b;g;){if(g.nodeType===3){if(b=a+g.textContent.length,a<=c&&b>=c)return{node:g,offset:c-a};a=b}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=bc(g)}}function Ha(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?Ha(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function ai(){for(var a=window,c=Ce();c instanceof a.HTMLIFrameElement;){try{var g=typeof c.contentWindow.location.href=="string"}catch{g=!1}if(g)a=c.contentWindow;else break;c=Ce(a.document)}return c}function qi(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function Ki(a){var c=ai(),g=a.focusedElem,b=a.selectionRange;if(c!==g&&g&&g.ownerDocument&&Ha(g.ownerDocument.documentElement,g)){if(b!==null&&qi(g)){if(c=b.start,a=b.end,a===void 0&&(a=c),"selectionStart"in g)g.selectionStart=c,g.selectionEnd=Math.min(a,g.value.length);else if(a=(c=g.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var P=g.textContent.length,D=Math.min(b.start,P);b=b.end===void 0?D:Math.min(b.end,P),!a.extend&&D>b&&(P=b,b=D,D=P),P=vs(g,D);var q=vs(g,b);P&&q&&(a.rangeCount!==1||a.anchorNode!==P.node||a.anchorOffset!==P.offset||a.focusNode!==q.node||a.focusOffset!==q.offset)&&(c=c.createRange(),c.setStart(P.node,P.offset),a.removeAllRanges(),D>b?(a.addRange(c),a.extend(q.node,q.offset)):(c.setEnd(q.node,q.offset),a.addRange(c)))}}for(c=[],a=g;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<c.length;g++)a=c[g],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var Qu=l&&"documentMode"in document&&11>=document.documentMode,ao=null,Ga=null,wc=null,Zi=!1;function $u(a,c,g){var b=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;Zi||ao==null||ao!==Ce(b)||(b=ao,"selectionStart"in b&&qi(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),wc&&za(wc,b)||(wc=b,b=od(Ga,"onSelect"),0<b.length&&(c=new Pi("onSelect","select",null,c,g),a.push({event:c,listeners:b}),c.target=ao)))}function Il(a,c){var g={};return g[a.toLowerCase()]=c.toLowerCase(),g["Webkit"+a]="webkit"+c,g["Moz"+a]="moz"+c,g}var ga={animationend:Il("Animation","AnimationEnd"),animationiteration:Il("Animation","AnimationIteration"),animationstart:Il("Animation","AnimationStart"),transitionend:Il("Transition","TransitionEnd")},js={},Ws={};l&&(Ws=document.createElement("div").style,"AnimationEvent"in window||(delete ga.animationend.animation,delete ga.animationiteration.animation,delete ga.animationstart.animation),"TransitionEvent"in window||delete ga.transitionend.transition);function lo(a){if(js[a])return js[a];if(!ga[a])return a;var c=ga[a],g;for(g in c)if(c.hasOwnProperty(g)&&g in Ws)return js[a]=c[g];return a}var Mc=lo("animationend"),Ec=lo("animationiteration"),Uf=lo("animationstart"),kf=lo("transitionend"),Ff=new Map,Nf="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 Po(a,c){Ff.set(a,c),s(c,[a])}for(var ed=0;ed<Nf.length;ed++){var Tc=Nf[ed],Ac=Tc.toLowerCase(),$p=Tc[0].toUpperCase()+Tc.slice(1);Po(Ac,"on"+$p)}Po(Mc,"onAnimationEnd"),Po(Ec,"onAnimationIteration"),Po(Uf,"onAnimationStart"),Po("dblclick","onDoubleClick"),Po("focusin","onFocus"),Po("focusout","onBlur"),Po(kf,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var va="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(" "),td=new Set("cancel close invalid load scroll toggle".split(" ").concat(va));function nd(a,c,g){var b=a.type||"unknown-event";a.currentTarget=g,xo(b,c,void 0,a),a.currentTarget=null}function Ll(a,c){c=(c&4)!==0;for(var g=0;g<a.length;g++){var b=a[g],P=b.event;b=b.listeners;e:{var D=void 0;if(c)for(var q=b.length-1;0<=q;q--){var de=b[q],me=de.instance,Ve=de.currentTarget;if(de=de.listener,me!==D&&P.isPropagationStopped())break e;nd(P,de,Ve),D=me}else for(q=0;q<b.length;q++){if(de=b[q],me=de.instance,Ve=de.currentTarget,de=de.listener,me!==D&&P.isPropagationStopped())break e;nd(P,de,Ve),D=me}}}if(_i)throw a=Si,_i=!1,Si=null,a}function Xn(a,c){var g=c[Wa];g===void 0&&(g=c[Wa]=new Set);var b=a+"__bubble";g.has(b)||(rd(c,a,2,!1),g.add(b))}function id(a,c,g){var b=0;c&&(b|=4),rd(g,a,b,c)}var Cc="_reactListening"+Math.random().toString(36).slice(2);function Dl(a){if(!a[Cc]){a[Cc]=!0,n.forEach(function(g){g!=="selectionchange"&&(td.has(g)||id(g,!1,a),id(g,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Cc]||(c[Cc]=!0,id("selectionchange",!1,c))}}function rd(a,c,g,b){switch(da(c)){case 1:var P=oo;break;case 4:P=Cs;break;default:P=ka}g=P.bind(null,c,g,a),P=void 0,!bn||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(P=!0),b?P!==void 0?a.addEventListener(c,g,{capture:!0,passive:P}):a.addEventListener(c,g,!0):P!==void 0?a.addEventListener(c,g,{passive:P}):a.addEventListener(c,g,!1)}function sd(a,c,g,b,P){var D=b;if((c&1)===0&&(c&2)===0&&b!==null)e:for(;;){if(b===null)return;var q=b.tag;if(q===3||q===4){var de=b.stateNode.containerInfo;if(de===P||de.nodeType===8&&de.parentNode===P)break;if(q===4)for(q=b.return;q!==null;){var me=q.tag;if((me===3||me===4)&&(me=q.stateNode.containerInfo,me===P||me.nodeType===8&&me.parentNode===P))return;q=q.return}for(;de!==null;){if(q=ya(de),q===null)return;if(me=q.tag,me===5||me===6){b=D=q;continue e}de=de.parentNode}}b=b.return}dn(function(){var Ve=D,ot=Fe(g),ct=[];e:{var st=Ff.get(a);if(st!==void 0){var At=Pi,It=a;switch(a){case"keypress":if(wo(g)===0)break e;case"keydown":case"keyup":At=Yu;break;case"focusin":It="focus",At=Vu;break;case"focusout":It="blur",At=Vu;break;case"beforeblur":case"afterblur":At=Vu;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":At=Ef;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":At=fa;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":At=Ao;break;case Mc:case Ec:case Uf:At=jp;break;case kf:At=Na;break;case"scroll":At=bi;break;case"wheel":At=Rf;break;case"copy":case"cut":case"paste":At=Tf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":At=ms}var Dt=(c&4)!==0,Hi=!Dt&&a==="scroll",Pe=Dt?st!==null?st+"Capture":null:st;Dt=[];for(var _e=Ve,Ne;_e!==null;){Ne=_e;var ht=Ne.stateNode;if(Ne.tag===5&&ht!==null&&(Ne=ht,Pe!==null&&(ht=Sn(_e,Pe),ht!=null&&Dt.push(Ul(_e,ht,Ne)))),Hi)break;_e=_e.return}0<Dt.length&&(st=new At(st,It,null,g,ot),ct.push({event:st,listeners:Dt}))}}if((c&7)===0){e:{if(st=a==="mouseover"||a==="pointerover",At=a==="mouseout"||a==="pointerout",st&&g!==ce&&(It=g.relatedTarget||g.fromElement)&&(ya(It)||It[ys]))break e;if((At||st)&&(st=ot.window===ot?ot:(st=ot.ownerDocument)?st.defaultView||st.parentWindow:window,At?(It=g.relatedTarget||g.toElement,At=Ve,It=It?ya(It):null,It!==null&&(Hi=Vn(It),It!==Hi||It.tag!==5&&It.tag!==6)&&(It=null)):(At=null,It=Ve),At!==It)){if(Dt=Ef,ht="onMouseLeave",Pe="onMouseEnter",_e="mouse",(a==="pointerout"||a==="pointerover")&&(Dt=ms,ht="onPointerLeave",Pe="onPointerEnter",_e="pointer"),Hi=At==null?st:wi(At),Ne=It==null?st:wi(It),st=new Dt(ht,_e+"leave",At,g,ot),st.target=Hi,st.relatedTarget=Ne,ht=null,ya(ot)===Ve&&(Dt=new Dt(Pe,_e+"enter",It,g,ot),Dt.target=Ne,Dt.relatedTarget=Hi,ht=Dt),Hi=ht,At&&It)t:{for(Dt=At,Pe=It,_e=0,Ne=Dt;Ne;Ne=Va(Ne))_e++;for(Ne=0,ht=Pe;ht;ht=Va(ht))Ne++;for(;0<_e-Ne;)Dt=Va(Dt),_e--;for(;0<Ne-_e;)Pe=Va(Pe),Ne--;for(;_e--;){if(Dt===Pe||Pe!==null&&Dt===Pe.alternate)break t;Dt=Va(Dt),Pe=Va(Pe)}Dt=null}else Dt=null;At!==null&&em(ct,st,At,Dt,!1),It!==null&&Hi!==null&&em(ct,Hi,It,Dt,!0)}}e:{if(st=Ve?wi(Ve):window,At=st.nodeName&&st.nodeName.toLowerCase(),At==="select"||At==="input"&&st.type==="file")var Nt=Jp;else if(Ku(st))if(Rl)Nt=oi;else{Nt=Qp;var Vt=Pl}else(At=st.nodeName)&&At.toLowerCase()==="input"&&(st.type==="checkbox"||st.type==="radio")&&(Nt=Df);if(Nt&&(Nt=Nt(a,Ve))){Al(ct,Nt,g,ot);break e}Vt&&Vt(a,st,Ve),a==="focusout"&&(Vt=st._wrapperState)&&Vt.controlled&&st.type==="number"&&He(st,"number",st.value)}switch(Vt=Ve?wi(Ve):window,a){case"focusin":(Ku(Vt)||Vt.contentEditable==="true")&&(ao=Vt,Ga=Ve,wc=null);break;case"focusout":wc=Ga=ao=null;break;case"mousedown":Zi=!0;break;case"contextmenu":case"mouseup":case"dragend":Zi=!1,$u(ct,g,ot);break;case"selectionchange":if(Qu)break;case"keydown":case"keyup":$u(ct,g,ot)}var jt;if(Dr)e:{switch(a){case"compositionstart":var $t="onCompositionStart";break e;case"compositionend":$t="onCompositionEnd";break e;case"compositionupdate":$t="onCompositionUpdate";break e}$t=void 0}else pa?Lf(a,g)&&($t="onCompositionEnd"):a==="keydown"&&g.keyCode===229&&($t="onCompositionStart");$t&&(El&&g.locale!=="ko"&&(pa||$t!=="onCompositionStart"?$t==="onCompositionEnd"&&pa&&(jt=Oi()):(Zr=ot,bo="value"in Zr?Zr.value:Zr.textContent,pa=!0)),Vt=od(Ve,$t),0<Vt.length&&($t=new Af($t,a,null,g,ot),ct.push({event:$t,listeners:Vt}),jt?$t.data=jt:(jt=qu(g),jt!==null&&($t.data=jt)))),(jt=$n?Kp(a,g):Sc(a,g))&&(Ve=od(Ve,"onBeforeInput"),0<Ve.length&&(ot=new Af("onBeforeInput","beforeinput",null,g,ot),ct.push({event:ot,listeners:Ve}),ot.data=jt))}Ll(ct,c)})}function Ul(a,c,g){return{instance:a,listener:c,currentTarget:g}}function od(a,c){for(var g=c+"Capture",b=[];a!==null;){var P=a,D=P.stateNode;P.tag===5&&D!==null&&(P=D,D=Sn(a,g),D!=null&&b.unshift(Ul(a,D,P)),D=Sn(a,c),D!=null&&b.push(Ul(a,D,P))),a=a.return}return b}function Va(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function em(a,c,g,b,P){for(var D=c._reactName,q=[];g!==null&&g!==b;){var de=g,me=de.alternate,Ve=de.stateNode;if(me!==null&&me===b)break;de.tag===5&&Ve!==null&&(de=Ve,P?(me=Sn(g,D),me!=null&&q.unshift(Ul(g,me,de))):P||(me=Sn(g,D),me!=null&&q.push(Ul(g,me,de)))),g=g.return}q.length!==0&&a.push({event:c,listeners:q})}var vv=/\r\n?/g,tm=/\u0000|\uFFFD/g;function Of(a){return(typeof a=="string"?a:""+a).replace(vv,` 38`).replace(tm,"")}function Rc(a,c,g){if(c=Of(c),Of(a)!==c&&g)throw Error(t(425))}function Pc(){}var kl=null,Bf=null;function zf(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Hf=typeof setTimeout=="function"?setTimeout:void 0,Gf=typeof clearTimeout=="function"?clearTimeout:void 0,ad=typeof Promise=="function"?Promise:void 0,yv=typeof queueMicrotask=="function"?queueMicrotask:typeof ad<"u"?function(a){return ad.resolve(null).then(a).catch(nm)}:Hf;function nm(a){setTimeout(function(){throw a})}function ld(a,c){var g=c,b=0;do{var P=g.nextSibling;if(a.removeChild(g),P&&P.nodeType===8)if(g=P.data,g==="/$"){if(b===0){a.removeChild(P),ca(c);return}b--}else g!=="$"&&g!=="$?"&&g!=="$!"||b++;g=P}while(g);ca(c)}function Io(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function Vf(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var g=a.data;if(g==="$"||g==="$!"||g==="$?"){if(c===0)return a;c--}else g==="/$"&&c++}a=a.previousSibling}return null}var ja=Math.random().toString(36).slice(2),zi="__reactFiber$"+ja,Fl="__reactProps$"+ja,ys="__reactContainer$"+ja,Wa="__reactEvents$"+ja,cd="__reactListeners$"+ja,ud="__reactHandles$"+ja;function ya(a){var c=a[zi];if(c)return c;for(var g=a.parentNode;g;){if(c=g[ys]||g[zi]){if(g=c.alternate,c.child!==null||g!==null&&g.child!==null)for(a=Vf(a);a!==null;){if(g=a[zi])return g;a=Vf(a)}return c}a=g,g=a.parentNode}return null}function Lo(a){return a=a[zi]||a[ys],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function wi(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function dd(a){return a[Fl]||null}var jf=[],Ji=-1;function mi(a){return{current:a}}function Yn(a){0>Ji||(a.current=jf[Ji],jf[Ji]=null,Ji--)}function Gn(a,c){Ji++,jf[Ji]=a.current,a.current=c}var Do={},sr=mi(Do),Ur=mi(!1),Uo=Do;function Xa(a,c){var g=a.type.contextTypes;if(!g)return Do;var b=a.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===c)return b.__reactInternalMemoizedMaskedChildContext;var P={},D;for(D in g)P[D]=c[D];return b&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=P),P}function Sr(a){return a=a.childContextTypes,a!=null}function Ic(){Yn(Ur),Yn(sr)}function Wf(a,c,g){if(sr.current!==Do)throw Error(t(168));Gn(sr,c),Gn(Ur,g)}function Lc(a,c,g){var b=a.stateNode;if(c=c.childContextTypes,typeof b.getChildContext!="function")return g;b=b.getChildContext();for(var P in b)if(!(P in c))throw Error(t(108,le(a)||"Unknown",P));return Z({},g,b)}function Ya(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Do,Uo=sr.current,Gn(sr,a),Gn(Ur,Ur.current),!0}function Xf(a,c,g){var b=a.stateNode;if(!b)throw Error(t(169));g?(a=Lc(a,c,Uo),b.__reactInternalMemoizedMergedChildContext=a,Yn(Ur),Yn(sr),Gn(sr,a)):Yn(Ur),Gn(Ur,g)}var Xs=null,Dc=!1,fd=!1;function Uc(a){Xs===null?Xs=[a]:Xs.push(a)}function im(a){Dc=!0,Uc(a)}function co(){if(!fd&&Xs!==null){fd=!0;var a=0,c=Ze;try{var g=Xs;for(Ze=1;a<g.length;a++){var b=g[a];do b=b(!0);while(b!==null)}Xs=null,Dc=!1}catch(P){throw Xs!==null&&(Xs=Xs.slice(a+1)),Te(Ot,co),P}finally{Ze=c,fd=!1}}return null}var qa=[],$r=0,hd=null,pd=0,kr=[],Qi=0,Ka=null,gt=1,Ls="";function ko(a,c){qa[$r++]=pd,qa[$r++]=hd,hd=a,pd=c}function Yf(a,c,g){kr[Qi++]=gt,kr[Qi++]=Ls,kr[Qi++]=Ka,Ka=a;var b=gt;a=Ls;var P=32-Qt(b)-1;b&=~(1<<P),g+=1;var D=32-Qt(c)+P;if(30<D){var q=P-P%5;D=(b&(1<<q)-1).toString(32),b>>=q,P-=q,gt=1<<32-Qt(c)+P|g<<P|b,Ls=D+a}else gt=1<<D|g<<P|b,Ls=a}function qf(a){a.return!==null&&(ko(a,1),Yf(a,1,0))}function Fo(a){for(;a===hd;)hd=qa[--$r],qa[$r]=null,pd=qa[--$r],qa[$r]=null;for(;a===Ka;)Ka=kr[--Qi],kr[Qi]=null,Ls=kr[--Qi],kr[Qi]=null,gt=kr[--Qi],kr[Qi]=null}var or=null,Fr=null,Kn=!1,Ds=null;function Kf(a,c){var g=mo(5,null,null,0);g.elementType="DELETED",g.stateNode=c,g.return=a,c=a.deletions,c===null?(a.deleti
vendor: 15,699 bytes, line 38
38ons=[g],a.flags|=16):c.push(g)}function Zf(a,c){switch(a.tag){case 5:var g=a.type;return c=c.nodeType!==1||g.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,or=a,Fr=Io(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,or=a,Fr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(g=Ka!==null?{id:gt,overflow:Ls}:null,a.memoizedState={dehydrated:c,treeContext:g,retryLane:1073741824},g=mo(18,null,null,0),g.stateNode=c,g.return=a,a.child=g,or=a,Fr=null,!0):!1;default:return!1}}function md(a){return(a.mode&1)!==0&&(a.flags&128)===0}function gd(a){if(Kn){var c=Fr;if(c){var g=c;if(!Zf(a,c)){if(md(a))throw Error(t(418));c=Io(g.nextSibling);var b=or;c&&Zf(a,c)?Kf(b,g):(a.flags=a.flags&-4097|2,Kn=!1,or=a)}}else{if(md(a))throw Error(t(418));a.flags=a.flags&-4097|2,Kn=!1,or=a}}}function vd(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;or=a}function Nl(a){if(a!==or)return!1;if(!Kn)return vd(a),Kn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!zf(a.type,a.memoizedProps)),c&&(c=Fr)){if(md(a))throw Jf(),Error(t(418));for(;c;)Kf(a,c),c=Io(c.nextSibling)}if(vd(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var g=a.data;if(g==="/$"){if(c===0){Fr=Io(a.nextSibling);break e}c--}else g!=="$"&&g!=="$!"&&g!=="$?"||c++}a=a.nextSibling}Fr=null}}else Fr=or?Io(a.stateNode.nextSibling):null;return!0}function Jf(){for(var a=Fr;a;)a=Io(a.nextSibling)}function xa(){Fr=or=null,Kn=!1}function Ol(a){Ds===null?Ds=[a]:Ds.push(a)}var xv=R.ReactCurrentBatchConfig;function kc(a,c,g){if(a=g.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(t(309));var b=g.stateNode}if(!b)throw Error(t(147,a));var P=b,D=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===D?c.ref:(c=function(q){var de=P.refs;q===null?delete de[D]:de[D]=q},c._stringRef=D,c)}if(typeof a!="string")throw Error(t(284));if(!g._owner)throw Error(t(290,a))}return a}function Fc(a,c){throw a=Object.prototype.toString.call(c),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function Qf(a){var c=a._init;return c(a._payload)}function $f(a){function c(Pe,_e){if(a){var Ne=Pe.deletions;Ne===null?(Pe.deletions=[_e],Pe.flags|=16):Ne.push(_e)}}function g(Pe,_e){if(!a)return null;for(;_e!==null;)c(Pe,_e),_e=_e.sibling;return null}function b(Pe,_e){for(Pe=new Map;_e!==null;)_e.key!==null?Pe.set(_e.key,_e):Pe.set(_e.index,_e),_e=_e.sibling;return Pe}function P(Pe,_e){return Pe=Kl(Pe,_e),Pe.index=0,Pe.sibling=null,Pe}function D(Pe,_e,Ne){return Pe.index=Ne,a?(Ne=Pe.alternate,Ne!==null?(Ne=Ne.index,Ne<_e?(Pe.flags|=2,_e):Ne):(Pe.flags|=2,_e)):(Pe.flags|=1048576,_e)}function q(Pe){return a&&Pe.alternate===null&&(Pe.flags|=2),Pe}function de(Pe,_e,Ne,ht){return _e===null||_e.tag!==6?(_e=Ov(Ne,Pe.mode,ht),_e.return=Pe,_e):(_e=P(_e,Ne),_e.return=Pe,_e)}function me(Pe,_e,Ne,ht){var Nt=Ne.type;return Nt===N?ot(Pe,_e,Ne.props.children,ht,Ne.key):_e!==null&&(_e.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===se&&Qf(Nt)===_e.type)?(ht=P(_e,Ne.props),ht.ref=kc(Pe,_e,Ne),ht.return=Pe,ht):(ht=Tm(Ne.type,Ne.key,Ne.props,null,Pe.mode,ht),ht.ref=kc(Pe,_e,Ne),ht.return=Pe,ht)}function Ve(Pe,_e,Ne,ht){return _e===null||_e.tag!==4||_e.stateNode.containerInfo!==Ne.containerInfo||_e.stateNode.implementation!==Ne.implementation?(_e=Bv(Ne,Pe.mode,ht),_e.return=Pe,_e):(_e=P(_e,Ne.children||[]),_e.return=Pe,_e)}function ot(Pe,_e,Ne,ht,Nt){return _e===null||_e.tag!==7?(_e=$c(Ne,Pe.mode,ht,Nt),_e.return=Pe,_e):(_e=P(_e,Ne),_e.return=Pe,_e)}function ct(Pe,_e,Ne){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return _e=Ov(""+_e,Pe.mode,Ne),_e.return=Pe,_e;if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case U:return Ne=Tm(_e.type,_e.key,_e.props,null,Pe.mode,Ne),Ne.ref=kc(Pe,null,_e),Ne.return=Pe,Ne;case k:return _e=Bv(_e,Pe.mode,Ne),_e.return=Pe,_e;case se:var ht=_e._init;return ct(Pe,ht(_e._payload),Ne)}if(Q(_e)||$(_e))return _e=$c(_e,Pe.mode,Ne,null),_e.return=Pe,_e;Fc(Pe,_e)}return null}function st(Pe,_e,Ne,ht){var Nt=_e!==null?_e.key:null;if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number")return Nt!==null?null:de(Pe,_e,""+Ne,ht);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case U:return Ne.key===Nt?me(Pe,_e,Ne,ht):null;case k:return Ne.key===Nt?Ve(Pe,_e,Ne,ht):null;case se:return Nt=Ne._init,st(Pe,_e,Nt(Ne._payload),ht)}if(Q(Ne)||$(Ne))return Nt!==null?null:ot(Pe,_e,Ne,ht,null);Fc(Pe,Ne)}return null}function At(Pe,_e,Ne,ht,Nt){if(typeof ht=="string"&&ht!==""||typeof ht=="number")return Pe=Pe.get(Ne)||null,de(_e,Pe,""+ht,Nt);if(typeof ht=="object"&&ht!==null){switch(ht.$$typeof){case U:return Pe=Pe.get(ht.key===null?Ne:ht.key)||null,me(_e,Pe,ht,Nt);case k:return Pe=Pe.get(ht.key===null?Ne:ht.key)||null,Ve(_e,Pe,ht,Nt);case se:var Vt=ht._init;return At(Pe,_e,Ne,Vt(ht._payload),Nt)}if(Q(ht)||$(ht))return Pe=Pe.get(Ne)||null,ot(_e,Pe,ht,Nt,null);Fc(_e,ht)}return null}function It(Pe,_e,Ne,ht){for(var Nt=null,Vt=null,jt=_e,$t=_e=0,Er=null;jt!==null&&$t<Ne.length;$t++){jt.index>$t?(Er=jt,jt=null):Er=jt.sibling;var Dn=st(Pe,jt,Ne[$t],ht);if(Dn===null){jt===null&&(jt=Er);break}a&&jt&&Dn.alternate===null&&c(Pe,jt),_e=D(Dn,_e,$t),Vt===null?Nt=Dn:Vt.sibling=Dn,Vt=Dn,jt=Er}if($t===Ne.length)return g(Pe,jt),Kn&&ko(Pe,$t),Nt;if(jt===null){for(;$t<Ne.length;$t++)jt=ct(Pe,Ne[$t],ht),jt!==null&&(_e=D(jt,_e,$t),Vt===null?Nt=jt:Vt.sibling=jt,Vt=jt);return Kn&&ko(Pe,$t),Nt}for(jt=b(Pe,jt);$t<Ne.length;$t++)Er=At(jt,Pe,$t,Ne[$t],ht),Er!==null&&(a&&Er.alternate!==null&&jt.delete(Er.key===null?$t:Er.key),_e=D(Er,_e,$t),Vt===null?Nt=Er:Vt.sibling=Er,Vt=Er);return a&&jt.forEach(function(Zl){return c(Pe,Zl)}),Kn&&ko(Pe,$t),Nt}function Dt(Pe,_e,Ne,ht){var Nt=$(Ne);if(typeof Nt!="function")throw Error(t(150));if(Ne=Nt.call(Ne),Ne==null)throw Error(t(151));for(var Vt=Nt=null,jt=_e,$t=_e=0,Er=null,Dn=Ne.next();jt!==null&&!Dn.done;$t++,Dn=Ne.next()){jt.index>$t?(Er=jt,jt=null):Er=jt.sibling;var Zl=st(Pe,jt,Dn.value,ht);if(Zl===null){jt===null&&(jt=Er);break}a&&jt&&Zl.alternate===null&&c(Pe,jt),_e=D(Zl,_e,$t),Vt===null?Nt=Zl:Vt.sibling=Zl,Vt=Zl,jt=Er}if(Dn.done)return g(Pe,jt),Kn&&ko(Pe,$t),Nt;if(jt===null){for(;!Dn.done;$t++,Dn=Ne.next())Dn=ct(Pe,Dn.value,ht),Dn!==null&&(_e=D(Dn,_e,$t),Vt===null?Nt=Dn:Vt.sibling=Dn,Vt=Dn);return Kn&&ko(Pe,$t),Nt}for(jt=b(Pe,jt);!Dn.done;$t++,Dn=Ne.next())Dn=At(jt,Pe,$t,Dn.value,ht),Dn!==null&&(a&&Dn.alternate!==null&&jt.delete(Dn.key===null?$t:Dn.key),_e=D(Dn,_e,$t),Vt===null?Nt=Dn:Vt.sibling=Dn,Vt=Dn);return a&&jt.forEach(function(VE){return c(Pe,VE)}),Kn&&ko(Pe,$t),Nt}function Hi(Pe,_e,Ne,ht){if(typeof Ne=="object"&&Ne!==null&&Ne.type===N&&Ne.key===null&&(Ne=Ne.props.children),typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case U:e:{for(var Nt=Ne.key,Vt=_e;Vt!==null;){if(Vt.key===Nt){if(Nt=Ne.type,Nt===N){if(Vt.tag===7){g(Pe,Vt.sibling),_e=P(Vt,Ne.props.children),_e.return=Pe,Pe=_e;break e}}else if(Vt.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===se&&Qf(Nt)===Vt.type){g(Pe,Vt.sibling),_e=P(Vt,Ne.props),_e.ref=kc(Pe,Vt,Ne),_e.return=Pe,Pe=_e;break e}g(Pe,Vt);break}else c(Pe,Vt);Vt=Vt.sibling}Ne.type===N?(_e=$c(Ne.props.children,Pe.mode,ht,Ne.key),_e.return=Pe,Pe=_e):(ht=Tm(Ne.type,Ne.key,Ne.props,null,Pe.mode,ht),ht.ref=kc(Pe,_e,Ne),ht.return=Pe,Pe=ht)}return q(Pe);case k:e:{for(Vt=Ne.key;_e!==null;){if(_e.key===Vt)if(_e.tag===4&&_e.stateNode.containerInfo===Ne.containerInfo&&_e.stateNode.implementation===Ne.implementation){g(Pe,_e.sibling),_e=P(_e,Ne.children||[]),_e.return=Pe,Pe=_e;break e}else{g(Pe,_e);break}else c(Pe,_e);_e=_e.sibling}_e=Bv(Ne,Pe.mode,ht),_e.return=Pe,Pe=_e}return q(Pe);case se:return Vt=Ne._init,Hi(Pe,_e,Vt(Ne._payload),ht)}if(Q(Ne))return It(Pe,_e,Ne,ht);if($(Ne))return Dt(Pe,_e,Ne,ht);Fc(Pe,Ne)}return typeof Ne=="string"&&Ne!==""||typeof Ne=="number"?(Ne=""+Ne,_e!==null&&_e.tag===6?(g(Pe,_e.sibling),_e=P(_e,Ne),_e.return=Pe,Pe=_e):(g(Pe,_e),_e=Ov(Ne,Pe.mode,ht),_e.return=Pe,Pe=_e),q(Pe)):g(Pe,_e)}return Hi}var Za=$f(!0),Nc=$f(!1),Ja=mi(null),Qa=null,No=null,Bl=null;function $a(){Bl=No=Qa=null}function Oc(a){var c=Ja.current;Yn(Ja),a._currentValue=c}function Bc(a,c,g){for(;a!==null;){var b=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,b!==null&&(b.childLanes|=c)):b!==null&&(b.childLanes&c)!==c&&(b.childLanes|=c),a===g)break;a=a.return}}function _a(a,c){Qa=a,Bl=No=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(ln=!0),a.firstContext=null)}function xs(a){var c=a._currentValue;if(Bl!==a)if(a={context:a,memoizedValue:c,next:null},No===null){if(Qa===null)throw Error(t(308));No=a,Qa.dependencies={lanes:0,firstContext:a}}else No=No.next=a;return c}var Oo=null;function eh(a){Oo===null?Oo=[a]:Oo.push(a)}function zc(a,c,g,b){var P=c.interleaved;return P===null?(g.next=g,eh(c)):(g.next=P.next,P.next=g),c.interleaved=g,Ys(a,b)}function Ys(a,c){a.lanes|=c;var g=a.alternate;for(g!==null&&(g.lanes|=c),g=a,a=a.return;a!==null;)a.childLanes|=c,g=a.alternate,g!==null&&(g.childLanes|=c),g=a,a=a.return;return g.tag===3?g.stateNode:null}var Nn=!1;function sn(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mi(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function On(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function ei(a,c,g){var b=a.updateQueue;if(b===null)return null;if(b=b.shared,(Rn&2)!==0){var P=b.pending;return P===null?c.next=c:(c.next=P.next,P.next=c),b.pending=c,Ys(a,g)}return P=b.interleaved,P===null?(c.next=c,eh(b)):(c.next=P.next,P.next=c),b.interleaved=c,Ys(a,g)}function br(a,c,g){if(c=c.updateQueue,c!==null&&(c=c.shared,(g&4194240)!==0)){var b=c.lanes;b&=a.pendingLanes,g|=b,c.lanes=g,Ee(a,g)}}function el(a,c){var g=a.updateQueue,b=a.alternate;if(b!==null&&(b=b.updateQueue,g===b)){var P=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var q={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};D===null?P=D=q:D=D.next=q,g=g.next}while(g!==null);D===null?P=D=c:D=D.next=c}else P=D=c;g={baseState:b.baseState,firstBaseUpdate:P,lastBaseUpdate:D,shared:b.shared,effects:b.effects},a.updateQueue=g;return}a=g.lastBaseUpdate,a===null?g.firstBaseUpdate=c:a.next=c,g.lastBaseUpdate=c}function gi(a,c,g,b){var P=a.updateQueue;Nn=!1;var D=P.firstBaseUpdate,q=P.lastBaseUpdate,de=P.shared.pending;if(de!==null){P.shared.pending=null;var me=de,Ve=me.next;me.next=null,q===null?D=Ve:q.next=Ve,q=me;var ot=a.alternate;ot!==null&&(ot=ot.updateQueue,de=ot.lastBaseUpdate,de!==q&&(de===null?ot.firstBaseUpdate=Ve:de.next=Ve,ot.lastBaseUpdate=me))}if(D!==null){var ct=P.baseState;q=0,ot=Ve=me=null,de=D;do{var st=de.lane,At=de.eventTime;if((b&st)===st){ot!==null&&(ot=ot.next={eventTime:At,lane:0,tag:de.tag,payload:de.payload,callback:de.callback,next:null});e:{var It=a,Dt=de;switch(st=c,At=g,Dt.tag){case 1:if(It=Dt.payload,typeof It=="function"){ct=It.call(At,ct,st);break e}ct=It;break e;case 3:It.flags=It.flags&-65537|128;case 0:if(It=Dt.payload,st=typeof It=="function"?It.call(At,ct,st):It,st==null)break e;ct=Z({},ct,st);break e;case 2:Nn=!0}}de.callback!==null&&de.lane!==0&&(a.flags|=64,st=P.effects,st===null?P.effects=[de]:st.push(de))}else At={eventTime:At,lane:st,tag:de.tag,payload:de.payload,callback:de.callback,next:null},ot===null?(Ve=ot=At,me=ct):ot=ot.next=At,q|=st;if(de=de.next,de===null){if(de=P.shared.pending,de===null)break;st=de,de=st.next,st.next=null,P.lastBaseUpdate=st,P.shared.pending=null}}while(!0);if(ot===null&&(me=ct),P.baseState=me,P.firstBaseUpdate=Ve,P.lastBaseUpdate=ot,c=P.shared.interleaved,c!==null){P=c;do q|=P.lane,P=P.next;while(P!==c)}else D===null&&(P.shared.lanes=0);Kc|=q,a.lanes=q,a.memoizedState=ct}}function zl(a,c,g){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var b=a[c],P=b.callback;if(P!==null){if(b.callback=null,b=g,typeof P!="function")throw Error(t(191,P));P.call(b)}}}var uo={},_s=mi(uo),tl=mi(uo),Bo=mi(uo);function Ii(a){if(a===uo)throw Error(t(174));return a}function Hc(a,c){switch(Gn(Bo,c),Gn(tl,a),Gn(_s,uo),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Oe(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=Oe(c,a)}Yn(_s),Gn(_s,c)}function Sa(){Yn(_s),Yn(tl),Yn(Bo)}function nl(a){Ii(Bo.current);var c=Ii(_s.current),g=Oe(c,a.type);c!==g&&(Gn(tl,a),Gn(_s,g))}function Hl(a){tl.current===a&&(Yn(_s),Yn(tl))}var Zn=mi(0);function qs(a){for(var c=a;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||g.data==="$?"||g.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Gl=[];function fo(){for(var a=0;a<Gl.length;a++)Gl[a]._workInProgressVersionPrimary=null;Gl.length=0}var il=R.ReactCurrentDispatcher,rl=R.ReactCurrentBatchConfig,zo=0,qn=null,vi=null,Cn=null,Ks=!1,wr=!1,ba=0,es=0;function ar(){throw Error(t(321))}function Gc(a,c){if(c===null)return!1;for(var g=0;g<c.length&&g<a.length;g++)if(!gs(a[g],c[g]))return!1;return!0}function Vc(a,c,g,b,P,D){if(zo=D,qn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,il.current=a===null||a.memoizedState===null?um:dm,a=g(b,P),wr){D=0;do{if(wr=!1,ba=0,25<=D)throw Error(t(301));D+=1,Cn=vi=null,c.updateQueue=null,il.current=fm,a=g(b,P)}while(wr)}if(il.current=Md,c=vi!==null&&vi.next!==null,zo=0,Cn=vi=qn=null,Ks=!1,c)throw Error(t(300));return a}function th(){var a=ba!==0;return ba=0,a}function lr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?qn.memoizedState=Cn=a:Cn=Cn.next=a,Cn}function Ss(){if(vi===null){var a=qn.alternate;a=a!==null?a.memoizedState:null}else a=vi.next;var c=Cn===null?qn.memoizedState:Cn.next;if(c!==null)Cn=c,vi=a;else{if(a===null)throw Error(t(310));vi=a,a={memoizedState:vi.memoizedState,baseState:vi.baseState,baseQueue:vi.baseQueue,queue:vi.queue,next:null},Cn===null?qn.memoizedState=Cn=a:Cn=Cn.next=a}return Cn}function Vl(a,c){return typeof c=="function"?c(a):c}function jc(a){var c=Ss(),g=c.queue;if(g===null)throw Error(t(311));g.lastRenderedReducer=a;var b=vi,P=b.baseQueue,D=g.pending;if(D!==null){if(P!==null){var q=P.next;P.next=D.next,D.next=q}b.baseQueue=P=D,g.pending=null}if(P!==null){D=P.next,b=b.baseState;var de=q=null,me=null,Ve=D;do{var ot=Ve.lane;if((zo&ot)===ot)me!==null&&(me=me.next={lane:0,action:Ve.action,hasEagerState:Ve.hasEagerState,eagerState:Ve.eagerState,next:null}),b=Ve.hasEagerState?Ve.eagerState:a(b,Ve.action);else{var ct={lane:ot,action:Ve.action,hasEagerState:Ve.hasEagerState,eagerState:Ve.eagerState,next:null};me===null?(de=me=ct,q=b):me=me.next=ct,qn.lanes|=ot,Kc|=ot}Ve=Ve.next}while(Ve!==null&&Ve!==D);me===null?q=b:me.next=de,gs(b,c.memoizedState)||(ln=!0),c.memoizedState=b,c.baseState=q,c.baseQueue=me,g.lastRenderedState=b}if(a=g.interleaved,a!==null){P=a;do D=P.lane,qn.lanes|=D,Kc|=D,P=P.next;while(P!==a)}else P===null&&(g.lanes=0);return[c.memoizedState,g.dispatch]}function Ho(a){var c=Ss(),g=c.queue;if(g===null)throw Error(t(311));g.lastRenderedReducer=a;var b=g.dispatch,P=g.pending,D=c.memoizedState;if(P!==null){g.pending=null;
vendor: 4,722 bytes, line 38
38var q=P=P.next;do D=a(D,q.action),q=q.next;while(q!==P);gs(D,c.memoizedState)||(ln=!0),c.memoizedState=D,c.baseQueue===null&&(c.baseState=D),g.lastRenderedState=D}return[D,b]}function nh(){}function ih(a,c){var g=qn,b=Ss(),P=c(),D=!gs(b.memoizedState,P);if(D&&(b.memoizedState=P,ln=!0),b=b.queue,oh(rm.bind(null,g,b,a),[a]),b.getSnapshot!==c||D||Cn!==null&&Cn.memoizedState.tag&1){if(g.flags|=2048,Zs(9,Wc.bind(null,g,b,P,c),void 0,null),Mr===null)throw Error(t(349));(zo&30)!==0||yd(g,c,P)}return P}function yd(a,c,g){a.flags|=16384,a={getSnapshot:c,value:g},c=qn.updateQueue,c===null?(c={lastEffect:null,stores:null},qn.updateQueue=c,c.stores=[a]):(g=c.stores,g===null?c.stores=[a]:g.push(a))}function Wc(a,c,g,b){c.value=g,c.getSnapshot=b,sm(c)&&rh(a)}function rm(a,c,g){return g(function(){sm(c)&&rh(a)})}function sm(a){var c=a.getSnapshot;a=a.value;try{var g=c();return!gs(a,g)}catch{return!0}}function rh(a){var c=Ys(a,1);c!==null&&Xo(c,a,1,-1)}function sh(a){var c=lr();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vl,lastRenderedState:a},c.queue=a,a=a.dispatch=sl.bind(null,qn,a),[c.memoizedState,a]}function Zs(a,c,g,b){return a={tag:a,create:c,destroy:g,deps:b,next:null},c=qn.updateQueue,c===null?(c={lastEffect:null,stores:null},qn.updateQueue=c,c.lastEffect=a.next=a):(g=c.lastEffect,g===null?c.lastEffect=a.next=a:(b=g.next,g.next=a,a.next=b,c.lastEffect=a)),a}function om(){return Ss().memoizedState}function ho(a,c,g,b){var P=lr();qn.flags|=a,P.memoizedState=Zs(1|c,g,void 0,b===void 0?null:b)}function Xc(a,c,g,b){var P=Ss();b=b===void 0?null:b;var D=void 0;if(vi!==null){var q=vi.memoizedState;if(D=q.destroy,b!==null&&Gc(b,q.deps)){P.memoizedState=Zs(c,g,D,b);return}}qn.flags|=a,P.memoizedState=Zs(1|c,g,D,b)}function Nr(a,c){return ho(8390656,8,a,c)}function oh(a,c){return Xc(2048,8,a,c)}function ah(a,c){return Xc(4,2,a,c)}function am(a,c){return Xc(4,4,a,c)}function lm(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function lh(a,c,g){return g=g!=null?g.concat([a]):null,Xc(4,4,lm.bind(null,c,a),g)}function xd(){}function cm(a,c){var g=Ss();c=c===void 0?null:c;var b=g.memoizedState;return b!==null&&c!==null&&Gc(c,b[1])?b[0]:(g.memoizedState=[a,c],a)}function bs(a,c){var g=Ss();c=c===void 0?null:c;var b=g.memoizedState;return b!==null&&c!==null&&Gc(c,b[1])?b[0]:(a=a(),g.memoizedState=[a,c],a)}function _d(a,c,g){return(zo&21)===0?(a.baseState&&(a.baseState=!1,ln=!0),a.memoizedState=g):(gs(g,c)||(g=Ni(),qn.lanes|=g,Kc|=g,a.baseState=!0),c)}function _v(a,c){var g=Ze;Ze=g!==0&&4>g?g:4,a(!0);var b=rl.transition;rl.transition={};try{a(!1),c()}finally{Ze=g,rl.transition=b}}function Go(){return Ss().memoizedState}function Sd(a,c,g){var b=Yl(a);if(g={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null},Yc(a))bd(c,g);else if(g=zc(a,c,g,b),g!==null){var P=Ms();Xo(g,a,b,P),wd(g,c,b)}}function sl(a,c,g){var b=Yl(a),P={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null};if(Yc(a))bd(c,P);else{var D=a.alternate;if(a.lanes===0&&(D===null||D.lanes===0)&&(D=c.lastRenderedReducer,D!==null))try{var q=c.lastRenderedState,de=D(q,g);if(P.hasEagerState=!0,P.eagerState=de,gs(de,q)){var me=c.interleaved;me===null?(P.next=P,eh(c)):(P.next=me.next,me.next=P),c.interleaved=P;return}}catch{}finally{}g=zc(a,c,P,b),g!==null&&(P=Ms(),Xo(g,a,b,P),wd(g,c,b))}}function Yc(a){var c=a.alternate;return a===qn||c!==null&&c===qn}function bd(a,c){wr=Ks=!0;var g=a.pending;g===null?c.next=c:(c.next=g.next,g.next=c),a.pending=c}function wd(a,c,g){if((g&4194240)!==0){var b=c.lanes;b&=a.pendingLanes,g|=b,c.lanes=g,Ee(a,g)}}var Md={readContext:xs,useCallback:ar,useContext:ar,useEffect:ar,useImperativeHandle:ar,useInsertionEffect:ar,useLayoutEffect:ar,useMemo:ar,useReducer:ar,useRef:ar,useState:ar,useDebugValue:ar,useDeferredValue:ar,useTransition:ar,useMutableSource:ar,useSyncExternalStore:ar,useId:ar,unstable_isNewReconciler:!1},um={readContext:xs,useCallback:function(a,c){return lr().memoizedState=[a,c===void 0?null:c],a},useContext:xs,useEffect:Nr,useImperativeHandle:function(a,c,g){return g=g!=null?g.concat([a]):null,ho(4194308,4,lm.bind(null,c,a),g)},useLayoutEffect:function(a,c){return ho(4194308,4,a,c)},useInsertionEffect:function(a,c){return ho(4,2,a,c)},useMemo:function(a,c){var g=lr();return c=c===void 0?null:c,a=a(),g.memoizedState=[a,c],a},useReducer:function(a,c,g){var b=lr();return c=g!==void 0?g(c):c,b.memoizedState=b.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},b.queue=a,a=a.dispatch=Sd.bind(null,qn,a),[b.memoizedState,a]}
vendor: 4,763 bytes, lines 38-40
38,useRef:function(a){var c=lr();return a={current:a},c.memoizedState=a},useState:sh,useDebugValue:xd,useDeferredValue:function(a){return lr().memoizedState=a},useTransition:function(){var a=sh(!1),c=a[0];return a=_v.bind(null,a[1]),lr().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,g){var b=qn,P=lr();if(Kn){if(g===void 0)throw Error(t(407));g=g()}else{if(g=c(),Mr===null)throw Error(t(349));(zo&30)!==0||yd(b,c,g)}P.memoizedState=g;var D={value:g,getSnapshot:c};return P.queue=D,Nr(rm.bind(null,b,D,a),[a]),b.flags|=2048,Zs(9,Wc.bind(null,b,D,g,c),void 0,null),g},useId:function(){var a=lr(),c=Mr.identifierPrefix;if(Kn){var g=Ls,b=gt;g=(b&~(1<<32-Qt(b)-1)).toString(32)+g,c=":"+c+"R"+g,g=ba++,0<g&&(c+="H"+g.toString(32)),c+=":"}else g=es++,c=":"+c+"r"+g.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},dm={readContext:xs,useCallback:cm,useContext:xs,useEffect:oh,useImperativeHandle:lh,useInsertionEffect:ah,useLayoutEffect:am,useMemo:bs,useReducer:jc,useRef:om,useState:function(){return jc(Vl)},useDebugValue:xd,useDeferredValue:function(a){var c=Ss();return _d(c,vi.memoizedState,a)},useTransition:function(){var a=jc(Vl)[0],c=Ss().memoizedState;return[a,c]},useMutableSource:nh,useSyncExternalStore:ih,useId:Go,unstable_isNewReconciler:!1},fm={readContext:xs,useCallback:cm,useContext:xs,useEffect:oh,useImperativeHandle:lh,useInsertionEffect:ah,useLayoutEffect:am,useMemo:bs,useReducer:Ho,useRef:om,useState:function(){return Ho(Vl)},useDebugValue:xd,useDeferredValue:function(a){var c=Ss();return vi===null?c.memoizedState=a:_d(c,vi.memoizedState,a)},useTransition:function(){var a=Ho(Vl)[0],c=Ss().memoizedState;return[a,c]},useMutableSource:nh,useSyncExternalStore:ih,useId:Go,unstable_isNewReconciler:!1};function Us(a,c){if(a&&a.defaultProps){c=Z({},c),a=a.defaultProps;for(var g in a)c[g]===void 0&&(c[g]=a[g]);return c}return c}function qc(a,c,g,b){c=a.memoizedState,g=g(b,c),g=g==null?c:Z({},c,g),a.memoizedState=g,a.lanes===0&&(a.updateQueue.baseState=g)}var Ed={isMounted:function(a){return(a=a._reactInternals)?Vn(a)===a:!1},enqueueSetState:function(a,c,g){a=a._reactInternals;var b=Ms(),P=Yl(a),D=On(b,P);D.payload=c,g!=null&&(D.callback=g),c=ei(a,D,P),c!==null&&(Xo(c,a,P,b),br(c,a,P))},enqueueReplaceState:function(a,c,g){a=a._reactInternals;var b=Ms(),P=Yl(a),D=On(b,P);D.tag=1,D.payload=c,g!=null&&(D.callback=g),c=ei(a,D,P),c!==null&&(Xo(c,a,P,b),br(c,a,P))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var g=Ms(),b=Yl(a),P=On(g,b);P.tag=2,c!=null&&(P.callback=c),c=ei(a,P,b),c!==null&&(Xo(c,a,b,g),br(c,a,b))}};function hm(a,c,g,b,P,D,q){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(b,D,q):c.prototype&&c.prototype.isPureReactComponent?!za(g,b)||!za(P,D):!0}function f(a,c,g){var b=!1,P=Do,D=c.contextType;return typeof D=="object"&&D!==null?D=xs(D):(P=Sr(c)?Uo:sr.current,b=c.contextTypes,D=(b=b!=null)?Xa(a,P):Do),c=new c(g,D),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ed,a.stateNode=c,c._reactInternals=a,b&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=P,a.__reactInternalMemoizedMaskedChildContext=D),c}function h(a,c,g,b){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,b),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,b),c.state!==a&&Ed.enqueueReplaceState(c,c.state,null)}function _(a,c,g,b){var P=a.stateNode;P.props=g,P.state=a.memoizedState,P.refs={},sn(a);var D=c.contextType;typeof D=="object"&&D!==null?P.context=xs(D):(D=Sr(c)?Uo:sr.current,P.context=Xa(a,D)),P.state=a.memoizedState,D=c.getDerivedStateFromProps,typeof D=="function"&&(qc(a,c,D,g),P.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof P.getSnapshotBeforeUpdate=="function"||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(c=P.state,typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount(),c!==P.state&&Ed.enqueueReplaceState(P,P.state,null),gi(a,g,P,b),P.state=a.memoizedState),typeof P.componentDidMount=="function"&&(a.flags|=4194308)}function C(a,c){try{var g="",b=c;do g+=ie(b),b=b.return;while(b);var P=g}catch(D){P=` 39Error generating stack: `+D.message+` 40`+D.stack}return{value:a,source:c,stack:P,digest:null}}function L(a,c,g){return{value:a,source:null,stack:g??null,digest:c??null}}function z(a,c){try{console.error(c.value)}catch(g){setTimeout(function(){throw g})}}var ae=typeof WeakMap=="function"?WeakMap:Map;function be(a,c,g){g=On(-1,g),g.tag=3,g.payload={element:null};var b=c.value;return g.callback=function(){_m||(_m=!0,Pv=b),z(a,c)},g}
vendor: 39,940 bytes, line 40
40function Je(a,c,g){g=On(-1,g),g.tag=3;var b=a.type.getDerivedStateFromError;if(typeof b=="function"){var P=c.value;g.payload=function(){return b(P)},g.callback=function(){z(a,c)}}var D=a.stateNode;return D!==null&&typeof D.componentDidCatch=="function"&&(g.callback=function(){z(a,c),typeof b!="function"&&(Wl===null?Wl=new Set([this]):Wl.add(this));var q=c.stack;this.componentDidCatch(c.value,{componentStack:q!==null?q:""})}),g}function dt(a,c,g){var b=a.pingCache;if(b===null){b=a.pingCache=new ae;var P=new Set;b.set(c,P)}else P=b.get(c),P===void 0&&(P=new Set,b.set(c,P));P.has(g)||(P.add(g),a=LE.bind(null,a,c,g),c.then(a,a))}function Ct(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function en(a,c,g,b,P){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(c=On(-1,1),c.tag=2,ei(g,c,1))),g.lanes|=1),a):(a.flags|=65536,a.lanes=P,a)}var Gt=R.ReactCurrentOwner,ln=!1;function Et(a,c,g,b){c.child=a===null?Nc(c,null,g,b):Za(c,a.child,g,b)}function cr(a,c,g,b,P){g=g.render;var D=c.ref;return _a(c,P),b=Vc(a,c,g,b,D,P),g=th(),a!==null&&!ln?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~P,ol(a,c,P)):(Kn&&g&&qf(c),c.flags|=1,Et(a,c,b,P),c.child)}function ws(a,c,g,b,P){if(a===null){var D=g.type;return typeof D=="function"&&!Nv(D)&&D.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(c.tag=15,c.type=D,Be(a,c,D,b,P)):(a=Tm(g.type,null,b,c,c.mode,P),a.ref=c.ref,a.return=c,c.child=a)}if(D=a.child,(a.lanes&P)===0){var q=D.memoizedProps;if(g=g.compare,g=g!==null?g:za,g(q,b)&&a.ref===c.ref)return ol(a,c,P)}return c.flags|=1,a=Kl(D,b),a.ref=c.ref,a.return=c,c.child=a}function Be(a,c,g,b,P){if(a!==null){var D=a.memoizedProps;if(za(D,b)&&a.ref===c.ref)if(ln=!1,c.pendingProps=b=D,(a.lanes&P)!==0)(a.flags&131072)!==0&&(ln=!0);else return c.lanes=a.lanes,ol(a,c,P)}return bt(a,c,g,b,P)}function Me(a,c,g){var b=c.pendingProps,P=b.children,D=a!==null?a.memoizedState:null;if(b.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Gn(Ad,Js),Js|=g;else{if((g&1073741824)===0)return a=D!==null?D.baseLanes|g:g,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Gn(Ad,Js),Js|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=D!==null?D.baseLanes:g,Gn(Ad,Js),Js|=b}else D!==null?(b=D.baseLanes|g,c.memoizedState=null):b=g,Gn(Ad,Js),Js|=b;return Et(a,c,P,g),c.child}function Ye(a,c){var g=c.ref;(a===null&&g!==null||a!==null&&a.ref!==g)&&(c.flags|=512,c.flags|=2097152)}function bt(a,c,g,b,P){var D=Sr(g)?Uo:sr.current;return D=Xa(c,D),_a(c,P),g=Vc(a,c,g,b,D,P),b=th(),a!==null&&!ln?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~P,ol(a,c,P)):(Kn&&b&&qf(c),c.flags|=1,Et(a,c,g,P),c.child)}function Ut(a,c,g,b,P){if(Sr(g)){var D=!0;Ya(c)}else D=!1;if(_a(c,P),c.stateNode===null)mm(a,c),f(c,g,b),_(c,g,b,P),b=!0;else if(a===null){var q=c.stateNode,de=c.memoizedProps;q.props=de;var me=q.context,Ve=g.contextType;typeof Ve=="object"&&Ve!==null?Ve=xs(Ve):(Ve=Sr(g)?Uo:sr.current,Ve=Xa(c,Ve));var ot=g.getDerivedStateFromProps,ct=typeof ot=="function"||typeof q.getSnapshotBeforeUpdate=="function";ct||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(de!==b||me!==Ve)&&h(c,q,b,Ve),Nn=!1;var st=c.memoizedState;q.state=st,gi(c,b,q,P),me=c.memoizedState,de!==b||st!==me||Ur.current||Nn?(typeof ot=="function"&&(qc(c,g,ot,b),me=c.memoizedState),(de=Nn||hm(c,g,de,b,st,me,Ve))?(ct||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount()),typeof q.componentDidMount=="function"&&(c.flags|=4194308)):(typeof q.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=b,c.memoizedState=me),q.props=b,q.state=me,q.context=Ve,b=de):(typeof q.componentDidMount=="function"&&(c.flags|=4194308),b=!1)}else{q=c.stateNode,Mi(a,c),de=c.memoizedProps,Ve=c.type===c.elementType?de:Us(c.type,de),q.props=Ve,ct=c.pendingProps,st=q.context,me=g.contextType,typeof me=="object"&&me!==null?me=xs(me):(me=Sr(g)?Uo:sr.current,me=Xa(c,me));var At=g.getDerivedStateFromProps;(ot=typeof At=="function"||typeof q.getSnapshotBeforeUpdate=="function")||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(de!==ct||st!==me)&&h(c,q,b,me),Nn=!1,st=c.memoizedState,q.state=st,gi(c,b,q,P);var It=c.memoizedState;de!==ct||st!==It||Ur.current||Nn?(typeof At=="function"&&(qc(c,g,At,b),It=c.memoizedState),(Ve=Nn||hm(c,g,Ve,b,st,It,me)||!1)?(ot||typeof q.UNSAFE_componentWillUpdate!="function"&&typeof q.componentWillUpdate!="function"||(typeof q.componentWillUpdate=="function"&&q.componentWillUpdate(b,It,me),typeof q.UNSAFE_componentWillUpdate=="function"&&q.UNSAFE_componentWillUpdate(b,It,me)),typeof q.componentDidUpdate=="function"&&(c.flags|=4),typeof q.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof q.componentDidUpdate!="function"||de===a.memoizedProps&&st===a.memoizedState||(c.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||de===a.memoizedProps&&st===a.memoizedState||(c.flags|=1024),c.memoizedProps=b,c.memoizedState=It),q.props=b,q.state=It,q.context=me,b=Ve):(typeof q.componentDidUpdate!="function"||de===a.memoizedProps&&st===a.memoizedState||(c.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||de===a.memoizedProps&&st===a.memoizedState||(c.flags|=1024),b=!1)}return nn(a,c,g,b,D,P)}function nn(a,c,g,b,P,D){Ye(a,c);var q=(c.flags&128)!==0;if(!b&&!q)return P&&Xf(c,g,!1),ol(a,c,D);b=c.stateNode,Gt.current=c;var de=q&&typeof g.getDerivedStateFromError!="function"?null:b.render();return c.flags|=1,a!==null&&q?(c.child=Za(c,a.child,null,D),c.child=Za(c,null,de,D)):Et(a,c,de,D),c.memoizedState=b.state,P&&Xf(c,g,!0),c.child}function tn(a){var c=a.stateNode;c.pendingContext?Wf(a,c.pendingContext,c.pendingContext!==c.context):c.context&&Wf(a,c.context,!1),Hc(a,c.containerInfo)}function Mn(a,c,g,b,P){return xa(),Ol(P),c.flags|=256,Et(a,c,g,b),c.child}var Li={dehydrated:null,treeContext:null,retryLane:0};function _n(a){return{baseLanes:a,cachePool:null,transitions:null}}function Vo(a,c,g){var b=c.pendingProps,P=Zn.current,D=!1,q=(c.flags&128)!==0,de;if((de=q)||(de=a!==null&&a.memoizedState===null?!1:(P&2)!==0),de?(D=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(P|=1),Gn(Zn,P&1),a===null)return gd(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(q=b.children,a=b.fallback,D?(b=c.mode,D=c.child,q={mode:"hidden",children:q},(b&1)===0&&D!==null?(D.childLanes=0,D.pendingProps=q):D=Am(q,b,0,null),a=$c(a,b,g,null),D.return=c,a.return=c,D.sibling=a,c.child=D,c.child.memoizedState=_n(g),c.memoizedState=Li,a):ch(c,q));if(P=a.memoizedState,P!==null&&(de=P.dehydrated,de!==null))return _E(a,c,q,b,de,P,g);if(D){D=b.fallback,q=c.mode,P=a.child,de=P.sibling;var me={mode:"hidden",children:b.children};return(q&1)===0&&c.child!==P?(b=c.child,b.childLanes=0,b.pendingProps=me,c.deletions=null):(b=Kl(P,me),b.subtreeFlags=P.subtreeFlags&14680064),de!==null?D=Kl(de,D):(D=$c(D,q,g,null),D.flags|=2),D.return=c,b.return=c,b.sibling=D,c.child=b,b=D,D=c.child,q=a.child.memoizedState,q=q===null?_n(g):{baseLanes:q.baseLanes|g,cachePool:null,transitions:q.transitions},D.memoizedState=q,D.childLanes=a.childLanes&~g,c.memoizedState=Li,b}return D=a.child,a=D.sibling,b=Kl(D,{mode:"visible",children:b.children}),(c.mode&1)===0&&(b.lanes=g),b.return=c,b.sibling=null,a!==null&&(g=c.deletions,g===null?(c.deletions=[a],c.flags|=16):g.push(a)),c.child=b,c.memoizedState=null,b}function ch(a,c){return c=Am({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function pm(a,c,g,b){return b!==null&&Ol(b),Za(c,a.child,null,g),a=ch(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function _E(a,c,g,b,P,D,q){if(g)return c.flags&256?(c.flags&=-257,b=L(Error(t(422))),pm(a,c,q,b)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(D=b.fallback,P=c.mode,b=Am({mode:"visible",children:b.children},P,0,null),D=$c(D,P,q,null),D.flags|=2,b.return=c,D.return=c,b.sibling=D,c.child=b,(c.mode&1)!==0&&Za(c,a.child,null,q),c.child.memoizedState=_n(q),c.memoizedState=Li,D);if((c.mode&1)===0)return pm(a,c,q,null);if(P.data==="$!"){if(b=P.nextSibling&&P.nextSibling.dataset,b)var de=b.dgst;return b=de,D=Error(t(419)),b=L(D,b,void 0),pm(a,c,q,b)}if(de=(q&a.childLanes)!==0,ln||de){if(b=Mr,b!==null){switch(q&-q){case 4:P=2;break;case 16:P=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:P=32;break;case 536870912:P=268435456;break;default:P=0}P=(P&(b.suspendedLanes|q))!==0?0:P,P!==0&&P!==D.retryLane&&(D.retryLane=P,Ys(a,P),Xo(b,a,P,-1))}return Fv(),b=L(Error(t(421))),pm(a,c,q,b)}return P.data==="$?"?(c.flags|=128,c.child=a.child,c=DE.bind(null,a),P._reactRetry=c,null):(a=D.treeContext,Fr=Io(P.nextSibling),or=c,Kn=!0,Ds=null,a!==null&&(kr[Qi++]=gt,kr[Qi++]=Ls,kr[Qi++]=Ka,gt=a.id,Ls=a.overflow,Ka=c),c=ch(c,b.children),c.flags|=4096,c)}function $1(a,c,g){a.lanes|=c;var b=a.alternate;b!==null&&(b.lanes|=c),Bc(a.return,c,g)}function Sv(a,c,g,b,P){var D=a.memoizedState;D===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:b,tail:g,tailMode:P}:(D.isBackwards=c,D.rendering=null,D.renderingStartTime=0,D.last=b,D.tail=g,D.tailMode=P)}function e_(a,c,g){var b=c.pendingProps,P=b.revealOrder,D=b.tail;if(Et(a,c,b.children,g),b=Zn.current,(b&2)!==0)b=b&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&$1(a,g,c);else if(a.tag===19)$1(a,g,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}b&=1}if(Gn(Zn,b),(c.mode&1)===0)c.memoizedState=null;else switch(P){case"forwards":for(g=c.child,P=null;g!==null;)a=g.alternate,a!==null&&qs(a)===null&&(P=g),g=g.sibling;g=P,g===null?(P=c.child,c.child=null):(P=g.sibling,g.sibling=null),Sv(c,!1,P,g,D);break;case"backwards":for(g=null,P=c.child,c.child=null;P!==null;){if(a=P.alternate,a!==null&&qs(a)===null){c.child=P;break}a=P.sibling,P.sibling=g,g=P,P=a}Sv(c,!0,g,null,D);break;case"together":Sv(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function mm(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function ol(a,c,g){if(a!==null&&(c.dependencies=a.dependencies),Kc|=c.lanes,(g&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(t(153));if(c.child!==null){for(a=c.child,g=Kl(a,a.pendingProps),c.child=g,g.return=c;a.sibling!==null;)a=a.sibling,g=g.sibling=Kl(a,a.pendingProps),g.return=c;g.sibling=null}return c.child}function SE(a,c,g){switch(c.tag){case 3:tn(c),xa();break;case 5:nl(c);break;case 1:Sr(c.type)&&Ya(c);break;case 4:Hc(c,c.stateNode.containerInfo);break;case 10:var b=c.type._context,P=c.memoizedProps.value;Gn(Ja,b._currentValue),b._currentValue=P;break;case 13:if(b=c.memoizedState,b!==null)return b.dehydrated!==null?(Gn(Zn,Zn.current&1),c.flags|=128,null):(g&c.child.childLanes)!==0?Vo(a,c,g):(Gn(Zn,Zn.current&1),a=ol(a,c,g),a!==null?a.sibling:null);Gn(Zn,Zn.current&1);break;case 19:if(b=(g&c.childLanes)!==0,(a.flags&128)!==0){if(b)return e_(a,c,g);c.flags|=128}if(P=c.memoizedState,P!==null&&(P.rendering=null,P.tail=null,P.lastEffect=null),Gn(Zn,Zn.current),b)break;return null;case 22:case 23:return c.lanes=0,Me(a,c,g)}return ol(a,c,g)}var t_,bv,n_,i_;t_=function(a,c){for(var g=c.child;g!==null;){if(g.tag===5||g.tag===6)a.appendChild(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}},bv=function(){},n_=function(a,c,g,b){var P=a.memoizedProps;if(P!==b){a=c.stateNode,Ii(_s.current);var D=null;switch(g){case"input":P=Le(a,P),b=Le(a,b),D=[];break;case"select":P=Z({},P,{value:void 0}),b=Z({},b,{value:void 0}),D=[];break;case"textarea":P=pe(a,P),b=pe(a,b),D=[];break;default:typeof P.onClick!="function"&&typeof b.onClick=="function"&&(a.onclick=Pc)}ue(g,b);var q;g=null;for(Ve in P)if(!b.hasOwnProperty(Ve)&&P.hasOwnProperty(Ve)&&P[Ve]!=null)if(Ve==="style"){var de=P[Ve];for(q in de)de.hasOwnProperty(q)&&(g||(g={}),g[q]="")}else Ve!=="dangerouslySetInnerHTML"&&Ve!=="children"&&Ve!=="suppressContentEditableWarning"&&Ve!=="suppressHydrationWarning"&&Ve!=="autoFocus"&&(i.hasOwnProperty(Ve)?D||(D=[]):(D=D||[]).push(Ve,null));for(Ve in b){var me=b[Ve];if(de=P!=null?P[Ve]:void 0,b.hasOwnProperty(Ve)&&me!==de&&(me!=null||de!=null))if(Ve==="style")if(de){for(q in de)!de.hasOwnProperty(q)||me&&me.hasOwnProperty(q)||(g||(g={}),g[q]="");for(q in me)me.hasOwnProperty(q)&&de[q]!==me[q]&&(g||(g={}),g[q]=me[q])}else g||(D||(D=[]),D.push(Ve,g)),g=me;else Ve==="dangerouslySetInnerHTML"?(me=me?me.__html:void 0,de=de?de.__html:void 0,me!=null&&de!==me&&(D=D||[]).push(Ve,me)):Ve==="children"?typeof me!="string"&&typeof me!="number"||(D=D||[]).push(Ve,""+me):Ve!=="suppressContentEditableWarning"&&Ve!=="suppressHydrationWarning"&&(i.hasOwnProperty(Ve)?(me!=null&&Ve==="onScroll"&&Xn("scroll",a),D||de===me||(D=[])):(D=D||[]).push(Ve,me))}g&&(D=D||[]).push("style",g);var Ve=D;(c.updateQueue=Ve)&&(c.flags|=4)}},i_=function(a,c,g,b){g!==b&&(c.flags|=4)};function uh(a,c){if(!Kn)switch(a.tailMode){case"hidden":c=a.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?a.tail=null:g.sibling=null;break;case"collapsed":g=a.tail;for(var b=null;g!==null;)g.alternate!==null&&(b=g),g=g.sibling;b===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:b.sibling=null}}function ts(a){var c=a.alternate!==null&&a.alternate.child===a.child,g=0,b=0;if(c)for(var P=a.child;P!==null;)g|=P.lanes|P.childLanes,b|=P.subtreeFlags&14680064,b|=P.flags&14680064,P.return=a,P=P.sibling;else for(P=a.child;P!==null;)g|=P.lanes|P.childLanes,b|=P.subtreeFlags,b|=P.flags,P.return=a,P=P.sibling;return a.subtreeFlags|=b,a.childLanes=g,c}function bE(a,c,g){var b=c.pendingProps;switch(Fo(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ts(c),null;case 1:return Sr(c.type)&&Ic(),ts(c),null;case 3:return b=c.stateNode,Sa(),Yn(Ur),Yn(sr),fo(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(a===null||a.child===null)&&(Nl(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Ds!==null&&(Dv(Ds),Ds=null))),bv(a,c),ts(c),null;case 5:Hl(c);var P=Ii(Bo.current);if(g=c.type,a!==null&&c.stateNode!=null)n_(a,c,g,b,P),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!b){if(c.stateNode===null)throw Error(t(166));return ts(c),null}if(a=Ii(_s.current),Nl(c)){b=c.stateNode,g=c.type;var D=c.memoizedProps;switch(b[zi]=c,b[Fl]=D,a=(c.mode&1)!==0,g){case"dialog":Xn("cancel",b),Xn("close",b);break;case"iframe":case"object":case"embed":Xn("load",b);break;case"video":case"audio":for(P=0;P<va.length;P++)Xn(va[P],b);break;case"source":Xn("error",b);break;case"img":case"image":case"link":Xn("error",b),Xn("load",b);break;case"details":Xn("toggle",b);break;case"input":Ge(b,D),Xn("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!D.multiple},Xn("invalid",b);break;case"textarea":ge(b,D),Xn("invalid",b)}ue(g,D),P=null;for(var q in D)if(D.hasOwnProperty(q)){var de=D[q];q==="children"?typeof de=="string"?b.textContent!==de&&(D.suppressHydrationWarning!==!0&&Rc(b.textContent,de,a),P=["children",de]):typeof de=="number"&&b.textContent!==""+de&&(D.suppressHydrationWarning!==!0&&Rc(b.textContent,de,a),P=["children",""+de]):i.hasOwnProperty(q)&&de!=null&&q==="onScroll"&&Xn("scroll",b)}switch(g){case"input":Ie(b),Re(b,D,!0);break;case"textarea":Ie(b),we(b);break;case"select":case"option":break;default:typeof D.onClick=="function"&&(b.onclick=Pc)}b=P,c.updateQueue=b,b!==null&&(c.flags|=4)}else{q=P.nodeType===9?P:P.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ut(g)),a==="http://www.w3.org/1999/xhtml"?g==="script"?(a=q.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof b.is=="string"?a=q.createElement(g,{is:b.is}):(a=q.createElement(g),g==="select"&&(q=a,b.multiple?q.multiple=!0:b.size&&(q.size=b.size))):a=q.createElementNS(a,g),a[zi]=c,a[Fl]=b,t_(a,c,!1,!1),c.stateNode=a;e:{switch(q=qe(g,b),g){case"dialog":Xn("cancel",a),Xn("close",a),P=b;break;case"iframe":case"object":case"embed":Xn("load",a),P=b;break;case"video":case"audio":for(P=0;P<va.length;P++)Xn(va[P],a);P=b;break;case"source":Xn("error",a),P=b;break;case"img":case"image":case"link":Xn("error",a),Xn("load",a),P=b;break;case"details":Xn("toggle",a),P=b;break;case"input":Ge(a,b),P=Le(a,b),Xn("invalid",a);break;case"option":P=b;break;case"select":a._wrapperState={wasMultiple:!!b.multiple},P=Z({},b,{value:void 0}),Xn("invalid",a);break;case"textarea":ge(a,b),P=pe(a,b),Xn("invalid",a);break;default:P=b}ue(g,P),de=P;for(D in de)if(de.hasOwnProperty(D)){var me=de[D];D==="style"?et(a,me):D==="dangerouslySetInnerHTML"?(me=me?me.__html:void 0,me!=null&&at(a,me)):D==="children"?typeof me=="string"?(g!=="textarea"||me!=="")&&Ke(a,me):typeof me=="number"&&Ke(a,""+me):D!=="suppressContentEditableWarning"&&D!=="suppressHydrationWarning"&&D!=="autoFocus"&&(i.hasOwnProperty(D)?me!=null&&D==="onScroll"&&Xn("scroll",a):me!=null&&T(a,D,me,q))}switch(g){case"input":Ie(a),Re(a,b,!1);break;case"textarea":Ie(a),we(a);break;case"option":b.value!=null&&a.setAttribute("value",""+ye(b.value));break;case"select":a.multiple=!!b.multiple,D=b.value,D!=null?B(a,!!b.multiple,D,!1):b.defaultValue!=null&&B(a,!!b.multiple,b.defaultValue,!0);break;default:typeof P.onClick=="function"&&(a.onclick=Pc)}switch(g){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return ts(c),null;case 6:if(a&&c.stateNode!=null)i_(a,c,a.memoizedProps,b);else{if(typeof b!="string"&&c.stateNode===null)throw Error(t(166));if(g=Ii(Bo.current),Ii(_s.current),Nl(c)){if(b=c.stateNode,g=c.memoizedProps,b[zi]=c,(D=b.nodeValue!==g)&&(a=or,a!==null))switch(a.tag){case 3:Rc(b.nodeValue,g,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Rc(b.nodeValue,g,(a.mode&1)!==0)}D&&(c.flags|=4)}else b=(g.nodeType===9?g:g.ownerDocument).createTextNode(b),b[zi]=c,c.stateNode=b}return ts(c),null;case 13:if(Yn(Zn),b=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(Kn&&Fr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)Jf(),xa(),c.flags|=98560,D=!1;else if(D=Nl(c),b!==null&&b.dehydrated!==null){if(a===null){if(!D)throw Error(t(318));if(D=c.memoizedState,D=D!==null?D.dehydrated:null,!D)throw Error(t(317));D[zi]=c}else xa(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ts(c),D=!1}else Ds!==null&&(Dv(Ds),Ds=null),D=!0;if(!D)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=g,c):(b=b!==null,b!==(a!==null&&a.memoizedState!==null)&&b&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(Zn.current&1)!==0?ur===0&&(ur=3):Fv())),c.updateQueue!==null&&(c.flags|=4),ts(c),null);case 4:return Sa(),bv(a,c),a===null&&Dl(c.stateNode.containerInfo),ts(c),null;case 10:return Oc(c.type._context),ts(c),null;case 17:return Sr(c.type)&&Ic(),ts(c),null;case 19:if(Yn(Zn),D=c.memoizedState,D===null)return ts(c),null;if(b=(c.flags&128)!==0,q=D.rendering,q===null)if(b)uh(D,!1);else{if(ur!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(q=qs(a),q!==null){for(c.flags|=128,uh(D,!1),b=q.updateQueue,b!==null&&(c.updateQueue=b,c.flags|=4),c.subtreeFlags=0,b=g,g=c.child;g!==null;)D=g,a=b,D.flags&=14680066,q=D.alternate,q===null?(D.childLanes=0,D.lanes=a,D.child=null,D.subtreeFlags=0,D.memoizedProps=null,D.memoizedState=null,D.updateQueue=null,D.dependencies=null,D.stateNode=null):(D.childLanes=q.childLanes,D.lanes=q.lanes,D.child=q.child,D.subtreeFlags=0,D.deletions=null,D.memoizedProps=q.memoizedProps,D.memoizedState=q.memoizedState,D.updateQueue=q.updateQueue,D.type=q.type,a=q.dependencies,D.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),g=g.sibling;return Gn(Zn,Zn.current&1|2),c.child}a=a.sibling}D.tail!==null&&je()>Cd&&(c.flags|=128,b=!0,uh(D,!1),c.lanes=4194304)}else{if(!b)if(a=qs(q),a!==null){if(c.flags|=128,b=!0,g=a.updateQueue,g!==null&&(c.updateQueue=g,c.flags|=4),uh(D,!0),D.tail===null&&D.tailMode==="hidden"&&!q.alternate&&!Kn)return ts(c),null}else 2*je()-D.renderingStartTime>Cd&&g!==1073741824&&(c.flags|=128,b=!0,uh(D,!1),c.lanes=4194304);D.isBackwards?(q.sibling=c.child,c.child=q):(g=D.last,g!==null?g.sibling=q:c.child=q,D.last=q)}return D.tail!==null?(c=D.tail,D.rendering=c,D.tail=c.sibling,D.renderingStartTime=je(),c.sibling=null,g=Zn.current,Gn(Zn,b?g&1|2:g&1),c):(ts(c),null);case 22:case 23:return kv(),b=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==b&&(c.flags|=8192),b&&(c.mode&1)!==0?(Js&1073741824)!==0&&(ts(c),c.subtreeFlags&6&&(c.flags|=8192)):ts(c),null;case 24:return null;case 25:return null}throw Error(t(156,c.tag))}function wE(a,c){switch(Fo(c),c.tag){case 1:return Sr(c.type)&&Ic(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Sa(),Yn(Ur),Yn(sr),fo(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Hl(c),null;case 13:if(Yn(Zn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(t(340));xa()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Yn(Zn),null;case 4:return Sa(),null;case 10:return Oc(c.type._context),null;case 22:case 23:return kv(),null;case 24:return null;default:return null}}var gm=!1,ns=!1,ME=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function Td(a,c){var g=a.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(b){Di(a,c,b)}else g.current=null}function wv(a,c,g){try{g()}catch(b){Di(a,c,b)}}var r_=!1;function EE(a,c){if(kl=Wi,a=ai(),qi(a)){if("selectionStart"in a)var g={start:a.selectionStart,end:a.selectionEnd};else e:{g=(g=a.ownerDocument)&&g.defaultView||window;var b=g.getSelection&&g.getSelection();if(b&&b.rangeCount!==0){g=b.anchorNode;var P=b.anchorOffset,D=b.focusNode;b=b.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var q=0,de=-1,me=-1,Ve=0,ot=0,ct=a,st=null;t:for(;;){for(var At;ct!==g||P!==0&&ct.nodeType!==3||(de=q+P),ct!==D||b!==0&&ct.nodeType!==3||(me=q+b),ct.nodeType===3&&(q+=ct.nodeValue.length),(At=ct.firstChild)!==null;)st=ct,ct=At;for(;;){if(ct===a)break t;if(st===g&&++Ve===P&&(de=q),st===D&&++ot===b&&(me=q),(At=ct.nextSibling)!==null)break;ct=st,st=ct.parentNode}ct=At}g=de===-1||me===-1?null:{start:de,end:me}}else g=null}g=g||{start:0,end:0}}else g=null;for(Bf={focusedElem:a,selectionRange:g},Wi=!1,Rt=c;Rt!==null;)if(c=Rt,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Rt=a;else for(;Rt!==null;){c=Rt;try{var It=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(It!==null){var Dt=It.memoizedProps,Hi=It.memoizedState,Pe=c.stateNode,_e=Pe.getSnapshotBeforeUpdate(c.elementType===c.type?Dt:Us(c.type,Dt),Hi);Pe.__reactInternalSnapshotBeforeUpdate=_e}break;case 3:var Ne=c.stateNode.containerInfo;Ne.nodeType===1?Ne.textContent="":Ne.nodeType===9&&Ne.documentElement&&Ne.removeChild(Ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(ht){Di(c,c.return,ht)}if(a=c.sibling,a!==null){a.return=c.return,Rt=a;break}Rt=c.return}return It=r_,r_=!1,It}function dh(a,c,g){var b=c.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var P=b=b.next;do{if((P.tag&a)===a){var D=P.destroy;P.destroy=void 0,D!==void 0&&wv(c,g,D)}P=P.next}while(P!==b)}}function vm(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var g=c=c.next;do{if((g.tag&a)===a){var b=g.create;g.destroy=b()}g=g.next}while(g!==c)}}function Mv(a){var c=a.ref;if(c!==null){var g=a.stateNode;switch(a.tag){case 5:a=g;break;default:a=g}typeof c=="function"?c(a):c.current=a}}function s_(a){var c=a.alternate;c!==null&&(a.alternate=null,s_(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[zi],delete c[Fl],delete c[Wa],delete c[cd],delete c[ud])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function o_(a){return a.tag===5||a.tag===3||a.tag===4}function a_(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||o_(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Ev(a,c,g){var b=a.tag;if(b===5||b===6)a=a.stateNode,c?g.nodeType===8?g.parentNode.insertBefore(a,c):g.insertBefore(a,c):(g.nodeType===8?(c=g.parentNode,c.insertBefore(a,g)):(c=g,c.appendChild(a)),g=g._reactRootContainer,g!=null||c.onclick!==null||(c.onclick=Pc));else if(b!==4&&(a=a.child,a!==null))for(Ev(a,c,g),a=a.sibling;a!==null;)Ev(a,c,g),a=a.sibling}function Tv(a,c,g){var b=a.tag;if(b===5||b===6)a=a.stateNode,c?g.insertBefore(a,c):g.appendChild(a);else if(b!==4&&(a=a.child,a!==null))for(Tv(a,c,g),a=a.sibling;a!==null;)Tv(a,c,g),a=a.sibling}var Or=null,jo=!1;function jl(a,c,g){for(g=g.child;g!==null;)l_(a,c,g),g=g.sibling}function l_(a,c,g){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(En,g)}catch{}switch(g.tag){case 5:ns||Td(g,c);case 6:var b=Or,P=jo;Or=null,jl(a,c,g),Or=b,jo=P,Or!==null&&(jo?(a=Or,g=g.stateNode,a.nodeType===8?a.parentNode.removeChild(g):a.removeChild(g)):Or.removeChild(g.stateNode));break;case 18:Or!==null&&(jo?(a=Or,g=g.stateNode,a.nodeType===8?ld(a.parentNode,g):a.nodeType===1&&ld(a,g),ca(a)):ld(Or,g.stateNode));break;case 4:b=Or,P=jo,Or=g.stateNode.containerInfo,jo=!0,jl(a,c,g),Or=b,jo=P;break;case 0:case 11:case 14:case 15:if(!ns&&(b=g.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){P=b=b.next;do{var D=P,q=D.destroy;D=D.tag,q!==void 0&&((D&2)!==0||(D&4)!==0)&&wv(g,c,q),P=P.next}while(P!==b)}jl(a,c,g);break;case 1:if(!ns&&(Td(g,c),b=g.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=g.memoizedProps,b.state=g.memoizedState,b.componentWillUnmount()}catch(de){Di(g,c,de)}jl(a,c,g);break;case 21:jl(a,c,g);break;case 22:g.mode&1?(ns=(b=ns)||g.memoizedState!==null,jl(a,c,g),ns=b):jl(a,c,g);break;default:jl(a,c,g)}}function c_(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var g=a.stateNode;g===null&&(g=a.stateNode=new ME),c.forEach(function(b){var P=UE.bind(null,a,b);g.has(b)||(g.add(b),b.then(P,P))})}}function Wo(a,c){var g=c.deletions;if(g!==null)for(var b=0;b<g.length;b++){var P=g[b];try{var D=a,q=c,de=q;e:for(;de!==null;){switch(de.tag){case 5:Or=de.stateNode,jo=!1;break e;case 3:Or=de.stateNode.containerInfo,jo=!0;break e;case 4:Or=de.stateNode.containerInfo,jo=!0;break e}de=de.return}if(Or===null)throw Error(t(160));l_(D,q,P),Or=null,jo=!1;var me=P.alternate;me!==null&&(me.return=null),P.return=null}catch(Ve){Di(P,c,Ve)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)u_(c,a),c=c.sibling}function u_(a,c){var g=a.alternate,b=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Wo(c,a),wa(a),b&4){try{dh(3,a,a.return),vm(3,a)}catch(Dt){Di(a,a.return,Dt)}try{dh(5,a,a.return)}catch(Dt){Di(a,a.return,Dt)}}break;case 1:Wo(c,a),wa(a),b&512&&g!==null&&Td(g,g.return);break;case 5:if(Wo(c,a),wa(a),b&512&&g!==null&&Td(g,g.return),a.flags&32){var P=a.stateNode;try{Ke(P,"")}catch(Dt){Di(a,a.return,Dt)}}if(b&4&&(P=a.stateNode,P!=null)){var D=a.memoizedProps,q=g!==null?g.memoizedProps:D,de=a.type,me=a.updateQueue;if(a.updateQueue=null,me!==null)try{de==="input"&&D.type==="radio"&&D.name!=null&&Ae(P,D),qe(de,q);var Ve=qe(de,D);for(q=0;q<me.length;q+=2){var ot=me[q],ct=me[q+1];ot==="style"?et(P,ct):ot==="dangerouslySetInnerHTML"?at(P,ct):ot==="children"?Ke(P,ct):T(P,ot,ct,Ve)}switch(de){case"input":$e(P,D);break;case"textarea":ve(P,D);break;case"select":var st=P._wrapperState.wasMultiple;P._wrapperState.wasMultiple=!!D.multiple;var At=D.value;At!=null?B(P,!!D.multiple,At,!1):st!==!!D.multiple&&(D.defaultValue!=null?B(P,!!D.multiple,D.defaultValue,!0):B(P,!!D.multiple,D.multiple?[]:"",!1))}P[Fl]=D}catch(Dt){Di(a,a.return,Dt)}}break;case 6:if(Wo(c,a),wa(a),b&4){if(a.stateNode===null)throw Error(t(162));P=a.stateNode,D=a.memoizedProps;try{P.nodeValue=D}catch(Dt){Di(a,a.return,Dt)}}break;case 3:if(Wo(c,a),wa(a),b&4&&g!==null&&g.memoizedState.isDehydrated)try{ca(c.containerInfo)}catch(Dt){Di(a,a.return,Dt)}break;case 4:Wo(c,a),wa(a);break;case 13:Wo(c,a),wa(a),P=a.child,P.flags&8192&&(D=P.memoizedState!==null,P.stateNode.isHidden=D,!D||P.alternate!==null&&P.alternate.memoizedState!==null||(Rv=je())),b&4&&c_(a);break;case 22:if(ot=g!==null&&g.memoizedState!==null,a.mode&1?(ns=(Ve=ns)||ot,Wo(c,a),ns=Ve):Wo(c,a),wa(a),b&8192){if(Ve=a.memoizedState!==null,(a.stateNode.isHidden=Ve)&&!ot&&(a.mode&1)!==0)for(Rt=a,ot=a.child;ot!==null;){for(ct=Rt=ot;Rt!==null;){switch(st=Rt,At=st.child,st.tag){case 0:case 11:case 14:case 15:dh(4,st,st.return);break;case 1:Td(st,st.return);var It=st.stateNode;if(typeof It.componentWillUnmount=="function"){b=st,g=st.return;try{c=b,It.props=c.memoizedProps,It.state=c.memoizedState,It.componentWillUnmount()}catch(Dt){Di(b,g,Dt)}}break;case 5:Td(st,st.return);break;case 22:if(st.memoizedState!==null){h_(ct);continue}}At!==null?(At.return=st,Rt=At):h_(ct)}ot=ot.sibling}e:for(ot=null,ct=a;;){if(ct.tag===5){if(ot===null){ot=ct;try{P=ct.stateNode,Ve?(D=P.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none"):(de=ct.stateNode,me=ct.memoizedProps.style,q=me!=null&&me.hasOwnProperty("display")?me.display:null,de.style.display=nt("display",q))}catch(Dt){Di(a,a.return,Dt)}}}else if(ct.tag===6){if(ot===null)try{ct.stateNode.nodeValue=Ve?"":ct.memoizedProps}catch(Dt){Di(a,a.return,Dt)}}else if((ct.tag!==22&&ct.tag!==23||ct.memoizedState===null||ct===a)&&ct.child!==null){ct.child.return=ct,ct=ct.child;continue}if(ct===a)break e;for(;ct.sibling===null;){if(ct.return===null||ct.return===a)break e;ot===ct&&(ot=null),ct=ct.return}ot===ct&&(ot=null),ct.sibling.return=ct.return,ct=ct.sibling}}break;case 19:Wo(c,a),wa(a),b&4&&c_(a);break;case 21:break;default:Wo(c,a),wa(a)}}function wa(a){var c=a.flags;if(c&2){try{e:{for(var g=a.return;g!==null;){if(o_(g)){var b=g;break e}g=g.return}throw Error(t(160))}switch(b.tag){case 5:var P=b.stateNode;b.flags&32&&(Ke(P,""),b.flags&=-33);var D=a_(a);Tv(a,D,P);break;case 3:case 4:var q=b.stateNode.containerInfo,de=a_(a);Ev(a,de,q);break;default:throw Error(t(161))}}catch(me){Di(a,a.return,me)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function TE(a,c,g){Rt=a,d_(a)}function d_(a,c,g){for(var b=(a.mode&1)!==0;Rt!==null;){var P=Rt,D=P.child;if(P.tag===22&&b){var q=P.memoizedState!==null||gm;if(!q){var de=P.alternate,me=de!==null&&de.memoizedState!==null||ns;de=gm;var Ve=ns;if(gm=q,(ns=me)&&!Ve)for(Rt=P;Rt!==null;)q=Rt,me=q.child,q.tag===22&&q.memoizedState!==null?p_(P):me!==null?(me.return=q,Rt=me):p_(P);for(;D!==null;)Rt=D,d_(D),D=D.sibling;Rt=P,gm=de,ns=Ve}f_(a)}else(P.subtreeFlags&8772)!==0&&D!==null?(D.return=P,Rt=D):f_(a)}}function f_(a){for(;Rt!==null;){var c=Rt;if((c.flags&8772)!==0){var g=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:ns||vm(5,c);break;case 1:var b=c.stateNode;if(c.flags&4&&!ns)if(g===null)b.componentDidMount();else{var P=c.elementType===c.type?g.memoizedProps:Us(c.type,g.memoizedProps);b.componentDidUpdate(P,g.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var D=c.updateQueue;D!==null&&zl(c,D,b);break;case 3:var q=c.updateQueue;if(q!==null){if(g=null,c.child!==null)switch(c.child.tag){case 5:g=c.child.stateNode;break;case 1:g=c.child.stateNode}zl(c,q,g)}break;case 5:var de=c.stateNode;if(g===null&&c.flags&4){g=de;var me=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":me.autoFocus&&g.focus();break;case"img":me.src&&(g.src=me.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var Ve=c.alternate;if(Ve!==null){var ot=Ve.memoizedState;if(ot!==null){var ct=ot.dehydrated;ct!==null&&ca(ct)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}ns||c.flags&512&&Mv(c)}catch(st){Di(c,c.return,st)}}if(c===a){Rt=null;break}if(g=c.sibling,g!==null){g.return=c.return,Rt=g;break}Rt=c.return}}function h_(a){for(;Rt!==null;){var c=Rt;if(c===a){Rt=null;break}var g=c.sibling;if(g!==null){g.return=c.return,Rt=g;break}Rt=c.return}}function p_(a){for(;Rt!==null;){var c=Rt;try{switch(c.tag){case 0:case 11:case 15:var g=c.return;try{vm(4,c)}catch(me){Di(c,g,me)}break;case 1:var b=c.stateNode;if(typeof b.componentDidMount=="function"){var P=c.return;try{b.componentDidMount()}catch(me){Di(c,P,me)}}var D=c.return;try{Mv(c)}catch(me){Di(c,D,me)}break;case 5:var q=c.return;try{Mv(c)}catch(me){Di(c,q,me)}}}catch(me){Di(c,c.return,me)}if(c===a){Rt=null;break}var de=c.sibling;if(de!==null){de.return=c.return,Rt=de;break}Rt=c.return}}var AE=Math.ceil,ym=R.ReactCurrentDispatcher,Av=R.ReactCurrentOwner,po=R.ReactCurrentBatchConfig,Rn=0,Mr=null,$i=null,Br=0,Js=0,Ad=mi(0),ur=0,fh=null,Kc=0,xm=0,Cv=0,hh=null,ks=null,Rv=0,Cd=1/0,al=null,_m=!1,Pv=null,Wl=null,Sm=!1,Xl=null,bm=0,ph=0,Iv=null,wm=-1,Mm=0;function Ms(){return(Rn&6)!==0?je():wm!==-1?wm:wm=je()}function Yl(a){return(a.mode&1)===0?1:(Rn&2)!==0&&Br!==0?Br&-Br:xv.transition!==null?(Mm===0&&(Mm=Ni()),Mm):(a=Ze,a!==0||(a=window.event,a=a===void 0?16:da(a.type)),a)}function Xo(a,c,g,b){if(50<ph)throw ph=0,Iv=null,Error(t(185));qr(a,g,b),((Rn&2)===0||a!==Mr)&&(a===Mr&&((Rn&2)===0&&(xm|=g),ur===4&&ql(a,Br)),Fs(a,b),g===1&&Rn===0&&(c.mode&1)===0&&(Cd=je()+500,Dc&&co()))}function Fs(a,c){var g=a.callbackNode;Jn(a,c);var b=Ci(a,a===Mr?Br:0);if(b===0)g!==null&<(g),a.callbackNode=null,a.callbackPriority=0;else if(c=b&-b,a.callbackPriority!==c){if(g!=null&<(g),c===1)a.tag===0?im(g_.bind(null,a)):Uc(g_.bind(null,a)),yv(function(){(Rn&6)===0&&co()}),g=null;else{switch(Ht(b)){case 1:g=Ot;break;case 4:g=xt;break;case 16:g=Zt;break;case 536870912:g=pn;break;default:g=Zt}g=M_(g,m_.bind(null,a))}a.callbackPriority=c,a.callbackNode=g}}function m_(a,c){if(wm=-1,Mm=0,(Rn&6)!==0)throw Error(t(327));var g=a.callbackNode;if(Rd()&&a.callbackNode!==g)return null;var b=Ci(a,a===Mr?Br:0);if(b===0)return null;if((b&30)!==0||(b&a.expiredLanes)!==0||c)c=Em(a,b);else{c=b;var P=Rn;Rn|=2;var D=y_();(Mr!==a||Br!==c)&&(al=null,Cd=je()+500,Jc(a,c));do try{PE();break}catch(de){v_(a,de)}while(!0);$a(),ym.current=D,Rn=P,$i!==null?c=0:(Mr=null,Br=0,c=ur)}if(c!==0){if(c===2&&(P=pi(a),P!==0&&(b=P,c=Lv(a,P))),c===1)throw g=fh,Jc(a,0),ql(a,b),Fs(a,je()),g;if(c===6)ql(a,b);else{if(P=a.current.alternate,(b&30)===0&&!CE(P)&&(c=Em(a,b),c===2&&(D=pi(a),D!==0&&(b=D,c=Lv(a,D))),c===1))throw g=fh,Jc(a,0),ql(a,b),Fs(a,je()),g;switch(a.finishedWork=P,a.finishedLanes=b,c){case 0:case 1:throw Error(t(345));case 2:Qc(a,ks,al);break;case 3:if(ql(a,b),(b&130023424)===b&&(c=Rv+500-je(),10<c)){if(Ci(a,0)!==0)break;if(P=a.suspendedLanes,(P&b)!==b){Ms(),a.pingedLanes|=a.suspendedLanes&P;break}a.timeoutHandle=Hf(Qc.bind(null,a,ks,al),c);break}Qc(a,ks,al);break;case 4:if(ql(a,b),(b&4194240)===b)break;for(c=a.eventTimes,P=-1;0<b;){var q=31-Qt(b);D=1<<q,q=c[q],q>P&&(P=q),b&=~D}if(b=P,b=je()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*AE(b/1960))-b,10<b){a.timeoutHandle=Hf(Qc.bind(null,a,ks,al),b);break}Qc(a,ks,al);break;case 5:Qc(a,ks,al);break;default:throw Error(t(329))}}}return Fs(a,je()),a.callbackNode===g?m_.bind(null,a):null}function Lv(a,c){var g=hh;return a.current.memoizedState.isDehydrated&&(Jc(a,c).flags|=256),a=Em(a,c),a!==2&&(c=ks,ks=g,c!==null&&Dv(c)),a}function Dv(a){ks===null?ks=a:ks.push.apply(ks,a)}function CE(a){for(var c=a;;){if(c.flags&16384){var g=c.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var b=0;b<g.length;b++){var P=g[b],D=P.getSnapshot;P=P.value;try{if(!gs(D(),P))return!1}catch{return!1}}}if(g=c.child,c.subtreeFlags&16384&&g!==null)g.return=c,c=g;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ql(a,c){for(c&=~Cv,c&=~xm,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var g=31-Qt(c),b=1<<g;a[g]=-1,c&=~b}}function g_(a){if((Rn&6)!==0)throw Error(t(327));Rd();var c=Ci(a,0);if((c&1)===0)return Fs(a,je()),null;var g=Em(a,c);if(a.tag!==0&&g===2){var b=pi(a);b!==0&&(c=b,g=Lv(a,b))}if(g===1)throw g=fh,Jc(a,0),ql(a,c),Fs(a,je()),g;if(g===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Qc(a,ks,al),Fs(a,je()),null}function Uv(a,c){var g=Rn;Rn|=1;try{return a(c)}finally{Rn=g,Rn===0&&(Cd=je()+500,Dc&&co())}}function Zc(a){Xl!==null&&Xl.tag===0&&(Rn&6)===0&&Rd();var c=Rn;Rn|=1;var g=po.transition,b=Ze;try{if(po.transition=null,Ze=1,a)return a()}finally{Ze=b,po.transition=g,Rn=c,(Rn&6)===0&&co()}}function kv(){Js=Ad.current,Yn(Ad)}function Jc(a,c){a.finishedWork=null,a.finishedLanes=0;var g=a.timeoutHandle;if(g!==-1&&(a.timeoutHandle=-1,Gf(g)),$i!==null)for(g=$i.return;g!==null;){var b=g;switch(Fo(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&Ic();break;case 3:Sa(),Yn(Ur),Yn(sr),fo();break;case 5:Hl(b);break;case 4:Sa();break;case 13:Yn(Zn);break;case 19:Yn(Zn);break;case 10:Oc(b.type._context);break;case 22:case 23:kv()}g=g.return}if(Mr=a,$i=a=Kl(a.current,null),Br=Js=c,ur=0,fh=null,Cv=xm=Kc=0,ks=hh=null,Oo!==null){for(c=0;c<Oo.length;c++)if(g=Oo[c],b=g.interleaved,b!==null){g.interleaved=null;var P=b.next,D=g.pending;if(D!==null){var q=D.next;D.next=P,b.next=q}g.pending=b}Oo=null}return a}function v_(a,c){do{var g=$i;try{if($a(),il.current=Md,Ks){for(var b=qn.memoizedState;b!==null;){var P=b.queue;P!==null&&(P.pending=null),b=b.next}Ks=!1}if(zo=0,Cn=vi=qn=null,wr=!1,ba=0,Av.current=null,g===null||g.return===null){ur=1,fh=c,$i=null;break}e:{var D=a,q=g.return,de=g,me=c;if(c=Br,de.flags|=32768,me!==null&&typeof me=="object"&&typeof me.then=="function"){var Ve=me,ot=de,ct=ot.tag;if((ot.mode&1)===0&&(ct===0||ct===11||ct===15)){var st=ot.alternate;st?(ot.updateQueue=st.updateQueue,ot.memoizedState=st.memoizedState,ot.lanes=st.lanes):(ot.updateQueue=null,ot.memoizedState=null)}var At=Ct(q);if(At!==null){At.flags&=-257,en(At,q,de,D,c),At.mode&1&&dt(D,Ve,c),c=At,me=Ve;var It=c.updateQueue;if(It===null){var Dt=new Set;Dt.add(me),c.updateQueue=Dt}else It.add(me);break e}else{if((c&1)===0){dt(D,Ve,c),Fv();break e}me=Error(t(426))}}else if(Kn&&de.mode&1){var Hi=Ct(q);if(Hi!==null){(Hi.flags&65536)===0&&(Hi.flags|=256),en(Hi,q,de,D,c),Ol(C(me,de));break e}}D=me=C(me,de),ur!==4&&(ur=2),hh===null?hh=[D]:hh.push(D),D=q;do{switch(D.tag){case 3:D.flags|=65536,c&=-c,D.lanes|=c;var Pe=be(D,me,c);el(D,Pe);break e;case 1:de=me;var _e=D.type,Ne=D.stateNode;if((D.flags&128)===0&&(typeof _e.getDerivedStateFromError=="function"||Ne!==null&&typeof Ne.componentDidCatch=="function"&&(Wl===null||!Wl.has(Ne)))){D.flags|=65536,c&=-c,D.lanes|=c;var ht=Je(D,de,c);el(D,ht);break e}}D=D.return}while(D!==null)}__(g)}catch(Nt){c=Nt,$i===g&&g!==null&&($i=g=g.return);continue}break}while(!0)}function y_(){var a=ym.current;return ym.current=Md,a===null?Md:a}function Fv(){(ur===0||ur===3||ur===2)&&(ur=4),Mr===null||(Kc&268435455)===0&&(xm&268435455)===0||ql(Mr,Br)}function Em(a,c){var g=Rn;Rn|=2;var b=y_();(Mr!==a||Br!==c)&&(al=null,Jc(a,c));do try{RE();break}
vendor: 5,497 bytes, line 40
40catch(P){v_(a,P)}while(!0);if($a(),Rn=g,ym.current=b,$i!==null)throw Error(t(261));return Mr=null,Br=0,ur}function RE(){for(;$i!==null;)x_($i)}function PE(){for(;$i!==null&&!yt();)x_($i)}function x_(a){var c=w_(a.alternate,a,Js);a.memoizedProps=a.pendingProps,c===null?__(a):$i=c,Av.current=null}function __(a){var c=a;do{var g=c.alternate;if(a=c.return,(c.flags&32768)===0){if(g=bE(g,c,Js),g!==null){$i=g;return}}else{if(g=wE(g,c),g!==null){g.flags&=32767,$i=g;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{ur=6,$i=null;return}}if(c=c.sibling,c!==null){$i=c;return}$i=c=a}while(c!==null);ur===0&&(ur=5)}function Qc(a,c,g){var b=Ze,P=po.transition;try{po.transition=null,Ze=1,IE(a,c,g,b)}finally{po.transition=P,Ze=b}return null}function IE(a,c,g,b){do Rd();while(Xl!==null);if((Rn&6)!==0)throw Error(t(327));g=a.finishedWork;var P=a.finishedLanes;if(g===null)return null;if(a.finishedWork=null,a.finishedLanes=0,g===a.current)throw Error(t(177));a.callbackNode=null,a.callbackPriority=0;var D=g.lanes|g.childLanes;if(Ua(a,D),a===Mr&&($i=Mr=null,Br=0),(g.subtreeFlags&2064)===0&&(g.flags&2064)===0||Sm||(Sm=!0,M_(Zt,function(){return Rd(),null})),D=(g.flags&15990)!==0,(g.subtreeFlags&15990)!==0||D){D=po.transition,po.transition=null;var q=Ze;Ze=1;var de=Rn;Rn|=4,Av.current=null,EE(a,g),u_(g,a),Ki(Bf),Wi=!!kl,Bf=kl=null,a.current=g,TE(g),Tt(),Rn=de,Ze=q,po.transition=D}else a.current=g;if(Sm&&(Sm=!1,Xl=a,bm=P),D=a.pendingLanes,D===0&&(Wl=null),ft(g.stateNode),Fs(a,je()),c!==null)for(b=a.onRecoverableError,g=0;g<c.length;g++)P=c[g],b(P.value,{componentStack:P.stack,digest:P.digest});if(_m)throw _m=!1,a=Pv,Pv=null,a;return(bm&1)!==0&&a.tag!==0&&Rd(),D=a.pendingLanes,(D&1)!==0?a===Iv?ph++:(ph=0,Iv=a):ph=0,co(),null}function Rd(){if(Xl!==null){var a=Ht(bm),c=po.transition,g=Ze;try{if(po.transition=null,Ze=16>a?16:a,Xl===null)var b=!1;else{if(a=Xl,Xl=null,bm=0,(Rn&6)!==0)throw Error(t(331));var P=Rn;for(Rn|=4,Rt=a.current;Rt!==null;){var D=Rt,q=D.child;if((Rt.flags&16)!==0){var de=D.deletions;if(de!==null){for(var me=0;me<de.length;me++){var Ve=de[me];for(Rt=Ve;Rt!==null;){var ot=Rt;switch(ot.tag){case 0:case 11:case 15:dh(8,ot,D)}var ct=ot.child;if(ct!==null)ct.return=ot,Rt=ct;else for(;Rt!==null;){ot=Rt;var st=ot.sibling,At=ot.return;if(s_(ot),ot===Ve){Rt=null;break}if(st!==null){st.return=At,Rt=st;break}Rt=At}}}var It=D.alternate;if(It!==null){var Dt=It.child;if(Dt!==null){It.child=null;do{var Hi=Dt.sibling;Dt.sibling=null,Dt=Hi}while(Dt!==null)}}Rt=D}}if((D.subtreeFlags&2064)!==0&&q!==null)q.return=D,Rt=q;else e:for(;Rt!==null;){if(D=Rt,(D.flags&2048)!==0)switch(D.tag){case 0:case 11:case 15:dh(9,D,D.return)}var Pe=D.sibling;if(Pe!==null){Pe.return=D.return,Rt=Pe;break e}Rt=D.return}}var _e=a.current;for(Rt=_e;Rt!==null;){q=Rt;var Ne=q.child;if((q.subtreeFlags&2064)!==0&&Ne!==null)Ne.return=q,Rt=Ne;else e:for(q=_e;Rt!==null;){if(de=Rt,(de.flags&2048)!==0)try{switch(de.tag){case 0:case 11:case 15:vm(9,de)}}catch(Nt){Di(de,de.return,Nt)}if(de===q){Rt=null;break e}var ht=de.sibling;if(ht!==null){ht.return=de.return,Rt=ht;break e}Rt=de.return}}if(Rn=P,co(),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(En,a)}catch{}b=!0}return b}finally{Ze=g,po.transition=c}}return!1}function S_(a,c,g){c=C(g,c),c=be(a,c,1),a=ei(a,c,1),c=Ms(),a!==null&&(qr(a,1,c),Fs(a,c))}function Di(a,c,g){if(a.tag===3)S_(a,a,g);else for(;c!==null;){if(c.tag===3){S_(c,a,g);break}else if(c.tag===1){var b=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Wl===null||!Wl.has(b))){a=C(g,a),a=Je(c,a,1),c=ei(c,a,1),a=Ms(),c!==null&&(qr(c,1,a),Fs(c,a));break}}c=c.return}}function LE(a,c,g){var b=a.pingCache;b!==null&&b.delete(c),c=Ms(),a.pingedLanes|=a.suspendedLanes&g,Mr===a&&(Br&g)===g&&(ur===4||ur===3&&(Br&130023424)===Br&&500>je()-Rv?Jc(a,0):Cv|=g),Fs(a,c)}function b_(a,c){c===0&&((a.mode&1)===0?c=1:(c=Hn,Hn<<=1,(Hn&130023424)===0&&(Hn=4194304)));var g=Ms();a=Ys(a,c),a!==null&&(qr(a,c,g),Fs(a,g))}function DE(a){var c=a.memoizedState,g=0;c!==null&&(g=c.retryLane),b_(a,g)}function UE(a,c){var g=0;switch(a.tag){case 13:var b=a.stateNode,P=a.memoizedState;P!==null&&(g=P.retryLane);break;case 19:b=a.stateNode;break;default:throw Error(t(314))}b!==null&&b.delete(c),b_(a,g)}var w_;w_=function(a,c,g){if(a!==null)if(a.memoizedProps!==c.pendingProps||Ur.current)ln=!0;else{if((a.lanes&g)===0&&(c.flags&128)===0)return ln=!1,SE(a,c,g);ln=(a.flags&131072)!==0}else ln=!1,Kn&&(c.flags&1048576)!==0&&Yf(c,pd,c.index);switch(c.lanes=0,c.tag){case 2:var b=c.type;mm(a,c),a=c.pendingProps;var P=Xa(c,sr.current);_a(c,g),P=Vc(null,c,b,a,P,g);var D=th();return c.flags|=1,typeof P=="object"&&P!==null&&typeof P.render=="function"&&P.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Sr(b)?(D=!0,Ya(c)):D=!1,c.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,sn(c),P.updater=Ed,c.stateNode=P,P._reactInternals=c,_(c,b,a,g),c=nn(null,c,b,!0,D,g)):(c.tag=0,Kn&&D&&qf(c),Et(null,c,P,g),c=c.child),c;case 16:b=c.elementType;e:{switch(mm(a,c),a=c.pendingProps,P=b._init,b=P(b._payload),c.type=b,P=c.tag=FE(b),a=Us(b,a),P){case 0:c=bt(null,c,b,a,g);break e;case 1:c=Ut(null,c,b,a,g);break e;case 11:c=cr(null,c,b,a,g);break e;case 14:c=ws(null,c,b,Us(b.type,a),g);break e}throw Error(t(306,b,""))}return c;case 0:return b=c.type,P=c.pendingProps,P=c.elementType===b?P:Us(b,P),bt(a,c,b,P,g);case 1:return b=c.type,P=c.pendingProps,P=c.elementType===b?P:Us(b,P),Ut
vendor: 12,153 bytes, line 40
40(a,c,b,P,g);case 3:e:{if(tn(c),a===null)throw Error(t(387));b=c.pendingProps,D=c.memoizedState,P=D.element,Mi(a,c),gi(c,b,null,g);var q=c.memoizedState;if(b=q.element,D.isDehydrated)if(D={element:b,isDehydrated:!1,cache:q.cache,pendingSuspenseBoundaries:q.pendingSuspenseBoundaries,transitions:q.transitions},c.updateQueue.baseState=D,c.memoizedState=D,c.flags&256){P=C(Error(t(423)),c),c=Mn(a,c,b,g,P);break e}else if(b!==P){P=C(Error(t(424)),c),c=Mn(a,c,b,g,P);break e}else for(Fr=Io(c.stateNode.containerInfo.firstChild),or=c,Kn=!0,Ds=null,g=Nc(c,null,b,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(xa(),b===P){c=ol(a,c,g);break e}Et(a,c,b,g)}c=c.child}return c;case 5:return nl(c),a===null&&gd(c),b=c.type,P=c.pendingProps,D=a!==null?a.memoizedProps:null,q=P.children,zf(b,P)?q=null:D!==null&&zf(b,D)&&(c.flags|=32),Ye(a,c),Et(a,c,q,g),c.child;case 6:return a===null&&gd(c),null;case 13:return Vo(a,c,g);case 4:return Hc(c,c.stateNode.containerInfo),b=c.pendingProps,a===null?c.child=Za(c,null,b,g):Et(a,c,b,g),c.child;case 11:return b=c.type,P=c.pendingProps,P=c.elementType===b?P:Us(b,P),cr(a,c,b,P,g);case 7:return Et(a,c,c.pendingProps,g),c.child;case 8:return Et(a,c,c.pendingProps.children,g),c.child;case 12:return Et(a,c,c.pendingProps.children,g),c.child;case 10:e:{if(b=c.type._context,P=c.pendingProps,D=c.memoizedProps,q=P.value,Gn(Ja,b._currentValue),b._currentValue=q,D!==null)if(gs(D.value,q)){if(D.children===P.children&&!Ur.current){c=ol(a,c,g);break e}}else for(D=c.child,D!==null&&(D.return=c);D!==null;){var de=D.dependencies;if(de!==null){q=D.child;for(var me=de.firstContext;me!==null;){if(me.context===b){if(D.tag===1){me=On(-1,g&-g),me.tag=2;var Ve=D.updateQueue;if(Ve!==null){Ve=Ve.shared;var ot=Ve.pending;ot===null?me.next=me:(me.next=ot.next,ot.next=me),Ve.pending=me}}D.lanes|=g,me=D.alternate,me!==null&&(me.lanes|=g),Bc(D.return,g,c),de.lanes|=g;break}me=me.next}}else if(D.tag===10)q=D.type===c.type?null:D.child;else if(D.tag===18){if(q=D.return,q===null)throw Error(t(341));q.lanes|=g,de=q.alternate,de!==null&&(de.lanes|=g),Bc(q,g,c),q=D.sibling}else q=D.child;if(q!==null)q.return=D;else for(q=D;q!==null;){if(q===c){q=null;break}if(D=q.sibling,D!==null){D.return=q.return,q=D;break}q=q.return}D=q}Et(a,c,P.children,g),c=c.child}return c;case 9:return P=c.type,b=c.pendingProps.children,_a(c,g),P=xs(P),b=b(P),c.flags|=1,Et(a,c,b,g),c.child;case 14:return b=c.type,P=Us(b,c.pendingProps),P=Us(b.type,P),ws(a,c,b,P,g);case 15:return Be(a,c,c.type,c.pendingProps,g);case 17:return b=c.type,P=c.pendingProps,P=c.elementType===b?P:Us(b,P),mm(a,c),c.tag=1,Sr(b)?(a=!0,Ya(c)):a=!1,_a(c,g),f(c,b,P),_(c,b,P,g),nn(null,c,b,!0,a,g);case 19:return e_(a,c,g);case 22:return Me(a,c,g)}throw Error(t(156,c.tag))};function M_(a,c){return Te(a,c)}function kE(a,c,g,b){this.tag=a,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=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mo(a,c,g,b){return new kE(a,c,g,b)}function Nv(a){return a=a.prototype,!(!a||!a.isReactComponent)}function FE(a){if(typeof a=="function")return Nv(a)?1:0;if(a!=null){if(a=a.$$typeof,a===W)return 11;if(a===oe)return 14}return 2}function Kl(a,c){var g=a.alternate;return g===null?(g=mo(a.tag,c,a.key,a.mode),g.elementType=a.elementType,g.type=a.type,g.stateNode=a.stateNode,g.alternate=a,a.alternate=g):(g.pendingProps=c,g.type=a.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=a.flags&14680064,g.childLanes=a.childLanes,g.lanes=a.lanes,g.child=a.child,g.memoizedProps=a.memoizedProps,g.memoizedState=a.memoizedState,g.updateQueue=a.updateQueue,c=a.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=a.sibling,g.index=a.index,g.ref=a.ref,g}function Tm(a,c,g,b,P,D){var q=2;if(b=a,typeof a=="function")Nv(a)&&(q=1);else if(typeof a=="string")q=5;else e:switch(a){case N:return $c(g.children,P,D,c);case H:q=8,P|=8;break;case F:return a=mo(12,g,c,P|2),a.elementType=F,a.lanes=D,a;case X:return a=mo(13,g,c,P),a.elementType=X,a.lanes=D,a;case J:return a=mo(19,g,c,P),a.elementType=J,a.lanes=D,a;case fe:return Am(g,P,D,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case I:q=10;break e;case G:q=9;break e;case W:q=11;break e;case oe:q=14;break e;case se:q=16,b=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return c=mo(q,g,c,P),c.elementType=a,c.type=b,c.lanes=D,c}function $c(a,c,g,b){return a=mo(7,a,b,c),a.lanes=g,a}function Am(a,c,g,b){return a=mo(22,a,b,c),a.elementType=fe,a.lanes=g,a.stateNode={isHidden:!1},a}function Ov(a,c,g){return a=mo(6,a,null,c),a.lanes=g,a}function Bv(a,c,g){return c=mo(4,a.children!==null?a.children:[],a.key,c),c.lanes=g,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function NE(a,c,g,b,P){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yr(0),this.expirationTimes=Yr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yr(0),this.identifierPrefix=b,this.onRecoverableError=P,this.mutableSourceEagerHydrationData=null}function zv(a,c,g,b,P,D,q,de,me){return a=new NE(a,c,g,de,me),c===1?(c=1,D===!0&&(c|=8)):c=0,D=mo(3,null,null,c),a.current=D,D.stateNode=a,D.memoizedState={element:b,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},sn(D),a}function OE(a,c,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:b==null?null:""+b,children:a,containerInfo:c,implementation:g}}function E_(a){if(!a)return Do;a=a._reactInternals;e:{if(Vn(a)!==a||a.tag!==1)throw Error(t(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Sr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(t(171))}if(a.tag===1){var g=a.type;if(Sr(g))return Lc(a,g,c)}return c}function T_(a,c,g,b,P,D,q,de,me){return a=zv(g,b,!0,a,P,D,q,de,me),a.context=E_(null),g=a.current,b=Ms(),P=Yl(g),D=On(b,P),D.callback=c??null,ei(g,D,P),a.current.lanes=P,qr(a,P,b),Fs(a,b),a}function Cm(a,c,g,b){var P=c.current,D=Ms(),q=Yl(P);return g=E_(g),c.context===null?c.context=g:c.pendingContext=g,c=On(D,q),c.payload={element:a},b=b===void 0?null:b,b!==null&&(c.callback=b),a=ei(P,c,q),a!==null&&(Xo(a,P,q,D),br(a,P,q)),q}function Rm(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function A_(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var g=a.retryLane;a.retryLane=g!==0&&g<c?g:c}}function Hv(a,c){A_(a,c),(a=a.alternate)&&A_(a,c)}function BE(){return null}var C_=typeof reportError=="function"?reportError:function(a){console.error(a)};function Gv(a){this._internalRoot=a}Pm.prototype.render=Gv.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(t(409));Cm(a,c,null,null)},Pm.prototype.unmount=Gv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Zc(function(){Cm(null,a,null,null)}),c[ys]=null}};function Pm(a){this._internalRoot=a}Pm.prototype.unstable_scheduleHydration=function(a){if(a){var c=hs();a={blockedOn:null,target:a,priority:c};for(var g=0;g<jn.length&&c!==0&&c<jn[g].priority;g++);jn.splice(g,0,a),g===0&&xr(a)}};function Vv(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Im(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function R_(){}function zE(a,c,g,b,P){if(P){if(typeof b=="function"){var D=b;b=function(){var Ve=Rm(q);D.call(Ve)}}var q=T_(c,b,a,0,null,!1,!1,"",R_);return a._reactRootContainer=q,a[ys]=q.current,Dl(a.nodeType===8?a.parentNode:a),Zc(),q}for(;P=a.lastChild;)a.removeChild(P);if(typeof b=="function"){var de=b;b=function(){var Ve=Rm(me);de.call(Ve)}}var me=zv(a,0,!1,null,null,!1,!1,"",R_);return a._reactRootContainer=me,a[ys]=me.current,Dl(a.nodeType===8?a.parentNode:a),Zc(function(){Cm(c,me,g,b)}),me}function Lm(a,c,g,b,P){var D=g._reactRootContainer;if(D){var q=D;if(typeof P=="function"){var de=P;P=function(){var me=Rm(q);de.call(me)}}Cm(c,q,a,P)}else q=zE(g,c,a,P,b);return Rm(q)}Jt=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var g=an(c.pendingLanes);g!==0&&(Ee(c,g|1),Fs(c,je()),(Rn&6)===0&&(Cd=je()+500,co()))}break;case 13:Zc(function(){var b=Ys(a,1);if(b!==null){var P=Ms();Xo(b,a,1,P)}}),Hv(a,1)}},yr=function(a){if(a.tag===13){var c=Ys(a,134217728);if(c!==null){var g=Ms();Xo(c,a,134217728,g)}Hv(a,134217728)}},Qn=function(a){if(a.tag===13){var c=Yl(a),g=Ys(a,c);if(g!==null){var b=Ms();Xo(g,a,c,b)}Hv(a,c)}},hs=function(){return Ze},so=function(a,c){var g=Ze;try{return Ze=a,c()}finally{Ze=g}},xe=function(a,c,g){switch(c){case"input":if($e(a,g),c=g.name,g.type==="radio"&&c!=null){for(g=a;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<g.length;c++){var b=g[c];if(b!==a&&b.form===a.form){var P=dd(b);if(!P)throw Error(t(90));Y(b),$e(b,P)}}}break;case"textarea":ve(a,g);break;case"select":c=g.value,c!=null&&B(a,!!g.multiple,c,!1)}},Ft=Uv,pt=Zc;var HE={usingClientEntryPoint:!1,Events:[Lo,wi,dd,vt,kt,Uv]},mh={findFiberByHostInstance:ya,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},GE={bundleType:mh.bundleType,version:mh.version,rendererPackageName:mh.rendererPackageName,rendererConfig:mh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Ue(a),a===null?null:a.stateNode},findFiberByHostInstance:mh.findFiberByHostInstance||BE,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 Dm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dm.isDisabled&&Dm.supportsFiber)try{En=Dm.inject(GE),Mt=Dm}catch{}}return Ns.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HE,Ns.createPortal=function(a,c){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vv(c))throw Error(t(200));return OE(a,c,null,g)},Ns.createRoot=function(a,c){if(!Vv(a))throw Error(t(299));var g=!1,b="",P=C_;return c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onRecoverableError!==void 0&&(P=c.onRecoverableError)),c=zv(a,1,!1,null,null,g,!1,b,P),a[ys]=c.current,Dl(a.nodeType===8?a.parentNode:a),new Gv(c)},Ns.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=Ue(c),a=a===null?null:a.stateNode,a},Ns.flushSync=function(a){return Zc(a)},Ns.hydrate=function(a,c,g){if(!Im(c))throw Error(t(200));return Lm(null,a,c,!0,g)},Ns.hydrateRoot=function(a,c,g){if(!Vv(a))throw Error(t(405));var b=g!=null&&g.hydratedSources||null,P=!1,D="",q=C_;if(g!=null&&(g.unstable_strictMode===!0&&(P=!0),g.identifierPrefix!==void 0&&(D=g.identifierPrefix),g.onRecoverableError!==void 0&&(q=g.onRecoverableError)),c=T_(c,null,a,1,g??null,P,!1,D,q),a[ys]=c.current,Dl(a),b)for(a=0;a<b.length;a++)g=b[a],P=g._getVersion,P=P(g._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[g,P]:c.mutableSourceEagerHydrationData.push(g,P);return new Pm(c)},Ns.render=function(a,c,g){if(!Im(c))throw Error(t(200));return Lm(null,a,c,!1,g)}
40,Ns.unmountComponentAtNode=function(a){if(!Im(a))throw Error(t(40));return a._reactRootContainer?(Zc(function(){Lm(null,null,a,!1,function(){a._reactRootContainer=null,a[ys]=null})}),!0):!1},Ns.unstable_batchedUpdates=Uv,Ns.unstable_renderSubtreeIntoContainer=function(a,c,g,b){if(!Im(g))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return Lm(a,c,g,!1,b)},Ns.version="18.3.1-next-f1338f8080-20240426",Ns}var N_;function Cw(){if(N_)return Xv.exports;N_=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),Xv.exports=ZE(),Xv.exports}var O_;function JE(){if(O_)return Um;O_=1;var r=Cw();return Um.createRoot=r.createRoot,Um.hydrateRoot=r.hydrateRoot,Um}var Rw=JE();const QE=["400 16px Inter","500 16px Inter","600 16px Inter","700 16px Inter","700 28px Inter","700 36px Inter","700 80px Inter",'400 12px "Roboto Condensed"','400 24px "Roboto Condensed"','400 52px "Roboto Condensed"','400 80px "Roboto Condensed"','400 24px "Roboto Mono"','400 28px "Roboto Mono"','400 52px "Roboto Mono"','400 80px "Roboto Mono"'];let B_=!1,Kv=null;async function $E(){B_||(Kv||(Kv=(async()=>{await Promise.all(QE.map(r=>document.fonts.load(r))),await document.fonts.ready,B_=!0})()),await Kv)}/** 41 * @license 42 * Copyright 2010-2024 Three.js Authors 43 * SPDX-License-Identifier: MIT 44 */const Du="168",pu={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},mu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Pw=0,cx=1,Iw=2,eT=3,Lw=0,C0=1,Oh=2,Zo=3,Da=0,dr=1,os=2,Wr=0,wu=1,ux=2,dx=3,fx=4,Dw=5,uc=100,Uw=101,kw=102,Fw=103,Nw=104,Ow=200,Bw=201,zw=202,Hw=203,Xg=204,Yg=205,Gw=206,Vw=207,jw=208,Ww=209,Xw=210,Yw=211,qw=212,Kw=213,Zw=214,Yx=0,R0=1,qg=2,pf=3,Jh=4,qx=5,Kx=6,P0=7,wp=0,Jw=1,Qw=2,ea=0,$w=1,eM=2,tM=3,Zx=4,nM=5,iM=6,rM=7,hx="attached",sM="detached",I0=300,yl=301,hc=302,Qh=303,$h=304,Sf=306,ep=1e3,yo=1001,tp=1002,yi=1003,Jx=1004,tT=1004,of=1005,nT=1005,ni=1006,Bh=1007,iT=1007,Ca=1008,rT=1008,pr=1009,Qx=1010,$x=1011,mf=1012,L0=1013,xl=1014,as=1015,Uu=1016,D0=1017,U0=1018,pc=1020,e1=35902,t1=1021,n1=1022,ls=1023,i1=1024,r1=1025,Mu=1026,mc=1027,k0=1028,Mp=1029,s1=1030,F0=1031,sT=1032,N0=1033,zh=33776,Hh=33777,Gh=33778,Vh=33779,Kg=35840,Zg=35841,Jg=35842,Qg=35843,$g=36196,e0=37492,t0=37496,n0=37808,i0=37809,r0=37810,s0=37811,o0=37812,a0=37813,l0=37814,c0=37815,u0=37816,d0=37817,f0=37818,h0=37819,p0=37820,m0=37821,jh=36492,g0=36494,v0=36495,o1=36283,y0=36284,x0=36285,_0=36286,oM=2200,aM=2201,lM=2202,np=2300,S0=2301,Hg=2302,xu=2400,_u=2401,ip=2402,O0=2500,a1=2501,oT=0,aT=1,lT=2,na=3200,Ep=3201,cT=3202,uT=3203,yc=0,cM=1,Qo="",Bn="srgb",ia="srgb-linear",B0="display-p3",Tp="display-p3-linear",rp="linear",ti="srgb",sp="rec709",op="p3",dT=0,gu=7680,fT=7681,hT=7682,pT=7683,mT=34055,gT=34056,vT=5386,yT=512,xT=513,_T=514,ST=515,bT=516,wT=517,MT=518,px=519,uM=512,dM=513,fM=514,l1=515,hM=516,pM=517,mM=518,gM=519,ap=35044,ET=35048,TT=35040,AT=35045,CT=35049,RT=35041,PT=35046,IT=35050,LT=35042,DT="100",mx="300 es",Ra=2e3,lp=2001;let ro=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}};const is=["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 z_=1234567;const Eu=Math.PI/180,gf=180/Math.PI;function no(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(is[r&255]+is[r>>8&255]+is[r>>16&255]+is[r>>24&255]+"-"+is[e&255]+is[e>>8&255]+"-"+is[e>>16&15|64]+is[e>>24&255]+"-"+is[t&63|128]+is[t>>8&255]+"-"+is[t>>16&255]+is[t>>24&255]+is[n&255]+is[n>>8&255]+is[n>>16&255]+is[n>>24&255]).toLowerCase()}function ki(r,e,t){return Math.max(e,Math.min(t,r))}function c1(r,e){return(r%e+e)%e}function UT(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function kT(r,e,t){return r!==e?(t-r)/(e-r):0}function Wh(r,e,t){return(1-t)*r+t*e}function FT(r,e,t,n){return Wh(r,e,1-Math.exp(-t*n))}function NT(r,e=1){return e-Math.abs(c1(r,e*2)-e)}function OT(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function BT(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function zT(r,e){return r+Math.floor(Math.random()*(e-r+1))}function HT(r,e){return r+Math.random()*(e-r)}function GT(r){return r*(.5-Math.random())}function VT(r){r!==void 0&&(z_=r);let e=z_+=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 jT(r){return r*Eu}function WT(r){return r*gf}function XT(r){return(r&r-1)===0&&r!==0}function YT(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function qT(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function KT(r,e,t,n,i){const s=Math.cos,o=Math.sin,l=s(t/2),u=o(t/2),d=s((e+n)/2),p=o((e+n)/2),m=s((e-n)/2),v=o((e-n)/2),y=s((n-e)/2),x=o((n-e)/2);switch(i){case"XYX":r.set(l*p,u*m,u*v,l*d);break;case"YZY":r.set(u*v,l*p,u*m,l*d);break;case"ZXZ":r.set(u*m,u*v,l*p,l*d);break;case"XZX":r.set(l*p,u*x,u*y,l*d);break;case"YXY":r.set(u*y,l*p,u*x,l*d);break;case"ZYZ":r.set(u*x,u*y,l*p,l*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function As(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function un(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const vM={DEG2RAD:Eu,RAD2DEG:gf,generateUUID:no,clamp:ki,euclideanModulo:c1,mapLinear:UT,inverseLerp:kT,lerp:Wh,damp:FT,pingpong:NT,smoothstep:OT,smootherstep:BT,randInt:zT,randFloat:HT,randFloatSpread:GT,seededRandom:VT,degToRad:jT,radToDeg:WT,isPowerOfTwo:XT,ceilPowerOfTwo:YT,floorPowerOfTwo:qT,setQuaternionFromProperEuler:KT,normalize:un,denormalize:As};class We{constructor(e=0,t=0){We.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,457 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,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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 n=this.dot(e)/t;return Math.acos(ki(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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 n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class on{constructor(e,t,n,i,s,o,l,u,d){on.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,l,u,d)}set(e,t,n,i,s,o,l,u,d){const p=this.elements;return p[0]=e,p[1]=i,p[2]=l,p[3]=t,p[4]=s,p[5]=u,p[6]=n,p[7]=o,p[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.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 n=e.elements,i=t.elements,s=this.elements,o=n[0],l=n[3],u=n[6],d=n[1],p=n[4],m=n[7],v=n[2],y=n[5],x=n[8],M=i[0],S=i[3],w=i[6],A=i[1],T=i[4],R=i[7],U=i[2],k=i[5],N=i[8];return s[0]=o*M+l*A+u*U,s[3]=o*S+l*T+u*k,s[6]=o*w+l*R+u*N,s[1]=d*M+p*A+m*U,s[4]=d*S+p*T+m*k,s[7]=d*w+p*R+m*N,s[2]=v*M+y*A+x*U,s[5]=v*S+y*T+x*k,s[8]=v*w+y*R+x*N,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],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],d=e[7],p=e[8];return t*o*p-t*l*d-n*s*p+n*l*u+i*s*d-i*o*u}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],d=e[7],p=e[8],m=p*o-l*d,v=l*u-p*s,y=d*s-o*u,x=t*m+n*v+i*y;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/x;return e[0]=m*M,e[1]=(i*d-p*n)*M,e[2]=(l*n-i*o)*M,e[3]=v*M,e[4]=(p*t-i*u)*M,e[5]=(i*s-l*t)*M,e[6]=y*M,e[7]=(n*u-d*t)*M,e[8]=(o*t-n*s)*M,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,n,i,s,o,l){const u=Math.cos(s),d=Math.sin(s);return this.set(n*u,n*d,-n*(u*o+d*l)+o+e,-i*d,i*u,-i*(-d*o+u*l)+l+t,0,0,1),this}scale(e,t){return this.premultiply(Zv.makeScale(e,t)),this}rotate(e){return this.premultiply(Zv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Zv.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),n=Math.sin(e);return this.set(t,-n,0,n,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,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Zv=new on;function yM(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}const ZT={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function af(r,e){return new ZT[r](e)}function cp(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function xM(){const r=cp("canvas");return r.style.display="block",r}const H_={};function ff(r){r in H_||(H_[r]=!0,console.warn(r))}function JT(r,e,t){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}const G_=new on().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),V_=new on().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),vh={[ia]:{transfer:rp,primaries:sp,luminanceCoefficients:[.2126,.7152,.0722],toReference:r=>r,fromReference:r=>r},[Bn]:{transfer:ti,primaries:sp,luminanceCoefficients:[.2126,.7152,.0722],toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Tp]:{transfer:rp,primaries:op,luminanceCoefficients:[.2289,.6917,.0793],toReference:r=>r.applyMatrix3(V_),fromReference:r=>r.applyMatrix3(G_)},[B0]:{transfer:ti,primaries:op,luminanceCoefficients:[.2289,.6917,.0793],toReference:r=>r.convertSRGBToLinear().applyMatrix3(V_),fromReference:r=>r.applyMatrix3(G_).convertLinearToSRGB()}},QT=new Set([ia,Tp]),kn={enabled:!0,_workingColorSpace:ia,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!QT.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=vh[e].toReference,i=vh[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return vh[r].primaries},getTransfer:function(r){return r===Qo?rp:vh[r].transfer},getLuminanceCoefficients:function(r,e=this._workingColorSpace){return r.fromArray(vh[e].luminanceCoefficients)}};function hf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Jv(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let Pd;class _M{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Pd===void 0&&(Pd=cp("canvas")),Pd.width=e.width,Pd.height=e.height;const n=Pd.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Pd}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=cp("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=hf(s[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(hf(t[n]/255)*255):t[n]=hf(t[n]);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 $T=0;class Su{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:$T++}),this.uuid=no(),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 n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,l=i.length;o<l;o++)i[o].isDataTexture?s.push(Qv(i[o].image)):s.push(Qv(i[o]))}else s=Qv(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function Qv(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?_M.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let eA=0;class di extends ro{constructor(e=di.DEFAULT_IMAGE,t=di.DEFAULT_MAPPING,n=yo,i=yo,s=ni,o=Ca,l=ls,u=pr,d=di.DEFAULT_ANISOTROPY,p=Qo){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:eA++}),this.uuid=no(),this.name="",this.source=new Su(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=d,this.format=l,this.internalFormat=null,this.type=u,this.offset=new We(0,0),this.repeat=new We(1,1),this.center=new We(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new on,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,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 n={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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==I0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ep:e.x=e.x-Math.floor(e.x);break;case yo:e.x=e.x<0?0:1;break;case tp: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 ep:e.y=e.y-Math.floor(e.y);break;case yo:e.y=e.y<0?0:1;break;case tp: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++}}di.DEFAULT_IMAGE=null;di.DEFAULT_MAPPING=I0;di.DEFAULT_ANISOTROPY=1;class fn{constructor(e=0,t=0,n=0,i=1){fn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}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,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,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,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+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,n,i,s;const u=e.elements,d=u[0],p=u[4],m=u[8],v=u[1],y=u[5],x=u[9],M=u[2],S=u[6],w=u[10];if(Math.abs(p-v)<.01&&Math.abs(m-M)<.01&&Math.abs(x-S)<.01){if(Math.abs(p+v)<.1&&Math.abs(m+M)<.1&&Math.abs(x+S)<.1&&Math.abs(d+y+w-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const T=(d+1)/2,R=(y+1)/2,U=(w+1)/2,k=(p+v)/4,N=(m+M)/4,H=(x+S)/4;return T>R&&T>U?T<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(T),i=k/n,s=N/n):R>U?R<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(R),n=k/i,s=H/i):U<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(U),n=N/s,i=H/s),this.set(n,i,s,t),this}let A=Math.sqrt((S-x)*(S-x)+(m-M)*(m-M)+(v-p)*(v-p));return Math.abs(A)<.001&&(A=1),this.x=(S-x)/A,this.y=(m-M)/A,this.z=(v-p)/A,this.w=Math.acos((d+y+w-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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,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 SM extends ro{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new fn(0,0,e,t),this.scissorTest=!1,this.viewport=new fn(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ni,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const s=new di(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let l=0;l<o;l++)this.textures[l]=s.clone(),this.textures[l].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;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 n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Su(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 xi extends SM{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class z0 extends di{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=yi,this.minFilter=yi,this.wrapR=yo,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class tA extends xi{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new z0(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class u1 extends di{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=yi,this.minFilter=yi,this.wrapR=yo,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class nA extends xi{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new u1(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Xr{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,o,l){let u=n[i+0],d=n[i+1],p=n[i+2],m=n[i+3];const v=s[o+0],y=s[o+1],x=s[o+2],M=s[o+3];if(l===0){e[t+0]=u,e[t+1]=d,e[t+2]=p,e[t+3]=m;return}if(l===1){e[t+0]=v,e[t+1]=y,e[t+2]=x,e[t+3]=M;return}if(m!==M||u!==v||d!==y||p!==x){let S=1-l;const w=u*v+d*y+p*x+m*M,A=w>=0?1:-1,T=1-w*w;if(T>Number.EPSILON){const U=Math.sqrt(T),k=Math.atan2(U,w*A);S=Math.sin(S*k)/U,l=Math.sin(l*k)/U}const R=l*A;if(u=u*S+v*R,d=d*S+y*R,p=p*S+x*R,m=m*S+M*R,S===1-l){const U=1/Math.sqrt(u*u+d*d+p*p+m*m);u*=U,d*=U,p*=U,m*=U}}e[t]=u,e[t+1]=d,e[t+2]=p,e[t+3]=m}static multiplyQuaternionsFlat(e,t,n,i,s,o){const l=n[i],u=n[i+1],d=n[i+2],p=n[i+3],m=s[o],v=s[o+1],y=s[o+2],x=s[o+3];return e[t]=l*x+p*m+u*y-d*v,e[t+1]=u*x+p*v+d*m-l*y,e[t+2]=d*x+p*y+l*v-u*m,e[t+3]=p*x-l*m-u*v-d*y,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,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,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 n=e._x,i=e._y,s=e._z,o=e._order,l=Math.cos,u=Math.sin,d=l(n/2),p=l(i/2),m=l(s/2),v=u(n/2),y=u(i/2),x=u(s/2);switch(o){case"XYZ":this._x=v*p*m+d*y*x,this._y=d*y*m-v*p*x,this._z=d*p*x+v*y*m,this._w=d*p*m-v*y*x;break;case"YXZ":this._x=v*p*m+d*y*x,this._y=d*y*m-v*p*x,this._z=d*p*x-v*y*m,this._w=d*p*m+v*y*x;break;case"ZXY":this._x=v*p*m-d*y*x,this._y=d*y*m+v*p*x,this._z=d*p*x+v*y*m,this._w=d*p*m-v*y*x;break;case"ZYX":this._x=v*p*m-d*y*x,this._y=d*y*m+v*p*x,this._z=d*p*x-v*y*m,this._w=d*p*m+v*y*x;break;case"YZX":this._x=v*p*m+d*y*x,this._y=d*y*m+v*p*x,this._z=d*p*x-v*y*m,this._w=d*p*m-v*y*x;break;case"XZY":this._x=v*p*m-d*y*x,this._y=d*y*m-v*p*x,this._z=d*p*x+v*y*m,this._w=d*p*m+v*y*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],l=t[5],u=t[9],d=t[2],p=t[6],m=t[10],v=n+l+m;if(v>0){const y=.5/Math.sqrt(v+1);this._w=.25/y,this._x=(p-u)*y,this._y=(s-d)*y,this._z=(o-i)*y}else if(n>l&&n>m){const y=2*Math.sqrt(1+n-l-m);this._w=(p-u)/y,this._x=.25*y,this._y=(i+o)/y,this._z=(s+d)/y}else if(l>m){const y=2*Math.sqrt(1+l-n-m);this._w=(s-d)/y,this._x=(i+o)/y,this._y=.25*y,this._z=(u+p)/y}else{const y=2*Math.sqrt(1+m-n-l);this._w=(o-i)/y,this._x=(s+d)/y,this._y=(u+p)/y,this._z=.25*y}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ki(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),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 n=e._x,i=e._y,s=e._z,o=e._w,l=t._x,u=t._y,d=t._z,p=t._w;return this._x=n*p+o*l+i*d-s*u,this._y=i*p+o*u+s*l-n*d,this._z=s*p+o*d+n*u-i*l,this._w=o*p-n*l-i*u-s*d,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let l=o*e._w+n*e._x+i*e._y+s*e._z;if(l<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),l>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const u=1-l*l;if(u<=Number.EPSILON){const y=1-t;return this._w=y*o+t*this._w,this._x=y*n+t*this._x,this._y=y*i+t*this._y,this._z=y*s+t*this._z,this.normalize(),this}const d=Math.sqrt(u),p=Math.atan2(d,l),m=Math.sin((1-t)*p)/d,v=Math.sin(t*p)/d;return this._w=o*m+this._w*v,this._x=n*m+this._x*v,this._y=i*m+this._y*v,this._z=s*m+this._z*v,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*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 te{constructor(e=0,t=0,n=0){te.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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(j_.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(j_.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,l=e.z,u=e.w,d=2*(o*i-l*n),p=2*(l*t-s*i),m=2*(s*n-o*t);return this.x=t+u*d+o*m-l*p,this.y=n+u*p+l*d-s*m,this.z=i+u*m+s*p-o*d,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,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,o=t.x,l=t.y,u=t.z;return this.x=i*u-s*l,this.y=s*o-n*u,this.z=n*l-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return $v.copy(this).projectOnVector(e),this.sub($v)}reflect(e){return this.sub($v.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 n=this.dot(e)/t;return Math.acos(ki(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}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,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,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(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,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,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const $v=new te,j_=new Xr;class ir{constructor(e=new te(1/0,1/0,1/0),t=new te(-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,n=e.length;t<n;t+=3)this.expandByPoint(Yo.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Yo.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Yo.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),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 n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,l=s.count;o<l;o++)e.isMesh===!0?e.getVertexPosition(o,Yo):Yo.fromBufferAttribute(s,o),Yo.applyMatrix4(e.matrixWorld),this.expandByPoint(Yo);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),km.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),km.copy(n.boundingBox)),km.applyM
vendor: 4,437 bytes, line 44
44atrix4(e.matrixWorld),this.union(km)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[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,Yo),Yo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(yh),Fm.subVectors(this.max,yh),Id.subVectors(e.a,yh),Ld.subVectors(e.b,yh),Dd.subVectors(e.c,yh),Jl.subVectors(Ld,Id),Ql.subVectors(Dd,Ld),eu.subVectors(Id,Dd);let t=[0,-Jl.z,Jl.y,0,-Ql.z,Ql.y,0,-eu.z,eu.y,Jl.z,0,-Jl.x,Ql.z,0,-Ql.x,eu.z,0,-eu.x,-Jl.y,Jl.x,0,-Ql.y,Ql.x,0,-eu.y,eu.x,0];return!ey(t,Id,Ld,Dd,Fm)||(t=[1,0,0,0,1,0,0,0,1],!ey(t,Id,Ld,Dd,Fm))?!1:(Nm.crossVectors(Jl,Ql),t=[Nm.x,Nm.y,Nm.z],ey(t,Id,Ld,Dd,Fm))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Yo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Yo).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:(ll[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ll[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ll[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ll[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ll[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ll[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ll[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ll[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ll),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 ll=[new te,new te,new te,new te,new te,new te,new te,new te],Yo=new te,km=new ir,Id=new te,Ld=new te,Dd=new te,Jl=new te,Ql=new te,eu=new te,yh=new te,Fm=new te,Nm=new te,tu=new te;function ey(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){tu.fromArray(r,s);const l=i.x*Math.abs(tu.x)+i.y*Math.abs(tu.y)+i.z*Math.abs(tu.z),u=e.dot(tu),d=t.dot(tu),p=n.dot(tu);if(Math.max(-Math.max(u,d,p),Math.min(u,d,p))>l)return!1}return!0}const iA=new ir,xh=new te,ty=new te;class hr{constructor(e=new te,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 n=this.center;t!==void 0?n.copy(t):iA.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),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 n=this.center.distanceToSquared(e);return t.copy(e),n>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,946 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;xh.subVectors(e,this.center);const t=xh.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(xh,i/n),this.radius+=i}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):(ty.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(xh.copy(e.center).add(ty)),this.expandByPoint(xh.copy(e.center).sub(ty))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const cl=new te,ny=new te,Om=new te,$l=new te,iy=new te,Bm=new te,ry=new te;class ku{constructor(e=new te,t=new te(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,cl)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=cl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(cl.copy(this.origin).addScaledVector(this.direction,t),cl.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){ny.copy(e).add(t).multiplyScalar(.5),Om.copy(t).sub(e).normalize(),$l.copy(this.origin).sub(ny);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Om),l=$l.dot(this.direction),u=-$l.dot(Om),d=$l.lengthSq(),p=Math.abs(1-o*o);let m,v,y,x;if(p>0)if(m=o*u-l,v=o*l-u,x=s*p,m>=0)if(v>=-x)if(v<=x){const M=1/p;m*=M,v*=M,y=m*(m+o*v+2*l)+v*(o*m+v+2*u)+d}else v=s,m=Math.max(0,-(o*v+l)),y=-m*m+v*(v+2*u)+d;else v=-s,m=Math.max(0,-(o*v+l)),y=-m*m+v*(v+2*u)+d;else v<=-x?(m=Math.max(0,-(-o*s+l)),v=m>0?-s:Math.min(Math.max(-s,-u),s),y=-m*m+v*(v+2*u)+d):v<=x?(m=0,v=Math.min(Math.max(-s,-u),s),y=v*(v+2*u)+d):(m=Math.max(0,-(o*s+l)),v=m>0?s:Math.min(Math.max(-s,-u),s),y=-m*m+v*(v+2*u)+d);else v=o>0?-s:s,m=Math.max(0,-(o*v+l)),y=-m*m+v*(v+2*u)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,m),i&&i.copy(ny).addScaledVector(Om,v),y}intersectSphere(e,t){cl.subVectors(e.center,this.origin);const n=cl.dot(this.direction),i=cl.dot(cl)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),l=n-o,u=n+o;return u<0?null:l<0?this.at(u,t):this.at(l,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,l,u;const d=1/this.direction.x,p=1/this.direction.y,m=1/this.direction.z,v=this.origin;return d>=0?(n=(e.min.x-v.x)*d,i=(e.max.x-v.x)*d):(n=(e.max.x-v.x)*d,i=(e.min.x-v.x)*d),p>=0?(s=(e.min.y-v.y)*p,o=(e.max.y-v.y)*p):(s=(e.max.y-v.y)*p,o=(e.min.y-v.y)*p),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),m>=0?(l=(e.min.z-v.z)*m,u=(e.max.z-v.z)*m):(l=(e.max.z-v.z)*m,u=(e.min.z-v.z)*m),n>u||l>i)||((l>n||n!==n)&&(n=l),(u<i||i!==i)&&(i=u),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,cl)!==null}intersectTriangle(e,t,n,i,s){iy.subVectors(t,e),Bm.subVectors(n,e),ry.crossVectors(iy,Bm);let o=this.direction.dot(ry),l;if(o>0){if(i)return null;l=1}else if(o<0)l=-1,o=-o;else return null;$l.subVectors(this.origin,e);const u=l*this.direction.dot(Bm.crossVectors($l,Bm));if(u<0)return null;const d=l*this.direction.dot(iy.cross($l));if(d<0||u+d>o)return null;const p=-l*$l.dot(ry);return p<0?null:this.at(p/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 Xt{constructor(e,t,n,i,s,o,l,u,d,p,m,v,y,x,M,S){Xt.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,n,i,s,o,l,u,d,p,m,v,y,x,M,S)}set(e,t,n,i,s,o,l,u,d,p,m,v,y,x,M,S){const w=this.elements;return w[0]=e,w[4]=t,w[8]=n,w[12]=i,w[1]=s,w[5]=o,w[9]=l,w[13]=u,w[2]=d,w[6]=p,w[10]=m,w[14]=v,w[3]=y,w[7]=x,w[11]=M,w[15]=S,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Xt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[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,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Ud.setFromMatrixColumn(e,0).length(),s=1/Ud.setFromMatrixColumn(e,1).length(),o=1/Ud.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),l=Math.sin(n),u=Math.cos(i),d=Math.sin(i),p=Math.cos(s),m=Math.sin(s);if(e.order==="XYZ"){const v=o*p,y=o*m,x=l*p,M=l*m;t[0]=u*p,t[4]=-u*m,t[8]=d,t[1]=y+x*d,t[5]=v-M*d,t[9]=-l*u,t[2]=M-v*d,t[6]=x+y*d,t[10]=o*u}else if(e.order==="YXZ"){const v=u*p,y=u*m,x=d*p,M=d*m;t[0]=v+M*l,t[4]=x*l-y,t[8]=o*d,t[1]=o*m,t[5]=o*p,t[9]=-l,t[2]=y*l-x,t[6]=M+v*l,t[10]=o*u}else if(e.order==="ZXY"){const v=u*p,y=u*m,x=d*p,M=d*m;t[0]=v-M*l,t[4]=-o*m,t[8]=x+y*l,t[1]=y+x*l,t[5]=o*p,t[9]=M-v*l,t[2]=-o*d,t[6]=l,t[10]=o*u}else if(e.order==="ZYX"){const v=o*p,y=o*m,x=l*p,M=l*m;t[0]=u*p,t[4]=x*d-y,t[8]=v*d+M,t[1]=u*m,t[5]=M*d+v,t[9]=y*d-x,t[2]=-d,t[6]=l*u,t[10]=o*u}else if(e.order==="YZX"){const v=o*u,y=o*d,x=l*u,M=l*d;t[0]=u*p,t[4]=M-v*m,t[8]=x*m+y,t[1]=m,t[5]=o*p,t[9]=-l*p,t[2]=-d*p,t[6]=y*m+x,t[10]=v-M*m}else if(e.order==="XZY"){const v=o*u,y=o*d,x=l*u,M=l*d;t[0]=u*p,t[4]=-m,t[8]=d*p,t[1]=v*m+M,t[5]=o*p,t[9]=y*m-x,t[2]=x*m-y,t[6]=l*p,t[10]=M*m+v}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(rA,e,sA)}lookAt(e,t,n){const i=this.elements;return Qs.subVectors(e,t),Qs.lengthSq()===0&&(Qs.z=1),Qs.normalize(),ec.crossVectors(n,Qs),ec.lengthSq()===0&&(Math.abs(n.z)===1?Qs.x+=1e-4:Qs.z+=1e-4,Qs.normalize(),ec.crossVectors(n,Qs)),ec.normalize(),zm.crossVectors(Qs,ec),i[0]=ec.x,i[4]=zm.x,i[8]=Qs.x,i[1]=ec.y,i[5]=zm.y,i[9]=Qs.y,i[2]=ec.z,i[6]=zm.z,i[10]=Qs.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],l=n[4],u=n[8],d=n[12],p=n[1],m=n[5],v=n[9],y=n[13],x=n[2],M=n[6],S=n[10],w=n[14],A=n[3],T=n[7],R=n[11],U=n[15],k=i[0],N=i[4],H=i[8],F=i[12],I=i[1],G=i[5],W=i[9],X=i[13],J=i[2],oe=i[6],se=i[10],fe=i[14],V=i[3],$=i[7],Z=i[11],O=i[15];return s[0]=o*k+l*I+u*J+d*V,s[4]=o*N+l*G+u*oe+d*$,s[8]=o*H+l*W+u*se+d*Z,s[12]=o*F+l*X+u*fe+d*O,s[1]=p*k+m*I+v*J+y*V,s[5]=p*N+m*G+v*oe+y*$,s[9]=p*H+m*W+v*se+y*Z,s[13]=p*F+m*X+v*fe+y*O,s[2]=x*k+M*I+S*J+w*V,s[6]=x*N+M*G+S*oe+w*$,s[10]=x*H+M*W+S*se+w*Z,s[14]=x*F+M*X+S*fe+w*O,s[3]=A*k+T*I+R*J+U*V,s[7]=A*N+T*G+R*oe+U*$,s[11]=A*H+T*W+R*se+U*Z,s[15]=A*F+T*X+R*fe+U*O,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],n=e[4],i=e[8],s=e[12],o=e[1],l=e[5],u=e[9],d=e[13],p=e[2],m=e[6],v=e[10],y=e[14],x=e[3],M=e[7],S=e[11],w=e[15];return x*(+s*u*m-i*d*m-s*l*v+n*d*v+i*l*y-n*u*y)+M*(+t*u*y-t*d*v+s*o*v-i*o*y+i*d*p-s*u*p)+S*(+t*d*m-t*l*y-s*o*m+n*o*y+s*l*p-n*d*p)+w*(-i*l*p-t*u*m+t*l*v+i*o*m-n*o*v+n*u*p)}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,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],d=e[7],p=e[8],m=e[9],v=e[10],y=e[11],x=e[12],M=e[13],S=e[14],w=e[15],A=m*S*d-M*v*d+M*u*y-l*S*y-m*u*w+l*v*w,T=x*v*d-p*S*d-x*u*y+o*S*y+p*u*w-o*v*w,R=p*M*d-x*m*d+x*l*y-o*M*y-p*l*w+o*m*w,U=x*m*u-p*M*u-x*l*v+o*M*v+p*l*S-o*m*S,k=t*A+n*T+i*R+s*U;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/k;return e[0]=A*N,e[1]=(M*v*s-m*S*s-M*i*y+n*S*y+m*i*w-n*v*w)*N,e[2]=(l*S*s-M*u*s+M*i*d-n*S*d-l*i*w+n*u*w)*N,e[3]=(m*u*s-l*v*s-m*i*d+n*v*d+l*i*y-n*u*y)*N,e[4]=T*N,e[5]=(p*S*s-x*v*s+x*i*y-t*S*y-p*i*w+t*v*w)*N,e[6]=(x*u*s-o*S*s-x*i*d+t*S*d+o*i*w-t*u*w)*N,e[7]=(o*v*s-p*u*s+p*i*d-t*v*d-o*i*y+t*u*y)*N,e[8]=R*N,e[9]=(x*m*s-p*M*s-x*n*y+t*M*y+p*n*w-t*m*w)*N,e[10]=(o*M*s-x*l*s+x*n*d-t*M*d-o*n*w+t*l*w)*N,e[11]=(p*l*s-o*m*s-p*n*d+t*m*d+o*n*y-t*l*y)*N,e[12]=U*N,e[13]=(p*M*i-x*m*i+x*n*v-t*M*v-p*n*S+t*m*S)*N,e[14]=(x*l*i-o*M*i-x*n*u+t*M*u+o*n*S-t*l*S)*N,e[15]=(o*m*i-p*l*i+p*n*u-t*m*u-o*n*v+t*l*v)*N,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){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,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,l=e.y,u=e.z,d=s*o,p=s*l;return this.set(d*o+n,d*l-i*u,d*u+i*l,0,d*l+i*u,p*l+n,p*u-i*o,0,d*u-i*l,p*u+i*o,s*u*u+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,l=t._z,u=t._w,d=s+s,p=o+o,m=l+l,v=s*d,y=s*p,x=s*m,M=o*p,S=o*m,w=l*m,A=u*d,T=u*p,R=u*m,U=n.x,k=n.y,N=n.z;return i[0]=(1-(M+w))*U,i[1]=(y+R)*U,i[2]=(x-T)*U,i[3]=0,i[4]=(y-R)*k,i[5]=(1-(v+w))*k,i[6]=(S+A)*k,i[7]=0,i[8]=(x+T)*N,i[9]=(S-A)*N,i[10]=(1-(v+M))*N,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=Ud.set(i[0],i[1],i[2]).length();const o=Ud.set(i[4],i[5],i[6]).length(),l=Ud.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],qo.copy(this);const d=1/s,p=1/o,m=1/l;return qo.elements[0]*=d,qo.elements[1]*=d,qo.elements[2]*=d,qo.elements[4]*=p,qo.elements[5]*=p,qo.elements[6]*=p,qo.elements[8]*=m,qo.elements[9]*=m,qo.elements[10]*=m,t.setFromRotationMatrix(qo),n.x=s,n.y=o,n.z=l,this}makePerspective(e,t,n,i,s,o,l=Ra){const u=this.elements,d=2*s/(t-e),p=2*s/(n-i),m=(t+e)/(t-e),v=(n+i)/(n-i);let y,x;if(l===Ra)y=-(o+s)/(o-s),x=-2*o*s/(o-s);else if(l===lp)y=-o/(o-s),x=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return u[0]=d,u[4]=0,u[8]=m,u[12]=0,u[1]=0,u[5]=p,u[9]=v,u[13]=0,u[2]=0,u[6]=0,u[10]=y,u[14]=x,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,n,i,s,o,l=Ra){const u=this.elements,d=1/(t-e),p=1/(n-i),m=1/(o-s),v=(t+e)*d,y=(n+i)*p;let x,M;if(l===Ra)x=(o+s)*m,M=-2*m;else if(l===lp)x=s*m,M=-1*m;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return u[0]=2*d,u[4]=0,u[8]=0,u[12]=-v,u[1]=0,u[5]=2*p,u[9]=0,u[13]=-y,u[2]=0,u[6]=0,u[10]=M,u[14]=-x,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Ud=new te,qo=new Xt,rA=new te(0,0,0),sA=new te(1,1,1),ec=new te,zm=new te,Qs=new te,W_=new Xt,X_=new Xr;class io{constructor(e=0,t=0,n=0,i=io.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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,n=!0){const i=e.elements,s=i[0],o=i[4],l=i[8],u=i[1],d=i[5],p=i[9],m=i[2],v=i[6],y=i[10];switch(t){case"XYZ":this._y=Math.asin(ki(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-p,y),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(v,d),this._z=0);break;case"YXZ":this._x=Math.asin(-ki(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(l,y),this._z=Math.atan2(u,d)):(this._y=Math.atan2(-m,s),this._z=0);break;case"ZXY":this._x=Math.asin(ki(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(-m,y),this._z=Math.atan2(-o,d)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-ki(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(v,y),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,d));break;case"YZX":this._z=Math.asin(ki(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-p,d),this._y=Math.atan2(-m,s)):(this._x=0,this._y=Math.atan2(l,y));break;case"XZY":this._z=Math.asin(-ki(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(v,d),this._y=Math.atan2(l,s)):(this._x=Math.atan2(-p,y),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return W_.makeRotationFromQuaternion(e),this.setFromRotationMatrix(W_,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return X_.setFromEuler(this),this.setFromQuaternion(X_,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}}io.DEFAULT_ORDER="XYZ";class Tu{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 oA=0;const Y_=new te,kd=new Xr,ul=new Xt,Hm=new te,_h=new te,aA=new te,lA=new Xr,q_=new te(1,0,0),K_=new te(0,1,0),Z_=new te(0,0,1),J_={type:"added"},cA={type:"removed"},Fd={type:"childadded",child:null},sy={type:"childremoved",child:null};class In extends ro{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:oA++}),this.uuid=no(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=In.DEFAULT_UP.clone();const e=new te,t=new io,n=new Xr,i=new te(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._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:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Xt},normalMatrix:{value:new on}}),this.matrix=new Xt,this.matrixWorld=new Xt,this.matrixAutoUpdate=In.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=In.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Tu,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: 7,843 bytes, line 44
44setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return kd.setFromAxisAngle(e,t),this.quaternion.multiply(kd),this}rotateOnWorldAxis(e,t){return kd.setFromAxisAngle(e,t),this.quaternion.premultiply(kd),this}rotateX(e){return this.rotateOnAxis(q_,e)}rotateY(e){return this.rotateOnAxis(K_,e)}rotateZ(e){return this.rotateOnAxis(Z_,e)}translateOnAxis(e,t){return Y_.copy(e).applyQuaternion(this.quaternion),this.position.add(Y_.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(q_,e)}translateY(e){return this.translateOnAxis(K_,e)}translateZ(e){return this.translateOnAxis(Z_,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ul.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Hm.copy(e):Hm.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),_h.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ul.lookAt(_h,Hm,this.up):ul.lookAt(Hm,_h,this.up),this.quaternion.setFromRotationMatrix(ul),i&&(ul.extractRotation(i.matrixWorld),kd.setFromRotationMatrix(ul),this.quaternion.premultiply(kd.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(J_),Fd.child=e,this.dispatchEvent(Fd),Fd.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(cA),sy.child=e,this.dispatchEvent(sy),sy.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),ul.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ul.multiply(e.parent.matrixWorld)),e.applyMatrix4(ul),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(J_),Fd.child=e,this.dispatchEvent(Fd),Fd.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 n=0,i=this.children.length;n<i;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_h,e,aA),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_h,lA,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 n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].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 n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(l,u){return l[u.uuid]===void 0&&(l[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){const u=l.shapes;if(Array.isArray(u))for(let d=0,p=u.length;d<p;d++){const m=u[d];s(e.shapes,m)}else s(e.shapes,u)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const l=[];for(let u=0,d=this.material.length;u<d;u++)l.push(s(e.materials,this.material[u]));i.material=l}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let l=0;l<this.children.length;l++)i.children.push(this.children[l].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let l=0;l<this.animations.length;l++){const u=this.animations[l];i.animations.push(s(e.animations,u))}}if(t){const l=o(e.geometries),u=o(e.materials),d=o(e.textures),p=o(e.images),m=o(e.shapes),v=o(e.skeletons),y=o(e.animations),x=o(e.n
vendor: 10,143 bytes, line 44
44odes);l.length>0&&(n.geometries=l),u.length>0&&(n.materials=u),d.length>0&&(n.textures=d),p.length>0&&(n.images=p),m.length>0&&(n.shapes=m),v.length>0&&(n.skeletons=v),y.length>0&&(n.animations=y),x.length>0&&(n.nodes=x)}return n.object=i,n;function o(l){const u=[];for(const d in l){const p=l[d];delete p.metadata,u.push(p)}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 n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}In.DEFAULT_UP=new te(0,1,0);In.DEFAULT_MATRIX_AUTO_UPDATE=!0;In.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ko=new te,dl=new te,oy=new te,fl=new te,Nd=new te,Od=new te,Q_=new te,ay=new te,ly=new te,cy=new te;class eo{constructor(e=new te,t=new te,n=new te){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Ko.subVectors(e,t),i.cross(Ko);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Ko.subVectors(i,t),dl.subVectors(n,t),oy.subVectors(e,t);const o=Ko.dot(Ko),l=Ko.dot(dl),u=Ko.dot(oy),d=dl.dot(dl),p=dl.dot(oy),m=o*d-l*l;if(m===0)return s.set(0,0,0),null;const v=1/m,y=(d*u-l*p)*v,x=(o*p-l*u)*v;return s.set(1-y-x,x,y)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,fl)===null?!1:fl.x>=0&&fl.y>=0&&fl.x+fl.y<=1}static getInterpolation(e,t,n,i,s,o,l,u){return this.getBarycoord(e,t,n,i,fl)===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,fl.x),u.addScaledVector(o,fl.y),u.addScaledVector(l,fl.z),u)}static isFrontFacing(e,t,n,i){return Ko.subVectors(n,t),dl.subVectors(e,t),Ko.cross(dl).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 Ko.subVectors(this.c,this.b),dl.subVectors(this.a,this.b),Ko.cross(dl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return eo.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return eo.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return eo.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return eo.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return eo.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,l;Nd.subVectors(i,n),Od.subVectors(s,n),ay.subVectors(e,n);const u=Nd.dot(ay),d=Od.dot(ay);if(u<=0&&d<=0)return t.copy(n);ly.subVectors(e,i);const p=Nd.dot(ly),m=Od.dot(ly);if(p>=0&&m<=p)return t.copy(i);const v=u*m-p*d;if(v<=0&&u>=0&&p<=0)return o=u/(u-p),t.copy(n).addScaledVector(Nd,o);cy.subVectors(e,s);const y=Nd.dot(cy),x=Od.dot(cy);if(x>=0&&y<=x)return t.copy(s);const M=y*d-u*x;if(M<=0&&d>=0&&x<=0)return l=d/(d-x),t.copy(n).addScaledVector(Od,l);const S=p*x-y*m;if(S<=0&&m-p>=0&&y-x>=0)return Q_.subVectors(s,i),l=(m-p)/(m-p+(y-x)),t.copy(i).addScaledVector(Q_,l);const w=1/(S+M+v);return o=M*w,l=v*w,t.copy(n).addScaledVector(Nd,o).addScaledVector(Od,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const bM={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},tc={h:0,s:0,l:0},Gm={h:0,s:0,l:0};function uy(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class St{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Bn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,kn.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=kn.workingColorSpace){return this.r=e,this.g=t,this.b=n,kn.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=kn.workingColorSpace){if(e=c1(e,1),t=ki(t,0,1),n=ki(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=uy(o,s,e+1/3),this.g=uy(o,s,e),this.b=uy(o,s,e-1/3)}return kn.toWorkingColorSpace(this,i),this}setStyle(e,t=Bn){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],l=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(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(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[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=Bn){const n=bM[e.toLowerCase()];return n!==void 0?this.setHex(n,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=hf(e.r),this.g=hf(e.g),this.b=hf(e.b),this}copyLinearToSRGB(e){return this.r=Jv(e.r),this.g=Jv(e.g),this.b=Jv(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Bn){return kn.fromWorkingColorSpace(rs.copy(this),e),Math.round(ki(rs.r*255,0,255))*65536+Math.round(ki(rs.g*255,0,255))*256+Math.round(ki(rs.b*255,0,255))}getHexString(e=Bn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=kn.workingColorSpace){kn.fromWorkingColorSpace(rs.copy(this),t);const n=rs.r,i=rs.g,s=rs.b,o=Math.max(n,i,s),l=Math.min(n,i,s);let u,d;const p=(l+o)/2;if(l===o)u=0,d=0;else{const m=o-l;switch(d=p<=.5?m/(o+l):m/(2-o-l),o){case n:u=(i-s)/m+(i<s?6:0);break;
vendor: 3,632 bytes, line 44
44case i:u=(s-n)/m+2;break;case s:u=(n-i)/m+4;break}u/=6}return e.h=u,e.s=d,e.l=p,e}getRGB(e,t=kn.workingColorSpace){return kn.fromWorkingColorSpace(rs.copy(this),t),e.r=rs.r,e.g=rs.g,e.b=rs.b,e}getStyle(e=Bn){kn.fromWorkingColorSpace(rs.copy(this),e);const t=rs.r,n=rs.g,i=rs.b;return e!==Bn?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(tc),this.setHSL(tc.h+e,tc.s+t,tc.l+n)}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,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(tc),e.getHSL(Gm);const n=Wh(tc.h,Gm.h,t),i=Wh(tc.s,Gm.s,t),s=Wh(tc.l,Gm.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,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 rs=new St;St.NAMES=bM;let uA=0;class Rr extends ro{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:uA++}),this.uuid=no(),this.name="",this.type="Material",this.blending=wu,this.side=Da,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Xg,this.blendDst=Yg,this.blendEquation=uc,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new St(0,0,0),this.blendAlpha=0,this.depthFunc=pf,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=px,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=gu,this.stencilZFail=gu,this.stencilZPass=gu,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 n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};
vendor: 8,832 bytes, line 44
44n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==wu&&(n.blending=this.blending),this.side!==Da&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Xg&&(n.blendSrc=this.blendSrc),this.blendDst!==Yg&&(n.blendDst=this.blendDst),this.blendEquation!==uc&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==pf&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==px&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==gu&&(n.stencilFail=this.stencilFail),this.stencilZFail!==gu&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==gu&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const o=[];for(const l in s){const u=s[l];delete u.metadata,o.push(u)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}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 n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 4,160 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 Sl extends Rr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new St(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 io,this.combine=wp,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 ml=dA();function dA(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let u=0;u<256;++u){const d=u-127;d<-27?(n[u]=0,n[u|256]=32768,i[u]=24,i[u|256]=24):d<-14?(n[u]=1024>>-d-14,n[u|256]=1024>>-d-14|32768,i[u]=-d-1,i[u|256]=-d-1):d<=15?(n[u]=d+15<<10,n[u|256]=d+15<<10|32768,i[u]=13,i[u|256]=13):d<128?(n[u]=31744,n[u|256]=64512,i[u]=24,i[u|256]=24):(n[u]=31744,n[u|256]=64512,i[u]=13,i[u|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let u=1;u<1024;++u){let d=u<<13,p=0;for(;(d&8388608)===0;)d<<=1,p-=8388608;d&=-8388609,p+=947912704,s[u]=d|p}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&&(l[u]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:l}}function Os(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=ki(r,-65504,65504),ml.floatView[0]=r;const e=ml.uint32View[0],t=e>>23&511;return ml.baseTable[t]+((e&8388607)>>ml.shiftTable[t])}function kh(r){const e=r>>10;return ml.uint32View[0]=ml.mantissaTable[ml.offsetTable[e]+(r&1023)]+ml.exponentTable[e],ml.floatView[0]}const fA={toHalfFloat:Os,fromHalfFloat:kh},er=new te,Vm=new We;class zn{constructor(e,t,n=!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=n,this.usage=ap,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=as,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return ff("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;
vendor: 39,061 bytes, lines 44-142
44for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Vm.fromBufferAttribute(this,t),Vm.applyMatrix3(e),this.setXY(t,Vm.x,Vm.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)er.fromBufferAttribute(this,t),er.applyMatrix3(e),this.setXYZ(t,er.x,er.y,er.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)er.fromBufferAttribute(this,t),er.applyMatrix4(e),this.setXYZ(t,er.x,er.y,er.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)er.fromBufferAttribute(this,t),er.applyNormalMatrix(e),this.setXYZ(t,er.x,er.y,er.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)er.fromBufferAttribute(this,t),er.transformDirection(e),this.setXYZ(t,er.x,er.y,er.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=As(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=un(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=As(t,this.array)),t}setX(e,t){return this.normalized&&(t=un(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=As(t,this.array)),t}setY(e,t){return this.normalized&&(t=un(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=As(t,this.array)),t}setZ(e,t){return this.normalized&&(t=un(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=As(t,this.array)),t}setW(e,t){return this.normalized&&(t=un(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=un(t,this.array),n=un(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=un(t,this.array),n=un(n,this.array),i=un(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=un(t,this.array),n=un(n,this.array),i=un(i,this.array),s=un(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==ap&&(e.usage=this.usage),e}}class hA extends zn{constructor(e,t,n){super(new Int8Array(e),t,n)}}class pA extends zn{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class mA extends zn{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class gA extends zn{constructor(e,t,n){super(new Int16Array(e),t,n)}}class d1 extends zn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class vA extends zn{constructor(e,t,n){super(new Int32Array(e),t,n)}}class f1 extends zn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class yA extends zn{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=kh(this.array[e*this.itemSize]);return this.normalized&&(t=As(t,this.array)),t}setX(e,t){return this.normalized&&(t=un(t,this.array)),this.array[e*this.itemSize]=Os(t),this}getY(e){let t=kh(this.array[e*this.itemSize+1]);return this.normalized&&(t=As(t,this.array)),t}setY(e,t){return this.normalized&&(t=un(t,this.array)),this.array[e*this.itemSize+1]=Os(t),this}getZ(e){let t=kh(this.array[e*this.itemSize+2]);return this.normalized&&(t=As(t,this.array)),t}setZ(e,t){return this.normalized&&(t=un(t,this.array)),this.array[e*this.itemSize+2]=Os(t),this}getW(e){let t=kh(this.array[e*this.itemSize+3]);return this.normalized&&(t=As(t,this.array)),t}setW(e,t){return this.normalized&&(t=un(t,this.array)),this.array[e*this.itemSize+3]=Os(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=un(t,this.array),n=un(n,this.array)),this.array[e+0]=Os(t),this.array[e+1]=Os(n),this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=un(t,this.array),n=un(n,this.array),i=un(i,this.array)),this.array[e+0]=Os(t),this.array[e+1]=Os(n),this.array[e+2]=Os(i),this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=un(t,this.array),n=un(n,this.array),i=un(i,this.array),s=un(s,this.array)),this.array[e+0]=Os(t),this.array[e+1]=Os(n),this.array[e+2]=Os(i),this.array[e+3]=Os(s),this}}class Pt extends zn{constructor(e,t,n){super(new Float32Array(e),t,n)}}let xA=0;const go=new Xt,dy=new In,Bd=new te,$s=new ir,Sh=new ir,Tr=new te;class qt extends ro{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:xA++}),this.uuid=no(),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(yM(e)?f1:d1)(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,n=0){this.groups.push({start:e,count:t,materialIndex:n})}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 n=this.attributes.normal;if(n!==void 0){const s=new on().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return go.makeRotationFromQuaternion(e),this.applyMatrix4(go),this}rotateX(e){return go.makeRotationX(e),this.applyMatrix4(go),this}rotateY(e){return go.makeRotationY(e),this.applyMatrix4(go),this}rotateZ(e){return go.makeRotationZ(e),this.applyMatrix4(go),this}translate(e,t,n){return go.makeTranslation(e,t,n),this.applyMatrix4(go),this}scale(e,t,n){return go.makeScale(e,t,n),this.applyMatrix4(go),this}lookAt(e){return dy.lookAt(e),dy.updateMatrix(),this.applyMatrix4(dy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Bd).negate(),this.translate(Bd.x,Bd.y,Bd.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Pt(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ir);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 te(-1/0,-1/0,-1/0),new te(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];$s.setFromBufferAttribute(s),this.morphTargetsRelative?(Tr.addVectors(this.boundingBox.min,$s.min),this.boundingBox.expandByPoint(Tr),Tr.addVectors(this.boundingBox.max,$s.max),this.boundingBox.expandByPoint(Tr)):(this.boundingBox.expandByPoint($s.min),this.boundingBox.expandByPoint($s.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 hr);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 te,1/0);return}if(e){const n=this.boundingSphere.center;if($s.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const l=t[s];Sh.setFromBufferAttribute(l),this.morphTargetsRelative?(Tr.addVectors($s.min,Sh.min),$s.expandByPoint(Tr),Tr.addVectors($s.max,Sh.max),$s.expandByPoint(Tr)):($s.expandByPoint(Sh.min),$s.expandByPoint(Sh.max))}$s.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)Tr.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Tr));if(t)for(let s=0,o=t.length;s<o;s++){const l=t[s],u=this.morphTargetsRelative;for(let d=0,p=l.count;d<p;d++)Tr.fromBufferAttribute(l,d),u&&(Bd.fromBufferAttribute(e,d),Tr.add(Bd)),i=Math.max(i,n.distanceToSquared(Tr))}this.boundingSphere.radius=Math.sqrt(i),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 n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new zn(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),l=[],u=[];for(let H=0;H<n.count;H++)l[H]=new te,u[H]=new te;const d=new te,p=new te,m=new te,v=new We,y=new We,x=new We,M=new te,S=new te;function w(H,F,I){d.fromBufferAttribute(n,H),p.fromBufferAttribute(n,F),m.fromBufferAttribute(n,I),v.fromBufferAttribute(s,H),y.fromBufferAttribute(s,F),x.fromBufferAttribute(s,I),p.sub(d),m.sub(d),y.sub(v),x.sub(v);const G=1/(y.x*x.y-x.x*y.y);isFinite(G)&&(M.copy(p).multiplyScalar(x.y).addScaledVector(m,-y.y).multiplyScalar(G),S.copy(m).multiplyScalar(y.x).addScaledVector(p,-x.x).multiplyScalar(G),l[H].add(M),l[F].add(M),l[I].add(M),u[H].add(S),u[F].add(S),u[I].add(S))}let A=this.groups;A.length===0&&(A=[{start:0,count:e.count}]);for(let H=0,F=A.length;H<F;++H){const I=A[H],G=I.start,W=I.count;for(let X=G,J=G+W;X<J;X+=3)w(e.getX(X+0),e.getX(X+1),e.getX(X+2))}const T=new te,R=new te,U=new te,k=new te;function N(H){U.fromBufferAttribute(i,H),k.copy(U);const F=l[H];T.copy(F),T.sub(U.multiplyScalar(U.dot(F))).normalize(),R.crossVectors(k,F);const G=R.dot(u[H])<0?-1:1;o.setXYZW(H,T.x,T.y,T.z,G)}for(let H=0,F=A.length;H<F;++H){const I=A[H],G=I.start,W=I.count;for(let X=G,J=G+W;X<J;X+=3)N(e.getX(X+0)),N(e.getX(X+1)),N(e.getX(X+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new zn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let v=0,y=n.count;v<y;v++)n.setXYZ(v,0,0,0);const i=new te,s=new te,o=new te,l=new te,u=new te,d=new te,p=new te,m=new te;if(e)for(let v=0,y=e.count;v<y;v+=3){const x=e.getX(v+0),M=e.getX(v+1),S=e.getX(v+2);i.fromBufferAttribute(t,x),s.fromBufferAttribute(t,M),o.fromBufferAttribute(t,S),p.subVectors(o,s),m.subVectors(i,s),p.cross(m),l.fromBufferAttribute(n,x),u.fromBufferAttribute(n,M),d.fromBufferAttribute(n,S),l.add(p),u.add(p),d.add(p),n.setXYZ(x,l.x,l.y,l.z),n.setXYZ(M,u.x,u.y,u.z),n.setXYZ(S,d.x,d.y,d.z)}else for(let v=0,y=t.count;v<y;v+=3)i.fromBufferAttribute(t,v+0),s.fromBufferAttribute(t,v+1),o.fromBufferAttribute(t,v+2),p.subVectors(o,s),m.subVectors(i,s),p.cross(m),n.setXYZ(v+0,p.x,p.y,p.z),n.setXYZ(v+1,p.x,p.y,p.z),n.setXYZ(v+2,p.x,p.y,p.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Tr.fromBufferAttribute(e,t),Tr.normalize(),e.setXYZ(t,Tr.x,Tr.y,Tr.z)}toNonIndexed(){function e(l,u){const d=l.array,p=l.itemSize,m=l.normalized,v=new d.constructor(u.length*p);let y=0,x=0;for(let M=0,S=u.length;M<S;M++){l.isInterleavedBufferAttribute?y=u[M]*l.data.stride+l.offset:y=u[M]*p;for(let w=0;w<p;w++)v[x++]=d[y++]}return new zn(v,p,m)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new qt,n=this.index.array,i=this.attributes;for(const l in i){const u=i[l],d=e(u,n);t.setAttribute(l,d)}const s=this.morphAttributes;for(const l in s){const u=[],d=s[l];for(let p=0,m=d.length;p<m;p++){const v=d[p],y=e(v,n);u.push(y)}t.morphAttributes[l]=u}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let l=0,u=o.length;l<u;l++){const d=o[l];t.addGroup(d.start,d.count,d.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 d in u)u[d]!==void 0&&(e[d]=u[d]);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 n=this.attributes;for(const u in n){const d=n[u];e.data.attributes[u]=d.toJSON(e.data)}const i={};let s=!1;for(const u in this.morphAttributes){const d=this.morphAttributes[u],p=[];for(let m=0,v=d.length;m<v;m++){const y=d[m];p.push(y.toJSON(e.data))}p.length>0&&(i[u]=p,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const l=this.boundingSphere;return l!==null&&(e.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const d in i){const p=i[d];this.setAttribute(d,p.clone(t))}const s=e.morphAttributes;for(const d in s){const p=[],m=s[d];for(let v=0,y=m.length;v<y;v++)p.push(m[v].clone(t));this.morphAttributes[d]=p}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let d=0,p=o.length;d<p;d++){const m=o[d];this.addGroup(m.start,m.count,m.materialIndex)}const l=e.boundingBox;l!==null&&(this.boundingBox=l.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 $_=new Xt,nu=new ku,jm=new hr,eS=new te,zd=new te,Hd=new te,Gd=new te,fy=new te,Wm=new te,Xm=new We,Ym=new We,qm=new We,tS=new te,nS=new te,iS=new te,Km=new te,Zm=new te;class ui extends In{constructor(e=new qt,t=new Sl){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,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const l=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const l=this.morphTargetInfluences;if(s&&l){Wm.set(0,0,0);for(let u=0,d=s.length;u<d;u++){const p=l[u],m=s[u];p!==0&&(fy.fromBufferAttribute(m,e),o?Wm.addScaledVector(fy,p):Wm.addScaledVector(fy.sub(t),p))}t.add(Wm)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),jm.copy(n.boundingSphere),jm.applyMatrix4(s),nu.copy(e.ray).recast(e.near),!(jm.containsPoint(nu.origin)===!1&&(nu.intersectSphere(jm,eS)===null||nu.origin.distanceToSquared(eS)>(e.far-e.near)**2))&&($_.copy(s).invert(),nu.copy(e.ray).applyMatrix4($_),!(n.boundingBox!==null&&nu.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,nu)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,l=s.index,u=s.attributes.position,d=s.attributes.uv,p=s.attributes.uv1,m=s.attributes.normal,v=s.groups,y=s.drawRange;if(l!==null)if(Array.isArray(o))for(let x=0,M=v.length;x<M;x++){const S=v[x],w=o[S.materialIndex],A=Math.max(S.start,y.start),T=Math.min(l.count,Math.min(S.start+S.count,y.start+y.count));for(let R=A,U=T;R<U;R+=3){const k=l.getX(R),N=l.getX(R+1),H=l.getX(R+2);i=Jm(this,w,e,n,d,p,m,k,N,H),i&&(i.faceIndex=Math.floor(R/3),i.face.materialIndex=S.materialIndex,t.push(i))}}else{const x=Math.max(0,y.start),M=Math.min(l.count,y.start+y.count);for(let S=x,w=M;S<w;S+=3){const A=l.getX(S),T=l.getX(S+1),R=l.getX(S+2);i=Jm(this,o,e,n,d,p,m,A,T,R),i&&(i.faceIndex=Math.floor(S/3),t.push(i))}}else if(u!==void 0)if(Array.isArray(o))for(let x=0,M=v.length;x<M;x++){const S=v[x],w=o[S.materialIndex],A=Math.max(S.start,y.start),T=Math.min(u.count,Math.min(S.start+S.count,y.start+y.count));for(let R=A,U=T;R<U;R+=3){const k=R,N=R+1,H=R+2;i=Jm(this,w,e,n,d,p,m,k,N,H),i&&(i.faceIndex=Math.floor(R/3),i.face.materialIndex=S.materialIndex,t.push(i))}}else{const x=Math.max(0,y.start),M=Math.min(u.count,y.start+y.count);for(let S=x,w=M;S<w;S+=3){const A=S,T=S+1,R=S+2;i=Jm(this,o,e,n,d,p,m,A,T,R),i&&(i.faceIndex=Math.floor(S/3),t.push(i))}}}}function _A(r,e,t,n,i,s,o,l){let u;if(e.side===dr?u=n.intersectTriangle(o,s,i,!0,l):u=n.intersectTriangle(i,s,o,e.side===Da,l),u===null)return null;Zm.copy(l),Zm.applyMatrix4(r.matrixWorld);const d=t.ray.origin.distanceTo(Zm);return d<t.near||d>t.far?null:{distance:d,point:Zm.clone(),object:r}}function Jm(r,e,t,n,i,s,o,l,u,d){r.getVertexPosition(l,zd),r.getVertexPosition(u,Hd),r.getVertexPosition(d,Gd);const p=_A(r,e,t,n,zd,Hd,Gd,Km);if(p){i&&(Xm.fromBufferAttribute(i,l),Ym.fromBufferAttribute(i,u),qm.fromBufferAttribute(i,d),p.uv=eo.getInterpolation(Km,zd,Hd,Gd,Xm,Ym,qm,new We)),s&&(Xm.fromBufferAttribute(s,l),Ym.fromBufferAttribute(s,u),qm.fromBufferAttribute(s,d),p.uv1=eo.getInterpolation(Km,zd,Hd,Gd,Xm,Ym,qm,new We)),o&&(tS.fromBufferAttribute(o,l),nS.fromBufferAttribute(o,u),iS.fromBufferAttribute(o,d),p.normal=eo.getInterpolation(Km,zd,Hd,Gd,tS,nS,iS,new te),p.normal.dot(n.direction)>0&&p.normal.multiplyScalar(-1));const m={a:l,b:u,c:d,normal:new te,materialIndex:0};eo.getNormal(zd,Hd,Gd,m.normal),p.face=m}return p}class Fu extends qt{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const l=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const u=[],d=[],p=[],m=[];let v=0,y=0;x("z","y","x",-1,-1,n,t,e,o,s,0),x("z","y","x",1,-1,n,t,-e,o,s,1),x("x","z","y",1,1,e,n,t,i,o,2),x("x","z","y",1,-1,e,n,-t,i,o,3),x("x","y","z",1,-1,e,t,n,i,s,4),x("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(u),this.setAttribute("position",new Pt(d,3)),this.setAttribute("normal",new Pt(p,3)),this.setAttribute("uv",new Pt(m,2));function x(M,S,w,A,T,R,U,k,N,H,F){const I=R/N,G=U/H,W=R/2,X=U/2,J=k/2,oe=N+1,se=H+1;let fe=0,V=0;const $=new te;for(let Z=0;Z<se;Z++){const O=Z*G-X;for(let j=0;j<oe;j++){const re=j*I-W;$[M]=re*A,$[S]=O*T,$[w]=J,d.push($.x,$.y,$.z),$[M]=0,$[S]=0,$[w]=k>0?1:-1,p.push($.x,$.y,$.z),m.push(j/N),m.push(1-Z/H),fe+=1}}for(let Z=0;Z<H;Z++)for(let O=0;O<N;O++){const j=v+O+oe*Z,re=v+O+oe*(Z+1),ne=v+(O+1)+oe*(Z+1),ie=v+(O+1)+oe*Z;u.push(j,re,ie),u.push(re,ne,ie),V+=6}l.addGroup(y,V,F),y+=V,v+=fe}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function vf(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function Ts(r){const e={};for(let t=0;t<r.length;t++){const n=vf(r[t]);for(const i in n)e[i]=n[i]}return e}function SA(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function wM(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:kn.workingColorSpace}const up={clone:vf,merge:Ts};var bA=`void main() { 45 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 46}`,wA=`void main() { 47 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 48}`;class Vi extends Rr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=bA,this.fragmentShader=wA,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=vf(e.uniforms),this.uniformsGroups=SA(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 i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={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 n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Ap extends In{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Xt,this.projectionMatrix=new Xt,this.projectionMatrixInverse=new Xt,this.coordinateSystem=Ra}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 nc=new te,rS=new We,sS=new We;class ci extends Ap{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,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=gf*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Eu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return gf*2*Math.atan(Math.tan(Eu*.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,n){nc.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(nc.x,nc.y).multiplyScalar(-e/nc.z),nc.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(nc.x,nc.y).multiplyScalar(-e/nc.z)}getViewSize(e,t){return this.getViewBounds(e,rS,sS),t.subVectors(sS,rS)}setViewOffset(e,t,n,i,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=n,this.view.offsetY=i,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(Eu*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const u=o.fullWidth,d=o.fullHeight;s+=o.offsetX*i/u,t-=o.offsetY*n/d,i*=o.width/u,n*=o.height/d}const l=this.filmOffset;l!==0&&(s+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,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 Vd=-90,jd=1;class MM extends In{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ci(Vd,jd,e,t);i.layers=this.layers,this.add(i);const s=new ci(Vd,jd,e,t);s.layers=this.layers,this.add(s);const o=new ci(Vd,jd,e,t);o.layers=this.layers,this.add(o);const l=new ci(Vd,jd,e,t);l.layers=this.layers,this.add(l);const u=new ci(Vd,jd,e,t);u.layers=this.layers,this.add(u);const d=new ci(Vd,jd,e,t);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,o,l,u]=t;for(const d of t)this.remove(d);if(e===Ra)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(e===lp)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const d of t)this.add(d),d.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,l,u,d,p]=this.children,m=e.getRenderTarget(),v=e.getActiveCubeFace(),y=e.getActiveMipmapLevel(),x=e.xr.enabled;e.xr.enabled=!1;const M=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,s),e.setRenderTarget(n,1,i),e.render(t,o),e.setRenderTarget(n,2,i),e.render(t,l),e.setRenderTarget(n,3,i),e.render(t,u),e.setRenderTarget(n,4,i),e.render(t,d),n.texture.generateMipmaps=M,e.setRenderTarget(n,5,i),e.render(t,p),e.setRenderTarget(m,v,y),e.xr.enabled=x,n.texture.needsPMREMUpdate=!0}}class Cp extends di{constructor(e,t,n,i,s,o,l,u,d,p){e=e!==void 0?e:[],t=t!==void 0?t:yl,super(e,t,n,i,s,o,l,u,d,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class EM extends xi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new Cp(i,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:ni}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={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 `},i=new Fu(5,5,5),s=new Vi({name:"CubemapFromEquirect",uniforms:vf(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:dr,blending:Wr});s.uniforms.tEquirect.value=t;const o=new ui(i,s),l=t.minFilter;return t.minFilter===Ca&&(t.minFilter=ni),new MM(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}const hy=new te,MA=new te,EA=new on;class pl{constructor(e=new te(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,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=hy.subVectors(n,t).cross(MA.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 n=e.delta(hy),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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 n=t||EA.getNormalMatrix(e),i=this.coplanarPoint(hy).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.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 iu=new hr,Qm=new te;class Rp{constructor(e=new pl,t=new pl,n=new pl,i=new pl,s=new pl,o=new pl){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const l=this.planes;return l[0].copy(e),l[1].copy(t),l[2].copy(n),l[3].copy(i),l[4].copy(s),l[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Ra){const n=this.planes,i=e.elements,s=i[0],o=i[1],l=i[2],u=i[3],d=i[4],p=i[5],m=i[6],v=i[7],y=i[8],x=i[9],M=i[10],S=i[11],w=i[12],A=i[13],T=i[14],R=i[15];if(n[0].setComponents(u-s,v-d,S-y,R-w).normalize(),n[1].setComponents(u+s,v+d,S+y,R+w).normalize(),n[2].setComponents(u+o,v+p,S+x,R+A).normalize(),n[3].setComponents(u-o,v-p,S-x,R-A).normalize(),n[4].setComponents(u-l,v-m,S-M,R-T).normalize(),t===Ra)n[5].setComponents(u+l,v+m,S+M,R+T).normalize();else if(t===lp)n[5].setComponents(l,m,M,T).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(),iu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),iu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(iu)}intersectsSprite(e){return iu.center.set(0,0,0),iu.radius=.7071067811865476,iu.applyMatrix4(e.matrixWorld),this.intersectsSphere(iu)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Qm.x=i.normal.x>0?e.max.x:e.min.x,Qm.y=i.normal.y>0?e.max.y:e.min.y,Qm.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Qm)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function TM(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function TA(r){const e=new WeakMap;function t(l,u){const d=l.array,p=l.usage,m=d.byteLength,v=r.createBuffer();r.bindBuffer(u,v),r.bufferData(u,d,p),l.onUploadCallback();let y;if(d instanceof Float32Array)y=r.FLOAT;else if(d instanceof Uint16Array)l.isFloat16BufferAttribute?y=r.HALF_FLOAT:y=r.UNSIGNED_SHORT;else if(d instanceof Int16Array)y=r.SHORT;else if(d instanceof Uint32Array)y=r.UNSIGNED_INT;else if(d instanceof Int32Array)y=r.INT;else if(d instanceof Int8Array)y=r.BYTE;else if(d instanceof Uint8Array)y=r.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)y=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:v,type:y,bytesPerElement:d.BYTES_PER_ELEMENT,version:l.version,size:m}}function n(l,u,d){const p=u.array,m=u._updateRange,v=u.updateRanges;if(r.bindBuffer(d,l),m.count===-1&&v.length===0&&r.bufferSubData(d,0,p),v.length!==0){for(let y=0,x=v.length;y<x;y++){const M=v[y];r.bufferSubData(d,M.start*p.BYTES_PER_ELEMENT,p,M.start,M.count)}u.clearUpdateRanges()}m.count!==-1&&(r.bufferSubData(d,m.offset*p.BYTES_PER_ELEMENT,p,m.offset,m.count),m.count=-1),u.onUploadCallback()}function i(l){return l.isInterleavedBufferAttribute&&(l=l.data),e.get(l)}function s(l){l.isInterleavedBufferAttribute&&(l=l.data);const u=e.get(l);u&&(r.deleteBuffer(u.buffer),e.delete(l))}function o(l,u){if(l.isInterleavedBufferAttribute&&(l=l.data),l.isGLBufferAttribute){const p=e.get(l);(!p||p.version<l.version)&&e.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}const d=e.get(l);if(d===void 0)e.set(l,t(l,u));else if(d.version<l.version){if(d.size!==l.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.");n(d.buffer,l,u),d.version=l.version}}return{get:i,remove:s,update:o}}class bl extends qt{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,o=t/2,l=Math.floor(n),u=Math.floor(i),d=l+1,p=u+1,m=e/l,v=t/u,y=[],x=[],M=[],S=[];for(let w=0;w<p;w++){const A=w*v-o;for(let T=0;T<d;T++){const R=T*m-s;x.push(R,-A,0),M.push(0,0,1),S.push(T/l),S.push(1-w/u)}}for(let w=0;w<u;w++)for(let A=0;A<l;A++){const T=A+d*w,R=A+d*(w+1),U=A+1+d*(w+1),k=A+1+d*w;y.push(T,R,k),y.push(R,U,k)}this.setIndex(y),this.setAttribute("position",new Pt(x,3)),this.setAttribute("normal",new Pt(M,3)),this.setAttribute("uv",new Pt(S,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new bl(e.width,e.height,e.widthSegments,e.heightSegments)}}var AA=`#ifdef USE_ALPHAHASH 84 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 85#endif`,CA=`#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`,RA=`#ifdef USE_ALPHAMAP 121 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 122#endif`,PA=`#ifdef USE_ALPHAMAP 123 uniform sampler2D alphaMap; 124#endif`,IA=`#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`,LA=`#ifdef USE_ALPHATEST 132 uniform float alphaTest; 133#endif`,DA=`#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`,UA=`#ifdef USE_AOMAP 147 uniform sampler2D aoMap; 148 uniform float aoMapIntensity; 149#endif`,kA=`#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`,FA=`#ifdef USE_BATCHING 184 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 185#endif`,NA=`vec3 transformed = vec3( position ); 186#ifdef USE_ALPHAHASH 187 vPosition = vec3( position ); 188#endif`,OA=`vec3 objectNormal = vec3( normal ); 189#ifdef USE_TANGENT 190 vec3 objectTangent = vec3( tangent.xyz ); 191#endif`,BA=`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`,zA=`#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`,HA=`#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`,GA=`#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`,VA=`#if NUM_CLIPPING_PLANES > 0 336 varying vec3 vClipPosition; 337 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 338#endif`,jA=`#if NUM_CLIPPING_PLANES > 0 339 varying vec3 vClipPosition; 340#endif`,WA=`#if NUM_CLIPPING_PLANES > 0 341 vClipPosition = - mvPosition.xyz; 342#endif`,XA=`#if defined( USE_COLOR_ALPHA ) 343 diffuseColor *= vColor; 344#elif defined( USE_COLOR ) 345 diffuseColor.rgb *= vColor; 346#endif`,YA=`#if defined( USE_COLOR_ALPHA ) 347 varying vec4 vColor; 348#elif defined( USE_COLOR ) 349 varying vec3 vColor; 350#endif`,qA=`#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`,KA=`#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`,ZA=`#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`,JA=`#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`,QA=`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`,$A=`#ifdef USE_DISPLACEMENTMAP 565 uniform sampler2D displacementMap; 566 uniform float displacementScale; 567 uniform float displacementBias; 568#endif`,eC=`#ifdef USE_DISPLACEMENTMAP 569 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
569placementBias ); 570#endif`,tC=`#ifdef USE_EMISSIVEMAP 571 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 572 totalEmissiveRadiance *= emissiveColor.rgb; 573#endif`,nC=`#ifdef USE_EMISSIVEMAP 574 uniform sampler2D emissiveMap; 575#endif`,iC="gl_FragColor = linearToOutputTexel( gl_FragColor );",rC=` 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}`,sC=`#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`,oC=`#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`,aC=`#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`,lC=`#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`,cC=`#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`,uC=`#ifdef USE_FOG 676 vFogDepth = - mvPosition.z; 677#endif`,dC=`#ifdef USE_FOG 678 varying float vFogDepth; 679#endif`,fC=`#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`,hC=`#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`,pC=`#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}`,mC=`#ifdef USE_LIGHTMAP 708 uniform sampler2D lightMap; 709 uniform float lightMapIntensity; 710#endif`,gC=`LambertMaterial material; 711material.diffuseColor = diffuseColor.rgb; 712material.specularStrength = specularStrength;`,vC=`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`,yC=`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`,xC=`#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`,_C=`ToonMaterial material; 876material.diffuseColor = diffuseColor.rgb;`,SC=`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`,bC=`BlinnPhongMaterial material; 889material.diffuseColor = diffuseColor.rgb; 890material.specularColor = specular; 891material.specularShininess = shininess; 892material.specularStrength = specularStrength;`,wC=`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`,MC=`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`,EC
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}`,
1296TC=` 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`,AC=`#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`,CC=`#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`,RC=`#if defined( USE_LOGDEPTHBUF ) 1436 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1437#endif`,PC=`#if defined( USE_LOGDEPTHBUF ) 1438 uniform float logDepthBufFC; 1439 varying float vFragDepth; 1440 varying float vIsPerspective; 1441#endif`,IC=`#ifdef USE_LOGDEPTHBUF 1442 varying float vFragDepth; 1443 varying float vIsPerspective; 1444#endif`,LC=`#ifdef USE_LOGDEPTHBUF 1445 vFragDepth = 1.0 + gl_Position.w; 1446 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1447#endif`,DC=`#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`,UC=`#ifdef USE_MAP 1455 uniform sampler2D map; 1456#endif`,kC=`#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`,FC=`#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`,NC=`float metalnessFactor = metalness; 1481#ifdef USE_METALNESSMAP 1482 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1483 metalnessFactor *= texelMetalness.b; 1484#endif`,OC=`#ifdef USE_METALNESSMAP 1485 uniform sampler2D metalnessMap; 1486#endif`,BC=`#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`,zC=`#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`,HC=`#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`,GC=`#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`,VC=`#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`,jC=`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;`,WC=`#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`,XC=`#ifndef FLAT_SHADED 1582 varying vec3 vNormal; 1583 #ifdef USE_TANGENT 1584 varying vec3 vTangent; 1585 varying vec3 vBitangent; 1586 #endif 1587#endif`,YC=`#ifndef FLAT_SHADED 1588 varying vec3 vNormal; 1589 #ifdef USE_TANGENT 1590 varying vec3 vTangent; 1591 varying vec3 vBitangent; 1592 #endif 1593#endif`,qC=`#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`,KC=`#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`,ZC=`#ifdef USE_CLEARCOAT 1622 vec3 clearcoatNormal = nonPerturbedNormal; 1623#endif`,JC=`#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`,QC=`#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`,$C=`#ifdef USE_IRIDESCENCEMAP 1637 uniform sampler2D iridescenceMap; 1638#endif 1639#ifdef USE_IRIDESCENCE_THICKNESSMAP 1640 uniform sampler2D iridescenceThicknessMap; 1641#endif`,eR=`#ifdef OPAQUE 1642diffuseColor.a = 1.0; 1643#endif 1644#ifdef USE_TRANSMISSION 1645diffuseColor.a *= material.transmissionAlpha; 1646#endif 1647gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,tR=`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}`,nR=`#ifdef PREMULTIPLIED_ALPHA 1717 gl_FragColor.rgb *= gl_FragColor.a; 1718#endif`,iR=`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;`,rR=`#ifdef DITHERING 1727 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1728#endif`,sR=`#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`,oR=`float roughnessFactor = roughness; 1736#ifdef USE_ROUGHNESSMAP 1737 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1738 roughnessFactor *= texelRoughness.g; 1739#endif`,aR=`#ifdef USE_ROUGHNESSMAP 1740 uniform sampler2D roughnessMap; 1741#endif`,lR=
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`,
1927cR=`#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`,uR=`#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`,dR=`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}`,fR=`#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`,hR=`#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`,pR=`#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`,mR=`#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`,gR=`float specularStrength; 2072#ifdef USE_SPECULARMAP 2073 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2074 specularStrength = texelSpecular.r; 2075#else 2076 specularStrength = 1.0; 2077#endif`,vR=`#ifdef USE_SPECULARMAP 2078 uniform sampler2D specularMap; 2079#endif`,yR=`#if defined( TONE_MAPPING ) 2080 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2081#endif`,xR=`#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; }`,_R=`#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`,SR=`#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`,bR=`#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`,wR=`#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`,MR=`#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`,ER=`#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 TR=`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}`,AR=`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}`,CR=`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}`,RR=`#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}`,PR=`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}`,IR=`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}`,LR=`#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}`,DR=`#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}`,UR=`#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}`,kR=`#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}`,FR=`varying vec3 vWorldDirection; 2751#include <common> 2752void main() { 2753 vWorldDirection = transformDirection( position, modelMatrix ); 2754 #include <begin_vertex> 2755 #include <project_vertex> 2756}`,NR=`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}`,OR=`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}`,BR=`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}`,zR=`#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}`,HR=`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}`,GR=`#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}`,VR=`#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}`,jR=`#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}`,WR=`#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}`,XR=`#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}`,YR=`#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}`,qR=`#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}`,KR=`#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}`,ZR=`#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}`,JR=`#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}`,QR=`#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}`,$R=`#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}`,eP=`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}`,tP=`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}`,nP=`#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}`,iP=`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}`,rP=`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 * vec4( 0.0, 0.0, 0.0, 1.0 ); 3587 vec2 scale; 3588 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 3589 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 3590 #ifndef USE_SIZEATTENUATION 3591 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3592 if ( isPerspective ) scale *= - mvPosition.z; 3593 #endif 3594 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3595 vec2 rotatedPosition; 3596 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3597 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3598 mvPosition.xy += rotatedPosition; 3599 gl_Position = projectionMatrix * mvPosition; 3600 #include <logdepthbuf_vertex> 3601 #include <clipping_planes_vertex> 3602 #include <fog_vertex> 3603}`,sP=`uniform vec3 diffuse; 3604uniform float opacity; 3605#include <common> 3606#include <uv_pars_fragment> 3607#include <map_pars_fragment> 3608#include <alphamap_pars_fragment> 3609#include <alphatest_pars_fragment> 3610#include <alphahash_pars_fragment> 3611#include <fog_pars_fragment> 3612#include <logdepthbuf_pars_fragment> 3613#include <clipping_planes_pars_fragment> 3614void main() { 3615 vec4 diffuseColor = vec4( diffuse, opacity ); 3616 #include <clipping_planes_fragment> 3617 vec3 outgoingLight = vec3( 0.0 ); 3618 #include <logdepthbuf_fragment> 3619 #include <map_fragment> 3620 #include <alphamap_fragment> 3621 #include <alphatest_fragment> 3622 #include <alphahash_fragment> 3623 outgoingLight = diffuseColor.rgb; 3624 #include <opaque_fragment> 3625 #include <tonemapping_fragment> 3626 #include <colorspace_fragment> 3627 #include <fog_fragment> 3628}`,cn={alphahash_fragment:AA,alphahash_pars_fragment:CA,alphamap_fragment:RA,alphamap_pars_fragment:PA,alphatest_fragment:IA,alphatest_pars_fragment:LA,aomap_fragment:DA,aomap_pars_fragment:UA,batching_pars_vertex:kA,batching_vertex:FA,begin_vertex:NA,beginnormal_vertex:OA,bsdfs:BA,iridescence_fragment:zA,bumpmap_pars_fragment:HA,clipping_planes_fragment:GA,clipping_planes_pars_fragment:VA,clipping_planes_pars_vertex:jA,clipping_planes_vertex:WA,color_fragment:XA,color_pars_fragment:YA,color_pars_vertex:qA,color_vertex:KA,common:ZA,cube_uv_reflection_fragment:JA,defaultnormal_vertex:QA,displacementmap_pars_vertex:$A,displacementmap_vertex:eC,emissivemap_fragment:tC,emissivemap_pars_fragment:nC,colorspace_fragment:iC,colorspace_pars_fragment:rC,envmap_fragment:sC,envmap_common_pars_fragment:oC,envmap_pars_fragment:aC,envmap_pars_vertex:lC,envmap_physical_pars_fragment:xC,envmap_vertex:cC,fog_vertex:uC,fog_pars_vertex:dC,fog_fragment:fC,fog_pars_fragment:hC,gradientmap_pars_fragment:pC,lightmap_pars_fragment:mC,lights_lambert_fragment:gC,lights_lambert_pars_fragment:vC,lights_pars_begin:yC,lights_toon_fragment:_C,lights_toon_pars_fragment:SC,lights_phong_fragment:bC,lights_phong_pars_fragment:wC,lights_physical_fragment:MC,lights_physical_pars_fragment:EC,lights_fragment_begin:TC,lights_fragment_maps:AC,lights_fragment_end:CC,logdepthbuf_fragment:RC,logdepthbuf_pars_fragment:PC,logdepthbuf_pars_vertex:IC,logdepthbuf_vertex:LC,map_fragment:DC,map_pars_fragment:UC,map_particle_fragment:kC,map_particle_pars_fragment:FC,metalnessmap_fragment:NC,metalnessmap_pars_fragment:OC,morphinstance_vertex:BC,morphcolor_vertex:zC,morphnormal_vertex:HC,morphtarget_pars_vertex:GC,morphtarget_vertex:VC,normal_fragment_begin:jC,normal_fragment_maps:WC,normal_pars_fragment:XC,normal_pars_vertex:YC,normal_vertex:qC,normalmap_pars_fragment:KC,clearcoat_normal_fragment_begin:ZC,clearcoat_normal_fragment_maps:JC,clearcoat_pars_fragment:QC,iridescence_pars_fragment:$C,opaque_fragment:eR,packing:tR,premultiplied_alpha_fragment:nR,project_vertex:iR,dithering_fragment:rR,dithering_pars_fragment:sR,roughnessmap_fragment:oR,roughnessmap_pars_fragment:aR,shadowmap_pars_fragment:lR,shadowmap_pars_vertex:cR,shadowmap_vertex:uR,shadowmask_pars_fragment:dR,skinbase_vertex:fR,skinning_pars_vertex:hR,skinning_vertex:pR,skinnormal_vertex:mR,specularmap_fragment:gR,specularmap_pars_fragment:vR,tonemapping_fragment:yR,tonemapping_pars_fragment:x
vendor: 4,960 bytes, line 3628
3628R,transmission_fragment:_R,transmission_pars_fragment:SR,uv_pars_fragment:bR,uv_pars_vertex:wR,uv_vertex:MR,worldpos_vertex:ER,background_vert:TR,background_frag:AR,backgroundCube_vert:CR,backgroundCube_frag:RR,cube_vert:PR,cube_frag:IR,depth_vert:LR,depth_frag:DR,distanceRGBA_vert:UR,distanceRGBA_frag:kR,equirect_vert:FR,equirect_frag:NR,linedashed_vert:OR,linedashed_frag:BR,meshbasic_vert:zR,meshbasic_frag:HR,meshlambert_vert:GR,meshlambert_frag:VR,meshmatcap_vert:jR,meshmatcap_frag:WR,meshnormal_vert:XR,meshnormal_frag:YR,meshphong_vert:qR,meshphong_frag:KR,meshphysical_vert:ZR,meshphysical_frag:JR,meshtoon_vert:QR,meshtoon_frag:$R,points_vert:eP,points_frag:tP,shadow_vert:nP,shadow_frag:iP,sprite_vert:rP,sprite_frag:sP},_t={common:{diffuse:{value:new St(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new on},alphaMap:{value:null},alphaMapTransform:{value:new on},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new on}},envmap:{envMap:{value:null},envMapRotation:{value:new on},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new on}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new on}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new on},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new on},normalScale:{value:new We(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new on},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new on}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new on}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new on}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new St(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 St(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new on},alphaTest:{value:0},uvTransform:{value:new on}},sprite:{diffuse:{value:new St(16777215)},opacity:{value:1},center:{value:new We(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new on},alphaMap:{value:null},alphaMapTransform:{value:new on},alphaTest:{value:0}}},Jo={basic:{uniforms:Ts([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.fog]),vertexShader:cn.meshbasic_vert,fragmentShader:cn.meshbasic_frag},lambert:{uniforms:Ts([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,_t.lights,{emissive:{value:new St(0)}}]),vertexShader:cn.meshlambert_vert,fragmentShader:cn.meshlambert_frag},phong:{uniforms:Ts([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,_t.lights,{emissive:{value:new St(0)},specular:{value:new St(1118481)},shininess:{value:30}}]),vertexShader:cn.meshphong_vert,fragmentShader:cn.meshphong_frag},standard:{uniforms:Ts([_t.common,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.roughnessmap,_t.metalnessmap,_t.fog,_t.lights,{emissive:{value:new St(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:cn.meshphysical_vert,fragmentShader:cn.meshphysical_frag},toon:{uniforms:Ts([_t.common,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.gradientmap,_t.fog,_t.lights,{emissive:{value:new St(0)}}]),vertexShader:cn.meshtoon_vert,fragmentShader:cn.meshtoon_frag},matcap:{uniforms:Ts([_t.common,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,{matc
vendor: 5,264 bytes, line 3628
3628ap:{value:null}}]),vertexShader:cn.meshmatcap_vert,fragmentShader:cn.meshmatcap_frag},points:{uniforms:Ts([_t.points,_t.fog]),vertexShader:cn.points_vert,fragmentShader:cn.points_frag},dashed:{uniforms:Ts([_t.common,_t.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:cn.linedashed_vert,fragmentShader:cn.linedashed_frag},depth:{uniforms:Ts([_t.common,_t.displacementmap]),vertexShader:cn.depth_vert,fragmentShader:cn.depth_frag},normal:{uniforms:Ts([_t.common,_t.bumpmap,_t.normalmap,_t.displacementmap,{opacity:{value:1}}]),vertexShader:cn.meshnormal_vert,fragmentShader:cn.meshnormal_frag},sprite:{uniforms:Ts([_t.sprite,_t.fog]),vertexShader:cn.sprite_vert,fragmentShader:cn.sprite_frag},background:{uniforms:{uvTransform:{value:new on},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:cn.background_vert,fragmentShader:cn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new on}},vertexShader:cn.backgroundCube_vert,fragmentShader:cn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:cn.cube_vert,fragmentShader:cn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:cn.equirect_vert,fragmentShader:cn.equirect_frag},distanceRGBA:{uniforms:Ts([_t.common,_t.displacementmap,{referencePosition:{value:new te},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:cn.distanceRGBA_vert,fragmentShader:cn.distanceRGBA_frag},shadow:{uniforms:Ts([_t.lights,_t.fog,{color:{value:new St(0)},opacity:{value:1}}]),vertexShader:cn.shadow_vert,fragmentShader:cn.shadow_frag}};Jo.physical={uniforms:Ts([Jo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new on},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new on},clearcoatNormalScale:{value:new We(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new on},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new on},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new on},sheen:{value:0},sheenColor:{value:new St(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new on},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new on},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new on},transmissionSamplerSize:{value:new We},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new on},attenuationDistance:{value:0},attenuationColor:{value:new St(0)},specularColor:{value:new St(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new on},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new on},anisotropyVector:{value:new We},anisotropyMap:{value:null},anisotropyMapTransform:{value:new on}}]),vertexShader:cn.meshphysical_vert,fragmentShader:cn.meshphysical_frag};const $m={r:0,b:0,g:0},ru=new io,oP=new Xt;function aP(r,e,t,n,i,s,o){const l=new St(0);let u=s===!0?0:1,d,p,m=null,v=0,y=null;function x(A){let T=A.isScene===!0?A.background:null;return T&&T.isTexture&&(T=(A.backgroundBlurriness>0?t:e).get(T)),T}function M(A){let T=!1;const R=x(A);R===null?w(l,u):R&&R.isColor&&(w(R,1),T=!0);const U=r.xr.getEnvironmentBlendMode();U==="additive"?n.buffers.color.setClear(0,0,0,1,o):U==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||T)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function S(A,T){const R=x(T);R&&(R.isCubeTexture||R.mapping===Sf)?(p===void 0&&(p=new ui(new Fu(1,1,1),new Vi({name:"BackgroundCubeMaterial",uniforms:vf(Jo.backgroundCube.uniforms),vertexShader:Jo.backgroundCube.vertexShader,fragmentShader:Jo.backgroundCube.fragmentShader,side:dr,depthTest:!1,depthWrite:!1,fog:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(U,k,N){this.matrixWorld.copyPosition(N.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(p)),ru.copy(T.backgroundRotation),ru.x*=-1,ru.y*=-1,ru.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(ru.y*=-1,ru.z*=-1),p.material.uniforms.envMap.value=R,p.material.uniforms.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=T.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(oP.makeRotationFromEuler(ru)),p.material.toneMapped=kn.getTransfer(R.colorSpace)!==ti,(m!==R||v!==R.version||y!==r.toneMapping)&&(p.material.needsUpdate=!0,m=R,v=R.version,y=r.toneMapping),p.layers.enableAll(),A.unshift(p,p.geometry,p.material,0,0,null)):R&&R.isTexture&&(d===void 0&&(d=new ui(new bl(2,2),new Vi({name:"Backgroun
3628dMaterial",uniforms:vf(Jo.background.uniforms),vertexShader:Jo.background.vertexShader,fragmentShader:Jo.background.fragmentShader,side:Da,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(d)),d.material.uniforms.t2D.value=R,d.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,d.material.toneMapped=kn.getTransfer(R.colorSpace)!==ti,R.matrixAutoUpdate===!0&&R.updateMatrix(),d.material.uniforms.uvTransform.value.copy(R.matrix),(m!==R||v!==R.version||y!==r.toneMapping)&&(d.material.needsUpdate=!0,m=R,v=R.version,y=r.toneMapping),d.layers.enableAll(),A.unshift(d,d.geometry,d.material,0,0,null))}function w(A,T){A.getRGB($m,wM(r)),n.buffers.color.setClear($m.r,$m.g,$m.b,T,o)}return{getClearColor:function(){return l},setClearColor:function(A,T=1){l.set(A),u=T,w(l,u)},getClearAlpha:function(){return u},setClearAlpha:function(A){u=A,w(l,u)},render:M,addToRenderList:S}}function lP(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=v(null);let s=i,o=!1;function l(I,G,W,X,J){let oe=!1;const se=m(X,W,G);s!==se&&(s=se,d(s.object)),oe=y(I,X,W,J),oe&&x(I,X,W,J),J!==null&&e.update(J,r.ELEMENT_ARRAY_BUFFER),(oe||o)&&(o=!1,R(I,G,W,X),J!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(J).buffer))}function u(){return r.createVertexArray()}function d(I){return r.bindVertexArray(I)}function p(I){return r.deleteVertexArray(I)}function m(I,G,W){const X=W.wireframe===!0;let J=n[I.id];J===void 0&&(J={},n[I.id]=J);let oe=J[G.id];oe===void 0&&(oe={},J[G.id]=oe);let se=oe[X];return se===void 0&&(se=v(u()),oe[X]=se),se}function v(I){const G=[],W=[],X=[];for(let J=0;J<t;J++)G[J]=0,W[J]=0,X[J]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:G,enabledAttributes:W,attributeDivisors:X,object:I,attributes:{},index:null}}function y(I,G,W,X){const J=s.attributes,oe=G.attributes;let se=0;const fe=W.getAttributes();for(const V in fe)if(fe[V].location>=0){const Z=J[V];let O=oe[V];if(O===void 0&&(V==="instanceMatrix"&&I.instanceMatrix&&(O=I.instanceMatrix),V==="instanceColor"&&I.instanceColor&&(O=I.instanceColor)),Z===void 0||Z.attribute!==O||O&&Z.data!==O.data)return!0;se++}return s.attributesNum!==se||s.index!==X}function x(I,G,W,X){const J={},oe=G.attributes;let se=0;const fe=W.getAttributes();for(const V in fe)if(fe[V].location>=0){let Z=oe[V];Z===void 0&&(V==="instanceMatrix"&&I.instanceMatrix&&(Z=I.instanceMatrix),V==="instanceColor"&&I.instanceColor&&(Z=I.instanceColor));const O={};O.attribute=Z,Z&&Z.data&&(O.data=Z.data),J[V]=O,se++}s.attributes=J,s.attributesNum=se,s.index=X}function M(){const I=s.newAttributes;for(let G=0,W=I.length;G<W;G++)I[G]=0}function S(I){w(I,0)}function w(I,G){const W=s.newAttributes,X=s.enabledAttributes,J=s.attributeDivisors;W[I]=1,X[I]===0&&(r.enableVertexAttribArray(I),X[I]=1),J[I]!==G&&(r.vertexAttribDivisor(I,G),J[I]=G)}function A(){const I=s.newAttributes,G=s.enabledAttributes;for(let W=0,X=G.length;W<X;W++)G[W]!==I[W]&&(r.disableVertexAttribArray(W),G[W]=0)}function T(I,G,W,X,J,oe,se){se===!0?r.vertexAttribIPointer(I,G,W,J,oe):r.vertexAttribPointer(I,G,W,X,J,oe)}function R(I,G,W,X){M();const J=X.attributes,oe=W.getAttributes(),se=G.defaultAttributeValues;for(const fe in oe){const V=oe[fe];if(V.location>=0){let $=J[fe];if($===void 0&&(fe==="instanceMatrix"&&I.instanceMatrix&&($=I.instanceMatrix),fe==="instanceColor"&&I.instanceColor&&($=I.instanceColor)),$!==void 0){const Z=$.normalized,O=$.itemSize,j=e.get($);if(j===void 0)continue;const re=j.buffer,ne=j.type,ie=j.bytesPerElement,he=ne===r.INT||ne===r.UNSIGNED_INT||$.gpuType===L0;if($.isInterleavedBufferAttribute){const le=$.data,ye=le.stride,ze=$.offset;if(le.isInstancedInterleavedBuffer){for(let Xe=0;Xe<V.locationSize;Xe++)w(V.location+Xe,le.meshPerAttribute);I.isInstancedMesh!==!0&&X._maxInstanceCount===void 0&&(X._maxInstanceCount=le.meshPerAttribute*le.count)}else for(let Xe=0;Xe<V.locationSize;Xe++)S(V.location+Xe);r.bindBuffer(r.ARRAY_BUFFER,re);for(let Xe=0;Xe<V.locationSize;Xe++)T(V.location+Xe,O/V.locationSize,ne,Z,ye*ie,(ze+O/V.locationSize*Xe)*ie,he)}else{if($.isInstancedBufferAttribute){for(let le=0;le<V.locationSize;le++)w(V.location+le,$.meshPerAttribute);I.isInstancedMesh!==!0&&X._maxInstanceCount===void 0&&(X._maxInstanceCount=$.meshPerAttribute*$.count)}else for(let le=0;le<V.locationSize;le++)S(V.location+le);r.bindBuffer(r.ARRAY_BUFFER,re);for(let le=0;le<V.locationSize;le++)T(V.location+le,O/V.locationSize,ne,Z,O*ie,O/V.locationSize*le*ie,he)}}else if(se!==void 0){const Z=se[fe];if(Z!==void 0)switch(Z.length){case 2:r.vertexAttrib2fv(V.location,Z);break;case 3:r.vertexAttrib3fv(V.location,Z);break;case 4:r.vertexAttrib4fv(V.location,Z);break;default:r.vertexAttrib1fv(V.location,Z)}}}}A()}function U(){H();for(const I in n){const G=n[I];for(const W in G){const X=G[W];for(const J in X)p(X[J].object),delete X[J];delete G[W]}delete n[I]}}
vendor: 15,129 bytes, lines 3628-3703
3628function k(I){if(n[I.id]===void 0)return;const G=n[I.id];for(const W in G){const X=G[W];for(const J in X)p(X[J].object),delete X[J];delete G[W]}delete n[I.id]}function N(I){for(const G in n){const W=n[G];if(W[I.id]===void 0)continue;const X=W[I.id];for(const J in X)p(X[J].object),delete X[J];delete W[I.id]}}function H(){F(),o=!0,s!==i&&(s=i,d(s.object))}function F(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:l,reset:H,resetDefaultState:F,dispose:U,releaseStatesOfGeometry:k,releaseStatesOfProgram:N,initAttributes:M,enableAttribute:S,disableUnusedAttributes:A}}function cP(r,e,t){let n;function i(d){n=d}function s(d,p){r.drawArrays(n,d,p),t.update(p,n,1)}function o(d,p,m){m!==0&&(r.drawArraysInstanced(n,d,p,m),t.update(p,n,m))}function l(d,p,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,d,0,p,0,m);let y=0;for(let x=0;x<m;x++)y+=p[x];t.update(y,n,1)}function u(d,p,m,v){if(m===0)return;const y=e.get("WEBGL_multi_draw");if(y===null)for(let x=0;x<d.length;x++)o(d[x],p[x],v[x]);else{y.multiDrawArraysInstancedWEBGL(n,d,0,p,0,v,0,m);let x=0;for(let M=0;M<m;M++)x+=p[M];for(let M=0;M<v.length;M++)t.update(x,n,v[M])}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=l,this.renderMultiDrawInstances=u}function uP(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const k=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(k.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(k){return!(k!==ls&&n.convert(k)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function l(k){const N=k===Uu&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(k!==pr&&n.convert(k)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&k!==as&&!N)}function u(k){if(k==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";k="mediump"}return k==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let d=t.precision!==void 0?t.precision:"highp";const p=u(d);p!==d&&(console.warn("THREE.WebGLRenderer:",d,"not supported, using",p,"instead."),d=p);const m=t.logarithmicDepthBuffer===!0,v=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),y=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),x=r.getParameter(r.MAX_TEXTURE_SIZE),M=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),S=r.getParameter(r.MAX_VERTEX_ATTRIBS),w=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),A=r.getParameter(r.MAX_VARYING_VECTORS),T=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),R=y>0,U=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:u,textureFormatReadable:o,textureTypeReadable:l,precision:d,logarithmicDepthBuffer:m,maxTextures:v,maxVertexTextures:y,maxTextureSize:x,maxCubemapSize:M,maxAttributes:S,maxVertexUniforms:w,maxVaryings:A,maxFragmentUniforms:T,vertexTextures:R,maxSamples:U}}function dP(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new pl,l=new on,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(m,v){const y=m.length!==0||v||n!==0||i;return i=v,n=m.length,y},this.beginShadows=function(){s=!0,p(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(m,v){t=p(m,v,0)},this.setState=function(m,v,y){const x=m.clippingPlanes,M=m.clipIntersection,S=m.clipShadows,w=r.get(m);if(!i||x===null||x.length===0||s&&!S)s?p(null):d();else{const A=s?0:n,T=A*4;let R=w.clippingState||null;u.value=R,R=p(x,v,T,y);for(let U=0;U!==T;++U)R[U]=t[U];w.clippingState=R,this.numIntersection=M?this.numPlanes:0,this.numPlanes+=A}};function d(){u.value!==t&&(u.value=t,u.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function p(m,v,y,x){const M=m!==null?m.length:0;let S=null;if(M!==0){if(S=u.value,x!==!0||S===null){const w=y+M*4,A=v.matrixWorldInverse;l.getNormalMatrix(A),(S===null||S.length<w)&&(S=new Float32Array(w));for(let T=0,R=y;T!==M;++T,R+=4)o.copy(m[T]).applyMatrix4(A,l),o.normal.toArray(S,R),S[R+3]=o.constant}u.value=S,u.needsUpdate=!0}return e.numPlanes=M,e.numIntersection=0,S}}function fP(r){let e=new WeakMap;function t(o,l){return l===Qh?o.mapping=yl:l===$h&&(o.mapping=hc),o}function n(o){if(o&&o.isTexture){const l=o.mapping;if(l===Qh||l===$h)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 d=new EM(u.height);return d.fromEquirectangularTexture(r,o),e.set(o,d),o.addEventListener("dispose",i),t(d.texture,o.mapping)}else return null}}return o}function i(o){const l=o.target;l.removeEventListener("dispose",i);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class ta extends Ap{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,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,n,i,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=n,this.view.offsetY=i,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),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,l=i+t,u=i-t;if(this.view!==null&&this.view.enabled){const d=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=d*this.view.offsetX,o=s+d*this.view.width,l-=p*this.view.offsetY,u=l-p*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,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 lf=4,oS=[.125,.215,.35,.446,.526,.582],yu=20,py=new ta,aS=new St;let my=null,gy=0,vy=0,yy=!1;const vu=(1+Math.sqrt(5))/2,Wd=1/vu,lS=[new te(-vu,Wd,0),new te(vu,Wd,0),new te(-Wd,0,vu),new te(Wd,0,vu),new te(0,vu,-Wd),new te(0,vu,Wd),new te(-1,1,-1),new te(1,1,-1),new te(-1,1,1),new te(1,1,1)];class gx{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,n=.1,i=100){my=this._renderer.getRenderTarget(),gy=this._renderer.getActiveCubeFace(),vy=this._renderer.getActiveMipmapLevel(),yy=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,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=dS(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=uS(),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(my,gy,vy),this._renderer.xr.enabled=yy,e.scissorTest=!1,eg(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===yl||e.mapping===hc?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),my=this._renderer.getRenderTarget(),gy=this._renderer.getActiveCubeFace(),vy=this._renderer.getActiveMipmapLevel(),yy=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:ni,minFilter:ni,generateMipmaps:!1,type:Uu,format:ls,colorSpace:ia,depthBuffer:!1},i=cS(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=cS(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=hP(s)),this._blurMaterial=pP(s,e,t)}return i}_compileMaterial(e){const t=new ui(this._lodPlanes[0],e);this._renderer.compile(t,py)}_sceneToCubeUV(e,t,n,i){const l=new ci(90,1,t,n),u=[1,-1,1,1,1,1],d=[1,1,1,-1,-1,-1],p=this._renderer,m=p.autoClear,v=p.toneMapping;p.getClearColor(aS),p.toneMapping=ea,p.autoClear=!1;const y=new Sl({name:"PMREM.Background",side:dr,depthWrite:!1,depthTest:!1}),x=new ui(new Fu,y);let M=!1;const S=e.background;S?S.isColor&&(y.color.copy(S),e.background=null,M=!0):(y.color.copy(aS),M=!0);for(let w=0;w<6;w++){const A=w%3;A===0?(l.up.set(0,u[w],0),l.lookAt(d[w],0,0)):A===1?(l.up.set(0,0,u[w]),l.lookAt(0,d[w],0)):(l.up.set(0,u[w],0),l.lookAt(0,0,d[w]));const T=this._cubeSize;eg(i,A*T,w>2?T:0,T,T),p.setRenderTarget(i),M&&p.render(x,l),p.render(e,l)}x.geometry.dispose(),x.material.dispose(),p.toneMapping=v,p.autoClear=m,e.background=S}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===yl||e.mapping===hc;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=dS()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=uS());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new ui(this._lodPlanes[0],s),l=s.uniforms;l.envMap.value=e;const u=this._cubeSize;eg(t,0,0,3*u,2*u),n.setRenderTarget(t),n.render(o,py)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),l=lS[(i-s-1)%lS.length];this._blur(e,s-1,s,o,l)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,l){const u=this._renderer,d=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const p=3,m=new ui(this._lodPlanes[i],d),v=d.uniforms,y=this._sizeLods[n]-1,x=isFinite(s)?Math.PI/(2*y):2*Math.PI/(2*yu-1),M=s/x,S=isFinite(s)?1+Math.floor(p*M):yu;S>yu&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${S} samples when the maximum is set to ${yu}`);const w=[];let A=0;for(let N=0;N<yu;++N){const H=N/M,F=Math.exp(-H*H/2);w.push(F),N===0?A+=F:N<S&&(A+=2*F)}for(let N=0;N<w.length;N++)w[N]=w[N]/A;v.envMap.value=e.texture,v.samples.value=S,v.weights.value=w,v.latitudinal.value=o==="latitudinal",l&&(v.poleAxis.value=l);const{_lodMax:T}=this;v.dTheta.value=x,v.mipInt.value=T-n;const R=this._sizeLods[i],U=3*R*(i>T-lf?i-T+lf:0),k=4*(this._cubeSize-R);eg(t,U,k,3*R,2*R),u.setRenderTarget(t),u.render(m,py)}}function hP(r){const e=[],t=[],n=[];let i=r;const s=r-lf+1+oS.length;for(let o=0;o<s;o++){const l=Math.pow(2,i);t.push(l);let u=1/l;o>r-lf?u=oS[o-r+lf-1]:o===0&&(u=0),n.push(u);const d=1/(l-2),p=-d,m=1+d,v=[p,p,m,p,m,m,p,p,m,m,p,m],y=6,x=6,M=3,S=2,w=1,A=new Float32Array(M*x*y),T=new Float32Array(S*x*y),R=new Float32Array(w*x*y);for(let k=0;k<y;k++){const N=k%3*2/3-1,H=k>2?0:-1,F=[N,H,0,N+2/3,H,0,N+2/3,H+1,0,N,H,0,N+2/3,H+1,0,N,H+1,0];A.set(F,M*x*k),T.set(v,S*x*k);const I=[k,k,k,k,k,k];R.set(I,w*x*k)}const U=new qt;U.setAttribute("position",new zn(A,M)),U.setAttribute("uv",new zn(T,S)),U.setAttribute("faceIndex",new zn(R,w)),e.push(U),i>lf&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function cS(r,e,t){const n=new xi(r,e,t);return n.texture.mapping=Sf,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function eg(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function pP(r,e,t){const n=new Float32Array(yu),i=new te(0,1,0);return new Vi({name:"SphericalGaussianBlur",defines:{n:yu,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:h1(),fragmentShader:` 3629 3630 precision mediump float; 3631 precision mediump int; 3632 3633 varying vec3 vOutputDirection; 3634 3635 uniform sampler2D envMap; 3636 uniform int samples; 3637 uniform float weights[ n ]; 3638 uniform bool latitudinal; 3639 uniform float dTheta; 3640 uniform float mipInt; 3641 uniform vec3 poleAxis; 3642 3643 #define ENVMAP_TYPE_CUBE_UV 3644 #include <cube_uv_reflection_fragment> 3645 3646 vec3 getSample( float theta, vec3 axis ) { 3647 3648 float cosTheta = cos( theta ); 3649 // Rodrigues' axis-angle rotation 3650 vec3 sampleDirection = vOutputDirection * cosTheta 3651 + cross( axis, vOutputDirection ) * sin( theta ) 3652 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3653 3654 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3655 3656 } 3657 3658 void main() { 3659 3660 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3661 3662 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3663 3664 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3665 3666 } 3667 3668 axis = normalize( axis ); 3669 3670 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3671 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3672 3673 for ( int i = 1; i < n; i++ ) { 3674 3675 if ( i >= samples ) { 3676 3677 break; 3678 3679 } 3680 3681 float theta = dTheta * float( i ); 3682 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3683 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3684 3685 } 3686 3687 } 3688 `,blending:Wr,depthTest:!1,depthWrite:!1})}function uS(){return new Vi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:h1(),fragmentShader:` 3689 3690 precision mediump float; 3691 precision mediump int; 3692 3693 varying vec3 vOutputDirection; 3694 3695 uniform sampler2D envMap; 3696 3697 #include <common> 3698 3699 void main() { 3700 3701 vec3 outputDirection = normalize( vOutputDirection ); 3702 vec2 uv = equirectUv( outputDirection ); 3703
3704 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3705 3706 } 3707 `,blending:Wr,depthTest:!1,depthWrite:!1})}function dS(){return new Vi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:h1(),fragmentShader:` 3708 3709 precision mediump float; 3710 precision mediump int; 3711 3712 uniform float flipEnvMap; 3713 3714 varying vec3 vOutputDirection; 3715 3716 uniform samplerCube envMap; 3717 3718 void main() { 3719 3720 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3721 3722 } 3723 `,blending:Wr,depthTest:!1,depthWrite:!1})}function h1(){return` 3724 3725 precision mediump float; 3726 precision mediump int; 3727 3728 attribute float faceIndex; 3729 3730 varying vec3 vOutputDirection; 3731 3732 // RH coordinate system; PMREM face-indexing convention 3733 vec3 getDirection( vec2 uv, float face ) { 3734 3735 uv = 2.0 * uv - 1.0; 3736 3737 vec3 direction = vec3( uv, 1.0 ); 3738 3739 if ( face == 0.0 ) { 3740 3741 direction = direction.zyx; // ( 1, v, u ) pos x 3742 3743 } else if ( face == 1.0 ) { 3744 3745 direction = direction.xzy; 3746 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3747 3748 } else if ( face == 2.0 ) { 3749 3750 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3751 3752 } else if ( face == 3.0 ) { 3753 3754 direction = direction.zyx; 3755 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3756 3757 } else if ( face == 4.0 ) { 3758 3759 direction = direction.xzy; 3760 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3761 3762 } else if ( face == 5.0 ) { 3763 3764 direction.z *= -1.0; // ( u, v, -1 ) neg z 3765 3766 } 3767 3768 return direction; 3769 3770 } 3771 3772 void main() { 3773 3774 vOutputDirection = getDirection( uv, faceIndex ); 3775 gl_Position = vec4( position, 1.0 ); 3776 3777 } 3778 `}function mP(r){let e=new WeakMap,t=null;function n(l){if(l&&l.isTexture){const u=l.mapping,d=u===Qh||u===$h,p=u===yl||u===hc;if(d||p){let m=e.get(l);const v=m!==void 0?m.texture.pmremVersion:0;if(l.isRenderTargetTexture&&l.pmremVersion!==v)return t===null&&(t=new gx(r)),m=d?t.fromEquirectangular(l,m):t.fromCubemap(l,m),m.texture.pmremVersion=l.pmremVersion,e.set(l,m),m.texture;if(m!==void 0)return m.texture;{const y=l.image;return d&&y&&y.height>0||p&&y&&i(y)?(t===null&&(t=new gx(r)),m=d?t.fromEquirectangular(l):t.fromCubemap(l),m.texture.pmremVersion=l.pmremVersion,e.set(l,m),l.addEventListener("dispose",s),m.texture):null}}}return l}function i(l){let u=0;const d=6;for(let p=0;p<d;p++)l[p]!==void 0&&u++;return u===d}function s(l){const u=l.target;u.removeEventListener("dispose",s);const d=e.get(u);d!==void 0&&(e.delete(u),d.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function gP(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==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(n){const i=t(n);return i===null&&ff("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function vP(r,e,t,n){const i={},s=new WeakMap;function o(m){const v=m.target;v.index!==null&&e.remove(v.index);for(const x in v.attributes)e.remove(v.attributes[x]);for(const x in v.morphAttributes){const M=v.morphAttributes[x];for(let S=0,w=M.length;S<w;S++)e.remove(M[S])}v.removeEventListener("dispose",o),delete i[v.id];const y=s.get(v);y&&(e.remove(y),s.delete(v)),n.releaseStatesOfGeometry(v),v.isInstancedBufferGeometry===!0&&delete v._maxInstanceCount,t.memory.geometries--}function l(m,v){return i[v.id]===!0||(v.addEventListener("dispose",o),i[v.id]=!0,t.memory.geometries++),v}function u(m){const v=m.attributes;for(const x in v)e.update(v[x],r.ARRAY_BUFFER);const y=m.morphAttributes;for(const x in y){const M=y[x];for(let S=0,w=M.length;S<w;S++)e.update(M[S],r.ARRAY_BUFFER)}}function d(m){const v=[],y=m.index,x=m.attributes.position;let M=0;if(y!==null){const A=y.array;M=y.version;for(let T=0,R=A.length;T<R;T+=3){const U=A[T+0],k=A[T+1],N=A[T+2];v.push(U,k,k,N,N,U)}}else if(x!==void 0){const A=x.array;M=x.version;for(let T=0,R=A.length/3-1;T<R;T+=3){const U=T+0,k=T+1,N=T+2;v.push(U,k,k,N,N,U)}}else return;const S=new(yM(v)?f1:d1)(v,1);S.version=M;const w=s.get(m);w&&e.remove(w),s.set(m,S)}function p(m){const v=s.get(m);
vendor: 11,377 bytes, line 3778
3778if(v){const y=m.index;y!==null&&v.version<y.version&&d(m)}else d(m);return s.get(m)}return{get:l,update:u,getWireframeAttribute:p}}function yP(r,e,t){let n;function i(v){n=v}let s,o;function l(v){s=v.type,o=v.bytesPerElement}function u(v,y){r.drawElements(n,y,s,v*o),t.update(y,n,1)}function d(v,y,x){x!==0&&(r.drawElementsInstanced(n,y,s,v*o,x),t.update(y,n,x))}function p(v,y,x){if(x===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,y,0,s,v,0,x);let S=0;for(let w=0;w<x;w++)S+=y[w];t.update(S,n,1)}function m(v,y,x,M){if(x===0)return;const S=e.get("WEBGL_multi_draw");if(S===null)for(let w=0;w<v.length;w++)d(v[w]/o,y[w],M[w]);else{S.multiDrawElementsInstancedWEBGL(n,y,0,s,v,0,M,0,x);let w=0;for(let A=0;A<x;A++)w+=y[A];for(let A=0;A<M.length;A++)t.update(w,n,M[A])}}this.setMode=i,this.setIndex=l,this.render=u,this.renderInstances=d,this.renderMultiDraw=p,this.renderMultiDrawInstances=m}function xP(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,l){switch(t.calls++,o){case r.TRIANGLES:t.triangles+=l*(s/3);break;case r.LINES:t.lines+=l*(s/2);break;case r.LINE_STRIP:t.lines+=l*(s-1);break;case r.LINE_LOOP:t.lines+=l*s;break;case r.POINTS:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function _P(r,e,t){const n=new WeakMap,i=new fn;function s(o,l,u){const d=o.morphTargetInfluences,p=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,m=p!==void 0?p.length:0;let v=n.get(l);if(v===void 0||v.count!==m){let I=function(){H.dispose(),n.delete(l),l.removeEventListener("dispose",I)};var y=I;v!==void 0&&v.texture.dispose();const x=l.morphAttributes.position!==void 0,M=l.morphAttributes.normal!==void 0,S=l.morphAttributes.color!==void 0,w=l.morphAttributes.position||[],A=l.morphAttributes.normal||[],T=l.morphAttributes.color||[];let R=0;x===!0&&(R=1),M===!0&&(R=2),S===!0&&(R=3);let U=l.attributes.position.count*R,k=1;U>e.maxTextureSize&&(k=Math.ceil(U/e.maxTextureSize),U=e.maxTextureSize);const N=new Float32Array(U*k*4*m),H=new z0(N,U,k,m);H.type=as,H.needsUpdate=!0;const F=R*4;for(let G=0;G<m;G++){const W=w[G],X=A[G],J=T[G],oe=U*k*4*G;for(let se=0;se<W.count;se++){const fe=se*F;x===!0&&(i.fromBufferAttribute(W,se),N[oe+fe+0]=i.x,N[oe+fe+1]=i.y,N[oe+fe+2]=i.z,N[oe+fe+3]=0),M===!0&&(i.fromBufferAttribute(X,se),N[oe+fe+4]=i.x,N[oe+fe+5]=i.y,N[oe+fe+6]=i.z,N[oe+fe+7]=0),S===!0&&(i.fromBufferAttribute(J,se),N[oe+fe+8]=i.x,N[oe+fe+9]=i.y,N[oe+fe+10]=i.z,N[oe+fe+11]=J.itemSize===4?i.w:1)}}v={count:m,texture:H,size:new We(U,k)},n.set(l,v),l.addEventListener("dispose",I)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)u.getUniforms().setValue(r,"morphTexture",o.morphTexture,t);else{let x=0;for(let S=0;S<d.length;S++)x+=d[S];const M=l.morphTargetsRelative?1:1-x;u.getUniforms().setValue(r,"morphTargetBaseInfluence",M),u.getUniforms().setValue(r,"morphTargetInfluences",d)}u.getUniforms().setValue(r,"morphTargetsTexture",v.texture,t),u.getUniforms().setValue(r,"morphTargetsTextureSize",v.size)}return{update:s}}function SP(r,e,t,n){let i=new WeakMap;function s(u){const d=n.render.frame,p=u.geometry,m=e.get(u,p);if(i.get(m)!==d&&(e.update(m),i.set(m,d)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),i.get(u)!==d&&(t.update(u.instanceMatrix,r.ARRAY_BUFFER),u.instanceColor!==null&&t.update(u.instanceColor,r.ARRAY_BUFFER),i.set(u,d))),u.isSkinnedMesh){const v=u.skeleton;i.get(v)!==d&&(v.update(),i.set(v,d))}return m}function o(){i=new WeakMap}function l(u){const d=u.target;d.removeEventListener("dispose",l),t.remove(d.instanceMatrix),d.instanceColor!==null&&t.remove(d.instanceColor)}return{update:s,dispose:o}}class H0 extends di{constructor(e,t,n,i,s,o,l,u,d,p=Mu){if(p!==Mu&&p!==mc)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&p===Mu&&(n=xl),n===void 0&&p===mc&&(n=pc),super(null,i,s,o,l,u,p,n,d),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=l!==void 0?l:yi,this.minFilter=u!==void 0?u:yi,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 AM=new di,fS=new H0(1,1),CM=new z0,RM=new u1,PM=new Cp,hS=[],pS=[],mS=new Float32Array(16),gS=new Float32Array(9),vS=new Float32Array(4);function bf(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=hS[i];if(s===void 0&&(s=new Float32Array(i),hS[i]=s),e!==0){n.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,r[o].toArray(s,l)}return s}function mr(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function gr(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function G0(r,e){let t=pS[e];t===void 0&&(t=new Int32Array(e),pS[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function bP(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function wP(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(mr(t,e))return;r.uniform2fv(this.addr,e),gr(t,e)}}function MP(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.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)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(mr(t,e))return;r.uniform3fv(this.addr,e),gr(t,e)}}function EP(r,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)&&(r.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(mr(t,e))return;r.uniform4fv(this.addr,e),gr(t,e)}}function TP(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(mr(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),gr(t,e)}else{if(mr(t,n))return;vS.set(n),r.uniformMatrix2fv(this.addr,!1,vS),gr(t,n)}}function AP(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(mr(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),gr(t,e)}else{if(mr(t,n))return;gS.set(n),r.uniformMatrix3fv(this.addr,!1,gS),gr(t,n)}}function CP(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(mr(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),gr(t,e)}else{if(mr(t,n))return;mS.set(n),r.uniformMatrix4fv(this.addr,!1,mS),gr(t,n)}}function RP(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function PP(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(mr(t,e))return;r.uniform2iv(this.addr,e),gr(t,e)}}function IP(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(mr(t,e))return;r.uniform3iv(this.addr,e),gr(t,e)}}function LP(r,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)&&(r.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(mr(t,e))return;r.uniform4iv(this.addr,e),gr(t,e)}}function DP(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function UP(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(mr(t,e))return;r.uniform2uiv(this.addr,e),gr(t,e)}}function kP(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(mr(t,e))return;r.uniform3uiv(this.addr,e),gr(t,e)}}function FP(r,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)&&(r.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(mr(t,e))return;r.uniform4uiv(this.addr,e),gr(t,e)}}function NP(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s;this.type===r.SAMPLER_2D_SHADOW?(fS.compareFunction=l1,s=fS):s=AM,t.setTexture2D(e||s,i)}function OP(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||RM,i)}function BP(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||PM,i)}function zP(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||CM,i)}function HP(r){switch(r){case 5126:return bP;case 35664:return wP;case 35665:return MP;case 35666:return EP;case 35674:return TP;case 35675:return AP;case 35676:return CP;case 5124:case 35670:return RP;case 35667:case 35671:return PP;case 35668:case 35672:return IP;case 35669:case 35673:return LP;case 5125:return DP;case 36294:return UP;case 36295:return kP;case 36296:return FP;case 35678:case 36198:case 36298:case 36306:case 35682:return NP;case 35679:case 36299:case 36307:return OP;case 35680:case 36300:case 36308:case 36293:return BP;case 36289:case 36303:case 36311:case 36292:return zP}}function GP(r,e){r.uniform1fv(this.addr,e)}function VP(r,e){const t=bf(e,this.size,2);r.uniform2fv(this.addr,t)}function jP(r,e){const t=bf(e,this.size,3);r.uniform3fv(this.addr,t)}function WP(r,e){const t=bf(e,this.size,4);r.uniform4fv(this.addr,t)}function XP(r,e){const t=bf(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function YP(r,e){const t=bf(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function qP(r,e){const t=bf(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function KP(r,e){r.uniform1iv(this.addr,e)}function ZP(r,e){r.uniform2iv(this.addr,e)}function JP(r,e){r.uniform3iv(this.addr,e)}function QP(r,e){r.uniform4iv(this.addr,e)}function $P(r,e){r.uniform1uiv(this.addr,e)}function eI(r,e){r.uniform2uiv(this.addr,e)}function tI(r,e){r.uniform3uiv(this.addr,e)}function nI(r,e){r.uniform4uiv(this.addr,e)}function iI(r,e,t){const n=this.cache,i=e.length,s=G0(t,i);mr(n,s)||(r.uniform1iv(this.addr,s),gr(n,s));for(let o=0;o!==i;++o)t.setTexture2D(e[o]||AM,s[o])}function rI(r,e,t){const n=this.cache,i=e.length,s=G0(t,i);mr(n,s)||(r.uniform1iv(this.addr,s),gr(n,s));for(let o=0;o!==i;++o)t.setTexture3D(e[o]||RM,s[o])}function sI(r,e,t){const n=this.cache,i=e.length,s=G0(t,i);mr(n,s)||(r.uniform1iv(this.addr,s),gr(n,s));for(let o=0;o!==i;++o)t.setTextureCube(e[o]||PM,s[o])}function oI(r,e,t){const n=this.cache,i=e.length,s=G0(t,i);mr(n,s)||(r.uniform1iv(this.addr,s),gr(n,s));for(let o=0;o!==i;++o)t.setTexture2DArray(e[o]||CM,s[o])}function aI(r){switch(r){case 5126:return GP;case 35664:return VP;case 35665:return jP;case 35666:return WP;case 35674:return XP;case 35675:return YP;case 35676:return qP;case 5124:case 35670:return KP;case 35667:case 35671:return ZP;case 35668:case 35672:return JP;case 35669:case 35673:return QP;case 5125:return $P;case 36294:return eI;case 36295:return tI;case 36296:return nI;case 35678:case 36198:case 36298:case 36306:case 35682:return iI;case 35679:case 36299:case 36307:return rI;case 35680:case 36300:case 36308:case 36293:return sI;case 36289:case 36303:case 36311:case 36292:return oI}}class lI{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=HP(t.type)}}
vendor: 4,132 bytes, lines 3778-3787
3778class cI{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=aI(t.type)}}class uI{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const l=i[s];l.setValue(e,t[l.id],n)}}}const xy=/(\w+)(\])?(\[|\.)?/g;function yS(r,e){r.seq.push(e),r.map[e.id]=e}function dI(r,e,t){const n=r.name,i=n.length;for(xy.lastIndex=0;;){const s=xy.exec(n),o=xy.lastIndex;let l=s[1];const u=s[2]==="]",d=s[3];if(u&&(l=l|0),d===void 0||d==="["&&o+2===i){yS(t,d===void 0?new lI(l,r,e):new cI(l,r,e));break}else{let m=t.map[l];m===void 0&&(m=new uI(l),yS(t,m)),t=m}}}class Gg{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i),o=e.getUniformLocation(t,s.name);dI(s,o,this)}}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,o=t.length;s!==o;++s){const l=t[s],u=n[l.id];u.needsUpdate!==!1&&l.setValue(e,u.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in t&&n.push(o)}return n}}function xS(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const fI=37297;let hI=0;function pI(r,e){const t=r.split(` 3779`),n=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=i;o<s;o++){const l=o+1;n.push(`${l===e?">":" "} ${l}: ${t[o]}`)}return n.join(` 3780`)}function mI(r){const e=kn.getPrimaries(kn.workingColorSpace),t=kn.getPrimaries(r);let n;switch(e===t?n="":e===op&&t===sp?n="LinearDisplayP3ToLinearSRGB":e===sp&&t===op&&(n="LinearSRGBToLinearDisplayP3"),r){case ia:case Tp:return[n,"LinearTransferOETF"];case Bn:case B0:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function _S(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` 3781 3782`+i+` 3783 3784`+pI(r.getShaderSource(e),o)}else return i}function gI(r,e){const t=mI(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function vI(r,e){let t;switch(e){case $w:t="Linear";break;case eM:t="Reinhard";break;case tM:t="Cineon";break;case Zx:t="ACESFilmic";break;case iM:t="AgX";break;case rM:t="Neutral";break;case nM:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const tg=new te;function yI(){kn.getLuminanceCoefficients(tg);const r=tg.x.toFixed(4),e=tg.y.toFixed(4),t=tg.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${r}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` 3785`)}function xI(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Fh).join(` 3786`)}function _I(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` 3787`)}function SI(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),o=s.name;let l=1;s.type===r.FLOAT_MAT2&&(l=2),s.type===r.FLOAT_MAT3&&(l=3),s.type===r.FLOAT_MAT4&&(l=4),t[o]={type:s.type,location:r.getAttribLocation(e,o),locationSize:l}}return t}function Fh(r){return r!==""}function SS(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_L
vendor: 4,357 bytes, lines 3787-3812
3787IGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function bS(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const bI=/^[ \t]*#include +<([\w\d./]+)>/gm;function vx(r){return r.replace(bI,MI)}const wI=new Map;function MI(r,e){let t=cn[e];if(t===void 0){const n=wI.get(e);if(n!==void 0)t=cn[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return vx(t)}const EI=/#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 wS(r){return r.replace(EI,TI)}function TI(r,e,t,n){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function MS(r){let e=`precision ${r.precision} float; 3788 precision ${r.precision} int; 3789 precision ${r.precision} sampler2D; 3790 precision ${r.precision} samplerCube; 3791 precision ${r.precision} sampler3D; 3792 precision ${r.precision} sampler2DArray; 3793 precision ${r.precision} sampler2DShadow; 3794 precision ${r.precision} samplerCubeShadow; 3795 precision ${r.precision} sampler2DArrayShadow; 3796 precision ${r.precision} isampler2D; 3797 precision ${r.precision} isampler3D; 3798 precision ${r.precision} isamplerCube; 3799 precision ${r.precision} isampler2DArray; 3800 precision ${r.precision} usampler2D; 3801 precision ${r.precision} usampler3D; 3802 precision ${r.precision} usamplerCube; 3803 precision ${r.precision} usampler2DArray; 3804 `;return r.precision==="highp"?e+=` 3805#define HIGH_PRECISION`:r.precision==="mediump"?e+=` 3806#define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=` 3807#define LOW_PRECISION`),e}function AI(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===C0?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===Oh?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===Zo&&(e="SHADOWMAP_TYPE_VSM"),e}function CI(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case yl:case hc:e="ENVMAP_TYPE_CUBE";break;case Sf:e="ENVMAP_TYPE_CUBE_UV";break}return e}function RI(r){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case hc:e="ENVMAP_MODE_REFRACTION";break}return e}function PI(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case wp:e="ENVMAP_BLENDING_MULTIPLY";break;case Jw:e="ENVMAP_BLENDING_MIX";break;case Qw:e="ENVMAP_BLENDING_ADD";break}return e}function II(r){const e=r.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function LI(r,e,t,n){const i=r.getContext(),s=t.defines;let o=t.vertexShader,l=t.fragmentShader;const u=AI(t),d=CI(t),p=RI(t),m=PI(t),v=II(t),y=xI(t),x=_I(s),M=i.createProgram();let S,w,A=t.glslVersion?"#version "+t.glslVersion+` 3808`:"";t.isRawShaderMaterial?(S=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(Fh).join(` 3809`),S.length>0&&(S+=` 3810`),w=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(Fh).join(` 3811`),w.length>0&&(w+=` 3812`)):(S=[MS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,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 "+p:"",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
3812IDESCENCEMAP":"",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":"","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",` 3813`].filter(Fh).join(` 3814`),w=[MS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,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 "+d:"",t.envMap?"#define "+p:"",t.envMap?"#define "+m:"",v?"#define CUBEUV_TEXEL_WIDTH "+v.texelWidth:"",v?"#define CUBEUV_TEXEL_HEIGHT "+v.texelHeight:"",v?"#define CUBEUV_MAX_MIP "+v.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
3814IDESCENCE":"",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":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ea?"#define TONE_MAPPING":"",t.toneMapping!==ea?cn.tonemapping_pars_fragment:"",t.toneMapping!==ea?vI("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",cn.colorspace_pars_fragment,gI("linearToOutputTexel",t.outputColorSpace),yI(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 3815`].filter(Fh).join(` 3816`)),o=vx(o),o=SS(o,t),o=bS(o,t),l=vx(l),l=SS(l,t),l=bS(l,t),o=wS(o),l=wS(l),t.isRawShaderMaterial!==!0&&(A=`#version 300 es 3817`,S=[y,"#define attribute in","#define varying out","#define texture2D texture"].join(` 3818`)+` 3819`+S,w=["#define varying in",t.glslVersion===mx?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===mx?"":"#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(` 3820`)+` 3821`+w);const T=A+S+o,R=A+w+l,U=xS(i,i.VERTEX_SHADER,T),k=xS(i,i.FRAGMENT_SHADER,R);i.attachShader(M,U),i.attachShader(M,k),t.index0AttributeName!==void 0?i.bindAttribLocation(M,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(M,0,"position"),i.linkProgram(M);function N(G){if(r.debug.checkShaderErrors){const W=i.getProgramInfoLog(M).trim(),X=i.getShaderInfoLog(U).trim(),J=i.getShaderInfoLog(k).trim();let oe=!0,se=!0;if(i.getProgramParameter(M,i.LINK_STATUS)===!1)if(oe=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,M,U,k);else{const fe=_S(i,U,"vertex"),V=_S(i,k,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(M,i.VALIDATE_STATUS)+` 3822 3823Material Name: `+G.name+` 3824Material Type: `+G.type+` 3825 3826Program Info Log: `+W+` 3827`+fe+` 3828`+V)}else W!==""?console.warn("THREE.WebGLProgram: Program Info Log:",W):(X===""||J==="")&&(se=!1);se&&(G.diagnostics={runnable:oe,programLog:W,vertexShader:{log:X,prefix:S},fragmentShader:{log:J,prefix:w}})}i.deleteShader(U),i.deleteShader(k),H=new Gg(i,M),F=SI(i,M)}let H;this.getUniforms=function(){return H===void 0&&N(this),H};let F;this.getAttributes=function(){return F===void 0&&N(this),F};let I=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return I===!1&&(I=i.getProgramParameter(
vendor: 22,152 bytes, lines 3828-3856
3828M,fI)),I},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(M),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=hI++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=U,this.fragmentShader=k,this}let DI=0;class UI{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.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 n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new kI(e),t.set(e,n)),n}}class kI{constructor(e){this.id=DI++,this.code=e,this.usedTimes=0}}function FI(r,e,t,n,i,s,o){const l=new Tu,u=new UI,d=new Set,p=[],m=i.logarithmicDepthBuffer,v=i.vertexTextures;let y=i.precision;const x={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 M(F){return d.add(F),F===0?"uv":`uv${F}`}function S(F,I,G,W,X){const J=W.fog,oe=X.geometry,se=F.isMeshStandardMaterial?W.environment:null,fe=(F.isMeshStandardMaterial?t:e).get(F.envMap||se),V=fe&&fe.mapping===Sf?fe.image.height:null,$=x[F.type];F.precision!==null&&(y=i.getMaxPrecision(F.precision),y!==F.precision&&console.warn("THREE.WebGLProgram.getParameters:",F.precision,"not supported, using",y,"instead."));const Z=oe.morphAttributes.position||oe.morphAttributes.normal||oe.morphAttributes.color,O=Z!==void 0?Z.length:0;let j=0;oe.morphAttributes.position!==void 0&&(j=1),oe.morphAttributes.normal!==void 0&&(j=2),oe.morphAttributes.color!==void 0&&(j=3);let re,ne,ie,he;if($){const pt=Jo[$];re=pt.vertexShader,ne=pt.fragmentShader}else re=F.vertexShader,ne=F.fragmentShader,u.update(F),ie=u.getVertexShaderID(F),he=u.getFragmentShaderID(F);const le=r.getRenderTarget(),ye=X.isInstancedMesh===!0,ze=X.isBatchedMesh===!0,Xe=!!F.map,Ie=!!F.matcap,Y=!!fe,Ce=!!F.aoMap,Le=!!F.lightMap,Ge=!!F.bumpMap,Ae=!!F.normalMap,$e=!!F.displacementMap,Re=!!F.emissiveMap,He=!!F.metalnessMap,Q=!!F.roughnessMap,B=F.anisotropy>0,pe=F.clearcoat>0,ge=F.dispersion>0,ve=F.iridescence>0,we=F.sheen>0,ut=F.transmission>0,Oe=B&&!!F.anisotropyMap,Qe=pe&&!!F.clearcoatMap,at=pe&&!!F.clearcoatNormalMap,Ke=pe&&!!F.clearcoatRoughnessMap,tt=ve&&!!F.iridescenceMap,wt=ve&&!!F.iridescenceThicknessMap,nt=we&&!!F.sheenColorMap,et=we&&!!F.sheenRoughnessMap,it=!!F.specularMap,ue=!!F.specularColorMap,qe=!!F.specularIntensityMap,ce=ut&&!!F.transmissionMap,Fe=ut&&!!F.thicknessMap,xe=!!F.gradientMap,De=!!F.alphaMap,rt=F.alphaTest>0,mt=!!F.alphaHash,vt=!!F.extensions;let kt=ea;F.toneMapped&&(le===null||le.isXRRenderTarget===!0)&&(kt=r.toneMapping);const Ft={shaderID:$,shaderType:F.type,shaderName:F.name,vertexShader:re,fragmentShader:ne,defines:F.defines,customVertexShaderID:ie,customFragmentShaderID:he,isRawShaderMaterial:F.isRawShaderMaterial===!0,glslVersion:F.glslVersion,precision:y,batching:ze,batchingColor:ze&&X._colorsTexture!==null,instancing:ye,instancingColor:ye&&X.instanceColor!==null,instancingMorph:ye&&X.morphTexture!==null,supportsVertexTextures:v,outputColorSpace:le===null?r.outputColorSpace:le.isXRRenderTarget===!0?le.texture.colorSpace:ia,alphaToCoverage:!!F.alphaToCoverage,map:Xe,matcap:Ie,envMap:Y,envMapMode:Y&&fe.mapping,envMapCubeUVHeight:V,aoMap:Ce,lightMap:Le,bumpMap:Ge,normalMap:Ae,displacementMap:v&&$e,emissiveMap:Re,normalMapObjectSpace:Ae&&F.normalMapType===cM,normalMapTangentSpace:Ae&&F.normalMapType===yc,metalnessMap:He,roughnessMap:Q,anisotropy:B,anisotropyMap:Oe,clearcoat:pe,clearcoatMap:Qe,clearcoatNormalMap:at,clearcoatRoughnessMap:Ke,dispersion:ge,iridescence:ve,iridescenceMap:tt,iridescenceThicknessMap:wt,sheen:we,sheenColorMap:nt,sheenRoughnessMap:et,specularMap:it,specularColorMap:ue,specularIntensityMap:qe,transmission:ut,transmissionMap:ce,thicknessMap:Fe,gradientMap:xe,opaque:F.transparent===!1&&F.blending===wu&&F.alphaToCoverage===!1,alphaMap:De,alphaTest:rt,alphaHash:mt,combine:F.combine,mapUv:Xe&&M(F.map.channel),aoMapUv:Ce&&M(F.aoMap.channel),lightMapUv:Le&&M(F.lightMap.channel),bumpMapUv:Ge&&M(F.bumpMap.channel),normalMapUv:Ae&&M(F.normalMap.channel),displacementMapUv:$e&&M(F.displacementMap.channel),emissiveMapUv:Re&&M(F.emissiveMap.channel),metalnessMapUv:He&&M(F.metalnessMap.channel),roughnessMapUv:Q&&M(F.roughnessMap.channel),anisotropyMapUv:Oe&&M(F.anisotropyMap.channel),clearcoatMapUv:Qe&&M(F.clearcoatMap.channel),clearcoatNormalMapUv:at&&M(F.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ke&&M(F.clearcoatRoughnessMap.channel),iridescenceMapUv:tt&&M(F.iridescenceMap.channel),iridescenceThicknessMapUv:wt&&M(F.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&M(F.sheenColorMap.channel),sheenRoughnessMapUv:et&&M(F.sheenRoughnessMap.channel),specularMapUv:it&&M(F.specularMap.channel),specularColorMapUv:ue&&M(F.specularColorMap.channel),specularIntensityMapUv:qe&&M(F.specularIntensityMap.channel),transmissionMapUv:ce&&M(F.transmissionMap.channel),thicknessMapUv:Fe&&M(F.thicknessMap.channel),alphaMapUv:De&&M(F.alphaMap.channel),vertexTangents:!!oe.attributes.tangent&&(Ae||B),vertexColors:F.vertexColors,vertexAlphas:F.vertexColors===!0&&!!oe.attributes.color&&oe.attributes.color.itemSize===4,pointsUvs:X.isPoints===!0&&!!oe.attributes.uv&&(Xe||De),fog:!!J,useFog:F.fog===!0,fogExp2:!!J&&J.isFogExp2,flatShading:F.flatShading===!0,sizeAttenuation:F.sizeAttenuation===!0,logarithmicDepthBuffer:m,skinning:X.isSkinnedMesh===!0,morphTargets:oe.morphAttributes.position!==void 0,morphNormals:oe.morphAttributes.normal!==void 0,morphColors:oe.morphAttributes.color!==void 0,morphTargetsCount:O,morphTextureStride:j,numDirLights:I.directional.length,numPointLights:I.point.length,numSpotLights:I.spot.length,numSpotLightMaps:I.spotLightMap.length,numRectAreaLights:I.rectArea.length,numHemiLights:I.hemi.length,numDirLightShadows:I.directionalShadowMap.length,numPointLightShadows:I.pointShadowMap.length,numSpotLightShadows:I.spotShadowMap.length,numSpotLightShadowsWithMaps:I.numSpotLightShadowsWithMaps,numLightProbes:I.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:F.dithering,shadowMapEnabled:r.shadowMap.enabled&&G.length>0,shadowMapType:r.shadowMap.type,toneMapping:kt,decodeVideoTexture:Xe&&F.map.isVideoTexture===!0&&kn.getTransfer(F.map.colorSpace)===ti,premultipliedAlpha:F.premultipliedAlpha,doubleSided:F.side===os,flipSided:F.side===dr,useDepthPacking:F.depthPacking>=0,depthPacking:F.depthPacking||0,index0AttributeName:F.index0AttributeName,extensionClipCullDistance:vt&&F.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(vt&&F.extensions.multiDraw===!0||ze)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:F.customProgramCacheKey()};return Ft.vertexUv1s=d.has(1),Ft.vertexUv2s=d.has(2),Ft.vertexUv3s=d.has(3),d.clear(),Ft}function w(F){const I=[];if(F.shaderID?I.push(F.shaderID):(I.push(F.customVertexShaderID),I.push(F.customFragmentShaderID)),F.defines!==void 0)for(const G in F.defines)I.push(G),I.push(F.defines[G]);return F.isRawShaderMaterial===!1&&(A(I,F),T(I,F),I.push(r.outputColorSpace)),I.push(F.customProgramCacheKey),I.join()}function A(F,I){F.push(I.precision),F.push(I.outputColorSpace),F.push(I.envMapMode),F.push(I.envMapCubeUVHeight),F.push(I.mapUv),F.push(I.alphaMapUv),F.push(I.lightMapUv),F.push(I.aoMapUv),F.push(I.bumpMapUv),F.push(I.normalMapUv),F.push(I.displacementMapUv),F.push(I.emissiveMapUv),F.push(I.metalnessMapUv),F.push(I.roughnessMapUv),F.push(I.anisotropyMapUv),F.push(I.clearcoatMapUv),F.push(I.clearcoatNormalMapUv),F.push(I.clearcoatRoughnessMapUv),F.push(I.iridescenceMapUv),F.push(I.iridescenceThicknessMapUv),F.push(I.sheenColorMapUv),F.push(I.sheenRoughnessMapUv),F.push(I.specularMapUv),F.push(I.specularColorMapUv),F.push(I.specularIntensityMapUv),F.push(I.transmissionMapUv),F.push(I.thicknessMapUv),F.push(I.combine),F.push(I.fogExp2),F.push(I.sizeAttenuation),F.push(I.morphTargetsCount),F.push(I.morphAttributeCount),F.push(I.numDirLights),F.push(I.numPointLights),F.push(I.numSpotLights),F.push(I.numSpotLightMaps),F.push(I.numHemiLights),F.push(I.numRectAreaLights),F.push(I.numDirLightShadows),F.push(I.numPointLightShadows),F.push(I.numSpotLightShadows),F.push(I.numSpotLightShadowsWithMaps),F.push(I.numLightProbes),F.push(I.shadowMapType),F.push(I.toneMapping),F.push(I.numClippingPlanes),F.push(I.numClipIntersection),F.push(I.depthPacking)}function T(F,I){l.disableAll(),I.supportsVertexTextures&&l.enable(0),I.instancing&&l.enable(1),I.instancingColor&&l.enable(2),I.instancingMorph&&l.enable(3),I.matcap&&l.enable(4),I.envMap&&l.enable(5),I.normalMapObjectSpace&&l.enable(6),I.normalMapTangentSpace&&l.enable(7),I.clearcoat&&l.enable(8),I.iridescence&&l.enable(9),I.alphaTest&&l.enable(10),I.vertexColors&&l.enable(11),I.vertexAlphas&&l.enable(12),I.vertexUv1s&&l.enable(13),I.vertexUv2s&&l.enable(14),I.vertexUv3s&&l.enable(15),I.vertexTangents&&l.enable(16),I.anisotropy&&l.enable(17),I.alphaHash&&l.enable(18),I.batching&&l.enable(19),I.dispersion&&l.enable(20),I.batchingColor&&l.enable(21),F.push(l.mask),l.disableAll(),I.fog&&l.enable(0),I.useFog&&l.enable(1),I.flatShading&&l.enable(2),I.logarithmicDepthBuffer&&l.enable(3),I.skinning&&l.enable(4),I.morphTargets&&l.enable(5),I.morphNormals&&l.enable(6),I.morphColors&&l.enable(7),I.premultipliedAlpha&&l.enable(8),I.shadowMapEnabled&&l.enable(9),I.doubleSided&&l.enable(10),I.flipSided&&l.enable(11),I.useDepthPacking&&l.enable(12),I.dithering&&l.enable(13),I.transmission&&l.enable(14),I.sheen&&l.enable(15),I.opaque&&l.enable(16),I.pointsUvs&&l.enable(17),I.decodeVideoTexture&&l.enable(18),I.alphaToCoverage&&l.enable(19),F.push(l.mask)}function R(F){const I=x[F.type];let G;if(I){const W=Jo[I];G=up.clone(W.uniforms)}else G=F.uniforms;return G}function U(F,I){let G;for(let W=0,X=p.length;W<X;W++){const J=p[W];if(J.cacheKey===I){G=J,++G.usedTimes;break}}return G===void 0&&(G=new LI(r,I,F,s),p.push(G)),G}function k(F){if(--F.usedTimes===0){const I=p.indexOf(F);p[I]=p[p.length-1],p.pop(),F.destroy()}}function N(F){u.remove(F)}function H(){u.dispose()}return{getParameters:S,getProgramCacheKey:w,getUniforms:R,acquireProgram:U,releaseProgram:k,releaseShaderCache:N,programs:p,dispose:H}}function NI(){let r=new WeakMap;function e(o){return r.has(o)}function t(o){let l=r.get(o);return l===void 0&&(l={},r.set(o,l)),l}function n(o){r.delete(o)}function i(o,l,u){r.get(o)[l]=u}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function OI(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function ES(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function TS(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function o(m,v,y,x,M,S){let w=r[e];return w===void 0?(w={id:m.id,object:m,geometry:v,material:y,groupOrder:x,renderOrder:m.renderOrder,z:M,group:S},r[e]=w):(w.id=m.id,w.object=m,w.geometry=v,w.material=y,w.groupOrder=x,w.renderOrder=m.renderOrder,w.z=M,w.group=S),e++,w}function l(m,v,y,x,M,S){const w=o(m,v,y,x,M,S);y.transmission>0?n.push(w):y.transparent===!0?i.push(w):t.push(w)}function u(m,v,y,x,M,S){const w=o(m,v,y,x,M,S);y.transmission>0?n.unshift(w):y.transparent===!0?i.unshift(w):t.unshift(w)}function d(m,v){t.length>1&&t.sort(m||OI),n.length>1&&n.sort(v||ES),i.length>1&&i.sort(v||ES)}function p(){for(let m=e,v=r.length;m<v;m++){const y=r[m];if(y.id===null)break;y.id=null,y.object=null,y.geometry=null,y.material=null,y.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:l,unshift:u,finish:p,sort:d}}function BI(){let r=new WeakMap;function e(n,i){const s=r.get(n);let o;return s===void 0?(o=new TS,r.set(n,[o])):i>=s.length?(o=new TS,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function zI(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new te,color:new St};break;case"SpotLight":t={position:new te,direction:new te,color:new St,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new te,color:new St,distance:0,decay:0};break;case"HemisphereLight":t={direction:new te,skyColor:new St,groundColor:new St};break;case"RectAreaLight":t={color:new St,position:new te,halfWidth:new te,halfHeight:new te};break}return r[e.id]=t,t}}}function HI(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new We};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new We};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new We,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let GI=0;function VI(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function jI(r){const e=new zI,t=HI(),n={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 d=0;d<9;d++)n.probe.push(new te);const i=new te,s=new Xt,o=new Xt;function l(d){let p=0,m=0,v=0;for(let F=0;F<9;F++)n.probe[F].set(0,0,0);let y=0,x=0,M=0,S=0,w=0,A=0,T=0,R=0,U=0,k=0,N=0;d.sort(VI);for(let F=0,I=d.length;F<I;F++){const G=d[F],W=G.color,X=G.intensity,J=G.distance,oe=G.shadow&&G.shadow.map?G.shadow.map.texture:null;if(G.isAmbientLight)p+=W.r*X,m+=W.g*X,v+=W.b*X;else if(G.isLightProbe){for(let se=0;se<9;se++)n.probe[se].addScaledVector(G.sh.coefficients[se],X);N++}else if(G.isDirectionalLight){const se=e.get(G);if(se.color.copy(G.color).multiplyScalar(G.intensity),G.castShadow){const fe=G.shadow,V=t.get(G);V.shadowIntensity=fe.intensity,V.shadowBias=fe.bias,V.shadowNormalBias=fe.normalBias,V.shadowRadius=fe.radius,V.shadowMapSize=fe.mapSize,n.directionalShadow[y]=V,n.directionalShadowMap[y]=oe,n.directionalShadowMatrix[y]=G.shadow.matrix,A++}n.directional[y]=se,y++}else if(G.isSpotLight){const se=e.get(G);se.position.setFromMatrixPosition(G.matrixWorld),se.color.copy(W).multiplyScalar(X),se.distance=J,se.coneCos=Math.cos(G.angle),se.penumbraCos=Math.cos(G.angle*(1-G.penumbra)),se.decay=G.decay,n.spot[M]=se;const fe=G.shadow;if(G.map&&(n.spotLightMap[U]=G.map,U++,fe.updateMatrices(G),G.castShadow&&k++),n.spotLightMatrix[M]=fe.matrix,G.castShadow){const V=t.get(G);V.shadowIntensity=fe.intensity,V.shadowBias=fe.bias,V.shadowNormalBias=fe.normalBias,V.shadowRadius=fe.radius,V.shadowMapSize=fe.mapSize,n.spotShadow[M]=V,n.spotShadowMap[M]=oe,R++}M++}else if(G.isRectAreaLight){const se=e.get(G);se.color.copy(W).multiplyScalar(X),se.halfWidth.set(G.width*.5,0,0),se.halfHeight.set(0,G.height*.5,0),n.rectArea[S]=se,S++}else if(G.isPointLight){const se=e.get(G);if(se.color.copy(G.color).multiplyScalar(G.intensity),se.distance=G.distance,se.decay=G.decay,G.castShadow){const fe=G.shadow,V=t.get(G);V.shadowIntensity=fe.intensity,V.shadowBias=fe.bias,V.shadowNormalBias=fe.normalBias,V.shadowRadius=fe.radius,V.shadowMapSize=fe.mapSize,V.shadowCameraNear=fe.camera.near,V.shadowCameraFar=fe.camera.far,n.pointShadow[x]=V,n.pointShadowMap[x]=oe,n.pointShadowMatrix[x]=G.shadow.matrix,T++}n.point[x]=se,x++}else if(G.isHemisphereLight){const se=e.get(G);se.skyColor.copy(G.color).multiplyScalar(X),se.groundColor.copy(G.groundColor).multiplyScalar(X),n.hemi[w]=se,w++}}S>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=_t.LTC_FLOAT_1,n.rectAreaLTC2=_t.LTC_FLOAT_2):(n.rectAreaLTC1=_t.LTC_HALF_1,n.rectAreaLTC2=_t.LTC_HALF_2)),n.ambient[0]=p,n.ambient[1]=m,n.ambient[2]=v;const H=n.hash;(H.directionalLength!==y||H.pointLength!==x||H.spotLength!==M||H.rectAreaLength!==S||H.hemiLength!==w||H.numDirectionalShadows!==A||H.numPointShadows!==T||H.numSpotShadows!==R||H.numSpotMaps!==U||H.numLightProbes!==N)&&(n.directional.length=y,n.spot.length=M,n.rectArea.length=S,n.point.length=x,n.hemi.length=w,n.directionalShadow.length=A,n.directionalShadowMap.length=A,n.pointShadow.length=T,n.pointShadowMap.length=T,n.spotShadow.length=R,n.spotShadowMap.length=R,n.directionalShadowMatrix.length=A,n.pointShadowMatrix.length=T,n.spotLightMatrix.length=R+U-k,n.spotLightMap.length=U,n.numSpotLightShadowsWithMaps=k,n.numLightProbes=N,H.directionalLength=y,H.pointLength=x,H.spotLength=M,H.rectAreaLength=S,H.hemiLength=w,H.numDirectionalShadows=A,H.numPointShadows=T,H.numSpotShadows=R,H.numSpotMaps=U,H.numLightProbes=N,n.version=GI++)}function u(d,p){let m=0,v=0,y=0,x=0,M=0;const S=p.matrixWorldInverse;for(let w=0,A=d.length;w<A;w++){const T=d[w];if(T.isDirectionalLight){const R=n.directional[m];R.direction.setFromMatrixPosition(T.matrixWorld),i.setFromMatrixPosition(T.target.matrixWorld),R.direction.sub(i),R.direction.transformDirection(S),m++}else if(T.isSpotLight){const R=n.spot[y];R.position.setFromMatrixPosition(T.matrixWorld),R.position.applyMatrix4(S),R.direction.setFromMatrixPosition(T.matrixWorld),i.setFromMatrixPosition(T.target.matrixWorld),R.direction.sub(i),R.direction.transformDirection(S),y++}else if(T.isRectAreaLight){const R=n.rectArea[x];R.position.setFromMatrixPosition(T.matrixWorld),R.position.applyMatrix4(S),o.identity(),s.copy(T.matrixWorld),s.premultiply(S),o.extractRotation(s),R.halfWidth.set(T.width*.5,0,0),R.halfHeight.set(0,T.height*.5,0),R.halfWidth.applyMatrix4(o),R.halfHeight.applyMatrix4(o),x++}else if(T.isPointLight){const R=n.point[v];R.position.setFromMatrixPosition(T.matrixWorld),R.position.applyMatrix4(S),v++}else if(T.isHemisphereLight){const R=n.hemi[M];R.direction.setFromMatrixPosition(T.matrixWorld),R.direction.transformDirection(S),M++}}}return{setup:l,setupView:u,state:n}}function AS(r){const e=new jI(r),t=[],n=[];function i(p){d.camera=p,t.length=0,n.length=0}function s(p){t.push(p)}function o(p){n.push(p)}function l(){e.setup(t)}function u(p){e.setupView(t,p)}const d={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:d,setupLights:l,setupLightsView:u,pushLight:s,pushShadow:o}}function WI(r){let e=new WeakMap;function t(i,s=0){const o=e.get(i);let l;return o===void 0?(l=new AS(r),e.set(i,[l])):s>=o.length?(l=new AS(r),o.push(l)):l=o[s],l}function n(){e=new WeakMap}return{get:t,dispose:n}}class Pp extends Rr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=na,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 V0 extends Rr{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 XI=`void main() { 3829 gl_Position = vec4( position, 1.0 ); 3830}`,YI=`uniform sampler2D shadow_pass; 3831uniform vec2 resolution; 3832uniform float radius; 3833#include <packing> 3834void main() { 3835 const float samples = float( VSM_SAMPLES ); 3836 float mean = 0.0; 3837 float squared_mean = 0.0; 3838 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 3839 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 3840 for ( float i = 0.0; i < samples; i ++ ) { 3841 float uvOffset = uvStart + i * uvStride; 3842 #ifdef HORIZONTAL_PASS 3843 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 3844 mean += distribution.x; 3845 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 3846 #else 3847 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 3848 mean += depth; 3849 squared_mean += depth * depth; 3850 #endif 3851 } 3852 mean = mean / samples; 3853 squared_mean = squared_mean / samples; 3854 float std_dev = sqrt( squared_mean - mean * mean ); 3855 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 3856}`;function qI(r,e,t){let n=new Rp;const i=new We,s=new We,o=new fn,l=new Pp({depthPacking:Ep}),u=new V0,d={},p=t.maxTextureSize,m={[Da]:dr,[dr]:Da,[os]:os}
vendor: 10,816 bytes, line 3856
3856,v=new Vi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new We},radius:{value:4}},vertexShader:XI,fragmentShader:YI}),y=v.clone();y.defines.HORIZONTAL_PASS=1;const x=new qt;x.setAttribute("position",new zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new ui(x,v),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=C0;let w=this.type;this.render=function(k,N,H){if(S.enabled===!1||S.autoUpdate===!1&&S.needsUpdate===!1||k.length===0)return;const F=r.getRenderTarget(),I=r.getActiveCubeFace(),G=r.getActiveMipmapLevel(),W=r.state;W.setBlending(Wr),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const X=w!==Zo&&this.type===Zo,J=w===Zo&&this.type!==Zo;for(let oe=0,se=k.length;oe<se;oe++){const fe=k[oe],V=fe.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",fe,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;i.copy(V.mapSize);const $=V.getFrameExtents();if(i.multiply($),s.copy(V.mapSize),(i.x>p||i.y>p)&&(i.x>p&&(s.x=Math.floor(p/$.x),i.x=s.x*$.x,V.mapSize.x=s.x),i.y>p&&(s.y=Math.floor(p/$.y),i.y=s.y*$.y,V.mapSize.y=s.y)),V.map===null||X===!0||J===!0){const O=this.type!==Zo?{minFilter:yi,magFilter:yi}:{};V.map!==null&&V.map.dispose(),V.map=new xi(i.x,i.y,O),V.map.texture.name=fe.name+".shadowMap",V.camera.updateProjectionMatrix()}r.setRenderTarget(V.map),r.clear();const Z=V.getViewportCount();for(let O=0;O<Z;O++){const j=V.getViewport(O);o.set(s.x*j.x,s.y*j.y,s.x*j.z,s.y*j.w),W.viewport(o),V.updateMatrices(fe,O),n=V.getFrustum(),R(N,H,V.camera,fe,this.type)}V.isPointLightShadow!==!0&&this.type===Zo&&A(V,H),V.needsUpdate=!1}w=this.type,S.needsUpdate=!1,r.setRenderTarget(F,I,G)};function A(k,N){const H=e.update(M);v.defines.VSM_SAMPLES!==k.blurSamples&&(v.defines.VSM_SAMPLES=k.blurSamples,y.defines.VSM_SAMPLES=k.blurSamples,v.needsUpdate=!0,y.needsUpdate=!0),k.mapPass===null&&(k.mapPass=new xi(i.x,i.y)),v.uniforms.shadow_pass.value=k.map.texture,v.uniforms.resolution.value=k.mapSize,v.uniforms.radius.value=k.radius,r.setRenderTarget(k.mapPass),r.clear(),r.renderBufferDirect(N,null,H,v,M,null),y.uniforms.shadow_pass.value=k.mapPass.texture,y.uniforms.resolution.value=k.mapSize,y.uniforms.radius.value=k.radius,r.setRenderTarget(k.map),r.clear(),r.renderBufferDirect(N,null,H,y,M,null)}function T(k,N,H,F){let I=null;const G=H.isPointLight===!0?k.customDistanceMaterial:k.customDepthMaterial;if(G!==void 0)I=G;else if(I=H.isPointLight===!0?u:l,r.localClippingEnabled&&N.clipShadows===!0&&Array.isArray(N.clippingPlanes)&&N.clippingPlanes.length!==0||N.displacementMap&&N.displacementScale!==0||N.alphaMap&&N.alphaTest>0||N.map&&N.alphaTest>0){const W=I.uuid,X=N.uuid;let J=d[W];J===void 0&&(J={},d[W]=J);let oe=J[X];oe===void 0&&(oe=I.clone(),J[X]=oe,N.addEventListener("dispose",U)),I=oe}if(I.visible=N.visible,I.wireframe=N.wireframe,F===Zo?I.side=N.shadowSide!==null?N.shadowSide:N.side:I.side=N.shadowSide!==null?N.shadowSide:m[N.side],I.alphaMap=N.alphaMap,I.alphaTest=N.alphaTest,I.map=N.map,I.clipShadows=N.clipShadows,I.clippingPlanes=N.clippingPlanes,I.clipIntersection=N.clipIntersection,I.displacementMap=N.displacementMap,I.displacementScale=N.displacementScale,I.displacementBias=N.displacementBias,I.wireframeLinewidth=N.wireframeLinewidth,I.linewidth=N.linewidth,H.isPointLight===!0&&I.isMeshDistanceMaterial===!0){const W=r.properties.get(I);W.light=H}return I}function R(k,N,H,F,I){if(k.visible===!1)return;if(k.layers.test(N.layers)&&(k.isMesh||k.isLine||k.isPoints)&&(k.castShadow||k.receiveShadow&&I===Zo)&&(!k.frustumCulled||n.intersectsObject(k))){k.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,k.matrixWorld);const X=e.update(k),J=k.material;if(Array.isArray(J)){const oe=X.groups;for(let se=0,fe=oe.length;se<fe;se++){const V=oe[se],$=J[V.materialIndex];if($&&$.visible){const Z=T(k,$,F,I);k.onBeforeShadow(r,k,N,H,X,Z,V),r.renderBufferDirect(H,null,X,Z,k,V),k.onAfterShadow(r,k,N,H,X,Z,V)}}}else if(J.visible){const oe=T(k,J,F,I);k.onBeforeShadow(r,k,N,H,X,oe,null),r.renderBufferDirect(H,null,X,oe,k,null),k.onAfterShadow(r,k,N,H,X,oe,null)}}const W=k.children;for(let X=0,J=W.length;X<J;X++)R(W[X],N,H,F,I)}function U(k){k.target.removeEventListener("dispose",U);for(const H in d){const F=d[H],I=k.target.uuid;I in F&&(F[I].dispose(),delete F[I])}}}function KI(r){function e(){let ce=!1;const Fe=new fn;let xe=null;const De=new fn(0,0,0,0);return{setMask:function(rt){xe!==rt&&!ce&&(r.colorMask(rt,rt,rt,rt),xe=rt)},setLocked:function(rt){ce=rt},setClear:function(rt,mt,vt,kt,Ft){Ft===!0&&(rt*=kt,mt*=kt,vt*=kt),Fe.set(rt,mt,vt,kt),De.equals(Fe)===!1&&(r.clearColor(rt,mt,vt,kt),De.copy(Fe))},reset:function(){ce=!1,xe=null,De.set(-1,0,0,0)}}}function t(){let ce=!1,Fe=null,xe=null,De=null;return{setTest:function(rt){rt?he(r.DEPTH_TEST):le(r.DEPTH_TEST)},setMask:function(rt){Fe!==rt&&!ce&&(r.depthMask(rt),Fe=rt)},setFunc:function(rt){if(xe!==rt){switch(rt){case Yx:r.depthFunc(r.NEVER);break;case R0:r.depthFunc(r.ALWAYS);break;case qg:r.depthFunc(r.LESS);break;case pf:r.depthFunc(r.LEQUAL);break;case Jh:r.depthFunc(r.EQUAL);break;case qx:r.depthFunc(r.GEQUAL);break;case Kx:r.depthFunc(r.GREATER);break;case P0:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}xe=rt}},setLocked:function(rt){ce=rt},setClear:function(rt){De!==rt&&(r.clearDepth(rt),De=rt)},reset:function(){ce=!1,Fe=null,xe=null,De=null}}}function n(){let ce=!1,Fe=null,xe=null,De=null,rt=null,mt=null,vt=null,kt=null,Ft=null;return{setTest:function(pt){ce||(pt?he(r.STENCIL_TEST):le(r.STENCIL_TEST))},setMask:function(pt){Fe!==pt&&!ce&&(r.stencilMask(pt),Fe=pt)},setFunc:function(pt,Kt,dn){(xe!==pt||De!==Kt||rt!==dn)&&(r.stencilFunc(pt,Kt,dn),xe=pt,De=Kt,rt=dn)},setOp:function(pt,Kt,dn){(mt!==pt||vt!==Kt||kt!==dn)&&(r.stencilOp(pt,Kt,dn),mt=pt,vt=Kt,kt=dn)},setLocked:function(pt){ce=pt},setClear:function(pt){Ft!==pt&&(r.clearStencil(pt),Ft=pt)},reset:function(){ce=!1,Fe=null,xe=null,De=null,rt=null,mt=null,vt=null,kt=null,Ft=null}}}const i=new e,s=new t,o=new n,l=new WeakMap,u=new WeakMap;let d={},p={},m=new WeakMap,v=[],y=null,x=!1,M=null,S=null,w=null,A=null,T=null,R=null,U=null,k=new St(0,0,0),N=0,H=!1,F=null,I=null,G=null,W=null,X=null;const J=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let oe=!1,se=0;const fe=r.getParameter(r.VERSION);fe.indexOf("WebGL")!==-1?(se=parseFloat(/^WebGL (\d)/.exec(fe)[1]),oe=se>=1):fe.indexOf("OpenGL ES")!==-1&&(se=parseFloat(/^OpenGL ES (\d)/.exec(fe)[1]),oe=se>=2);let V=null,$={};const Z=r.getParameter(r.SCISSOR_BOX),O=r.getParameter(r.VIEWPORT),j=new fn().fromArray(Z),re=new fn().fromArray(O);function ne(ce,Fe,xe,De){const rt=new Uint8Array(4),mt=r.createTexture();r.bindTexture(ce,mt),r.texParameteri(ce,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(ce,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let vt=0;vt<xe;vt++)ce===r.TEXTURE_3D||ce===r.TEXTURE_2D_ARRAY?r.texImage3D(Fe,0,r.RGBA,1,1,De,0,r.RGBA,r.UNSIGNED_BYTE,rt):r.texImage2D(Fe+vt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,rt);return mt}const ie={};ie[r.TEXTURE_2D]=ne(r.TEXTURE_2D,r.TEXTURE_2D,1),ie[r.TEXTURE_CUBE_MAP]=ne(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ie[r.TEXTURE_2D_ARRAY]=ne(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ie[r.TEXTURE_3D]=ne(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),he(r.DEPTH_TEST),s.setFunc(pf),Ge(!1),Ae(cx),he(r.CULL_FACE),Ce(Wr);function he(ce){d[ce]!==!0&&(r.enable(ce),d[ce]=!0)}function le(ce){d[ce]!==!1&&(r.disable(ce),d[ce]=!1)}function ye(ce,Fe){return p[ce]!==Fe?(r.bindFramebuffer(ce,Fe),p[ce]=Fe,ce===r.DRAW_FRAMEBUFFER&&(p[r.FRAMEBUFFER]=Fe),ce===r.FRAMEBUFFER&&(p[r.DRAW_FRAMEBUFFER]=Fe),!0):!1}function ze(ce,Fe){let xe=v,De=!1;if(ce){xe=m.get(Fe),xe===void 0&&(xe=[],m.set(Fe,xe));const rt=ce.textures;if(xe.length!==rt.length||xe[0]!==r.COLOR_ATTACHMENT0){for(let mt=0,vt=rt.length;mt<vt;mt++)xe[mt]=r.COLOR_ATTACHMENT0+mt;xe.length=rt.length,De=!0}}else xe[0]!==r.BACK&&(xe[0]=r.BACK,De=!0);De&&r.drawBuffers(xe)}function Xe(ce){return y!==ce?(r.useProgram(ce),y=ce,!0):!1}const Ie={[uc]:r.FUNC_ADD,[Uw]:r.FUNC_SUBTRACT,[kw]:r.FUNC_REVERSE_SUBTRACT};Ie[Fw]=r.MIN,Ie[Nw]=r.MAX;const Y={[Ow]:r.ZERO,[Bw]:r.ONE,[zw]:r.SRC_COLOR,[Xg]:r.SRC_ALPHA,[Xw]:r.SRC_ALPHA_SATURATE,[jw]:r.DST_COLOR,[Gw]:r.DST_ALPHA,[Hw]:r.ONE_MINUS_SRC_COLOR,[Yg]:r.ONE_MINUS_SRC_ALPHA,[Ww]:r.ONE_MINUS_DST_COLOR,[Vw]:r.ONE_MINUS_DST_ALPHA,[Yw]:r.CONSTANT_COLOR,[qw]:r.ONE_MINUS_CONSTANT_COLOR,[Kw]:r.CONSTANT_ALPHA,[Zw]:r.ONE_MINUS_CONSTANT_ALPHA};function Ce(ce,Fe,xe,De,rt,mt,vt,kt,Ft,pt){if(ce===Wr){x===!0&&(le(r.BLEND),x=!1);return}if(x===!1&&(he(r.BLEND),x=!0),ce!==Dw){if(ce!==M||pt!==H){if((S!==uc||T!==uc)&&(r.blendEquation(r.FUNC_ADD),S=uc,T=uc),pt)switch(ce){case wu:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case ux:r.blendFunc(r.ONE,r.ONE);break;case dx:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case fx:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",ce);break}else switch(ce){case wu:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case ux:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case dx:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case fx:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",ce);break}w=null,A=null,R=null,U=null,k.set(0,0,0),N=0,M=ce,H=pt}return}rt=rt||Fe,mt=mt||xe,vt=vt||De,(Fe!==S||rt!==T)&&(r.blendEquationSeparate(Ie[Fe],Ie[rt]),S=Fe,T=rt),(xe!==w||De!==A||mt!==R||vt!==U)&&(r.blendFuncSeparate(Y[xe],Y[De],Y[mt],Y[vt]),w=xe,A=De,R=mt,U=vt),(kt.equals(k)===!1||Ft!==N)&&(r.blendColor(kt.r,kt.g,kt.b,Ft),k.copy(kt),N=Ft),M=ce,H=!1}function Le(ce,Fe){ce.side===os?le(r.CULL_FACE):he(r.CULL_FACE);let xe=ce.side===dr;Fe&&(xe=!xe),Ge(xe),ce.blending===wu&&ce.transparent===!1?Ce(Wr):Ce(ce.blending,ce.blendEquation,ce.blendSrc,ce.blendDst,ce.blendEquationAlpha,ce.blendSrcAlpha,ce.blendDstAlpha,ce.blendColor,ce.blendAlpha,ce.premultipliedAlpha),s.setFunc(ce.depthFunc),s.setTest(ce.depthTest),s.setMask(ce.depthWrite),i.setMask(ce.colorWrite);const De=ce.stencilWrite;o.setTest(De),De&&(o.setMask(ce.stencilWriteMask),o.setFunc(ce.stencilFunc,ce.stencilRef,ce.stencilFuncMask),o.setOp(ce.stencilFail,ce.stencilZFail,ce.stencilZPass)),Re(ce.polygonOffset,ce.polygonOffsetFactor,ce.polygonOffsetUnits),ce.alphaToCoverage===!0?he(r.SAMPLE_ALPHA_TO_COVERAGE):le(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ge(ce){F!==ce&&(ce?r.frontFace(r.CW):r.frontFace(r.CCW),F=ce)}function Ae(ce){ce!==Pw?(he(r.CULL_FACE),ce!==I&&(ce===cx?r.cullFace(r.BACK):ce===Iw?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):le(r.CULL_FACE),I=ce}function $e(ce){ce!==G&&(oe&&r.lineWidth(ce),G=ce)}
vendor: 7,704 bytes, line 3856
3856function Re(ce,Fe,xe){ce?(he(r.POLYGON_OFFSET_FILL),(W!==Fe||X!==xe)&&(r.polygonOffset(Fe,xe),W=Fe,X=xe)):le(r.POLYGON_OFFSET_FILL)}function He(ce){ce?he(r.SCISSOR_TEST):le(r.SCISSOR_TEST)}function Q(ce){ce===void 0&&(ce=r.TEXTURE0+J-1),V!==ce&&(r.activeTexture(ce),V=ce)}function B(ce,Fe,xe){xe===void 0&&(V===null?xe=r.TEXTURE0+J-1:xe=V);let De=$[xe];De===void 0&&(De={type:void 0,texture:void 0},$[xe]=De),(De.type!==ce||De.texture!==Fe)&&(V!==xe&&(r.activeTexture(xe),V=xe),r.bindTexture(ce,Fe||ie[ce]),De.type=ce,De.texture=Fe)}function pe(){const ce=$[V];ce!==void 0&&ce.type!==void 0&&(r.bindTexture(ce.type,null),ce.type=void 0,ce.texture=void 0)}function ge(){try{r.compressedTexImage2D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function ve(){try{r.compressedTexImage3D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function we(){try{r.texSubImage2D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function ut(){try{r.texSubImage3D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function Oe(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function Qe(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function at(){try{r.texStorage2D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function Ke(){try{r.texStorage3D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function tt(){try{r.texImage2D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function wt(){try{r.texImage3D.apply(r,arguments)}catch(ce){console.error("THREE.WebGLState:",ce)}}function nt(ce){j.equals(ce)===!1&&(r.scissor(ce.x,ce.y,ce.z,ce.w),j.copy(ce))}function et(ce){re.equals(ce)===!1&&(r.viewport(ce.x,ce.y,ce.z,ce.w),re.copy(ce))}function it(ce,Fe){let xe=u.get(Fe);xe===void 0&&(xe=new WeakMap,u.set(Fe,xe));let De=xe.get(ce);De===void 0&&(De=r.getUniformBlockIndex(Fe,ce.name),xe.set(ce,De))}function ue(ce,Fe){const De=u.get(Fe).get(ce);l.get(Fe)!==De&&(r.uniformBlockBinding(Fe,De,ce.__bindingPointIndex),l.set(Fe,De))}function qe(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),d={},V=null,$={},p={},m=new WeakMap,v=[],y=null,x=!1,M=null,S=null,w=null,A=null,T=null,R=null,U=null,k=new St(0,0,0),N=0,H=!1,F=null,I=null,G=null,W=null,X=null,j.set(0,0,r.canvas.width,r.canvas.height),re.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:he,disable:le,bindFramebuffer:ye,drawBuffers:ze,useProgram:Xe,setBlending:Ce,setMaterial:Le,setFlipSided:Ge,setCullFace:Ae,setLineWidth:$e,setPolygonOffset:Re,setScissorTest:He,activeTexture:Q,bindTexture:B,unbindTexture:pe,compressedTexImage2D:ge,compressedTexImage3D:ve,texImage2D:tt,texImage3D:wt,updateUBOMapping:it,uniformBlockBinding:ue,texStorage2D:at,texStorage3D:Ke,texSubImage2D:we,texSubImage3D:ut,compressedTexSubImage2D:Oe,compressedTexSubImage3D:Qe,scissor:nt,viewport:et,reset:qe}}function ZI(r,e){const t=r.image&&r.image.width?r.image.width/r.image.height:1;return t>e?(r.repeat.x=1,r.repeat.y=t/e,r.offset.x=0,r.offset.y=(1-r.repeat.y)/2):(r.repeat.x=e/t,r.repeat.y=1,r.offset.x=(1-r.repeat.x)/2,r.offset.y=0),r}function JI(r,e){const t=r.image&&r.image.width?r.image.width/r.image.height:1;return t>e?(r.repeat.x=e/t,r.repeat.y=1,r.offset.x=(1-r.repeat.x)/2,r.offset.y=0):(r.repeat.x=1,r.repeat.y=t/e,r.offset.x=0,r.offset.y=(1-r.repeat.y)/2),r}function QI(r){return r.repeat.x=1,r.repeat.y=1,r.offset.x=0,r.offset.y=0,r}function yx(r,e,t,n){const i=$I(n);switch(t){case t1:return r*e;case i1:return r*e;case r1:return r*e*2;case k0:return r*e/i.components*i.byteLength;case Mp:return r*e/i.components*i.byteLength;case s1:return r*e*2/i.components*i.byteLength;case F0:return r*e*2/i.components*i.byteLength;case n1:return r*e*3/i.components*i.byteLength;case ls:return r*e*4/i.components*i.byteLength;case N0:return r*e*4/i.components*i.byteLength;case zh:case Hh:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case Gh:case Vh:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Zg:case Qg:return Math.max(r,16)*Math.max(e,8)/4;case Kg:case Jg:return Math.max(r,8)*Math.max(e,8)/2;case $g:case e0:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case t0:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case n0:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case i0:return Math.floor((r+4)/5)*Math.floor((e+3)/4)*16;case r0:return Math.floor((r+4)/5)*Math.floor((e+4)/5)*16;case s0:return Math.floor((r+5)/6)*Math.floor((e+4)/5)*16;case o0:return Math.floor((r+5)/6)*Math.floor((e+5)/6)*16;case a0:return Math.floor((r+7)/8)*Math.floor((e+4)/5)*16;case l0:return Math.floor((r+7)/8)*Math.floor((e+5)/6)*16;case c0:return Math.floor((r+7)/8)*Math.floor((e+7)/8)*16;case u0:return Math.floor((r+9)/10)*Math.floor((e+4)/5)*16;case d0:return Math.floor((r+9)/10)*Math.floor((e+5)/6)*16;case f0:return Math.floor((r+9)/10)*Math.floor((e+7)/8)*16;case h0:return Math.floor((r+9)/10)*Math.floor((e+9)/10)*16;case p0:return Math.floor((r+11)/12)*Math.floor((e+9)/10)*16;case m0:return Math.floor((r+11)/12)*Math.floor((e+11)/12)*16;case jh:case g0:case v0:return Math.ceil(r/4)*Math.ceil(e/4)*16;case o1:case y0:return Math.ceil(r/4)*Math.ceil(e/4)*8;case x0:case _0:return Math.ceil(r/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function $I(r){switch(r){case pr:case Qx:return{byteLength:1,components:1};case mf:case $x:case Uu:return{byteLength:2,components:1};case D0:case U0:return{byteLength:2,components:4};case xl:case L0:case as:return{byteLength:4,components:1};case e1:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${r}.`)}const e3={contain:ZI,cover:JI,fill:QI,getByteLength:yx};function t3(r,e,t,n,i,s,o){const l=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),d=new We,p=new WeakMap;let m;const v=new WeakMap;let y=!1;try{y=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(Q,B){return y?new OffscreenCanvas(Q,B):cp("canvas")}function M(Q,B,pe){let ge=1;const ve=He(Q);if((ve.width>pe||ve.height>pe)&&(ge=pe/Math.max(ve.width,ve.height)),ge<1)if(typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Q instanceof ImageBitmap||typeof VideoFrame<"u"&&Q instanceof VideoFrame){const we=Math.floor(ge*ve.width),ut=Math.floor(ge*ve.height);m===void 0&&(m=x(we,ut));const Oe=B?x(we,ut):m;return Oe.width=we,Oe.height=ut,Oe.getContext("2d").drawImage(Q,0,0,we,ut),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ve.width+"x"+ve.height+") to ("+we+"x"+ut+")."),Oe}
vendor: 5,441 bytes, line 3856
3856else return"data"in Q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ve.width+"x"+ve.height+")."),Q;return Q}function S(Q){return Q.generateMipmaps&&Q.minFilter!==yi&&Q.minFilter!==ni}function w(Q){r.generateMipmap(Q)}function A(Q,B,pe,ge,ve=!1){if(Q!==null){if(r[Q]!==void 0)return r[Q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Q+"'")}let we=B;if(B===r.RED&&(pe===r.FLOAT&&(we=r.R32F),pe===r.HALF_FLOAT&&(we=r.R16F),pe===r.UNSIGNED_BYTE&&(we=r.R8)),B===r.RED_INTEGER&&(pe===r.UNSIGNED_BYTE&&(we=r.R8UI),pe===r.UNSIGNED_SHORT&&(we=r.R16UI),pe===r.UNSIGNED_INT&&(we=r.R32UI),pe===r.BYTE&&(we=r.R8I),pe===r.SHORT&&(we=r.R16I),pe===r.INT&&(we=r.R32I)),B===r.RG&&(pe===r.FLOAT&&(we=r.RG32F),pe===r.HALF_FLOAT&&(we=r.RG16F),pe===r.UNSIGNED_BYTE&&(we=r.RG8)),B===r.RG_INTEGER&&(pe===r.UNSIGNED_BYTE&&(we=r.RG8UI),pe===r.UNSIGNED_SHORT&&(we=r.RG16UI),pe===r.UNSIGNED_INT&&(we=r.RG32UI),pe===r.BYTE&&(we=r.RG8I),pe===r.SHORT&&(we=r.RG16I),pe===r.INT&&(we=r.RG32I)),B===r.RGB&&pe===r.UNSIGNED_INT_5_9_9_9_REV&&(we=r.RGB9_E5),B===r.RGBA){const ut=ve?rp:kn.getTransfer(ge);pe===r.FLOAT&&(we=r.RGBA32F),pe===r.HALF_FLOAT&&(we=r.RGBA16F),pe===r.UNSIGNED_BYTE&&(we=ut===ti?r.SRGB8_ALPHA8:r.RGBA8),pe===r.UNSIGNED_SHORT_4_4_4_4&&(we=r.RGBA4),pe===r.UNSIGNED_SHORT_5_5_5_1&&(we=r.RGB5_A1)}return(we===r.R16F||we===r.R32F||we===r.RG16F||we===r.RG32F||we===r.RGBA16F||we===r.RGBA32F)&&e.get("EXT_color_buffer_float"),we}function T(Q,B){let pe;return Q?B===null||B===xl||B===pc?pe=r.DEPTH24_STENCIL8:B===as?pe=r.DEPTH32F_STENCIL8:B===mf&&(pe=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):B===null||B===xl||B===pc?pe=r.DEPTH_COMPONENT24:B===as?pe=r.DEPTH_COMPONENT32F:B===mf&&(pe=r.DEPTH_COMPONENT16),pe}function R(Q,B){return S(Q)===!0||Q.isFramebufferTexture&&Q.minFilter!==yi&&Q.minFilter!==ni?Math.log2(Math.max(B.width,B.height))+1:Q.mipmaps!==void 0&&Q.mipmaps.length>0?Q.mipmaps.length:Q.isCompressedTexture&&Array.isArray(Q.image)?B.mipmaps.length:1}function U(Q){const B=Q.target;B.removeEventListener("dispose",U),N(B),B.isVideoTexture&&p.delete(B)}function k(Q){const B=Q.target;B.removeEventListener("dispose",k),F(B)}function N(Q){const B=n.get(Q);if(B.__webglInit===void 0)return;const pe=Q.source,ge=v.get(pe);if(ge){const ve=ge[B.__cacheKey];ve.usedTimes--,ve.usedTimes===0&&H(Q),Object.keys(ge).length===0&&v.delete(pe)}n.remove(Q)}function H(Q){const B=n.get(Q);r.deleteTexture(B.__webglTexture);const pe=Q.source,ge=v.get(pe);delete ge[B.__cacheKey],o.memory.textures--}function F(Q){const B=n.get(Q);if(Q.depthTexture&&Q.depthTexture.dispose(),Q.isWebGLCubeRenderTarget)for(let ge=0;ge<6;ge++){if(Array.isArray(B.__webglFramebuffer[ge]))for(let ve=0;ve<B.__webglFramebuffer[ge].length;ve++)r.deleteFramebuffer(B.__webglFramebuffer[ge][ve]);else r.deleteFramebuffer(B.__webglFramebuffer[ge]);B.__webglDepthbuffer&&r.deleteRenderbuffer(B.__webglDepthbuffer[ge])}else{if(Array.isArray(B.__webglFramebuffer))for(let ge=0;ge<B.__webglFramebuffer.length;ge++)r.deleteFramebuffer(B.__webglFramebuffer[ge]);else r.deleteFramebuffer(B.__webglFramebuffer);if(B.__webglDepthbuffer&&r.deleteRenderbuffer(B.__webglDepthbuffer),B.__webglMultisampledFramebuffer&&r.deleteFramebuffer(B.__webglMultisampledFramebuffer),B.__webglColorRenderbuffer)for(let ge=0;ge<B.__webglColorRenderbuffer.length;ge++)B.__webglColorRenderbuffer[ge]&&r.deleteRenderbuffer(B.__webglColorRenderbuffer[ge]);B.__webglDepthRenderbuffer&&r.deleteRenderbuffer(B.__webglDepthRenderbuffer)}const pe=Q.textures;for(let ge=0,ve=pe.length;ge<ve;ge++){const we=n.get(pe[ge]);we.__webglTexture&&(r.deleteTexture(we.__webglTexture),o.memory.textures--),n.remove(pe[ge])}n.remove(Q)}let I=0;function G(){I=0}function W(){const Q=I;return Q>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Q+" texture units while this GPU supports only "+i.maxTextures),I+=1,Q}function X(Q){const B=[];return B.push(Q.wrapS),B.push(Q.wrapT),B.push(Q.wrapR||0),B.push(Q.magFilter),B.push(Q.minFilter),B.push(Q.anisotropy),B.push(Q.internalFormat),B.push(Q.format),B.push(Q.type),B.push(Q.generateMipmaps),B.push(Q.premultiplyAlpha),B.push(Q.flipY),B.push(Q.unpackAlignment),B.push(Q.colorSpace),B.join()}function J(Q,B){const pe=n.get(Q);if(Q.isVideoTexture&&$e(Q),Q.isRenderTargetTexture===!1&&Q.version>0&&pe.__version!==Q.version){const ge=Q.image;if(ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(pe,Q,B);return}}t.bindTexture(r.TEXTURE_2D,pe.__webglTexture,r.TEXTURE0+B)}function oe(Q,B){const pe=n.get(Q);if(Q.version>0&&pe.__version!==Q.version){re(pe,Q,B);return}t.bindTexture(r.TEXTURE_2D_ARRAY,pe.__webglTexture,r.TEXTURE0+B)}function se(Q,B){const pe=n.get(Q);if(Q.version>0&&pe.__version!==Q.version){re(pe,Q,B);return}t.bindTexture(r.TEXTURE_3D,pe.__webglTexture,r.TEXTURE0+B)}function fe(Q,B){const pe=n.get(Q);if(Q.version>0&&pe.__version!==Q.version){ne(pe,Q,B);return}t.bindTexture(r.TEXTURE_CUBE_MAP,pe.__webglTexture,r.TEXTURE0+B)}const V={[ep]:r.REPEAT,[yo]:r.CLAMP_TO_EDGE,[tp]:r.MIRRORED_REPEAT},$={[yi]:r.NEAREST,[Jx]:r.NEAREST_MIPMAP_NEAREST,[of]:r.NEAREST_MIPMAP_LINEAR,[ni]:r.LINEAR,[Bh]:r.LINEAR_MIPMAP_NEAREST,[Ca]:r.LINEAR_MIPMAP_LINEAR}
vendor: 2,117 bytes, line 3856
3856,Z={[uM]:r.NEVER,[gM]:r.ALWAYS,[dM]:r.LESS,[l1]:r.LEQUAL,[fM]:r.EQUAL,[mM]:r.GEQUAL,[hM]:r.GREATER,[pM]:r.NOTEQUAL};function O(Q,B){if(B.type===as&&e.has("OES_texture_float_linear")===!1&&(B.magFilter===ni||B.magFilter===Bh||B.magFilter===of||B.magFilter===Ca||B.minFilter===ni||B.minFilter===Bh||B.minFilter===of||B.minFilter===Ca)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Q,r.TEXTURE_WRAP_S,V[B.wrapS]),r.texParameteri(Q,r.TEXTURE_WRAP_T,V[B.wrapT]),(Q===r.TEXTURE_3D||Q===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Q,r.TEXTURE_WRAP_R,V[B.wrapR]),r.texParameteri(Q,r.TEXTURE_MAG_FILTER,$[B.magFilter]),r.texParameteri(Q,r.TEXTURE_MIN_FILTER,$[B.minFilter]),B.compareFunction&&(r.texParameteri(Q,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Q,r.TEXTURE_COMPARE_FUNC,Z[B.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(B.magFilter===yi||B.minFilter!==of&&B.minFilter!==Ca||B.type===as&&e.has("OES_texture_float_linear")===!1)return;if(B.anisotropy>1||n.get(B).__currentAnisotropy){const pe=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Q,pe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(B.anisotropy,i.getMaxAnisotropy())),n.get(B).__currentAnisotropy=B.anisotropy}}}function j(Q,B){let pe=!1;Q.__webglInit===void 0&&(Q.__webglInit=!0,B.addEventListener("dispose",U));const ge=B.source;let ve=v.get(ge);ve===void 0&&(ve={},v.set(ge,ve));const we=X(B);if(we!==Q.__cacheKey){ve[we]===void 0&&(ve[we]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,pe=!0),ve[we].usedTimes++;const ut=ve[Q.__cacheKey];ut!==void 0&&(ve[Q.__cacheKey].usedTimes--,ut.usedTimes===0&&H(B)),Q.__cacheKey=we,Q.__webglTexture=ve[we].texture}return pe}function re(Q,B,pe){let ge=r.TEXTURE_2D;(B.isDataArrayTexture||B.isCompressedArrayTexture)&&(ge=r.TEXTURE_2D_ARRAY),B.isData3DTexture&&(ge=r.TEXTURE_3D);const ve=j(Q,B),we=B.source;t.bindTexture(ge,Q.__webglTexture,r.TEXTURE0+pe);const ut=n.get(we);if(we.version!==ut.__version||ve===!0){t.activeTexture(r.TEXTURE0+pe);
vendor: 4,101 bytes, line 3856
3856const Oe=kn.getPrimaries(kn.workingColorSpace),Qe=B.colorSpace===Qo?null:kn.getPrimaries(B.colorSpace),at=B.colorSpace===Qo||Oe===Qe?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,B.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,B.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,at);let Ke=M(B.image,!1,i.maxTextureSize);Ke=Re(B,Ke);const tt=s.convert(B.format,B.colorSpace),wt=s.convert(B.type);let nt=A(B.internalFormat,tt,wt,B.colorSpace,B.isVideoTexture);O(ge,B);let et;const it=B.mipmaps,ue=B.isVideoTexture!==!0,qe=ut.__version===void 0||ve===!0,ce=we.dataReady,Fe=R(B,Ke);if(B.isDepthTexture)nt=T(B.format===mc,B.type),qe&&(ue?t.texStorage2D(r.TEXTURE_2D,1,nt,Ke.width,Ke.height):t.texImage2D(r.TEXTURE_2D,0,nt,Ke.width,Ke.height,0,tt,wt,null));else if(B.isDataTexture)if(it.length>0){ue&&qe&&t.texStorage2D(r.TEXTURE_2D,Fe,nt,it[0].width,it[0].height);for(let xe=0,De=it.length;xe<De;xe++)et=it[xe],ue?ce&&t.texSubImage2D(r.TEXTURE_2D,xe,0,0,et.width,et.height,tt,wt,et.data):t.texImage2D(r.TEXTURE_2D,xe,nt,et.width,et.height,0,tt,wt,et.data);B.generateMipmaps=!1}else ue?(qe&&t.texStorage2D(r.TEXTURE_2D,Fe,nt,Ke.width,Ke.height),ce&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Ke.width,Ke.height,tt,wt,Ke.data)):t.texImage2D(r.TEXTURE_2D,0,nt,Ke.width,Ke.height,0,tt,wt,Ke.data);else if(B.isCompressedTexture)if(B.isCompressedArrayTexture){ue&&qe&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Fe,nt,it[0].width,it[0].height,Ke.depth);for(let xe=0,De=it.length;xe<De;xe++)if(et=it[xe],B.format!==ls)if(tt!==null)if(ue){if(ce)if(B.layerUpdates.size>0){const rt=yx(et.width,et.height,B.format,B.type);for(const mt of B.layerUpdates){const vt=et.data.subarray(mt*rt/et.data.BYTES_PER_ELEMENT,(mt+1)*rt/et.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,xe,0,0,mt,et.width,et.height,1,tt,vt,0,0)}B.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,xe,0,0,0,et.width,et.height,Ke.depth,tt,et.data,0,0)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,xe,nt,et.width,et.height,Ke.depth,0,et.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ue?ce&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,xe,0,0,0,et.width,et.height,Ke.depth,tt,wt,et.data):t.texImage3D(r.TEXTURE_2D_ARRAY,xe,nt,et.width,et.height,Ke.depth,0,tt,wt,et.data)}else{ue&&qe&&t.texStorage2D(r.TEXTURE_2D,Fe,nt,it[0].width,it[0].height);for(let xe=0,De=it.length;xe<De;xe++)et=it[xe],B.format!==ls?tt!==null?ue?ce&&t.compressedTexSubImage2D(r.TEXTURE_2D,xe,0,0,et.width,et.height,tt,et.data):t.compressedTexImage2D(r.TEXTURE_2D,xe,nt,et.width,et.height,0,et.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ue?ce&&t.texSubImage2D(r.TEXTURE_2D,xe,0,0,et.width,et.height,tt,wt,et.data):t.texImage2D(r.TEXTURE_2D,xe,nt,et.width,et.height,0,tt,wt,et.data)}else if(B.isDataArrayTexture)if(ue){if(qe&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Fe,nt,Ke.width,Ke.height,Ke.depth),ce)if(B.layerUpdates.size>0){const xe=yx(Ke.width,Ke.height,B.format,B.type);for(const De of B.layerUpdates){const rt=Ke.data.subarray(De*xe/Ke.data.BYTES_PER_ELEMENT,(De+1)*xe/Ke.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,De,Ke.width,Ke.height,1,tt,wt,rt)}B.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,Ke.width,Ke.height,Ke.depth,tt,wt,Ke.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,nt,Ke.width,Ke.height,Ke.depth,0,tt,wt,Ke.data);else if(B.isData3DTexture)ue?(qe&&t.texStorage3D(r.TEXTURE_3D,Fe,nt,Ke.width,Ke.height,Ke.depth),ce&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,Ke.width,Ke.height,Ke.depth,tt,wt,Ke.data)):t.texImage3D(r.TEXTURE_3D,0,nt,Ke.width,Ke.height,Ke.depth,0,tt,wt,Ke.data);else if(B.isFramebufferTexture){if(qe)if(ue)t.texStorage2D(r.TEXTURE_2D,Fe,nt,Ke.width,Ke.height);else{let xe=Ke.width,De=Ke.height;for(let rt=0;rt<Fe;rt++)t.texImage2D(r.TEXTURE_2D,rt,nt,xe,De,0,tt,wt,null),xe>>=1,De>>=1}}else if(it.length>0){if(ue&&qe){const xe=He(it[0]);
vendor: 5,001 bytes, line 3856
3856t.texStorage2D(r.TEXTURE_2D,Fe,nt,xe.width,xe.height)}for(let xe=0,De=it.length;xe<De;xe++)et=it[xe],ue?ce&&t.texSubImage2D(r.TEXTURE_2D,xe,0,0,tt,wt,et):t.texImage2D(r.TEXTURE_2D,xe,nt,tt,wt,et);B.generateMipmaps=!1}else if(ue){if(qe){const xe=He(Ke);t.texStorage2D(r.TEXTURE_2D,Fe,nt,xe.width,xe.height)}ce&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,tt,wt,Ke)}else t.texImage2D(r.TEXTURE_2D,0,nt,tt,wt,Ke);S(B)&&w(ge),ut.__version=we.version,B.onUpdate&&B.onUpdate(B)}Q.__version=B.version}function ne(Q,B,pe){if(B.image.length!==6)return;const ge=j(Q,B),ve=B.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Q.__webglTexture,r.TEXTURE0+pe);const we=n.get(ve);if(ve.version!==we.__version||ge===!0){t.activeTexture(r.TEXTURE0+pe);const ut=kn.getPrimaries(kn.workingColorSpace),Oe=B.colorSpace===Qo?null:kn.getPrimaries(B.colorSpace),Qe=B.colorSpace===Qo||ut===Oe?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,B.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,B.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Qe);const at=B.isCompressedTexture||B.image[0].isCompressedTexture,Ke=B.image[0]&&B.image[0].isDataTexture,tt=[];for(let De=0;De<6;De++)!at&&!Ke?tt[De]=M(B.image[De],!0,i.maxCubemapSize):tt[De]=Ke?B.image[De].image:B.image[De],tt[De]=Re(B,tt[De]);const wt=tt[0],nt=s.convert(B.format,B.colorSpace),et=s.convert(B.type),it=A(B.internalFormat,nt,et,B.colorSpace),ue=B.isVideoTexture!==!0,qe=we.__version===void 0||ge===!0,ce=ve.dataReady;let Fe=R(B,wt);O(r.TEXTURE_CUBE_MAP,B);let xe;if(at){ue&&qe&&t.texStorage2D(r.TEXTURE_CUBE_MAP,Fe,it,wt.width,wt.height);for(let De=0;De<6;De++){xe=tt[De].mipmaps;for(let rt=0;rt<xe.length;rt++){const mt=xe[rt];B.format!==ls?nt!==null?ue?ce&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,rt,0,0,mt.width,mt.height,nt,mt.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,rt,it,mt.width,mt.height,0,mt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ue?ce&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,rt,0,0,mt.width,mt.height,nt,et,mt.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,rt,it,mt.width,mt.height,0,nt,et,mt.data)}}}else{if(xe=B.mipmaps,ue&&qe){xe.length>0&&Fe++;const De=He(tt[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,Fe,it,De.width,De.height)}for(let De=0;De<6;De++)if(Ke){ue?ce&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,0,0,tt[De].width,tt[De].height,nt,et,tt[De].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,it,tt[De].width,tt[De].height,0,nt,et,tt[De].data);for(let rt=0;rt<xe.length;rt++){const vt=xe[rt].image[De].image;ue?ce&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,rt+1,0,0,vt.width,vt.height,nt,et,vt.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,rt+1,it,vt.width,vt.height,0,nt,et,vt.data)}}else{ue?ce&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,0,0,nt,et,tt[De]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,it,nt,et,tt[De]);for(let rt=0;rt<xe.length;rt++){const mt=xe[rt];ue?ce&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,rt+1,0,0,nt,et,mt.image[De]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+De,rt+1,it,nt,et,mt.image[De])}}}S(B)&&w(r.TEXTURE_CUBE_MAP),we.__version=ve.version,B.onUpdate&&B.onUpdate(B)}Q.__version=B.version}function ie(Q,B,pe,ge,ve,we){const ut=s.convert(pe.format,pe.colorSpace),Oe=s.convert(pe.type),Qe=A(pe.internalFormat,ut,Oe,pe.colorSpace);if(!n.get(B).__hasExternalTextures){const Ke=Math.max(1,B.width>>we),tt=Math.max(1,B.height>>we);ve===r.TEXTURE_3D||ve===r.TEXTURE_2D_ARRAY?t.texImage3D(ve,we,Qe,Ke,tt,B.depth,0,ut,Oe,null):t.texImage2D(ve,we,Qe,Ke,tt,0,ut,Oe,null)}t.bindFramebuffer(r.FRAMEBUFFER,Q),Ae(B)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ge,ve,n.get(pe).__webglTexture,0,Ge(B)):(ve===r.TEXTURE_2D||ve>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&ve<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,ge,ve,n.get(pe).__webglTexture,we),t.bindFramebuffer(r.FRAMEBUFFER,null)}function he(Q,B,pe){if(r.bindRenderbuffer(r.RENDERBUFFER,Q),B.depthBuffer){const ge=B.depthTexture,ve=ge&&ge.isDepthTexture?ge.type:null,we=T(B.stencilBuffer,ve),ut=B.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Oe=Ge(B);Ae(B)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Oe,we,B.width,B.height):pe?r.renderbufferStorageMultisample(r.RENDERBUFFER,Oe,we,B.width,B.height):r.renderbufferStorage(r.RENDERBUFFER,we,B.width,B.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,ut,r.RENDERBUFFER,Q)}else{const ge=B.textures;for(let ve=0;ve<ge.length;ve++){const we=ge[ve],ut=s.convert(we.format,we.colorSpace),Oe=s.convert(we.type),Qe=A(we.internalFormat,ut,Oe,we.colorSpace),at=Ge(B);pe&&Ae(B)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,at,Qe,B.width,B.height):Ae(B)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,at,Qe,B.width,B.height):r.renderbufferStorage(r.RENDERBUFFER,Qe,B.width,B.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}
vendor: 12,933 bytes, line 3856
3856function le(Q,B){if(B&&B.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Q),!(B.depthTexture&&B.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(B.depthTexture).__webglTexture||B.depthTexture.image.width!==B.width||B.depthTexture.image.height!==B.height)&&(B.depthTexture.image.width=B.width,B.depthTexture.image.height=B.height,B.depthTexture.needsUpdate=!0),J(B.depthTexture,0);const ge=n.get(B.depthTexture).__webglTexture,ve=Ge(B);if(B.depthTexture.format===Mu)Ae(B)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ge,0,ve):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ge,0);else if(B.depthTexture.format===mc)Ae(B)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ge,0,ve):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ge,0);else throw new Error("Unknown depthTexture format")}function ye(Q){const B=n.get(Q),pe=Q.isWebGLCubeRenderTarget===!0;if(B.__boundDepthTexture!==Q.depthTexture){const ge=Q.depthTexture;if(B.__depthDisposeCallback&&B.__depthDisposeCallback(),ge){const ve=()=>{delete B.__boundDepthTexture,delete B.__depthDisposeCallback,ge.removeEventListener("dispose",ve)};ge.addEventListener("dispose",ve),B.__depthDisposeCallback=ve}B.__boundDepthTexture=ge}if(Q.depthTexture&&!B.__autoAllocateDepthBuffer){if(pe)throw new Error("target.depthTexture not supported in Cube render targets");le(B.__webglFramebuffer,Q)}else if(pe){B.__webglDepthbuffer=[];for(let ge=0;ge<6;ge++)if(t.bindFramebuffer(r.FRAMEBUFFER,B.__webglFramebuffer[ge]),B.__webglDepthbuffer[ge]===void 0)B.__webglDepthbuffer[ge]=r.createRenderbuffer(),he(B.__webglDepthbuffer[ge],Q,!1);else{const ve=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,we=B.__webglDepthbuffer[ge];r.bindRenderbuffer(r.RENDERBUFFER,we),r.framebufferRenderbuffer(r.FRAMEBUFFER,ve,r.RENDERBUFFER,we)}}else if(t.bindFramebuffer(r.FRAMEBUFFER,B.__webglFramebuffer),B.__webglDepthbuffer===void 0)B.__webglDepthbuffer=r.createRenderbuffer(),he(B.__webglDepthbuffer,Q,!1);else{const ge=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ve=B.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,ve),r.framebufferRenderbuffer(r.FRAMEBUFFER,ge,r.RENDERBUFFER,ve)}t.bindFramebuffer(r.FRAMEBUFFER,null)}function ze(Q,B,pe){const ge=n.get(Q);B!==void 0&&ie(ge.__webglFramebuffer,Q,Q.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),pe!==void 0&&ye(Q)}function Xe(Q){const B=Q.texture,pe=n.get(Q),ge=n.get(B);Q.addEventListener("dispose",k);const ve=Q.textures,we=Q.isWebGLCubeRenderTarget===!0,ut=ve.length>1;if(ut||(ge.__webglTexture===void 0&&(ge.__webglTexture=r.createTexture()),ge.__version=B.version,o.memory.textures++),we){pe.__webglFramebuffer=[];for(let Oe=0;Oe<6;Oe++)if(B.mipmaps&&B.mipmaps.length>0){pe.__webglFramebuffer[Oe]=[];for(let Qe=0;Qe<B.mipmaps.length;Qe++)pe.__webglFramebuffer[Oe][Qe]=r.createFramebuffer()}else pe.__webglFramebuffer[Oe]=r.createFramebuffer()}else{if(B.mipmaps&&B.mipmaps.length>0){pe.__webglFramebuffer=[];for(let Oe=0;Oe<B.mipmaps.length;Oe++)pe.__webglFramebuffer[Oe]=r.createFramebuffer()}else pe.__webglFramebuffer=r.createFramebuffer();if(ut)for(let Oe=0,Qe=ve.length;Oe<Qe;Oe++){const at=n.get(ve[Oe]);at.__webglTexture===void 0&&(at.__webglTexture=r.createTexture(),o.memory.textures++)}if(Q.samples>0&&Ae(Q)===!1){pe.__webglMultisampledFramebuffer=r.createFramebuffer(),pe.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,pe.__webglMultisampledFramebuffer);for(let Oe=0;Oe<ve.length;Oe++){const Qe=ve[Oe];pe.__webglColorRenderbuffer[Oe]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,pe.__webglColorRenderbuffer[Oe]);const at=s.convert(Qe.format,Qe.colorSpace),Ke=s.convert(Qe.type),tt=A(Qe.internalFormat,at,Ke,Qe.colorSpace,Q.isXRRenderTarget===!0),wt=Ge(Q);r.renderbufferStorageMultisample(r.RENDERBUFFER,wt,tt,Q.width,Q.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Oe,r.RENDERBUFFER,pe.__webglColorRenderbuffer[Oe])}r.bindRenderbuffer(r.RENDERBUFFER,null),Q.depthBuffer&&(pe.__webglDepthRenderbuffer=r.createRenderbuffer(),he(pe.__webglDepthRenderbuffer,Q,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(we){t.bindTexture(r.TEXTURE_CUBE_MAP,ge.__webglTexture),O(r.TEXTURE_CUBE_MAP,B);for(let Oe=0;Oe<6;Oe++)if(B.mipmaps&&B.mipmaps.length>0)for(let Qe=0;Qe<B.mipmaps.length;Qe++)ie(pe.__webglFramebuffer[Oe][Qe],Q,B,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Oe,Qe);else ie(pe.__webglFramebuffer[Oe],Q,B,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Oe,0);S(B)&&w(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ut){for(let Oe=0,Qe=ve.length;Oe<Qe;Oe++){const at=ve[Oe],Ke=n.get(at);t.bindTexture(r.TEXTURE_2D,Ke.__webglTexture),O(r.TEXTURE_2D,at),ie(pe.__webglFramebuffer,Q,at,r.COLOR_ATTACHMENT0+Oe,r.TEXTURE_2D,0),S(at)&&w(r.TEXTURE_2D)}t.unbindTexture()}else{let Oe=r.TEXTURE_2D;if((Q.isWebGL3DRenderTarget||Q.isWebGLArrayRenderTarget)&&(Oe=Q.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Oe,ge.__webglTexture),O(Oe,B),B.mipmaps&&B.mipmaps.length>0)for(let Qe=0;Qe<B.mipmaps.length;Qe++)ie(pe.__webglFramebuffer[Qe],Q,B,r.COLOR_ATTACHMENT0,Oe,Qe);else ie(pe.__webglFramebuffer,Q,B,r.COLOR_ATTACHMENT0,Oe,0);S(B)&&w(Oe),t.unbindTexture()}Q.depthBuffer&&ye(Q)}function Ie(Q){const B=Q.textures;for(let pe=0,ge=B.length;pe<ge;pe++){const ve=B[pe];if(S(ve)){const we=Q.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,ut=n.get(ve).__webglTexture;t.bindTexture(we,ut),w(we),t.unbindTexture()}}}const Y=[],Ce=[];function Le(Q){if(Q.samples>0){if(Ae(Q)===!1){const B=Q.textures,pe=Q.width,ge=Q.height;let ve=r.COLOR_BUFFER_BIT;const we=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ut=n.get(Q),Oe=B.length>1;if(Oe)for(let Qe=0;Qe<B.length;Qe++)t.bindFramebuffer(r.FRAMEBUFFER,ut.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Qe,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,ut.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Qe,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,ut.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,ut.__webglFramebuffer);for(let Qe=0;Qe<B.length;Qe++){if(Q.resolveDepthBuffer&&(Q.depthBuffer&&(ve|=r.DEPTH_BUFFER_BIT),Q.stencilBuffer&&Q.resolveStencilBuffer&&(ve|=r.STENCIL_BUFFER_BIT)),Oe){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,ut.__webglColorRenderbuffer[Qe]);const at=n.get(B[Qe]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,at,0)}r.blitFramebuffer(0,0,pe,ge,0,0,pe,ge,ve,r.NEAREST),u===!0&&(Y.length=0,Ce.length=0,Y.push(r.COLOR_ATTACHMENT0+Qe),Q.depthBuffer&&Q.resolveDepthBuffer===!1&&(Y.push(we),Ce.push(we),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,Ce)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Y))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Oe)for(let Qe=0;Qe<B.length;Qe++){t.bindFramebuffer(r.FRAMEBUFFER,ut.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Qe,r.RENDERBUFFER,ut.__webglColorRenderbuffer[Qe]);const at=n.get(B[Qe]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,ut.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Qe,r.TEXTURE_2D,at,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,ut.__webglMultisampledFramebuffer)}else if(Q.depthBuffer&&Q.resolveDepthBuffer===!1&&u){const B=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[B])}}}function Ge(Q){return Math.min(i.maxSamples,Q.samples)}function Ae(Q){const B=n.get(Q);return Q.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&B.__useRenderToTexture!==!1}function $e(Q){const B=o.render.frame;p.get(Q)!==B&&(p.set(Q,B),Q.update())}function Re(Q,B){const pe=Q.colorSpace,ge=Q.format,ve=Q.type;return Q.isCompressedTexture===!0||Q.isVideoTexture===!0||pe!==ia&&pe!==Qo&&(kn.getTransfer(pe)===ti?(ge!==ls||ve!==pr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",pe)),B}function He(Q){return typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement?(d.width=Q.naturalWidth||Q.width,d.height=Q.naturalHeight||Q.height):typeof VideoFrame<"u"&&Q instanceof VideoFrame?(d.width=Q.displayWidth,d.height=Q.displayHeight):(d.width=Q.width,d.height=Q.height),d}this.allocateTextureUnit=W,this.resetTextureUnits=G,this.setTexture2D=J,this.setTexture2DArray=oe,this.setTexture3D=se,this.setTextureCube=fe,this.rebindTextures=ze,this.setupRenderTarget=Xe,this.updateRenderTargetMipmap=Ie,this.updateMultisampleRenderTarget=Le,this.setupDepthRenderbuffer=ye,this.setupFrameBufferTexture=ie,this.useMultisampledRTT=Ae}function IM(r,e){function t(n,i=Qo){let s;const o=kn.getTransfer(i);if(n===pr)return r.UNSIGNED_BYTE;if(n===D0)return r.UNSIGNED_SHORT_4_4_4_4;if(n===U0)return r.UNSIGNED_SHORT_5_5_5_1;if(n===e1)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===Qx)return r.BYTE;if(n===$x)return r.SHORT;if(n===mf)return r.UNSIGNED_SHORT;if(n===L0)return r.INT;if(n===xl)return r.UNSIGNED_INT;if(n===as)return r.FLOAT;if(n===Uu)return r.HALF_FLOAT;if(n===t1)return r.ALPHA;if(n===n1)return r.RGB;if(n===ls)return r.RGBA;if(n===i1)return r.LUMINANCE;if(n===r1)return r.LUMINANCE_ALPHA;if(n===Mu)return r.DEPTH_COMPONENT;if(n===mc)return r.DEPTH_STENCIL;if(n===k0)return r.RED;if(n===Mp)return r.RED_INTEGER;if(n===s1)return r.RG;if(n===F0)return r.RG_INTEGER;if(n===N0)return r.RGBA_INTEGER;if(n===zh||n===Hh||n===Gh||n===Vh)if(o===ti)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===zh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Hh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Gh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Vh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===zh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Hh)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Gh)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Vh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Kg||n===Zg||n===Jg||n===Qg)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===Kg)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Zg)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Jg)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Qg)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===$g||n===e0||n===t0)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===$g||n===e0)return o===ti?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===t0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===n0||n===i0||n===r0||n===s0||n===o0||n===a0||n===l0||n===c0||n===u0||n===d0||n===f0||n===h0||n===p0||n===m0)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===n0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===i0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===r0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===s0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===o0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===a0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===l0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===c0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===u0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===d0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===f0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===h0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===p0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===m0)return o===ti?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===jh||n===g0||n===v0)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===jh)return o===ti?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===g0)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===v0)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===o1||n===y0||n===x0||n===_0)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===jh)return s.COMPRESSED_RED_RGT
vendor: 6,952 bytes, lines 3856-3880
3856C1_EXT;if(n===y0)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===x0)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===_0)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===pc?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class LM extends ci{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class cf extends In{constructor(){super(),this.isGroup=!0,this.type="Group"}}const n3={type:"move"};class _y{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new cf,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 cf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new cf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te),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 n of e.hand.values())this._getHandJoint(t,n)}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,n){let i=null,s=null,o=null;const l=this._targetRay,u=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const M of e.hand.values()){const S=t.getJointPose(M,n),w=this._getHandJoint(d,M);S!==null&&(w.matrix.fromArray(S.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.matrixWorldNeedsUpdate=!0,w.jointRadius=S.radius),w.visible=S!==null}const p=d.joints["index-finger-tip"],m=d.joints["thumb-tip"],v=p.position.distanceTo(m.position),y=.02,x=.005;d.inputState.pinching&&v>y+x?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&v<=y-x&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),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));l!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(l.matrix.fromArray(i.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,i.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(i.linearVelocity)):l.hasLinearVelocity=!1,i.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(i.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(n3)))}return l!==null&&(l.visible=i!==null),u!==null&&(u.visible=s!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new cf;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const i3=` 3857void main() { 3858 3859 gl_Position = vec4( position, 1.0 ); 3860 3861}`,r3=` 3862uniform sampler2DArray depthColor; 3863uniform float depthWidth; 3864uniform float depthHeight; 3865 3866void main() { 3867 3868 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 3869 3870 if ( coord.x >= 1.0 ) { 3871 3872 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 3873 3874 } else { 3875 3876 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 3877 3878 } 3879 3880}`;class s3{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new di,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Vi({vertexShader:i3,fragmentShader:r3,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ui(new bl(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class o3 extends ro{constructor(e,t){super();const n=this;let i=null,s=1,o=null,l="local-floor",u=1,d=null,p=null,m=null,v=null,y=null,x=null;const M=new s3,S=t.getContextAttributes();let w=null,A=null;const T=[],R=[],U=new We;let k=null;const N=new ci;N.layers.enable(1),N.viewport=new fn;const H=new ci;H.layers.enable(2),H.viewport=new fn;const F=[N,H],I=new LM;I.layers.enable(1),I.layers.enable(2);let G=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ne){let ie=T[ne];return ie===void 0&&(ie=new _y,T[ne]=ie),ie.getTargetRaySpace()},this.getControllerGrip=function(ne){let ie=T[ne];return ie===void 0&&(ie=new _y,T[ne]=ie),ie.getGripSpace()},this.getHand=function(ne){let ie=T[ne];return ie===void 0&&(ie=new _y,T[ne]=ie),ie.getHandSpace()};function X(ne){const ie=R.indexOf(ne.inputSource);if(ie===-1)return;const he=T[ie];he!==void 0&&(he.update(ne.inputSource,ne.frame,d||o),he.dispatchEvent({type:ne.type,data:ne.inputSource}))}function J(){i.removeEventListener("select",X),i.removeEventListener("selectstart",X),i.removeEventListener("selectend",X),i.removeEventListener("squeeze",X),i.removeEventListener("squeezestart",X),i.removeEventListener("squeezeend",X),i.removeEventListener("end",J),i.removeEventListener("inputsourceschange",oe);for(let ne=0;ne<T.length;ne++){const ie=R[ne];ie!==null&&(R[ne]=null,T[ne].disconnect(ie))}G=null,W=null,M.reset(),e.setRenderTarget(w),y=null,v=null,m=null,i=null,A=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(k),e.setSize(U.width,U.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ne){s=ne,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ne){l=ne,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||o},this.setReferenceSpace=function(ne){d=ne},this.getBaseLayer=function(){return v!==null?v:y},this.getBinding=function(){return m},this.getFrame=function(){return x}
vendor: 5,336 bytes, line 3880
3880,this.getSession=function(){return i},this.setSession=async function(ne){if(i=ne,i!==null){if(w=e.getRenderTarget(),i.addEventListener("select",X),i.addEventListener("selectstart",X),i.addEventListener("selectend",X),i.addEventListener("squeeze",X),i.addEventListener("squeezestart",X),i.addEventListener("squeezeend",X),i.addEventListener("end",J),i.addEventListener("inputsourceschange",oe),S.xrCompatible!==!0&&await t.makeXRCompatible(),k=e.getPixelRatio(),e.getSize(U),i.renderState.layers===void 0){const ie={antialias:S.antialias,alpha:!0,depth:S.depth,stencil:S.stencil,framebufferScaleFactor:s};y=new XRWebGLLayer(i,t,ie),i.updateRenderState({baseLayer:y}),e.setPixelRatio(1),e.setSize(y.framebufferWidth,y.framebufferHeight,!1),A=new xi(y.framebufferWidth,y.framebufferHeight,{format:ls,type:pr,colorSpace:e.outputColorSpace,stencilBuffer:S.stencil})}else{let ie=null,he=null,le=null;S.depth&&(le=S.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ie=S.stencil?mc:Mu,he=S.stencil?pc:xl);const ye={colorFormat:t.RGBA8,depthFormat:le,scaleFactor:s};m=new XRWebGLBinding(i,t),v=m.createProjectionLayer(ye),i.updateRenderState({layers:[v]}),e.setPixelRatio(1),e.setSize(v.textureWidth,v.textureHeight,!1),A=new xi(v.textureWidth,v.textureHeight,{format:ls,type:pr,depthTexture:new H0(v.textureWidth,v.textureHeight,he,void 0,void 0,void 0,void 0,void 0,void 0,ie),stencilBuffer:S.stencil,colorSpace:e.outputColorSpace,samples:S.antialias?4:0,resolveDepthBuffer:v.ignoreDepthValues===!1})}A.isXRRenderTarget=!0,this.setFoveation(u),d=null,o=await i.requestReferenceSpace(l),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return M.getDepthTexture()};function oe(ne){for(let ie=0;ie<ne.removed.length;ie++){const he=ne.removed[ie],le=R.indexOf(he);le>=0&&(R[le]=null,T[le].disconnect(he))}for(let ie=0;ie<ne.added.length;ie++){const he=ne.added[ie];let le=R.indexOf(he);if(le===-1){for(let ze=0;ze<T.length;ze++)if(ze>=R.length){R.push(he),le=ze;break}else if(R[ze]===null){R[ze]=he,le=ze;break}if(le===-1)break}const ye=T[le];ye&&ye.connect(he)}}const se=new te,fe=new te;function V(ne,ie,he){se.setFromMatrixPosition(ie.matrixWorld),fe.setFromMatrixPosition(he.matrixWorld);const le=se.distanceTo(fe),ye=ie.projectionMatrix.elements,ze=he.projectionMatrix.elements,Xe=ye[14]/(ye[10]-1),Ie=ye[14]/(ye[10]+1),Y=(ye[9]+1)/ye[5],Ce=(ye[9]-1)/ye[5],Le=(ye[8]-1)/ye[0],Ge=(ze[8]+1)/ze[0],Ae=Xe*Le,$e=Xe*Ge,Re=le/(-Le+Ge),He=Re*-Le;if(ie.matrixWorld.decompose(ne.position,ne.quaternion,ne.scale),ne.translateX(He),ne.translateZ(Re),ne.matrixWorld.compose(ne.position,ne.quaternion,ne.scale),ne.matrixWorldInverse.copy(ne.matrixWorld).invert(),ye[10]===-1)ne.projectionMatrix.copy(ie.projectionMatrix),ne.projectionMatrixInverse.copy(ie.projectionMatrixInverse);else{const Q=Xe+Re,B=Ie+Re,pe=Ae-He,ge=$e+(le-He),ve=Y*Ie/B*Q,we=Ce*Ie/B*Q;ne.projectionMatrix.makePerspective(pe,ge,ve,we,Q,B),ne.projectionMatrixInverse.copy(ne.projectionMatrix).invert()}}function $(ne,ie){ie===null?ne.matrixWorld.copy(ne.matrix):ne.matrixWorld.multiplyMatrices(ie.matrixWorld,ne.matrix),ne.matrixWorldInverse.copy(ne.matrixWorld).invert()}this.updateCamera=function(ne){if(i===null)return;let ie=ne.near,he=ne.far;M.texture!==null&&(M.depthNear>0&&(ie=M.depthNear),M.depthFar>0&&(he=M.depthFar)),I.near=H.near=N.near=ie,I.far=H.far=N.far=he,(G!==I.near||W!==I.far)&&(i.updateRenderState({depthNear:I.near,depthFar:I.far}),G=I.near,W=I.far);const le=ne.parent,ye=I.cameras;$(I,le);for(let ze=0;ze<ye.length;ze++)$(ye[ze],le);ye.length===2?V(I,N,H):I.projectionMatrix.copy(N.projectionMatrix),Z(ne,I,le)};function Z(ne,ie,he){he===null?ne.matrix.copy(ie.matrixWorld):(ne.matrix.copy(he.matrixWorld),ne.matrix.invert(),ne.matrix.multiply(ie.matrixWorld)),ne.matrix.decompose(ne.position,ne.quaternion,ne.scale),ne.updateMatrixWorld(!0),ne.projectionMatrix.copy(ie.projectionMatrix),ne.projectionMatrixInverse.copy(ie.projectionMatrixInverse),ne.isPerspectiveCamera&&(ne.fov=gf*2*Math.atan(1/ne.projectionMatrix.elements[5]),ne.zoom=1)}this.getCamera=function(){return I},this.getFoveation=function(){if(!(v===null&&y===null))return u},this.setFoveation=function(ne){u=ne,v!==null&&(v.fixedFoveation=ne),y!==null&&y.fixedFoveation!==void 0&&(y.fixedFoveation=ne)},this.hasDepthSensing=function(){return M.texture!==null},this.getDepthSensingMesh=function(){return M.getMesh(I)};let O=null;function j(ne,ie){if(p=ie.getViewerPose(d||o),x=ie,p!==null){const he=p.views;y!==null&&(e.setRenderTargetFramebuffer(A,y.framebuffer),e.setRenderTarget(A));let le=!1;he.length!==I.cameras.length&&(I.cameras.length=0,le=!0);for(let ze=0;ze<he.length;ze++){const Xe=he[ze];let Ie=null;if(y!==null)Ie=y.getViewport(Xe);else{const Ce=m.getViewSubImage(v,Xe);Ie=Ce.viewport,ze===0&&(e.setRenderTargetTextures(A,Ce.colorTexture,v.ignoreDepthValues?void 0:Ce.depthStencilTexture),e.setRenderTarget(A))}let Y=F[ze];Y===void 0&&(Y=new ci,Y.layers.enable(ze),Y.viewport=new fn,F[ze]=Y),Y.matrix.fromArray(Xe.transform.matrix),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.projectionMatrix.fromArray(Xe.projectionMatrix),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert(),Y.viewport.set(Ie.x,Ie.y,Ie.width,Ie.he
vendor: 34,599 bytes, line 3880
3880ight),ze===0&&(I.matrix.copy(Y.matrix),I.matrix.decompose(I.position,I.quaternion,I.scale)),le===!0&&I.cameras.push(Y)}const ye=i.enabledFeatures;if(ye&&ye.includes("depth-sensing")){const ze=m.getDepthInformation(he[0]);ze&&ze.isValid&&ze.texture&&M.init(e,ze,i.renderState)}}for(let he=0;he<T.length;he++){const le=R[he],ye=T[he];le!==null&&ye!==void 0&&ye.update(le,ie,d||o)}O&&O(ne,ie),ie.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ie}),x=null}const re=new TM;re.setAnimationLoop(j),this.setAnimationLoop=function(ne){O=ne},this.dispose=function(){}}}const su=new io,a3=new Xt;function l3(r,e){function t(S,w){S.matrixAutoUpdate===!0&&S.updateMatrix(),w.value.copy(S.matrix)}function n(S,w){w.color.getRGB(S.fogColor.value,wM(r)),w.isFog?(S.fogNear.value=w.near,S.fogFar.value=w.far):w.isFogExp2&&(S.fogDensity.value=w.density)}function i(S,w,A,T,R){w.isMeshBasicMaterial||w.isMeshLambertMaterial?s(S,w):w.isMeshToonMaterial?(s(S,w),m(S,w)):w.isMeshPhongMaterial?(s(S,w),p(S,w)):w.isMeshStandardMaterial?(s(S,w),v(S,w),w.isMeshPhysicalMaterial&&y(S,w,R)):w.isMeshMatcapMaterial?(s(S,w),x(S,w)):w.isMeshDepthMaterial?s(S,w):w.isMeshDistanceMaterial?(s(S,w),M(S,w)):w.isMeshNormalMaterial?s(S,w):w.isLineBasicMaterial?(o(S,w),w.isLineDashedMaterial&&l(S,w)):w.isPointsMaterial?u(S,w,A,T):w.isSpriteMaterial?d(S,w):w.isShadowMaterial?(S.color.value.copy(w.color),S.opacity.value=w.opacity):w.isShaderMaterial&&(w.uniformsNeedUpdate=!1)}function s(S,w){S.opacity.value=w.opacity,w.color&&S.diffuse.value.copy(w.color),w.emissive&&S.emissive.value.copy(w.emissive).multiplyScalar(w.emissiveIntensity),w.map&&(S.map.value=w.map,t(w.map,S.mapTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,t(w.alphaMap,S.alphaMapTransform)),w.bumpMap&&(S.bumpMap.value=w.bumpMap,t(w.bumpMap,S.bumpMapTransform),S.bumpScale.value=w.bumpScale,w.side===dr&&(S.bumpScale.value*=-1)),w.normalMap&&(S.normalMap.value=w.normalMap,t(w.normalMap,S.normalMapTransform),S.normalScale.value.copy(w.normalScale),w.side===dr&&S.normalScale.value.negate()),w.displacementMap&&(S.displacementMap.value=w.displacementMap,t(w.displacementMap,S.displacementMapTransform),S.displacementScale.value=w.displacementScale,S.displacementBias.value=w.displacementBias),w.emissiveMap&&(S.emissiveMap.value=w.emissiveMap,t(w.emissiveMap,S.emissiveMapTransform)),w.specularMap&&(S.specularMap.value=w.specularMap,t(w.specularMap,S.specularMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest);const A=e.get(w),T=A.envMap,R=A.envMapRotation;T&&(S.envMap.value=T,su.copy(R),su.x*=-1,su.y*=-1,su.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(su.y*=-1,su.z*=-1),S.envMapRotation.value.setFromMatrix4(a3.makeRotationFromEuler(su)),S.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,S.reflectivity.value=w.reflectivity,S.ior.value=w.ior,S.refractionRatio.value=w.refractionRatio),w.lightMap&&(S.lightMap.value=w.lightMap,S.lightMapIntensity.value=w.lightMapIntensity,t(w.lightMap,S.lightMapTransform)),w.aoMap&&(S.aoMap.value=w.aoMap,S.aoMapIntensity.value=w.aoMapIntensity,t(w.aoMap,S.aoMapTransform))}function o(S,w){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,w.map&&(S.map.value=w.map,t(w.map,S.mapTransform))}function l(S,w){S.dashSize.value=w.dashSize,S.totalSize.value=w.dashSize+w.gapSize,S.scale.value=w.scale}function u(S,w,A,T){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,S.size.value=w.size*A,S.scale.value=T*.5,w.map&&(S.map.value=w.map,t(w.map,S.uvTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,t(w.alphaMap,S.alphaMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest)}function d(S,w){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,S.rotation.value=w.rotation,w.map&&(S.map.value=w.map,t(w.map,S.mapTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,t(w.alphaMap,S.alphaMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest)}function p(S,w){S.specular.value.copy(w.specular),S.shininess.value=Math.max(w.shininess,1e-4)}function m(S,w){w.gradientMap&&(S.gradientMap.value=w.gradientMap)}function v(S,w){S.metalness.value=w.metalness,w.metalnessMap&&(S.metalnessMap.value=w.metalnessMap,t(w.metalnessMap,S.metalnessMapTransform)),S.roughness.value=w.roughness,w.roughnessMap&&(S.roughnessMap.value=w.roughnessMap,t(w.roughnessMap,S.roughnessMapTransform)),w.envMap&&(S.envMapIntensity.value=w.envMapIntensity)}function y(S,w,A){S.ior.value=w.ior,w.sheen>0&&(S.sheenColor.value.copy(w.sheenColor).multiplyScalar(w.sheen),S.sheenRoughness.value=w.sheenRoughness,w.sheenColorMap&&(S.sheenColorMap.value=w.sheenColorMap,t(w.sheenColorMap,S.sheenColorMapTransform)),w.sheenRoughnessMap&&(S.sheenRoughnessMap.value=w.sheenRoughnessMap,t(w.sheenRoughnessMap,S.sheenRoughnessMapTransform))),w.clearcoat>0&&(S.clearcoat.value=w.clearcoat,S.clearcoatRoughness.value=w.clearcoatRoughness,w.clearcoatMap&&(S.clearcoatMap.value=w.clearcoatMap,t(w.clearcoatMap,S.clearcoatMapTransform)),w.clearcoatRoughnessMap&&(S.clearcoatRoughnessMap.value=w.clearcoatRoughnessMap,t(w.clearcoatRoughnessMap,S.clearcoatRoughnessMapTransform)),w.clearcoatNormalMap&&(S.clearcoatNormalMap.value=w.clearcoatNormalMap,t(w.clearcoatNormalMap,S.clearcoatNormalMapTransform),S.clearcoatNormalScale.value.copy(w.clearcoatNormalScale),w.side===dr&&S.clearcoatNormalScale.value.negate())),w.dispersion>0&&(S.dispersion.value=w.dispersion),w.iridescence>0&&(S.iridescence.value=w.iridescence,S.iridescenceIOR.value=w.iridescenceIOR,S.iridescenceThicknessMinimum.value=w.iridescenceThicknessRange[0],S.iridescenceThicknessMaximum.value=w.iridescenceThicknessRange[1],w.iridescenceMap&&(S.iridescenceMap.value=w.iridescenceMap,t(w.iridescenceMap,S.iridescenceMapTransform)),w.iridescenceThicknessMap&&(S.iridescenceThicknessMap.value=w.iridescenceThicknessMap,t(w.iridescenceThicknessMap,S.iridescenceThicknessMapTransform))),w.transmission>0&&(S.transmission.value=w.transmission,S.transmissionSamplerMap.value=A.texture,S.transmissionSamplerSize.value.set(A.width,A.height),w.transmissionMap&&(S.transmissionMap.value=w.transmissionMap,t(w.transmissionMap,S.transmissionMapTransform)),S.thickness.value=w.thickness,w.thicknessMap&&(S.thicknessMap.value=w.thicknessMap,t(w.thicknessMap,S.thicknessMapTransform)),S.attenuationDistance.value=w.attenuationDistance,S.attenuationColor.value.copy(w.attenuationColor)),w.anisotropy>0&&(S.anisotropyVector.value.set(w.anisotropy*Math.cos(w.anisotropyRotation),w.anisotropy*Math.sin(w.anisotropyRotation)),w.anisotropyMap&&(S.anisotropyMap.value=w.anisotropyMap,t(w.anisotropyMap,S.anisotropyMapTransform))),S.specularIntensity.value=w.specularIntensity,S.specularColor.value.copy(w.specularColor),w.specularColorMap&&(S.specularColorMap.value=w.specularColorMap,t(w.specularColorMap,S.specularColorMapTransform)),w.specularIntensityMap&&(S.specularIntensityMap.value=w.specularIntensityMap,t(w.specularIntensityMap,S.specularIntensityMapTransform))}function x(S,w){w.matcap&&(S.matcap.value=w.matcap)}function M(S,w){const A=e.get(w).light;S.referencePosition.value.setFromMatrixPosition(A.matrixWorld),S.nearDistance.value=A.shadow.camera.near,S.farDistance.value=A.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function c3(r,e,t,n){let i={},s={},o=[];const l=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function u(A,T){const R=T.program;n.uniformBlockBinding(A,R)}function d(A,T){let R=i[A.id];R===void 0&&(x(A),R=p(A),i[A.id]=R,A.addEventListener("dispose",S));const U=T.program;n.updateUBOMapping(A,U);const k=e.render.frame;s[A.id]!==k&&(v(A),s[A.id]=k)}function p(A){const T=m();A.__bindingPointIndex=T;const R=r.createBuffer(),U=A.__size,k=A.usage;return r.bindBuffer(r.UNIFORM_BUFFER,R),r.bufferData(r.UNIFORM_BUFFER,U,k),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,T,R),R}function m(){for(let A=0;A<l;A++)if(o.indexOf(A)===-1)return o.push(A),A;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function v(A){const T=i[A.id],R=A.uniforms,U=A.__cache;r.bindBuffer(r.UNIFORM_BUFFER,T);for(let k=0,N=R.length;k<N;k++){const H=Array.isArray(R[k])?R[k]:[R[k]];for(let F=0,I=H.length;F<I;F++){const G=H[F];if(y(G,k,F,U)===!0){const W=G.__offset,X=Array.isArray(G.value)?G.value:[G.value];let J=0;for(let oe=0;oe<X.length;oe++){const se=X[oe],fe=M(se);typeof se=="number"||typeof se=="boolean"?(G.__data[0]=se,r.bufferSubData(r.UNIFORM_BUFFER,W+J,G.__data)):se.isMatrix3?(G.__data[0]=se.elements[0],G.__data[1]=se.elements[1],G.__data[2]=se.elements[2],G.__data[3]=0,G.__data[4]=se.elements[3],G.__data[5]=se.elements[4],G.__data[6]=se.elements[5],G.__data[7]=0,G.__data[8]=se.elements[6],G.__data[9]=se.elements[7],G.__data[10]=se.elements[8],G.__data[11]=0):(se.toArray(G.__data,J),J+=fe.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,W,G.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function y(A,T,R,U){const k=A.value,N=T+"_"+R;if(U[N]===void 0)return typeof k=="number"||typeof k=="boolean"?U[N]=k:U[N]=k.clone(),!0;{const H=U[N];if(typeof k=="number"||typeof k=="boolean"){if(H!==k)return U[N]=k,!0}else if(H.equals(k)===!1)return H.copy(k),!0}return!1}function x(A){const T=A.uniforms;let R=0;const U=16;for(let N=0,H=T.length;N<H;N++){const F=Array.isArray(T[N])?T[N]:[T[N]];for(let I=0,G=F.length;I<G;I++){const W=F[I],X=Array.isArray(W.value)?W.value:[W.value];for(let J=0,oe=X.length;J<oe;J++){const se=X[J],fe=M(se),V=R%U,$=V%fe.boundary,Z=V+$;R+=$,Z!==0&&U-Z<fe.storage&&(R+=U-Z),W.__data=new Float32Array(fe.storage/Float32Array.BYTES_PER_ELEMENT),W.__offset=R,R+=fe.storage}}}const k=R%U;return k>0&&(R+=U-k),A.__size=R,A.__cache={},this}function M(A){const T={boundary:0,storage:0};return typeof A=="number"||typeof A=="boolean"?(T.boundary=4,T.storage=4):A.isVector2?(T.boundary=8,T.storage=8):A.isVector3||A.isColor?(T.boundary=16,T.storage=12):A.isVector4?(T.boundary=16,T.storage=16):A.isMatrix3?(T.boundary=48,T.storage=48):A.isMatrix4?(T.boundary=64,T.storage=64):A.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",A),T}function S(A){const T=A.target;T.removeEventListener("dispose",S);const R=o.indexOf(T.__bindingPointIndex);o.splice(R,1),r.deleteBuffer(i[T.id]),delete i[T.id],delete s[T.id]}function w(){for(const A in i)r.deleteBuffer(i[A]);o=[],i={},s={}}return{bind:u,update:d,dispose:w}}class DM{constructor(e={}){const{canvas:t=xM(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:l=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:d=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:m=!1}=e;this.isWebGLRenderer=!0;let v;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");v=n.getContextAttributes().alpha}else v=o;const y=new Uint32Array(4),x=new Int32Array(4);let M=null,S=null;const w=[],A=[];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=Bn,this.toneMapping=ea,this.toneMappingExposure=1;const T=this;let R=!1,U=0,k=0,N=null,H=-1,F=null;const I=new fn,G=new fn;let W=null;const X=new St(0);let J=0,oe=t.width,se=t.height,fe=1,V=null,$=null;const Z=new fn(0,0,oe,se),O=new fn(0,0,oe,se);let j=!1;const re=new Rp;let ne=!1,ie=!1;const he=new Xt,le=new te,ye=new fn,ze={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Xe=!1;function Ie(){return N===null?fe:1}let Y=n;function Ce(ee,Se){return t.getContext(ee,Se)}try{const ee={alpha:!0,depth:i,stencil:s,antialias:l,premultipliedAlpha:u,preserveDrawingBuffer:d,powerPreference:p,failIfMajorPerformanceCaveat:m};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Du}`),t.addEventListener("webglcontextlost",xe,!1),t.addEventListener("webglcontextrestored",De,!1),t.addEventListener("webglcontextcreationerror",rt,!1),Y===null){const Se="webgl2";if(Y=Ce(Se,ee),Y===null)throw Ce(Se)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(ee){throw console.error("THREE.WebGLRenderer: "+ee.message),ee}let Le,Ge,Ae,$e,Re,He,Q,B,pe,ge,ve,we,ut,Oe,Qe,at,Ke,tt,wt,nt,et,it,ue,qe;function ce(){Le=new gP(Y),Le.init(),it=new IM(Y,Le),Ge=new uP(Y,Le,e,it),Ae=new KI(Y),$e=new xP(Y),Re=new NI,He=new t3(Y,Le,Ae,Re,Ge,it,$e),Q=new fP(T),B=new mP(T),pe=new TA(Y),ue=new lP(Y,pe),ge=new vP(Y,pe,$e,ue),ve=new SP(Y,ge,pe,$e),wt=new _P(Y,Ge,He),at=new dP(Re),we=new FI(T,Q,B,Le,Ge,ue,at),ut=new l3(T,Re),Oe=new BI,Qe=new WI(Le),tt=new aP(T,Q,B,Ae,ve,v,u),Ke=new qI(T,ve,Ge),qe=new c3(Y,$e,Ge,Ae),nt=new cP(Y,Le,$e),et=new yP(Y,Le,$e),$e.programs=we.programs,T.capabilities=Ge,T.extensions=Le,T.properties=Re,T.renderLists=Oe,T.shadowMap=Ke,T.state=Ae,T.info=$e}ce();const Fe=new o3(T,Y);this.xr=Fe,this.getContext=function(){return Y},this.getContextAttributes=function(){return Y.getContextAttributes()},this.forceContextLoss=function(){const ee=Le.get("WEBGL_lose_context");ee&&ee.loseContext()},this.forceContextRestore=function(){const ee=Le.get("WEBGL_lose_context");ee&&ee.restoreContext()},this.getPixelRatio=function(){return fe},this.setPixelRatio=function(ee){ee!==void 0&&(fe=ee,this.setSize(oe,se,!1))},this.getSize=function(ee){return ee.set(oe,se)},this.setSize=function(ee,Se,Ue=!0){if(Fe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}oe=ee,se=Se,t.width=Math.floor(ee*fe),t.height=Math.floor(Se*fe),Ue===!0&&(t.style.width=ee+"px",t.style.height=Se+"px"),this.setViewport(0,0,ee,Se)},this.getDrawingBufferSize=function(ee){return ee.set(oe*fe,se*fe).floor()},this.setDrawingBufferSize=function(ee,Se,Ue){oe=ee,se=Se,fe=Ue,t.width=Math.floor(ee*Ue),t.height=Math.floor(Se*Ue),this.setViewport(0,0,ee,Se)},this.getCurrentViewport=function(ee){return ee.copy(I)},this.getViewport=function(ee){return ee.copy(Z)},this.setViewport=function(ee,Se,Ue,ke){ee.isVector4?Z.set(ee.x,ee.y,ee.z,ee.w):Z.set(ee,Se,Ue,ke),Ae.viewport(I.copy(Z).multiplyScalar(fe).round())},this.getScissor=function(ee){return ee.copy(O)},this.setScissor=function(ee,Se,Ue,ke){ee.isVector4?O.set(ee.x,ee.y,ee.z,ee.w):O.set(ee,Se,Ue,ke),Ae.scissor(G.copy(O).multiplyScalar(fe).round())},this.getScissorTest=function(){return j},this.setScissorTest=function(ee){Ae.setScissorTest(j=ee)},this.setOpaqueSort=function(ee){V=ee},this.setTransparentSort=function(ee){$=ee},this.getClearColor=function(ee){return ee.copy(tt.getClearColor())},this.setClearColor=function(){tt.setClearColor.apply(tt,arguments)},this.getClearAlpha=function(){return tt.getClearAlpha()},this.setClearAlpha=function(){tt.setClearAlpha.apply(tt,arguments)},this.clear=function(ee=!0,Se=!0,Ue=!0){let ke=0;if(ee){let Te=!1;if(N!==null){const lt=N.texture.format;Te=lt===N0||lt===F0||lt===Mp}if(Te){const lt=N.texture.type,yt=lt===pr||lt===xl||lt===mf||lt===pc||lt===D0||lt===U0,Tt=tt.getClearColor(),je=tt.getClearAlpha(),Lt=Tt.r,Ot=Tt.g,xt=Tt.b;yt?(y[0]=Lt,y[1]=Ot,y[2]=xt,y[3]=je,Y.clearBufferuiv(Y.COLOR,0,y)):(x[0]=Lt,x[1]=Ot,x[2]=xt,x[3]=je,Y.clearBufferiv(Y.COLOR,0,x))}else ke|=Y.COLOR_BUFFER_BIT}Se&&(ke|=Y.DEPTH_BUFFER_BIT),Ue&&(ke|=Y.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Y.clear(ke)},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",xe,!1),t.removeEventListener("webglcontextrestored",De,!1),t.removeEventListener("webglcontextcreationerror",rt,!1),Oe.dispose(),Qe.dispose(),Re.dispose(),Q.dispose(),B.dispose(),ve.dispose(),ue.dispose(),qe.dispose(),we.dispose(),Fe.dispose(),Fe.removeEventListener("sessionstart",dn),Fe.removeEventListener("sessionend",Sn),bn.stop()};function xe(ee){ee.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function De(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;const ee=$e.autoReset,Se=Ke.enabled,Ue=Ke.autoUpdate,ke=Ke.needsUpdate,Te=Ke.type;ce(),$e.autoReset=ee,Ke.enabled=Se,Ke.autoUpdate=Ue,Ke.needsUpdate=ke,Ke.type=Te}function rt(ee){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",ee.statusMessage)}function mt(ee){const Se=ee.target;Se.removeEventListener("dispose",mt),vt(Se)}function vt(ee){kt(ee),Re.remove(ee)}function kt(ee){const Se=Re.get(ee).programs;Se!==void 0&&(Se.forEach(function(Ue){we.releaseProgram(Ue)}),ee.isShaderMaterial&&we.releaseShaderCache(ee))}this.renderBufferDirect=function(ee,Se,Ue,ke,Te,lt){Se===null&&(Se=ze);const yt=Te.isMesh&&Te.matrixWorld.determinant()<0,Tt=xo(ee,Se,Ue,ke,Te);Ae.setMaterial(ke,yt);let je=Ue.index,Lt=1;if(ke.wireframe===!0){if(je=ge.getWireframeAttribute(Ue),je===void 0)return;Lt=2}const Ot=Ue.drawRange,xt=Ue.attributes.position;let Zt=Ot.start*Lt,wn=(Ot.start+Ot.count)*Lt;lt!==null&&(Zt=Math.max(Zt,lt.start*Lt),wn=Math.min(wn,(lt.start+lt.count)*Lt)),je!==null?(Zt=Math.max(Zt,0),wn=Math.min(wn,je.count)):xt!=null&&(Zt=Math.max(Zt,0),wn=Math.min(wn,xt.count));const pn=wn-Zt;if(pn<0||pn===1/0)return;ue.setup(Te,ke,Tt,Ue,je);let En,Mt=nt;if(je!==null&&(En=pe.get(je),Mt=et,Mt.setIndex(En)),Te.isMesh)ke.wireframe===!0?(Ae.setLineWidth(ke.wireframeLinewidth*Ie()),Mt.setMode(Y.LINES)):Mt.setMode(Y.TRIANGLES);else if(Te.isLine){let ft=ke.linewidth;ft===void 0&&(ft=1),Ae.setLineWidth(ft*Ie()),Te.isLineSegments?Mt.setMode(Y.LINES):Te.isLineLoop?Mt.setMode(Y.LINE_LOOP):Mt.setMode(Y.LINE_STRIP)}else Te.isPoints?Mt.setMode(Y.POINTS):Te.isSprite&&Mt.setMode(Y.TRIANGLES);if(Te.isBatchedMesh)if(Te._multiDrawInstances!==null)Mt.renderMultiDrawInstances(Te._multiDrawStarts,Te._multiDrawCounts,Te._multiDrawCount,Te._multiDrawInstances);else if(Le.get("WEBGL_multi_draw"))Mt.renderMultiDraw(Te._multiDrawStarts,Te._multiDrawCounts,Te._multiDrawCount);else{const ft=Te._multiDrawStarts,Qt=Te._multiDrawCounts,zt=Te._multiDrawCount,xn=je?pe.get(je).bytesPerElement:1,ri=Re.get(ke).currentProgram.getUniforms();for(let Tn=0;Tn<zt;Tn++)ri.setValue(Y,"_gl_DrawID",Tn),Mt.render(ft[Tn]/xn,Qt[Tn])}else if(Te.isInstancedMesh)Mt.renderInstances(Zt,pn,Te.count);else if(Ue.isInstancedBufferGeometry){const ft=Ue._maxInstanceCount!==void 0?Ue._maxInstanceCount:1/0,Qt=Math.min(Ue.instanceCount,ft);Mt.renderInstances(Zt,pn,Qt)}else Mt.render(Zt,pn)};function Ft(ee,Se,Ue){ee.transparent===!0&&ee.side===os&&ee.forceSinglePass===!1?(ee.side=dr,ee.needsUpdate=!0,Si(ee,Se,Ue),ee.side=Da,ee.needsUpdate=!0,Si(ee,Se,Ue),ee.side=os):Si(ee,Se,Ue)}this.compile=function(ee,Se,Ue=null){Ue===null&&(Ue=ee),S=Qe.get(Ue),S.init(Se),A.push(S),Ue.traverseVisible(function(Te){Te.isLight&&Te.layers.test(Se.layers)&&(S.pushLight(Te),Te.castShadow&&S.pushShadow(Te))}),ee!==Ue&&ee.traverseVisible(function(Te){Te.isLight&&Te.layers.test(Se.layers)&&(S.pushLight(Te),Te.castShadow&&S.pushShadow(Te))}),S.setupLights();const ke=new Set;return ee.traverse(function(Te){const lt=Te.material;if(lt)if(Array.isArray(lt))for(let yt=0;yt<lt.length;yt++){const Tt=lt[yt];Ft(Tt,Ue,Te),ke.add(Tt)}else Ft(lt,Ue,Te),ke.add(lt)}),A.pop(),S=null,ke},this.compileAsync=function(ee,Se,Ue=null){const ke=this.compile(ee,Se,Ue);return new Promise(Te=>{function lt(){if(ke.forEach(function(yt){Re.get(yt).currentProgram.isReady()&&ke.delete(yt)}),ke.size===0){Te(ee);return}setTimeout(lt,10)}Le.get("KHR_parallel_shader_compile")!==null?lt():setTimeout(lt,10)})};let pt=null;function Kt(ee){pt&&pt(ee)}function dn(){bn.stop()}function Sn(){bn.start()}const bn=new TM;bn.setAnimationLoop(Kt),typeof self<"u"&&bn.setContext(self),this.setAnimationLoop=function(ee){pt=ee,Fe.setAnimationLoop(ee),ee===null?bn.stop():bn.start()},Fe.addEventListener("sessionstart",dn),Fe.addEventListener("sessionend",Sn),this.render=function(ee,Se){if(Se!==void 0&&Se.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;if(ee.matrixWorldAutoUpdate===!0&&ee.updateMatrixWorld(),Se.parent===null&&Se.matrixWorldAutoUpdate===!0&&Se.updateMatrixWorld(),Fe.enabled===!0&&Fe.isPresenting===!0&&(Fe.cameraAutoUpdate===!0&&Fe.updateCamera(Se),Se=Fe.getCamera()),ee.isScene===!0&&ee.onBeforeRender(T,ee,Se,N),S=Qe.get(ee,A.length),S.init(Se),A.push(S),he.multiplyMatrices(Se.projectionMatrix,Se.matrixWorldInverse),re.setFromProjectionMatrix(he),ie=this.localClippingEnabled,ne=at.init(this.clippingPlanes,ie),M=Oe.get(ee,w.length),M.init(),w.push(M),Fe.enabled===!0&&Fe.isPresenting===!0){const lt=T.xr.getDepthSensingMesh();lt!==null&&ii(lt,Se,-1/0,T.sortObjects)}ii(ee,Se,0,T.sortObjects),M.finish(),T.sortObjects===!0&&M.sort(V,$),Xe=Fe.enabled===!1||Fe.isPresenting===!1||Fe.hasDepthSensing()===!1,Xe&&tt.addToRenderList(M,ee),this.info.render.frame++,ne===!0&&at.beginShadows();const Ue=S.state.shadowsArray;Ke.render(Ue,ee,Se),ne===!0&&at.endShadows(),this.info.autoReset===!0&&this.info.reset();const ke=M.opaque,Te=M.transmissive;if(S.setupLights(),Se.isArrayCamera){const lt=Se.cameras;if(Te.length>0)for(let yt=0,Tt=lt.length;yt<Tt;yt++){const je=lt[yt];fi(ke,Te,ee,je)}Xe&&tt.render(ee);for(let yt=0,Tt=lt.length;yt<Tt;yt++){const je=lt[yt];vr(M,ee,je,je.viewport)}}else Te.length>0&&fi(ke,Te,ee,Se),Xe&&tt.render(ee),vr(M,ee,Se);N!==null&&(He.updateMultisampleRenderTarget(N),He.updateRenderTargetMipmap(N)),ee.isScene===!0&&ee.onAfterRender(T,ee,Se),ue.resetDefaultState(),H=-1,F=null,A.pop(),A.length>0?(S=A[A.length-1],ne===!0&&at.setGlobalState(T.clippingPlanes,S.state.camera)):S=null,w.pop(),w.length>0?M=w[w.length-1]:M=null};function ii(ee,Se,Ue,ke){if(ee.visible===!1)return;if(ee.layers.test(Se.layers)){if(ee.isGroup)Ue=ee.renderOrder;else if(ee.isLOD)ee.autoUpdate===!0&&ee.update(Se);else if(ee.isLight)S.pushLight(ee),ee.castShadow&&S.pushShadow(ee);else if(ee.isSprite){if(!ee.frustumCulled||re.intersectsSprite(ee)){ke&&ye.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(he);const yt=ve.update(ee),Tt=ee.material;Tt.visible&&M.push(ee,yt,Tt,Ue,ye.z,null)}}else if((ee.isMesh||ee.isLine||ee.isPoints)&&(!ee.frustumCulled||re.intersectsObject(ee))){const yt=ve.update(ee),Tt=ee.material;if(ke&&(ee.boundingSphere!==void 0?(ee.boundingSphere===null&&ee.computeBoundingSphere(),ye.copy(ee.boundingSphere.center)):(yt.boundingSphere===null&&yt.computeBoundingSphere(),ye.copy(yt.boundingSphere.center)),ye.applyMatrix4(ee.matrixWorld).applyMatrix4(he)),Array.isArray(Tt)){const je=yt.groups;for(let Lt=0,Ot=je.length;Lt<Ot;Lt++){const xt=je[Lt],Zt=Tt[xt.materialIndex];Zt&&Zt.visible&&M.push(ee,yt,Zt,Ue,ye.z,xt)}}else Tt.visible&&M.push(ee,yt,Tt,Ue,ye.z,null)}}const lt=ee.children;for(let yt=0,Tt=lt.length;yt<Tt;yt++)ii(lt[yt],Se,Ue,ke)}function vr(ee,Se,Ue,ke){const Te=ee.opaque,lt=ee.transmissive,yt=ee.transparent;S.setupLightsView(Ue),ne===!0&&at.setGlobalState(T.clippingPlanes,Ue),ke&&Ae.viewport(I.copy(ke)),Te.length>0&&Ai(Te,Se,Ue),lt.length>0&&Ai(lt,Se,Ue),yt.length>0&&Ai(yt,Se,Ue),Ae.buffers.depth.setTest(!0),Ae.buffers.depth.setMask(!0),Ae.buffers.color.setMask(!0),Ae.setPolygonOffset(!1)}function fi(ee,Se,Ue,ke){if((Ue.isScene===!0?Ue.overrideMaterial:null)!==null)return;S.state.transmissionRenderTarget[ke.id]===void 0&&(S.state.transmissionRenderTarget[ke.id]=new xi(1,1,{generateMipmaps:!0,type:Le.has("EXT_color_buffer_half_float")||Le.has("EXT_color_buffer_float")?Uu:pr,minFilter:Ca,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:kn.workingColorSpace}));const lt=S.state.transmissionRenderTarget[ke.id],yt=ke.viewport||I;lt.setSize(yt.z,yt.w);const Tt=T.getRenderTarget();T.setRenderTarget(lt),T.getClearColor(X),J=T.getClearAlpha(),J<1&&T.setClearColor(16777215,.5),T.clear(),Xe&&tt.render(Ue);const je=T.toneMapping;T.toneMapping=ea;const Lt=ke.viewport;if(ke.viewport!==void 0&&(ke.viewport=void 0),S.setupLightsView(ke),ne===!0&&at.setGlobalState(T.clippingPlanes,ke),Ai(ee,Ue,ke),He.updateMultisampleRenderTarget(lt),He.updateRenderTargetMipmap(lt),Le.has("WEBGL_multisampled_render_to_texture")===!1){let Ot=!1;for(let xt=0,Zt=Se.length;xt<Zt;xt++){const wn=Se[xt],pn=wn.object,En=wn.geometry,Mt=wn.material,ft=wn.group;if(Mt.side===os&&pn.layers.test(ke.layers)){const Qt=Mt.side;Mt.side=dr,Mt.needsUpdate=!0,_i(pn,Ue,ke,En,Mt,ft),Mt.side=Qt,Mt.needsUpdate=!0,Ot=!0}}Ot===!0&&(He.updateMultisampleRenderTarget(lt),He.updateRenderTargetMipmap(lt))}T.setRenderTarget(Tt),T.setClearColor(X,J),Lt!==void 0&&(ke.viewport=Lt),T.toneMapping=je}function Ai(ee,Se,Ue){const ke=Se.isScene===!0?Se.overrideMaterial:null;for(let Te=0,lt=ee.length;Te<lt;Te++){const yt=ee[Te],Tt=yt.object,je=yt.geometry,Lt=ke===null?yt.material:ke,Ot=yt.group;Tt.layers.test(Ue.layers)&&_i(Tt,Se,Ue,je,Lt,Ot)}}function _i(ee,Se,Ue,ke,Te,lt){ee.onBeforeRender(T,Se,Ue,ke,Te,lt),ee.modelViewMatrix.multiplyMatrices(Ue.matrixWorldInverse,ee.matrixWorld),ee.normalMatrix.getNormalMatrix(ee.modelViewMatrix),Te.onBeforeRender(T,Se,Ue,ke,ee,lt),Te.transparent===!0&&Te.side===os&&Te.forceSinglePass===!1?(Te.side=dr,Te.needsUpdate=!0,T.renderBufferDirect(Ue,Se,ke,Te,ee,lt),Te.side=Da,Te.needsUpdate=!0,T.renderBufferDirect(Ue,Se,ke,Te,ee,lt),Te.side=os):T.renderBufferDirect(Ue,Se,ke,Te,ee,lt),ee.onAfterRender(T,Se,Ue,ke,Te,lt)}function Si(ee,Se,Ue){Se.isScene!==!0&&(Se=ze);const ke=Re.get(ee),Te=S.state.lights,lt=S.state.shadowsArray,yt=Te.state.version,Tt=we.getParameters(ee,Te.state,lt,Se,Ue),je=we.getProgramCacheKey(Tt);let Lt=ke.programs;ke.environment=ee.isMeshStandardMaterial?Se.environment:null,ke.fog=Se.fog,ke.envMap=(ee.isMeshStandardMaterial?B:Q).get(ee.envMap||ke.environment),ke.envMapRotation=ke.environment!==null&&ee.envMap===null?Se.environmentRotation:ee.envMapRotation,Lt===void 0&&(ee.addEventListener("dispose",mt),Lt=new Map,ke.programs=Lt);let Ot=Lt.get(je);if(Ot!==void 0){if(ke.currentProgram===Ot&&ke.lightsStateVersion===yt)return Pr(ee,Tt),Ot}else Tt.uniforms=we.getUniforms(ee),ee.onBeforeCompile(Tt,T),Ot=we.acquireProgram(Tt,je),Lt.set(je,Ot),ke.uniforms=Tt.uniforms;const xt=ke.uniforms;return(!ee.isShaderMaterial&&!ee.isRawShaderMaterial||ee.clipping===!0)&&(xt.clippingPlanes=at.uniform),Pr(ee,Tt),ke.needsLights=Hs(ee),ke.lightsStateVersion=yt,ke.needsLights&&(xt.ambientLightColor.value=Te.state.ambient,xt.lightProbe.value=Te.state.probe,xt.directionalLights.value=Te.state.directional,xt.directionalLightShadows.value=Te.state.directionalShadow,xt.spotLights.value=Te.state.spot,xt.spotLightShadows.value=Te.state.spotShadow,xt.rectAreaLights.value=Te.state.rectArea,xt.ltc_1.value=Te.state.rectAreaLTC1,xt.ltc_2.value=Te.state.rectAreaLTC2,xt.pointLights.value=Te.state.point,xt.pointLightShadows.value=Te.state.pointShadow,xt.hemisphereLights.value=Te.state.hemi,xt.directionalShadowMap.value=Te.state.directionalShadowMap,xt.directionalShadowMatrix.value=Te.state.directionalShadowMatrix,xt.spotShadowMap.value=Te.state.spotShadowMap,xt.spotLightMatrix.value=Te.state.spotLightMatrix,xt.spotLightMap.value=Te.state.spotLightMap,xt.pointShadowMap.value=Te.state.pointShadowMap,xt.pointShadowMatrix.value=Te.state.pointShadowMatrix),ke.currentProgram=Ot,ke.uniformsList=null,Ot}function hi(ee){if(ee.uniformsList===null){const Se=ee.currentProgram.getUniforms();ee.uniformsList=Gg.seqWithValue(Se.seq,ee.uniforms)}return ee.uniformsList}function Pr(ee,Se){const Ue=Re.get(ee);Ue.outputColorSpace=Se.outputColorSpace,Ue.batching=Se.batching,Ue.batchingColor=Se.batchingColor,Ue.instancing=Se.instancing,Ue.instancingColor=Se.instancingColor,Ue.instancingMorph=Se.instancingMorph,Ue.skinning=Se.skinning,Ue.morphTargets=Se.morphTargets,Ue.morphNormals=Se.morphNormals,Ue.morphColors=Se.morphColors,Ue.morphTargetsCount=Se.morphTargetsCount,Ue.numClippingPlanes=Se.numClippingPlanes,Ue.numIntersection=Se.numClipIntersection,Ue.vertexAlphas=Se.vertexAlphas,Ue.vertexTangents=Se.vertexTangents,Ue.toneMapping=Se.toneMapping}function xo(ee,Se,Ue,ke,Te){Se.isScene!==!0&&(Se=ze),He.resetTextureUnits();const lt=Se.fog,yt=ke.isMeshStandardMaterial?Se.environment:null,Tt=N===null?T.outputColorSpace:N.isXRRenderTarget===!0?N.texture.colorSpace:ia,je=(ke.isMeshStandardMaterial?B:Q).get(ke.envMap||yt),Lt=ke.vertexColors===!0&&!!Ue.attributes.color&&Ue.attributes.color.itemSize===4,Ot=!!Ue.attributes.tangent&&(!!ke.normalMap||ke.anisotropy>0),xt=!!Ue.morphAttributes.position,Zt=!!Ue.morphAttributes.normal,wn=!!Ue.morphAttributes.color;let pn=ea;ke.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(pn=T.toneMapping);const En=Ue.morphAttributes.position||Ue.morphAttributes.normal||Ue.morphAttributes.color,Mt=En!==void 0?En.length:0,ft=Re.get(ke),Qt=S.state.lights;if(ne===!0&&(ie===!0||ee!==F)){const Jn=ee===F&&ke.id===H;at.setState(ke,ee,Jn)}let zt=!1;ke.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==Qt.state.version||ft.outputColorSpace!==Tt||Te.isBatchedMesh&&ft.batching===!1||!Te.isBatchedMesh&&ft.batching===!0||Te.isBatchedMesh&&ft.batchingColor===!0&&Te.colorTexture===null||Te.isBatchedMesh&&ft.batchingColor===!1&&Te.colorTexture!==null||Te.isInstancedMesh&&ft.instancing===!1||!Te.isInstancedMesh&&ft.instancing===!0||Te.isSkinnedMesh&&ft.skinning===!1||!Te.isSkinnedMesh&&ft.skinning===!0||Te.isInstancedMesh&&ft.instancingColor===!0&&Te.instanceColor===null||Te.isInstancedMesh&&ft.instancingColor===!1&&Te.instanceColor!==null||Te.isInstancedMesh&&ft.instancingMorph===!0&&Te.morphTexture===null||Te.isInstancedMesh&&ft.instancingMorph===!1&&Te.morphTexture!==null||ft.envMap!==je||ke.fog===!0&&ft.fog!==lt||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==at.numPlanes||ft.numIntersection!==at.numIntersection)||ft.vertexAlphas!==Lt||ft.vertexTangents!==Ot||ft.morphTargets!==xt||ft.morphNormals!==Zt||ft.morphColors!==wn||ft.toneMapping!==pn||ft.morphTargetsCount!==Mt)&&(zt=!0):(zt=!0,ft.__version=ke.version);let xn=ft.currentProgram;zt===!0&&(xn=Si(ke,Se,Te));let ri=!1,Tn=!1,Hn=!1;const an=xn.getUniforms(),Ci=ft.uniforms;if(Ae.useProgram(xn.program)&&(ri=!0,Tn=!0,Hn=!0),ke.id!==H&&(H=ke.id,Tn=!0),ri||F!==ee){an.setValue(Y,"projectionMatrix",ee.projectionMatrix),an.setValue(Y,"viewMatrix",ee.matrixWorldInverse);const Jn=an.map.cameraPosition;Jn!==void 0&&Jn.setValue(Y,le.setFromMatrixPosition(ee.matrixWorld)),Ge.logarithmicDepthBuffer&&an.setValue(Y,"logDepthBufFC",2/(Math.log(ee.far+1)/Math.LN2)),(ke.isMeshPhongMaterial||ke.isMeshToonMaterial||ke.isMeshLambertMaterial||ke.isMeshBasicMaterial||ke.isMeshStandardMaterial||ke.isShaderMaterial)&&an.setValue(Y,"isOrthographic",ee.isOrthographicCamera===!0),F!==ee&&(F=ee,Tn=!0,Hn=!0)}if(Te.isSkinnedMesh){an.setOptional(Y,Te,"bindMatrix"),an.setOptional(Y,Te,"bindMatrixInverse");const Jn=Te.skeleton;Jn&&(Jn.boneTexture===null&&Jn.computeBoneTexture(),an.setValue(Y,"boneTexture",Jn.boneTexture,He))}Te.isBatchedMesh&&(an.setOptional(Y,Te,"batchingTexture"),an.setValue(Y,"batchingTexture",Te._matricesTexture,He),an.setOptional(Y,Te,"batchingIdTexture"),an.setValue(Y,"batchingIdTexture",Te._indirectTexture,He),an.setOptional(Y,Te,"batchingColorTexture"),Te._colorsTexture!==null&&an.setValue(Y,"batchingColorTexture",Te._colorsTexture,He));const fs=Ue.morphAttributes;if((fs.position!==void 0||fs.normal!==void 0||fs.color!==void 0)&&wt.update(Te,Ue,xn),(Tn||ft.receiveShadow!==Te.receiveShadow)&&(ft.receiveShadow=Te.receiveShadow,an.setValue(Y,"receiveShadow",Te.receiveShadow)),ke.isMeshGouraudMaterial&&ke.envMap!==null&&(Ci.envMap.value=je,Ci.flipEnvMap.value=je.isCubeTexture&&je.isRenderTargetTexture===!1?-1:1),ke.isMeshStandardMaterial&&ke.envMap===null&&Se.environment!==null&&(Ci.envMapIntensity.value=Se.environmentIntensity),Tn&&(an.setValue(Y,"toneMappingExposure",T.toneMappingExposure),ft.needsLights&&Vn(Ci,Hn),lt&&ke.fog===!0&&ut.refreshFogUniforms(Ci,lt),ut.refreshMaterialUniforms(Ci,ke,fe,se,S.state.transmissionRenderTarget[ee.id]),Gg.upload(Y,hi(ft),Ci,He)),ke.isShaderMaterial&&ke.uniformsNeedUpdate===!0&&(Gg.upload(Y,hi(ft),Ci,He),ke.uniformsNeedUpdate=!1),ke.isSpriteMaterial&&an.setValue(Y,"center",Te.center),an.setValue(Y,"modelViewMatrix",Te.modelViewMatrix),an.setValue(Y,"normalMatrix",Te.normalMatrix),an.setValue(Y,"modelMatrix",Te.matrixWorld),ke.isShaderMaterial||ke.isRawShaderMaterial){const Jn=ke.uniformsGroups;for(let pi=0,Ni=Jn.length;pi<Ni;pi++){const Yr=Jn[pi];qe.update(Yr,xn),qe.bind(Yr,xn)}}return xn}function Vn(ee,Se){ee.ambientLightColor.needsUpdate=Se,ee.lightProbe.needsUpdate=Se,ee.directionalLights.needsUpdate=Se,ee.directionalLightShadows.needsUpdate=Se,ee.pointLights.needsUpdate=Se,ee.pointLightShadows.needsUpdate=Se,ee.spotLights.needsUpdate=Se,ee.spotLightShadows.needsUpdate=Se,ee.rectAreaLights.needsUpdate=Se,ee.hemisphereLights.needsUpdate=Se}function Hs(ee){return ee.isMeshLambertMaterial||ee.isMeshToonMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.isShadowMaterial||ee.isShaderMaterial&&ee.lights===!0}this.getActiveCubeFace=function(){return U},this.getActiveMipmapLevel=function(){return k},this.getRenderTarget=function(){return N},this.setRenderTargetTextures=function(ee,Se,Ue){Re.get(ee.texture).__webglTexture=Se,Re.get(ee.depthTexture).__webglTexture=Ue;const ke=Re.get(ee);ke.__hasExternalTextures=!0,ke.__autoAllocateDepthBuffer=Ue===void 0,ke.__autoAllocateDepthBuffer||Le.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ke.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(ee,Se){const Ue=Re.get(ee);Ue.__webglFramebuffer=Se,Ue.__useDefaultFramebuffer=Se===void 0},this.setRenderTarget=function(ee,Se=0,Ue=0){N=ee,U=Se,k=Ue;let ke=!0,Te=null,lt=!1,yt=!1;if(ee){const je=Re.get(ee);if(je.__useDefaultFramebuffer!==void 0)Ae.bindFramebuffer(Y.FRAMEBUFFER,null),ke=!1;else if(je.__webglFramebuffer===void 0)He.setupRenderTarget(ee);else if(je.__hasExternalTextures)He.rebindTextures(ee,Re.get(ee.texture).__webglTexture,Re.get(ee.depthTexture).__webglTexture);else if(ee.depthBuffer){const xt=ee.depthTexture;if(je.__boundDepthTexture!==xt){if(xt!==null&&Re.has(xt)&&(ee.width!==xt.image.width||ee.height!==xt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");He.setupDepthRenderbuffer(ee)}}const Lt=ee.texture;(Lt.isData3DTexture||Lt.isDataArrayTexture||Lt.isCompressedArrayTexture)&&(yt=!0);const Ot=Re.get(ee).__webglFramebuffer;
3880ee.isWebGLCubeRenderTarget?(Array.isArray(Ot[Se])?Te=Ot[Se][Ue]:Te=Ot[Se],lt=!0):ee.samples>0&&He.useMultisampledRTT(ee)===!1?Te=Re.get(ee).__webglMultisampledFramebuffer:Array.isArray(Ot)?Te=Ot[Ue]:Te=Ot,I.copy(ee.viewport),G.copy(ee.scissor),W=ee.scissorTest}else I.copy(Z).multiplyScalar(fe).floor(),G.copy(O).multiplyScalar(fe).floor(),W=j;if(Ae.bindFramebuffer(Y.FRAMEBUFFER,Te)&&ke&&Ae.drawBuffers(ee,Te),Ae.viewport(I),Ae.scissor(G),Ae.setScissorTest(W),lt){const je=Re.get(ee.texture);Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_CUBE_MAP_POSITIVE_X+Se,je.__webglTexture,Ue)}else if(yt){const je=Re.get(ee.texture),Lt=Se||0;Y.framebufferTextureLayer(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,je.__webglTexture,Ue||0,Lt)}H=-1},this.readRenderTargetPixels=function(ee,Se,Ue,ke,Te,lt,yt){if(!(ee&&ee.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Tt=Re.get(ee).__webglFramebuffer;if(ee.isWebGLCubeRenderTarget&&yt!==void 0&&(Tt=Tt[yt]),Tt){Ae.bindFramebuffer(Y.FRAMEBUFFER,Tt);try{const je=ee.texture,Lt=je.format,Ot=je.type;if(!Ge.textureFormatReadable(Lt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ge.textureTypeReadable(Ot)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Se>=0&&Se<=ee.width-ke&&Ue>=0&&Ue<=ee.height-Te&&Y.readPixels(Se,Ue,ke,Te,it.convert(Lt),it.convert(Ot),lt)}finally{const je=N!==null?Re.get(N).__webglFramebuffer:null;Ae.bindFramebuffer(Y.FRAMEBUFFER,je)}}},this.readRenderTargetPixelsAsync=async function(ee,Se,Ue,ke,Te,lt,yt){if(!(ee&&ee.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Tt=Re.get(ee).__webglFramebuffer;if(ee.isWebGLCubeRenderTarget&&yt!==void 0&&(Tt=Tt[yt]),Tt){Ae.bindFramebuffer(Y.FRAMEBUFFER,Tt);try{const je=ee.texture,Lt=je.format,Ot=je.type;if(!Ge.textureFormatReadable(Lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ge.textureTypeReadable(Ot))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(Se>=0&&Se<=ee.width-ke&&Ue>=0&&Ue<=ee.height-Te){const xt=Y.createBuffer();Y.bindBuffer(Y.PIXEL_PACK_BUFFER,xt),Y.bufferData(Y.PIXEL_PACK_BUFFER,lt.byteLength,Y.STREAM_READ),Y.readPixels(Se,Ue,ke,Te,it.convert(Lt),it.convert(Ot),0),Y.flush();const Zt=Y.fenceSync(Y.SYNC_GPU_COMMANDS_COMPLETE,0);await JT(Y,Zt,4);try{Y.bindBuffer(Y.PIXEL_PACK_BUFFER,xt),Y.getBufferSubData(Y.PIXEL_PACK_BUFFER,0,lt)}finally{Y.deleteBuffer(xt),Y.deleteSync(Zt)}return lt}}finally{const je=N!==null?Re.get(N).__webglFramebuffer:null;Ae.bindFramebuffer(Y.FRAMEBUFFER,je)}}},this.copyFramebufferToTexture=function(ee,Se=null,Ue=0){ee.isTexture!==!0&&(ff("WebGLRenderer: copyFramebufferToTexture function signature has changed."),Se=arguments[0]||null,ee=arguments[1]);const ke=Math.pow(2,-Ue),Te=Math.floor(ee.image.width*ke),lt=Math.floor(ee.image.height*ke),yt=Se!==null?Se.x:0,Tt=Se!==null?Se.y:0;He.setTexture2D(ee,0),Y.copyTexSubImage2D(Y.TEXTURE_2D,Ue,0,0,yt,Tt,Te,lt),Ae.unbindTexture()},this.copyTextureToTexture=function(ee,Se,Ue=null,ke=null,Te=0){ee.isTexture!==!0&&(ff("WebGLRenderer: copyTextureToTexture function signature has changed."),ke=arguments[0]||null,ee=arguments[1],Se=arguments[2],Te=arguments[3]||0,Ue=null);let lt,yt,Tt,je,Lt,Ot;Ue!==null?(lt=Ue.max.x-Ue.min.x,yt=Ue.max.y-Ue.min.y,Tt=Ue.min.x,je=Ue.min.y):(lt=ee.image.width,yt=ee.image.height,Tt=0,je=0),ke!==null?(Lt=ke.x,Ot=ke.y):(Lt=0,Ot=0);const xt=it.convert(Se.format),Zt=it.convert(Se.type);He.setTexture2D(Se,0),Y.pixelStorei(Y.UNPACK_FLIP_Y_WEBGL,Se.flipY),Y.pixelStorei(Y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Se.premultiplyAlpha),Y.pixelStorei(Y.UNPACK_ALIGNMENT,Se.unpackAlignment);const wn=Y.getParameter(Y.UNPACK_ROW_LENGTH),pn=Y.getParameter(Y.UNPACK_IMAGE_HEIGHT),En=Y.getParameter(Y.UNPACK_SKIP_PIXELS),Mt=Y.getParameter(Y.UNPACK_SKIP_ROWS),ft=Y.getParameter(Y.UNPACK_SKIP_IMAGES),Qt=ee.isCompressedTexture?ee.mipmaps[Te]:ee.image;Y.pixelStorei(Y.UNPACK_ROW_LENGTH,Qt.width),Y.pixelStorei(Y.UNPACK_IMAGE_HEIGHT,Qt.height),Y.pixelStorei(Y.UNPACK_SKIP_PIXELS,Tt),Y.pixelStorei(Y.UNPACK_SKIP_ROWS,je),ee.isDataTexture?Y.texSubImage2D(Y.TEXTURE_2D,Te,Lt,Ot,lt,yt,xt,Zt,Qt.data):ee.isCompressedTexture?Y.compressedTexSubImage2D(Y.TEXTURE_2D,Te,Lt,Ot,Qt.width,Qt.height,xt,Qt.data):Y.texSubImage2D(Y.TEXTURE_2D,Te,Lt,Ot,lt,yt,xt,Zt,Qt),Y.pixelStorei(Y.UNPACK_ROW_LENGTH,wn),Y.pixelStorei(Y.UNPACK_IMAGE_HEIGHT,pn),Y.pixelStorei(Y.UNPACK_SKIP_PIXELS,En),Y.pixelStorei(Y.UNPACK_SKIP_ROWS,Mt),Y.pixelStorei(Y.UNPACK_SKIP_IMAGES,ft),Te===0&&Se.generateMipmaps&&Y.generateMipmap(Y.TEXTURE_2D),Ae.unbindTexture()},this.copyTextureToTexture3D=function(ee,Se,Ue=null,ke=null,Te=0){ee.isTexture!==!0&&(ff("WebGLRenderer: copyTextureToTexture3D function signature has changed."),Ue=arguments[0]||null,ke=arguments[1]||null,ee=arguments[2],Se=arguments[3],Te=arguments[4]||0);let lt,yt,Tt,je,Lt,Ot,xt,Zt,wn;const pn=ee.isCompressedTexture?ee.mipmaps[Te]:ee.image;Ue!==null?(lt=Ue.max.x-Ue.min.x,yt=Ue.max.y-Ue.min.y,Tt=Ue.max.z-Ue.min.z,je=Ue.min.x,Lt=Ue.min.y,Ot=Ue.min.z):(lt=pn.width,yt=pn.height,Tt=pn.depth,je=0,Lt=0,Ot=0),ke!==null?(xt=ke.x,Zt=ke.y,wn=ke.z):(xt=0,Zt=0,wn=0);const En=it.convert(Se.format),Mt=it.convert(Se.type);let ft;if(Se.isData3DTexture)He.setTexture3D(Se,0),ft=Y.TEXTURE_3D;else if(Se.isDataArrayTexture||Se.isCompressedArrayTexture)He.setTexture2DArray(Se,0),ft=Y.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Y.pixelStorei(Y.UNPACK_FLIP_Y_WEBGL,Se.flipY),Y.pixelStorei(Y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Se.premultiplyAlpha),Y.pixelStorei(Y.UNPACK_ALIGNMENT,Se.unpackAlignment);
vendor: 34,623 bytes, line 3880
3880const Qt=Y.getParameter(Y.UNPACK_ROW_LENGTH),zt=Y.getParameter(Y.UNPACK_IMAGE_HEIGHT),xn=Y.getParameter(Y.UNPACK_SKIP_PIXELS),ri=Y.getParameter(Y.UNPACK_SKIP_ROWS),Tn=Y.getParameter(Y.UNPACK_SKIP_IMAGES);Y.pixelStorei(Y.UNPACK_ROW_LENGTH,pn.width),Y.pixelStorei(Y.UNPACK_IMAGE_HEIGHT,pn.height),Y.pixelStorei(Y.UNPACK_SKIP_PIXELS,je),Y.pixelStorei(Y.UNPACK_SKIP_ROWS,Lt),Y.pixelStorei(Y.UNPACK_SKIP_IMAGES,Ot),ee.isDataTexture||ee.isData3DTexture?Y.texSubImage3D(ft,Te,xt,Zt,wn,lt,yt,Tt,En,Mt,pn.data):Se.isCompressedArrayTexture?Y.compressedTexSubImage3D(ft,Te,xt,Zt,wn,lt,yt,Tt,En,pn.data):Y.texSubImage3D(ft,Te,xt,Zt,wn,lt,yt,Tt,En,Mt,pn),Y.pixelStorei(Y.UNPACK_ROW_LENGTH,Qt),Y.pixelStorei(Y.UNPACK_IMAGE_HEIGHT,zt),Y.pixelStorei(Y.UNPACK_SKIP_PIXELS,xn),Y.pixelStorei(Y.UNPACK_SKIP_ROWS,ri),Y.pixelStorei(Y.UNPACK_SKIP_IMAGES,Tn),Te===0&&Se.generateMipmaps&&Y.generateMipmap(ft),Ae.unbindTexture()},this.initRenderTarget=function(ee){Re.get(ee).__webglFramebuffer===void 0&&He.setupRenderTarget(ee)},this.initTexture=function(ee){ee.isCubeTexture?He.setTextureCube(ee,0):ee.isData3DTexture?He.setTexture3D(ee,0):ee.isDataArrayTexture||ee.isCompressedArrayTexture?He.setTexture2DArray(ee,0):He.setTexture2D(ee,0),Ae.unbindTexture()},this.resetState=function(){U=0,k=0,N=null,Ae.reset(),ue.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ra}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===B0?"display-p3":"srgb",t.unpackColorSpace=kn.workingColorSpace===Tp?"display-p3":"srgb"}}class j0{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new St(e),this.density=t}clone(){return new j0(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class W0{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new St(e),this.near=t,this.far=n}clone(){return new W0(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class dp extends In{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 io,this.environmentIntensity=1,this.environmentRotation=new io,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 X0{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ap,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=no()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return ff("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[n+i];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=no()),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]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}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=no()),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 Es=new te;class to{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}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,n=this.data.count;t<n;t++)Es.fromBufferAttribute(this,t),Es.applyMatrix4(e),this.setXYZ(t,Es.x,Es.y,Es.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Es.fromBufferAttribute(this,t),Es.applyNormalMatrix(e),this.setXYZ(t,Es.x,Es.y,Es.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Es.fromBufferAttribute(this,t),Es.transformDirection(e),this.setXYZ(t,Es.x,Es.y,Es.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=As(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=un(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=un(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=un(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=un(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=un(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=As(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=As(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=As(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=As(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=un(t,this.array),n=un(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=un(t,this.array),n=un(n,this.array),i=un(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=un(t,this.array),n=un(n,this.array),i=un(i,this.array),s=un(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,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 n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new zn(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 to(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 n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+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 p1 extends Rr{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new St(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 Xd;const bh=new te,Yd=new te,qd=new te,Kd=new We,wh=new We,UM=new Xt,ng=new te,Mh=new te,ig=new te,CS=new We,Sy=new We,RS=new We;class kM extends In{constructor(e=new p1){if(super(),this.isSprite=!0,this.type="Sprite",Xd===void 0){Xd=new qt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new X0(t,5);Xd.setIndex([0,1,2,0,2,3]),Xd.setAttribute("position",new to(n,3,0,!1)),Xd.setAttribute("uv",new to(n,2,3,!1))}this.geometry=Xd,this.material=e,this.center=new We(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Yd.setFromMatrixScale(this.matrixWorld),UM.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),qd.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Yd.multiplyScalar(-qd.z);const n=this.material.rotation;let i,s;n!==0&&(s=Math.cos(n),i=Math.sin(n));const o=this.center;rg(ng.set(-.5,-.5,0),qd,o,Yd,i,s),rg(Mh.set(.5,-.5,0),qd,o,Yd,i,s),rg(ig.set(.5,.5,0),qd,o,Yd,i,s),CS.set(0,0),Sy.set(1,0),RS.set(1,1);let l=e.ray.intersectTriangle(ng,Mh,ig,!1,bh);if(l===null&&(rg(Mh.set(-.5,.5,0),qd,o,Yd,i,s),Sy.set(0,1),l=e.ray.intersectTriangle(ng,ig,Mh,!1,bh),l===null))return;const u=e.ray.origin.distanceTo(bh);u<e.near||u>e.far||t.push({distance:u,point:bh.clone(),uv:eo.getInterpolation(bh,ng,Mh,ig,CS,Sy,RS,new We),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 rg(r,e,t,n,i,s){Kd.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(wh.x=s*Kd.x-i*Kd.y,wh.y=i*Kd.x+s*Kd.y):wh.copy(Kd),r.copy(e),r.x+=wh.x,r.y+=wh.y,r.applyMatrix4(UM)}const sg=new te,PS=new te;class FM extends In{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 n=0,i=t.length;n<i;n++){const s=t[n];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let s;for(s=0;s<i.length&&!(t<i[s].distance);s++);return i.splice(s,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let s=t[n].distance;if(t[n].object.visible&&(s-=s*t[n].hysteresis),e<s)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){sg.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(sg);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){sg.setFromMatrixPosition(e.matrixWorld),PS.setFromMatrixPosition(this.matrixWorld);const n=sg.distanceTo(PS)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i<s;i++){let o=t[i].distance;if(t[i].object.visible&&(o-=o*t[i].hysteresis),n>=o)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<s;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,s=n.length;i<s;i++){const o=n[i];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}}const IS=new te,LS=new fn,DS=new fn,u3=new te,US=new Xt,og=new te,by=new hr,kS=new Xt,wy=new ku;class NM extends ui{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=hx,this.bindMatrix=new Xt,this.bindMatrixInverse=new Xt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new ir),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,og),this.boundingBox.expandByPoint(og)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new hr),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,og),this.boundingSphere.expandByPoint(og)}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 n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),by.copy(this.boundingSphere),by.applyMatrix4(i),e.ray.intersectsSphere(by)!==!1&&(kS.copy(i).invert(),wy.copy(e.ray).applyMatrix4(kS),!(this.boundingBox!==null&&wy.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,wy)))}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 fn,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===hx?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===sM?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;LS.fromBufferAttribute(i.attributes.skinIndex,e),DS.fromBufferAttribute(i.attributes.skinWeight,e),IS.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=DS.getComponent(s);if(o!==0){const l=LS.getComponent(s);US.multiplyMatrices(n.bones[l].matrixWorld,n.boneInverses[l]),t.addScaledVector(u3.copy(IS).applyMatrix4(US),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class m1 extends In{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Pa extends di{constructor(e=null,t=1,n=1,i,s,o,l,u,d=yi,p=yi,m,v){super(null,o,l,u,d,p,i,s,m,v),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const FS=new Xt,d3=new Xt;class Y0{constructor(e=[],t=[]){this.uuid=no(),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 n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Xt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new Xt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:d3;FS.multiplyMatrices(l,t[s]),FS.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Y0(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 n=new Pa(t,e,e,ls,as);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const s=e.bones[n];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new m1),this.bones.push(o),this.boneInverses.push(new Xt().fromArray(e.boneInverses[n]))}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,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const l=n[i];e.boneInverses.push(l.toArray())}return e}}class Pu extends zn{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}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 Zd=new Xt,NS=new Xt,ag=[],OS=new ir,f3=new Xt,Eh=new ui,Th=new hr;class OM extends ui{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Pu(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,f3)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new ir),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Zd),OS.copy(e.boundingBox).applyMatrix4(Zd),this.boundingBox.union(OS)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new hr),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Zd),Th.copy(e.boundingSphere).applyMatrix4(Zd),this.boundingSphere.union(Th)}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 n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=n.length+1,o=e*s+1;for(let l=0;l<n.length;l++)n[l]=i[o+l]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Eh.geometry=this.geometry,Eh.material=this.material,Eh.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Th.copy(this.boundingSphere),Th.applyMatrix4(n),e.ray.intersectsSphere(Th)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Zd),NS.multiplyMatrices(n,Zd),Eh.matrixWorld=NS,Eh.raycast(e,ag);for(let o=0,l=ag.length;o<l;o++){const u=ag[o];u.instanceId=s,u.object=this,t.push(u)}ag.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Pu(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 n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new Pa(new Float32Array(i*this.count),i,this.count,k0,as));const s=this.morphTexture.source.data.data;let o=0;for(let d=0;d<n.length;d++)o+=n[d];const l=this.geometry.morphTargetsRelative?1:1-o,u=i*e;s[u]=l,s.set(n,u+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}function h3(r,e){return r.z-e.z}function p3(r,e){return e.z-r.z}class m3{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n){const i=this.pool,s=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});const o=i[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=n}reset(){this.list.length=0,this.index=0}}const ic=new Xt,My=new Xt,g3=new Xt,v3=new St(1,1,1),BS=new Xt,Ey=new Rp,lg=new ir,ou=new hr,Ah=new te,zS=new te,y3=new te,Ty=new m3,ss=new ui,cg=[];function x3(r,e,t=0){const n=e.itemSize;if(r.isInterleavedBufferAttribute||r.array.constructor!==e.array.constructor){const i=r.count;for(let s=0;s<i;s++)for(let o=0;o<n;o++)e.setComponent(s+t,o,r.getComponent(s,o))}else e.array.set(r.array,t*n);e.needsUpdate=!0}class BM extends ui{get maxInstanceCount(){return this._maxInstanceCount}constructor(e,t,n=t*2,i){super(new qt,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawInfo=[],this._drawRanges=[],this._reservedRanges=[],this._bounds=[],this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,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),n=new Pa(t,e,e,ls,as);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new Pa(t,e,e,Mp,xl);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new Pa(t,e,e,ls,as);n.colorSpace=kn.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,i=this._maxIndexCount;if(this._geometryInitialized===!1){for(const s in e.attributes){const o=e.getAttribute(s),{array:l,itemSize:u,normalized:d}=o,p=new l.constructor(n*u),m=new zn(p,u,d);t.setAttribute(s,m)}if(e.getIndex()!==null){const s=n>65535?new Uint32Array(i):new Uint16Array(i);t.setIndex(new zn(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 n in t.attributes){if(!e.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=e.getAttribute(n),s=t.getAttribute(n);if(i.itemSize!==s.itemSize||i.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 ir);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let n=0,i=t.length;n<i;n++){if(t[n].active===!1)continue;const s=t[n].geometryIndex;this.getMatrixAt(n,ic),this.getBoundingBoxAt(s,lg).applyMatrix4(ic),e.union(lg)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new hr);const e=this.boundingSphere,t=this._drawInfo;e.makeEmpty();for(let n=0,i=t.length;n<i;n++){if(t[n].active===!1)continue;const s=t[n].geometryIndex;this.getMatrixAt(n,ic),this.getBoundingSphereAt(s,ou).applyMatrix4(ic),e.union(ou)}}addInstance(e){if(this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:e});const t=this._drawInfo.length-1,n=this._matricesTexture,i=n.image.data;g3.toArray(i,t*16),n.needsUpdate=!0;const s=this._colorsTexture;return s&&(v3.toArray(s.image.data,t*4),s.needsUpdate=!0),t}addGeometry(e,t=-1,n=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,l=this._drawRanges,u=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=t,s===null?i.vertexStart=0:i.vertexStart=s.vertexStart+s.vertexCount;const d=e.getIndex(),p=d!==null;if(p&&(n===-1?i.indexCount=d.count:i.indexCount=n,s===null?i.indexStart=0:i.indexStart=s.indexStart+s.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const m=this._geometryCount;return this._geometryCount++,o.push(i),l.push({start:p?i.indexStart:i.vertexStart,count:-1}),u.push({boxInitialized:!1,box:new ir,sphereInitialized:!1,sphere:new hr}),this.setGeometryAt(m,e),m}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,i=n.getIndex()!==null,s=n.getIndex(),o=t.getIndex(),l=this._reservedRanges[e];if(i&&o.count>l.indexCount||t.attributes.position.count>l.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const u=l.vertexStart,d=l.vertexCount;for(const y in n.attributes){const x=t.getAttribute(y),M=n.getAttribute(y);x3(x,M,u);const S=x.itemSize;for(let w=x.count,A=d;w<A;w++){const T=u+w;for(let R=0;R<S;R++)M.setComponent(T,R,0)}M.needsUpdate=!0,M.addUpdateRange(u*S,d*S)}if(i){const y=l.indexStart;for(let x=0;x<o.count;x++)s.setX(y+x,u+o.getX(x));for(let x=o.count,M=l.indexCount;x<M;x++)s.setX(y+x,u);s.needsUpdate=!0,s.addUpdateRange(y,l.indexCount)}const p=this._bounds[e];t.boundingBox!==null?(p.box.copy(t.boundingBox),p.boxInitialized=!0):p.boxInitialized=!1,t.boundingSphere!==null?(p.sphere.copy(t.boundingSphere),p.sphereInitialized=!0):p.sphereInitialized=!1;const m=this._drawRanges[e],v=t.getAttribute("position");return m.count=i?o.count:v.count,this._visibilityChanged=!0,e}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this._bounds[e],i=n.box,s=this.geometry;if(n.boxInitialized===!1){i.makeEmpty();const o=s.index,l=s.attributes.position,u=this._drawRanges[e];for(let d=u.start,p=u.start+u.count;d<p;d++){let m=d;o&&(m=o.getX(m)),i.expandByPoint(Ah.fromBufferAttribute(l,m))}n.boxInitialized=!0}return t.copy(i),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this._bounds[e],i=n.sphere,s=this.geometry;if(n.sphereInitialized===!1){i.makeEmpty(),this.getBoundingBoxAt(e,lg),lg.getCenter(i.center);const o=s.index,l=s.attributes.position,u=this._drawRanges[e];let d=0;for(let p=u.start,m=u.start+u.count;p<m;p++){let v=p;o&&(v=o.getX(v)),Ah.fromBufferAttribute(l,v),d=Math.max(d,i.center.distanceToSquared(Ah))}i.radius=Math.sqrt(d),n.sphereInitialized=!0}return t.copy(i),t}setMatrixAt(e,t){const n=this._drawInfo,i=this._matricesTexture,s=this._matricesTexture.image.data;return e>=n.length||n[e].active===!1?this:(t.toArray(s,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,t){const n=this._drawInfo,i=this._matricesTexture.image.data;return e>=n.length||n[e].active===!1?null:t.fromArray(i,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const n=this._colorsTexture,i=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(i,e*4),n.needsUpdate=!0,this)}getColorAt(e,t){const n=this._colorsTexture.image.data,i=this._drawInfo;return e>=i.length||i[e].active===!1?null:t.fromArray(n,e*4)}setVisibleAt(e,t){const n=this._drawInfo;return e>=n.length||n[e].active===!1||n[e].visible===t?this:(n[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}raycast(e,t){const n=this._drawInfo,i=this._drawRanges,s=this.matrixWorld,o=this.geometry;ss.material=this.material,ss.geometry.index=o.index,ss.geometry.attributes=o.attributes,ss.geometry.boundingBox===null&&(ss.geometry.boundingBox=new ir),ss.geometry.boundingSphere===null&&(ss.geometry.boundingSphere=new hr);for(let l=0,u=n.length;l<u;l++){if(!n[l].visible||!n[l].active)continue;const d=n[l].geometryIndex,p=i[d];ss.geometry.setDrawRange(p.start,p.count),this.getMatrixAt(l,ss.matrixWorld).premultiply(s),this.getBoundingBoxAt(d,ss.geometry.boundingBox),this.getBoundingSphereAt(d,ss.geometry.boundingSphere),ss.raycast(e,cg);for(let m=0,v=cg.length;m<v;m++){const y=cg[m];y.object=this,y.batchId=l,t.push(y)}cg.length=0}ss.material=null,ss.geometry.index=null,ss.geometry.attributes={},ss.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,n,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=i.getIndex(),l=o===null?1:o.array.BYTES_PER_ELEMENT,u=this._drawInfo,d=this._multiDrawStarts,p=this._multiDrawCounts,m=this._drawRanges,v=this.perObjectFrustumCulled,y=this._indirectTexture,x=y.image.data;v&&(BS.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),Ey.setFromProjectionMatrix(BS,e.coordinateSystem));let M=0;if(this.sortObjects){My.copy(this.matrixWorld).invert(),Ah.setFromMatrixPosition(n.matrixWorld).applyMatrix4(My),zS.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(My);for(let A=0,T=u.length;A<T;A++)if(u[A].visible&&u[A].active){const R=u[A].geometryIndex;this.getMatrixAt(A,ic),this.getBoundingSphereAt(R,ou).applyMatrix4(ic);let U=!1;if(v&&(U=!Ey.intersectsSphere(ou)),!U){const k=y3.subVectors(ou.center,Ah).dot(zS);Ty.push(m[R],k,A)}}const S=Ty.list,w=this.customSort;w===null?S.sort(s.transparent?p3:h3):w.call(this,S,n);for(let A=0,T=S.length;A<T;A++){const R=S[A];d[M]=R.start*l,p[M]=R.count,x[M]=R.index,M++}Ty.reset()}else for(let S=0,w=u.length;S<w;S++)if(u[S].visible&&u[S].active){const A=u[S].geometryIndex;let T=!1;if(v&&(this.getMatrixAt(S,ic),this.getBoundingSphereAt(A,ou).applyMatrix4(ic),T=!Ey.intersectsSphere(ou)),!T){const R=m[A];d[M]=R.start*l,p[M]=R.count,x[M]=S,M++}}y.needsUpdate=!0,this._multiDrawCount=M,this._visibilityChanged=!1}onBeforeShadow(e,t,n,i,s,o){this.onBeforeRender(e,null,i,s,o)}}class Ar extends Rr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new St(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 b0=new te,w0=new te,HS=new Xt,Ch=new ku,ug=new hr,Ay=new te,GS=new te;let cs=class extends In{constructor(e=new qt,t=new Ar){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,n=[0];for(let i=1,s=t.count;i<s;i++)b0.fromBufferAttribute(t,i-1),w0.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=b0.distanceTo(w0);e.setAttribute("lineDistance",new Pt(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),ug.copy(n.boundingSphere),ug.applyM
vendor: 6,793 bytes, line 3880
3880atrix4(i),ug.radius+=s,e.ray.intersectsSphere(ug)===!1)return;HS.copy(i).invert(),Ch.copy(e.ray).applyMatrix4(HS);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,d=this.isLineSegments?2:1,p=n.index,v=n.attributes.position;if(p!==null){const y=Math.max(0,o.start),x=Math.min(p.count,o.start+o.count);for(let M=y,S=x-1;M<S;M+=d){const w=p.getX(M),A=p.getX(M+1),T=dg(this,e,Ch,u,w,A);T&&t.push(T)}if(this.isLineLoop){const M=p.getX(x-1),S=p.getX(y),w=dg(this,e,Ch,u,M,S);w&&t.push(w)}}else{const y=Math.max(0,o.start),x=Math.min(v.count,o.start+o.count);for(let M=y,S=x-1;M<S;M+=d){const w=dg(this,e,Ch,u,M,M+1);w&&t.push(w)}if(this.isLineLoop){const M=dg(this,e,Ch,u,x-1,y);M&&t.push(M)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const l=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}};function dg(r,e,t,n,i,s){const o=r.geometry.attributes.position;if(b0.fromBufferAttribute(o,i),w0.fromBufferAttribute(o,s),t.distanceSqToSegment(b0,w0,Ay,GS)>n)return;Ay.applyMatrix4(r.matrixWorld);const u=e.ray.origin.distanceTo(Ay);if(!(u<e.near||u>e.far))return{distance:u,point:GS.clone().applyMatrix4(r.matrixWorld),index:i,face:null,faceIndex:null,object:r}}const VS=new te,jS=new te;class ra extends cs{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,n=[];for(let i=0,s=t.count;i<s;i+=2)VS.fromBufferAttribute(t,i),jS.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+VS.distanceTo(jS);e.setAttribute("lineDistance",new Pt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class zM extends cs{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class g1 extends Rr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new St(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 WS=new Xt,xx=new ku,fg=new hr,hg=new te;class HM extends In{constructor(e=new qt,t=new g1){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 n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),fg.copy(n.boundingSphere),fg.applyMatrix4(i),fg.radius+=s,e.ray.intersectsSphere(fg)===!1)return;WS.copy(i).invert(),xx.copy(e.ray).applyMatrix4(WS);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,d=n.index,m=n.attributes.position;if(d!==null){const v=Math.max(0,o.start),y=Math.min(d.count,o.start+o.count);for(let x=v,M=y;x<M;x++){const S=d.getX(x);hg.fromBufferAttribute(m,S),XS(hg,S,u,i,e,t,this)}}else{const v=Math.max(0,o.start),y=Math.min(m.count,o.start+o.count);for(let x=v,M=y;x<M;x++)hg.fromBufferAttribute(m,x),XS(hg,x,u,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const l=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}}function XS(r,e,t,n,i,s,o){const l=xx.distanceSqToPoint(r);if(l<t){const u=new te;xx.closestPointToPoint(r,u),u.applyMatrix4(n);const d=i.ray.origin.distanceTo(u);if(d<i.near||d>i.far)return;s.push({distance:d,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class _3 extends di{constructor(e,t,n,i,s,o,l,u,d){super(e,t,n,i,s,o,l,u,d),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:ni,this.magFilter=s!==void 0?s:ni,this.generateMipmaps=!1;const p=this;function m(){p.needsUpdate=!0,e.requestVideoFrameCallback(m)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(m)}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 S3 extends di{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=yi,this.minFilter=yi,this.generateMipmaps=!1,this.needsUpdate=!0}}class q0 extends di{constructor(e,t,n,i,s,o,l,u,d,p,m,v){super(null,o,l,u,d,p,i,s,m,v),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class b3 extends q0{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=yo,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class w3 extends q0{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,yl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class M3 extends di{constructor(e,t,n,i,s,o,l,u,d){super(e,t,n,i,s,o,l,u,d),this.isCanvasTexture=!0,this.needsUpdate=!0}}class sa{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/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 n,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),s+=n.distanceTo(i),t.push(s),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const s=n.length;let o;t?o=t:o=e*n[s-1];let l=0,u=s-1,d;for(;l<=u;)if(i=Math.floor(l+(u-l)/2),d=n[i]-o,d<0)l=i+1;else if(d>0)u=i-1;else{u=i;break}if(i=u,n[i]===o)return i/(s-1);const p=n[i],v=n[i+1]-p,y=(o-p)/v;return(i+y)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),l=this.getPoint(s),u=t||(o.isVector2?new We:new te);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}
vendor: 6,194 bytes, line 3880
3880computeFrenetFrames(e,t){const n=new te,i=[],s=[],o=[],l=new te,u=new Xt;for(let y=0;y<=e;y++){const x=y/e;i[y]=this.getTangentAt(x,new te)}s[0]=new te,o[0]=new te;let d=Number.MAX_VALUE;const p=Math.abs(i[0].x),m=Math.abs(i[0].y),v=Math.abs(i[0].z);p<=d&&(d=p,n.set(1,0,0)),m<=d&&(d=m,n.set(0,1,0)),v<=d&&n.set(0,0,1),l.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],l),o[0].crossVectors(i[0],s[0]);for(let y=1;y<=e;y++){if(s[y]=s[y-1].clone(),o[y]=o[y-1].clone(),l.crossVectors(i[y-1],i[y]),l.length()>Number.EPSILON){l.normalize();const x=Math.acos(ki(i[y-1].dot(i[y]),-1,1));s[y].applyMatrix4(u.makeRotationAxis(l,x))}o[y].crossVectors(i[y],s[y])}if(t===!0){let y=Math.acos(ki(s[0].dot(s[e]),-1,1));y/=e,i[0].dot(l.crossVectors(s[0],s[e]))>0&&(y=-y);for(let x=1;x<=e;x++)s[x].applyMatrix4(u.makeRotationAxis(i[x],y*x)),o[x].crossVectors(i[x],s[x])}return{tangents:i,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 K0 extends sa{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t=new We){const n=t,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(o?s=0:s=i),this.aClockwise===!0&&!o&&(s===i?s=-i:s=s-i);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),d=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const p=Math.cos(this.aRotation),m=Math.sin(this.aRotation),v=u-this.aX,y=d-this.aY;u=v*p-y*m+this.aX,d=v*m+y*p+this.aY}return n.set(u,d)}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 GM extends K0{constructor(e,t,n,i,s,o){super(e,t,n,n,i,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function v1(){let r=0,e=0,t=0,n=0;function i(s,o,l,u){r=s,e=l,t=-3*s+3*o-2*l-u,n=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,d){i(o,l,d*(l-s),d*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,d,p,m){let v=(o-s)/d-(l-s)/(d+p)+(l-o)/p,y=(l-o)/p-(u-o)/(p+m)+(u-l)/m;v*=p,y*=p,i(o,l,v,y)},calc:function(s){const o=s*s,l=o*s;return r+e*s+t*o+n*l}}}const pg=new te,Cy=new v1,Ry=new v1,Py=new v1;class VM extends sa{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new te){const n=t,i=this.points,s=i.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let d,p;this.closed||l>0?d=i[(l-1)%s]:(pg.subVectors(i[0],i[1]).add(i[0]),d=pg);const m=i[l%s],v=i[(l+1)%s];if(this.closed||l+2<s?p=i[(l+2)%s]:(pg.subVectors(i[s-1],i[s-2]).add(i[s-1]),p=pg),this.curveType==="centripetal"||this.curveType==="chordal"){const y=this.curveType==="chordal"?.5:.25;let x=Math.pow(d.distanceToSquared(m),y),M=Math.pow(m.distanceToSquared(v),y),S=Math.pow(v.distanceToSquared(p),y);M<1e-4&&(M=1),x<1e-4&&(x=M),S<1e-4&&(S=M),Cy.initNonuniformCatmullRom(d.x,m.x,v.x,p.x,x,M,S),Ry.initNonuniformCatmullRom(d.y,m.y,v.y,p.y,x,M,S),Py.initNonuniformCatmullRom(d.z,m.z,v.z,p.z,x,M,S)}else this.curveType==="catmullrom"&&(Cy.initCatmullRom(d.x,m.x,v.x,p.x,this.tension),Ry.initCatmullRom(d.y,m.y,v.y,p.y,this.tension),Py.initCatmullRom(d.z,m.z,v.z,p.z,this.tension));return n.set(Cy.calc(u),Ry.calc(u),Py.calc(u)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.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,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.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,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new te().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function YS(r,e,t,n,i){const s=(n-e)*.5,o=(i-t)*.5,l=r*r,u=r*l;return(2*t-2*n+s+o)*u+(-3*t+3*n-2*s-o)*l+s*r+t}function E3(r,e){const t=1-r;return t*t*e}function T3(r,e){return 2*(1-r)*r*e}function A3(r,e){return r*r*e}function Xh(r,e,t,n){return E3(r,e)+T3(r,t)+A3(r,n)}function C3(r,e){const t=1-r;return t*t*t*e}function R3(r,e){const t=1-r;return 3*t*t*r*e}function P3(r,e){return 3*(1-r)*r*r*e}function I3(r,e){return r*r*r*e}function Yh(r,e,t,n,i){return C3(r,e)+R3(r,t)+P3(r,n)+I3(r,i)}class y1 extends sa{constructor(e=new We,t=new We,n=new We,i=new We){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new We){const n=t,i=this.v0,s=this.v1,o=this.v2,l=this.v3;return n.set(Yh(e,i.x,s.x,o.x,l.x),Yh(e,i.y,s.y,o.y,l.y)),n}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}}
vendor: 5,421 bytes, line 3880
3880class jM extends sa{constructor(e=new te,t=new te,n=new te,i=new te){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new te){const n=t,i=this.v0,s=this.v1,o=this.v2,l=this.v3;return n.set(Yh(e,i.x,s.x,o.x,l.x),Yh(e,i.y,s.y,o.y,l.y),Yh(e,i.z,s.z,o.z,l.z)),n}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 x1 extends sa{constructor(e=new We,t=new We){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new We){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new We){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 WM extends sa{constructor(e=new te,t=new te){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new te){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new te){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 _1 extends sa{constructor(e=new We,t=new We,n=new We){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new We){const n=t,i=this.v0,s=this.v1,o=this.v2;return n.set(Xh(e,i.x,s.x,o.x),Xh(e,i.y,s.y,o.y)),n}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 Nu extends sa{constructor(e=new te,t=new te,n=new te){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new te){const n=t,i=this.v0,s=this.v1,o=this.v2;return n.set(Xh(e,i.x,s.x,o.x),Xh(e,i.y,s.y,o.y),Xh(e,i.z,s.z,o.z)),n}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 S1 extends sa{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new We){const n=t,i=this.points,s=(i.length-1)*e,o=Math.floor(s),l=s-o,u=i[o===0?o:o-1],d=i[o],p=i[o>i.length-2?i.length-1:o+1],m=i[o>i.length-3?i.length-1:o+2];return n.set(YS(l,u.x,d.x,p.x,m.x),YS(l,u.y,d.y,p.y,m.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new We().fromArray(i))}return this}}var M0=Object.freeze({__proto__:null,ArcCurve:GM,CatmullRomCurve3:VM,CubicBezierCurve:y1,CubicBezierCurve3:jM,EllipseCurve:K0,LineCurve:x1,LineCurve3:WM,QuadraticBezierCurve:_1,QuadraticBezierCurve3:Nu,SplineCurve:S1});class XM extends sa{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 n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new M0[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let s=0;for(;s<i.length;){if(i[s]>=n){const o=i[s]-n,l=this.curves[s],u=l.getLength(),d=u===0?0:1-o/u;return l.getPointAt(d,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 n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,s=this.curves;i<s.length;i++){const o=s[i],l=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isS
vendor: 6,575 bytes, line 3880
3880plineCurve?e*o.points.length:e,u=o.getPoints(l);for(let d=0;d<u.length;d++){const p=u[d];n&&n.equals(p)||(t.push(p),n=p)}}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,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(new M0[i.type]().fromJSON(i))}return this}}class fp extends XM{constructor(e){super(),this.type="Path",this.currentPoint=new We,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;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 n=new x1(this.currentPoint.clone(),new We(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const s=new _1(this.currentPoint.clone(),new We(e,t),new We(n,i));return this.curves.push(s),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,s,o){const l=new y1(this.currentPoint.clone(),new We(e,t),new We(n,i),new We(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new S1(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,n,i,s,o),this}absarc(e,t,n,i,s,o){return this.absellipse(e,t,n,n,i,s,o),this}ellipse(e,t,n,i,s,o,l,u){const d=this.currentPoint.x,p=this.currentPoint.y;return this.absellipse(e+d,t+p,n,i,s,o,l,u),this}absellipse(e,t,n,i,s,o,l,u){const d=new K0(e,t,n,i,s,o,l,u);if(this.curves.length>0){const m=d.getPoint(0);m.equals(this.currentPoint)||this.lineTo(m.x,m.y)}this.curves.push(d);const p=d.getPoint(1);return this.currentPoint.copy(p),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 Ip extends qt{constructor(e=[new We(0,-.5),new We(.5,0),new We(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=ki(i,0,Math.PI*2);const s=[],o=[],l=[],u=[],d=[],p=1/t,m=new te,v=new We,y=new te,x=new te,M=new te;let S=0,w=0;for(let A=0;A<=e.length-1;A++)switch(A){case 0:S=e[A+1].x-e[A].x,w=e[A+1].y-e[A].y,y.x=w*1,y.y=-S,y.z=w*0,M.copy(y),y.normalize(),u.push(y.x,y.y,y.z);break;case e.length-1:u.push(M.x,M.y,M.z);break;default:S=e[A+1].x-e[A].x,w=e[A+1].y-e[A].y,y.x=w*1,y.y=-S,y.z=w*0,x.copy(y),y.x+=M.x,y.y+=M.y,y.z+=M.z,y.normalize(),u.push(y.x,y.y,y.z),M.copy(x)}for(let A=0;A<=t;A++){const T=n+A*p*i,R=Math.sin(T),U=Math.cos(T);for(let k=0;k<=e.length-1;k++){m.x=e[k].x*R,m.y=e[k].y,m.z=e[k].x*U,o.push(m.x,m.y,m.z),v.x=A/t,v.y=k/(e.length-1),l.push(v.x,v.y);const N=u[3*k+0]*R,H=u[3*k+1],F=u[3*k+0]*U;d.push(N,H,F)}}for(let A=0;A<t;A++)for(let T=0;T<e.length-1;T++){const R=T+A*e.length,U=R,k=R+e.length,N=R+e.length+1,H=R+1;s.push(U,k,H),s.push(N,H,k)}this.setIndex(s),this.setAttribute("position",new Pt(o,3)),this.setAttribute("uv",new Pt(l,2)),this.setAttribute("normal",new Pt(d,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ip(e.points,e.segments,e.phiStart,e.phiLength)}}class Z0 extends Ip{constructor(e=1,t=1,n=4,i=8){const s=new fp;s.absarc(0,-t/2,e,Math.PI*1.5,0),s.absarc(0,t/2,e,0,Math.PI*.5),super(s.getPoints(n),i),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:n,radialSegments:i}}static fromJSON(e){return new Z0(e.radius,e.length,e.capSegments,e.radialSegments)}}class J0 extends qt{constructor(e=1,t=32,n=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const s=[],o=[],l=[],u=[],d=new te,p=new We;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let m=0,v=3;m<=t;m++,v+=3){const y=n+m/t*i;d.x=e*Math.cos(y),d.y=e*Math.sin(y),o.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(o[v]/e+1)/2,p.y=(o[v+1]/e+1)/2,u.push(p.x,p.y)}for(let m=1;m<=t;m++)s.push(m,m+1,0);this.setIndex(s),this.setAttribute("position",new Pt(o,3)),this.setAttribute("normal",new Pt(l,3)),this.setAttribute("uv",new Pt(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new J0(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class wf extends qt{constructor(e=1,t=1,n=1,i=32,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const d=this;i=Math.floor(i),s=Math.floor(s);const p=[],m=[],v=[],y=[];let x=0;const M=[],S=n/2;let w=0;A(),o===!1&&(e>0&&T(!0),t>0&&T(!1)),this.setIndex(p),this.setAttribute("position",new Pt(m,3)),this.setAttribute("normal",new Pt(v,3)),this.setAttribute("uv",new Pt(y,2));function A(){const R=new te,U=new te;let k=0;const N=(t-e)/n;for(let H=0;H<=s;H++){const F=[],I=H/s,G=I*(t-e)+e;for(let W=0;W<=i;W++){const X=W/i,J=X*u+l,oe=Math.sin(J),se=Math.cos(J);U.x=G*oe,U.y=-I*n+S,U.z=G*se,m.push(U.x,U.y,U.z),R.set(oe,N,se).normalize(),v.push(R.x,R.y,R.z),y.push(X,1-I),F.push(x++)}M.push(F)}for(let H=0;H<i;H++)for(let F=0;F<s;F++){const I=M[F][H],G=M[F+1][H],W=M[F+1][H+1],X=M[F][H+1];p.push(I,G,X),p.push(G,W,X),k+=6}d.addGroup(w,k,0),w+=k}function T(R){const U=x,k=new We,N=new te;let H=0;const F=R===!0?e:t,I=R===!0?1:-1;for(let W=1;W<=i;W++)m.push(0,S*I,0),v.push(0,I,0),y.push(.5,.5),x++;const G=x;for(let W=0;W<=i;W++){const J=W/i*u+l,oe=Math.cos(J),se=Math.sin(J);N.x=F*se,N.y=S*I,N.z=F*oe,m.push(N.x,N.y,N.z),v.push(0,I,0),k.x=oe*.5+.5,k.y=se*.5*I+.5,y.push(k.x,k.y),x++}for(let W=0;W<i;W++){const X=U+W,J=G+W;R===!0?p.push(J,J+1,X):p.push(J+1,J,X),H+=3}d.addGroup(w,H,R===!0?1:2),w+=H}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new wf(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Q0 extends wf{constructor(e=1,t=1,n=32,i=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,n,i,s,o,l),this.type="C
3880oneGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new Q0(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class xc extends qt{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const s=[],o=[];l(i),d(n),p(),this.setAttribute("position",new Pt(s,3)),this.setAttribute("normal",new Pt(s.slice(),3)),this.setAttribute("uv",new Pt(o,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function l(A){const T=new te,R=new te,U=new te;for(let k=0;k<t.length;k+=3)y(t[k+0],T),y(t[k+1],R),y(t[k+2],U),u(T,R,U,A)}function u(A,T,R,U){const k=U+1,N=[];for(let H=0;H<=k;H++){N[H]=[];const F=A.clone().lerp(R,H/k),I=T.clone().lerp(R,H/k),G=k-H;for(let W=0;W<=G;W++)W===0&&H===k?N[H][W]=F:N[H][W]=F.clone().lerp(I,W/G)}for(let H=0;H<k;H++)for(let F=0;F<2*(k-H)-1;F++){const I=Math.floor(F/2);F%2===0?(v(N[H][I+1]),v(N[H+1][I]),v(N[H][I])):(v(N[H][I+1]),v(N[H+1][I+1]),v(N[H+1][I]))}}function d(A){const T=new te;for(let R=0;R<s.length;R+=3)T.x=s[R+0],T.y=s[R+1],T.z=s[R+2],T.normalize().multiplyScalar(A),s[R+0]=T.x,s[R+1]=T.y,s[R+2]=T.z}function p(){const A=new te;for(let T=0;T<s.length;T+=3){A.x=s[T+0],A.y=s[T+1],A.z=s[T+2];const R=S(A)/2/Math.PI+.5,U=w(A)/Math.PI+.5;o.push(R,1-U)}x(),m()}function m(){for(let A=0;A<o.length;A+=6){const T=o[A+0],R=o[A+2],U=o[A+4],k=Math.max(T,R,U),N=Math.min(T,R,U);k>.9&&N<.1&&(T<.2&&(o[A+0]+=1),R<.2&&(o[A+2]+=1),U<.2&&(o[A+4]+=1))}}function v(A){s.push(A.x,A.y,A.z)}function y(A,T){const R=A*3;T.x=e[R+0],T.y=e[R+1],T.z=e[R+2]}function x(){const A=new te,T=new te,R=new te,U=new te,k=new We,N=new We,H=new We;for(let F=0,I=0;F<s.length;F+=9,I+=6){A.set(s[F+0],s[F+1],s[F+2]),T.set(s[F+3],s[F+4],s[F+5]),R.set(s[F+6],s[F+7],s[F+8]),k.set(o[I+0],o[I+1]),N.set(o[I+2],o[I+3]),H.set(o[I+4],o[I+5]),U.copy(A).add(T).add(R).divideScalar(3);const G=S(U);M(k,I+0,A,G),M(N,I+2,T,G),M(H,I+4,R,G)}}function M(A,T,R,U){U<0&&A.x===1&&(o[T]=A.x-1),R.x===0&&R.z===0&&(o[T]=U/2/Math.PI+.5)}function S(A){return Math.atan2(A.z,-A.x)}function w(A){return Math.atan2(-A.y,Math.sqrt(A.x*A.x+A.z*A.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xc(e.vertices,e.indices,e.radius,e.details)}}class $0 extends xc{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n,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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],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: 127,639 bytes, line 3880
388019,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 $0(e.radius,e.detail)}}const mg=new te,gg=new te,Iy=new te,vg=new eo;class YM extends qt{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),s=Math.cos(Eu*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,d=[0,0,0],p=["a","b","c"],m=new Array(3),v={},y=[];for(let x=0;x<u;x+=3){o?(d[0]=o.getX(x),d[1]=o.getX(x+1),d[2]=o.getX(x+2)):(d[0]=x,d[1]=x+1,d[2]=x+2);const{a:M,b:S,c:w}=vg;if(M.fromBufferAttribute(l,d[0]),S.fromBufferAttribute(l,d[1]),w.fromBufferAttribute(l,d[2]),vg.getNormal(Iy),m[0]=`${Math.round(M.x*i)},${Math.round(M.y*i)},${Math.round(M.z*i)}`,m[1]=`${Math.round(S.x*i)},${Math.round(S.y*i)},${Math.round(S.z*i)}`,m[2]=`${Math.round(w.x*i)},${Math.round(w.y*i)},${Math.round(w.z*i)}`,!(m[0]===m[1]||m[1]===m[2]||m[2]===m[0]))for(let A=0;A<3;A++){const T=(A+1)%3,R=m[A],U=m[T],k=vg[p[A]],N=vg[p[T]],H=`${R}_${U}`,F=`${U}_${R}`;F in v&&v[F]?(Iy.dot(v[F].normal)<=s&&(y.push(k.x,k.y,k.z),y.push(N.x,N.y,N.z)),v[F]=null):H in v||(v[H]={index0:d[A],index1:d[T],normal:Iy.clone()})}}for(const x in v)if(v[x]){const{index0:M,index1:S}=v[x];mg.fromBufferAttribute(l,M),gg.fromBufferAttribute(l,S),y.push(mg.x,mg.y,mg.z),y.push(gg.x,gg.y,gg.z)}this.setAttribute("position",new Pt(y,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Au extends fp{constructor(e){super(e),this.uuid=no(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].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,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(new fp().fromJSON(i))}return this}}const L3={triangulate:function(r,e,t=2){const n=e&&e.length,i=n?e[0]*t:r.length;let s=qM(r,0,i,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,d,p,m,v,y;if(n&&(s=N3(r,e,s,t)),r.length>80*t){l=d=r[0],u=p=r[1];for(let x=t;x<i;x+=t)m=r[x],v=r[x+1],m<l&&(l=m),v<u&&(u=v),m>d&&(d=m),v>p&&(p=v);y=Math.max(d-l,p-u),y=y!==0?32767/y:0}return hp(s,o,t,l,u,y,0),o}};function qM(r,e,t,n,i){let s,o;if(i===q3(r,e,t,n)>0)for(s=e;s<t;s+=n)o=qS(s,r[s],r[s+1],o);else for(s=t-n;s>=e;s-=n)o=qS(s,r[s],r[s+1],o);return o&&ev(o,o.next)&&(mp(o),o=o.next),o}function Iu(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(ev(t,t.next)||Ti(t.prev,t,t.next)===0)){if(mp(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function hp(r,e,t,n,i,s,o){if(!r)return;!o&&s&&G3(r,n,i,s);let l=r,u,d;for(;r.prev!==r.next;){if(u=r.prev,d=r.next,s?U3(r,n,i,s):D3(r)){e.push(u.i/t|0),e.push(r.i/t|0),e.push(d.i/t|0),mp(r),r=d.next,l=d.next;continue}if(r=d,r===l){o?o===1?(r=k3(Iu(r),e,t),hp(r,e,t,n,i,s,2)):o===2&&F3(r,e,t,n,i,s):hp(Iu(r),e,t,n,i,s,1);break}}}function D3(r){const e=r.prev,t=r,n=r.next;if(Ti(e,t,n)>=0)return!1;const i=e.x,s=t.x,o=n.x,l=e.y,u=t.y,d=n.y,p=i<s?i<o?i:o:s<o?s:o,m=l<u?l<d?l:d:u<d?u:d,v=i>s?i>o?i:o:s>o?s:o,y=l>u?l>d?l:d:u>d?u:d;let x=n.next;for(;x!==e;){if(x.x>=p&&x.x<=v&&x.y>=m&&x.y<=y&&uf(i,l,s,u,o,d,x.x,x.y)&&Ti(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function U3(r,e,t,n){const i=r.prev,s=r,o=r.next;if(Ti(i,s,o)>=0)return!1;const l=i.x,u=s.x,d=o.x,p=i.y,m=s.y,v=o.y,y=l<u?l<d?l:d:u<d?u:d,x=p<m?p<v?p:v:m<v?m:v,M=l>u?l>d?l:d:u>d?u:d,S=p>m?p>v?p:v:m>v?m:v,w=_x(y,x,e,t,n),A=_x(M,S,e,t,n);let T=r.prevZ,R=r.nextZ;for(;T&&T.z>=w&&R&&R.z<=A;){if(T.x>=y&&T.x<=M&&T.y>=x&&T.y<=S&&T!==i&&T!==o&&uf(l,p,u,m,d,v,T.x,T.y)&&Ti(T.prev,T,T.next)>=0||(T=T.prevZ,R.x>=y&&R.x<=M&&R.y>=x&&R.y<=S&&R!==i&&R!==o&&uf(l,p,u,m,d,v,R.x,R.y)&&Ti(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;T&&T.z>=w;){if(T.x>=y&&T.x<=M&&T.y>=x&&T.y<=S&&T!==i&&T!==o&&uf(l,p,u,m,d,v,T.x,T.y)&&Ti(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;R&&R.z<=A;){if(R.x>=y&&R.x<=M&&R.y>=x&&R.y<=S&&R!==i&&R!==o&&uf(l,p,u,m,d,v,R.x,R.y)&&Ti(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function k3(r,e,t){let n=r;do{const i=n.prev,s=n.next.next;!ev(i,s)&&KM(i,n,n.next,s)&&pp(i,s)&&pp(s,i)&&(e.push(i.i/t|0),e.push(n.i/t|0),e.push(s.i/t|0),mp(n),mp(n.next),n=r=s),n=n.next}while(n!==r);return Iu(n)}function F3(r,e,t,n,i,s){let o=r;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&W3(o,l)){let u=ZM(o,l);o=Iu(o,o.next),u=Iu(u,u.next),hp(o,e,t,n,i,s,0),hp(u,e,t,n,i,s,0);return}l=l.next}o=o.next}while(o!==r)}function N3(r,e,t,n){const i=[];let s,o,l,u,d;for(s=0,o=e.length;s<o;s++)l=e[s]*n,u=s<o-1?e[s+1]*n:r.length,d=qM(r,l,u,n,!1),d===d.next&&(d.steiner=!0),i.push(j3(d));for(i.sort(O3),s=0;s<i.length;s++)t=B3(i[s],t);return t}function O3(r,e){return r.x-e.x}function B3(r,e){const t=z3(r,e);if(!t)return e;const n=ZM(t,r);return Iu(n,n.next),Iu(t,t.next)}function z3(r,e){let t=e,n=-1/0,i;const s=r.x,o=r.y;do{if(o<=t.y&&o>=t.next.y&&t.next.y!==t.y){const v=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(v<=s&&v>n&&(n=v,i=t.x<t.next.x?t:t.next,v===s))return i}t=t.next}while(t!==e);if(!i)return null;const l=i,u=i.x,d=i.y;let p=1/0,m;t=i;do s>=t.x&&t.x>=u&&s!==t.x&&uf(o<d?s:n,o,u,d,o<d?n:s,o,t.x,t.y)&&(m=Math.abs(o-t.y)/(s-t.x),pp(t,r)&&(m<p||m===p&&(t.x>i.x||t.x===i.x&&H3(i,t)))&&(i=t,p=m)),t=t.next;while(t!==l);return i}function H3(r,e){return Ti(r.prev,r,e.prev)<0&&Ti(e.next,r,r.next)<0}function G3(r,e,t,n){let i=r;do i.z===0&&(i.z=_x(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,V3(i)}function V3(r){let e,t,n,i,s,o,l,u,d=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,l=0,e=0;e<d&&(l++,n=n.nextZ,!!n);e++);for(u=d;l>0||u>0&&n;)l!==0&&(u===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,l--):(i=n,n=n.nextZ,u--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,d*=2}while(o>1);return r}function _x(r,e,t,n,i){return r=(r-t)*i|0,e=(e-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function j3(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function uf(r,e,t,n,i,s,o,l){return(i-o)*(e-l)>=(r-o)*(s-l)&&(r-o)*(n-l)>=(t-o)*(e-l)&&(t-o)*(s-l)>=(i-o)*(n-l)}function W3(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!X3(r,e)&&(pp(r,e)&&pp(e,r)&&Y3(r,e)&&(Ti(r.prev,r,e.prev)||Ti(r,e.prev,e))||ev(r,e)&&Ti(r.prev,r,r.next)>0&&Ti(e.prev,e,e.next)>0)}function Ti(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function ev(r,e){return r.x===e.x&&r.y===e.y}function KM(r,e,t,n){const i=xg(Ti(r,e,t)),s=xg(Ti(r,e,n)),o=xg(Ti(t,n,r)),l=xg(Ti(t,n,e));return!!(i!==s&&o!==l||i===0&&yg(r,t,e)||s===0&&yg(r,n,e)||o===0&&yg(t,r,n)||l===0&&yg(t,e,n))}function yg(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function xg(r){return r>0?1:r<0?-1:0}function X3(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&KM(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function pp(r,e){return Ti(r.prev,r,r.next)<0?Ti(r,e,r.next)>=0&&Ti(r,r.prev,e)>=0:Ti(r,e,r.prev)<0||Ti(r,r.next,e)<0}function Y3(r,e){let t=r,n=!1;const i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function ZM(r,e){const t=new Sx(r.i,r.x,r.y),n=new Sx(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function qS(r,e,t,n){const i=new Sx(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function mp(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Sx(r,e,t){this.i=r,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 q3(r,e,t,n){let i=0;for(let s=e,o=t-n;s<t;s+=n)i+=(r[o]-r[s])*(r[s+1]+r[o+1]),o=s;return i}class Ia{static area(e){const t=e.length;let n=0;for(let i=t-1,s=0;s<t;i=s++)n+=e[i].x*e[s].y-e[s].x*e[i].y;return n*.5}static isClockWise(e){return Ia.area(e)<0}static triangulateShape(e,t){const n=[],i=[],s=[];KS(e),ZS(n,e);let o=e.length;t.forEach(KS);for(let u=0;u<t.length;u++)i.push(o),o+=t[u].length,ZS(n,t[u]);const l=L3.triangulate(n,i);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function KS(r){const e=r.length;e>2&&r[e-1].equals(r[0])&&r.pop()}function ZS(r,e){for(let t=0;t<e.length;t++)r.push(e[t].x),r.push(e[t].y)}class tv extends qt{constructor(e=new Au([new We(.5,.5),new We(-.5,.5),new We(-.5,-.5),new We(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],s=[];for(let l=0,u=e.length;l<u;l++){const d=e[l];o(d)}this.setAttribute("position",new Pt(i,3)),this.setAttribute("uv",new Pt(s,2)),this.computeVertexNormals();function o(l){const u=[],d=t.curveSegments!==void 0?t.curveSegments:12,p=t.steps!==void 0?t.steps:1,m=t.depth!==void 0?t.depth:1;let v=t.bevelEnabled!==void 0?t.bevelEnabled:!0,y=t.bevelThickness!==void 0?t.bevelThickness:.2,x=t.bevelSize!==void 0?t.bevelSize:y-.1,M=t.bevelOffset!==void 0?t.bevelOffset:0,S=t.bevelSegments!==void 0?t.bevelSegments:3;const w=t.extrudePath,A=t.UVGenerator!==void 0?t.UVGenerator:K3;let T,R=!1,U,k,N,H;w&&(T=w.getSpacedPoints(p),R=!0,v=!1,U=w.computeFrenetFrames(p,!1),k=new te,N=new te,H=new te),v||(S=0,y=0,x=0,M=0);const F=l.extractPoints(d);let I=F.shape;const G=F.holes;if(!Ia.isClockWise(I)){I=I.reverse();for(let Y=0,Ce=G.length;Y<Ce;Y++){const Le=G[Y];Ia.isClockWise(Le)&&(G[Y]=Le.reverse())}}const X=Ia.triangulateShape(I,G),J=I;for(let Y=0,Ce=G.length;Y<Ce;Y++){const Le=G[Y];I=I.concat(Le)}function oe(Y,Ce,Le){return Ce||console.error("THREE.ExtrudeGeometry: vec does not exist"),Y.clone().addScaledVector(Ce,Le)}const se=I.length,fe=X.length;function V(Y,Ce,Le){let Ge,Ae,$e;const Re=Y.x-Ce.x,He=Y.y-Ce.y,Q=Le.x-Y.x,B=Le.y-Y.y,pe=Re*Re+He*He,ge=Re*B-He*Q;if(Math.abs(ge)>Number.EPSILON){const ve=Math.sqrt(pe),we=Math.sqrt(Q*Q+B*B),ut=Ce.x-He/ve,Oe=Ce.y+Re/ve,Qe=Le.x-B/we,at=Le.y+Q/we,Ke=((Qe-ut)*B-(at-Oe)*Q)/(Re*B-He*Q);Ge=ut+Re*Ke-Y.x,Ae=Oe+He*Ke-Y.y;const tt=Ge*Ge+Ae*Ae;if(tt<=2)return new We(Ge,Ae);$e=Math.sqrt(tt/2)}else{let ve=!1;Re>Number.EPSILON?Q>Number.EPSILON&&(ve=!0):Re<-Number.EPSILON?Q<-Number.EPSILON&&(ve=!0):Math.sign(He)===Math.sign(B)&&(ve=!0),ve?(Ge=-He,Ae=Re,$e=Math.sqrt(pe)):(Ge=Re,Ae=He,$e=Math.sqrt(pe/2))}return new We(Ge/$e,Ae/$e)}const $=[];for(let Y=0,Ce=J.length,Le=Ce-1,Ge=Y+1;Y<Ce;Y++,Le++,Ge++)Le===Ce&&(Le=0),Ge===Ce&&(Ge=0),$[Y]=V(J[Y],J[Le],J[Ge]);const Z=[];let O,j=$.concat();for(let Y=0,Ce=G.length;Y<Ce;Y++){const Le=G[Y];O=[];for(let Ge=0,Ae=Le.length,$e=Ae-1,Re=Ge+1;Ge<Ae;Ge++,$e++,Re++)$e===Ae&&($e=0),Re===Ae&&(Re=0),O[Ge]=V(Le[Ge],Le[$e],Le[Re]);Z.push(O),j=j.concat(O)}for(let Y=0;Y<S;Y++){const Ce=Y/S,Le=y*Math.cos(Ce*Math.PI/2),Ge=x*Math.sin(Ce*Math.PI/2)+M;for(let Ae=0,$e=J.length;Ae<$e;Ae++){const Re=oe(J[Ae],$[Ae],Ge);le(Re.x,Re.y,-Le)}for(let Ae=0,$e=G.length;Ae<$e;Ae++){const Re=G[Ae];O=Z[Ae];for(let He=0,Q=Re.length;He<Q;He++){const B=oe(Re[He],O[He],Ge);le(B.x,B.y,-Le)}}}const re=x+M;for(let Y=0;Y<se;Y++){const Ce=v?oe(I[Y],j[Y],re):I[Y];R?(N.copy(U.normals[0]).multiplyScalar(Ce.x),k.copy(U.binormals[0]).multiplyScalar(Ce.y),H.copy(T[0]).add(N).add(k),le(H.x,H.y,H.z)):le(Ce.x,Ce.y,0)}for(let Y=1;Y<=p;Y++)for(let Ce=0;Ce<se;Ce++){const Le=v?oe(I[Ce],j[Ce],re):I[Ce];R?(N.copy(U.normals[Y]).multiplyScalar(Le.x),k.copy(U.binormals[Y]).multiplyScalar(Le.y),H.copy(T[Y]).add(N).add(k),le(H.x,H.y,H.z)):le(Le.x,Le.y,m/p*Y)}for(let Y=S-1;Y>=0;Y--){const Ce=Y/S,Le=y*Math.cos(Ce*Math.PI/2),Ge=x*Math.sin(Ce*Math.PI/2)+M;for(let Ae=0,$e=J.length;Ae<$e;Ae++){const Re=oe(J[Ae],$[Ae],Ge);le(Re.x,Re.y,m+Le)}for(let Ae=0,$e=G.length;Ae<$e;Ae++){const Re=G[Ae];O=Z[Ae];for(let He=0,Q=Re.length;He<Q;He++){const B=oe(Re[He],O[He],Ge);R?le(B.x,B.y+T[p-1].y,T[p-1].x+Le):le(B.x,B.y,m+Le)}}}ne(),ie();function ne(){const Y=i.length/3;if(v){let Ce=0,Le=se*Ce;for(let Ge=0;Ge<fe;Ge++){const Ae=X[Ge];ye(Ae[2]+Le,Ae[1]+Le,Ae[0]+Le)}Ce=p+S*2,Le=se*Ce;for(let Ge=0;Ge<fe;Ge++){const Ae=X[Ge];ye(Ae[0]+Le,Ae[1]+Le,Ae[2]+Le)}}else{for(let Ce=0;Ce<fe;Ce++){const Le=X[Ce];ye(Le[2],Le[1],Le[0])}for(let Ce=0;Ce<fe;Ce++){const Le=X[Ce];ye(Le[0]+se*p,Le[1]+se*p,Le[2]+se*p)}}n.addGroup(Y,i.length/3-Y,0)}function ie(){const Y=i.length/3;let Ce=0;he(J,Ce),Ce+=J.length;for(let Le=0,Ge=G.length;Le<Ge;Le++){const Ae=G[Le];he(Ae,Ce),Ce+=Ae.length}n.addGroup(Y,i.length/3-Y,1)}function he(Y,Ce){let Le=Y.length;for(;--Le>=0;){const Ge=Le;let Ae=Le-1;Ae<0&&(Ae=Y.length-1);for(let $e=0,Re=p+S*2;$e<Re;$e++){const He=se*$e,Q=se*($e+1),B=Ce+Ge+He,pe=Ce+Ae+He,ge=Ce+Ae+Q,ve=Ce+Ge+Q;ze(B,pe,ge,ve)}}}function le(Y,Ce,Le){u.push(Y),u.push(Ce),u.push(Le)}function ye(Y,Ce,Le){Xe(Y),Xe(Ce),Xe(Le);const Ge=i.length/3,Ae=A.generateTopUV(n,i,Ge-3,Ge-2,Ge-1);Ie(Ae[0]),Ie(Ae[1]),Ie(Ae[2])}function ze(Y,Ce,Le,Ge){Xe(Y),Xe(Ce),Xe(Ge),Xe(Ce),Xe(Le),Xe(Ge);const Ae=i.length/3,$e=A.generateSideWallUV(n,i,Ae-6,Ae-3,Ae-2,Ae-1);Ie($e[0]),Ie($e[1]),Ie($e[3]),Ie($e[1]),Ie($e[2]),Ie($e[3])}function Xe(Y){i.push(u[Y*3+0]),i.push(u[Y*3+1]),i.push(u[Y*3+2])}function Ie(Y){s.push(Y.x),s.push(Y.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return Z3(t,n,e)}static fromJSON(e,t){const n=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];n.push(l)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new M0[i.type]().fromJSON(i)),new tv(n,e.options)}}const K3={generateTopUV:function(r,e,t,n,i){const s=e[t*3],o=e[t*3+1],l=e[n*3],u=e[n*3+1],d=e[i*3],p=e[i*3+1];return[new We(s,o),new We(l,u),new We(d,p)]},generateSideWallUV:function(r,e,t,n,i,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],d=e[n*3],p=e[n*3+1],m=e[n*3+2],v=e[i*3],y=e[i*3+1],x=e[i*3+2],M=e[s*3],S=e[s*3+1],w=e[s*3+2];return Math.abs(l-p)<Math.abs(o-d)?[new We(o,1-u),new We(d,1-m),new We(v,1-x),new We(M,1-w)]:[new We(l,1-u),new We(p,1-m),new We(y,1-x),new We(S,1-w)]}};function Z3(r,e,t){if(t.shapes=[],Array.isArray(r))for(let n=0,i=r.length;n<i;n++){const s=r[n];t.shapes.push(s.uuid)}else t.shapes.push(r.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class nv extends xc{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,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(i,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new nv(e.radius,e.detail)}}class Lp extends xc{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[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(n,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Lp(e.radius,e.detail)}}class iv extends qt{constructor(e=.5,t=1,n=32,i=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:s,thetaLength:o},n=Math.max(3,n),i=Math.max(1,i);const l=[],u=[],d=[],p=[];let m=e;const v=(t-e)/i,y=new te,x=new We;for(let M=0;M<=i;M++){for(let S=0;S<=n;S++){const w=s+S/n*o;y.x=m*Math.cos(w),y.y=m*Math.sin(w),u.push(y.x,y.y,y.z),d.push(0,0,1),x.x=(y.x/t+1)/2,x.y=(y.y/t+1)/2,p.push(x.x,x.y)}m+=v}for(let M=0;M<i;M++){const S=M*(n+1);for(let w=0;w<n;w++){const A=w+S,T=A,R=A+n+1,U=A+n+2,k=A+1;l.push(T,R,k),l.push(R,U,k)}}this.setIndex(l),this.setAttribute("position",new Pt(u,3)),this.setAttribute("normal",new Pt(d,3)),this.setAttribute("uv",new Pt(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new iv(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class rv extends qt{constructor(e=new Au([new We(0,.5),new We(-.5,-.5),new We(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)d(e);else for(let p=0;p<e.length;p++)d(e[p]),this.addGroup(l,u,p),l+=u,u=0;this.setIndex(n),this.setAttribute("position",new Pt(i,3)),this.setAttribute("normal",new Pt(s,3)),this.setAttribute("uv",new Pt(o,2));function d(p){const m=i.length/3,v=p.extractPoints(t);let y=v.shape;const x=v.holes;Ia.isClockWise(y)===!1&&(y=y.reverse());for(let S=0,w=x.length;S<w;S++){const A=x[S];Ia.isClockWise(A)===!0&&(x[S]=A.reverse())}const M=Ia.triangulateShape(y,x);for(let S=0,w=x.length;S<w;S++){const A=x[S];y=y.concat(A)}for(let S=0,w=y.length;S<w;S++){const A=y[S];i.push(A.x,A.y,0),s.push(0,0,1),o.push(A.x,A.y)}for(let S=0,w=M.length;S<w;S++){const A=M[S],T=A[0]+m,R=A[1]+m,U=A[2]+m;n.push(T,R,U),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 J3(t,e)}static fromJSON(e,t){const n=[];for(let i=0,s=e.shapes.length;i<s;i++){const o=t[e.shapes[i]];n.push(o)}return new rv(n,e.curveSegments)}}function J3(r,e){if(e.shapes=[],Array.isArray(r))for(let t=0,n=r.length;t<n;t++){const i=r[t];e.shapes.push(i.uuid)}else e.shapes.push(r.uuid);return e}class Dp extends qt{constructor(e=1,t=32,n=16,i=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const u=Math.min(o+l,Math.PI);let d=0;const p=[],m=new te,v=new te,y=[],x=[],M=[],S=[];for(let w=0;w<=n;w++){const A=[],T=w/n;let R=0;w===0&&o===0?R=.5/t:w===n&&u===Math.PI&&(R=-.5/t);for(let U=0;U<=t;U++){const k=U/t;m.x=-e*Math.cos(i+k*s)*Math.sin(o+T*l),m.y=e*Math.cos(o+T*l),m.z=e*Math.sin(i+k*s)*Math.sin(o+T*l),x.push(m.x,m.y,m.z),v.copy(m).normalize(),M.push(v.x,v.y,v.z),S.push(k+R,1-T),A.push(d++)}p.push(A)}for(let w=0;w<n;w++)for(let A=0;A<t;A++){const T=p[w][A+1],R=p[w][A],U=p[w+1][A],k=p[w+1][A+1];(w!==0||o>0)&&y.push(T,R,k),(w!==n-1||u<Math.PI)&&y.push(R,U,k)}this.setIndex(y),this.setAttribute("position",new Pt(x,3)),this.setAttribute("normal",new Pt(M,3)),this.setAttribute("uv",new Pt(S,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Dp(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class sv extends xc{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new sv(e.radius,e.detail)}}class ov extends qt{constructor(e=1,t=.4,n=12,i=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:s},n=Math.floor(n),i=Math.floor(i);const o=[],l=[],u=[],d=[],p=new te,m=new te,v=new te;for(let y=0;y<=n;y++)for(let x=0;x<=i;x++){const M=x/i*s,S=y/n*Math.PI*2;m.x=(e+t*Math.cos(S))*Math.cos(M),m.y=(e+t*Math.cos(S))*Math.sin(M),m.z=t*Math.sin(S),l.push(m.x,m.y,m.z),p.x=e*Math.cos(M),p.y=e*Math.sin(M),v.subVectors(m,p).normalize(),u.push(v.x,v.y,v.z),d.push(x/i),d.push(y/n)}for(let y=1;y<=n;y++)for(let x=1;x<=i;x++){const M=(i+1)*y+x-1,S=(i+1)*(y-1)+x-1,w=(i+1)*(y-1)+x,A=(i+1)*y+x;o.push(M,S,A),o.push(S,w,A)}this.setIndex(o),this.setAttribute("position",new Pt(l,3)),this.setAttribute("normal",new Pt(u,3)),this.setAttribute("uv",new Pt(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ov(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class av extends qt{constructor(e=1,t=.4,n=64,i=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:s,q:o},n=Math.floor(n),i=Math.floor(i);const l=[],u=[],d=[],p=[],m=new te,v=new te,y=new te,x=new te,M=new te,S=new te,w=new te;for(let T=0;T<=n;++T){const R=T/n*s*Math.PI*2;A(R,s,o,e,y),A(R+.01,s,o,e,x),S.subVectors(x,y),w.addVectors(x,y),M.crossVectors(S,w),w.crossVectors(M,S),M.normalize(),w.normalize();for(let U=0;U<=i;++U){const k=U/i*Math.PI*2,N=-t*Math.cos(k),H=t*Math.sin(k);m.x=y.x+(N*w.x+H*M.x),m.y=y.y+(N*w.y+H*M.y),m.z=y.z+(N*w.z+H*M.z),u.push(m.x,m.y,m.z),v.subVectors(m,y).normalize(),d.push(v.x,v.y,v.z),p.push(T/n),p.push(U/i)}}for(let T=1;T<=n;T++)for(let R=1;R<=i;R++){const U=(i+1)*(T-1)+(R-1),k=(i+1)*T+(R-1),N=(i+1)*T+R,H=(i+1)*(T-1)+R;l.push(U,k,H),l.push(k,N,H)}this.setIndex(l),this.setAttribute("position",new Pt(u,3)),this.setAttribute("normal",new Pt(d,3)),this.setAttribute("uv",new Pt(p,2));function A(T,R,U,k,N){const H=Math.cos(T),F=Math.sin(T),I=U/R*T,G=Math.cos(I);N.x=k*(2+G)*.5*H,N.y=k*(2+G)*F*.5,N.z=k*Math.sin(I)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new av(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class lv extends qt{constructor(e=new Nu(new te(-1,-1,0),new te(-1,1,0),new te(1,1,0)),t=64,n=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new te,u=new te,d=new We;let p=new te;const m=[],v=[],y=[],x=[];M(),this.setIndex(x),this.setAttribute("position",new Pt(m,3)),this.setAttribute("normal",new Pt(v,3)),this.setAttribute("uv",new Pt(y,2));function M(){for(let T=0;T<t;T++)S(T);S(s===!1?t:0),A(),w()}function S(T){p=e.getPointAt(T/t,p);const R=o.normals[T],U=o.binormals[T];for(let k=0;k<=i;k++){const N=k/i*Math.PI*2,H=Math.sin(N),F=-Math.cos(N);u.x=F*R.x+H*U.x,u.y=F*R.y+H*U.y,u.z=F*R.z+H*U.z,u.normalize(),v.push(u.x,u.y,u.z),l.x=p.x+n*u.x,l.y=p.y+n*u.y,l.z=p.z+n*u.z,m.push(l.x,l.y,l.z)}}function w(){for(let T=1;T<=t;T++)for(let R=1;R<=i;R++){const U=(i+1)*(T-1)+(R-1),k=(i+1)*T+(R-1),N=(i+1)*T+R,H=(i+1)*(T-1)+R;x.push(U,k,H),x.push(k,N,H)}}function A(){for(let T=0;T<=t;T++)for(let R=0;R<=i;R++)d.x=T/t,d.y=R/i,y.push(d.x,d.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 lv(new M0[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class b1 extends qt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new te,s=new te;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let d=0,p=u.length;d<p;++d){const m=u[d],v=m.start,y=m.count;for(let x=v,M=v+y;x<M;x+=3)for(let S=0;S<3;S++){const w=l.getX(x+S),A=l.getX(x+(S+1)%3);i.fromBufferAttribute(o,w),s.fromBufferAttribute(o,A),JS(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let d=0;d<3;d++){const p=3*l+d,m=3*l+(d+1)%3;i.fromBufferAttribute(o,p),s.fromBufferAttribute(o,m),JS(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new Pt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function JS(r,e,t){const n=`${r.x},${r.y},${r.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${r.x},${r.y},${r.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}var QS=Object.freeze({__proto__:null,BoxGeometry:Fu,CapsuleGeometry:Z0,CircleGeometry:J0,ConeGeometry:Q0,CylinderGeometry:wf,DodecahedronGeometry:$0,EdgesGeometry:YM,ExtrudeGeometry:tv,IcosahedronGeometry:nv,LatheGeometry:Ip,OctahedronGeometry:Lp,PlaneGeometry:bl,PolyhedronGeometry:xc,RingGeometry:iv,ShapeGeometry:rv,SphereGeometry:Dp,TetrahedronGeometry:sv,TorusGeometry:ov,TorusKnotGeometry:av,TubeGeometry:lv,WireframeGeometry:b1});class JM extends Rr{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new St(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 QM extends Vi{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class w1 extends Rr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new St(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 St(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yc,this.normalScale=new We(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 io,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 $M extends w1{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 We(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ki(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 St(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 St(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new St(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 e2 extends Rr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new St(16777215),this.specular=new St(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new St(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yc,this.normalScale=new We(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new io,this.combine=wp,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 t2 extends Rr{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new St(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new St(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yc,this.normalScale=new We(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 M1 extends Rr{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yc,this.normalScale=new We(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 n2 extends Rr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new St(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new St(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yc,this.normalScale=new We(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new io,this.combine=wp,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 i2 extends Rr{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new St(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yc,this.normalScale=new We(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 gc extends Ar{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 bu(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function r2(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function s2(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function bx(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const l=t[s]*e;for(let u=0;u!==e;++u)i[o++]=r[l+u]}return i}function E1(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}function Q3(r,e,t,n,i=30){const s=r.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const d=s.tracks[u],p=d.getValueSize(),m=[],v=[];for(let y=0;y<d.times.length;++y){const x=d.times[y]*i;if(!(x<t||x>=n)){m.push(d.times[y]);for(let M=0;M<p;++M)v.push(d.values[y*p+M])}}m.length!==0&&(d.times=bu(m,d.times.constructor),d.values=bu(v,d.values.constructor),o.push(d))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s}function $3(r,e=0,t=r,n=30){n<=0&&(n=30);const i=t.tracks.length,s=e/n;for(let o=0;o<i;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const d=r.tracks.find(function(w){return w.name===l.name&&w.ValueTypeName===u});if(d===void 0)continue;let p=0;const m=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);let v=0;const y=d.getValueSize();d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(v=y/3);const x=l.times.length-1;let M;if(s<=l.times[0]){const w=p,A=m-p;M=l.values.slice(w,A)}else if(s>=l.times[x]){const w=x*m+p,A=w+m-p;M=l.values.slice(w,A)}else{const w=l.createInterpolant(),A=p,T=m-p;w.evaluate(s),M=w.resultBuffer.slice(A,T)}u==="quaternion"&&new Xr().fromArray(M).normalize().conjugate().toArray(M);const S=d.times.length;for(let w=0;w<S;++w){const A=w*y+v;if(u==="quaternion")Xr.multiplyQuaternionsFlat(d.values,A,M,0,d.values,A);else{const T=y-v*2;for(let R=0;R<T;++R)d.values[A+R]-=M[R]}}}return r.blendMode=a1,r}const eL={convertArray:bu,isTypedArray:r2,getKeyframeOrder:s2,sortedArray:bx,flattenJSON:E1,subclip:Q3,makeClipAdditive:$3};class Up{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let o;n:{i:if(!(e<i)){for(let l=n+2;;){if(i===void 0){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===l)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(n=2,s=l);for(let u=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===u)break;if(i=s,s=t[--n-1],e>=s)break t}o=n,n=0;break n}break e}for(;n<o;){const l=n+o>>>1;e<t[l]?o=l:n=l+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class o2 extends Up{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:xu,endingEnd:xu}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,l=i[s],u=i[o];if(l===void 0)switch(this.getSettings_().endingStart){case _u:s=e,l=2*t-n;break;case ip:s=i.length-2,l=t+i[s]-i[s+1];break;default:s=e,l=n}if(u===void 0)switch(this.getSettings_().endingEnd){case _u:o=e,u=2*n-t;break;case ip:o=1,u=n+i[1]-i[0];break;default:o=e-1,u=t}const d=(n-t)*.5,p=this.valueSize;this._weightPrev=d/(t-l),this._weightNext=d/(u-n),this._offsetPrev=s*p,this._offsetNext=o*p}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,d=u-l,p=this._offsetPrev,m=this._offsetNext,v=this._weightPrev,y=this._weightNext,x=(n-t)/(i-t),M=x*x,S=M*x,w=-v*S+2*v*M-v*x,A=(1+v)*S+(-1.5-2*v)*M+(-.5+v)*x+1,T=(-1-y)*S+(1.5+y)*M+.5*x,R=y*S-y*M;for(let U=0;U!==l;++U)s[U]=w*o[p+U]+A*o[d+U]+T*o[u+U]+R*o[m+U];return s}}class T1 extends Up{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,d=u-l,p=(n-t)/(i-t),m=1-p;for(let v=0;v!==l;++v)s[v]=o[d+v]*m+o[u+v]*p;return s}}class a2 extends Up{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class oa{constructor(e,t,n,i){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=bu(t,this.TimeBufferType),this.values=bu(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:bu(e.times,Array),values:bu(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new a2(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new T1(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new o2(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case np:t=this.InterpolantFactoryMethodDiscrete;break;case S0:t=this.InterpolantFactoryMethodLinear;break;case Hg:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="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(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return np;case this.InterpolantFactoryMethodLinear:return S0;case this.InterpolantFactoryMethodSmooth:return Hg}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,o=i-1;for(;s!==i&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*l,o*l)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const u=n[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(i!==void 0&&r2(i))for(let l=0,u=i.length;l!==u;++l){const d=i[l];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,d),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Hg,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const d=e[l],p=e[l+1];if(d!==p&&(l!==1||d!==e[0]))if(i)u=!0;else{const m=l*n,v=m-n,y=m+n;for(let x=0;x!==n;++x){const M=t[m+x];if(M!==t[v+x]||M!==t[y+x]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const m=l*n,v=o*n;for(let y=0;y!==n;++y)t[v+y]=t[m+y]}++o}}if(s>0){e[o]=e[s];for(let l=s*n,u=o*n,d=0;d!==n;++d)t[u+d]=t[l+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}oa.prototype.TimeBufferType=Float32Array;oa.prototype.ValueBufferType=Float32Array;oa.prototype.DefaultInterpolation=S0;class Ou extends oa{constructor(e,t,n){super(e,t,n)}}Ou.prototype.ValueTypeName="bool";Ou.prototype.ValueBufferType=Array;Ou.prototype.DefaultInterpolation=np;Ou.prototype.InterpolantFactoryMethodLinear=void 0;Ou.prototype.InterpolantFactoryMethodSmooth=void 0;class A1 extends oa{}A1.prototype.ValueTypeName="color";class gp extends oa{}gp.prototype.ValueTypeName="number";class l2 extends Up{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(n-t)/(i-t);let d=e*l;for(let p=d+l;d!==p;d+=4)Xr.slerpFlat(s,0,o,d-l,o,d,u);return s}}class kp extends oa{InterpolantFactoryMethodLinear(e){return new l2(this.times,this.values,this.getValueSize(),e)}}kp.prototype.ValueTypeName="quaternion";kp.prototype.InterpolantFactoryMethodSmooth=void 0;class Bu extends oa{constructor(e,t,n){super(e,t,n)}}Bu.prototype.ValueTypeName="string";Bu.prototype.ValueBufferType=Array;Bu.prototype.DefaultInterpolation=np;Bu.prototype.InterpolantFactoryMethodLinear=void 0;Bu.prototype.InterpolantFactoryMethodSmooth=void 0;class vp extends oa{}vp.prototype.ValueTypeName="vector";class yp{constructor(e="",t=-1,n=[],i=O0){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=no(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,l=n.length;o!==l;++o)t.push(nL(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(oa.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],d=[];u.push((l+s-1)%s,l,(l+1)%s),d.push(0,1,0);const p=s2(u);u=bx(u,1,p),d=bx(d,1,p),!i&&u[0]===0&&(u.push(s),d.push(d[0])),o.push(new gp(".morphTargetInfluences["+t[l].name+"]",u,d).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,u=e.length;l<u;l++){const d=e[l],p=d.name.match(s);if(p&&p.length>1){const m=p[1];let v=i[m];v||(i[m]=v=[]),v.push(d)}}const o=[];for(const l in i)o.push(this.CreateFromMorphTargetSequence(l,i[l],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(m,v,y,x,M){if(y.length!==0){const S=[],w=[];E1(y,S,w,x),S.length!==0&&M.push(new m(v,S,w))}},i=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const d=e.hierarchy||[];for(let m=0;m<d.length;m++){const v=d[m].keys;if(!(!v||v.length===0))if(v[0].morphTargets){const y={};let x;for(x=0;x<v.length;x++)if(v[x].morphTargets)for(let M=0;M<v[x].morphTargets.length;M++)y[v[x].morphTargets[M]]=-1;for(const M in y){const S=[],w=[];for(let A=0;A!==v[x].morphTargets.length;++A){const T=v[x];S.push(T.time),w.push(T.morphTarget===M?1:0)}i.push(new gp(".morphTargetInfluence["+M+"]",S,w))}u=y.length*o}else{const y=".bones["+t[m].name+"]";n(vp,y+".position",v,"pos",i),n(kp,y+".quaternion",v,"rot",i),n(vp,y+".scale",v,"scl",i)}}return i.length===0?null:new this(s,u,i,l)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];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 tL(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return gp;case"vector":case"vector2":case"vector3":case"vector4":return vp;case"color":return A1;case"quaternion":return kp;case"bool":case"boolean":return Ou;case"string":return Bu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function nL(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=tL(r.type);if(r.times===void 0){const t=[],n=[];E1(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const vl={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class C1{constructor(e,t,n){const i=this;let s=!1,o=0,l=0,u;const d=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(p){l++,s===!1&&i.onStart!==void 0&&i.onStart(p,o,l),s=!0},this.itemEnd=function(p){o++,i.onProgress!==void 0&&i.onProgress(p,o,l),o===l&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(p){i.onError!==void 0&&i.onError(p)},this.resolveURL=function(p){return u?u(p):p},this.setURLModifier=function(p){return u=p,this},this.addHandler=function(p,m){return d.push(p,m),this},this.removeHandler=function(p){const m=d.indexOf(p);return m!==-1&&d.splice(m,2),this},this.getHandler=function(p){for(let m=0,v=d.length;m<v;m+=2){const y=d[m],x=d[m+1];if(y.global&&(y.lastIndex=0),y.test(p))return x}return null}}}const c2=new C1;class zs{constructor(e){this.manager=e!==void 0?e:c2,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,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}}zs.DEFAULT_MATERIAL_NAME="__DEFAULT";const hl={};class iL extends Error{constructor(e,t){super(e),this.response=t}}class _l extends zs{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=vl.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(hl[e]!==void 0){hl[e].push({onLoad:t,onProgress:n,onError:i});return}hl[e]=[],hl[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),l=this.mimeType,u=this.responseType;fetch(o).then(d=>{if(d.status===200||d.status===0){if(d.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||d.body===void 0||d.body.getReader===void 0)return d;const p=hl[e],m=d.body.getReader(),v=d.headers.get("X-File-Size")||d.headers.get("Content-Length"),y=v?parseInt(v):0,x=y!==0;let M=0;const S=new ReadableStream({start(w){A();function A(){m.read().then(({done:T,value:R})=>{if(T)w.close();else{M+=R.byteLength;const U=new ProgressEvent("progress",{lengthComputable:x,loaded:M,total:y});for(let k=0,N=p.length;k<N;k++){const H=p[k];H.onProgress&&H.onProgress(U)}w.enqueue(R),A()}},T=>{w.error(T)})}}});return new Response(S)}else throw new iL(`fetch for "${d.url}" responded with ${d.status}: ${d.statusText}`,d)}).then(d=>{switch(u){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(p=>new DOMParser().parseFromString(p,l));case"json":return d.json();default:if(l===void 0)return d.text();{const m=/charset="?([^;"\s]*)"?/i.exec(l),v=m&&m[1]?m[1].toLowerCase():void 0,y=new TextDecoder(v);return d.arrayBuffer().then(x=>y.decode(x))}}}).then(d=>{vl.add(e,d);const p=hl[e];delete hl[e];for(let m=0,v=p.length;m<v;m++){const y=p[m];y.onLoad&&y.onLoad(d)}}).catch(d=>{const p=hl[e];if(p===void 0)throw this.manager.itemError(e),d;delete hl[e];for(let m=0,v=p.length;m<v;m++){const y=p[m];y.onError&&y.onError(d)}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 rL extends zs{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new _l(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){i?i(u):console.error(u),s.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=yp.parse(e[n]);t.push(i)}return t}}class sL extends zs{constructor(e){super(e)}load(e,t,n,i){const s=this,o=[],l=new q0,u=new _l(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let d=0;function p(m){u.load(e[m],function(v){const y=s.parse(v,!0);o[m]={width:y.width,height:y.height,format:y.format,mipmaps:y.mipmaps},d+=1,d===6&&(y.mipmapCount===1&&(l.minFilter=ni),l.image=o,l.format=y.format,l.needsUpdate=!0,t&&t(l))},n,i)}if(Array.isArray(e))for(let m=0,v=e.length;m<v;++m)p(m);else u.load(e,function(m){const v=s.parse(m,!0);if(v.isCubemap){const y=v.mipmaps.length/v.mipmapCount;for(let x=0;x<y;x++){o[x]={mipmaps:[]};for(let M=0;M<v.mipmapCount;M++)o[x].mipmaps.push(v.mipmaps[x*v.mipmapCount+M]),o[x].format=v.format,o[x].width=v.width,o[x].height=v.height}l.image=o}else l.image.width=v.width,l.image.height=v.height,l.mipmaps=v.mipmaps;v.mipmapCount===1&&(l.minFilter=ni),l.format=v.format,l.needsUpdate=!0,t&&t(l)},n,i);return l}}class xp extends zs{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=vl.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=cp("img");function u(){p(),vl.add(e,this),t&&t(this),s.manager.itemEnd(e)}function d(m){p(),i&&i(m),s.manager.itemError(e),s.manager.itemEnd(e)}function p(){l.removeEventListener("load",u,!1),l.removeEventListener("error",d,!1)}return l.addEventListener("load",u,!1),l.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class oL extends zs{constructor(e){super(e)}load(e,t,n,i){const s=new Cp;s.colorSpace=Bn;const o=new xp(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(d){o.load(e[d],function(p){s.images[d]=p,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,i)}for(let d=0;d<e.length;++d)u(d);return s}}class aL extends zs{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Pa,l=new _l(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){let d;try{d=s.parse(u)}catch(p){if(i!==void 0)i(p);else{console.error(p);return}}d.image!==void 0?o.image=d.image:d.data!==void 0&&(o.image.width=d.width,o.image.height=d.height,o.image.data=d.data),o.wrapS=d.wrapS!==void 0?d.wrapS:yo,o.wrapT=d.wrapT!==void 0?d.wrapT:yo,o.magFilter=d.magFilter!==void 0?d.magFilter:ni,o.minFilter=d.minFilter!==void 0?d.minFilter:ni,o.anisotropy=d.anisotropy!==void 0?d.anisotropy:1,d.colorSpace!==void 0&&(o.colorSpace=d.colorSpace),d.flipY!==void 0&&(o.flipY=d.flipY),d.format!==void 0&&(o.format=d.format),d.type!==void 0&&(o.type=d.type),d.mipmaps!==void 0&&(o.mipmaps=d.mipmaps,o.minFilter=Ca),d.mipmapCount===1&&(o.minFilter=ni),d.generateMipmaps!==void 0&&(o.generateMipmaps=d.generateMipmaps),o.needsUpdate=!0,t&&t(o,d)},n,i),o}}class lL extends zs{constructor(e){super(e)}load(e,t,n,i){const s=new di,o=new xp(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class _c extends In{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new St(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 u2 extends _c{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(In.DEFAULT_UP),this.updateMatrix(),this.groundColor=new St(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Ly=new Xt,$S=new te,eb=new te;class R1{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new We(512,512),this.map=null,this.mapPass=null,this.matrix=new Xt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Rp,this._frameExtents=new We(1,1),this._viewportCount=1,this._viewports=[new fn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;$S.setFromMatrixPosition(e.matrixWorld),t.position.copy($S),eb.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(eb),t.updateMatrixWorld(),Ly.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ly),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Ly)}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 cL extends R1{constructor(){super(new ci(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=gf*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class d2 extends _c{constructor(e,t,n=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(In.DEFAULT_UP),this.updateMatrix(),this.target=new In,this.distance=n,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new cL}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 tb=new Xt,Rh=new te,Dy=new te;class uL extends R1{constructor(){super(new ci(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new We(4,2),this._viewportCount=6,this._viewports=[new fn(2,1,1,1),new fn(0,1,1,1),new fn(3,1,1,1),new fn(1,1,1,1),new fn(3,0,1,1),new fn(1,0,1,1)],this._cubeDirections=[new te(1,0,0),new te(-1,0,0),new te(0,0,1),new te(0,0,-1),new te(0,1,0),new te(0,-1,0)],this._cubeUps=[new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,0,1),new te(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),Rh.setFromMatrixPosition(e.matrixWorld),n.position.copy(Rh),Dy.copy(n.position),Dy.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Dy),n.updateMatrixWorld(),i.makeTranslation(-Rh.x,-Rh.y,-Rh.z),tb.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(tb)}}class f2 extends _c{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new uL}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 dL extends R1{constructor(){super(new ta(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class h2 extends _c{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(In.DEFAULT_UP),this.updateMatrix(),this.target=new In,this.shadow=new dL}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class p2 extends _c{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class m2 extends _c{constructor(e,t,n=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}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 g2{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new te)}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 n=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*i),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],1.092548*(n*i)),t.addScaledVector(o[5],1.092548*(i*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(n*s)),t.addScaledVector(o[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*i),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*n),t.addScaledVector(o[4],2*.429043*n*i),t.addScaledVector(o[5],2*.429043*i*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*n*s),t.addScaledVector(o[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],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 n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const n=e.x,i=e.y,s=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*s,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*n*s,t[8]=.546274*(n*n-i*i)}}class v2 extends _c{constructor(e=new g2,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 cv extends zs{constructor(e){super(e),this.textures={}}load(e,t,n,i){const s=this,o=new _l(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){i?i(u):console.error(u),s.manager.itemError(e)}},n,i)}parse(e){const t=this.textures;function n(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const i=cv.createMaterialFromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new St().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(i.dispersion=e.dispersion),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(i.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(i.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(i.depthFunc=e.depthFunc),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(i.blendSrc=e.blendSrc),e.blendDst!==void 0&&(i.blendDst=e.blendDst),e.blendEquation!==void 0&&(i.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(i.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(i.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(i.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&i.blendColor!==void 0&&i.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(i.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==void 0&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(i.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new St().setHex(o.value);break;case"v2":i.uniforms[s].value=new We().fromArray(o.value);break;case"v3":i.uniforms[s].value=new te().fromArray(o.value);break;case"v4":i.uniforms[s].value=new fn().fromArray(o.value);break;case"m3":i.uniforms[s].value=new on().fromArray(o.value);break;case"m4":i.uniforms[s].value=new Xt().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new We().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new We().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:JM,SpriteMaterial:p1,RawShaderMaterial:QM,ShaderMaterial:Vi,PointsMaterial:g1,MeshPhysicalMaterial:$M,MeshStandardMaterial:w1,MeshPhongMaterial:e2,MeshToonMaterial:t2,MeshNormalMaterial:M1,MeshLambertMaterial:n2,MeshDepthMaterial:Pp,MeshDistanceMaterial:V0,MeshBasicMaterial:Sl,MeshMatcapMaterial:i2,LineDashedMaterial:gc,LineBasicMaterial:Ar,Material:Rr};return new t[e]}}class wx{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 n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);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 uv extends qt{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 y2 extends zs{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new _l(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){i?i(u):console.error(u),s.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(y,x){if(t[x]!==void 0)return t[x];const S=y.interleavedBuffers[x],w=s(y,S.buffer),A=af(S.type,w),T=new X0(A,S.stride);return T.uuid=S.uuid,t[x]=T,T}function s(y,x){if(n[x]!==void 0)return n[x];const S=y.arrayBuffers[x],w=new Uint32Array(S).buffer;return n[x]=w,w}const o=e.isInstancedBufferGeometry?new uv:new qt,l=e.data.index;if(l!==void 0){const y=af(l.type,l.array);o.setIndex(new zn(y,1))}const u=e.data.attributes;for(const y in u){const x=u[y];let M;if(x.isInterleavedBufferAttribute){const S=i(e.data,x.data);M=new to(S,x.itemSize,x.offset,x.normalized)}else{const S=af(x.type,x.array),w=x.isInstancedBufferAttribute?Pu:zn;M=new w(S,x.itemSize,x.normalized)}x.name!==void 0&&(M.name=x.name),x.usage!==void 0&&M.setUsage(x.usage),o.setAttribute(y,M)}const d=e.data.morphAttributes;if(d)for(const y in d){const x=d[y],M=[];for(let S=0,w=x.length;S<w;S++){const A=x[S];let T;if(A.isInterleavedBufferAttribute){const R=i(e.data,A.data);T=new to(R,A.itemSize,A.offset,A.normalized)}else{const R=af(A.type,A.array);T=new zn(R,A.itemSize,A.normalized)}A.name!==void 0&&(T.name=A.name),M.push(T)}o.morphAttributes[y]=M}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const m=e.data.groups||e.data.drawcalls||e.data.offsets;if(m!==void 0)for(let y=0,x=m.length;y!==x;++y){const M=m[y];o.addGroup(M.start,M.count,M.materialIndex)}const v=e.data.boundingSphere;if(v!==void 0){const y=new te;v.center!==void 0&&y.fromArray(v.center),o.boundingSphere=new hr(y,v.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class fL extends zs{constructor(e){super(e)}load(e,t,n,i){const s=this,o=this.path===""?wx.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new _l(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let d=null;try{d=JSON.parse(u)}catch(m){i!==void 0&&i(m),console.error("THREE:ObjectLoader: Can't parse "+e+".",m.message);return}const p=d.metadata;if(p===void 0||p.type===void 0||p.type.toLowerCase()==="geometry"){i!==void 0&&i(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(d,t)},n,i)}async loadAsync(e,t){const n=this,i=this.path===""?wx.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const s=new _l(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(l)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,i),o=this.parseImages(e.images,function(){t!==void 0&&t(d)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),d=this.parseObject(e.object,s,u,l,n),p=this.parseSkeletons(e.skeletons,d);if(this.bindSkeletons(d,p),this.bindLightTargets(d),t!==void 0){let m=!1;for(const v in o)if(o[v].data instanceof HTMLImageElement){m=!0;break}m===!1&&t(d)}return d}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,i,l,o,t),d=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,d),this.bindLightTargets(u),u}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const s=new Au().fromJSON(e[n]);t[s.uuid]=s}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(s){s.isBone&&(i[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new Y0().fromJSON(e[s],i);n[l.uuid]=l}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new y2;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=i.parse(u);break;default:u.type in QS?l=QS[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),u.userData!==void 0&&(l.userData=u.userData),n[u.uuid]=l}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const s=new cv;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];n[u.uuid]===void 0&&(n[u.uuid]=s.parse(u)),i[u.uuid]=n[u.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const i=e[n],s=yp.parse(i);t[s.uuid]=s}return t}parseImages(e,t){const n=this,i={};let s;function o(u){return n.manager.itemStart(u),s.load(u,function(){n.manager.itemEnd(u)},void 0,function(){n.manager.itemError(u),n.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const d=u,p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;return o(p)}else return u.data?{data:af(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new C1(t);s=new xp(u),s.setCrossOrigin(this.crossOrigin);for(let d=0,p=e.length;d<p;d++){const m=e[d],v=m.url;if(Array.isArray(v)){const y=[];for(let x=0,M=v.length;x<M;x++){const S=v[x],w=l(S);w!==null&&(w instanceof HTMLImageElement?y.push(w):y.push(new Pa(w.data,w.width,w.height)))}i[m.uuid]=new Su(y)}else{const y=l(m.url);i[m.uuid]=new Su(y)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await i.loadAsync(u)}else return o.data?{data:af(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){i=new xp(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],d=u.url;if(Array.isArray(d)){const p=[];for(let m=0,v=d.length;m<v;m++){const y=d[m],x=await s(y);x!==null&&(x instanceof HTMLImageElement?p.push(x):p.push(new Pa(x.data,x.width,x.height)))}n[u.uuid]=new Su(p)}else{const p=await s(u.url);n[u.uuid]=new Su(p)}}}return n}parseTextures(e,t){function n(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const i={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);const u=t[l.image],d=u.data;let p;Array.isArray(d)?(p=new Cp,d.length===6&&(p.needsUpdate=!0)):(d&&d.data?p=new Pa:p=new di,d&&(p.needsUpdate=!0)),p.source=u,p.uuid=l.uuid,l.name!==void 0&&(p.name=l.name),l.mapping!==void 0&&(p.mapping=n(l.mapping,hL)),l.channel!==void 0&&(p.channel=l.channel),l.offset!==void 0&&p.offset.fromArray(l.offset),l.repeat!==void 0&&p.repeat.fromArray(l.repeat),l.center!==void 0&&p.center.fromArray(l.center),l.rotation!==void 0&&(p.rotation=l.rotation),l.wrap!==void 0&&(p.wrapS=n(l.wrap[0],nb),p.wrapT=n(l.wrap[1],nb)),l.format!==void 0&&(p.format=l.format),l.internalFormat!==void 0&&(p.internalFormat=l.internalFormat),l.type!==void 0&&(p.type=l.type),l.colorSpace!==void 0&&(p.colorSpace=l.colorSpace),l.minFilter!==void 0&&(p.minFilter=n(l.minFilter,ib)),l.magFilter!==void 0&&(p.magFilter=n(l.magFilter,ib)),l.anisotropy!==void 0&&(p.anisotropy=l.anisotropy),l.flipY!==void 0&&(p.flipY=l.flipY),l.generateMipmaps!==void 0&&(p.generateMipmaps=l.generateMipmaps),l.premultiplyAlpha!==void 0&&(p.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(p.unpackAlignment=l.unpackAlignment),l.compareFunction!==void 0&&(p.compareFunction=l.compareFunction),l.userData!==void 0&&(p.userData=l.userData),i[l.uuid]=p}return i}parseObject(e,t,n,i,s){let o;function l(v){return t[v]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",v),t[v]}function u(v){if(v!==void 0){if(Array.isArray(v)){const y=[];for(let x=0,M=v.length;x<M;x++){const S=v[x];n[S]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",S),y.push(n[S])}return y}return n[v]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",v),n[v]}}function d(v){return i[v]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",v),i[v]}let p,m;switch(e.type){case"Scene":o=new dp,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new St(e.background):o.background=d(e.background)),e.environment!==void 0&&(o.environment=d(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new W0(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new j0(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 ci(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 ta(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 p2(e.color,e.intensity);break;case"DirectionalLight":o=new h2(e.color,e.intensity),o.target=e.target||"";break;case"PointLight":o=new f2(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new m2(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new d2(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),o.target=e.target||"";break;case"HemisphereLight":o=new u2(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new v2().fromJSON(e);break;case"SkinnedMesh":p=l(e.geometry),m=u(e.material),o=new NM(p,m),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":p=l(e.geometry),m=u(e.material),o=new ui(p,m);break;case"InstancedMesh":p=l(e.geometry),m=u(e.material);const v=e.count,y=e.instanceMatrix,x=e.instanceColor;o=new OM(p,m,v),o.instanceMatrix=new Pu(new Float32Array(y.array),16),x!==void 0&&(o.instanceColor=new Pu(new Float32Array(x.array),x.itemSize));break;case"BatchedMesh":p=l(e.geometry),m=u(e.material),o=new BM(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,m),o.geometry=p,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(M=>{const S=new ir;S.min.fromArray(M.boxMin),S.max.fromArray(M.boxMax);const w=new hr;return w.radius=M.sphereRadius,w.center.fromArray(M.sphereCenter),{boxInitialized:M.boxInitialized,box:S,sphereInitialized:M.sphereInitialized,sphere:w}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=d(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=d(e.colorsTexture.uuid));break;case"LOD":o=new FM;break;case"Line":o=new cs(l(e.geometry),u(e.material));break;case"LineLoop":o=new zM(l(e.geometry),u(e.material));break;case"LineSegments":o=new ra(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new HM(l(e.geometry),u(e.material));break;case"Sprite":o=new kM(u(e.material));break;case"Group":o=new cf;break;case"Bone":o=new m1;break;default:o=new In}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 v=e.children;for(let y=0;y<v.length;y++)o.add(this.parseObject(v[y],t,n,i,s))}if(e.animations!==void 0){const v=e.animations;for(let y=0;y<v.length;y++){const x=v[y];o.animations.push(s[x])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const v=e.levels;for(let y=0;y<v.length;y++){const x=v[y],M=o.getObjectByProperty("uuid",x.object);M!==void 0&&o.addLevel(M,x.distance,x.hysteresis)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const i=t[n.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(i,n.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,i=e.getObjectByProperty("uuid",n);i!==void 0?t.target=i:t.target=new In}})}}const hL={UVMapping:I0,CubeReflectionMapping:yl,CubeRefractionMapping:hc,EquirectangularReflectionMapping:Qh,EquirectangularRefractionMapping:$h,CubeUVReflectionMapping:Sf},nb={RepeatWrapping:ep,ClampToEdgeWrapping:yo,MirroredRepeatWrapping:tp},ib={NearestFilter:yi,NearestMipmapNearestFilter:Jx,NearestMipmapLinearFilter:of,LinearFilter:ni,LinearMipmapNearestFilter:Bh,LinearMipmapLinearFilter:Ca};class pL extends zs{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,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=vl.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(d=>{t&&t(d),s.manager.itemEnd(e)}).catch(d=>{i&&i(d)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader;const u=fetch(e,l).then(function(d){return d.blob()}).then(function(d){return createImageBitmap(d,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(d){return vl.add(e,d),t&&t(d),s.manager.itemEnd(e),d}).catch(function(d){i&&i(d),vl.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});vl.add(e,u),s.manager.itemStart(e)}}let _g;class P1{static getContext(){return _g===void 0&&(_g=new(window.AudioContext||window.webkitAudioContext)),_g}static setContext(e){_g=e}}class mL extends zs{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new _l(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){try{const d=u.slice(0);P1.getContext().decodeAudioData(d,function(m){t(m)}).catch(l)}catch(d){l(d)}},n,i);function l(u){i?i(u):console.error(u),s.manager.itemError(e)}}}const rb=new Xt,sb=new Xt,au=new Xt;class gL{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ci,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ci,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,au.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(Eu*t.fov*.5)/t.zoom;let l,u;sb.elements[12]=-i,rb.elements[12]=i,l=-o*t.aspect+s,u=o*t.aspect+s,au.elements[0]=2*t.near/(u-l),au.elements[8]=(u+l)/(u-l),this.cameraL.projectionMatrix.copy(au),l=-o*t.aspect-s,u=o*t.aspect-s,au.elements[0]=2*t.near/(u-l),au.elements[8]=(u+l)/(u-l),this.cameraR.projectionMatrix.copy(au)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(sb),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(rb)}}class I1{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ob(),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=ob();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function ob(){return(typeof performance>"u"?Date:performance).now()}const lu=new te,ab=new Xr,vL=new te,cu=new te;class yL extends In{constructor(){super(),this.type="AudioListener",this.context=P1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new I1}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,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(lu,ab,vL),cu.set(0,0,-1).applyQuaternion(ab),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(lu.x,i),t.positionY.linearRampToValueAtTime(lu.y,i),t.positionZ.linearRampToValueAtTime(lu.z,i),t.forwardX.linearRampToValueAtTime(cu.x,i),t.forwardY.linearRampToValueAtTime(cu.y,i),t.forwardZ.linearRampToValueAtTime(cu.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(lu.x,lu.y,lu.z),t.setOrientation(cu.x,cu.y,cu.z,n.x,n.y,n.z)}}class x2 extends In{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const uu=new te,lb=new Xr,xL=new te,du=new te;class _L extends x2{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,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(uu,lb,xL),du.set(0,0,1).applyQuaternion(lb);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(uu.x,n),t.positionY.linearRampToValueAtTime(uu.y,n),t.positionZ.linearRampToValueAtTime(uu.z,n),t.orientationX.linearRampToValueAtTime(du.x,n),t.orientationY.linearRampToValueAtTime(du.y,n),t.orientationZ.linearRampToValueAtTime(du.z,n)}else t.setPosition(uu.x,uu.y,uu.z),t.setOrientation(du.x,du.y,du.z)}}class SL{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 n=0;n<t.length;n++)e+=t[n];return e/t.length}}class _2{constructor(e,t,n){this.binding=e,this.valueSize=n;let i,s,o;switch(t){case"quaternion":i=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:i=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=i,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 n=this.buffer,i=this.valueSize,s=e*i+i;let o=this.cumulativeWeight;if(o===0){for(let l=0;l!==i;++l)n[s+l]=n[l];o=t}else{o+=t;const l=t/o;this._mixBufferRegion(n,s,0,l,i)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,l=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const u=t*this._origIndex;this._mixBufferRegion(n,i,u,1-s,t)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let u=t,d=t+t;u!==d;++u)if(n[u]!==n[u+t]){l.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];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 n=e;n<t;n++)this.buffer[n]=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 n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,s){if(i>=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Xr.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const o=this._workIndex*s;Xr.multiplyQuaternionsFlat(e,o,e,t,e,n),Xr.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){const o=1-i;for(let l=0;l!==s;++l){const u=t+l;e[u]=e[u]*o+e[n+l]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]+e[n+o]*i}}}const L1="\\[\\]\\.:\\/",bL=new RegExp("["+L1+"]","g"),D1="[^"+L1+"]",wL="[^"+L1.replace("\\.","")+"]",ML=/((?:WC+[\/:])*)/.source.replace("WC",D1),EL=/(WCOD+)?/.source.replace("WCOD",wL),TL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",D1),AL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",D1),CL=new RegExp("^"+ML+EL+TL+AL+"$"),RL=["material","materials","bones","map"];class PL{constructor(e,t,n){const i=n||Pn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Pn{constructor(e,t,n){this.path=t,this.parsedPath=n||Pn.parseTrackName(t),this.node=Pn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Pn.Composite(e,t,n):new Pn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(bL,"")}static parseTrackName(e){const t=CL.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);RL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o<s.length;o++){const l=s[o];if(l.name===t||l.uuid===t)return l;const u=n(l.children);if(u)return u}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_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 n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=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,n=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Pn.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(n){let d=t.objectIndex;switch(n){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 p=0;p<e.length;p++)if(e[p].name===d){d=p;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[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(d!==void 0){if(e[d]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[d]}}const o=e[i];if(o===void 0){const d=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+d+"."+i+" but it wasn't found.",e);return}let l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(s!==void 0){if(i==="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=i;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Pn.Composite=PL;Pn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Pn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Pn.prototype.GetterByBindingType=[Pn.prototype._getValue_direct,Pn.prototype._getValue_array,Pn.prototype._getValue_arrayElement,Pn.prototype._getValue_toArray];Pn.prototype.SetterByBindingTypeAndVersioning=[[Pn.prototype._setValue_direct,Pn.prototype._setValue_direct_setNeedsUpdate,Pn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Pn.prototype._setValue_array,Pn.prototype._setValue_array_setNeedsUpdate,Pn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Pn.prototype._setValue_arrayElement,Pn.prototype._setValue_arrayElement_setNeedsUpdate,Pn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Pn.prototype._setValue_fromArray,Pn.prototype._setValue_fromArray_setNeedsUpdate,Pn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class IL{constructor(){this.isAnimationObjectGroup=!0,this.uuid=no(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;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,n=this._paths,i=this._parsedPaths,s=this._bindings,o=s.length;let l,u=e.length,d=this.nCachedObjects_;for(let p=0,m=arguments.length;p!==m;++p){const v=arguments[p],y=v.uuid;let x=t[y];if(x===void 0){x=u++,t[y]=x,e.push(v);for(let M=0,S=o;M!==S;++M)s[M].push(new Pn(v,n[M],i[M]))}else if(x<d){l=e[x];const M=--d,S=e[M];t[S.uuid]=x,e[x]=S,t[y]=M,e[M]=v;for(let w=0,A=o;w!==A;++w){const T=s[w],R=T[M];let U=T[x];T[x]=R,U===void 0&&(U=new Pn(v,n[w],i[w])),T[M]=U}}else e[x]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=d}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_;for(let o=0,l=arguments.length;o!==l;++o){const u=arguments[o],d=u.uuid,p=t[d];if(p!==void 0&&p>=s){const m=s++,v=e[m];t[v.uuid]=p,e[p]=v,t[d]=m,e[m]=u;for(let y=0,x=i;y!==x;++y){const M=n[y],S=M[m],w=M[p];M[p]=S,M[m]=w}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,o=e.length;for(let l=0,u=arguments.length;l!==u;++l){const d=arguments[l],p=d.uuid,m=t[p];if(m!==void 0)if(delete t[p],m<s){const v=--s,y=e[v],x=--o,M=e[x];t[y.uuid]=m,e[m]=y,t[M.uuid]=v,e[v]=M,e.pop();for(let S=0,w=i;S!==w;++S){const A=n[S],T=A[v],R=A[x];A[m]=T,A[v]=R,A.pop()}}else{const v=--o,y=e[v];v>0&&(t[y.uuid]=m),e[m]=y,e.pop();for(let x=0,M=i;x!==M;++x){const S=n[x];S[m]=S[v],S.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,l=this._parsedPaths,u=this._objects,d=u.length,p=this.nCachedObjects_,m=new Array(d);i=s.length,n[e]=i,o.push(e),l.push(t),s.push(m);for(let v=p,y=u.length;v!==y;++v){const x=u[v];m[v]=new Pn(x,e,t)}return m}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,l=o.length-1,u=o[l],d=e[l];t[d]=n,o[n]=u,o.pop(),s[n]=s[l],s.pop(),i[n]=i[l],i.pop()}}}class S2{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,o=s.length,l=new Array(o),u={endingStart:xu,endingEnd:xu};for(let d=0;d!==o;++d){const p=s[d].createInterpolant(null);l[d]=p,p.settings=u}this._interpolantSettings=u,this._interpolants=l,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=aM,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,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,s=e._clip.duration,o=s/i,l=i/s;e.warp(1,o,t),this.warp(l,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}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,n){const i=this._mixer,s=i.time,o=this.timeScale;let l=this._timeScaleInterpolant;l===null&&(l=i._lendControlInterpolant(),this._timeScaleInterpolant=l);const u=l.parameterPositions,d=l.sampleValues;return u[0]=s,u[1]=s+n,d[0]=e/o,d[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,n,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const u=(e-s)*n;u<0||n===0?t=0:(this._startTime=null,t=n*u)}t*=this._updateTimeScale(e);const o=this._updateTime(t),l=this._updateWeight(e);if(l>0){const u=this._interpolants,d=this._propertyBindings;switch(this.blendMode){case a1:for(let p=0,m=u.length;p!==m;++p)u[p].evaluate(o),d[p].accumulateAdditive(l);break;case O0:default:for(let p=0,m=u.length;p!==m;++p)u[p].evaluate(o),d[p].accumulate(i,l)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,s=this._loopCount;const o=n===lM;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(n===oM){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,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)),i>=t||i<0){const l=Math.floor(i/t);i-=t*l,s+=Math.abs(l);const u=this.repetitions-s;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const d=e<0;this._setEndings(d,!d,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=_u,i.endingEnd=_u):(e?i.endingStart=this.zeroSlopeAtStart?_u:xu:i.endingStart=ip,t?i.endingEnd=this.zeroSlopeAtEnd?_u:xu:i.endingEnd=ip)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=s,u[0]=t,l[1]=s+e,u[1]=n,this}}const LL=new Float32Array(1);class DL extends ro{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,l=e._interpolants,u=n.uuid,d=this._bindingsByRootAndName;let p=d[u];p===void 0&&(p={},d[u]=p);for(let m=0;m!==s;++m){const v=i[m],y=v.name;let x=p[y];if(x!==void 0)++x.referenceCount,o[m]=x;else{if(x=o[m],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,u,y));continue}const M=t&&t._propertyBindings[m].binding.parsedPath;x=new _2(Pn.create(n,y,M),v.ValueTypeName,v.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,u,y),o[m]=x}l[m].resultBuffer=x.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--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,n){const i=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 l=o.knownActions;e._byClipCacheIndex=l.length,l.push(e)}e._cacheIndex=i.length,i.push(e),o.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,l=o[s],u=l.knownActions,d=u[u.length-1],p=e._byClipCacheIndex;d._byClipCacheIndex=p,u[p]=d,u.pop(),e._byClipCacheIndex=null;const m=l.actionByRoot,v=(e._localRoot||this._root).uuid;delete m[v],u.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,s=this._bindings;let o=i[t];o===void 0&&(o={},i[t]=o),o[n]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,s=n.path,o=this._bindingsByRootAndName,l=o[i],u=t[t.length-1],d=e._cacheIndex;u._cacheIndex=d,t[d]=u,t.pop(),delete l[s],Object.keys(l).length===0&&delete o[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new T1(new Float32Array(2),new Float32Array(2),1,LL),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,s=t[i];e.__cacheIndex=i,t[i]=e,s.__cacheIndex=n,t[n]=s}clipAction(e,t,n){const i=t||this._root,s=i.uuid;let o=typeof e=="string"?yp.findByName(i,e):e;const l=o!==null?o.uuid:e,u=this._actionsByClip[l];let d=null;if(n===void 0&&(o!==null?n=o.blendMode:n=O0),u!==void 0){const m=u.actionByRoot[s];if(m!==void 0&&m.blendMode===n)return m;d=u.knownActions[0],o===null&&(o=d._clip)}if(o===null)return null;const p=new S2(this,o,t,n);return this._bindAction(p,d),this._addInactiveAction(p,l,s),p}existingAction(e,t){const n=t||this._root,i=n.uuid,s=typeof e=="string"?yp.findByName(n,e):e,o=s?s.uuid:e,l=this._actionsByClip[o];return l!==void 0&&l.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let d=0;d!==n;++d)t[d]._update(i,e,s,o);const l=this._bindings,u=this._nActiveBindings;for(let d=0;d!==u;++d)l[d].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,n=e.uuid,i=this._actionsByClip,s=i[n];if(s!==void 0){const o=s.knownActions;for(let l=0,u=o.length;l!==u;++l){const d=o[l];this._deactivateAction(d);const p=d._cacheIndex,m=t[t.length-1];d._cacheIndex=null,d._byClipCacheIndex=null,m._cacheIndex=p,t[p]=m,t.pop(),this._removeInactiveBindingsForAction(d)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const o in n){const l=n[o].actionByRoot,u=l[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const i=this._bindingsByRootAndName,s=i[t];if(s!==void 0)for(const o in s){const l=s[o];l.restoreOriginalState(),this._removeInactiveBinding(l)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class hn{constructor(e){this.value=e}clone(){return new hn(this.value.clone===void 0?this.value:this.value.clone())}}let UL=0;class kL extends ro{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:UL++}),this.name="",this.usage=ap,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 n=0,i=t.length;n<i;n++){const s=Array.isArray(t[n])?t[n]:[t[n]];for(let o=0;o<s.length;o++)this.uniforms.push(s[o].clone())}return this}clone(){return new this.constructor().copy(this)}}class E0 extends X0{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}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 FL{constructor(e,t,n,i,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,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}}
vendor: 4,408 bytes, line 3880
3880const cb=new Xt;class b2{constructor(e,t,n=0,i=1/0){this.ray=new ku(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Tu,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: Unsupported camera type: "+t.type)}setFromXRController(e){return cb.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(cb),this}intersectObject(e,t=!0,n=[]){return Mx(e,this,n,t),n.sort(ub),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i<s;i++)Mx(e[i],this,n,t);return n.sort(ub),n}}function ub(r,e){return r.distance-e.distance}function Mx(r,e,t,n){let i=!0;if(r.layers.test(e.layers)&&r.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const s=r.children;for(let o=0,l=s.length;o<l;o++)Mx(s[o],e,t,!0)}}class Ex{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,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,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(ki(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class NL{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,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,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}class U1{constructor(e,t,n,i){U1.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){const s=this.elements;return s[0]=e,s[2]=t,s[1]=n,s[3]=i,this}}const db=new We;class OL{constructor(e=new We(1/0,1/0),t=new We(-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,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=db.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),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,db).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)}}
vendor: 10,942 bytes, line 3880
3880const fb=new te,Sg=new te;class w2{constructor(e=new te,t=new te){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){fb.subVectors(e,this.start),Sg.subVectors(this.end,this.start);const n=Sg.dot(Sg);let s=Sg.dot(fb)/n;return t&&(s=ki(s,0,1)),s}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const hb=new te;class BL extends In{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new qt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,l=1,u=32;o<u;o++,l++){const d=o/u*Math.PI*2,p=l/u*Math.PI*2;i.push(Math.cos(d),Math.sin(d),1,Math.cos(p),Math.sin(p),1)}n.setAttribute("position",new Pt(i,3));const s=new Ar({fog:!1,toneMapped:!1});this.cone=new ra(n,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),hb.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(hb),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const rc=new te,bg=new Xt,Uy=new Xt;class zL extends ra{constructor(e){const t=M2(e),n=new qt,i=[],s=[],o=new St(0,0,1),l=new St(0,1,0);for(let d=0;d<t.length;d++){const p=t[d];p.parent&&p.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(o.r,o.g,o.b),s.push(l.r,l.g,l.b))}n.setAttribute("position",new Pt(i,3)),n.setAttribute("color",new Pt(s,3));const u=new Ar({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,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,n=this.geometry,i=n.getAttribute("position");Uy.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const l=t[s];l.parent&&l.parent.isBone&&(bg.multiplyMatrices(Uy,l.matrixWorld),rc.setFromMatrixPosition(bg),i.setXYZ(o,rc.x,rc.y,rc.z),bg.multiplyMatrices(Uy,l.parent.matrixWorld),rc.setFromMatrixPosition(bg),i.setXYZ(o+1,rc.x,rc.y,rc.z),o+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function M2(r){const e=[];r.isBone===!0&&e.push(r);for(let t=0;t<r.children.length;t++)e.push.apply(e,M2(r.children[t]));return e}class HL extends ui{constructor(e,t,n){const i=new Dp(t,4,2),s=new Sl({wireframe:!0,fog:!1,toneMapped:!1});super(i,s),this.light=e,this.color=n,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 GL=new te,pb=new St,mb=new St;class VL extends In{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new Lp(t);i.rotateY(Math.PI*.5),this.material=new Sl({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),o=new Float32Array(s.count*3);i.setAttribute("color",new zn(o,3)),this.add(new ui(i,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");pb.copy(this.light.color),mb.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const s=n<i/2?pb:mb;t.setXYZ(n,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(GL.setFromMatrixPosition(this.light.matrixWorld).negate())}}class jL extends ra{constructor(e=10,t=10,n=4473924,i=8947848){n=new St(n),i=new St(i);const s=t/2,o=e/t,l=e/2,u=[],d=[];for(let v=0,y=0,x=-l;v<=t;v++,x+=o){u.push(-l,0,x,l,0,x),u.push(x,0,-l,x,0,l);const M=v===s?n:i;M.toArray(d,y),y+=3,M.toArray(d,y),y+=3,M.toArray(d,y),y+=3,M.toArray(d,y),y+=3}const p=new qt;p.setAttribute("position",new Pt(u,3)),p.setAttribute("color",new Pt(d,3));const m=new Ar({vertexColors:!0,toneMapped:!1});super(p,m),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class WL extends ra{constructor(e=10,t=16,n=8,i=64,s=4473924,o=8947848){s=new St(s),o=new St(o);const l=[],u=[];if(t>1)for(let m=0;m<t;m++){const v=m/t*(Math.PI*2),y=Math.sin(v)*e,x=Math.cos(v)*e;l.push(0,0,0),l.push(y,0,x);const M=m&1?s:o;u.push(M.r,M.g,M.b),u.push(M.r,M.g,M.b)}for(let m=0;m<n;m++){const v=m&1?s:o,y=e-e/n*m;for(let x=0;x<i;x++){let M=x/i*(Math.PI*2),S=Math.sin(M)*y,w=Math.cos(M)*y;l.push(S,0,w),u.push(v.r,v.g,v.b),M=(x+1)/i*(Math.PI*2),S=Math.sin(M)*y,w=Math.cos(M)*y,l.push(S,0,w),u.push(v.r,v.g,v.b)}}const d=new qt;d.setAttribute("position",new Pt(l,3)),d.setAttribute("color",new Pt(u,3));const p=new Ar({vertexColors:!0,toneMapped:!1});super(d,p),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const gb=new te,wg=new te,vb=new te;class XL extends In{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",t===void 0&&(t=1);let i=new qt;i.setAttribute("position",new Pt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new Ar({fog:!1,toneMapped:!1});this.lightPlane=new cs(i,s),this.add(this.lightPlane),i=new qt,i.setAttribute("position",new Pt([0,0,0,0,0,1],3)),this.targetLine=new cs(i,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),gb.setFromMatrixPosition(this.light.matrixWorld),wg.setFromMatrixPosition(this.light.target.matrixWorld),vb.subVectors(wg,gb),this.lightPlane.lookAt(wg),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(wg),this.targetLine.scale.z=vb.length()}}const Mg=new te,Ui=new Ap;class YL extends ra{constructor(e){const t=new qt,n=new Ar({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={};l("n1","n2"),l("n2","n4"),l("n4","n3"),l("n3","n1"),l("f1","f2"),l("f2","f4"),l("f4","f3"),l("f3","f1"),l("n1","f1"),l("n2","f2"),l("n3","f3"),l("n4","f4"),l("p","n1"),l("p","n2"),l("p","n3"),l("p","n4"),l("u1","u2"),l("u2","u3"),l("u3","u1"),l("c","t"),l("p","c"),l("cn1","cn2"),l("cn3","cn4"),l("cf1","cf2"),l("cf3","cf4");function l(x,M){u(x),u(M)}function u(x){i.push(0,0,0),s.push(0,0,0),o[x]===void 0&&(o[x]=[]),o[x].push(i.length/3-1)}t.setAttribute("position",new Pt(i,3)),t.setAttribute("color",new Pt(s,3)),super(t,n),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 d=new St(16755200),p=new St(16711680),m=new St(43775),v=new St(16777215),y=new St(3355443);this.setColors(d,p,m,v,y)}setColors(e,t,n,i,s){const l=this.geometry.getAttribute("color");l.setXYZ(0,e.r,e.g,e.b),l.setXYZ(1,e.r,e.g,e.b),l.setXYZ(2,e.r,e.g,e.b),l.setXYZ(3,e.r,e.g,e.b),l.setXYZ(4,e.r,e.g,e.b),l.setXYZ(5,e.r,e.g,e.b),l.setXYZ(6,e.r,e.g,e.b),l.setXYZ(7,e.r,e.g,e.b),l.setXYZ(8,e.r,e.g,e.b),l.setXYZ(9,e.r,e.g,e.b),l.setXYZ(10,e.r,e.g,e.b),l.setXYZ(11,e.r,e.g,e.b),l.setXYZ(12,e.r,e.g,e.b),l.setXYZ(13,e.r,e.g,e.b),l.setXYZ(14,e.r,e.g,e.b),l.setXYZ(15,e.r,e.g,e.b),l.setXYZ(16,e.r,e.g,e.b),l.setXYZ(17,e.r,e.g,e.b),l.setXYZ(18,e.r,e.g,e.b),l.setXYZ(19,e.r,e.g,e.b),l.setXYZ(20,e.r,e.g,e.b),l.setXYZ(21,e.r,e.g,e.b),l.setXYZ(22,e.r,e.g,e.b),l.setXYZ(23,e.r,e.g,e.b),l.setXYZ(24,t.r,t.g,t.b),l.setXYZ(25,t.r,t.g,t.b),l.setXYZ(26,t.r,t.g,t.b),l.setXYZ(27,t.r,t.g,t.b),l.setXYZ(28,t.r,t.g,t.b),l.setXYZ(29,t.r,t.g,t.b),l.setXYZ(30,t.r,t.g,t.b),l.setXYZ(31,t.r,t.g,t.b),l.setXYZ(32,n.r,n.g,n.b),l.setXYZ(33,n.r,n.g,n.b),l.setXYZ(34,n.r,n.g,n.b),l.setXYZ(35,n.r,n.g,n.b),l.setXYZ(36,n.r,n.g,n.b),l.setXYZ(37,n.r,n.g,n.b),l.setXYZ(38,i.r,i.g,i.b),l.setXYZ(39,i.r,i.g,i.b),l.setXYZ(40,s.r,s.g,s.b),l.setXYZ(41,s.r,s.g,s.b),l.setXYZ(42,s.r,s.g,s.b),l.setXYZ(43,s.r,s.g,s.b),l.setXYZ(44,s.r,s.g,s.b),l.setXYZ(45,s.r,s.g,s.b),l.setXYZ(46,s.r,s.g,s.b),l.setXYZ(47,s.r,s.g,s.b),l.setXYZ(48,s.r,s.g,s.b),l.setXYZ(49,s.r,s.g,s.b),l.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,n=1,i=1;Ui.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Gi("c",t,e,Ui,0,0,-1),Gi("t",t,e,Ui,0,0,1),Gi("n1",t,e,Ui,-n,-i,-1),Gi("n2",t,e,Ui,n,-i,-1),Gi("n3",t,e,Ui,-n,i,-1),Gi("n4",t,e,Ui,n,i,-1),Gi("f1",t,e,Ui,-n,-i,1),Gi("f2",t,e,Ui,n,-i,1),Gi("f3",t,e,Ui,-n,i,1),Gi("f4",t,e,Ui,n,i,1),Gi("u1",t,e,Ui,n*.7,i*1.1,-1),Gi("u2",t,e,Ui,-n*.7,i*1.1,-1),Gi("u3",t,e,Ui,0,i*2,-1),Gi("cf1",t,e,Ui,-n,0,1),Gi("cf2",t,e,Ui,n,0,1),Gi("cf3",t,e,Ui,0,-i,1),Gi("cf4",t,e,Ui,0,i,1),Gi("cn1",t,e,Ui,-n,0,-1),Gi("cn2",t,e,Ui,n,0,-1),Gi("cn3",t,e,Ui,0,-i,-1),Gi("cn4",t,e,Ui,0,i,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Gi(r,e,t,n,i,s,o){Mg.set(i,s,o).unproject(n);const l=e[r];if(l!==void 0){const u=t.getAttribute("position");for(let d=0,p=l.length;d<p;d++)u.setXYZ(l[d],Mg.x,Mg.y,Mg.z)}}const Eg=new ir;class qL extends ra{constructor(e,t=16776960){const n=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]),i=new Float32Array(24),s=new qt;s.setIndex(new zn(n,1)),s.setAttribute("position",new zn(i,3)),super(s,new Ar({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(
3880) has no longer arguments."),this.object!==void 0&&Eg.setFromObject(this.object),Eg.isEmpty())return;const t=Eg.min,n=Eg.max,i=this.geometry.attributes.position,s=i.array;s[0]=n.x,s[1]=n.y,s[2]=n.z,s[3]=t.x,s[4]=n.y,s[5]=n.z,s[6]=t.x,s[7]=t.y,s[8]=n.z,s[9]=n.x,s[10]=t.y,s[11]=n.z,s[12]=n.x,s[13]=n.y,s[14]=t.z,s[15]=t.x,s[16]=n.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=n.x,s[22]=t.y,s[23]=t.z,i.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 KL extends ra{constructor(e,t=16776960){const n=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]),i=[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 qt;s.setIndex(new zn(n,1)),s.setAttribute("position",new Pt(i,3)),super(s,new Ar({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 ZL extends cs{constructor(e,t=1,n=16776960){const i=n,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 qt;o.setAttribute("position",new Pt(s,3)),o.computeBoundingSphere(),super(o,new Ar({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const l=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],u=new qt;u.setAttribute("position",new Pt(l,3)),u.computeBoundingSphere(),this.add(new ui(u,new Sl({color:i,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 yb=new te;let Tg,ky;class JL extends In{constructor(e=new te(0,0,1),t=new te(0,0,0),n=1,i=16776960,s=n*.2,o=s*.2){super(),this.type="ArrowHelper",Tg===void 0&&(Tg=new qt,Tg.setAttribute("position",new Pt([0,0,0,0,1,0],3)),ky=new wf(0,.5,1,5,1),ky.translate(0,-.5,0)),this.position.copy(t),this.line=new cs(Tg,new Ar({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ui(ky,new Sl({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,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{yb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(yb,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),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 QL extends ra{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new qt;i.setAttribute("position",new Pt(t,3)),i.setAttribute("color",new Pt(n,3));const s=new Ar({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,n){const i=new St,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class $L{constructor(){this.type="ShapePath",this.color=new St,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new fp,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,s,o){return this.currentPath.bezierCurveTo(e,t,n,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(w){const A=[];for(let T=0,R=w.length;T<R;T++){const U=w[T],k=new Au;k.curves=U.curves,A.push(k)}return A}function n(w,A){const T=A.length;let R=!1;for(let U=T-1,k=0;k<T;U=k++){let N=A[U],H=A[k],F=H.x-N.x,I=H.y-N.y;
vendor: 16,872 bytes, lines 3880-3896
3880if(Math.abs(I)>Number.EPSILON){if(I<0&&(N=A[k],F=-F,H=A[U],I=-I),w.y<N.y||w.y>H.y)continue;if(w.y===N.y){if(w.x===N.x)return!0}else{const G=I*(w.x-N.x)-F*(w.y-N.y);if(G===0)return!0;if(G<0)continue;R=!R}}else{if(w.y!==N.y)continue;if(H.x<=w.x&&w.x<=N.x||N.x<=w.x&&w.x<=H.x)return!0}}return R}const i=Ia.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,l,u;const d=[];if(s.length===1)return l=s[0],u=new Au,u.curves=l.curves,d.push(u),d;let p=!i(s[0].getPoints());p=e?!p:p;const m=[],v=[];let y=[],x=0,M;v[x]=void 0,y[x]=[];for(let w=0,A=s.length;w<A;w++)l=s[w],M=l.getPoints(),o=i(M),o=e?!o:o,o?(!p&&v[x]&&x++,v[x]={s:new Au,p:M},v[x].s.curves=l.curves,p&&x++,y[x]=[]):y[x].push({h:l,p:M[0]});if(!v[0])return t(s);if(v.length>1){let w=!1,A=0;for(let T=0,R=v.length;T<R;T++)m[T]=[];for(let T=0,R=v.length;T<R;T++){const U=y[T];for(let k=0;k<U.length;k++){const N=U[k];let H=!0;for(let F=0;F<v.length;F++)n(N.p,v[F].p)&&(T!==F&&A++,H?(H=!1,m[F].push(N)):w=!0);H&&m[T].push(N)}}A>0&&w===!1&&(y=m)}let S;for(let w=0,A=v.length;w<A;w++){u=v[w].s,d.push(u),S=y[w];for(let T=0,R=S.length;T<R;T++)u.holes.push(S[T].h)}return d}}class eD extends ro{constructor(e,t){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 tD extends xi{constructor(e=1,t=1,n=1,i={}){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,{...i,count:n}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Du}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Du);const nD=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Zx,AddEquation:uc,AddOperation:Qw,AdditiveAnimationBlendMode:a1,AdditiveBlending:ux,AgXToneMapping:iM,AlphaFormat:t1,AlwaysCompare:gM,AlwaysDepth:R0,AlwaysStencilFunc:px,AmbientLight:p2,AnimationAction:S2,AnimationClip:yp,AnimationLoader:rL,AnimationMixer:DL,AnimationObjectGroup:IL,AnimationUtils:eL,ArcCurve:GM,ArrayCamera:LM,ArrowHelper:JL,AttachedBindMode:hx,Audio:x2,AudioAnalyser:SL,AudioContext:P1,AudioListener:yL,AudioLoader:mL,AxesHelper:QL,BackSide:dr,BasicDepthPacking:na,BasicShadowMap:Lw,BatchedMesh:BM,Bone:m1,BooleanKeyframeTrack:Ou,Box2:OL,Box3:ir,Box3Helper:KL,BoxGeometry:Fu,BoxHelper:qL,BufferAttribute:zn,BufferGeometry:qt,BufferGeometryLoader:y2,ByteType:Qx,Cache:vl,Camera:Ap,CameraHelper:YL,CanvasTexture:M3,CapsuleGeometry:Z0,CatmullRomCurve3:VM,CineonToneMapping:tM,CircleGeometry:J0,ClampToEdgeWrapping:yo,Clock:I1,Color:St,ColorKeyframeTrack:A1,ColorManagement:kn,CompressedArrayTexture:b3,CompressedCubeTexture:w3,CompressedTexture:q0,CompressedTextureLoader:sL,ConeGeometry:Q0,ConstantAlphaFactor:Kw,ConstantColorFactor:Yw,Controls:eD,CubeCamera:MM,CubeReflectionMapping:yl,CubeRefractionMapping:hc,CubeTexture:Cp,CubeTextureLoader:oL,CubeUVReflectionMapping:Sf,CubicBezierCurve:y1,CubicBezierCurve3:jM,CubicInterpolant:o2,CullFaceBack:cx,CullFaceFront:Iw,CullFaceFrontBack:eT,CullFaceNone:Pw,Curve:sa,CurvePath:XM,CustomBlending:Dw,CustomToneMapping:nM,CylinderGeometry:wf,Cylindrical:NL,Data3DTexture:u1,DataArrayTexture:z0,DataTexture:Pa,DataTextureLoader:aL,DataUtils:fA,DecrementStencilOp:pT,DecrementWrapStencilOp:gT,DefaultLoadingManager:c2,DepthFormat:Mu,DepthStencilFormat:mc,DepthTexture:H0,DetachedBindMode:sM,DirectionalLight:h2,DirectionalLightHelper:XL,DiscreteInterpolant:a2,DisplayP3ColorSpace:B0,DodecahedronGeometry:$0,DoubleSide:os,DstAlphaFactor:Gw,DstColorFactor:jw,DynamicCopyUsage:IT,DynamicDrawUsage:ET,DynamicReadUsage:CT,EdgesGeometry:YM,EllipseCurve:K0,EqualCompare:fM,EqualDepth:Jh,EqualStencilFunc:_T,EquirectangularReflectionMapping:Qh,EquirectangularRefractionMapping:$h,Euler:io,EventDispatcher:ro,ExtrudeGeometry:tv,FileLoader:_l,Float16BufferAttribute:yA,Float32BufferAttribute:Pt,FloatType:as,Fog:W0,FogExp2:j0,FramebufferTexture:S3,FrontSide:Da,Frustum:Rp,GLBufferAttribute:FL,GLSL1:DT,GLSL3:mx,GreaterCompare:hM,GreaterDepth:Kx,GreaterEqualCompare:mM,GreaterEqualDepth:qx,GreaterEqualStencilFunc:MT,GreaterStencilFunc:bT,GridHelper:jL,Group:cf,HalfFloatType:Uu,HemisphereLight:u2,HemisphereLightHelper:VL,IcosahedronGeometry:nv,ImageBitmapLoader:pL,ImageLoader:xp,ImageUtils:_M,IncrementStencilOp:hT,IncrementWrapStencilOp:mT,InstancedBufferAttribute:Pu,InstancedBufferGeometry:uv,InstancedInterleavedBuffer:E0,InstancedMesh:OM,Int16BufferAttribute:gA,Int32BufferAttribute:vA,Int8BufferAttribute:hA,IntType:L0,InterleavedBuffer:X0,InterleavedBufferAttribute:to,Interpolant:Up,InterpolateDiscrete:np,InterpolateLinear:S0,InterpolateSmooth:Hg,InvertStencilOp:vT,KeepStencilOp:gu,KeyframeTrack:oa,LOD:FM,LatheGeometry:Ip,Layers:Tu,LessCompare:dM,LessDepth:qg,LessEqualCompare:l1,LessEqualDepth:pf,LessEqualStencilFunc:ST,LessStencilFunc:xT,Light:_c,LightProbe:v2,Line:cs,Line3:w2,LineBasicMaterial:Ar,LineCurve:x1,LineCurve3:WM,LineDashedMaterial:gc,LineLoop:zM,LineSegments:ra,LinearDisplayP3ColorSpace:Tp,LinearFilter:ni,LinearInterpolant:T1,LinearMipMapLinearFilter:rT,LinearMipMapNearestFilter:iT,LinearMipmapLinearFilter:Ca,LinearMipmapNearestFilter:Bh,LinearSRGBColorSpace:ia,LinearToneMapping:$w,LinearTransfer:rp,Loader:zs,LoaderUtils:wx,LoadingManager:C1,LoopOnce:oM,LoopPingPong:lM,LoopRepeat:aM,LuminanceAlphaFormat:r1,LuminanceFormat:i1,MOUSE:pu,Material:Rr,MaterialLoader:cv,MathUtils:vM,Matrix2:U1,Matrix3:on,Matrix4:Xt,MaxEquation:Nw,Mesh:ui,MeshBasicMaterial:Sl,MeshDepthMaterial:Pp,MeshDistanceMaterial:V0,MeshLambertMaterial:n2,MeshMatcapMaterial:i2,MeshNormalMaterial:M1,MeshPhongMaterial:e2,MeshPhysicalMaterial:$M,MeshStandardMaterial:w1,MeshToonMaterial:t2,MinEquation:Fw,MirroredRepeatWrapping:tp,MixOperation:Jw,MultiplyBlending:fx,MultiplyOperation:wp,NearestFilter:yi,NearestMipMapLinearFilter:nT,NearestMipMapNearestFilter:tT,NearestMipmapLinearFilter:of,NearestMipmapNearestFilter:Jx,NeutralToneMapping:rM,NeverCompare:uM,NeverDepth:Yx,NeverStencilFunc:yT,NoBlending:Wr,NoColorSpace:Qo,NoToneMapping:ea,NormalAnimationBlendMode:O0,NormalBlending:wu,NotEqualCompare:pM,NotEqualDepth:P0,NotEqualStencilFunc:wT,NumberKeyframeTrack:gp,Object3D:In,ObjectLoader:fL,ObjectSpaceNormalMap:cM,OctahedronGeometry:Lp,OneFactor:Bw,OneMinusConstantAlphaFactor:Zw,OneMinusConstantColorFactor:qw,OneMinusDstAlphaFactor:Vw,OneMinusDstColorFactor:Ww,OneMinusSrcAlphaFactor:Yg,OneMinusSrcColorFactor:Hw,OrthographicCamera:ta,P3Primaries:op,PCFShadowMap:C0,PCFSoftShadowMap:Oh,PMREMGenerator:gx,Path:fp,PerspectiveCamera:ci,Plane:pl,PlaneGeometry:bl,PlaneHelper:ZL,PointLight:f2,PointLightHelper:HL,Points:HM,PointsMaterial:g1,PolarGridHelper:WL,PolyhedronGeometry:xc,PositionalAudio:_L,PropertyBinding:Pn,PropertyMixer:_2,QuadraticBezierCurve:_1,QuadraticBezierCurve3:Nu,Quaternion:Xr,QuaternionKeyframeTrack:kp,QuaternionLinearInterpolant:l2,RED_GREEN_RGTC2_Format:x0,RED_RGTC1_Format:o1,REVISION:Du,RGBADepthPacking:Ep,RGBAFormat:ls,RGBAIntegerFormat:N0,RGBA_ASTC_10x10_Format:h0,RGBA_ASTC_10x5_Format:u0,RGBA_ASTC_10x6_Format:d0,RGBA_ASTC_10x8_Format:f0,RGBA_ASTC_12x10_Format:p0,RGBA_ASTC_12x12_Format:m0,RGBA_ASTC_4x4_Format:n0,RGBA_ASTC_5x4_Format:i0,RGBA_ASTC_5x5_Format:r0,RGBA_ASTC_6x5_Format:s0,RGBA_ASTC_6x6_Format:o0,RGBA_ASTC_8x5_Format:a0,RGBA_ASTC_8x6_Format:l0,RGBA_ASTC_8x8_Format:c0,RGBA_BPTC_Format:jh,RGBA_ETC2_EAC_Format:t0,RGBA_PVRTC_2BPPV1_Format:Qg,RGBA_PVRTC_4BPPV1_Format:Jg,RGBA_S3TC_DXT1_Format:Hh,RGBA_S3TC_DXT3_Format:Gh,RGBA_S3TC_DXT5_Format:Vh,RGBDepthPacking:cT,RGBFormat:n1,RGBIntegerFormat:sT,RGB_BPTC_SIGNED_Format:g0,RGB_BPTC_UNSIGNED_Format:v0,RGB_ETC1_Format:$g,RGB_ETC2_Format:e0,RGB_PVRTC_2BPPV1_Format:Zg,RGB_PVRTC_4BPPV1_Format:Kg,RGB_S3TC_DXT1_Format:zh,RGDepthPacking:uT,RGFormat:s1,RGIntegerFormat:F0,RawShaderMaterial:QM,Ray:ku,Raycaster:b2,Rec709Primaries:sp,RectAreaLight:m2,RedFormat:k0,RedIntegerFormat:Mp,ReinhardToneMapping:eM,RenderTarget:SM,RepeatWrapping:ep,ReplaceStencilOp:fT,ReverseSubtractEquation:kw,RingGeometry:iv,SIGNED_RED_GREEN_RGTC2_Format:_0,SIGNED_RED_RGTC1_Format:y0,SRGBColorSpace:Bn,SRGBTransfer:ti,Scene:dp,ShaderChunk:cn,ShaderLib:Jo,ShaderMaterial:Vi,ShadowMaterial:JM,Shape:Au,ShapeGeometry:rv,ShapePath:$L,ShapeUtils:Ia,ShortType:$x,Skeleton:Y0,SkeletonHelper:zL,SkinnedMesh:NM,Source:Su,Sphere:hr,SphereGeometry:Dp,Spherical:Ex,SphericalHarmonics3:g2,SplineCurve:S1,SpotLight:d2,SpotLightHelper:BL,Sprite:kM,SpriteMaterial:p1,SrcAlphaFactor:Xg,SrcAlphaSaturateFactor:Xw,SrcColorFactor:zw,StaticCopyUsage:PT,StaticDrawUsage:ap,StaticReadUsage:AT,StereoCamera:gL,StreamCopyUsage:LT,StreamDrawUsage:TT,StreamReadUsage:RT,StringKeyframeTrack:Bu,SubtractEquation:Uw,SubtractiveBlending:dx,TOUCH:mu,TangentSpaceNormalMap:yc,TetrahedronGeometry:sv,Texture:di,TextureLoader:lL,TextureUtils:e3,TorusGeometry:ov,TorusKnotGeometry:av,Triangle:eo,TriangleFanDrawMode:lT,TriangleStripDrawMode:aT,TrianglesDrawMode:oT,TubeGeometry:lv,UVMapping:I0,Uint16BufferAttribute:d1,Uint32BufferAttribute:f1,Uint8BufferAttribute:pA,Uint8ClampedBufferAttribute:mA,Uniform:hn,UniformsGroup:kL,UniformsLib:_t,UniformsUtils:up,UnsignedByteType:pr,UnsignedInt248Type:pc,UnsignedInt5999Type:e1,UnsignedIntType:xl,UnsignedShort4444Type:D0,UnsignedShort5551Type:U0,UnsignedShortType:mf,VSMShadowMap:Zo,Vector2:We,Vector3:te,Vector4:fn,VectorKeyframeTrack:vp,VideoTexture:_3,WebGL3DRenderTarget:nA,WebGLArrayRenderTarget:tA,WebGLCoordinateSystem:Ra,WebGLCubeRenderTarget:EM,WebGLMultipleRenderTargets:tD,WebGLRenderTarget:xi,WebGLRenderer:DM,WebGLUtils:IM,WebGPUCoordinateSystem:lp,WireframeGeometry:b1,WrapAroundEnding:ip,ZeroCurvatureEnding:xu,ZeroFactor:Ow,ZeroSlopeEnding:_u,ZeroStencilOp:dT,createCanvasElement:xM},Symbol.toStringTag,{value:"Module"}));var Fy={exports:{}},sc={};/** 3881 * @license React 3882 * react-reconciler-constants.production.min.js 3883 * 3884 * Copyright (c) Facebook, Inc. and its affiliates. 3885 * 3886 * This source code is licensed under the MIT license found in the 3887 * LICENSE file in the root directory of this source tree. 3888 */var xb;function iD(){return xb||(xb=1,sc.ConcurrentRoot=1,sc.ContinuousEventPriority=4,sc.DefaultEventPriority=16,sc.DiscreteEventPriority=1,sc.IdleEventPriority=536870912,sc.LegacyRoot=0),sc}var _b;function rD(){return _b||(_b=1,Fy.exports=iD()),Fy.exports}var df=rD();function sD(r){let e;const t=new Set,n=(d,p)=>{const m=typeof d=="function"?d(e):d;if(m!==e){const v=e;e=p?m:Object.assign({},e,m),t.forEach(y=>y(e,v))}},i=()=>e,s=(d,p=i,m=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let v=p(e);function y(){const x=p(e);if(!m(v,x)){const M=v;d(v=x,M)}}return t.add(y),()=>t.delete(y)},u={setState:n,getState:i,subscribe:(d,p,m)=>p||m?s(d,p,m):(t.add(d),()=>t.delete(d)),destroy:()=>t.clear()};return e=r(n,i,u),u}const oD=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Sb=oD?K.useEffect:K.useLayoutEffect;function aD(r){const e=typeof r=="function"?sD(r):r,t=(n=e.getState,i=Object.is)=>{const[,s]=K.useReducer(S=>S+1,0),o=e.getState(),l=K.useRef(o),u=K.useRef(n),d=K.useRef(i),p=K.useRef(!1),m=K.useRef();m.current===void 0&&(m.current=n(o));let v,y=!1;(l.current!==o||u.current!==n||d.current!==i||p.current)&&(v=n(o),y=!i(m.current,v)),Sb(()=>{y&&(m.current=v),l.current=o,u.current=n,d.current=i,p.current=!1});const x=K.useRef(o);Sb(()=>{const S=()=>{try{const A=e.getState(),T=u.current(A);d.current(m.current,T)||(l.current=A,m.current=T,s())}catch{p.current=!0,s()}},w=e.subscribe(S);return e.getState()!==x.current&&S(),w},[]);const M=y?v:m.current;return K.useDebugValue(M),M};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[t,e];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},t}const lD=r=>typeof r=="object"&&typeof r.then=="function",Ag=[];function cD(r,e,t=(n,i)=>n===i){if(r===e)return!0;if(!r||!e)return!1;const n=r.length;if(e.length!==n)return!1;for(let i=0;i<n;i++)if(!t(r[i],e[i]))return!1;return!0}function uD(r,e=null,t=!1,n={}){e===null&&(e=[r]);for(const s of Ag)if(cD(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 n.lifespan&&n.lifespan>0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,n.lifespan)),s.response;if(!t)throw s.promise}const i={keys:e,equal:n.equal,remove:()=>{const s=Ag.indexOf(i);s!==-1&&Ag.splice(s,1)},promise:(lD(r)?r:r(...e)).then(s=>{i.response=s,n.lifespan&&n.lifespan>0&&(i.timeout=setTimeout(i.remove,n.lifespan))}).catch(s=>i.error=s)};if(Ag.push(i),!t)throw i.promise}const dD=(r,e,t)=>uD(r,e,!1,t);var Ny={exports:{}},Oy={exports:{}},By={};/** 3889 * @license React 3890 * scheduler.production.min.js 3891 * 3892 * Copyright (c) Facebook, Inc. and its affiliates. 3893 * 3894 * This source code is licensed under the MIT license found in the 3895 * LICENSE file in the root directory of this source tree. 3896 */var bb;function fD(){return bb||(bb=1,(function(r){function e(V,$){var Z=V.length;V.push($);e:for(;0<Z;){var O=Z-1>>>1,j=V[O];if(0<i(j,$))V[O]=$,V[Z]=j,Z=O;else break e}}function t(V){return V.length===0?null:V[0]}function n(V){if(V.length===0)return null;var $=V[0],Z=V.pop();if(Z!==$){V[0]=Z;e:for(var O=0,j=V.length,re=j>>>1;O<re;){var ne=2*(O+1)-1,ie=V[ne],he=ne+1,le=V[he];if(0>i(ie,Z))he<j&&0>i(le,ie)?(V[O]=le,V[he]=Z,O=he):(V[O]=ie,V[ne]=Z,O=ne);else if(he<j&&0>i(le,Z))V[O]=le,V[he]=Z,O=he;else break e}}return $}function i(V,$){var Z=V.sortIndex-$.sortIndex;return Z!==0?Z:V.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();r.unstable_now=function(){return o.now()-l}}var u=[],d=[],p=1,m=null,v=3,y=!1,x=!1,M=!1,S=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(V){for(var $=t(d);$!==null;){if($.callback===null)n(d);else if($.startTime<=V)n(d),$.sortIndex=$.expirationTime,e(u,$);else break;$=t(d)}}function R(V){if(M=!1,T(V),!x)if(t(u)!==null)x=!0,se(U);else{var $=t(d);$!==null&&fe(R,$.startTime-V)}}function U(V,$){x=!1,M&&(M=!1,w(H),H=-1),y=!0;var Z=v;try{for(T($),m=t(u);m!==null&&(!(m.expirationTime>$)||V&&!G());){var O=m.callback;if(typeof O=="function"){m.callback=null,v=m.priorityLevel;var j=O(m.expirationTime<=$);$=r.unstable_now(),typeof j=="function"?m.callback=j:m===t(u)&&n(u),T($)}else n(u);m=t(u)}if(m!==null)var re=!0;else{var ne=t(d);ne!==null&&fe(R,ne.startTime-$),re=!1}return re}finally{m=null,v=Z,y=!1}}var k=!1,N=null,H=-1,F=5,I=-1;function G(){return!(r.unstable_now()-I<F)}function W(){if(N!==null){var V=r.unstable_now();I=V;var $=!0;try{$=N(!0,V)}finally{$?X():(k=!1,N=null)}}else k=!1}var X;if(typeof A=="function")X=function(){A(W)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,oe=J.port2;J.port1.onmessage=W,X=function(){oe.postMessage(null)}}else X=function(){S(W,0)};function se(V){N=V,k||(k=!0,X())}function fe(V,$){H=S(function(){V(r.unstable_now())},$)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(V){V.callback=null},r.unstable_continueExecution=function(){x||y||(x=!0,se(U))},r.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<V?Math.floor(1e3/V):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_getFirstCallbackNode=function(){return t(u)},r.unstable_next=function(V){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var Z=v;v=$;try{return V()}finally{v=Z}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(V,$){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var Z=v;v=V;try{return $()}finally{v=Z}},r.unstable_scheduleCallback=function(V,$,Z){var O=r.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?O+Z:O):Z=O,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,V={id:p++,callback:$,priorityLevel:V,startTime:Z,expirationTime:j,sortIndex:-1},Z>
vendor: 5,396 bytes, lines 3896-3904
3896O?(V.sortIndex=Z,e(d,V),t(u)===null&&V===t(d)&&(M?(w(H),H=-1):M=!0,fe(R,Z-O))):(V.sortIndex=j,e(u,V),x||y||(x=!0,se(U))),V},r.unstable_shouldYield=G,r.unstable_wrapCallback=function(V){var $=v;return function(){var Z=v;v=$;try{return V.apply(this,arguments)}finally{v=Z}}}})(By)),By}var wb;function E2(){return wb||(wb=1,Oy.exports=fD()),Oy.exports}/** 3897 * @license React 3898 * react-reconciler.production.min.js 3899 * 3900 * Copyright (c) Facebook, Inc. and its affiliates. 3901 * 3902 * This source code is licensed under the MIT license found in the 3903 * LICENSE file in the root directory of this source tree. 3904 */var zy,Mb;function hD(){return Mb||(Mb=1,zy=function(e){var t={},n=A0(),i=E2(),s=Object.assign;function o(f){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+f,_=1;_<arguments.length;_++)h+="&args[]="+encodeURIComponent(arguments[_]);return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),d=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),x=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),U=Symbol.iterator;function k(f){return f===null||typeof f!="object"?null:(f=U&&f[U]||f["@@iterator"],typeof f=="function"?f:null)}function N(f){if(f==null)return null;if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case p:return"Fragment";case d:return"Portal";case v:return"Profiler";case m:return"StrictMode";case S:return"Suspense";case w:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case x:return(f.displayName||"Context")+".Consumer";case y:return(f._context.displayName||"Context")+".Provider";case M:var h=f.render;return f=f.displayName,f||(f=h.displayName||h.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case A:return h=f.displayName||null,h!==null?h:N(f.type)||"Memo";case T:h=f._payload,f=f._init;try{return N(f(h))}catch{}}return null}function H(f){var h=f.type;switch(f.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return f=h.render,f=f.displayName||f.name||"",h.displayName||(f!==""?"ForwardRef("+f+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return N(h);case 8:return h===m?"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 h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function F(f){var h=f,_=f;if(f.alternate)for(;h.return;)h=h.return;else{f=h;do h=f,(h.flags&4098)!==0&&(_=h.return),f=h.return;while(f)}return h.tag===3?_:null}function I(f){if(F(f)!==f)throw Error(o(188))}function G(f){var h=f.alternate;if(!h){if(h=F(f),h===null)throw Error(o(188));return h!==f?null:f}for(var _=f,C=h;;){var L=_.return;if(L===null)break;var z=L.alternate;if(z===null){if(C=L.return,C!==null){_=C;continue}break}if(L.child===z.child){for(z=L.child;z;){if(z===_)return I(L),f;if(z===C)return I(L),h;z=z.sibling}throw Error(o(188))}if(_.return!==C.return)_=L,C=z;else{for(var ae=!1,be=L.child;be;){if(be===_){ae=!0,_=L,C=z;break}if(be===C){ae=!0,C=L,_=z;break}be=be.sibling}if(!ae){for(be=z.child;be;){if(be===_){ae=!0,_=z,C=L;break}if(be===C){ae=!0,C=z,_=L;break}be=be.sibling}if(!ae)throw Error(o(189))}}if(_.alternate!==C)throw Error(o(190))}if(_.tag!==3)throw Error(o(188));return _.stateNode.current===_?f:h}function W(f){return f=G(f),f!==null?X(f):null}function X(f){if(f.tag===5||f.tag===6)return f;for(f=f.child;f!==null;){var h=X(f);if(h!==null)return h;f=f.sibling}return null}function J(f){if(f.tag===5||f.tag===6)return f;for(f=f.child;f!==null;){if(f.tag!==4){var h=J(f);if(h!==null)return h}f=f.sibling}return null}var oe=Array.isArray,se=e.getPublicInstance,fe=e.getRootHostContext,V=e.getChildHostContext,$=e.prepareForCommit,Z=e.resetAfterCommit,O=e.createInstance,j=e.appendInitialChild,re=e.finalizeInitialChildren,ne=e.prepareUpdate,ie=e.shouldSetTextContent,he=e.createTextInstance,le=e.scheduleTimeout,ye=e.cancelTimeout,ze=e.noTimeout,Xe=e.isPrimaryRenderer,Ie=e.supportsMutation,Y=e.supportsPersistence,Ce=e.supportsHydration,Le=e.getInstanceFromNode,Ge=e.preparePortalMount,Ae=e.getCurrentEventPriority,$e=e.detachDeletedInstance,Re=e.supportsMicrotasks,He=e.scheduleMicrotask,Q=e.supportsTestSelectors,B=e.findFiberRoot,pe=e.getBoundingRect,ge=e.getTextContent,ve=e.isHiddenSubtree,we=e.matchAccessibilityRole,ut=e.setFocusIfFocusable,Oe=e.setupIntersectionObserver,Qe=e.appendChild,at=e.appendChildToContainer,Ke=e.commitTextUpdate,tt=e.commitMount,wt=e.commitUpdate,nt=e.insertBefore,et=e.insertInContainerBefore,it=e.removeChild,ue=e.removeChildFromContainer,qe=e.resetTextContent,ce=e.hideInstance,Fe=e.hideTextInstance,xe=e.unhideInstance,De=e.unhideTextInstance,rt
vendor: 5,315 bytes, lines 3904-3908
3904=e.clearContainer,mt=e.cloneInstance,vt=e.createContainerChildSet,kt=e.appendChildToContainerChildSet,Ft=e.finalizeContainerChildren,pt=e.replaceContainerChildren,Kt=e.cloneHiddenInstance,dn=e.cloneHiddenTextInstance,Sn=e.canHydrateInstance,bn=e.canHydrateTextInstance,ii=e.canHydrateSuspenseInstance,vr=e.isSuspenseInstancePending,fi=e.isSuspenseInstanceFallback,Ai=e.registerSuspenseInstanceRetry,_i=e.getNextHydratableSibling,Si=e.getFirstHydratableChild,hi=e.getFirstHydratableChildWithinContainer,Pr=e.getFirstHydratableChildWithinSuspenseInstance,xo=e.hydrateInstance,Vn=e.hydrateTextInstance,Hs=e.hydrateSuspenseInstance,ee=e.getNextHydratableInstanceAfterSuspenseInstance,Se=e.commitHydratedContainer,Ue=e.commitHydratedSuspenseInstance,ke=e.clearSuspenseBoundary,Te=e.clearSuspenseBoundaryFromContainer,lt=e.shouldDeleteUnhydratedTailInstances,yt=e.didNotMatchHydratedContainerTextInstance,Tt=e.didNotMatchHydratedTextInstance,je;function Lt(f){if(je===void 0)try{throw Error()}catch(_){var h=_.stack.trim().match(/\n( *(at )?)/);je=h&&h[1]||""}return` 3905`+je+f}var Ot=!1;function xt(f,h){if(!f||Ot)return"";Ot=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(dt){var C=dt}Reflect.construct(f,[],h)}else{try{h.call()}catch(dt){C=dt}f.call(h.prototype)}else{try{throw Error()}catch(dt){C=dt}f()}}catch(dt){if(dt&&C&&typeof dt.stack=="string"){for(var L=dt.stack.split(` 3906`),z=C.stack.split(` 3907`),ae=L.length-1,be=z.length-1;1<=ae&&0<=be&&L[ae]!==z[be];)be--;for(;1<=ae&&0<=be;ae--,be--)if(L[ae]!==z[be]){if(ae!==1||be!==1)do if(ae--,be--,0>be||L[ae]!==z[be]){var Je=` 3908`+L[ae].replace(" at new "," at ");return f.displayName&&Je.includes("<anonymous>")&&(Je=Je.replace("<anonymous>",f.displayName)),Je}while(1<=ae&&0<=be);break}}}finally{Ot=!1,Error.prepareStackTrace=_}return(f=f?f.displayName||f.name:"")?Lt(f):""}var Zt=Object.prototype.hasOwnProperty,wn=[],pn=-1;function En(f){return{current:f}}function Mt(f){0>pn||(f.current=wn[pn],wn[pn]=null,pn--)}function ft(f,h){pn++,wn[pn]=f.current,f.current=h}var Qt={},zt=En(Qt),xn=En(!1),ri=Qt;function Tn(f,h){var _=f.type.contextTypes;if(!_)return Qt;var C=f.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===h)return C.__reactInternalMemoizedMaskedChildContext;var L={},z;for(z in _)L[z]=h[z];return C&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=h,f.__reactInternalMemoizedMaskedChildContext=L),L}function Hn(f){return f=f.childContextTypes,f!=null}function an(){Mt(xn),Mt(zt)}function Ci(f,h,_){if(zt.current!==Qt)throw Error(o(168));ft(zt,h),ft(xn,_)}function fs(f,h,_){var C=f.stateNode;if(h=h.childContextTypes,typeof C.getChildContext!="function")return _;C=C.getChildContext();for(var L in C)if(!(L in h))throw Error(o(108,H(f)||"Unknown",L));return s({},_,C)}function Jn(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||Qt,ri=zt.current,ft(zt,f),ft(xn,xn.current),!0}function pi(f,h,_){var C=f.stateNode;if(!C)throw Error(o(169));_?(f=fs(f,h,ri),C.__reactInternalMemoizedMergedChildContext=f,Mt(xn),Mt(zt),ft(zt,f)):Mt(xn),ft(xn,_)}var Ni=Math.clz32?Math.clz32:Ua,Yr=Math.log,qr=Math.LN2;function Ua(f){return f>>>=0,f===0?32:31-(Yr(f)/qr|0)|0}var Ee=64,Ze=4194304;function Ht(f){switch(f&-f){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 f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function Jt(f,h){var _=f.pendingLanes;if(_===0)return 0;var C=0,L=f.suspendedLanes,z=f.pingedLanes,ae=_&268435455;if(ae!==0){var be=ae&~L;be!==0?C=Ht(be):(z&=ae,z!==0&&(C=Ht(z)))}else ae=_&~L,ae!==0?C=Ht(ae):z!==0&&(C=Ht(z));if(C===0)return 0;if(h!==0&&h!==C&&(h&L)===0&&(L=C&-C,z=h&-h,L>=z||L===16&&(z&4194240)!==0))return h;if((C&4)!==0&&(C|=_&16),h=f.entangledLanes,h!==0)for(f=f.entanglements,h&=C;0<h;)_=31-Ni(h),L=1<<_,C|=f[_],h&=~L;return C}function yr(f,h){switch(f){case 1:case 2:case 4:return h+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 h+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 Qn(f,h){for(var _=f.suspendedLanes,C=f.pingedLanes,L=f.expirationTimes,z=f.pendingLanes;0<z;){var ae=31-Ni(z),be=1<<ae,Je=L[ae];Je===-1?((be&_)===0||(be&C)!==0)&&(L[ae]=yr(be,h)):Je<=h&&(f.expiredLanes|=be),z&=~be}}function hs(f){return f=f.pendingLanes&-1073741825,f!==0?f:f&1073741824?1073741824:0}function so(f){for(var h=[],_=0;31>_;_++)h.push(f);return h}function Ir(f,h,_){f.pendingLanes|=h,h!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,h=31-Ni(h),f[h]=_}
vendor: 36,886 bytes, lines 3908-3910
3908function Kr(f,h){var _=f.pendingLanes&~h;f.pendingLanes=h,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=h,f.mutableReadLanes&=h,f.entangledLanes&=h,h=f.entanglements;var C=f.eventTimes;for(f=f.expirationTimes;0<_;){var L=31-Ni(_),z=1<<L;h[L]=0,C[L]=-1,f[L]=-1,_&=~z}}function Ri(f,h){var _=f.entangledLanes|=h;for(f=f.entanglements;_;){var C=31-Ni(_),L=1<<C;L&h|f[C]&h&&(f[C]|=h),_&=~L}}var Yt=0;function An(f){return f&=-f,1<f?4<f?(f&268435455)!==0?16:536870912:4:1}var Ln=i.unstable_scheduleCallback,gn=i.unstable_cancelCallback,jn=i.unstable_shouldYield,_o=i.unstable_requestPaint,Wn=i.unstable_now,Gs=i.unstable_ImmediatePriority,Hu=i.unstable_UserBlockingPriority,xr=i.unstable_NormalPriority,aa=i.unstable_IdlePriority,la=null,ps=null;function So(f){if(ps&&typeof ps.onCommitFiberRoot=="function")try{ps.onCommitFiberRoot(la,f,void 0,(f.current.flags&128)===128)}catch{}}function ca(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var ji=typeof Object.is=="function"?Object.is:ca,Wi=null,oo=!1,Cs=!1;function ka(f){Wi===null?Wi=[f]:Wi.push(f)}function ua(f){oo=!0,ka(f)}function _r(){if(!Cs&&Wi!==null){Cs=!0;var f=0,h=Yt;try{var _=Wi;for(Yt=1;f<_.length;f++){var C=_[f];do C=C(!0);while(C!==null)}Wi=null,oo=!1}catch(L){throw Wi!==null&&(Wi=Wi.slice(f+1)),Ln(Gs,_r),L}finally{Yt=h,Cs=!1}}return null}var da=l.ReactCurrentBatchConfig;function Zr(f,h){if(ji(f,h))return!0;if(typeof f!="object"||f===null||typeof h!="object"||h===null)return!1;var _=Object.keys(f),C=Object.keys(h);if(_.length!==C.length)return!1;for(C=0;C<_.length;C++){var L=_[C];if(!Zt.call(h,L)||!ji(f[L],h[L]))return!1}return!0}function bo(f){switch(f.tag){case 5:return Lt(f.type);case 16:return Lt("Lazy");case 13:return Lt("Suspense");case 19:return Lt("SuspenseList");case 0:case 2:case 15:return f=xt(f.type,!1),f;case 11:return f=xt(f.type.render,!1),f;case 1:return f=xt(f.type,!0),f;default:return""}}function Xi(f,h){if(f&&f.defaultProps){h=s({},h),f=f.defaultProps;for(var _ in f)h[_]===void 0&&(h[_]=f[_]);return h}return h}var Oi=En(null),wo=null,Jr=null,Mo=null;function Yi(){Mo=Jr=wo=null}function Eo(f,h,_){Xe?(ft(Oi,h._currentValue),h._currentValue=_):(ft(Oi,h._currentValue2),h._currentValue2=_)}function Pi(f){var h=Oi.current;Mt(Oi),Xe?f._currentValue=h:f._currentValue2=h}function Bi(f,h,_){for(;f!==null;){var C=f.alternate;if((f.childLanes&h)!==h?(f.childLanes|=h,C!==null&&(C.childLanes|=h)):C!==null&&(C.childLanes&h)!==h&&(C.childLanes|=h),f===_)break;f=f.return}}function bi(f,h){wo=f,Mo=Jr=null,f=f.dependencies,f!==null&&f.firstContext!==null&&((f.lanes&h)!==0&&(Ji=!0),f.firstContext=null)}function si(f){var h=Xe?f._currentValue:f._currentValue2;if(Mo!==f)if(f={context:f,memoizedValue:h,next:null},Jr===null){if(wo===null)throw Error(o(308));Jr=f,wo.dependencies={lanes:0,firstContext:f}}else Jr=Jr.next=f;return h}var Lr=null,Rs=!1;function wl(f){f.updateQueue={baseState:f.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ef(f,h){f=f.updateQueue,h.updateQueue===f&&(h.updateQueue={baseState:f.baseState,firstBaseUpdate:f.firstBaseUpdate,lastBaseUpdate:f.lastBaseUpdate,shared:f.shared,effects:f.effects})}function To(f,h){return{eventTime:f,lane:h,tag:0,payload:null,callback:null,next:null}}function fa(f,h){var _=f.updateQueue;_!==null&&(_=_.shared,Mi!==null&&(f.mode&1)!==0&&(sn&2)===0?(f=_.interleaved,f===null?(h.next=h,Lr===null?Lr=[_]:Lr.push(_)):(h.next=f.next,f.next=h),_.interleaved=h):(f=_.pending,f===null?h.next=h:(h.next=f.next,f.next=h),_.pending=h))}function Gu(f,h,_){if(h=h.updateQueue,h!==null&&(h=h.shared,(_&4194240)!==0)){var C=h.lanes;C&=f.pendingLanes,_|=C,h.lanes=_,Ri(f,_)}}function Vu(f,h){var _=f.updateQueue,C=f.alternate;if(C!==null&&(C=C.updateQueue,_===C)){var L=null,z=null;if(_=_.firstBaseUpdate,_!==null){do{var ae={eventTime:_.eventTime,lane:_.lane,tag:_.tag,payload:_.payload,callback:_.callback,next:null};z===null?L=z=ae:z=z.next=ae,_=_.next}while(_!==null);z===null?L=z=h:z=z.next=h}else L=z=h;_={baseState:C.baseState,firstBaseUpdate:L,lastBaseUpdate:z,shared:C.shared,effects:C.effects},f.updateQueue=_;return}f=_.lastBaseUpdate,f===null?_.firstBaseUpdate=h:f.next=h,_.lastBaseUpdate=h}function ju(f,h,_,C){var L=f.updateQueue;Rs=!1;var z=L.firstBaseUpdate,ae=L.lastBaseUpdate,be=L.shared.pending;if(be!==null){L.shared.pending=null;var Je=be,dt=Je.next;Je.next=null,ae===null?z=dt:ae.next=dt,ae=Je;var Ct=f.alternate;Ct!==null&&(Ct=Ct.updateQueue,be=Ct.lastBaseUpdate,be!==ae&&(be===null?Ct.firstBaseUpdate=dt:be.next=dt,Ct.lastBaseUpdate=Je))}if(z!==null){var en=L.baseState;ae=0,Ct=dt=Je=null,be=z;do{var Gt=be.lane,ln=be.eventTime;if((C&Gt)===Gt){Ct!==null&&(Ct=Ct.next={eventTime:ln,lane:0,tag:be.tag,payload:be.payload,callback:be.callback,next:null});e:{var Et=f,cr=be;switch(Gt=h,ln=_,cr.tag){case 1:if(Et=cr.payload,typeof Et=="function"){en=Et.call(ln,en,Gt);break e}en=Et;break e;case 3:Et.flags=Et.flags&-65537|128;case 0:if(Et=cr.payload,Gt=typeof Et=="function"?Et.call(ln,en,Gt):Et,Gt==null)break e;en=s({},en,Gt);break e;case 2:Rs=!0}}be.callback!==null&&be.lane!==0&&(f.flags|=64,Gt=L.effects,Gt===null?L.effects=[be]:Gt.push(be))}else ln={eventTime:ln,lane:Gt,tag:be.tag,payload:be.payload,callback:be.callback,next:null},Ct===null?(dt=Ct=ln,Je=en):Ct=Ct.next=ln,ae|=Gt;if(be=be.next,be===null){if(be=L.shared.pending,be===null)break;Gt=be,be=Gt.next,Gt.next=null,L.lastBaseUpdate=Gt,L.shared.pending=null}}while(!0);if(Ct===null&&(Je=en),L.baseState=Je,L.firstBaseUpdate=dt,L.lastBaseUpdate=Ct,h=L.shared.interleaved,h!==null){L=h;do ae|=L.lane,L=L.next;while(L!==h)}else z===null&&(L.shared.lanes=0);uo|=ae,f.lanes=ae,f.memoizedState=en}}function jp(f,h,_){if(f=h.effects,h.effects=null,f!==null)for(h=0;h<f.length;h++){var C=f[h],L=C.callback;if(L!==null){if(C.callback=null,C=_,typeof L!="function")throw Error(o(191,L));L.call(C)}}}var Wp=new n.Component().refs;function Tf(f,h,_,C){h=f.memoizedState,_=_(C,h),_=_==null?h:s({},h,_),f.memoizedState=_,f.lanes===0&&(f.updateQueue.baseState=_)}var Wu={isMounted:function(f){return(f=f._reactInternals)?F(f)===f:!1},enqueueSetState:function(f,h,_){f=f._reactInternals;var C=Cn(),L=Ks(f),z=To(C,L);z.payload=h,_!=null&&(z.callback=_),fa(f,z),h=wr(f,L,C),h!==null&&Gu(h,f,L)},enqueueReplaceState:function(f,h,_){f=f._reactInternals;var C=Cn(),L=Ks(f),z=To(C,L);z.tag=1,z.payload=h,_!=null&&(z.callback=_),fa(f,z),h=wr(f,L,C),h!==null&&Gu(h,f,L)},enqueueForceUpdate:function(f,h){f=f._reactInternals;var _=Cn(),C=Ks(f),L=To(_,C);L.tag=2,h!=null&&(L.callback=h),fa(f,L),h=wr(f,C,_),h!==null&&Gu(h,f,C)}};function Af(f,h,_,C,L,z,ae){return f=f.stateNode,typeof f.shouldComponentUpdate=="function"?f.shouldComponentUpdate(C,z,ae):h.prototype&&h.prototype.isPureReactComponent?!Zr(_,C)||!Zr(L,z):!0}function Xp(f,h,_){var C=!1,L=Qt,z=h.contextType;return typeof z=="object"&&z!==null?z=si(z):(L=Hn(h)?ri:zt.current,C=h.contextTypes,z=(C=C!=null)?Tn(f,L):Qt),h=new h(_,z),f.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Wu,f.stateNode=h,h._reactInternals=f,C&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=L,f.__reactInternalMemoizedMaskedChildContext=z),h}function Yp(f,h,_,C){f=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(_,C),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(_,C),h.state!==f&&Wu.enqueueReplaceState(h,h.state,null)}function Cf(f,h,_,C){var L=f.stateNode;L.props=_,L.state=f.memoizedState,L.refs=Wp,wl(f);var z=h.contextType;typeof z=="object"&&z!==null?L.context=si(z):(z=Hn(h)?ri:zt.current,L.context=Tn(f,z)),L.state=f.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(Tf(f,h,z,_),L.state=f.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof L.getSnapshotBeforeUpdate=="function"||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(h=L.state,typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount(),h!==L.state&&Wu.enqueueReplaceState(L,L.state,null),ju(f,_,L,C),L.state=f.memoizedState),typeof L.componentDidMount=="function"&&(f.flags|=4194308)}var Ml=[],ha=0,Xu=null,Yu=0,Ps=[],ms=0,Fa=null,Ao=1,Co="";function Na(f,h){Ml[ha++]=Yu,Ml[ha++]=Xu,Xu=f,Yu=h}function qp(f,h,_){Ps[ms++]=Ao,Ps[ms++]=Co,Ps[ms++]=Fa,Fa=f;var C=Ao;f=Co;var L=32-Ni(C)-1;C&=~(1<<L),_+=1;var z=32-Ni(h)+L;if(30<z){var ae=L-L%5;z=(C&(1<<ae)-1).toString(32),C>>=ae,L-=ae,Ao=1<<32-Ni(h)+L|_<<L|C,Co=z+f}else Ao=1<<z|_<<L|C,Co=f}function Rf(f){f.return!==null&&(Na(f,1),qp(f,1,0))}function Pf(f){for(;f===Xu;)Xu=Ml[--ha],Ml[ha]=null,Yu=Ml[--ha],Ml[ha]=null;for(;f===Fa;)Fa=Ps[--ms],Ps[ms]=null,Co=Ps[--ms],Ps[ms]=null,Ao=Ps[--ms],Ps[ms]=null}var Dr=null,rr=null,$n=!1,El=!1,Is=null;function If(f,h){var _=bs(5,null,null,0);_.elementType="DELETED",_.stateNode=h,_.return=f,h=f.deletions,h===null?(f.deletions=[_],f.flags|=16):h.push(_)}function Lf(f,h){switch(f.tag){case 5:return h=Sn(h,f.type,f.pendingProps),h!==null?(f.stateNode=h,Dr=f,rr=Si(h),!0):!1;case 6:return h=bn(h,f.pendingProps),h!==null?(f.stateNode=h,Dr=f,rr=null,!0):!1;case 13:if(h=ii(h),h!==null){var _=Fa!==null?{id:Ao,overflow:Co}:null;return f.memoizedState={dehydrated:h,treeContext:_,retryLane:1073741824},_=bs(18,null,null,0),_.stateNode=h,_.return=f,f.child=_,Dr=f,rr=null,!0}return!1;default:return!1}}function qu(f){return(f.mode&1)!==0&&(f.flags&128)===0}function pa(f){if($n){var h=rr;if(h){var _=h;if(!Lf(f,h)){if(qu(f))throw Error(o(418));h=_i(_);var C=Dr;h&&Lf(f,h)?If(C,_):(f.flags=f.flags&-4097|2,$n=!1,Dr=f)}}else{if(qu(f))throw Error(o(418));f.flags=f.flags&-4097|2,$n=!1,Dr=f}}}function Kp(f){for(f=f.return;f!==null&&f.tag!==5&&f.tag!==3&&f.tag!==13;)f=f.return;Dr=f}function Sc(f){if(!Ce||f!==Dr)return!1;if(!$n)return Kp(f),$n=!0,!1;if(f.tag!==3&&(f.tag!==5||lt(f.type)&&!ie(f.type,f.memoizedProps))){var h=rr;if(h){if(qu(f)){for(f=rr;f;)f=_i(f);throw Error(o(418))}for(;h;)If(f,h),h=_i(h)}}if(Kp(f),f.tag===13){if(!Ce)throw Error(o(316));if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));rr=ee(f)}else rr=Dr?_i(f.stateNode):null;return!0}function Tl(){Ce&&(rr=Dr=null,El=$n=!1)}function Ku(f){Is===null?Is=[f]:Is.push(f)}function Al(f,h,_){if(f=_.ref,f!==null&&typeof f!="function"&&typeof f!="object"){if(_._owner){if(_=_._owner,_){if(_.tag!==1)throw Error(o(309));var C=_.stateNode}if(!C)throw Error(o(147,f));var L=C,z=""+f;return h!==null&&h.ref!==null&&typeof h.ref=="function"&&h.ref._stringRef===z?h.ref:(h=function(ae){var be=L.refs;be===Wp&&(be=L.refs={}),ae===null?delete be[z]:be[z]=ae},h._stringRef=z,h)}if(typeof f!="string")throw Error(o(284));if(!_._owner)throw Error(o(290,f))}return f}function ma(f,h){throw f=Object.prototype.toString.call(h),Error(o(31,f==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":f))}function Cl(f){var h=f._init;return h(f._payload)}function Zp(f){function h(Be,Me){if(f){var Ye=Be.deletions;Ye===null?(Be.deletions=[Me],Be.flags|=16):Ye.push(Me)}}function _(Be,Me){if(!f)return null;for(;Me!==null;)h(Be,Me),Me=Me.sibling;return null}function C(Be,Me){for(Be=new Map;Me!==null;)Me.key!==null?Be.set(Me.key,Me):Be.set(Me.index,Me),Me=Me.sibling;return Be}function L(Be,Me){return Be=Go(Be,Me),Be.index=0,Be.sibling=null,Be}function z(Be,Me,Ye){return Be.index=Ye,f?(Ye=Be.alternate,Ye!==null?(Ye=Ye.index,Ye<Me?(Be.flags|=2,Me):Ye):(Be.flags|=2,Me)):(Be.flags|=1048576,Me)}function ae(Be){return f&&Be.alternate===null&&(Be.flags|=2),Be}function be(Be,Me,Ye,bt){return Me===null||Me.tag!==6?(Me=bd(Ye,Be.mode,bt),Me.return=Be,Me):(Me=L(Me,Ye),Me.return=Be,Me)}function Je(Be,Me,Ye,bt){var Ut=Ye.type;return Ut===p?Ct(Be,Me,Ye.props.children,bt,Ye.key):Me!==null&&(Me.elementType===Ut||typeof Ut=="object"&&Ut!==null&&Ut.$$typeof===T&&Cl(Ut)===Me.type)?(bt=L(Me,Ye.props),bt.ref=Al(Be,Me,Ye),bt.return=Be,bt):(bt=Sd(Ye.type,Ye.key,Ye.props,null,Be.mode,bt),bt.ref=Al(Be,Me,Ye),bt.return=Be,bt)}function dt(Be,Me,Ye,bt){return Me===null||Me.tag!==4||Me.stateNode.containerInfo!==Ye.containerInfo||Me.stateNode.implementation!==Ye.implementation?(Me=wd(Ye,Be.mode,bt),Me.return=Be,Me):(Me=L(Me,Ye.children||[]),Me.return=Be,Me)}function Ct(Be,Me,Ye,bt,Ut){return Me===null||Me.tag!==7?(Me=sl(Ye,Be.mode,bt,Ut),Me.return=Be,Me):(Me=L(Me,Ye),Me.return=Be,Me)}function en(Be,Me,Ye){if(typeof Me=="string"&&Me!==""||typeof Me=="number")return Me=bd(""+Me,Be.mode,Ye),Me.return=Be,Me;if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case u:return Ye=Sd(Me.type,Me.key,Me.props,null,Be.mode,Ye),Ye.ref=Al(Be,null,Me),Ye.return=Be,Ye;case d:return Me=wd(Me,Be.mode,Ye),Me.return=Be,Me;case T:var bt=Me._init;return en(Be,bt(Me._payload),Ye)}if(oe(Me)||k(Me))return Me=sl(Me,Be.mode,Ye,null),Me.return=Be,Me;ma(Be,Me)}return null}function Gt(Be,Me,Ye,bt){var Ut=Me!==null?Me.key:null;if(typeof Ye=="string"&&Ye!==""||typeof Ye=="number")return Ut!==null?null:be(Be,Me,""+Ye,bt);if(typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case u:return Ye.key===Ut?Je(Be,Me,Ye,bt):null;case d:return Ye.key===Ut?dt(Be,Me,Ye,bt):null;case T:return Ut=Ye._init,Gt(Be,Me,Ut(Ye._payload),bt)}if(oe(Ye)||k(Ye))return Ut!==null?null:Ct(Be,Me,Ye,bt,null);ma(Be,Ye)}return null}function ln(Be,Me,Ye,bt,Ut){if(typeof bt=="string"&&bt!==""||typeof bt=="number")return Be=Be.get(Ye)||null,be(Me,Be,""+bt,Ut);if(typeof bt=="object"&&bt!==null){switch(bt.$$typeof){case u:return Be=Be.get(bt.key===null?Ye:bt.key)||null,Je(Me,Be,bt,Ut);case d:return Be=Be.get(bt.key===null?Ye:bt.key)||null,dt(Me,Be,bt,Ut);case T:var nn=bt._init;return ln(Be,Me,Ye,nn(bt._payload),Ut)}if(oe(bt)||k(bt))return Be=Be.get(Ye)||null,Ct(Me,Be,bt,Ut,null);ma(Me,bt)}return null}function Et(Be,Me,Ye,bt){for(var Ut=null,nn=null,tn=Me,Mn=Me=0,Li=null;tn!==null&&Mn<Ye.length;Mn++){tn.index>Mn?(Li=tn,tn=null):Li=tn.sibling;var _n=Gt(Be,tn,Ye[Mn],bt);if(_n===null){tn===null&&(tn=Li);break}f&&tn&&_n.alternate===null&&h(Be,tn),Me=z(_n,Me,Mn),nn===null?Ut=_n:nn.sibling=_n,nn=_n,tn=Li}if(Mn===Ye.length)return _(Be,tn),$n&&Na(Be,Mn),Ut;if(tn===null){for(;Mn<Ye.length;Mn++)tn=en(Be,Ye[Mn],bt),tn!==null&&(Me=z(tn,Me,Mn),nn===null?Ut=tn:nn.sibling=tn,nn=tn);return $n&&Na(Be,Mn),Ut}for(tn=C(Be,tn);Mn<Ye.length;Mn++)Li=ln(tn,Be,Mn,Ye[Mn],bt),Li!==null&&(f&&Li.alternate!==null&&tn.delete(Li.key===null?Mn:Li.key),Me=z(Li,Me,Mn),nn===null?Ut=Li:nn.sibling=Li,nn=Li);return f&&tn.forEach(function(Vo){return h(Be,Vo)}),$n&&Na(Be,Mn),Ut}function cr(Be,Me,Ye,bt){var Ut=k(Ye);if(typeof Ut!="function")throw Error(o(150));if(Ye=Ut.call(Ye),Ye==null)throw Error(o(151));for(var nn=Ut=null,tn=Me,Mn=Me=0,Li=null,_n=Ye.next();tn!==null&&!_n.done;Mn++,_n=Ye.next()){tn.index>Mn?(Li=tn,tn=null):Li=tn.sibling;var Vo=Gt(Be,tn,_n.value,bt);if(Vo===null){tn===null&&(tn=Li);break}f&&tn&&Vo.alternate===null&&h(Be,tn),Me=z(Vo,Me,Mn),nn===null?Ut=Vo:nn.sibling=Vo,nn=Vo,tn=Li}if(_n.done)return _(Be,tn),$n&&Na(Be,Mn),Ut;if(tn===null){for(;!_n.done;Mn++,_n=Ye.next())_n=en(Be,_n.value,bt),_n!==null&&(Me=z(_n,Me,Mn),nn===null?Ut=_n:nn.sibling=_n,nn=_n);return $n&&Na(Be,Mn),Ut}for(tn=C(Be,tn);!_n.done;Mn++,_n=Ye.next())_n=ln(tn,Be,Mn,_n.value,bt),_n!==null&&(f&&_n.alternate!==null&&tn.delete(_n.key===null?Mn:_n.key),Me=z(_n,Me,Mn),nn===null?Ut=_n:nn.sibling=_n,nn=_n);return f&&tn.forEach(function(ch){return h(Be,ch)}),$n&&Na(Be,Mn),Ut}function ws(Be,Me,Ye,bt){if(typeof Ye=="object"&&Ye!==null&&Ye.type===p&&Ye.key===null&&(Ye=Ye.props.children),typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case u:e:{for(var Ut=Ye.key,nn=Me;nn!==null;){if(nn.key===Ut){if(Ut=Ye.type,Ut===p){if(nn.tag===7){_(Be,nn.sibling),Me=L(nn,Ye.props.children),Me.return=Be,Be=Me;break e}}else if(nn.elementType===Ut||typeof Ut=="object"&&Ut!==null&&Ut.$$typeof===T&&Cl(Ut)===nn.type){_(Be,nn.sibling),Me=L(nn,Ye.props),Me.ref=Al(Be,nn,Ye),Me.return=Be,Be=Me;break e}_(Be,nn);break}else h(Be,nn);nn=nn.sibling}Ye.type===p?(Me=sl(Ye.props.children,Be.mode,bt,Ye.key),Me.return=Be,Be=Me):(bt=Sd(Ye.type,Ye.key,Ye.props,null,Be.mode,bt),bt.ref=Al(Be,Me,Ye),bt.return=Be,Be=bt)}return ae(Be);case d:e:{for(nn=Ye.key;Me!==null;){if(Me.key===nn)if(Me.tag===4&&Me.stateNode.containerInfo===Ye.containerInfo&&Me.stateNode.implementation===Ye.implementation){_(Be,Me.sibling),Me=L(Me,Ye.children||[]),Me.return=Be,Be=Me;break e}else{_(Be,Me);break}else h(Be,Me);Me=Me.sibling}Me=wd(Ye,Be.mode,bt),Me.return=Be,Be=Me}return ae(Be);case T:return nn=Ye._init,ws(Be,Me,nn(Ye._payload),bt)}if(oe(Ye))return Et(Be,Me,Ye,bt);if(k(Ye))return cr(Be,Me,Ye,bt);ma(Be,Ye)}return typeof Ye=="string"&&Ye!==""||typeof Ye=="number"?(Ye=""+Ye,Me!==null&&Me.tag===6?(_(Be,Me.sibling),Me=L(Me,Ye),Me.return=Be,Be=Me):(_(Be,Me),Me=bd(Ye,Be.mode,bt),Me.return=Be,Be=Me),ae(Be)):_(Be,Me)}return ws}var Ro=Zp(!0),Jp=Zp(!1),Rl={},Qr=En(Rl),Oa=En(Rl),Ba=En(Rl);function Vs(f){if(f===Rl)throw Error(o(174));return f}function Zu(f,h){ft(Ba,h),ft(Oa,f),ft(Qr,Rl),f=fe(h),Mt(Qr),ft(Qr,f)}function Pl(){Mt(Qr),Mt(Oa),Mt(Ba)}function Qp(f){var h=Vs(Ba.current),_=Vs(Qr.current);h=V(_,f.type,h),_!==h&&(ft(Oa,f),ft(Qr,h))}function Df(f){Oa.current===f&&(Mt(Qr),Mt(Oa))}var oi=En(0);function Ju(f){for(var h=f;h!==null;){if(h.tag===13){var _=h.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||vr(_)||fi(_)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===f)break;for(;h.sibling===null;){if(h.return===null||h.return===f)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var gs=[];function za(){for(var f=0;f<gs.length;f++){var h=gs[f];Xe?h._workInProgressVersionPrimary=null:h._workInProgressVersionSecondary=null}gs.length=0}var bc=l.ReactCurrentDispatcher,vs=l.ReactCurrentBatchConfig,Ha=0,ai=null,qi=null,Ki=null,Qu=!1,ao=!1,Ga=0,wc=0;function Zi(){throw Error(o(321))}function $u(f,h){if(h===null)return!1;for(var _=0;_<h.length&&_<f.length;_++)if(!ji(f[_],h[_]))return!1;return!0}function Il(f,h,_,C,L,z){if(Ha=z,ai=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,bc.current=f===null||f.memoizedState===null?Bf:zf,f=_(C,L),ao){z=0;do{if(ao=!1,Ga=0,25<=z)throw Error(o(301));z+=1,Ki=qi=null,h.updateQueue=null,bc.current=Hf,f=_(C,L)}while(ao)}if(bc.current=kl,h=qi!==null&&qi.next!==null,Ha=0,Ki=qi=ai=null,Qu=!1,h)throw Error(o(300));return f}function ga(){var f=Ga!==0;return Ga=0,f}function js(){var f={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ki===null?ai.memoizedState=Ki=f:Ki=Ki.next=f,Ki}function Ws(){if(qi===null){var f=ai.alternate;f=f!==null?f.memoizedState:null}else f=qi.next;var h=Ki===null?ai.memoizedState:Ki.next;if(h!==null)Ki=h,qi=f;else{if(f===null)throw Error(o(310));qi=f,f={memoizedState:qi.memoizedState,baseState:qi.baseState,baseQueue:qi.baseQueue,queue:qi.queue,next:null},Ki===null?ai.memoizedState=Ki=f:Ki=Ki.next=f}return Ki}function lo(f,h){return typeof h=="function"?h(f):h}function Mc(f){var h=Ws(),_=h.queue;if(_===null)throw Error(o(311));_.lastRenderedReducer=f;var C=qi,L=C.baseQueue,z=_.pending;if(z!==null){if(L!==null){var ae=L.next;L.next=z.next,z.next=ae}C.baseQueue=L=z,_.pending=null}if(L!==null){z=L.next,C=C.baseState;var be=ae=null,Je=null,dt=z;do{var Ct=dt.lane;if((Ha&Ct)===Ct)Je!==null&&(Je=Je.next={lane:0,action:dt.action,hasEagerState:dt.hasEagerState,eagerState:dt.eagerState,next:null}),C=dt.hasEagerState?dt.eagerState:f(C,dt.action);else{var en={lane:Ct,action:dt.action,hasEagerState:dt.hasEagerState,eagerState:dt.eagerState,next:null};Je===null?(be=Je=en,ae=C):Je=Je.next=en,ai.lanes|=Ct,uo|=Ct}dt=dt.next}while(dt!==null&&dt!==z);Je===null?ae=C:Je.next=be,ji(C,h.memoizedState)||(Ji=!0),h.memoizedState=C,h.baseState=ae,h.baseQueue=Je,_.lastRenderedState=C}if(f=_.interleaved,f!==null){L=f;do z=L.lane,ai.lanes|=z,uo|=z,L=L.next;while(L!==f)}else L===null&&(_.lanes=0);return[h.memoizedState,_.dispatch]}function Ec(f){var h=Ws(),_=h.queue;if(_===null)throw Error(o(311));_.lastRenderedReducer=f;var C=_.dispatch,L=_.pending,z=h.memoizedState;if(L!==null){_.pending=null;var ae=L=L.next;do z=f(z,ae.action),ae=ae.next;while(ae!==L);ji(z,h.memoizedState)||(Ji=!0),h.memoizedState=z,h.baseQueue===null&&(h.baseState=z),_.lastRenderedState=z}return[z,C]}function Uf(){}function kf(f,h){var _=ai,C=Ws(),L=h(),z=!ji(C.memoizedState,L);if(z&&(C.memoizedState=L,Ji=!0),C=C.queue,Ll(Po.bind(null,_,C,f),[f]),C.getSnapshot!==h||z||Ki!==null&&Ki.memoizedState.tag&1){if(_.flags|=2048,Ac(9,Nf.bind(null,_,C,L,h),void 0,null),Mi===null)throw Error(o(349));(Ha&30)!==0||Ff(_,h,L)}return L}function Ff(f,h,_){f.flags|=16384,f={getSnapshot:h,value:_},h=ai.updateQueue,h===null?(h={lastEffect:null,stores:null},ai.updateQueue=h,h.stores=[f]):(_=h.stores,_===null?h.stores=[f]:_.push(f))}function Nf(f,h,_,C){h.value=_,h.getSnapshot=C,ed(h)&&wr(f,1,-1)}function Po(f,h,_){return _(function(){ed(h)&&wr(f,1,-1)})}function ed(f){var h=f.getSnapshot;f=f.value;try{var _=h();return!ji(f,_)}catch{return!0}}function Tc(f){var h=js();return typeof f=="function"&&(f=f()),h.memoizedState=h.baseState=f,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:lo,lastRenderedState:f},h.queue=f,f=f.dispatch=vv.bind(null,ai,f),[h.memoizedState,f]}function Ac(f,h,_,C){return f={tag:f,create:h,destroy:_,deps:C,next:null},h=ai.updateQueue,h===null?(h={lastEffect:null,stores:null},ai.updateQueue=h,h.lastEffect=f.next=f):(_=h.lastEffect,_===null?h.lastEffect=f.next=f:(C=_.next,_.next=f,f.next=C,h.lastEffect=f)),f}function $p(){return Ws().memoizedState}function va(f,h,_,C){var L=js();ai.flags|=f,L.memoizedState=Ac(1|h,_,void 0,C===void 0?null:C)}function td(f,h,_,C){var L=Ws();C=C===void 0?null:C;var z=void 0;if(qi!==null){var ae=qi.memoizedState;if(z=ae.destroy,C!==null&&$u(C,ae.deps)){L.memoizedState=Ac(h,_,z,C);return}}ai.flags|=f,L.memoizedState=Ac(1|h,_,z,C)}function nd(f,h){return va(8390656,8,f,h)}function Ll(f,h){return td(2048,8,f,h)}function Xn(f,h){return td(4,2,f,h)}function id(f,h){return td(4,4,f,h)}function Cc(f,h){if(typeof h=="function")return f=f(),h(f),function(){h(null)};if(h!=null)return f=f(),h.current=f,function(){h.current=null}}function Dl(f,h,_){return _=_!=null?_.concat([f]):null,td(4,4,Cc.bind(null,h,f),_)}function rd(){}function sd(f,h){var _=Ws();h=h===void 0?null:h;var C=_.memoizedState;return C!==null&&h!==null&&$u(h,C[1])?C[0]:(_.memoizedState=[f,h],f)}function Ul(f,h){var _=Ws();h=h===void 0?null:h;var C=_.memoizedState;return C!==null&&h!==null&&$u(h,C[1])?C[0]:(f=f(),_.memoizedState=[f,h],f)}function od(f,h){var _=Yt;Yt=_!==0&&4>_?_:4,f(!0);var C=vs.transition;vs.transition={};try{f(!1),h()}finally{Yt=_,vs.transition=C}}function Va(){return Ws().memoizedState}function em(f,h,_){var C=Ks(f);_={lane:C,action:_,hasEagerState:!1,eagerState:null,next:null},tm(f)?Of(h,_):(Rc(f,h,_),_=Cn(),f=wr(f,C,_),f!==null&&Pc(f,h,C))}function vv(f,h,_){var C=Ks(f),L={lane:C,action:_,hasEagerState:!1,eagerState:null,next:null};if(tm(f))Of(h,L);else{Rc(f,h,L);var z=f.alternate;if(f.lanes===0&&(z===null||z.lanes===0)&&(z=h.lastRenderedReducer,z!==null))try{var ae=h.lastRenderedState,be=z(ae,_);if(L.hasEagerState=!0,L.eagerState=be,ji(be,ae))return}catch{}finally{}_=Cn(),f=wr(f,C,_),f!==null&&Pc(f,h,C)}}function tm(f){var h=f.alternate;return f===ai||h!==null&&h===ai}function Of(f,h){ao=Qu=!0;var _=f.pending;_===null?h.next=h:(h.next=_.next,_.next=h),f.pending=h}function Rc(f,h,_){Mi!==null&&(f.mode&1)!==0&&(sn&2)===0?(f=h.interleaved,f===null?(_.next=_,Lr===null?Lr=[h]:Lr.push(h)):(_.next=f.next,f.next=_),h.interleaved=_):(f=h.pending,f===null?_.next=_:(_.next=f.next,f.next=_),h.pending=_)}function Pc(f,h,_){if((_&4194240)!==0){var C=h.lanes;C&=f.pendingLanes,_|=C,h.lanes=_,Ri(f,_)}}var kl={readContext:si,useCallback:Zi,useContext:Zi,useEffect:Zi,useImperativeHandle:Zi,useInsertionEffect:Zi,useLayoutEffect:Zi,useMemo:Zi,useReducer:Zi,useRef:Zi,useState:Zi,useDebugValue:Zi,useDeferredValue:Zi,useTransition:Zi,useMutableSource:Zi,useSyncExternalStore:Zi,useId:Zi,unstable_isNewReconciler:!1},Bf={readContext:si,useCallback:function(f,h){return js().memoizedState=[f,h===void 0?null:h],f},useContext:si,useEffect:nd,useImperativeHandle:function(f,h,_){return _=_!=null?_.concat([f]):null,va(4194308,4,Cc.bind(null,h,f),_)},useLayoutEffect:function(f,h){return va(4194308,4,f,h)},useInsertionEffect:function(f,h){return va(4,2,f,h)},useMemo:function(f,h){var _=js();return h=h===void 0?null:h,f=f(),_.memoizedState=[f,h],f},useReducer:function(f,h,_){var C=js();return h=_!==void 0?_(h):h,C.memoizedState=C.baseState=h,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:h},C.queue=f,f=f.dispatch=em.bind(null,ai,f),[C.memoizedState,f]},useRef:function(f){var h=js();return f={current:f},h.memoizedState=f},useState:Tc,useDebugValue:rd,useDeferredValue:function(f){var h=Tc(f),_=h[0],C=h[1];return nd(function(){var L=vs.transition;vs.transition={};try{C(f)}finally{vs.transition=L}},[f]),_},useTransition:function(){var f=Tc(!1),h=f[0];return f=od.bind(null,f[1]),js().memoizedState=f,[h,f]},useMutableSource:function(){},useSyncExternalStore:function(f,h,_){var C=ai,L=js();if($n){if(_===void 0)throw Error(o(407));_=_()}else{if(_=h(),Mi===null)throw Error(o(349));(Ha&30)!==0||Ff(C,h,_)}L.memoizedState=_;var z={value:_,getSnapshot:h};return L.queue=z,nd(Po.bind(null,C,z,f),[f]),C.flags|=2048,Ac(9,Nf.bind(null,C,z,_,h),void 0,null),_},useId:function(){var f=js(),h=Mi.identifierPrefix;if($n){var _=Co,C=Ao;_=(C&~(1<<32-Ni(C)-1)).toString(32)+_,h=":"+h+"R"+_,_=Ga++,0<_&&(h+="H"+_.toString(32)),h+=":"}else _=wc++,h=":"+h+"r"+_.toString(32)+":";return f.memoizedState=h},unstable_isNewReconciler:!1},zf={readContext:si,useCallback:sd,useContext:si,useEffect:Ll,useImperativeHandle:Dl,useInsertionEffect:Xn,useLayoutEffect:id,useMemo:Ul,useReducer:Mc,useRef:$p,useState:function(){return Mc(lo)},useDebugValue:rd,useDeferredValue:function(f){var h=Mc(lo),_=h[0],C=h[1];return Ll(function(){var L=vs.transition;vs.transition={};try{C(f)}finally{vs.transition=L}},[f]),_},useTransition:function(){var f=Mc(lo)[0],h=Ws().memoizedState;return[f,h]},useMutableSource:Uf,useSyncExternalStore:kf,useId:Va,unstable_isNewReconciler:!1},Hf={readContext:si,useCallback:sd,useContext:si,useEffect:Ll,useImperativeHandle:Dl,useInsertionEffect:Xn,useLayoutEffect:id,useMemo:Ul,useReducer:Ec,useRef:$p,useState:function(){return Ec(lo)},useDebugValue:rd,useDeferredValue:function(f){var h=Ec(lo),_=h[0],C=h[1];return Ll(function(){var L=vs.transition;vs.transition={};try{C(f)}finally{vs.transition=L}},[f]),_},useTransition:function(){var f=Ec(lo)[0],h=Ws().memoizedState;return[f,h]},useMutableSource:Uf,useSyncExternalStore:kf,useId:Va,unstable_isNewReconciler:!1};function Gf(f,h){try{var _="",C=h;do _+=bo(C),C=C.return;while(C);var L=_}catch(z){L=` 3909Error generating stack: `+z.message+` 3910`+z.stack}return{value:f,source:h,stack:L}}function ad(f,h){try{console.error(h.value)}catch(_){setTimeout(function(){throw _})}}var yv=typeof WeakMap=="function"?WeakMap:Map;function nm(f,h,_){_=To(-1,_),_.tag=3,_.payload={element:null};var C=h.value;return _.callback=function(){Hl||(Hl=!0,Zn=C),ad(f,h)},_}function ld(f,h,_){_=To(-1,_),_.tag=3;var C=f.type.getDerivedStateFromError;if(typeof C=="function"){var L=h.value;_.payload=function(){return C(L)},_.callback=function(){ad(f,h)}}var z=f.stateNode;return z!==null&&typeof z.componentDidCatch=="function"&&(_.callback=function(){ad(f,h),typeof C!="function"&&(qs===null?qs=new Set([this]):qs.add(this));var ae=h.stack;this.componentDidCatch(h.value,{componentStack:ae!==null?ae:""})}),_}function Io(f,h,_){var C=f.pingCache;if(C===null){C=f.pingCache=new yv;var L=new Set;C.set(h,L)}else L=C.get(h),L===void 0&&(L=new Set,C.set(h,L));L.has(_)||(L.add(_),f=oh.bind(null,f,h,_),h.then(f,f))}function Vf(f){do{var h;if((h=f.tag===13)&&(h=f.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return f;f=f.return}while(f!==null);return null}function ja(f,h,_,C,L){return(f.mode&1)===0?(f===h?f.flags|=65536:(f.flags|=128,_.flags|=131072,_.flags&=-52805,_.tag===1&&(_.alternate===null?_.tag=17:(h=To(-1,1),h.tag=2,fa(_,h))),_.lanes|=1),f):(f.flags|=65536,f.lanes=L,f)}function zi(f){f.flags|=4}function Fl(f,h){if(f!==null&&f.child===h.child)return!0;if((h.flags&16)!==0)return!1;for(f=h.child;f!==null;){if((f.flags&12854)!==0||(f.subtreeFlags&12854)!==0)return!1;f=f.sibling}return!0}var ys,Wa,cd,ud;if(Ie)ys=function(f,h){for(var _=h.child;_!==null;){if(_.tag===5||_.tag===6)j(f,_.stateNode);else if(_.tag!==4&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===h)break;for(;_.sibling===null;){if(_.return===null||_.return===h)return;_=_.return}_.sibling.return=_.return,_=_.sibling}},Wa=function(){},cd=function(f,h,_,C,L){if(f=f.memoizedProps,f!==C){var z=h.stateNode,ae=Vs(Qr.current);_=ne(z,_,f,C,L,ae),(h.updateQueue=_)&&zi(h)}},ud=function(f,h,_,C){_!==C&&zi(h)};else if(Y){ys=function(f,h,_,C){for(var L=h.child;L!==null;){if(L.tag===5){var z=L.stateNode;_&&C&&(z=Kt(z,L.type,L.memoizedProps,L)),j(f,z)}else if(L.tag===6)z=L.stateNode,_&&C&&(z=dn(z,L.memoizedProps,L)),j(f,z);else if(L.tag!==4){if(L.tag===22&&L.memoizedState!==null)z=L.child,z!==null&&(z.return=L),ys(f,L,!0,!0);else if(L.child!==null){L.child.return=L,L=L.child;continue}}if(L===h)break;for(;L.sibling===null;){if(L.return===null||L.return===h)return;L=L.return}L.sibling.return=L.return,L=L.sibling}};var ya=function(f,h,_,C){for(var L=h.child;L!==null;){if(L.tag===5){var z=L.stateNode;_&&C&&(z=Kt(z,L.type,L.memoizedProps,L)),kt(f,z)}else if(L.tag===6)z=L.stateNode,_&&C&&(z=dn(z,L.memoizedProps,L)),kt(f,z);else if(L.tag!==4){if(L.tag===22&&L.memoizedState!==null)z=L.child,z!==null&&(z.return=L),ya(f,L,!0,!0);else if(L.child!==null){L.child.return=L,L=L.child;continue}}if(L===h)break;for(;L.sibling===null;){if(L.return===null||L.return===h)return;L=L.return}L.sibling.return=L.return,L=L.sibling}};Wa=function(f,h){var _=h.stateNode;if(!Fl(f,h)){f=_.containerInfo;var C=vt(f);ya(C,h,!1,!1),_.pendingChildren=C,zi(h),Ft(f,C)}},cd=function(f,h,_,C,L){var z=f.stateNode,ae=f.memoizedProps;if((f=Fl(f,h))&&ae===C)h.stateNode=z;else{var be=h.stateNode,Je=Vs(Qr.current),dt=null;ae!==C&&(dt=ne(be,_,ae,C,L,Je)),f&&dt===null?h.stateNode=z:(z=mt(z,dt,_,ae,C,h,f,be),re(z,_,C,L,Je)&&zi(h),h.stateNode=z,f?zi(h):ys(z,h,!1,!1))}},ud=function(f,h,_,C){_!==C?(f=Vs(Ba.current),_=Vs(Qr.current),h.stateNode=he(C,f,_,h),zi(h)):h.stateNode=f.stateNode}}else Wa=function(){},cd=function(){},ud=function(){};function Lo(f,h){if(!$n)switch(f.tailMode){case"hidden":h=f.tail;for(var _=null;h!==null;)h.alternate!==null&&(_=h),h=h.sibling;_===null?f.tail=null:_.sibling=null;break;case"collapsed":_=f.tail;for(var C=null;_!==null;)_.alternate!==null&&(C=_),_=_.sibling;C===null?h||f.tail===null?f.tail=null:f.tail.sibling=null:C.sibling=null}}function wi(f){var h=f.alternate!==null&&f.alternate.child===f.child,_=0,C=0;if(h)for(var L=f.child;L!==null;)_|=L.lanes|L.childLanes,C|=L.subtreeFlags&14680064,C|=L.flags&14680064,L.return=f,L=L.sibling;else for(L=f.child;L!==null;)_|=L.lanes|L.childLanes,C|=L.subtreeFlags,C|=L.flags,L.return=f,L=L.sibling;return f.subtreeFlags|=C,f.childLanes=_,h}function dd(f,h,_){var C=h.pendingProps;switch(Pf(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wi(h),null;case 1:return Hn(h.type)&&an(),wi(h),null;case 3:return C=h.stateNode,Pl(),Mt(xn),Mt(zt),za(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(f===null||f.child===null)&&(Sc(h)?zi(h):f===null||f.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,Is!==null&&(Vc(Is),Is=null))),Wa(f,h),wi(h),null;case 5:Df(h),_=Vs(Ba.current);var L=h.type;if(f!==null&&h.stateNode!=null)cd(f,h,L,C,_),f.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!C){if(h.stateNode===null)throw Error(o(166));return wi(h),null}if(f=Vs(Qr.current),Sc(h)){if(!Ce)throw Error(o(175));f=xo(h.stateNode,h.type,h.memoizedProps,_,f,h,!El),h.updateQueue=f,f!==null&&zi(h)}else{var z=O(L,C,_,f,h);ys(z,h,!1,!1),h.stateNode=z,re(z,L,C,_,f)&&zi(h)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return wi(h),null;case 6:if(f&&h.stateNode!=null)ud(f,h,f.memoizedProps,C);else{if(typeof C!="string"&&h.stateNode===null)throw Error(o(166));if(f=Vs(Ba.current),_=Vs(Qr.current),Sc(h)){if(!Ce)throw Error(o(176));if(f=h.stateNode,C=h.memoizedProps,(_=Vn(f,C,h,!El))&&(L=Dr,L!==null))switch(z=(L.mode&1)!==0,L.tag){case 3:yt(L.stateNode.containerInfo,f,C,z);break;case 5:Tt(L.type,L.memoizedProps,L.stateNode,f,C,z)}_&&zi(h)}else h.stateNode=he(C,f,_,h)}return wi(h),null;case 13:if(Mt(oi),C=h.memoizedState,$n&&rr!==null&&(h.mode&1)!==0&&(h.flags&128)===0){for(f=rr;f;)f=_i(f);return Tl(),h.flags|=98560,h}if(C!==null&&C.dehydrated!==null){if(C=Sc(h),f===null){if(!C)throw Error(o(318));if(!Ce)throw Error(o(344));if(f=h.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));Hs(f,h)}else Tl(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;return wi(h),null}return Is!==null&&(Vc(Is),Is=null),(h.flags&128)!==0?(h.lanes=_,h):(C=C!==null,_=!1,f===null?Sc(h):_=f.memoizedState!==null,C&&!_&&(h.child.flags|=8192,(h.mode&1)!==0&&(f===null||(oi.current&1)!==0?gi===0&&(gi=3):yd())),h.updateQueue!==null&&(h.flags|=4),wi(h),null);case 4:return Pl(),Wa(f,h),f===null&&Ge(h.stateNode.containerInfo),wi(h),null;case 10:return Pi(h.type._context),wi(h),null;case 17:return Hn(h.type)&&an(),wi(h),null;case 19:if(Mt(oi),L=h.memoizedState,L===null)return wi(h),null;if(C=(h.flags&128)!==0,z=L.rendering,z===null)if(C)Lo(L,!1);else{if(gi!==0||f!==null&&(f.flags&128)!==0)for(f=h.child;f!==null;){if(z=Ju(f),z!==null){for(h.flags|=128,Lo(L,!1),f=z.updateQueue,f!==null&&(h.updateQueue=f,h.flags|=4),h.subtreeFlags=0,f=_,C=h.child;C!==null;)_=C,L=f,_.flags&=14680066,z=_.alternate,z===null?(_.childLanes=0,_.lanes=L,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=z.childLanes,_.lanes=z.lanes,_.child=z.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=z.memoizedProps,_.memoizedState=z.memoizedState,_.updateQueue=z.updateQueue,_.type=z.type,L=z.dependencies,_.dependencies=L===null?null:{lanes:L.lanes,firstContext:L.firstContext}),C=C.sibling;return ft(oi,oi.current&1|2),h.child}f=f.sibling}L.tail!==null&&Wn()>Sa&&(h.flags|=128,C=!0,Lo(L,!1),h.lanes=4194304)}else{if(!C)if(f=Ju(z),f!==null){if(h.flags|=128,C=!0,f=f.updateQueue,f!==null&&(h.updateQueue=f,h.flags|=4),Lo(L,!0),L.tail===null&&L.tailMode==="hidden"&&!z.alternate&&!$n)return wi(h),null}else 2*Wn()-L.renderingStartTime>Sa&&_!==1073741824&&(h.flags|=128,C=!0,Lo(L,!1),h.lanes=4194304);L.isBackwards?(z.sibling=h.child,h.child=z):(f=L.last,f!==null?f.sibling=z:h.child=z,L.last=z)}return L.tail!==null?(h=L.tail,L.rendering=h,L.tail=h.sibling,L.renderingStartTime=Wn(),h.sibling=null,f=oi.current,ft(oi,C?f&1|2:f&1),h):(wi(h),null);case 22:case 23:return jc(),C=h.memoizedState!==null,f!==null&&f.memoizedState!==null!==C&&(h.flags|=8192),C&&(h.mode&1)!==0?(br&1073741824)!==0&&(wi(h),Ie&&h.subtreeFlags&6&&(h.flags|=8192)):wi(h),null;case 24:return null;case 25:return null}throw Error(o(156,h.tag))}var jf=l.ReactCurrentOwner,Ji=!1;function mi(f,h,_,C){h.child=f===null?Jp(h,null,_,C):Ro(h,f.child,_,C)}function Yn(f,h,_,C,L){_=_.render;var z=h.ref;return bi(h,L),C=Il(f,h,_,C,z,L),_=ga(),f!==null&&!Ji?(h.updateQueue=f.updateQueue,h.flags&=-2053,f.lanes&=~L,$r(f,h,L)):($n&&_&&Rf(h),h.flags|=1,mi(f,h,C,L),h.child)}function Gn(f,h,_,C,L){if(f===null){var z=_.type;return typeof z=="function"&&!_d(z)&&z.defaultProps===void 0&&_.compare===null&&_.defaultProps===void 0?(h.tag=15,h.type=z,Do(f,h,z,C,L)):(f=Sd(_.type,null,C,h,h.mode,L),f.ref=h.ref,f.return=h,h.child=f)}if(z=f.child,(f.lanes&L)===0){var ae=z.memoizedProps;if(_=_.compare,_=_!==null?_:Zr,_(ae,C)&&f.ref===h.ref)return $r(f,h,L)}return h.flags|=1,f=Go(z,C),f.ref=h.ref,f.return=h,h.child=f}function Do(f,h,_,C,L){if(f!==null&&Zr(f.memoizedProps,C)&&f.ref===h.ref)if(Ji=!1,(f.lanes&L)!==0)(f.flags&131072)!==0&&(Ji=!0);else return h.lanes=f.lanes,$r(f,h,L);return Uo(f,h,_,C,L)}function sr(f,h,_){var C=h.pendingProps,L=C.children,z=f!==null?f.memoizedState:null;if(C.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null},ft(el,br),br|=_;else if((_&1073741824)!==0)h.memoizedState={baseLanes:0,cachePool:null},C=z!==null?z.baseLanes:_,ft(el,br),br|=C;else return f=z!==null?z.baseLanes|_:_,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:f,cachePool:null},h.updateQueue=null,ft(el,br),br|=f,null;else z!==null?(C=z.baseLanes|_,h.memoizedState=null):C=_,ft(el,br),br|=C;return mi(f,h,L,_),h.child}function Ur(f,h){var _=h.ref;(f===null&&_!==null||f!==null&&f.ref!==_)&&(h.flags|=512,h.flags|=2097152)}
vendor: 4,849 bytes, line 3910
3910function Uo(f,h,_,C,L){var z=Hn(_)?ri:zt.current;return z=Tn(h,z),bi(h,L),_=Il(f,h,_,C,z,L),C=ga(),f!==null&&!Ji?(h.updateQueue=f.updateQueue,h.flags&=-2053,f.lanes&=~L,$r(f,h,L)):($n&&C&&Rf(h),h.flags|=1,mi(f,h,_,L),h.child)}function Xa(f,h,_,C,L){if(Hn(_)){var z=!0;Jn(h)}else z=!1;if(bi(h,L),h.stateNode===null)f!==null&&(f.alternate=null,h.alternate=null,h.flags|=2),Xp(h,_,C),Cf(h,_,C,L),C=!0;else if(f===null){var ae=h.stateNode,be=h.memoizedProps;ae.props=be;var Je=ae.context,dt=_.contextType;typeof dt=="object"&&dt!==null?dt=si(dt):(dt=Hn(_)?ri:zt.current,dt=Tn(h,dt));var Ct=_.getDerivedStateFromProps,en=typeof Ct=="function"||typeof ae.getSnapshotBeforeUpdate=="function";en||typeof ae.UNSAFE_componentWillReceiveProps!="function"&&typeof ae.componentWillReceiveProps!="function"||(be!==C||Je!==dt)&&Yp(h,ae,C,dt),Rs=!1;var Gt=h.memoizedState;ae.state=Gt,ju(h,C,ae,L),Je=h.memoizedState,be!==C||Gt!==Je||xn.current||Rs?(typeof Ct=="function"&&(Tf(h,_,Ct,C),Je=h.memoizedState),(be=Rs||Af(h,_,be,C,Gt,Je,dt))?(en||typeof ae.UNSAFE_componentWillMount!="function"&&typeof ae.componentWillMount!="function"||(typeof ae.componentWillMount=="function"&&ae.componentWillMount(),typeof ae.UNSAFE_componentWillMount=="function"&&ae.UNSAFE_componentWillMount()),typeof ae.componentDidMount=="function"&&(h.flags|=4194308)):(typeof ae.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=C,h.memoizedState=Je),ae.props=C,ae.state=Je,ae.context=dt,C=be):(typeof ae.componentDidMount=="function"&&(h.flags|=4194308),C=!1)}else{ae=h.stateNode,Ef(f,h),be=h.memoizedProps,dt=h.type===h.elementType?be:Xi(h.type,be),ae.props=dt,en=h.pendingProps,Gt=ae.context,Je=_.contextType,typeof Je=="object"&&Je!==null?Je=si(Je):(Je=Hn(_)?ri:zt.current,Je=Tn(h,Je));var ln=_.getDerivedStateFromProps;(Ct=typeof ln=="function"||typeof ae.getSnapshotBeforeUpdate=="function")||typeof ae.UNSAFE_componentWillReceiveProps!="function"&&typeof ae.componentWillReceiveProps!="function"||(be!==en||Gt!==Je)&&Yp(h,ae,C,Je),Rs=!1,Gt=h.memoizedState,ae.state=Gt,ju(h,C,ae,L);var Et=h.memoizedState;be!==en||Gt!==Et||xn.current||Rs?(typeof ln=="function"&&(Tf(h,_,ln,C),Et=h.memoizedState),(dt=Rs||Af(h,_,dt,C,Gt,Et,Je)||!1)?(Ct||typeof ae.UNSAFE_componentWillUpdate!="function"&&typeof ae.componentWillUpdate!="function"||(typeof ae.componentWillUpdate=="function"&&ae.componentWillUpdate(C,Et,Je),typeof ae.UNSAFE_componentWillUpdate=="function"&&ae.UNSAFE_componentWillUpdate(C,Et,Je)),typeof ae.componentDidUpdate=="function"&&(h.flags|=4),typeof ae.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof ae.componentDidUpdate!="function"||be===f.memoizedProps&&Gt===f.memoizedState||(h.flags|=4),typeof ae.getSnapshotBeforeUpdate!="function"||be===f.memoizedProps&&Gt===f.memoizedState||(h.flags|=1024),h.memoizedProps=C,h.memoizedState=Et),ae.props=C,ae.state=Et,ae.context=Je,C=dt):(typeof ae.componentDidUpdate!="function"||be===f.memoizedProps&&Gt===f.memoizedState||(h.flags|=4),typeof ae.getSnapshotBeforeUpdate!="function"||be===f.memoizedProps&&Gt===f.memoizedState||(h.flags|=1024),C=!1)}return Sr(f,h,_,C,z,L)}function Sr(f,h,_,C,L,z){Ur(f,h);var ae=(h.flags&128)!==0;if(!C&&!ae)return L&&pi(h,_,!1),$r(f,h,z);C=h.stateNode,jf.current=h;var be=ae&&typeof _.getDerivedStateFromError!="function"?null:C.render();return h.flags|=1,f!==null&&ae?(h.child=Ro(h,f.child,null,z),h.child=Ro(h,null,be,z)):mi(f,h,be,z),h.memoizedState=C.state,L&&pi(h,_,!0),h.child}function Ic(f){var h=f.stateNode;h.pendingContext?Ci(f,h.pendingContext,h.pendingContext!==h.context):h.context&&Ci(f,h.context,!1),Zu(f,h.containerInfo)}function Wf(f,h,_,C,L){return Tl(),Ku(L),h.flags|=256,mi(f,h,_,C),h.child}var Lc={dehydrated:null,treeContext:null,retryLane:0};function Ya(f){return{baseLanes:f,cachePool:null}}function Xf(f,h,_){var C=h.pendingProps,L=oi.current,z=!1,ae=(h.flags&128)!==0,be;if((be=ae)||(be=f!==null&&f.memoizedState===null?!1:(L&2)!==0),be?(z=!0,h.flags&=-129):(f===null||f.memoizedState!==null)&&(L|=1),ft(oi,L&1),f===null)return pa(h),f=h.memoizedState,f!==null&&(f=f.dehydrated,f!==null)?((h.mode&1)===0?h.lanes=1:fi(f)?h.lanes=8:h.lanes=1073741824,null):(L=C.children,f=C.fallback,z?(C=h.mode,z=h.child,L={mode:"hidden",children:L},(C&1)===0&&z!==null?(z.childLanes=0,z.pendingProps=L):z=Yc(L,C,0,null),f=sl(f,C,_,null),z.return=h,f.return=h,z.sibling=f,h.child=z,h.child.memoizedState=Ya(_),h.memoizedState=Lc,f):Xs(h,L));if(L=f.memoizedState,L!==null){if(be=L.dehydrated,be!==null){if(ae)return h.flags&256?(h.flags&=-257,Uc(f,h,_,Error(o(422)))):h.memoizedState!==null?(h.child=f.child,h.flags|=128,null):(z=C.fallback,L=h.mode,C=Yc({mode:"visible",children:C.children},L,0,null),z=sl(z,L,_,null),z.flags|=2,C.return=h,z.return=h,C.sibling=z,h.child=C,(h.mode&1)!==0&&Ro(h,f.child,null,_),h.child.memoizedState=Ya(_),h.memoizedState=Lc,z);
vendor: 1,613 bytes, line 3910
3910if((h.mode&1)===0)h=Uc(f,h,_,null);else if(fi(be))h=Uc(f,h,_,Error(o(419)));else if(C=(_&f.childLanes)!==0,Ji||C){if(C=Mi,C!==null){switch(_&-_){case 4:z=2;break;case 16:z=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:z=32;break;case 536870912:z=268435456;break;default:z=0}C=(z&(C.suspendedLanes|_))!==0?0:z,C!==0&&C!==L.retryLane&&(L.retryLane=C,wr(f,C,-1))}yd(),h=Uc(f,h,_,Error(o(421)))}else vr(be)?(h.flags|=128,h.child=f.child,h=am.bind(null,f),Ai(be,h),h=null):(_=L.treeContext,Ce&&(rr=Pr(be),Dr=h,$n=!0,Is=null,El=!1,_!==null&&(Ps[ms++]=Ao,Ps[ms++]=Co,Ps[ms++]=Fa,Ao=_.id,Co=_.overflow,Fa=h)),h=Xs(h,h.pendingProps.children),h.flags|=4096);return h}return z?(C=fd(f,h,C.children,C.fallback,_),z=h.child,L=f.child.memoizedState,z.memoizedState=L===null?Ya(_):{baseLanes:L.baseLanes|_,cachePool:null},z.childLanes=f.childLanes&~_,h.memoizedState=Lc,C):(_=Dc(f,h,C.children,_),h.memoizedState=null,_)}return z?(C=fd(f,h,C.children,C.fallback,_),z=h.child,L=f.child.memoizedState,z.memoizedState=L===null?Ya(_):{baseLanes:L.baseLanes|_,cachePool:null},z.childLanes=f.childLanes&~_,h.memoizedState=Lc,C):(_=Dc(f,h,C.children,_),h.memoizedState=null,_)}function Xs(f,h){return h=Yc({mode:"visible",children:h},f.mode,0,null),h.return=f,f.child=h}function Dc(f,h,_,C){var L=f.child;return f=L.sibling,_=Go(L,{mode:"visible",children:_}),(h.mode&1)===0&&(_.lanes=C),_.return=h,_.sibling=null,f!==null&&(C=h.deleti
vendor: 4,187 bytes, line 3910
3910ons,C===null?(h.deletions=[f],h.flags|=16):C.push(f)),h.child=_}function fd(f,h,_,C,L){var z=h.mode;f=f.child;var ae=f.sibling,be={mode:"hidden",children:_};return(z&1)===0&&h.child!==f?(_=h.child,_.childLanes=0,_.pendingProps=be,h.deletions=null):(_=Go(f,be),_.subtreeFlags=f.subtreeFlags&14680064),ae!==null?C=Go(ae,C):(C=sl(C,z,L,null),C.flags|=2),C.return=h,_.return=h,_.sibling=C,h.child=_,C}function Uc(f,h,_,C){return C!==null&&Ku(C),Ro(h,f.child,null,_),f=Xs(h,h.pendingProps.children),f.flags|=2,h.memoizedState=null,f}function im(f,h,_){f.lanes|=h;var C=f.alternate;C!==null&&(C.lanes|=h),Bi(f.return,h,_)}function co(f,h,_,C,L){var z=f.memoizedState;z===null?f.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:C,tail:_,tailMode:L}:(z.isBackwards=h,z.rendering=null,z.renderingStartTime=0,z.last=C,z.tail=_,z.tailMode=L)}function qa(f,h,_){var C=h.pendingProps,L=C.revealOrder,z=C.tail;if(mi(f,h,C.children,_),C=oi.current,(C&2)!==0)C=C&1|2,h.flags|=128;else{if(f!==null&&(f.flags&128)!==0)e:for(f=h.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&im(f,_,h);else if(f.tag===19)im(f,_,h);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===h)break e;for(;f.sibling===null;){if(f.return===null||f.return===h)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}C&=1}if(ft(oi,C),(h.mode&1)===0)h.memoizedState=null;else switch(L){case"forwards":for(_=h.child,L=null;_!==null;)f=_.alternate,f!==null&&Ju(f)===null&&(L=_),_=_.sibling;_=L,_===null?(L=h.child,h.child=null):(L=_.sibling,_.sibling=null),co(h,!1,L,_,z);break;case"backwards":for(_=null,L=h.child,h.child=null;L!==null;){if(f=L.alternate,f!==null&&Ju(f)===null){h.child=L;break}f=L.sibling,L.sibling=_,_=L,L=f}co(h,!0,_,null,z);break;case"together":co(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function $r(f,h,_){if(f!==null&&(h.dependencies=f.dependencies),uo|=h.lanes,(_&h.childLanes)===0)return null;if(f!==null&&h.child!==f.child)throw Error(o(153));if(h.child!==null){for(f=h.child,_=Go(f,f.pendingProps),h.child=_,_.return=h;f.sibling!==null;)f=f.sibling,_=_.sibling=Go(f,f.pendingProps),_.return=h;_.sibling=null}return h.child}function hd(f,h,_){switch(h.tag){case 3:Ic(h),Tl();break;case 5:Qp(h);break;case 1:Hn(h.type)&&Jn(h);break;case 4:Zu(h,h.stateNode.containerInfo);break;case 10:Eo(h,h.type._context,h.memoizedProps.value);break;case 13:var C=h.memoizedState;if(C!==null)return C.dehydrated!==null?(ft(oi,oi.current&1),h.flags|=128,null):(_&h.child.childLanes)!==0?Xf(f,h,_):(ft(oi,oi.current&1),f=$r(f,h,_),f!==null?f.sibling:null);ft(oi,oi.current&1);break;case 19:if(C=(_&h.childLanes)!==0,(f.flags&128)!==0){if(C)return qa(f,h,_);h.flags|=128}var L=h.memoizedState;if(L!==null&&(L.rendering=null,L.tail=null,L.lastEffect=null),ft(oi,oi.current),C)break;return null;case 22:case 23:return h.lanes=0,sr(f,h,_)}return $r(f,h,_)}function pd(f,h){switch(Pf(h),h.tag){case 1:return Hn(h.type)&&an(),f=h.flags,f&65536?(h.flags=f&-65537|128,h):null;case 3:return Pl(),Mt(xn),Mt(zt),za(),f=h.flags,(f&65536)!==0&&(f&128)===0?(h.flags=f&-65537|128,h):null;case 5:return Df(h),null;case 13:if(Mt(oi),f=h.memoizedState,f!==null&&f.dehydrated!==null){if(h.alternate===null)throw Error(o(340));Tl()}return f=h.flags,f&65536?(h.flags=f&-65537|128,h):null;case 19:return Mt(oi),null;case 4:return Pl(),null;case 10:return Pi(h.type._context),null;case 22:case 23:return jc(),null;case 24:return null;default:return null}}var kr=!1,Qi=!1,Ka=typeof WeakSet=="function"?WeakSet:Set,gt=null;function Ls(f,h){var _=f.ref;if(_!==null)if(typeof _=="function")try{_(null)}catch(C){Nr(f,h,C)}else _.current=null}function ko(f,h,_){try{_()}catch(C){Nr(f,h,C)}}var Yf=!1;function qf(f,h){for($(f.containerInfo),gt=h;gt!==null;)if(f=gt,h=f.child,(f.subtreeFlags&1028)!==0&&h!==null)h.return=f,gt=h;else for(;gt!==null;){f=gt;try{var _=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var C=_.memoizedProps,L=_.memoizedState,z=f.stateNode,ae=z.getSnapshotBeforeUpdate(f.elementType===f.type?C:Xi(f.type,C),L);z.__reactInternalSnapshotBeforeUpdate=ae}break;case 3:Ie&&rt(f.stateNode.containerInfo);break;
vendor: 11,166 bytes, line 3910
3910case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(be){Nr(f,f.return,be)}if(h=f.sibling,h!==null){h.return=f.return,gt=h;break}gt=f.return}return _=Yf,Yf=!1,_}function Fo(f,h,_){var C=h.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var L=C=C.next;do{if((L.tag&f)===f){var z=L.destroy;L.destroy=void 0,z!==void 0&&ko(h,_,z)}L=L.next}while(L!==C)}}function or(f,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var _=h=h.next;do{if((_.tag&f)===f){var C=_.create;_.destroy=C()}_=_.next}while(_!==h)}}function Fr(f){var h=f.ref;if(h!==null){var _=f.stateNode;switch(f.tag){case 5:f=se(_);break;default:f=_}typeof h=="function"?h(f):h.current=f}}function Kn(f,h,_){if(ps&&typeof ps.onCommitFiberUnmount=="function")try{ps.onCommitFiberUnmount(la,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(f=h.updateQueue,f!==null&&(f=f.lastEffect,f!==null)){var C=f=f.next;do{var L=C,z=L.destroy;L=L.tag,z!==void 0&&((L&2)!==0||(L&4)!==0)&&ko(h,_,z),C=C.next}while(C!==f)}break;case 1:if(Ls(h,_),f=h.stateNode,typeof f.componentWillUnmount=="function")try{f.props=h.memoizedProps,f.state=h.memoizedState,f.componentWillUnmount()}catch(ae){Nr(h,_,ae)}break;case 5:Ls(h,_);break;case 4:Ie?Jf(f,h,_):Y&&Y&&(h=h.stateNode.containerInfo,_=vt(h),pt(h,_))}}function Ds(f,h,_){for(var C=h;;)if(Kn(f,C,_),C.child===null||Ie&&C.tag===4){if(C===h)break;for(;C.sibling===null;){if(C.return===null||C.return===h)return;C=C.return}C.sibling.return=C.return,C=C.sibling}else C.child.return=C,C=C.child}function Kf(f){var h=f.alternate;h!==null&&(f.alternate=null,Kf(h)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(h=f.stateNode,h!==null&&$e(h)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Zf(f){return f.tag===5||f.tag===3||f.tag===4}function md(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Zf(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function gd(f){if(Ie){e:{for(var h=f.return;h!==null;){if(Zf(h))break e;h=h.return}throw Error(o(160))}var _=h;switch(_.tag){case 5:h=_.stateNode,_.flags&32&&(qe(h),_.flags&=-33),_=md(f),Nl(f,_,h);break;case 3:case 4:h=_.stateNode.containerInfo,_=md(f),vd(f,_,h);break;default:throw Error(o(161))}}}function vd(f,h,_){var C=f.tag;if(C===5||C===6)f=f.stateNode,h?et(_,f,h):at(_,f);else if(C!==4&&(f=f.child,f!==null))for(vd(f,h,_),f=f.sibling;f!==null;)vd(f,h,_),f=f.sibling}function Nl(f,h,_){var C=f.tag;if(C===5||C===6)f=f.stateNode,h?nt(_,f,h):Qe(_,f);else if(C!==4&&(f=f.child,f!==null))for(Nl(f,h,_),f=f.sibling;f!==null;)Nl(f,h,_),f=f.sibling}function Jf(f,h,_){for(var C=h,L=!1,z,ae;;){if(!L){L=C.return;e:for(;;){if(L===null)throw Error(o(160));switch(z=L.stateNode,L.tag){case 5:ae=!1;break e;case 3:z=z.containerInfo,ae=!0;break e;case 4:z=z.containerInfo,ae=!0;break e}L=L.return}L=!0}if(C.tag===5||C.tag===6)Ds(f,C,_),ae?ue(z,C.stateNode):it(z,C.stateNode);else if(C.tag===18)ae?Te(z,C.stateNode):ke(z,C.stateNode);else if(C.tag===4){if(C.child!==null){z=C.stateNode.containerInfo,ae=!0,C.child.return=C,C=C.child;continue}}else if(Kn(f,C,_),C.child!==null){C.child.return=C,C=C.child;continue}if(C===h)break;for(;C.sibling===null;){if(C.return===null||C.return===h)return;C=C.return,C.tag===4&&(L=!1)}C.sibling.return=C.return,C=C.sibling}}function xa(f,h){if(Ie){switch(h.tag){case 0:case 11:case 14:case 15:Fo(3,h,h.return),or(3,h),Fo(5,h,h.return);return;case 1:return;case 5:var _=h.stateNode;if(_!=null){var C=h.memoizedProps;f=f!==null?f.memoizedProps:C;var L=h.type,z=h.updateQueue;h.updateQueue=null,z!==null&&wt(_,z,L,f,C,h)}return;case 6:if(h.stateNode===null)throw Error(o(162));_=h.memoizedProps,Ke(h.stateNode,f!==null?f.memoizedProps:_,_);return;case 3:Ce&&f!==null&&f.memoizedState.isDehydrated&&Se(h.stateNode.containerInfo);return;case 12:return;case 13:Ol(h);return;case 19:Ol(h);return;case 17:return}throw Error(o(163))}switch(h.tag){case 0:case 11:case 14:case 15:Fo(3,h,h.return),or(3,h),Fo(5,h,h.return);return;case 12:return;case 13:Ol(h);return;case 19:Ol(h);return;case 3:Ce&&f!==null&&f.memoizedState.isDehydrated&&Se(h.stateNode.containerInfo);break;case 22:case 23:return}e:if(Y){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,pt(h.containerInfo,h.pendingChildren);break e}throw Error(o(163))}}function Ol(f){var h=f.updateQueue;if(h!==null){f.updateQueue=null;var _=f.stateNode;_===null&&(_=f.stateNode=new Ka),h.forEach(function(C){var L=lm.bind(null,f,C);_.has(C)||(_.add(C),C.then(L,L))})}}function xv(f,h){for(gt=h;gt!==null;){h=gt;var _=h.deletions;if(_!==null)for(var C=0;C<_.length;C++){var L=_[C];try{var z=f;Ie?Jf(z,L,h):Ds(z,L,h);var ae=L.alternate;ae!==null&&(ae.return=null),L.return=null}catch(Ut){Nr(L,h,Ut)}}if(_=h.child,(h.subtreeFlags&12854)!==0&&_!==null)_.return=h,gt=_;else for(;gt!==null;){h=gt;try{var be=h.flags;if(be&32&&Ie&&qe(h.stateNode),be&512){var Je=h.alternate;if(Je!==null){var dt=Je.ref;dt!==null&&(typeof dt=="function"?dt(null):dt.current=null)}}if(be&8192)switch(h.tag){case 13:if(h.memoizedState!==null){var Ct=h.alternate;(Ct===null||Ct.memoizedState===null)&&(Hc=Wn())}break;case 22:var en=h.memoizedState!==null,Gt=h.alternate,ln=Gt!==null&&Gt.memoizedState!==null;if(_=h,Ie){e:if(C=_,L=en,z=null,Ie)for(var Et=C;;){if(Et.tag===5){if(z===null){z=Et;var cr=Et.stateNode;L?ce(cr):xe(Et.stateNode,Et.memoizedProps)}}else if(Et.tag===6){if(z===null){var ws=Et.stateNode;L?Fe(ws):De(ws,Et.memoizedProps)}}else if((Et.tag!==22&&Et.tag!==23||Et.memoizedState===null||Et===C)&&Et.child!==null){Et.child.return=Et,Et=Et.child;continue}if(Et===C)break;for(;Et.sibling===null;){if(Et.return===null||Et.return===C)break e;z===Et&&(z=null),Et=Et.return}z===Et&&(z=null),Et.sibling.return=Et.return,Et=Et.sibling}}if(en&&!ln&&(_.mode&1)!==0){gt=_;for(var Be=_.child;Be!==null;){for(_=gt=Be;gt!==null;){C=gt;var Me=C.child;switch(C.tag){case 0:case 11:case 14:case 15:Fo(4,C,C.return);break;case 1:Ls(C,C.return);var Ye=C.stateNode;if(typeof Ye.componentWillUnmount=="function"){var bt=C.return;try{Ye.props=C.memoizedProps,Ye.state=C.memoizedState,Ye.componentWillUnmount()}catch(Ut){Nr(C,bt,Ut)}}break;case 5:Ls(C,C.return);break;case 22:if(C.memoizedState!==null){$f(_);continue}}Me!==null?(Me.return=C,gt=Me):$f(_)}Be=Be.sibling}}}switch(be&4102){case 2:gd(h),h.flags&=-3;break;case 6:gd(h),h.flags&=-3,xa(h.alternate,h);break;case 4096:h.flags&=-4097;break;case 4100:h.flags&=-4097,xa(h.alternate,h);break;case 4:xa(h.alternate,h)}}catch(Ut){Nr(h,h.return,Ut)}if(_=h.sibling,_!==null){_.return=h.return,gt=_;break}gt=h.return}}}function kc(f,h,_){gt=f,Fc(f)}function Fc(f,h,_){for(var C=(f.mode&1)!==0;gt!==null;){var L=gt,z=L.child;if(L.tag===22&&C){var ae=L.memoizedState!==null||kr;if(!ae){var be=L.alternate,Je=be!==null&&be.memoizedState!==null||Qi;be=kr;var dt=Qi;if(kr=ae,(Qi=Je)&&!dt)for(gt=L;gt!==null;)ae=gt,Je=ae.child,ae.tag===22&&ae.memoizedState!==null?Za(L):Je!==null?(Je.return=ae,gt=Je):Za(L);for(;z!==null;)gt=z,Fc(z),z=z.sibling;gt=L,kr=be,Qi=dt}Qf(f)}else(L.subtreeFlags&8772)!==0&&z!==null?(z.return=L,gt=z):Qf(f)}}function Qf(f){for(;gt!==null;){var h=gt;if((h.flags&8772)!==0){var _=h.alternate;try{if((h.flags&8772)!==0)switch(h.tag){case 0:case 11:case 15:Qi||or(5,h);break;case 1:var C=h.stateNode;if(h.flags&4&&!Qi)if(_===null)C.componentDidMount();else{var L=h.elementType===h.type?_.memoizedProps:Xi(h.type,_.memoizedProps);C.componentDidUpdate(L,_.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var z=h.updateQueue;z!==null&&jp(h,z,C);break;case 3:var ae=h.updateQueue;if(ae!==null){if(_=null,h.child!==null)switch(h.child.tag){case 5:_=se(h.child.stateNode);break;case 1:_=h.child.stateNode}jp(h,ae,_)}break;case 5:var be=h.stateNode;_===null&&h.flags&4&&tt(be,h.type,h.memoizedProps,h);break;case 6:break;case 4:break;case 12:break;case 13:if(Ce&&h.memoizedState===null){var Je=h.alternate;if(Je!==null){var dt=Je.memoizedState;if(dt!==null){var Ct=dt.dehydrated;Ct!==null&&Ue(Ct)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}Qi||h.flags&512&&Fr(h)}catch(en){Nr(h,h.return,en)}}if(h===f){gt=null;break}if(_=h.sibling,_!==null){_.return=h.return,gt=_;break}gt=h.return}}function $f(f){for(;gt!==null;){var h=gt;if(h===f){gt=null;break}var _=h.sibling;if(_!==null){_.return=h.return,gt=_;break}gt=h.return}}function Za(f){for(;gt!==null;){var h=gt;try{switch(h.tag){case 0:case 11:case 15:var _=h.return;try{or(4,h)}catch(Je){Nr(h,_,Je)}break;case 1:var C=h.stateNode;if(typeof C.componentDidMount=="function"){var L=h.return;try{C.componentDidMount()}catch(Je){Nr(h,L,Je)}}var z=h.return;try{Fr(h)}catch(Je){Nr(h,z,Je)}break;case 5:var ae=h.return;try{Fr(h)}catch(Je){Nr(h,ae,Je)}}}catch(Je){Nr(h,h.return,Je)}if(h===f){gt=null;break}var be=h.sibling;if(be!==null){be.return=h.return,gt=be;break}gt=h.return}}var Nc=0,Ja=1,Qa=2,No=3,Bl=4;if(typeof Symbol=="function"&&Symbol.for){var $a=Symbol.for;Nc=$a("selector.component"),Ja=$a("selector.has_pseudo_class"),Qa=$a("selector.role"),No=$a("selector.test_id"),Bl=$a("selector.text")}function Oc(f){var h=Le(f);if(h!=null){if(typeof h.memoizedProps["data-testname"]!="string")throw Error(o(364));return h}if(f=B(f),f===null)throw Error(o(362));return f.stateNode.current}function Bc(f,h){switch(h.$$typeof){case Nc:if(f.type===h.value)return!0;break;case Ja:e:{h=h.value,f=[f,0];for(var _=0;_<f.length;){var C=f[_++],L=f[_++],z=h[L];if(C.tag!==5||!ve(C)){for(;z!=null&&Bc(C,z);)L++,z=h[L];if(L===h.length){h=!0;break e}else for(C=C.child;C!==null;)f.push(C,L),C=C.sibling}}h=!1}return h;case Qa:if(f.tag===5&&we(f.stateNode,h.value))return!0;break;case Bl:if((f.tag===5||f.tag===6)&&(f=ge(f),f!==null&&0<=f.indexOf(h.value)))return!0;break;case No:if(f.tag===5&&(f=f.memoizedProps["data-testname"],typeof f=="string"&&f.toLowerCase()===h.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function _a(f){switch(f.$$typeof){case Nc:return"<"+(N(f.value)||"Unknown")+">";case Ja:return":has("+(_a(f)||"")+")";case Qa:return'[role="'+f.value+'"]';case Bl:return'"'+f.value+'"';case No:return'[data-testname="'+f.value+'"]';default:throw Error(o(365))}}function xs(f,h){var _=[];f=[f,0];for(var C=0;C<f.length;){var L=f[C++],z=f[C++],ae=h[z];if(L.tag!==5||!ve(L)){for(;ae!=null&&Bc(L,ae);)z++,ae=h[z];if(z===h.length)_.push(L);else for(L=L.child;L!==null;)f.push(L,z),L=L.sibling}}return _}function Oo(f,h){if(!Q)throw Error(o(363));f=Oc(f),f=xs(f,h),h=[],f=Array.from(f);for(var _=0;_<f.length;){var C=f[_++];if(C.tag===5)ve(C)||h.push(C.stateNode);else for(C=C.child;C!==null;)f.push(C),C=C.sibling}return h}var eh=Math.ceil,zc=l.ReactCurrentDispatcher,Ys=l.ReactCurrentOwner,Nn=l.ReactCurrentBatchConfig,sn=0,Mi=null,On=null,ei=0,br=0,el=En(0),gi=0,zl=null,uo=0,_s=0,tl=0,Bo=null,Ii=null,Hc=0,Sa=1/0;function nl(){Sa=Wn()+500}var Hl=!1,Zn=null,qs=null,Gl=!1,fo=null,il=0,rl=0,zo=null,qn=-1,vi=0;function Cn(){return(sn&6)!==0?Wn():qn!==-1?qn:qn=Wn()}
vendor: 4,473 bytes, line 3910
3910function Ks(f){return(f.mode&1)===0?1:(sn&2)!==0&&ei!==0?ei&-ei:da.transition!==null?(vi===0&&(f=Ee,Ee<<=1,(Ee&4194240)===0&&(Ee=64),vi=f),vi):(f=Yt,f!==0?f:Ae())}function wr(f,h,_){if(50<rl)throw rl=0,zo=null,Error(o(185));var C=ba(f,h);return C===null?null:(Ir(C,h,_),((sn&2)===0||C!==Mi)&&(C===Mi&&((sn&2)===0&&(_s|=h),gi===4&&lr(C,ei)),es(C,_),h===1&&sn===0&&(f.mode&1)===0&&(nl(),oo&&_r())),C)}function ba(f,h){f.lanes|=h;var _=f.alternate;for(_!==null&&(_.lanes|=h),_=f,f=f.return;f!==null;)f.childLanes|=h,_=f.alternate,_!==null&&(_.childLanes|=h),_=f,f=f.return;return _.tag===3?_.stateNode:null}function es(f,h){var _=f.callbackNode;Qn(f,h);var C=Jt(f,f===Mi?ei:0);if(C===0)_!==null&&gn(_),f.callbackNode=null,f.callbackPriority=0;else if(h=C&-C,f.callbackPriority!==h){if(_!=null&&gn(_),h===1)f.tag===0?ua(Ss.bind(null,f)):ka(Ss.bind(null,f)),Re?He(function(){sn===0&&_r()}):Ln(Gs,_r),_=null;else{switch(An(C)){case 1:_=Gs;break;case 4:_=Hu;break;case 16:_=xr;break;case 536870912:_=aa;break;default:_=xr}_=xd(_,ar.bind(null,f))}f.callbackPriority=h,f.callbackNode=_}}function ar(f,h){if(qn=-1,vi=0,(sn&6)!==0)throw Error(o(327));var _=f.callbackNode;if(ho()&&f.callbackNode!==_)return null;var C=Jt(f,f===Mi?ei:0);if(C===0)return null;if((C&30)!==0||(C&f.expiredLanes)!==0||h)h=Wc(f,C);else{h=C;var L=sn;sn|=2;var z=ih();(Mi!==f||ei!==h)&&(nl(),Ho(f,h));do try{sm();break}catch(be){nh(f,be)}while(!0);Yi(),zc.current=z,sn=L,On!==null?h=0:(Mi=null,ei=0,h=gi)}if(h!==0){if(h===2&&(L=hs(f),L!==0&&(C=L,h=Gc(f,L))),h===1)throw _=zl,Ho(f,0),lr(f,C),es(f,Wn()),_;if(h===6)lr(f,C);else{if(L=f.current.alternate,(C&30)===0&&!th(L)&&(h=Wc(f,C),h===2&&(z=hs(f),z!==0&&(C=z,h=Gc(f,z))),h===1))throw _=zl,Ho(f,0),lr(f,C),es(f,Wn()),_;switch(f.finishedWork=L,f.finishedLanes=C,h){case 0:case 1:throw Error(o(345));case 2:Zs(f,Ii);break;case 3:if(lr(f,C),(C&130023424)===C&&(h=Hc+500-Wn(),10<h)){if(Jt(f,0)!==0)break;if(L=f.suspendedLanes,(L&C)!==C){Cn(),f.pingedLanes|=f.suspendedLanes&L;break}f.timeoutHandle=le(Zs.bind(null,f,Ii),h);break}Zs(f,Ii);break;case 4:if(lr(f,C),(C&4194240)===C)break;for(h=f.eventTimes,L=-1;0<C;){var ae=31-Ni(C);z=1<<ae,ae=h[ae],ae>L&&(L=ae),C&=~z}if(C=L,C=Wn()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*eh(C/1960))-C,10<C){f.timeoutHandle=le(Zs.bind(null,f,Ii),C);break}Zs(f,Ii);break;case 5:Zs(f,Ii);break;default:throw Error(o(329))}}}return es(f,Wn()),f.callbackNode===_?ar.bind(null,f):null}function Gc(f,h){var _=Bo;return f.current.memoizedState.isDehydrated&&(Ho(f,h).flags|=256),f=Wc(f,h),f!==2&&(h=Ii,Ii=_,h!==null&&Vc(h)),f}function Vc(f){Ii===null?Ii=f:Ii.push.apply(Ii,f)}function th(f){for(var h=f;;){if(h.flags&16384){var _=h.updateQueue;if(_!==null&&(_=_.stores,_!==null))for(var C=0;C<_.length;C++){var L=_[C],z=L.getSnapshot;L=L.value;try{if(!ji(z(),L))return!1}catch{return!1}}}if(_=h.child,h.subtreeFlags&16384&&_!==null)_.return=h,h=_;else{if(h===f)break;for(;h.sibling===null;){if(h.return===null||h.return===f)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function lr(f,h){for(h&=~tl,h&=~_s,f.suspendedLanes|=h,f.pingedLanes&=~h,f=f.expirationTimes;0<h;){var _=31-Ni(h),C=1<<_;f[_]=-1,h&=~C}}function Ss(f){if((sn&6)!==0)throw Error(o(327));ho();var h=Jt(f,0);if((h&1)===0)return es(f,Wn()),null;var _=Wc(f,h);if(f.tag!==0&&_===2){var C=hs(f);C!==0&&(h=C,_=Gc(f,C))}if(_===1)throw _=zl,Ho(f,0),lr(f,h),es(f,Wn()),_;if(_===6)throw Error(o(345));return f.finishedWork=f.current.alternate,f.finishedLanes=h,Zs(f,Ii),es(f,Wn()),null}function Vl(f){fo!==null&&fo.tag===0&&(sn&6)===0&&ho();var h=sn;sn|=1;var _=Nn.transition,C=Yt;try{if(Nn.transition=null,Yt=1,f)return f()}finally{Yt=C,Nn.transition=_,sn=h,(sn&6)===0&&_r()}}function jc(){br=el.current,Mt(el)}function Ho(f,h){f.finishedWork=null,f.finishedLanes=0;var _=f.timeoutHandle;if(_!==ze&&(f.timeoutHandle=ze,ye(_)),On!==null)for(_=On.return;_!==null;){var C=_;switch(Pf(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&an();break;case 3:Pl(),Mt(xn),Mt(zt),za();break;case 5:Df(C);break;case 4:Pl();break;case 13:Mt(oi);break;case 19:Mt(oi);break;case 10:Pi(C.type._context);break;case 22:case 23:jc()}_=_.return}if(Mi=f,On=f=Go(f.current,null),ei=br=h,gi=0,zl=null,tl=_s=uo=0,Ii=Bo=null,Lr!==null){for(h=0;h<Lr.length;h++)if(_=Lr[h],C=_.interleaved,C!==null){_.interleaved=null;var L=C.next,z=_.pending;if(z!==null){var ae=z.next;z.next=L,C.next=ae}_.pending=C}Lr=null}return f}function nh(f,h){do{var _=On;
vendor: 4,654 bytes, line 3910
3910try{if(Yi(),bc.current=kl,Qu){for(var C=ai.memoizedState;C!==null;){var L=C.queue;L!==null&&(L.pending=null),C=C.next}Qu=!1}if(Ha=0,Ki=qi=ai=null,ao=!1,Ga=0,Ys.current=null,_===null||_.return===null){gi=1,zl=h,On=null;break}e:{var z=f,ae=_.return,be=_,Je=h;if(h=ei,be.flags|=32768,Je!==null&&typeof Je=="object"&&typeof Je.then=="function"){var dt=Je,Ct=be,en=Ct.tag;if((Ct.mode&1)===0&&(en===0||en===11||en===15)){var Gt=Ct.alternate;Gt?(Ct.updateQueue=Gt.updateQueue,Ct.memoizedState=Gt.memoizedState,Ct.lanes=Gt.lanes):(Ct.updateQueue=null,Ct.memoizedState=null)}var ln=Vf(ae);if(ln!==null){ln.flags&=-257,ja(ln,ae,be,z,h),ln.mode&1&&Io(z,dt,h),h=ln,Je=dt;var Et=h.updateQueue;if(Et===null){var cr=new Set;cr.add(Je),h.updateQueue=cr}else Et.add(Je);break e}else{if((h&1)===0){Io(z,dt,h),yd();break e}Je=Error(o(426))}}else if($n&&be.mode&1){var ws=Vf(ae);if(ws!==null){(ws.flags&65536)===0&&(ws.flags|=256),ja(ws,ae,be,z,h),Ku(Je);break e}}z=Je,gi!==4&&(gi=2),Bo===null?Bo=[z]:Bo.push(z),Je=Gf(Je,be),be=ae;do{switch(be.tag){case 3:be.flags|=65536,h&=-h,be.lanes|=h;var Be=nm(be,Je,h);Vu(be,Be);break e;case 1:z=Je;var Me=be.type,Ye=be.stateNode;if((be.flags&128)===0&&(typeof Me.getDerivedStateFromError=="function"||Ye!==null&&typeof Ye.componentDidCatch=="function"&&(qs===null||!qs.has(Ye)))){be.flags|=65536,h&=-h,be.lanes|=h;var bt=ld(be,z,h);Vu(be,bt);break e}}be=be.return}while(be!==null)}sh(_)}catch(Ut){h=Ut,On===_&&_!==null&&(On=_=_.return);continue}break}while(!0)}function ih(){var f=zc.current;return zc.current=kl,f===null?kl:f}function yd(){(gi===0||gi===3||gi===2)&&(gi=4),Mi===null||(uo&268435455)===0&&(_s&268435455)===0||lr(Mi,ei)}function Wc(f,h){var _=sn;sn|=2;var C=ih();Mi===f&&ei===h||Ho(f,h);do try{rm();break}catch(L){nh(f,L)}while(!0);if(Yi(),sn=_,zc.current=C,On!==null)throw Error(o(261));return Mi=null,ei=0,gi}function rm(){for(;On!==null;)rh(On)}function sm(){for(;On!==null&&!jn();)rh(On)}function rh(f){var h=lh(f.alternate,f,br);f.memoizedProps=f.pendingProps,h===null?sh(f):On=h,Ys.current=null}function sh(f){var h=f;do{var _=h.alternate;if(f=h.return,(h.flags&32768)===0){if(_=dd(_,h,br),_!==null){On=_;return}}else{if(_=pd(_,h),_!==null){_.flags&=32767,On=_;return}if(f!==null)f.flags|=32768,f.subtreeFlags=0,f.deletions=null;else{gi=6,On=null;return}}if(h=h.sibling,h!==null){On=h;return}On=h=f}while(h!==null);gi===0&&(gi=5)}function Zs(f,h){var _=Yt,C=Nn.transition;try{Nn.transition=null,Yt=1,om(f,h,_)}finally{Nn.transition=C,Yt=_}return null}function om(f,h,_){do ho();while(fo!==null);if((sn&6)!==0)throw Error(o(327));var C=f.finishedWork,L=f.finishedLanes;if(C===null)return null;if(f.finishedWork=null,f.finishedLanes=0,C===f.current)throw Error(o(177));f.callbackNode=null,f.callbackPriority=0;var z=C.lanes|C.childLanes;if(Kr(f,z),f===Mi&&(On=Mi=null,ei=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||Gl||(Gl=!0,xd(xr,function(){return ho(),null})),z=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||z){z=Nn.transition,Nn.transition=null;var ae=Yt;Yt=1;var be=sn;sn|=4,Ys.current=null,qf(f,C),xv(f,C),Z(f.containerInfo),f.current=C,kc(C),_o(),sn=be,Yt=ae,Nn.transition=z}else f.current=C;if(Gl&&(Gl=!1,fo=f,il=L),z=f.pendingLanes,z===0&&(qs=null),So(C.stateNode),es(f,Wn()),h!==null)for(_=f.onRecoverableError,C=0;C<h.length;C++)_(h[C]);if(Hl)throw Hl=!1,f=Zn,Zn=null,f;return(il&1)!==0&&f.tag!==0&&ho(),z=f.pendingLanes,(z&1)!==0?f===zo?rl++:(rl=0,zo=f):rl=0,_r(),null}function ho(){if(fo!==null){var f=An(il),h=Nn.transition,_=Yt;try{if(Nn.transition=null,Yt=16>f?16:f,fo===null)var C=!1;else{if(f=fo,fo=null,il=0,(sn&6)!==0)throw Error(o(331));var L=sn;for(sn|=4,gt=f.current;gt!==null;){var z=gt,ae=z.child;if((gt.flags&16)!==0){var be=z.deletions;if(be!==null){for(var Je=0;Je<be.length;Je++){var dt=be[Je];for(gt=dt;gt!==null;){var Ct=gt;switch(Ct.tag){case 0:case 11:case 15:Fo(8,Ct,z)}var en=Ct.child;if(en!==null)en.return=Ct,gt=en;else for(;gt!==null;){Ct=gt;var Gt=Ct.sibling,ln=Ct.return;if(Kf(Ct),Ct===dt){gt=null;break}if(Gt!==null){Gt.return=ln,gt=Gt;break}gt=ln}}}var Et=z.alternate;if(Et!==null){var cr=Et.child;if(cr!==null){Et.child=null;do{var ws=cr.sibling;cr.sibling=null,cr=ws}while(cr!==null)}}gt=z}}if((z.subtreeFlags&2064)!==0&&ae!==null)ae.return=z,gt=ae;else e:for(;gt!==null;){if(z=gt,(z.flags&2048)!==0)switch(z.tag){case 0:case 11:case 15:Fo(9,z,z.return)}var Be=z.sibling;if(Be!==null){Be.return=z.return,gt=Be;break e}gt=z.return}}var Me=f.current;for(gt=Me;gt!==null;){ae=gt;var Ye=ae.child;if((ae.subtreeFlags&2064)!==0&&Ye!==null)Ye.return=ae,gt=Ye;else e:for(ae=Me;gt!==null;){if(be=gt,(be.flags&2048)!==0)try{switch(be.tag){case 0:case 11:case 15:or(9,be)}}
vendor: 4,299 bytes, line 3910
3910catch(Ut){Nr(be,be.return,Ut)}if(be===ae){gt=null;break e}var bt=be.sibling;if(bt!==null){bt.return=be.return,gt=bt;break e}gt=be.return}}if(sn=L,_r(),ps&&typeof ps.onPostCommitFiberRoot=="function")try{ps.onPostCommitFiberRoot(la,f)}catch{}C=!0}return C}finally{Yt=_,Nn.transition=h}}return!1}function Xc(f,h,_){h=Gf(_,h),h=nm(f,h,1),fa(f,h),h=Cn(),f=ba(f,1),f!==null&&(Ir(f,1,h),es(f,h))}function Nr(f,h,_){if(f.tag===3)Xc(f,f,_);else for(;h!==null;){if(h.tag===3){Xc(h,f,_);break}else if(h.tag===1){var C=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(qs===null||!qs.has(C))){f=Gf(_,f),f=ld(h,f,1),fa(h,f),f=Cn(),h=ba(h,1),h!==null&&(Ir(h,1,f),es(h,f));break}}h=h.return}}function oh(f,h,_){var C=f.pingCache;C!==null&&C.delete(h),h=Cn(),f.pingedLanes|=f.suspendedLanes&_,Mi===f&&(ei&_)===_&&(gi===4||gi===3&&(ei&130023424)===ei&&500>Wn()-Hc?Ho(f,0):tl|=_),es(f,h)}function ah(f,h){h===0&&((f.mode&1)===0?h=1:(h=Ze,Ze<<=1,(Ze&130023424)===0&&(Ze=4194304)));var _=Cn();f=ba(f,h),f!==null&&(Ir(f,h,_),es(f,_))}function am(f){var h=f.memoizedState,_=0;h!==null&&(_=h.retryLane),ah(f,_)}function lm(f,h){var _=0;switch(f.tag){case 13:var C=f.stateNode,L=f.memoizedState;L!==null&&(_=L.retryLane);break;case 19:C=f.stateNode;break;default:throw Error(o(314))}C!==null&&C.delete(h),ah(f,_)}var lh;lh=function(f,h,_){if(f!==null)if(f.memoizedProps!==h.pendingProps||xn.current)Ji=!0;else{if((f.lanes&_)===0&&(h.flags&128)===0)return Ji=!1,hd(f,h,_);Ji=(f.flags&131072)!==0}else Ji=!1,$n&&(h.flags&1048576)!==0&&qp(h,Yu,h.index);switch(h.lanes=0,h.tag){case 2:var C=h.type;f!==null&&(f.alternate=null,h.alternate=null,h.flags|=2),f=h.pendingProps;var L=Tn(h,zt.current);bi(h,_),L=Il(null,h,C,f,L,_);var z=ga();return h.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,Hn(C)?(z=!0,Jn(h)):z=!1,h.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,wl(h),L.updater=Wu,h.stateNode=L,L._reactInternals=h,Cf(h,C,f,_),h=Sr(null,h,C,!0,z,_)):(h.tag=0,$n&&z&&Rf(h),mi(null,h,L,_),h=h.child),h;case 16:C=h.elementType;e:{switch(f!==null&&(f.alternate=null,h.alternate=null,h.flags|=2),f=h.pendingProps,L=C._init,C=L(C._payload),h.type=C,L=h.tag=_v(C),f=Xi(C,f),L){case 0:h=Uo(null,h,C,f,_);break e;case 1:h=Xa(null,h,C,f,_);break e;case 11:h=Yn(null,h,C,f,_);break e;case 14:h=Gn(null,h,C,Xi(C.type,f),_);break e}throw Error(o(306,C,""))}return h;case 0:return C=h.type,L=h.pendingProps,L=h.elementType===C?L:Xi(C,L),Uo(f,h,C,L,_);case 1:return C=h.type,L=h.pendingProps,L=h.elementType===C?L:Xi(C,L),Xa(f,h,C,L,_);case 3:e:{if(Ic(h),f===null)throw Error(o(387));C=h.pendingProps,z=h.memoizedState,L=z.element,Ef(f,h),ju(h,C,null,_);var ae=h.memoizedState;if(C=ae.element,Ce&&z.isDehydrated)if(z={element:C,isDehydrated:!1,cache:ae.cache,transitions:ae.transitions},h.updateQueue.baseState=z,h.memoizedState=z,h.flags&256){L=Error(o(423)),h=Wf(f,h,C,_,L);break e}else if(C!==L){L=Error(o(424)),h=Wf(f,h,C,_,L);break e}else for(Ce&&(rr=hi(h.stateNode.containerInfo),Dr=h,$n=!0,Is=null,El=!1),_=Jp(h,null,C,_),h.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(Tl(),C===L){h=$r(f,h,_);break e}mi(f,h,C,_)}h=h.child}return h;case 5:return Qp(h),f===null&&pa(h),C=h.type,L=h.pendingProps,z=f!==null?f.memoizedProps:null,ae=L.children,ie(C,L)?ae=null:z!==null&&ie(C,z)&&(h.flags|=32),Ur(f,h),mi(f,h,ae,_),h.child;case 6:return f===null&&pa(h),null;case 13:return Xf(f,h,_);case 4:return Zu(h,h.stateNode.containerInfo),C=h.pendingProps,f===null?h.child=Ro(h,null,C,_):mi(f,h,C,_),h.child;case 11:return C=h.type,L=h.pendingProps,L=h.elementType===C?L:Xi(C,L),Yn(f,h,C,L,_);case 7:return mi(f,h,h.pendingProps,_),h.child;case 8:return mi(f,h,h.pendingProps.children,_),h.child;case 12:return mi(f,h,h.pendingProps.children,_),h.child;case 10:e:{if(C=h.type._context,L=h.pendingProps,z=h.memoizedProps,ae=L.value,Eo(h,C,ae),z!==null)if(ji(z.value,ae)){if(z.children===L.children&&!xn.current){h=$r(f,h,_);break e}}else for(z=h.child,z!==null&&(z.return=h);z!==null;){var be=z.dependencies;if(be!==null){ae=z.child;for(var Je=be.firstContext;Je!==null;){if(Je.context===C){if(z.tag===1){Je=To(-1,_&-_),Je.tag=2;var dt=z.updateQueue;if(dt!==null){dt=dt.shared;
vendor: 50,926 bytes, lines 3910-3951
3910var Ct=dt.pending;Ct===null?Je.next=Je:(Je.next=Ct.next,Ct.next=Je),dt.pending=Je}}z.lanes|=_,Je=z.alternate,Je!==null&&(Je.lanes|=_),Bi(z.return,_,h),be.lanes|=_;break}Je=Je.next}}else if(z.tag===10)ae=z.type===h.type?null:z.child;else if(z.tag===18){if(ae=z.return,ae===null)throw Error(o(341));ae.lanes|=_,be=ae.alternate,be!==null&&(be.lanes|=_),Bi(ae,_,h),ae=z.sibling}else ae=z.child;if(ae!==null)ae.return=z;else for(ae=z;ae!==null;){if(ae===h){ae=null;break}if(z=ae.sibling,z!==null){z.return=ae.return,ae=z;break}ae=ae.return}z=ae}mi(f,h,L.children,_),h=h.child}return h;case 9:return L=h.type,C=h.pendingProps.children,bi(h,_),L=si(L),C=C(L),h.flags|=1,mi(f,h,C,_),h.child;case 14:return C=h.type,L=Xi(C,h.pendingProps),L=Xi(C.type,L),Gn(f,h,C,L,_);case 15:return Do(f,h,h.type,h.pendingProps,_);case 17:return C=h.type,L=h.pendingProps,L=h.elementType===C?L:Xi(C,L),f!==null&&(f.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,Hn(C)?(f=!0,Jn(h)):f=!1,bi(h,_),Xp(h,C,L),Cf(h,C,L,_),Sr(null,h,C,!0,f,_);case 19:return qa(f,h,_);case 22:return sr(f,h,_)}throw Error(o(156,h.tag))};function xd(f,h){return Ln(f,h)}function cm(f,h,_,C){this.tag=f,this.key=_,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bs(f,h,_,C){return new cm(f,h,_,C)}function _d(f){return f=f.prototype,!(!f||!f.isReactComponent)}function _v(f){if(typeof f=="function")return _d(f)?1:0;if(f!=null){if(f=f.$$typeof,f===M)return 11;if(f===A)return 14}return 2}function Go(f,h){var _=f.alternate;return _===null?(_=bs(f.tag,h,f.key,f.mode),_.elementType=f.elementType,_.type=f.type,_.stateNode=f.stateNode,_.alternate=f,f.alternate=_):(_.pendingProps=h,_.type=f.type,_.flags=0,_.subtreeFlags=0,_.deletions=null),_.flags=f.flags&14680064,_.childLanes=f.childLanes,_.lanes=f.lanes,_.child=f.child,_.memoizedProps=f.memoizedProps,_.memoizedState=f.memoizedState,_.updateQueue=f.updateQueue,h=f.dependencies,_.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},_.sibling=f.sibling,_.index=f.index,_.ref=f.ref,_}function Sd(f,h,_,C,L,z){var ae=2;if(C=f,typeof f=="function")_d(f)&&(ae=1);else if(typeof f=="string")ae=5;else e:switch(f){case p:return sl(_.children,L,z,h);case m:ae=8,L|=8;break;case v:return f=bs(12,_,h,L|2),f.elementType=v,f.lanes=z,f;case S:return f=bs(13,_,h,L),f.elementType=S,f.lanes=z,f;case w:return f=bs(19,_,h,L),f.elementType=w,f.lanes=z,f;case R:return Yc(_,L,z,h);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case y:ae=10;break e;case x:ae=9;break e;case M:ae=11;break e;case A:ae=14;break e;case T:ae=16,C=null;break e}throw Error(o(130,f==null?f:typeof f,""))}return h=bs(ae,_,h,L),h.elementType=f,h.type=C,h.lanes=z,h}function sl(f,h,_,C){return f=bs(7,f,C,h),f.lanes=_,f}function Yc(f,h,_,C){return f=bs(22,f,C,h),f.elementType=R,f.lanes=_,f.stateNode={},f}function bd(f,h,_){return f=bs(6,f,null,h),f.lanes=_,f}function wd(f,h,_){return h=bs(4,f.children!==null?f.children:[],f.key,h),h.lanes=_,h.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},h}function Md(f,h,_,C,L){this.tag=h,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ze,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=so(0),this.expirationTimes=so(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=so(0),this.identifierPrefix=C,this.onRecoverableError=L,Ce&&(this.mutableSourceEagerHydrationData=null)}function um(f,h,_,C,L,z,ae,be,Je){return f=new Md(f,h,_,be,Je),h===1?(h=1,z===!0&&(h|=8)):h=0,z=bs(3,null,null,h),f.current=z,z.stateNode=f,z.memoizedState={element:C,isDehydrated:_,cache:null,transitions:null},wl(z),f}function dm(f){if(!f)return Qt;f=f._reactInternals;e:{if(F(f)!==f||f.tag!==1)throw Error(o(170));var h=f;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(Hn(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(o(171))}if(f.tag===1){var _=f.type;if(Hn(_))return fs(f,_,h)}return h}function fm(f){var h=f._reactInternals;if(h===void 0)throw typeof f.render=="function"?Error(o(188)):(f=Object.keys(f).join(","),Error(o(268,f)));return f=W(h),f===null?null:f.stateNode}function Us(f,h){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var _=f.retryLane;f.retryLane=_!==0&&_<h?_:h}}function qc(f,h){Us(f,h),(f=f.alternate)&&Us(f,h)}function Ed(f){return f=W(f),f===null?null:f.stateNode}function hm(){return null}return t.attemptContinuousHydration=function(f){if(f.tag===13){var h=Cn();wr(f,134217728,h),qc(f,134217728)}},t.attemptHydrationAtCurrentPriority=function(f){if(f.tag===13){var h=Cn(),_=Ks(f);wr(f,_,h),qc(f,_)}},t.attemptSynchronousHydration=function(f){switch(f.tag){case 3:var h=f.stateNode;if(h.current.memoizedState.isDehydrated){var _=Ht(h.pendingLanes);_!==0&&(Ri(h,_|1),es(h,Wn()),(sn&6)===0&&(nl(),_r()))}break;case 13:var C=Cn();Vl(function(){return wr(f,1,C)}),qc(f,1)}},t.batchedUpdates=function(f,h){var _=sn;sn|=1;try{return f(h)}finally{sn=_,sn===0&&(nl(),oo&&_r())}},t.createComponentSelector=function(f){return{$$typeof:Nc,value:f}},t.createContainer=function(f,h,_,C,L,z,ae){return um(f,h,!1,null,_,C,L,z,ae)},t.createHasPseudoClassSelector=function(f){return{$$typeof:Ja,value:f}},t.createHydrationContainer=function(f,h,_,C,L,z,ae,be,Je){return f=um(_,C,!0,f,L,z,ae,be,Je),f.context=dm(null),_=f.current,C=Cn(),L=Ks(_),z=To(C,L),z.callback=h??null,fa(_,z),f.current.lanes=L,Ir(f,L,C),es(f,C),f},t.createPortal=function(f,h,_){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:C==null?null:""+C,children:f,containerInfo:h,implementation:_}},t.createRoleSelector=function(f){return{$$typeof:Qa,value:f}},t.createTestNameSelector=function(f){return{$$typeof:No,value:f}},t.createTextSelector=function(f){return{$$typeof:Bl,value:f}},t.deferredUpdates=function(f){var h=Yt,_=Nn.transition;try{return Nn.transition=null,Yt=16,f()}finally{Yt=h,Nn.transition=_}},t.discreteUpdates=function(f,h,_,C,L){var z=Yt,ae=Nn.transition;try{return Nn.transition=null,Yt=1,f(h,_,C,L)}finally{Yt=z,Nn.transition=ae,sn===0&&nl()}},t.findAllNodes=Oo,t.findBoundingRects=function(f,h){if(!Q)throw Error(o(363));h=Oo(f,h),f=[];for(var _=0;_<h.length;_++)f.push(pe(h[_]));for(h=f.length-1;0<h;h--){_=f[h];for(var C=_.x,L=C+_.width,z=_.y,ae=z+_.height,be=h-1;0<=be;be--)if(h!==be){var Je=f[be],dt=Je.x,Ct=dt+Je.width,en=Je.y,Gt=en+Je.height;if(C>=dt&&z>=en&&L<=Ct&&ae<=Gt){f.splice(h,1);break}else if(C!==dt||_.width!==Je.width||Gt<z||en>ae){if(!(z!==en||_.height!==Je.height||Ct<C||dt>L)){dt>C&&(Je.width+=dt-C,Je.x=C),Ct<L&&(Je.width=L-dt),f.splice(h,1);break}}else{en>z&&(Je.height+=en-z,Je.y=z),Gt<ae&&(Je.height=ae-en),f.splice(h,1);break}}}return f},t.findHostInstance=fm,t.findHostInstanceWithNoPortals=function(f){return f=G(f),f=f!==null?J(f):null,f===null?null:f.stateNode},t.findHostInstanceWithWarning=function(f){return fm(f)},t.flushControlled=function(f){var h=sn;sn|=1;var _=Nn.transition,C=Yt;try{Nn.transition=null,Yt=1,f()}finally{Yt=C,Nn.transition=_,sn=h,sn===0&&(nl(),_r())}},t.flushPassiveEffects=ho,t.flushSync=Vl,t.focusWithin=function(f,h){if(!Q)throw Error(o(363));for(f=Oc(f),h=xs(f,h),h=Array.from(h),f=0;f<h.length;){var _=h[f++];if(!ve(_)){if(_.tag===5&&ut(_.stateNode))return!0;for(_=_.child;_!==null;)h.push(_),_=_.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Yt},t.getFindAllNodesFailureDescription=function(f,h){if(!Q)throw Error(o(363));var _=0,C=[];f=[Oc(f),0];for(var L=0;L<f.length;){var z=f[L++],ae=f[L++],be=h[ae];if((z.tag!==5||!ve(z))&&(Bc(z,be)&&(C.push(_a(be)),ae++,ae>_&&(_=ae)),ae<h.length))for(z=z.child;z!==null;)f.push(z,ae),z=z.sibling}if(_<h.length){for(f=[];_<h.length;_++)f.push(_a(h[_]));return`findAllNodes was able to match part of the selector: 3911 `+(C.join(" > ")+` 3912 3913No matching component was found for: 3914 `)+f.join(" > ")}return null},t.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return se(f.child.stateNode);default:return f.child.stateNode}},t.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:Ed,findFiberByHostInstance:f.findFiberByHostInstance||hm,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)f=!0;else{try{la=h.inject(f),ps=h}catch{}f=!!h.checkDCE}}return f},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(f,h,_,C){if(!Q)throw Error(o(363));f=Oo(f,h);var L=Oe(f,_,C).disconnect;return{disconnect:function(){L()}}},t.registerMutableSourceForHydration=function(f,h){var _=h._getVersion;_=_(h._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[h,_]:f.mutableSourceEagerHydrationData.push(h,_)},t.runWithPriority=function(f,h){var _=Yt;try{return Yt=f,h()}finally{Yt=_}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(f,h,_,C){var L=h.current,z=Cn(),ae=Ks(L);return _=dm(_),h.context===null?h.context=_:h.pendingContext=_,h=To(z,ae),h.payload={element:f},C=C===void 0?null:C,C!==null&&(h.callback=C),fa(L,h),f=wr(L,ae,z),f!==null&&Gu(f,L,ae),ae},t}),zy}var Eb;function pD(){return Eb||(Eb=1,Ny.exports=hD()),Ny.exports}var mD=pD();const gD=Aw(mD);var Tb=E2();const k1={},vD=r=>void Object.assign(k1,r);function yD(r,e){function t(p,{args:m=[],attach:v,...y},x){let M=`${p[0].toUpperCase()}${p.slice(1)}`,S;if(p==="primitive"){if(y.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const w=y.object;S=nf(w,{type:p,root:x,attach:v,primitive:!0})}else{const w=k1[M];if(!w)throw new Error(`R3F: ${M} 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(m))throw new Error("R3F: The args prop must be an array!");S=nf(new w(...m),{type:p,root:x,attach:v,memoizedProps:{args:m}})}return S.__r3f.attach===void 0&&(S.isBufferGeometry?S.__r3f.attach="geometry":S.isMaterial&&(S.__r3f.attach="material")),M!=="inject"&&Vy(S,y),S}function n(p,m){let v=!1;if(m){var y,x;(y=m.__r3f)!=null&&y.attach?Gy(p,m,m.__r3f.attach):m.isObject3D&&p.isObject3D&&(p.add(m),v=!0),v||(x=p.__r3f)==null||x.objects.push(m),m.__r3f||nf(m,{}),m.__r3f.parent=p,Ax(m),rf(m)}}function i(p,m,v){let y=!1;if(m){var x,M;if((x=m.__r3f)!=null&&x.attach)Gy(p,m,m.__r3f.attach);else if(m.isObject3D&&p.isObject3D){m.parent=p,m.dispatchEvent({type:"added"}),p.dispatchEvent({type:"childadded",child:m});const S=p.children.filter(A=>A!==m),w=S.indexOf(v);p.children=[...S.slice(0,w),m,...S.slice(w)],y=!0}y||(M=p.__r3f)==null||M.objects.push(m),m.__r3f||nf(m,{}),m.__r3f.parent=p,Ax(m),rf(m)}}function s(p,m,v=!1){p&&[...p].forEach(y=>o(m,y,v))}function o(p,m,v){if(m){var y,x,M;if(m.__r3f&&(m.__r3f.parent=null),(y=p.__r3f)!=null&&y.objects&&(p.__r3f.objects=p.__r3f.objects.filter(R=>R!==m)),(x=m.__r3f)!=null&&x.attach)Ib(p,m,m.__r3f.attach);else if(m.isObject3D&&p.isObject3D){var S;p.remove(m),(S=m.__r3f)!=null&&S.root&&ED(Vg(m),m)}const A=(M=m.__r3f)==null?void 0:M.primitive,T=!A&&(v===void 0?m.dispose!==null:v);if(!A){var w;s((w=m.__r3f)==null?void 0:w.objects,m,T),s(m.children,m,T)}if(delete m.__r3f,T&&m.dispose&&m.type!=="Scene"){const R=()=>{try{m.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?Tb.unstable_scheduleCallback(Tb.unstable_IdlePriority,R):R()}rf(p)}}function l(p,m,v,y){var x;const M=(x=p.__r3f)==null?void 0:x.parent;if(!M)return;const S=t(m,v,p.__r3f.root);if(p.children){for(const w of p.children)w.__r3f&&n(S,w);p.children=p.children.filter(w=>!w.__r3f)}p.__r3f.objects.forEach(w=>n(S,w)),p.__r3f.objects=[],p.__r3f.autoRemovedBeforeAppend||o(M,p),S.parent&&(S.__r3f.autoRemovedBeforeAppend=!0),n(M,S),S.raycast&&S.__r3f.eventCount&&Vg(S).getState().internal.interaction.push(S),[y,y.alternate].forEach(w=>{w!==null&&(w.stateNode=S,w.ref&&(typeof w.ref=="function"?w.ref(S):w.ref.current=S))})}const u=()=>{};return{reconciler:gD({createInstance:t,removeChild:o,appendChild:n,appendInitialChild:n,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(p,m)=>{if(!m)return;const v=p.getState().scene;v.__r3f&&(v.__r3f.root=p,n(v,m))},removeChildFromContainer:(p,m)=>{m&&o(p.getState().scene,m)},insertInContainerBefore:(p,m,v)=>{if(!m||!v)return;const y=p.getState().scene;y.__r3f&&i(y,m,v)},getRootHostContext:()=>null,getChildHostContext:p=>p,finalizeInitialChildren(p){var m;return!!((m=p==null?void 0:p.__r3f)!=null?m:{}).handlers},prepareUpdate(p,m,v,y){var x;if(((x=p==null?void 0:p.__r3f)!=null?x:{}).primitive&&y.object&&y.object!==p)return[!0];{const{args:S=[],children:w,...A}=y,{args:T=[],children:R,...U}=v;if(!Array.isArray(S))throw new Error("R3F: the args prop must be an array!");if(S.some((N,H)=>N!==T[H]))return[!0];const k=L2(p,A,U,!0);return k.changes.length?[!1,k]:null}},commitUpdate(p,[m,v],y,x,M,S){m?l(p,y,M,S):Vy(p,v)},commitMount(p,m,v,y){var x;const M=(x=p.__r3f)!=null?x:{};p.raycast&&M.handlers&&M.eventCount&&Vg(p).getState().internal.interaction.push(p)},getPublicInstance:p=>p,prepareForCommit:()=>null,preparePortalMount:p=>nf(p.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(p){var m;const{attach:v,parent:y}=(m=p.__r3f)!=null?m:{};v&&y&&Ib(y,p,v),p.isObject3D&&(p.visible=!1),rf(p)},unhideInstance(p,m){var v;const{attach:y,parent:x}=(v=p.__r3f)!=null?v:{};y&&x&&Gy(x,p,y),(p.isObject3D&&m.visible==null||m.visible)&&(p.visible=!0),rf(p)},createTextInstance:u,hideTextInstance:u,unhideTextInstance:u,getCurrentEventPriority:()=>e?e():df.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&li.fun(performance.now)?performance.now:li.fun(Date.now)?Date.now:()=>0,scheduleTimeout:li.fun(setTimeout)?setTimeout:void 0,cancelTimeout:li.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Vy}}var Ab,Cb;const Hy=r=>"colorSpace"in r||"outputColorSpace"in r,T2=()=>{var r;return(r=k1.ColorManagement)!=null?r:null},A2=r=>r&&r.isOrthographicCamera,xD=r=>r&&r.hasOwnProperty("current"),Fp=typeof window<"u"&&((Ab=window.document)!=null&&Ab.createElement||((Cb=window.navigator)==null?void 0:Cb.product)==="ReactNative")?K.useLayoutEffect:K.useEffect;function C2(r){const e=K.useRef(r);return Fp(()=>void(e.current=r),[r]),e}function _D({set:r}){return Fp(()=>(r(new Promise(()=>null)),()=>r(!1)),[r]),null}class R2 extends K.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}R2.getDerivedStateFromError=()=>({error:!0});const P2="__default",Rb=new Map,SD=r=>r&&!!r.memoized&&!!r.changes;function I2(r){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(r)?Math.min(Math.max(r[0],t),r[1]):r}const Ph=r=>{var e;return(e=r.__r3f)==null?void 0:e.root.getState()};function Vg(r){let e=r.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const li={obj:r=>r===Object(r)&&!li.arr(r)&&typeof r!="function",fun:r=>typeof r=="function",str:r=>typeof r=="string",num:r=>typeof r=="number",boo:r=>typeof r=="boolean",und:r=>r===void 0,arr:r=>Array.isArray(r),equ(r,e,{arrays:t="shallow",objects:n="reference",strict:i=!0}={}){if(typeof r!=typeof e||!!r!=!!e)return!1;if(li.str(r)||li.num(r)||li.boo(r))return r===e;const s=li.obj(r);if(s&&n==="reference")return r===e;const o=li.arr(r);if(o&&t==="reference")return r===e;if((o||s)&&r===e)return!0;let l;for(l in r)if(!(l in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(l in i?e:r)if(!li.equ(r[l],e[l],{strict:i,objects:"reference"}))return!1}else for(l in i?e:r)if(r[l]!==e[l])return!1;if(li.und(l)){if(o&&r.length===0&&e.length===0||s&&Object.keys(r).length===0&&Object.keys(e).length===0)return!0;if(r!==e)return!1}return!0}};function bD(r){r.dispose&&r.type!=="Scene"&&r.dispose();for(const e in r)e.dispose==null||e.dispose(),delete r[e]}function nf(r,e){const t=r;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},r}function Tx(r,e){let t=r;if(e.includes("-")){const n=e.split("-"),i=n.pop();return t=n.reduce((s,o)=>s[o],r),{target:t,key:i}}else return{target:t,key:e}}const Pb=/-\d+$/;function Gy(r,e,t){if(li.str(t)){if(Pb.test(t)){const s=t.replace(Pb,""),{target:o,key:l}=Tx(r,s);Array.isArray(o[l])||(o[l]=[])}const{target:n,key:i}=Tx(r,t);e.__r3f.previousAttach=n[i],n[i]=e}else e.__r3f.previousAttach=t(r,e)}function Ib(r,e,t){var n,i;if(li.str(t)){const{target:s,key:o}=Tx(r,t),l=e.__r3f.previousAttach;l===void 0?delete s[o]:s[o]=l}else(n=e.__r3f)==null||n.previousAttach==null||n.previousAttach(r,e);(i=e.__r3f)==null||delete i.previousAttach}function L2(r,{children:e,key:t,ref:n,...i},{children:s,key:o,ref:l,...u}={},d=!1){const p=r.__r3f,m=Object.entries(i),v=[];if(d){const x=Object.keys(u);for(let M=0;M<x.length;M++)i.hasOwnProperty(x[M])||m.unshift([x[M],P2+"remove"])}m.forEach(([x,M])=>{var S;if((S=r.__r3f)!=null&&S.primitive&&x==="object"||li.equ(M,u[x]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(x))return v.push([x,M,!0,[]]);let w=[];x.includes("-")&&(w=x.split("-")),v.push([x,M,!1,w]);for(const A in i){const T=i[A];A.startsWith(`${x}-`)&&v.push([A,T,!1,A.split("-")])}});const y={...i};return p!=null&&p.memoizedProps&&p!=null&&p.memoizedProps.args&&(y.args=p.memoizedProps.args),p!=null&&p.memoizedProps&&p!=null&&p.memoizedProps.attach&&(y.attach=p.memoizedProps.attach),{memoized:y,changes:v}}function Vy(r,e){var t;const n=r.__r3f,i=n==null?void 0:n.root,s=i==null||i.getState==null?void 0:i.getState(),{memoized:o,changes:l}=SD(e)?e:L2(r,e),u=n==null?void 0:n.eventCount;r.__r3f&&(r.__r3f.memoizedProps=o);for(let v=0;v<l.length;v++){let[y,x,M,S]=l[v];if(Hy(r)){const R="srgb",U="srgb-linear";y==="encoding"?(y="colorSpace",x=x===3001?R:U):y==="outputEncoding"&&(y="outputColorSpace",x=x===3001?R:U)}let w=r,A=w[y];if(S.length&&(A=S.reduce((T,R)=>T[R],r),!(A&&A.set))){const[T,...R]=S.reverse();w=R.reverse().reduce((U,k)=>U[k],r),y=T}if(x===P2+"remove")if(w.constructor){let T=Rb.get(w.constructor);T||(T=new w.constructor,Rb.set(w.constructor,T)),x=T[y]}else x=0;if(M&&n)x?n.handlers[y]=x:delete n.handlers[y],n.eventCount=Object.keys(n.handlers).length;else if(A&&A.set&&(A.copy||A instanceof Tu)){if(Array.isArray(x))A.fromArray?A.fromArray(x):A.set(...x);else if(A.copy&&x&&x.constructor&&A.constructor===x.constructor)A.copy(x);else if(x!==void 0){var d;const T=(d=A)==null?void 0:d.isColor;!T&&A.setScalar?A.setScalar(x):A instanceof Tu&&x instanceof Tu?A.mask=x.mask:A.set(x),!T2()&&s&&!s.linear&&T&&A.convertSRGBToLinear()}}else{var p;if(w[y]=x,(p=w[y])!=null&&p.isTexture&&w[y].format===ls&&w[y].type===pr&&s){const T=w[y];Hy(T)&&Hy(s.gl)?T.colorSpace=s.gl.outputColorSpace:T.encoding=s.gl.outputEncoding}}rf(r)}if(n&&n.parent&&r.raycast&&u!==n.eventCount){const v=Vg(r).getState().internal,y=v.interaction.indexOf(r);y>-1&&v.interaction.splice(y,1),n.eventCount&&v.interaction.push(r)}return!(l.length===1&&l[0][0]==="onUpdate")&&l.length&&(t=r.__r3f)!=null&&t.parent&&Ax(r),r}function rf(r){var e,t;const n=(e=r.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();n&&n.internal.frames===0&&n.invalidate()}function Ax(r){r.onUpdate==null||r.onUpdate(r)}function wD(r,e){r.manual||(A2(r)?(r.left=e.width/-2,r.right=e.width/2,r.top=e.height/2,r.bottom=e.height/-2):r.aspect=e.width/e.height,r.updateProjectionMatrix(),r.updateMatrixWorld())}function Cg(r){return(r.eventObject||r.object).uuid+"/"+r.index+r.instanceId}function MD(){var r;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return df.DefaultEventPriority;switch((r=e.event)==null?void 0:r.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return df.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return df.ContinuousEventPriority;default:return df.DefaultEventPriority}}function D2(r,e,t,n){const i=t.get(e);i&&(t.delete(e),t.size===0&&(r.delete(n),i.target.releasePointerCapture(n)))}function ED(r,e){const{internal:t}=r.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,i)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((n,i)=>{D2(t.capturedMap,e,n,i)})}function TD(r){function e(u){const{internal:d}=r.getState(),p=u.offsetX-d.initialClick[0],m=u.offsetY-d.initialClick[1];return Math.round(Math.sqrt(p*p+m*m))}function t(u){return u.filter(d=>["Move","Over","Enter","Out","Leave"].some(p=>{var m;return(m=d.__r3f)==null?void 0:m.handlers["onPointer"+p]}))}function n(u,d){const p=r.getState(),m=new Set,v=[],y=d?d(p.internal.interaction):p.internal.interaction;for(let w=0;w<y.length;w++){const A=Ph(y[w]);A&&(A.raycaster.camera=void 0)}p.previousRoot||p.events.compute==null||p.events.compute(u,p);function x(w){const A=Ph(w);if(!A||!A.events.enabled||A.raycaster.camera===null)return[];if(A.raycaster.camera===void 0){var T;A.events.compute==null||A.events.compute(u,A,(T=A.previousRoot)==null?void 0:T.getState()),A.raycaster.camera===void 0&&(A.raycaster.camera=null)}return A.raycaster.camera?A.raycaster.intersectObject(w,!0):[]}let M=y.flatMap(x).sort((w,A)=>{const T=Ph(w.object),R=Ph(A.object);return!T||!R?w.distance-A.distance:R.events.priority-T.events.priority||w.distance-A.distance}).filter(w=>{const A=Cg(w);return m.has(A)?!1:(m.add(A),!0)});p.events.filter&&(M=p.events.filter(M,p));for(const w of M){let A=w.object;for(;A;){var S;(S=A.__r3f)!=null&&S.eventCount&&v.push({...w,eventObject:A}),A=A.parent}}if("pointerId"in u&&p.internal.capturedMap.has(u.pointerId))for(let w of p.internal.capturedMap.get(u.pointerId).values())m.has(Cg(w.intersection))||v.push(w.intersection);return v}function i(u,d,p,m){const v=r.getState();if(u.length){const y={stopped:!1};for(const x of u){const M=Ph(x.object)||v,{raycaster:S,pointer:w,camera:A,internal:T}=M,R=new te(w.x,w.y,0).unproject(A),U=I=>{var G,W;return(G=(W=T.capturedMap.get(I))==null?void 0:W.has(x.eventObject))!=null?G:!1},k=I=>{const G={intersection:x,target:d.target};T.capturedMap.has(I)?T.capturedMap.get(I).set(x.eventObject,G):T.capturedMap.set(I,new Map([[x.eventObject,G]])),d.target.setPointerCapture(I)},N=I=>{const G=T.capturedMap.get(I);G&&D2(T.capturedMap,x.eventObject,G,I)};let H={};for(let I in d){let G=d[I];typeof G!="function"&&(H[I]=G)}let F={...x,...H,pointer:w,intersections:u,stopped:y.stopped,delta:p,unprojectedPoint:R,ray:S.ray,camera:A,stopPropagation(){const I="pointerId"in d&&T.capturedMap.get(d.pointerId);if((!I||I.has(x.eventObject))&&(F.stopped=y.stopped=!0,T.hovered.size&&Array.from(T.hovered.values()).find(G=>G.eventObject===x.eventObject))){const G=u.slice(0,u.indexOf(x));s([...G,x])}},target:{hasPointerCapture:U,setPointerCapture:k,releasePointerCapture:N},currentTarget:{hasPointerCapture:U,setPointerCapture:k,releasePointerCapture:N},nativeEvent:d};if(m(F),y.stopped===!0)break}}return u}function s(u){const{internal:d}=r.getState();for(const p of d.hovered.values())if(!u.length||!u.find(m=>m.object===p.object&&m.index===p.index&&m.instanceId===p.instanceId)){const v=p.eventObject.__r3f,y=v==null?void 0:v.handlers;if(d.hovered.delete(Cg(p)),v!=null&&v.eventCount){const x={...p,intersections:u};y.onPointerOut==null||y.onPointerOut(x),y.onPointerLeave==null||y.onPointerLeave(x)}}}function o(u,d){for(let p=0;p<d.length;p++){const m=d[p].__r3f;m==null||m.handlers.onPointerMissed==null||m.handlers.onPointerMissed(u)}}function l(u){switch(u){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return d=>{const{internal:p}=r.getState();"pointerId"in d&&p.capturedMap.has(d.pointerId)&&requestAnimationFrame(()=>{p.capturedMap.has(d.pointerId)&&(p.capturedMap.delete(d.pointerId),s([]))})}}return function(p){const{onPointerMissed:m,internal:v}=r.getState();v.lastEvent.current=p;const y=u==="onPointerMove",x=u==="onClick"||u==="onContextMenu"||u==="onDoubleClick",S=n(p,y?t:void 0),w=x?e(p):0;u==="onPointerDown"&&(v.initialClick=[p.offsetX,p.offsetY],v.initialHits=S.map(T=>T.eventObject)),x&&!S.length&&w<=2&&(o(p,v.interaction),m&&m(p)),y&&s(S);function A(T){const R=T.eventObject,U=R.__r3f,k=U==null?void 0:U.handlers;if(U!=null&&U.eventCount)if(y){if(k.onPointerOver||k.onPointerEnter||k.onPointerOut||k.onPointerLeave){const N=Cg(T),H=v.hovered.get(N);H?H.stopped&&T.stopPropagation():(v.hovered.set(N,T),k.onPointerOver==null||k.onPointerOver(T),k.onPointerEnter==null||k.onPointerEnter(T))}k.onPointerMove==null||k.onPointerMove(T)}else{const N=k[u];N?(!x||v.initialHits.includes(R))&&(o(p,v.interaction.filter(H=>!v.initialHits.includes(H))),N(T)):x&&v.initialHits.includes(R)&&o(p,v.interaction.filter(H=>!v.initialHits.includes(H)))}}i(S,p,w,A)}}return{handlePointer:l}}const U2=r=>!!(r!=null&&r.render),k2=K.createContext(null),AD=(r,e)=>{const t=aD((l,u)=>{const d=new te,p=new te,m=new te;function v(w=u().camera,A=p,T=u().size){const{width:R,height:U,top:k,left:N}=T,H=R/U;A.isVector3?m.copy(A):m.set(...A);const F=w.getWorldPosition(d).distanceTo(m);if(A2(w))return{width:R/w.zoom,height:U/w.zoom,top:k,left:N,factor:1,distance:F,aspect:H};{const I=w.fov*Math.PI/180,G=2*Math.tan(I/2)*F,W=G*(R/U);return{width:W,height:G,top:k,left:N,factor:R/W,distance:F,aspect:H}}}let y;const x=w=>l(A=>({performance:{...A.performance,current:w}})),M=new We;return{set:l,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(w=1)=>r(u(),w),advance:(w,A)=>e(w,A,u()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new I1,pointer:M,mouse:M,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const w=u();y&&clearTimeout(y),w.performance.current!==w.performance.min&&x(w.performance.min),y=setTimeout(()=>x(u().performance.max),w.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:v},setEvents:w=>l(A=>({...A,events:{...A.events,...w}})),setSize:(w,A,T,R,U)=>{const k=u().camera,N={width:w,height:A,top:R||0,left:U||0,updateStyle:T};l(H=>({size:N,viewport:{...H.viewport,...v(k,p,N)}}))},setDpr:w=>l(A=>{const T=I2(w);return{viewport:{...A.viewport,dpr:T,initialDpr:A.viewport.initialDpr||T}}}),setFrameloop:(w="always")=>{const A=u().clock;A.stop(),A.elapsedTime=0,w!=="never"&&(A.start(),A.elapsedTime=0),l(()=>({frameloop:w}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:K.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(w,A,T)=>{const R=u().internal;return R.priority=R.priority+(A>0?1:0),R.subscribers.push({ref:w,priority:A,store:T}),R.subscribers=R.subscribers.sort((U,k)=>U.priority-k.priority),()=>{const U=u().internal;U!=null&&U.subscribers&&(U.priority=U.priority-(A>0?1:0),U.subscribers=U.subscribers.filter(k=>k.ref!==w))}}}}}),n=t.getState();let i=n.size,s=n.viewport.dpr,o=n.camera;return t.subscribe(()=>{const{camera:l,size:u,viewport:d,gl:p,set:m}=t.getState();if(u.width!==i.width||u.height!==i.height||d.dpr!==s){var v;i=u,s=d.dpr,wD(l,u),p.setPixelRatio(d.dpr);const y=(v=u.updateStyle)!=null?v:typeof HTMLCanvasElement<"u"&&p.domElement instanceof HTMLCanvasElement;p.setSize(u.width,u.height,y)}l!==o&&(o=l,m(y=>({viewport:{...y.viewport,...y.viewport.getCurrentViewport(l)}})))}),t.subscribe(l=>r(l)),t};let Rg,CD=new Set,RD=new Set,PD=new Set;function jy(r,e){if(r.size)for(const{callback:t}of r.values())t(e)}function Ih(r,e){switch(r){case"before":return jy(CD,e);case"after":return jy(RD,e);case"tail":return jy(PD,e)}}let Wy,Xy;function Yy(r,e,t){let n=e.clock.getDelta();for(e.frameloop==="never"&&typeof r=="number"&&(n=r-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=r),Wy=e.internal.subscribers,Rg=0;Rg<Wy.length;Rg++)Xy=Wy[Rg],Xy.ref.current(Xy.store.getState(),n,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 ID(r){let e=!1,t=!1,n,i,s;function o(d){i=requestAnimationFrame(o),e=!0,n=0,Ih("before",d),t=!0;for(const m of r.values()){var p;s=m.store.getState(),s.internal.active&&(s.frameloop==="always"||s.internal.frames>0)&&!((p=s.gl.xr)!=null&&p.isPresenting)&&(n+=Yy(d,s))}if(t=!1,Ih("after",d),n===0)return Ih("tail",d),e=!1,cancelAnimationFrame(i)}function l(d,p=1){var m;if(!d)return r.forEach(v=>l(v.store.getState(),p));(m=d.gl.xr)!=null&&m.isPresenting||!d.internal.active||d.frameloop==="never"||(p>1?d.internal.frames=Math.min(60,d.internal.frames+p):t?d.internal.frames=2:d.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function u(d,p=!0,m,v){if(p&&Ih("before",d),m)Yy(d,m,v);else for(const y of r.values())Yy(d,y.store.getState());p&&Ih("after",d)}return{loop:o,invalidate:l,advance:u}}function F2(){const r=K.useContext(k2);if(!r)throw new Error("R3F: Hooks can only be used within the Canvas component!");return r}function Bs(r=t=>t,e){return F2()(r,e)}function us(r,e=0){const t=F2(),n=t.getState().internal.subscribe,i=C2(r);return Fp(()=>n(i,e,t),[e,n,t]),null}const yf=new Map,{invalidate:Lb,advance:Db}=ID(yf),{reconciler:T0,applyProps:Jd}=yD(yf,MD),Qd={objects:"shallow",strict:!1},LD=(r,e)=>{const t=typeof r=="function"?r(e):r;return U2(t)?t:new DM({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...r})};function DD(r,e){const t=typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement;if(e){const{width:n,height:i,top:s,left:o,updateStyle:l=t}=e;return{width:n,height:i,top:s,left:o,updateStyle:l}}else if(typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&r.parentElement){const{width:n,height:i,top:s,left:o}=r.parentElement.getBoundingClientRect();return{width:n,height:i,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas)return{width:r.width,height:r.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function UD(r){const e=yf.get(r),t=e==null?void 0:e.fiber,n=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=n||AD(Lb,Db),o=t||T0.createContainer(s,df.ConcurrentRoot,null,!1,null,"",i,null);e||yf.set(r,{fiber:o,store:s});let l,u=!1,d;return{configure(p={}){let{gl:m,size:v,scene:y,events:x,onCreated:M,shadows:S=!1,linear:w=!1,flat:A=!1,legacy:T=!1,orthographic:R=!1,frameloop:U="always",dpr:k=[1,2],performance:N,raycaster:H,camera:F,onPointerMissed:I}=p,G=s.getState(),W=G.gl;G.gl||G.set({gl:W=LD(m,r)});let X=G.raycaster;X||G.set({raycaster:X=new b2});const{params:J,...oe}=H||{};if(li.equ(oe,X,Qd)||Jd(X,{...oe}),li.equ(J,X.params,Qd)||Jd(X,{params:{...X.params,...J}}),!G.camera||G.camera===d&&!li.equ(d,F,Qd)){d=F;const Z=F instanceof Ap,O=Z?F:R?new ta(0,0,0,0,.1,1e3):new ci(75,0,.1,1e3);Z||(O.position.z=5,F&&(Jd(O,F),("aspect"in F||"left"in F||"right"in F||"bottom"in F||"top"in F)&&(O.manual=!0,O.updateProjectionMatrix())),!G.camera&&!(F!=null&&F.rotation)&&O.lookAt(0,0,0)),G.set({camera:O}),X.camera=O}if(!G.scene){let Z;y!=null&&y.isScene?Z=y:(Z=new dp,y&&Jd(Z,y)),G.set({scene:nf(Z)})}if(!G.xr){var se;const Z=(re,ne)=>{const ie=s.getState();ie.frameloop!=="never"&&Db(re,!0,ie,ne)},O=()=>{const re=s.getState();re.gl.xr.enabled=re.gl.xr.isPresenting,re.gl.xr.setAnimationLoop(re.gl.xr.isPresenting?Z:null),re.gl.xr.isPresenting||Lb(re)},j={connect(){const re=s.getState().gl;re.xr.addEventListener("sessionstart",O),re.xr.addEventListener("sessionend",O)},disconnect(){const re=s.getState().gl;re.xr.removeEventListener("sessionstart",O),re.xr.removeEventListener("sessionend",O)}};typeof((se=W.xr)==null?void 0:se.addEventListener)=="function"&&j.connect(),G.set({xr:j})}if(W.shadowMap){const Z=W.shadowMap.enabled,O=W.shadowMap.type;if(W.shadowMap.enabled=!!S,li.boo(S))W.shadowMap.type=Oh;else if(li.str(S)){var fe;const j={basic:Lw,percentage:C0,soft:Oh,variance:Zo};W.shadowMap.type=(fe=j[S])!=null?fe:Oh}else li.obj(S)&&Object.assign(W.shadowMap,S);(Z!==W.shadowMap.enabled||O!==W.shadowMap.type)&&(W.shadowMap.needsUpdate=!0)}const V=T2();V&&("enabled"in V?V.enabled=!T:"legacyMode"in V&&(V.legacyMode=T)),u||Jd(W,{outputEncoding:w?3e3:3001,toneMapping:A?ea:Zx}),G.legacy!==T&&G.set(()=>({legacy:T})),G.linear!==w&&G.set(()=>({linear:w})),G.flat!==A&&G.set(()=>({flat:A})),m&&!li.fun(m)&&!U2(m)&&!li.equ(m,W,Qd)&&Jd(W,m),x&&!G.events.handlers&&G.set({events:x(s)});const $=DD(r,v);return li.equ($,G.size,Qd)||G.setSize($.width,$.height,$.updateStyle,$.top,$.left),k&&G.viewport.dpr!==I2(k)&&G.setDpr(k),G.frameloop!==U&&G.setFrameloop(U),G.onPointerMissed||G.set({onPointerMissed:I}),N&&!li.equ(N,G.performance,Qd)&&G.set(Z=>({performance:{...Z.performance,...N}})),l=M,u=!0,this},render(p){return u||this.configure(),T0.updateContainer(E.jsx(kD,{store:s,children:p,onCreated:l,rootElement:r}),o,null,()=>{}),s},unmount(){N2(r)}}}function kD({store:r,children:e,onCreated:t,rootElement:n}){return Fp(()=>{const i=r.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),r.getState().events.connected||i.events.connect==null||i.events.connect(n)},[]),E.jsx(k2.Provider,{value:r,children:e})}function N2(r,e){const t=yf.get(r),n=t==null?void 0:t.fiber;if(n){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),T0.updateContainer(null,n,null,()=>{i&&setTimeout(()=>{try{var s,o,l,u;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(l=i.gl)==null||l.forceContextLoss==null||l.forceContextLoss(),(u=i.gl)!=null&&u.xr&&i.xr.disconnect(),bD(i),yf.delete(r)}catch{}},500)})}}T0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:K.version});const qy={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 FD(r){const{handlePointer:e}=TD(r);return{priority:1,enabled:!0,compute(t,n,i){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(qy).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:i}=r.getState();(t=i.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var n;const{set:i,events:s}=r.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((n=s.handlers)!=null?n:[]).forEach(([o,l])=>{const[u,d]=qy[o];t.addEventListener(u,l,{passive:d})})},disconnect:()=>{const{set:t,events:n}=r.getState();if(n.connected){var i;Object.entries((i=n.handlers)!=null?i:[]).forEach(([s,o])=>{if(n&&n.connected instanceof HTMLElement){const[l]=qy[s];n.connected.removeEventListener(l,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function Ub(r,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>r(...n),e)}}function ND({debounce:r,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const i=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)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]=K.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=K.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),u=r?typeof r=="number"?r:r.scroll:null,d=r?typeof r=="number"?r:r.resize:null,p=K.useRef(!1);K.useEffect(()=>(p.current=!0,()=>void(p.current=!1)));const[m,v,y]=K.useMemo(()=>{const w=()=>{if(!l.current.element)return;const{left:A,top:T,width:R,height:U,bottom:k,right:N,x:H,y:F}=l.current.element.getBoundingClientRect(),I={left:A,top:T,width:R,height:U,bottom:k,right:N,x:H,y:F};l.current.element instanceof HTMLElement&&n&&(I.height=l.current.element.offsetHeight,I.width=l.current.element.offsetWidth),Object.freeze(I),p.current&&!HD(l.current.lastBounds,I)&&o(l.current.lastBounds=I)};return[w,d?Ub(w,d):w,u?Ub(w,u):w]},[o,n,u,d]);function x(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",y,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null),l.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",l.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",l.current.orientationHandler))}function M(){l.current.element&&(l.current.resizeObserver=new i(y),l.current.resizeObserver.observe(l.current.element),e&&l.current.scrollContainers&&l.current.scrollContainers.forEach(w=>w.addEventListener("scroll",y,{capture:!0,passive:!0})),l.current.orientationHandler=()=>{y()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",l.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",l.current.orientationHandler))}const S=w=>{!w||w===l.current.element||(x(),l.current.element=w,l.current.scrollContainers=O2(w),M())};return BD(y,!!e),OD(v),K.useEffect(()=>{x(),M()},[e,y,v]),K.useEffect(()=>x,[]),[S,s,m]}function OD(r){K.useEffect(()=>{const e=r;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[r])}function BD(r,e){K.useEffect(()=>{if(e){const t=r;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[r,e])}function O2(r){const e=[];if(!r||r===document.body)return e;const{overflow:t,overflowX:n,overflowY:i}=window.getComputedStyle(r);return[t,n,i].some(s=>s==="auto"||s==="scroll")&&e.push(r),[...e,...O2(r.parentElement)]}const zD=["x","y","top","bottom","left","right","width","height"],HD=(r,e)=>zD.every(t=>r[t]===e[t]);var GD=Object.defineProperty,VD=Object.defineProperties,jD=Object.getOwnPropertyDescriptors,kb=Object.getOwnPropertySymbols,WD=Object.prototype.hasOwnProperty,XD=Object.prototype.propertyIsEnumerable,Fb=(r,e,t)=>e in r?GD(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Nb=(r,e)=>{for(var t in e||(e={}))WD.call(e,t)&&Fb(r,t,e[t]);if(kb)for(var t of kb(e))XD.call(e,t)&&Fb(r,t,e[t]);return r},YD=(r,e)=>VD(r,jD(e)),Ob,Bb;typeof window<"u"&&((Ob=window.document)!=null&&Ob.createElement||((Bb=window.navigator)==null?void 0:Bb.product)==="ReactNative")?K.useLayoutEffect:K.useEffect;function B2(r,e,t){if(!r)return;if(t(r)===!0)return r;let n=r.child;for(;n;){const i=B2(n,e,t);if(i)return i;n=n.sibling}}function z2(r){try{return Object.defineProperties(r,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return r}}const zb=console.error;console.error=function(){const r=[...arguments].join("");if(r!=null&&r.startsWith("Warning:")&&r.includes("useContext")){console.error=zb;return}return zb.apply(this,arguments)};const F1=z2(K.createContext(null));class H2 extends K.Component{render(){return K.createElement(F1.Provider,{value:this._reactInternals},this.props.children)}}function qD(){const r=K.useContext(F1);if(r===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=K.useId();return K.useMemo(()=>{for(const n of[r,r==null?void 0:r.alternate]){if(!n)continue;const i=B2(n,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[r,e])}function KD(){const r=qD(),[e]=K.useState(()=>new Map);e.clear();let t=r;for(;t;){if(t.type&&typeof t.type=="object"){const i=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;i&&i!==F1&&!e.has(i)&&e.set(i,K.useContext(z2(i)))}t=t.return}return e}function ZD(){const r=KD();return K.useMemo(()=>Array.from(r.keys()).reduce((e,t)=>n=>K.createElement(e,null,K.createElement(t.Provider,YD(Nb({},n),{value:r.get(t)}))),e=>K.createElement(H2,Nb({},e))),[r])}const JD=K.forwardRef(function({children:e,fallback:t,resize:n,style:i,gl:s,events:o=FD,eventSource:l,eventPrefix:u,shadows:d,linear:p,flat:m,legacy:v,orthographic:y,frameloop:x,dpr:M,performance:S,raycaster:w,camera:A,scene:T,onPointerMissed:R,onCreated:U,...k},N){K.useMemo(()=>vD(nD),[]);const H=ZD(),[F,I]=ND({scroll:!0,debounce:{scroll:50,resize:0},...n}),G=K.useRef(null),W=K.useRef(null);K.useImperativeHandle(N,()=>G.current);const X=C2(R),[J,oe]=K.useState(!1),[se,fe]=K.useState(!1);if(J)throw J;if(se)throw se;const V=K.useRef(null);Fp(()=>{const Z=G.current;I.width>0&&I.height>0&&Z&&(V.current||(V.current=UD(Z)),V.current.configure({gl:s,events:o,shadows:d,linear:p,flat:m,legacy:v,orthographic:y,frameloop:x,dpr:M,performance:S,raycaster:w,camera:A,scene:T,size:I,onPointerMissed:(...O)=>X.current==null?void 0:X.current(...O),onCreated:O=>{O.events.connect==null||O.events.connect(l?xD(l)?l.current:l:W.current),u&&O.setEvents({compute:(j,re)=>{const ne=j[u+"X"],ie=j[u+"Y"];re.pointer.set(ne/re.size.width*2-1,-(ie/re.size.height)*2+1),re.raycaster.setFromCamera(re.pointer,re.camera)}}),U==null||U(O)}}),V.current.render(E.jsx(H,{children:E.jsx(R2,{set:fe,children:E.jsx(K.Suspense,{fallback:E.jsx(_D,{set:oe}),children:e??null})})})))}),K.useEffect(()=>{const Z=G.current;if(Z)return()=>N2(Z)},[]);const $=l?"none":"auto";return E.jsx("div",{ref:W,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:$,...i},...k,children:E.jsx("div",{ref:F,style:{width:"100%",height:"100%"},children:E.jsx("canvas",{ref:G,style:{display:"block"},children:t})})})}),QD=K.forwardRef(function(e,t){return E.jsx(H2,{children:E.jsx(JD,{...e,ref:t})})});function vc(){return vc=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},vc.apply(null,arguments)}const Np=new te,N1=new te,$D=new te,Hb=new We;function eU(r,e,t){const n=Np.setFromMatrixPosition(r.matrixWorld);n.project(e);const i=t.width/2,s=t.height/2;return[n.x*i+i,-(n.y*s)+s]}function tU(r,e){const t=Np.setFromMatrixPosition(r.matrixWorld),n=N1.setFromMatrixPosition(e.matrixWorld),i=t.sub(n),s=e.getWorldDirection($D);return i.angleTo(s)>Math.PI/2}function nU(r,e,t,n){const i=Np.setFromMatrixPosition(r.matrixWorld),s=i.clone();s.project(e),Hb.set(s.x,s.y),t.setFromCamera(Hb,e);const o=t.intersectObjects(n,!0);if(o.length){const l=o[0].distance;return i.distanceTo(t.ray.origin)<l}return!0}function iU(r,e){if(e instanceof ta)return e.zoom;if(e instanceof ci){const t=Np.setFromMatrixPosition(r.matrixWorld),n=N1.setFromMatrixPosition(e.matrixWorld),i=e.fov*Math.PI/180,s=t.distanceTo(n);return 1/(2*Math.tan(i/2)*s)}else return 1}function rU(r,e,t){if(e instanceof ci||e instanceof ta){const n=Np.setFromMatrixPosition(r.matrixWorld),i=N1.setFromMatrixPosition(e.matrixWorld),s=n.distanceTo(i),o=(t[1]-t[0])/(e.far-e.near),l=t[1]-o*e.far;return Math.round(o*s+l)}}const Cx=r=>Math.abs(r)<1e-10?0:r;function G2(r,e,t=""){let n="matrix3d(";for(let i=0;i!==16;i++)n+=Cx(e[i]*r.elements[i])+(i!==15?",":")");return t+n}const sU=(r=>e=>G2(e,r))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),oU=(r=>(e,t)=>G2(e,r(t),"translate(-50%,-50%)"))(r=>[1/r,1/r,1/r,1,-1/r,-1/r,-1/r,-1,1/r,1/r,1/r,1,1,1,1,1]);function aU(r){return r&&typeof r=="object"&&"current"in r}const V2=K.forwardRef(({children:r,eps:e=.001,style:t,className:n,prepend:i,center:s,fullscreen:o,portal:l,distanceFactor:u,sprite:d=!1,transform:p=!1,occlude:m,onOcclude:v,castShadow:y,receiveShadow:x,material:M,geometry:S,zIndexRange:w=[16777271,0],calculatePosition:A=eU,as:T="div",wrapperClass:R,pointerEvents:U="auto",...k},N)=>{const{gl:H,camera:F,scene:I,size:G,raycaster:W,events:X,viewport:J}=Bs(),[oe]=K.useState(()=>document.createElement(T)),se=K.useRef(),fe=K.useRef(null),V=K.useRef(0),$=K.useRef([0,0]),Z=K.useRef(null),O=K.useRef(null),j=(l==null?void 0:l.current)||X.connected||H.domElement.parentNode,re=K.useRef(null),ne=K.useRef(!1),ie=K.useMemo(()=>m&&m!=="blending"||Array.isArray(m)&&m.length&&aU(m[0]),[m]);K.useLayoutEffect(()=>{const Xe=H.domElement;m&&m==="blending"?(Xe.style.zIndex=`${Math.floor(w[0]/2)}`,Xe.style.position="absolute",Xe.style.pointerEvents="none"):(Xe.style.zIndex=null,Xe.style.position=null,Xe.style.pointerEvents=null)},[m]),K.useLayoutEffect(()=>{if(fe.current){const Xe=se.current=Rw.createRoot(oe);if(I.updateMatrixWorld(),p)oe.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Ie=A(fe.current,F,G);oe.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Ie[0]}px,${Ie[1]}px,0);transform-origin:0 0;`}return j&&(i?j.prepend(oe):j.appendChild(oe)),()=>{j&&j.removeChild(oe),Xe.unmount()}}},[j,p]),K.useLayoutEffect(()=>{R&&(oe.className=R)},[R]);const he=K.useMemo(()=>p?{position:"absolute",top:0,left:0,width:G.width,height:G.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-G.height/2,left:-G.width/2,width:G.width,height:G.height},...t},[t,s,o,G,p]),le=K.useMemo(()=>({position:"absolute",pointerEvents:U}),[U]);K.useLayoutEffect(()=>{if(ne.current=!1,p){var Xe;(Xe=se.current)==null||Xe.render(K.createElement("div",{ref:Z,style:he},K.createElement("div",{ref:O,style:le},K.createElement("div",{ref:N,className:n,style:t,children:r}))))}else{var Ie;(Ie=se.current)==null||Ie.render(K.createElement("div",{ref:N,style:he,className:n,children:r}))}});const ye=K.useRef(!0);us(Xe=>{if(fe.current){F.updateMatrixWorld(),fe.current.updateWorldMatrix(!0,!1);const Ie=p?$.current:A(fe.current,F,G);if(p||Math.abs(V.current-F.zoom)>e||Math.abs($.current[0]-Ie[0])>e||Math.abs($.current[1]-Ie[1])>e){const Y=tU(fe.current,F);let Ce=!1;ie&&(Array.isArray(m)?Ce=m.map($e=>$e.current):m!=="blending"&&(Ce=[I]));const Le=ye.current;if(Ce){const $e=nU(fe.current,F,W,Ce);ye.current=$e&&!Y}else ye.current=!Y;Le!==ye.current&&(v?v(!ye.current):oe.style.display=ye.current?"block":"none");const Ge=Math.floor(w[0]/2),Ae=m?ie?[w[0],Ge]:[Ge-1,0]:w;if(oe.style.zIndex=`${rU(fe.current,F,Ae)}`,p){const[$e,Re]=[G.width/2,G.height/2],He=F.projectionMatrix.elements[5]*Re,{isOrthographicCamera:Q,top:B,left:pe,bottom:ge,right:ve}=F,we=sU(F.matrixWorldInverse),ut=Q?`scale(${He})translate(${Cx(-(ve+pe)/2)}px,${Cx((B+ge)/2)}px)`:`translateZ(${He}px)`;let Oe=fe.current.matrixWorld;d&&(Oe=F.matrixWorldInverse.clone().transpose().copyPosition(Oe).scale(fe.current.scale),Oe.elements[3]=Oe.elements[7]=Oe.elements[11]=0,Oe.elements[15]=1),oe.style.width=G.width+"px",oe.style.height=G.height+"px",oe.style.perspective=Q?"":`${He}px`,Z.current&&O.current&&(Z.current.style.transform=`${ut}${we}translate(${$e}px,${Re}px)`,O.current.style.transform=oU(Oe,1/((u||10)/400)))}else{const $e=u===void 0?1:iU(fe.current,F)*u;oe.style.transform=`translate3d(${Ie[0]}px,${Ie[1]}px,0) scale(${$e})`}$.current=Ie,V.current=F.zoom}}if(!ie&&re.current&&!ne.current)if(p){if(Z.current){const Ie=Z.current.children[0];if(Ie!=null&&Ie.clientWidth&&Ie!=null&&Ie.clientHeight){const{isOrthographicCamera:Y}=F;if(Y||S)k.scale&&(Array.isArray(k.scale)?k.scale instanceof te?re.current.scale.copy(k.scale.clone().divideScalar(1)):re.current.scale.set(1/k.scale[0],1/k.scale[1],1/k.scale[2]):re.current.scale.setScalar(1/k.scale));else{const Ce=(u||10)/400,Le=Ie.clientWidth*Ce,Ge=Ie.clientHeight*Ce;re.current.scale.set(Le,Ge,1)}ne.current=!0}}}else{const Ie=oe.children[0];if(Ie!=null&&Ie.clientWidth&&Ie!=null&&Ie.clientHeight){const Y=1/J.factor,Ce=Ie.clientWidth*Y,Le=Ie.clientHeight*Y;re.current.scale.set(Ce,Le,1),ne.current=!0}re.current.lookAt(Xe.camera.position)}});const ze=K.useMemo(()=>({vertexShader:p?void 0:` 3915 /* 3916 This shader is from the THREE's SpriteMaterial. 3917 We need to turn the backing plane into a Sprite 3918 (make it always face the camera) if "transfrom" 3919 is false. 3920 */ 3921 #include <common> 3922 3923 void main() { 3924 vec2 center = vec2(0., 1.); 3925 float rotation = 0.0; 3926 3927 // This is somewhat arbitrary, but it seems to work well 3928 // Need to figure out how to derive this dynamically if it even matters 3929 float size = 0.03; 3930 3931 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 3932 vec2 scale; 3933 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 3934 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 3935 3936 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3937 if ( isPerspective ) scale *= - mvPosition.z; 3938 3939 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; 3940 vec2 rotatedPosition; 3941 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3942 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3943 mvPosition.xy += rotatedPosition; 3944 3945 gl_Position = projectionMatrix * mvPosition; 3946 } 3947 `,fragmentShader:` 3948 void main() { 3949 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 3950 } 3951 `}
3951),[p]);return K.createElement("group",vc({},k,{ref:fe}),m&&!ie&&K.createElement("mesh",{castShadow:y,receiveShadow:x,ref:re},S||K.createElement("planeGeometry",null),M||K.createElement("shaderMaterial",{side:os,vertexShader:ze.vertexShader,fragmentShader:ze.fragmentShader})))});let Lh;function lU(){var r;if(Lh!==void 0)return Lh;try{let e;const t=document.createElement("canvas");return Lh=!!(window.WebGL2RenderingContext&&(e=t.getContext("webgl2"))),e&&((r=e.getExtension("WEBGL_lose_context"))==null||r.loseContext()),Lh}catch{return Lh=!1}}const j2=parseInt(Du.replace(/\D+/g,"")),W2=j2>=125?"uv1":"uv2";var cU=Object.defineProperty,uU=(r,e,t)=>e in r?cU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,dU=(r,e,t)=>(uU(r,e+"",t),t);class fU{constructor(){dU(this,"_listeners")}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}}var hU=Object.defineProperty,pU=(r,e,t)=>e in r?hU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Wt=(r,e,t)=>(pU(r,typeof e!="symbol"?e+"":e,t),t);const Pg=new ku,Gb=new pl,mU=Math.cos(70*(Math.PI/180)),Vb=(r,e)=>(r%e+e)%e;let gU=class extends fU{constructor(e,t){super(),Wt(this,"object"),Wt(this,"domElement"),Wt(this,"enabled",!0),Wt(this,"target",new te),Wt(this,"minDistance",0),Wt(this,"maxDistance",1/0),Wt(this,"minZoom",0),Wt(this,"maxZoom",1/0),Wt(this,"minPolarAngle",0),Wt(this,"maxPolarAngle",Math.PI),Wt(this,"minAzimuthAngle",-1/0),Wt(this,"maxAzimuthAngle",1/0),Wt(this,"enableDamping",!1),Wt(this,"dampingFactor",.05),Wt(this,"enableZoom",!0),Wt(this,"zoomSpeed",1),Wt(this,"enableRotate",!0),Wt(this,"rotateSpeed",1),Wt(this,"enablePan",!0),Wt(this,"panSpeed",1),Wt(this,"screenSpacePanning",!0),Wt(this,"keyPanSpeed",7),Wt(this,"zoomToCursor",!1),Wt(this,"autoRotate",!1),Wt(this,"autoRotateSpeed",2),Wt(this,"reverseOrbit",!1),Wt(this,"reverseHorizontalOrbit",!1),Wt(this,"reverseVerticalOrbit",!1),Wt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Wt(this,"mouseButtons",{LEFT:pu.ROTATE,MIDDLE:pu.DOLLY,RIGHT:pu.PAN}),Wt(this,"touches",{ONE:mu.ROTATE,TWO:mu.DOLLY_PAN}),Wt(this,"target0"),Wt(this,"position0"),Wt(this,"zoom0"),Wt(this,"_domElementKeyEvents",null),Wt(this,"getPolarAngle"),Wt(this,"getAzimuthalAngle"),Wt(this,"setPolarAngle"),Wt(this,"setAzimuthalAngle"),Wt(this,"getDistance"),Wt(this,"getZoomScale"),Wt(this,"listenToKeyEvents"),Wt(this,"stopListenToKeyEvents"),Wt(this,"saveState"),Wt(this,"reset"),Wt(this,"update"),Wt(this,"connect"),Wt(this,"dispose"),Wt(this,"dollyIn"),Wt(this,"dollyOut"),Wt(this,"getScale"),Wt(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>p.phi,this.getAzimuthalAngle=()=>p.theta,this.setPolarAngle=ue=>{let qe=Vb(ue,2*Math.PI),ce=p.phi;ce<0&&(ce+=2*Math.PI),qe<0&&(qe+=2*Math.PI);let Fe=Math.abs(qe-ce);2*Math.PI-Fe<Fe&&(qe<ce?qe+=2*Math.PI:ce+=2*Math.PI),m.phi=qe-ce,n.update()},this.setAzimuthalAngle=ue=>{let qe=Vb(ue,2*Math.PI),ce=p.theta;ce<0&&(ce+=2*Math.PI),qe<0&&(qe+=2*Math.PI);let Fe=Math.abs(qe-ce);2*Math.PI-Fe<Fe&&(qe<ce?qe+=2*Math.PI:ce+=2*Math.PI),m.theta=qe-ce,n.update()},this.getDistance=()=>n.object.position.distanceTo(n.target),this.listenToKeyEvents=ue=>{ue.addEventListener("keydown",Qe),this._domElementKeyEvents=ue},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Qe),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(i),n.update(),u=l.NONE},this.update=(()=>{const ue=new te,qe=new te(0,1,0),ce=new Xr().setFromUnitVectors(e.up,qe),Fe=ce.clone().invert(),xe=new te,De=new Xr,rt=2*Math.PI;return function(){const vt=n.object.position;ce.setFromUnitVectors(e.up,qe),Fe.copy(ce).invert(),ue.copy(vt).sub(n.target),ue.applyQuaternion(ce),p.setFromVector3(ue),n.autoRotate&&u===l.NONE&&J(W()),n.enableDamping?(p.theta+=m.theta*n.dampingFactor,p.phi+=m.phi*n.dampingFactor):(p.theta+=m.theta,p.phi+=m.phi);let kt=n.minAzimuthAngle,Ft=n.maxAzimuthAngle;isFinite(kt)&&isFinite(Ft)&&(kt<-Math.PI?kt+=rt:kt>Math.PI&&(kt-=rt),Ft<-Math.PI?Ft+=rt:Ft>Math.PI&&(Ft-=rt),kt<=Ft?p.theta=Math.max(kt,Math.min(Ft,p.theta)):p.theta=p.theta>(kt+Ft)/2?Math.max(kt,p.theta):Math.min(Ft,p.theta)),p.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,p.phi)),p.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(y,n.dampingFactor):n.target.add(y),n.zoomToCursor&&F||n.object.isOrthographicCamera?p.radius=re(p.radius):p.radius=re(p.radius*v),ue.setFromSpherical(p),ue.applyQuaternion(Fe),vt.copy(n.target).add(ue),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),n.enableDamping===!0?(m.theta*=1-n.dampingFactor,m.phi*=1-n.dampingFactor,y.multiplyScalar(1-n.dampingFactor)):(m.set(0,0,0),y.set(0,0,0));let pt=!1;if(n.zoomToCursor&&F){let Kt=null;if(n.object instanceof ci&&n.object.isPerspectiveCamera){const dn=ue.length();Kt=re(dn*v);const Sn=dn-Kt;n.object.position.addScaledVector(N,Sn),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const dn=new te(H.x,H.y,0);dn.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/v)),n.object.updateProjectionMatrix(),pt=!0;const Sn=new te(H.x,H.y,0);Sn.unproject(n.object),n.object.position.sub(Sn).add(dn),n.object.updateMatrixWorld(),Kt=ue.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Kt!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Kt).add(n.object.position):(Pg.origin.copy(n.object.position),Pg.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Pg.direction))<mU?e.lookAt(n.target):(Gb.setFromNormalAndCoplanarPoint(n.object.up,n.target),Pg.intersectPlane(Gb,n.target))))}else n.object instanceof ta&&n.object.isOrthographicCamera&&(pt=v!==1,pt&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/v)),n.object.updateProjectionMatrix()));return v=1,F=!1,pt||xe.distanceToSquared(n.object.position)>d||8*(1-De.dot(n.object.quaternion))>d?(n.dispatchEvent(i),xe.copy(n.object.position),De.copy(n.object.quaternion),pt=!1,!0):!1}})(),this.connect=ue=>{n.domElement=ue,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",tt),n.domElement.addEventListener("pointerdown",pe),n.domElement.addEventListener("pointercancel",ve),n.domElement.addEventListener("wheel",Oe)},this.dispose=()=>{var ue,qe,ce,Fe,xe,De;n.domElement&&(n.domElement.style.touchAction="auto"),(ue=n.domElement)==null||ue.removeEventListener("contextmenu",tt),(qe=n.domElement)==null||qe.removeEventListener("pointerdown",pe),(ce=n.domElement)==null||ce.removeEventListener("pointercancel",ve),(Fe=n.domElement)==null||Fe.removeEventListener("wheel",Oe),(xe=n.domElement)==null||xe.ownerDocument.removeEventListener("pointermove",ge),(De=n.domElement)==null||De.ownerDocument.removeEventListener("pointerup",ve),n._domElementKeyEvents!==null&&n._domElementKeyEvents.removeEventListener("keydown",Qe)};const n=this,i={type:"change"},s={type:"start"},o={type:"end"},l={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let u=l.NONE;const d=1e-6,p=new Ex,m=new Ex;let v=1;
3951const y=new te,x=new We,M=new We,S=new We,w=new We,A=new We,T=new We,R=new We,U=new We,k=new We,N=new te,H=new We;let F=!1;const I=[],G={};function W(){return 2*Math.PI/60/60*n.autoRotateSpeed}function X(){return Math.pow(.95,n.zoomSpeed)}function J(ue){n.reverseOrbit||n.reverseHorizontalOrbit?m.theta+=ue:m.theta-=ue}function oe(ue){n.reverseOrbit||n.reverseVerticalOrbit?m.phi+=ue:m.phi-=ue}const se=(()=>{const ue=new te;return function(ce,Fe){ue.setFromMatrixColumn(Fe,0),ue.multiplyScalar(-ce),y.add(ue)}})(),fe=(()=>{const ue=new te;return function(ce,Fe){n.screenSpacePanning===!0?ue.setFromMatrixColumn(Fe,1):(ue.setFromMatrixColumn(Fe,0),ue.crossVectors(n.object.up,ue)),ue.multiplyScalar(ce),y.add(ue)}})(),V=(()=>{const ue=new te;return function(ce,Fe){const xe=n.domElement;if(xe&&n.object instanceof ci&&n.object.isPerspectiveCamera){const De=n.object.position;ue.copy(De).sub(n.target);let rt=ue.length();rt*=Math.tan(n.object.fov/2*Math.PI/180),se(2*ce*rt/xe.clientHeight,n.object.matrix),fe(2*Fe*rt/xe.clientHeight,n.object.matrix)}else xe&&n.object instanceof ta&&n.object.isOrthographicCamera?(se(ce*(n.object.right-n.object.left)/n.object.zoom/xe.clientWidth,n.object.matrix),fe(Fe*(n.object.top-n.object.bottom)/n.object.zoom/xe.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function $(ue){n.object instanceof ci&&n.object.isPerspectiveCamera||n.object instanceof ta&&n.object.isOrthographicCamera?v=ue:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Z(ue){$(v/ue)}function O(ue){$(v*ue)}function j(ue){if(!n.zoomToCursor||!n.domElement)return;F=!0;const qe=n.domElement.getBoundingClientRect(),ce=ue.clientX-qe.left,Fe=ue.clientY-qe.top,xe=qe.width,De=qe.height;H.x=ce/xe*2-1,H.y=-(Fe/De)*2+1,N.set(H.x,H.y,1).unproject(n.object).sub(n.object.position).normalize()}function re(ue){return Math.max(n.minDistance,Math.min(n.maxDistance,ue))}function ne(ue){x.set(ue.clientX,ue.clientY)}function ie(ue){j(ue),R.set(ue.clientX,ue.clientY)}function he(ue){w.set(ue.clientX,ue.clientY)}function le(ue){M.set(ue.clientX,ue.clientY),S.subVectors(M,x).multiplyScalar(n.rotateSpeed);const qe=n.domElement;qe&&(J(2*Math.PI*S.x/qe.clientHeight),oe(2*Math.PI*S.y/qe.clientHeight)),x.copy(M),n.update()}function ye(ue){U.set(ue.clientX,ue.clientY),k.subVectors(U,R),k.y>0?Z(X()):k.y<0&&O(X()),R.copy(U),n.update()}function ze(ue){A.set(ue.clientX,ue.clientY),T.subVectors(A,w).multiplyScalar(n.panSpeed),V(T.x,T.y),w.copy(A),n.update()}function Xe(ue){j(ue),ue.deltaY<0?O(X()):ue.deltaY>0&&Z(X()),n.update()}function Ie(ue){let qe=!1;switch(ue.code){case n.keys.UP:V(0,n.keyPanSpeed),qe=!0;break;case n.keys.BOTTOM:V(0,-n.keyPanSpeed),qe=!0;break;case n.keys.LEFT:V(n.keyPanSpeed,0),qe=!0;break;case n.keys.RIGHT:V(-n.keyPanSpeed,0),qe=!0;break}qe&&(ue.preventDefault(),n.update())}function Y(){if(I.length==1)x.set(I[0].pageX,I[0].pageY);else{const ue=.5*(I[0].pageX+I[1].pageX),qe=.5*(I[0].pageY+I[1].pageY);x.set(ue,qe)}}function Ce(){if(I.length==1)w.set(I[0].pageX,I[0].pageY);else{const ue=.5*(I[0].pageX+I[1].pageX),qe=.5*(I[0].pageY+I[1].pageY);w.set(ue,qe)}}function Le(){const ue=I[0].pageX-I[1].pageX,qe=I[0].pageY-I[1].pageY,ce=Math.sqrt(ue*ue+qe*qe);R.set(0,ce)}function Ge(){n.enableZoom&&Le(),n.enablePan&&Ce()}function Ae(){n.enableZoom&&Le(),n.enableRotate&&Y()}function $e(ue){if(I.length==1)M.set(ue.pageX,ue.pageY);else{const ce=it(ue),Fe=.5*(ue.pageX+ce.x),xe=.5*(ue.pageY+ce.y);M.set(Fe,xe)}S.subVectors(M,x).multiplyScalar(n.rotateSpeed);const qe=n.domElement;qe&&(J(2*Math.PI*S.x/qe.clientHeight),oe(2*Math.PI*S.y/qe.clientHeight)),x.copy(M)}function Re(ue){if(I.length==1)A.set(ue.pageX,ue.pageY);else{const qe=it(ue),ce=.5*(ue.pageX+qe.x),Fe=.5*(ue.pageY+qe.y);A.set(ce,Fe)}T.subVectors(A,w).multiplyScalar(n.panSpeed),V(T.x,T.y),w.copy(A)}function He(ue){const qe=it(ue),ce=ue.pageX-qe.x,Fe=ue.pageY-qe.y,xe=Math.sqrt(ce*ce+Fe*Fe);U.set(0,xe),k.set(0,Math.pow(U.y/R.y,n.zoomSpeed)),Z(k.y),R.copy(U)}function Q(ue){n.enableZoom&&He(ue),n.enablePan&&Re(ue)}function B(ue){n.enableZoom&&He(ue),n.enableRotate&&$e(ue)}function pe(ue){var qe,ce;n.enabled!==!1&&(I.length===0&&((qe=n.domElement)==null||qe.ownerDocument.addEventListener("pointermove",ge),(ce=n.domElement)==null||ce.ownerDocument.addEventListener("pointerup",ve)),wt(ue),ue.pointerType==="touch"?at(ue):we(ue))}function ge(ue){n.enabled!==!1&&(ue.pointerType==="touch"?Ke(ue):ut(ue))}function ve(ue){var qe,ce,Fe;nt(ue),I.length===0&&((qe=n.domElement)==null||qe.releasePointerCapture(ue.pointerId),(ce=n.domElement)==null||ce.ownerDocument.removeEventListener("pointermove",ge),(Fe=n.domElement)==null||Fe.ownerDocument.removeEventListener("pointerup",ve)),n.dispatchEvent(o),u=l.NONE}function we(ue){let qe;switch(ue.button){case 0:qe=n.mouseButtons.LEFT;break;case 1:qe=n.mouseButtons.MIDDLE;break;case 2:qe=n.mouseButtons.RIGHT;break;default:qe=-1}switch(qe){case pu.DOLLY:if(n.enableZoom===!1)return;ie(ue),u=l.DOLLY;break;case pu.ROTATE:if(ue.ctrlKey||ue.metaKey||ue.shiftKey){if(n.enablePan===!1)return;he(ue),u=l.PAN}else{if(n.enableRotate===!1)return;ne(ue),u=l.ROTATE}break;case pu.PAN:if(ue.ctrlKey||ue.metaKey||ue.shiftKey){if(n.enableRotate===!1)return;ne(ue),u=l.ROTATE}else{if(n.enablePan===!1)return;he(ue),u=l.PAN}break;default:u=l.NONE}u!==l.NONE&&n.dispatchEvent(s)}function ut(ue){if(n.enabled!==!1)switch(u){case l.ROTATE:if(n.enableRotate===!1)return;le(ue);break;case l.DOLLY:if(n.enableZoom===!1)return;ye(ue);break;case l.PAN:if(n.enablePan===!1)return;ze(ue);break}}function Oe(ue){n.enabled===!1||n.enableZoom===!1||u!==l.NONE&&u!==l.ROTATE||(ue.preventDefault(),n.dispatchEvent(s),Xe(ue),n.dispatchEvent(o))}function Qe(ue){n.enabled===!1||n.enablePan===!1||Ie(ue)}function at(ue){switch(et(ue),I.length){case 1:switch(n.touches.ONE){case mu.ROTATE:if(n.enableRotate===!1)return;Y(),u=l.TOUCH_ROTATE;break;case mu.PAN:if(n.enablePan===!1)return;Ce(),u=l.TOUCH_PAN;break;default:u=l.NONE}break;case 2:switch(n.touches.TWO){case mu.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ge(),u=l.TOUCH_DOLLY_PAN;break;case mu.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Ae(),u=l.TOUCH_DOLLY_ROTATE;break;default:u=l.NONE}break;default:u=l.NONE}u!==l.NONE&&n.dispatchEvent(s)}function Ke(ue){switch(et(ue),u){case l.TOUCH_ROTATE:if(n.enableRotate===!1)return;$e(ue),n.update();break;case l.TOUCH_PAN:if(n.enablePan===!1)return;Re(ue),n.update();break;case l.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Q(ue),n.update();break;case l.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;B(ue),n.update();break;default:u=l.NONE}}function tt(ue){n.enabled!==!1&&ue.preventDefault()}function wt(ue){I.push(ue)}function nt(ue){delete G[ue.pointerId];for(let qe=0;qe<I.length;qe++)if(I[qe].pointerId==ue.pointerId){I.splice(qe,1);return}}function et(ue){let qe=G[ue.pointerId];qe===void 0&&(qe=new We,G[ue.pointerId]=qe),qe.set(ue.pageX,ue.pageY)}function it(ue){const qe=ue.pointerId===I[0].pointerId?I[1]:I[0];return G[qe.pointerId]}this.dollyIn=(ue=X())=>{O(ue),n.update()},this.dollyOut=(ue=X())=>{Z(ue),n.update()}
3951,this.getScale=()=>v,this.setScale=ue=>{$(ue),n.update()},this.getZoomScale=()=>X(),t!==void 0&&this.connect(t),this.update()}};const jb=new ir,Ig=new te;class O1 extends uv{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new Pt(e,3)),this.setAttribute("uv",new Pt(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new E0(t,6,1);return this.setAttribute("instanceStart",new to(n,3,0)),this.setAttribute("instanceEnd",new to(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new E0(n,t*2,1);return this.setAttribute("instanceColorStart",new to(i,t,0)),this.setAttribute("instanceColorEnd",new to(i,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new b1(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ir);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),jb.setFromBufferAttribute(t),this.boundingBox.union(jb))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new hr),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)Ig.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Ig)),Ig.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(Ig));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}class X2 extends O1{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setPositions(n),this}setColors(e,t=3){const n=e.length-t,i=new Float32Array(2*n);if(t===3)for(let s=0;s<n;s+=t)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];else for(let s=0;s<n;s+=t)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5],i[2*s+6]=e[s+6],i[2*s+7]=e[s+7];return super.setColors(i,t),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class B1 extends Vi{constructor(e){super({type:"LineMaterial",uniforms:up.clone(up.merge([_t.common,_t.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new We(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:` 3952 #include <common> 3953 #include <fog_pars_vertex> 3954 #include <logdepthbuf_pars_vertex> 3955 #include <clipping_planes_pars_vertex> 3956 3957 uniform float linewidth; 3958 uniform vec2 resolution; 3959 3960 attribute vec3 instanceStart; 3961 attribute vec3 instanceEnd; 3962 3963 #ifdef USE_COLOR 3964 #ifdef USE_LINE_COLOR_ALPHA 3965 varying vec4 vLineColor; 3966 attribute vec4 instanceColorStart; 3967 attribute vec4 instanceColorEnd; 3968 #else 3969 varying vec3 vLineColor; 3970 attribute vec3 instanceColorStart; 3971 attribute vec3 instanceColorEnd; 3972 #endif 3973 #endif 3974 3975 #ifdef WORLD_UNITS 3976 3977 varying vec4 worldPos; 3978 varying vec3 worldStart; 3979 varying vec3 worldEnd; 3980 3981 #ifdef USE_DASH 3982 3983 varying vec2 vUv; 3984 3985 #endif 3986 3987 #else 3988 3989 varying vec2 vUv; 3990 3991 #endif 3992 3993 #ifdef USE_DASH 3994 3995 uniform float dashScale; 3996 attribute float instanceDistanceStart; 3997 attribute float instanceDistanceEnd; 3998 varying float vLineDistance; 3999 4000 #endif 4001 4002 void trimSegment( const in vec4 start, inout vec4 end ) { 4003 4004 // trim end segment so it terminates between the camera plane and the near plane 4005 4006 // conservative estimate of the near plane 4007 float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column 4008 float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column 4009 float nearEstimate = - 0.5 * b / a; 4010 4011 float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); 4012 4013 end.xyz = mix( start.xyz, end.xyz, alpha ); 4014 4015 } 4016 4017 void main() { 4018 4019 #ifdef USE_COLOR 4020 4021 vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; 4022 4023 #endif 4024 4025 #ifdef USE_DASH 4026 4027 vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; 4028 vUv = uv; 4029 4030 #endif 4031 4032 float aspect = resolution.x / resolution.y; 4033 4034 // camera space 4035 vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); 4036 vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); 4037 4038 #ifdef WORLD_UNITS 4039 4040 worldStart = start.xyz; 4041 worldEnd = end.xyz; 4042 4043 #else 4044 4045 vUv = uv; 4046 4047 #endif 4048 4049 // special case for perspective projection, and segments that terminate either in, or behind, the camera plane 4050 // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space 4051 // but we need to perform ndc-space calculations in the shader, so we must address this issue directly 4052 // perhaps there is a more elegant solution -- WestLangley 4053 4054 bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column 4055 4056 if ( perspective ) { 4057 4058 if ( start.z < 0.0 && end.z >= 0.0 ) { 4059 4060 trimSegment( start, end ); 4061 4062 } else if ( end.z < 0.0 && start.z >= 0.0 ) { 4063 4064 trimSegment( end, start ); 4065 4066 } 4067 4068 } 4069 4070 // clip space 4071 vec4 clipStart = projectionMatrix * start; 4072 vec4 clipEnd = projectionMatrix * end; 4073 4074 // ndc space 4075 vec3 ndcStart = clipStart.xyz / clipStart.w; 4076 vec3 ndcEnd = clipEnd.xyz / clipEnd.w; 4077 4078 // direction 4079 vec2 dir = ndcEnd.xy - ndcStart.xy; 4080 4081 // account for clip-space aspect ratio 4082 dir.x *= aspect; 4083 dir = normalize( dir ); 4084 4085 #ifdef WORLD_UNITS 4086 4087 // get the offset direction as perpendicular to the view vector
4088 vec3 worldDir = normalize( end.xyz - start.xyz ); 4089 vec3 offset; 4090 if ( position.y < 0.5 ) { 4091 4092 offset = normalize( cross( start.xyz, worldDir ) ); 4093 4094 } else { 4095 4096 offset = normalize( cross( end.xyz, worldDir ) ); 4097 4098 } 4099 4100 // sign flip 4101 if ( position.x < 0.0 ) offset *= - 1.0; 4102 4103 float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) ); 4104 4105 // don't extend the line if we're rendering dashes because we 4106 // won't be rendering the endcaps 4107 #ifndef USE_DASH 4108 4109 // extend the line bounds to encompass endcaps 4110 start.xyz += - worldDir * linewidth * 0.5; 4111 end.xyz += worldDir * linewidth * 0.5; 4112 4113 // shift the position of the quad so it hugs the forward edge of the line 4114 offset.xy -= dir * forwardOffset; 4115 offset.z += 0.5; 4116 4117 #endif 4118 4119 // endcaps 4120 if ( position.y > 1.0 || position.y < 0.0 ) { 4121 4122 offset.xy += dir * 2.0 * forwardOffset; 4123 4124 } 4125 4126 // adjust for linewidth 4127 offset *= linewidth * 0.5; 4128 4129 // set the world position 4130 worldPos = ( position.y < 0.5 ) ? start : end; 4131 worldPos.xyz += offset; 4132 4133 // project the worldpos 4134 vec4 clip = projectionMatrix * worldPos; 4135 4136 // shift the depth of the projected points so the line 4137 // segments overlap neatly 4138 vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; 4139 clip.z = clipPose.z * clip.w; 4140 4141 #else 4142 4143 vec2 offset = vec2( dir.y, - dir.x ); 4144 // undo aspect ratio adjustment 4145 dir.x /= aspect; 4146 offset.x /= aspect; 4147 4148 // sign flip 4149 if ( position.x < 0.0 ) offset *= - 1.0; 4150 4151 // endcaps 4152 if ( position.y < 0.0 ) { 4153 4154 offset += - dir; 4155 4156 } else if ( position.y > 1.0 ) { 4157 4158 offset += dir; 4159 4160 } 4161 4162 // adjust for linewidth 4163 offset *= linewidth; 4164 4165 // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... 4166 offset /= resolution.y; 4167 4168 // select end 4169 vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; 4170 4171 // back to clip space 4172 offset *= clip.w; 4173 4174 clip.xy += offset; 4175 4176 #endif 4177 4178 gl_Position = clip; 4179 4180 vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation 4181 4182 #include <logdepthbuf_vertex> 4183 #include <clipping_planes_vertex> 4184 #include <fog_vertex> 4185 4186 } 4187 `,fragmentShader:` 4188 uniform vec3 diffuse; 4189 uniform float opacity; 4190 uniform float linewidth; 4191 4192 #ifdef USE_DASH 4193 4194 uniform float dashOffset; 4195 uniform float dashSize; 4196 uniform float gapSize; 4197 4198 #endif 4199 4200 varying float vLineDistance; 4201 4202 #ifdef WORLD_UNITS 4203 4204 varying vec4 worldPos; 4205 varying vec3 worldStart; 4206 varying vec3 worldEnd; 4207 4208 #ifdef USE_DASH 4209 4210 varying vec2 vUv; 4211 4212 #endif 4213 4214 #else 4215 4216 varying vec2 vUv; 4217 4218 #endif 4219 4220 #include <common> 4221 #include <fog_pars_fragment> 4222 #include <logdepthbuf_pars_fragment> 4223 #include <clipping_planes_pars_fragment> 4224 4225 #ifdef USE_COLOR 4226 #ifdef USE_LINE_COLOR_ALPHA 4227 varying vec4 vLineColor; 4228 #else 4229 varying vec3 vLineColor; 4230 #endif 4231 #endif 4232 4233 vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { 4234 4235 float mua; 4236 float mub; 4237 4238 vec3 p13 = p1 - p3; 4239 vec3 p43 = p4 - p3; 4240 4241 vec3 p21 = p2 - p1; 4242 4243 float d1343 = dot( p13, p43 ); 4244 float d4321 = dot( p43, p21 );
4245 float d1321 = dot( p13, p21 ); 4246 float d4343 = dot( p43, p43 ); 4247 float d2121 = dot( p21, p21 ); 4248 4249 float denom = d2121 * d4343 - d4321 * d4321; 4250 4251 float numer = d1343 * d4321 - d1321 * d4343; 4252 4253 mua = numer / denom; 4254 mua = clamp( mua, 0.0, 1.0 ); 4255 mub = ( d1343 + d4321 * ( mua ) ) / d4343; 4256 mub = clamp( mub, 0.0, 1.0 ); 4257 4258 return vec2( mua, mub ); 4259 4260 } 4261 4262 void main() { 4263 4264 #include <clipping_planes_fragment> 4265 4266 #ifdef USE_DASH 4267 4268 if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps 4269 4270 if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX 4271 4272 #endif 4273 4274 float alpha = opacity; 4275 4276 #ifdef WORLD_UNITS 4277 4278 // Find the closest points on the view ray and the line segment 4279 vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; 4280 vec3 lineDir = worldEnd - worldStart; 4281 vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); 4282 4283 vec3 p1 = worldStart + lineDir * params.x; 4284 vec3 p2 = rayEnd * params.y; 4285 vec3 delta = p1 - p2; 4286 float len = length( delta ); 4287 float norm = len / linewidth; 4288 4289 #ifndef USE_DASH 4290 4291 #ifdef USE_ALPHA_TO_COVERAGE 4292 4293 float dnorm = fwidth( norm ); 4294 alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); 4295 4296 #else 4297 4298 if ( norm > 0.5 ) { 4299 4300 discard; 4301 4302 } 4303 4304 #endif 4305 4306 #endif 4307 4308 #else 4309 4310 #ifdef USE_ALPHA_TO_COVERAGE 4311 4312 // artifacts appear on some hardware if a derivative is taken within a conditional 4313 float a = vUv.x; 4314 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 4315 float len2 = a * a + b * b; 4316 float dlen = fwidth( len2 ); 4317 4318 if ( abs( vUv.y ) > 1.0 ) { 4319 4320 alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); 4321 4322 } 4323 4324 #else 4325 4326 if ( abs( vUv.y ) > 1.0 ) { 4327 4328 float a = vUv.x; 4329 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 4330 float len2 = a * a + b * b; 4331 4332 if ( len2 > 1.0 ) discard; 4333 4334 } 4335 4336 #endif 4337 4338 #endif 4339 4340 vec4 diffuseColor = vec4( diffuse, alpha ); 4341 #ifdef USE_COLOR 4342 #ifdef USE_LINE_COLOR_ALPHA 4343 diffuseColor *= vLineColor; 4344 #else 4345 diffuseColor.rgb *= vLineColor; 4346 #endif 4347 #endif 4348 4349 #include <logdepthbuf_fragment> 4350 4351 gl_FragColor = diffuseColor; 4352 4353 #include <tonemapping_fragment> 4354 #include <${j2>=154?"colorspace_fragment":"encodings_fragment"}> 4355 #include <fog_fragment> 4356 #include <premultiplied_alpha_fragment> 4357 4358 } 4359 `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}
4359,alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}const Ky=new fn,Wb=new te,Xb=new te,zr=new fn,Hr=new fn,Ma=new fn,Zy=new te,Jy=new Xt,Vr=new w2,Yb=new te,Lg=new ir,Dg=new hr,Ea=new fn;let Aa,Cu;function qb(r,e,t){return Ea.set(0,0,-e,1).applyMatrix4(r.projectionMatrix),Ea.multiplyScalar(1/Ea.w),Ea.x=Cu/t.width,Ea.y=Cu/t.height,Ea.applyMatrix4(r.projectionMatrixInverse),Ea.multiplyScalar(1/Ea.w),Math.abs(Math.max(Ea.x,Ea.y))}function vU(r,e){const t=r.matrixWorld,n=r.geometry,i=n.attributes.instanceStart,s=n.attributes.instanceEnd,o=Math.min(n.instanceCount,i.count);for(let l=0,u=o;l<u;l++){Vr.start.fromBufferAttribute(i,l),Vr.end.fromBufferAttribute(s,l),Vr.applyMatrix4(t);const d=new te,p=new te;Aa.distanceSqToSegment(Vr.start,Vr.end,p,d),p.distanceTo(d)<Cu*.5&&e.push({point:p,pointOnLine:d,distance:Aa.origin.distanceTo(p),object:r,face:null,faceIndex:l,uv:null,[W2]:null})}}function yU(r,e,t){const n=e.projectionMatrix,s=r.material.resolution,o=r.matrixWorld,l=r.geometry,u=l.attributes.instanceStart,d=l.attributes.instanceEnd,p=Math.min(l.instanceCount,u.count),m=-e.near;Aa.at(1,Ma),Ma.w=1,Ma.applyMatrix4(e.matrixWorldInverse),Ma.applyMatrix4(n),Ma.multiplyScalar(1/Ma.w),Ma.x*=s.x/2,Ma.y*=s.y/2,Ma.z=0,Zy.copy(Ma),Jy.multiplyMatrices(e.matrixWorldInverse,o);for(let v=0,y=p;v<y;v++){if(zr.fromBufferAttribute(u,v),Hr.fromBufferAttribute(d,v),zr.w=1,Hr.w=1,zr.applyMatrix4(Jy),Hr.applyMatrix4(Jy),zr.z>m&&Hr.z>m)continue;if(zr.z>m){const T=zr.z-Hr.z,R=(zr.z-m)/T;zr.lerp(Hr,R)}else if(Hr.z>m){const T=Hr.z-zr.z,R=(Hr.z-m)/T;Hr.lerp(zr,R)}zr.applyMatrix4(n),Hr.applyMatrix4(n),zr.multiplyScalar(1/zr.w),Hr.multiplyScalar(1/Hr.w),zr.x*=s.x/2,zr.y*=s.y/2,Hr.x*=s.x/2,Hr.y*=s.y/2,Vr.start.copy(zr),Vr.start.z=0,Vr.end.copy(Hr),Vr.end.z=0;const M=Vr.closestPointToPointParameter(Zy,!0);Vr.at(M,Yb);const S=vM.lerp(zr.z,Hr.z,M),w=S>=-1&&S<=1,A=Zy.distanceTo(Yb)<Cu*.5;if(w&&A){Vr.start.fromBufferAttribute(u,v),Vr.end.fromBufferAttribute(d,v),Vr.start.applyMatrix4(o),Vr.end.applyMatrix4(o);const T=new te,R=new te;Aa.distanceSqToSegment(Vr.start,Vr.end,R,T),t.push({point:R,pointOnLine:T,distance:Aa.origin.distanceTo(R),object:r,face:null,faceIndex:v,uv:null,[W2]:null})}}}class Y2 extends ui{constructor(e=new O1,t=new B1({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let o=0,l=0,u=t.count;o<u;o++,l+=2)Wb.fromBufferAttribute(t,o),Xb.fromBufferAttribute(n,o),i[l]=l===0?0:i[l-1],i[l+1]=i[l]+Wb.distanceTo(Xb);const s=new E0(i,2,1);return e.setAttribute("instanceDistanceStart",new to(s,1,0)),e.setAttribute("instanceDistanceEnd",new to(s,1,1)),this}raycast(e,t){const n=this.material.worldUnits,i=e.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;Aa=e.ray;const o=this.matrixWorld,l=this.geometry,u=this.material;Cu=u.linewidth+s,l.boundingSphere===null&&l.computeBoundingSphere(),Dg.copy(l.boundingSphere).applyMatrix4(o);let d;if(n)d=Cu*.5;else{const m=Math.max(i.near,Dg.distanceToPoint(Aa.origin));d=qb(i,m,u.resolution)}if(Dg.radius+=d,Aa.intersectsSphere(Dg)===!1)return;l.boundingBox===null&&l.computeBoundingBox(),Lg.copy(l.boundingBox).applyMatrix4(o);let p;if(n)p=Cu*.5;else{const m=Math.max(i.near,Lg.distanceToPoint(Aa.origin));p=qb(i,m,u.resolution)}Lg.expandByScalar(p),Aa.intersectsBox(Lg)!==!1&&(n?vU(this,t):yU(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Ky),this.material.uniforms.resolution.value.set(Ky.z,Ky.w))}}class xU extends Y2{constructor(e=new X2,t=new B1({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}const dv=K.forwardRef(function({children:e,follow:t=!0,lockX:n=!1,lockY:i=!1,lockZ:s=!1,...o},l){const u=K.useRef(null),d=K.useRef(null),p=new Xr;return us(({camera:m})=>
4359{if(!t||!d.current)return;const v=u.current.rotation.clone();d.current.updateMatrix(),d.current.updateWorldMatrix(!1,!1),d.current.getWorldQuaternion(p),m.getWorldQuaternion(u.current.quaternion).premultiply(p.invert()),n&&(u.current.rotation.x=v.x),i&&(u.current.rotation.y=v.y),s&&(u.current.rotation.z=v.z)}),K.useImperativeHandle(l,()=>d.current,[]),K.createElement("group",vc({ref:d},o),K.createElement("group",{ref:u},e))}),Rx=K.forwardRef(function({points:e,color:t=16777215,vertexColors:n,linewidth:i,lineWidth:s,segments:o,dashed:l,...u},d){var p,m;const v=Bs(w=>w.size),y=K.useMemo(()=>o?new Y2:new xU,[o]),[x]=K.useState(()=>new B1),M=(n==null||(p=n[0])==null?void 0:p.length)===4?4:3,S=K.useMemo(()=>{const w=o?new O1:new X2,A=e.map(T=>{const R=Array.isArray(T);return T instanceof te||T instanceof fn?[T.x,T.y,T.z]:T instanceof We?[T.x,T.y,0]:R&&T.length===3?[T[0],T[1],T[2]]:R&&T.length===2?[T[0],T[1],0]:T});if(w.setPositions(A.flat()),n){t=16777215;const T=n.map(R=>R instanceof St?R.toArray():R);w.setColors(T.flat(),M)}return w},[e,o,n,M]);return K.useLayoutEffect(()=>{y.computeLineDistances()},[e,y]),K.useLayoutEffect(()=>{l?x.defines.USE_DASH="":delete x.defines.USE_DASH,x.needsUpdate=!0},[l,x]),K.useEffect(()=>()=>{S.dispose(),x.dispose()},[S]),K.createElement("primitive",vc({object:y,ref:d},u),K.createElement("primitive",{object:S,attach:"geometry"}),K.createElement("primitive",vc({object:x,attach:"material",color:t,vertexColors:!!n,resolution:[v.width,v.height],linewidth:(m=i??s)!==null&&m!==void 0?m:1,dashed:l,transparent:M===4},u)))});function _U(){var r=Object.create(null);function e(i,s){var o=i.id,l=i.name,u=i.dependencies;u===void 0&&(u=[]);var d=i.init;d===void 0&&(d=function(){});var p=i.getTransferables;if(p===void 0&&(p=null),!r[o])try{u=u.map(function(v){return v&&v.isWorkerModule&&(e(v,function(y){if(y instanceof Error)throw y}),v=r[v.id].value),v}),d=n("<"+l+">.init",d),p&&(p=n("<"+l+">.getTransferables",p));var m=null;typeof d=="function"?m=d.apply(void 0,u):console.error("worker module init function failed to rehydrate"),r[o]={id:o,value:m,getTransferables:p},s(m)}catch(v){v&&v.noLog||console.error(v),s(v)}}function t(i,s){var o,l=i.id,u=i.args;(!r[l]||typeof r[l].value!="function")&&s(new Error("Worker module "+l+": not found or its 'init' did not return a function"));try{var d=(o=r[l]).value.apply(o,u);d&&typeof d.then=="function"?d.then(p,function(m){return s(m instanceof Error?m:new Error(""+m))}):p(d)}catch(m){s(m)}function p(m){try{var v=r[l].getTransferables&&r[l].getTransferables(m);(!v||!Array.isArray(v)||!v.length)&&(v=void 0),s(m,v)}catch(y){console.error(y),s(y)}}}function n(i,s){var o=void 0;self.troikaDefine=function(u){return o=u};var l=URL.createObjectURL(new Blob(["/** "+i.replace(/\*/g,"")+` **/ 4360 4361troikaDefine( 4362`+s+` 4363)`],{type:"application/javascript"}));try{importScripts(l)}catch(u){console.error(u)}return URL.revokeObjectURL(l),delete self.troikaDefine,o}self.addEventListener("message",function(i){var s=i.data,o=s.messageId,l=s.action,u=s.data;try{l==="registerModule"&&e(u,function(d){d instanceof Error?postMessage({messageId:o,success:!1,error:d.message}):postMessage({messageId:o,success:!0,result:{isCallable:typeof d=="function"}})}),l==="callModule"&&t(u,function(d,p){d instanceof Error?postMessage({messageId:o,success:!1,error:d.message}):postMessage({messageId:o,success:!0,result:d},p||void 0)})}catch(d){postMessage({messageId:o,success:!1,error:d.stack})}})}function SU(r){var e=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return e._getInitResult().then(function(i){if(typeof i=="function")return i.apply(void 0,t);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var t=r.dependencies,n=r.init;t=Array.isArray(t)?t.map(function(s){return s&&(s=s.onMainThread||s,s._getInitResult&&(s=s._getInitResult())),s}):[];var i=Promise.all(t).then(function(s){return n.apply(null,s)});return e._getInitResult=function(){return i},i},e}var q2=function(){var r=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),r=!0}catch(t){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return q2=function(){return r},r},bU=0,wU=0,Qy=!1,qh=Object.create(null),Kh=Object.create(null),Px=Object.create(null);function Mf(r){if((!r||typeof r.init!="function")&&!Qy)throw new Error("requires `options.init` function");var e=r.dependencies,t=r.init,n=r.getTransferables,i=r.workerId,s=SU(r);i==null&&(i="#default");var o="workerModule"+ ++bU,l=r.name||o,u=null;e=e&&e.map(function(p){return typeof p=="function"&&!p.workerModuleData&&(Qy=!0,p=Mf({workerId:i,name:"<"+l+"> function dependency: "+p.name,init:`function(){return ( 4364`+jg(p)+` 4365)}`}),Qy=!1),p&&p.workerModuleData&&(p=p.workerModuleData),p});function d(){for(var p=[],m=arguments.length;m--;)p[m]=arguments[m];if(!q2())return s.apply(void 0,p);if(!u){u=Kb(i,"registerModule",d.workerModuleData);var v=function(){u=null,Kh[i].delete(v)};(Kh[i]||(Kh[i]=new Set)).add(v)}return u.then(function(y){var x=y.isCallable;
4365if(x)return Kb(i,"callModule",{id:o,args:p});throw new Error("Worker module function was called but `init` did not return a callable function")})}return d.workerModuleData={isWorkerModule:!0,id:o,name:l,dependencies:e,init:jg(t),getTransferables:n&&jg(n)},d.onMainThread=s,d}function MU(r){Kh[r]&&Kh[r].forEach(function(e){e()}),qh[r]&&(qh[r].terminate(),delete qh[r])}function jg(r){var e=r.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function EU(r){var e=qh[r];if(!e){var t=jg(_U);e=qh[r]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+r.replace(/\*/g,"")+` **/ 4366 4367;(`+t+")()"],{type:"application/javascript"}))),e.onmessage=function(n){var i=n.data,s=i.messageId,o=Px[s];if(!o)throw new Error("WorkerModule response with empty or unknown messageId");delete Px[s],o(i)}}return e}function Kb(r,e,t){return new Promise(function(n,i){var s=++wU;Px[s]=function(o){o.success?n(o.result):i(new Error("Error in worker "+e+" call: "+o.error))},EU(r).postMessage({messageId:s,action:e,data:t})})}function K2(){var r=(function(e){function t($,Z,O,j,re,ne,ie,he){var le=1-ie;he.x=le*le*$+2*le*ie*O+ie*ie*re,he.y=le*le*Z+2*le*ie*j+ie*ie*ne}function n($,Z,O,j,re,ne,ie,he,le,ye){var ze=1-le;ye.x=ze*ze*ze*$+3*ze*ze*le*O+3*ze*le*le*re+le*le*le*ie,ye.y=ze*ze*ze*Z+3*ze*ze*le*j+3*ze*le*le*ne+le*le*le*he}function i($,Z){for(var O=/([MLQCZ])([^MLQCZ]*)/g,j,re,ne,ie,he;j=O.exec($);){var le=j[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(ye){return parseFloat(ye)});switch(j[1]){case"M":ie=re=le[0],he=ne=le[1];break;case"L":(le[0]!==ie||le[1]!==he)&&Z("L",ie,he,ie=le[0],he=le[1]);break;case"Q":{Z("Q",ie,he,ie=le[2],he=le[3],le[0],le[1]);break}case"C":{Z("C",ie,he,ie=le[4],he=le[5],le[0],le[1],le[2],le[3]);break}case"Z":(ie!==re||he!==ne)&&Z("L",ie,he,re,ne);break}}}function s($,Z,O){O===void 0&&(O=16);var j={x:0,y:0};i($,function(re,ne,ie,he,le,ye,ze,Xe,Ie){switch(re){case"L":Z(ne,ie,he,le);break;case"Q":{for(var Y=ne,Ce=ie,Le=1;Le<O;Le++)t(ne,ie,ye,ze,he,le,Le/(O-1),j),Z(Y,Ce,j.x,j.y),Y=j.x,Ce=j.y;break}case"C":{for(var Ge=ne,Ae=ie,$e=1;$e<O;$e++)n(ne,ie,ye,ze,Xe,Ie,he,le,$e/(O-1),j),Z(Ge,Ae,j.x,j.y),Ge=j.x,Ae=j.y;break}}})}var o="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",l="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",u=new WeakMap,d={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function p($,Z){var O=$.getContext?$.getContext("webgl",d):$,j=u.get(O);if(!j){let Ge=function(B){var pe=ne[B];if(!pe&&(pe=ne[B]=O.getExtension(B),!pe))throw new Error(B+" not supported");return pe},Ae=function(B,pe){var ge=O.createShader(pe);return O.shaderSource(ge,B),O.compileShader(ge),ge},$e=function(B,pe,ge,ve){if(!ie[B]){var we={},ut={},Oe=O.createProgram();O.attachShader(Oe,Ae(pe,O.VERTEX_SHADER)),O.attachShader(Oe,Ae(ge,O.FRAGMENT_SHADER)),O.linkProgram(Oe),ie[B]={program:Oe,transaction:function(at){O.useProgram(Oe),at({setUniform:function(tt,wt){for(var nt=[],et=arguments.length-2;et-- >0;)nt[et]=arguments[et+2];var it=ut[wt]||(ut[wt]=O.getUniformLocation(Oe,wt));O["uniform"+tt].apply(O,[it].concat(nt))},setAttribute:function(tt,wt,nt,et,it){var ue=we[tt];ue||(ue=we[tt]={buf:O.createBuffer(),loc:O.getAttribLocation(Oe,tt),data:null}),O.bindBuffer(O.ARRAY_BUFFER,ue.buf),O.vertexAttribPointer(ue.loc,wt,O.FLOAT,!1,0,0),O.enableVertexAttribArray(ue.loc),re?O.vertexAttribDivisor(ue.loc,et):Ge("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(ue.loc,et),it!==ue.data&&(O.bufferData(O.ARRAY_BUFFER,it,nt),ue.data=it)}})}}}ie[B].transaction(ve)},Re=function(B,pe){le++;try{O.activeTexture(O.TEXTURE0+le);var ge=he[B];ge||(ge=he[B]=O.createTexture(),O.bindTexture(O.TEXTURE_2D,ge),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_MIN_FILTER,O.NEAREST),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_MAG_FILTER,O.NEAREST)),O.bindTexture(O.TEXTURE_2D,ge),pe(ge,le)}finally{le--}},He=function(B,pe,ge){var ve=O.createFramebuffer();ye.push(ve),O.bindFramebuffer(O.FRAMEBUFFER,ve),O.activeTexture(O.TEXTURE0+pe),O.bindTexture(O.TEXTURE_2D,B),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,B,0);try{ge(ve)}finally{O.deleteFramebuffer(ve),O.bindFramebuffer(O.FRAMEBUFFER,ye[--ye.length-1]||null)}},Q=function(){ne={},ie={},he={},le=-1,ye.length=0};var ze=Ge,Xe=Ae,Ie=$e,Y=Re,Ce=He,Le=Q,re=typeof WebGL2RenderingContext<"u"&&O instanceof WebGL2RenderingContext,ne={},ie={},he={},le=-1,ye=[];O.canvas.addEventListener("webglcontextlost",function(B){Q(),B.preventDefault()},!1),u.set(O,j={gl:O,isWebGL2:re,getExtension:Ge,withProgram:$e,withTexture:Re,withTextureFramebuffer:He,handleContextLoss:Q})}Z(j)}function m($,Z,O,j,re,ne,ie,he){ie===void 0&&(ie=15),he===void 0&&(he=null),p($,function(le){var ye=le.gl,ze=le.withProgram,Xe=le.withTexture;Xe("copy",function(Ie,Y){ye.texImage2D(ye.TEXTURE_2D,0,ye.RGBA,re,ne,0,ye.RGBA,ye.UNSIGNED_BYTE,Z),ze("copy",o,l,function(Ce){var Le=Ce.setUniform,Ge=Ce.setAttribute;Ge("aUV",2,ye.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),Le("1i","image",Y),ye.bindFramebuffer(ye.FRAMEBUFFER,he||null),ye.disable(ye.BLEND),ye.colorMask(ie&8,ie&4,ie&2,ie&1),ye.viewport(O,j,re,ne),ye.scissor(O,j,re,ne),ye.drawArrays(ye.TRIANGLES,0,3)})})})}function v($,Z,O){var j=$.width,re=$.height;p($,function(ne){var ie=ne.gl,he=new Uint8Array(j*re*4);ie.readPixels(0,0,j,re,ie.RGBA,ie.UNSIGNED_BYTE,he),$.width=Z,$.height=O,m(ie,he,0,0,j,re)})}var y=Object.freeze({__proto__:null,withWebGLContext:p,renderImageData:m,resizeWebGLCanvasWithoutClearing:v});function x($,Z,O,j,re,ne){ne===void 0&&(ne=1);var ie=new Uint8Array($*Z),he=j[2]-j[0],le=j[3]-j[1],ye=[];s(O,function(Ge,Ae,$e,Re){ye.push({x1:Ge,y1:Ae,x2:$e,y2:Re,minX:Math.min(Ge,$e),minY:Math.min(Ae,Re),maxX:Math.max(Ge,$e),maxY:M
4367ath.max(Ae,Re)})}),ye.sort(function(Ge,Ae){return Ge.maxX-Ae.maxX});for(var ze=0;ze<$;ze++)for(var Xe=0;Xe<Z;Xe++){var Ie=Ce(j[0]+he*(ze+.5)/$,j[1]+le*(Xe+.5)/Z),Y=Math.pow(1-Math.abs(Ie)/re,ne)/2;Ie<0&&(Y=1-Y),Y=Math.max(0,Math.min(255,Math.round(Y*255))),ie[Xe*$+ze]=Y}return ie;function Ce(Ge,Ae){for(var $e=1/0,Re=1/0,He=ye.length;He--;){var Q=ye[He];if(Q.maxX+Re<=Ge)break;if(Ge+Re>Q.minX&&Ae-Re<Q.maxY&&Ae+Re>Q.minY){var B=w(Ge,Ae,Q.x1,Q.y1,Q.x2,Q.y2);B<$e&&($e=B,Re=Math.sqrt($e))}}return Le(Ge,Ae)&&(Re=-Re),Re}function Le(Ge,Ae){for(var $e=0,Re=ye.length;Re--;){var He=ye[Re];if(He.maxX<=Ge)break;var Q=He.y1>Ae!=He.y2>Ae&&Ge<(He.x2-He.x1)*(Ae-He.y1)/(He.y2-He.y1)+He.x1;Q&&($e+=He.y1<He.y2?1:-1)}return $e!==0}}function M($,Z,O,j,re,ne,ie,he,le,ye){ne===void 0&&(ne=1),he===void 0&&(he=0),le===void 0&&(le=0),ye===void 0&&(ye=0),S($,Z,O,j,re,ne,ie,null,he,le,ye)}function S($,Z,O,j,re,ne,ie,he,le,ye,ze){ne===void 0&&(ne=1),le===void 0&&(le=0),ye===void 0&&(ye=0),ze===void 0&&(ze=0);for(var Xe=x($,Z,O,j,re,ne),Ie=new Uint8Array(Xe.length*4),Y=0;Y<Xe.length;Y++)Ie[Y*4+ze]=Xe[Y];m(ie,Ie,le,ye,$,Z,1<<3-ze,he)}function w($,Z,O,j,re,ne){var ie=re-O,he=ne-j,le=ie*ie+he*he,ye=le?Math.max(0,Math.min(1,(($-O)*ie+(Z-j)*he)/le)):0,ze=$-(O+ye*ie),Xe=Z-(j+ye*he);return ze*ze+Xe*Xe}var A=Object.freeze({__proto__:null,generate:x,generateIntoCanvas:M,generateIntoFramebuffer:S}),T="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",R="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",U="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",k=new Float32Array([0,0,2,0,0,2]),N=null,H=!1,F={},I=new WeakMap;function G($){if(!H&&!oe($))throw new Error("WebGL generation not supported")}function W($,Z,O,j,re,ne,ie){if(ne===void 0&&(ne=1),ie===void 0&&(ie=null),!ie&&(ie=N,!ie)){var he=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!he)throw new Error("OffscreenCanvas or DOM canvas not supported");ie=N=he.getContext("webgl",{depth:!1})}G(ie);var le=new Uint8Array($*Z*4);p(ie,function(Ie){var Y=Ie.gl,Ce=Ie.withTexture,Le=Ie.withTextureFramebuffer;Ce("readable",function(Ge,Ae){Y.texImage2D(Y.TEXTURE_2D,0,Y.RGBA,$,Z,0,Y.RGBA,Y.UNSIGNED_BYTE,null),Le(Ge,Ae,function($e){J($,Z,O,j,re,ne,Y,$e,0,0,0),Y.readPixels(0,0,$,Z,Y.RGBA,Y.UNSIGNED_BYTE,le)})})});for(var ye=new Uint8Array($*Z),ze=0,Xe=0;ze<le.length;ze+=4)ye[Xe++]=le[ze];return ye}function X($,Z,O,j,re,ne,ie,he,le,ye){ne===void 0&&(ne=1),he===void 0&&(he=0),le===void 0&&(le=0),ye===void 0&&(ye=0),J($,Z,O,j,re,ne,ie,null,he,le,ye)}function J($,Z,O,j,re,ne,ie,he,le,ye,ze){ne===void 0&&(ne=1),le===void 0&&(le=0),ye===void 0&&(ye=0),ze===void 0&&(ze=0),G(ie);var Xe=[];s(O,function(Ie,Y,Ce,Le){Xe.push(Ie,Y,Ce,Le)}),Xe=new Float32Array(Xe),p(ie,function(Ie){var Y=Ie.gl,Ce=Ie.isWebGL2,Le=Ie.getExtension,Ge=Ie.withProgram,Ae=Ie.withTexture,$e=Ie.withTextureFramebuffer,Re=Ie.handleContextLoss;if(Ae("rawDistances",function(He,Q){($!==He._lastWidth||Z!==He._lastHeight)&&Y.texImage2D(Y.TEXTURE_2D,0,Y.RGBA,He._lastWidth=$,He._lastHeight=Z,0,Y.RGBA,Y.UNSIGNED_BYTE,null),Ge("main",T,R,function(B){var pe=B.setAttribute,ge=B.setUniform,ve=!Ce&&Le("ANGLE_instanced_arrays"),we=!Ce&&Le("EXT_blend_minmax");pe("aUV",2,Y.STATIC_DRAW,0,k),pe("aLineSegment",4,Y.DYNAMIC_DRAW,1,Xe),ge.apply(void 0,["4f","uGlyphBounds"].concat(j)),ge("1f","uMaxDistance",re),ge("1f","uExponent",ne),$e(He,Q,function(ut){Y.enable(Y.BLEND),Y.colorMask(!0,!0,
4367!0,!0),Y.viewport(0,0,$,Z),Y.scissor(0,0,$,Z),Y.blendFunc(Y.ONE,Y.ONE),Y.blendEquationSeparate(Y.FUNC_ADD,Ce?Y.MAX:we.MAX_EXT),Y.clear(Y.COLOR_BUFFER_BIT),Ce?Y.drawArraysInstanced(Y.TRIANGLES,0,3,Xe.length/4):ve.drawArraysInstancedANGLE(Y.TRIANGLES,0,3,Xe.length/4)})}),Ge("post",o,U,function(B){B.setAttribute("aUV",2,Y.STATIC_DRAW,0,k),B.setUniform("1i","tex",Q),Y.bindFramebuffer(Y.FRAMEBUFFER,he),Y.disable(Y.BLEND),Y.colorMask(ze===0,ze===1,ze===2,ze===3),Y.viewport(le,ye,$,Z),Y.scissor(le,ye,$,Z),Y.drawArrays(Y.TRIANGLES,0,3)})}),Y.isContextLost())throw Re(),new Error("webgl context lost")})}function oe($){var Z=!$||$===N?F:$.canvas||$,O=I.get(Z);if(O===void 0){H=!0;var j=null;try{var re=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],ne=W(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,$);O=ne&&re.length===ne.length&&ne.every(function(ie,he){return ie===re[he]}),O||(j="bad trial run results",console.info(re,ne))}catch(ie){O=!1,j=ie.message}j&&console.warn("WebGL SDF generation not supported:",j),H=!1,I.set(Z,O)}return O}var se=Object.freeze({__proto__:null,generate:W,generateIntoCanvas:X,generateIntoFramebuffer:J,isSupported:oe});function fe($,Z,O,j,re,ne){re===void 0&&(re=Math.max(j[2]-j[0],j[3]-j[1])/2),ne===void 0&&(ne=1);try{return W.apply(se,arguments)}catch(ie){return console.info("WebGL SDF generation failed, falling back to JS",ie),x.apply(A,arguments)}}function V($,Z,O,j,re,ne,ie,he,le,ye){re===void 0&&(re=Math.max(j[2]-j[0],j[3]-j[1])/2),ne===void 0&&(ne=1),he===void 0&&(he=0),le===void 0&&(le=0),ye===void 0&&(ye=0);try{return X.apply(se,arguments)}catch(ze){return console.info("WebGL SDF generation failed, falling back to JS",ze),M.apply(A,arguments)}}return e.forEachPathCommand=i,e.generate=fe,e.generateIntoCanvas=V,e.javascript=A,e.pathToLineSegments=s,e.webgl=se,e.webglUtils=y,Object.defineProperty(e,"__esModule",{value:!0}),e})({});return r}function TU(){var r=(function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},n={},i={};n.L=1,i[1]="L",Object.keys(t).forEach(function(Re,He){n[Re]=1<<He+1,i[n[Re]]=Re}),Object.freeze(n);
vendor: 7,656 bytes, line 4367
4367var s=n.LRI|n.RLI|n.FSI,o=n.L|n.R|n.AL,l=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,u=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,d=n.S|n.WS|n.B|s|n.PDI|u,p=null;function m(){if(!p){p=new Map;var Re=function(Q){if(t.hasOwnProperty(Q)){var B=0;t[Q].split(",").forEach(function(pe){var ge=pe.split("+"),ve=ge[0],we=ge[1];ve=parseInt(ve,36),we=we?parseInt(we,36):0,p.set(B+=ve,n[Q]);for(var ut=0;ut<we;ut++)p.set(++B,n[Q])})}};for(var He in t)Re(He)}}function v(Re){return m(),p.get(Re.codePointAt(0))||n.L}function y(Re){return i[v(Re)]}var x={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function M(Re,He){var Q=36,B=0,pe=new Map,ge=He&&new Map,ve;return Re.split(",").forEach(function we(ut){if(ut.indexOf("+")!==-1)for(var Oe=+ut;Oe--;)we(ve);else{ve=ut;var Qe=ut.split(">"),at=Qe[0],Ke=Qe[1];at=String.fromCodePoint(B+=parseInt(at,Q)),Ke=String.fromCodePoint(B+=parseInt(Ke,Q)),pe.set(at,Ke),He&&ge.set(Ke,at)}}),{map:pe,reverseMap:ge}}var S,w,A;function T(){if(!S){var Re=M(x.pairs,!0),He=Re.map,Q=Re.reverseMap;S=He,w=Q,A=M(x.canonical,!1).map}}function R(Re){return T(),S.get(Re)||null}function U(Re){return T(),w.get(Re)||null}function k(Re){return T(),A.get(Re)||null}var N=n.L,H=n.R,F=n.EN,I=n.ES,G=n.ET,W=n.AN,X=n.CS,J=n.B,oe=n.S,se=n.ON,fe=n.BN,V=n.NSM,$=n.AL,Z=n.LRO,O=n.RLO,j=n.LRE,re=n.RLE,ne=n.PDF,ie=n.LRI,he=n.RLI,le=n.FSI,ye=n.PDI;function ze(Re,He){for(var Q=125,B=new Uint32Array(Re.length),pe=0;pe<Re.length;pe++)B[pe]=v(Re[pe]);var ge=new Map;function ve(Pi,Bi){var bi=B[Pi];B[Pi]=Bi,ge.set(bi,ge.get(bi)-1),bi&l&&ge.set(l,ge.get(l)-1),ge.set(Bi,(ge.get(Bi)||0)+1),Bi&l&&ge.set(l,(ge.get(l)||0)+1)}for(var we=new Uint8Array(Re.length),ut=new Map,Oe=[],Qe=null,at=0;at<Re.length;at++)Qe||Oe.push(Qe={start:at,end:Re.length-1,level:He==="rtl"?1:He==="ltr"?0:Yi(at,!1)}),B[at]&J&&(Qe.end=at,Qe=null);for(var Ke=re|j|O|Z|s|ye|ne|J,tt=function(Pi){return Pi+(Pi&1?1:2)},wt=function(Pi){return Pi+(Pi&1?2:1)},nt=0;nt<Oe.length;nt++){Qe=Oe[nt];var et=[{_level:Qe.level,_override:0,_isolate:0}],it=void 0,ue=0,qe=0,ce=0;ge.clear();for(var Fe=Qe.start;Fe<=Qe.end;Fe++){var xe=B[Fe];if(it=et[et.length-1],ge.set(xe,(ge.get(xe)||0)+1),xe&l&&ge.set(l,(ge.get(l)||0)+1),xe&Ke)if(xe&(re|j)){we[Fe]=it._level;var De=(xe===re?wt:tt)(it._level);De<=Q&&!ue&&!qe?et.push({_level:De,_override:0,_isolate:0}):ue||qe++}else if(xe&(O|Z)){we[Fe]=it._level;var rt=(xe===O?wt:tt)(it._level);rt<=Q&&!ue&&!qe?et.push({_level:rt,_override:xe&O?H:N,_isolate:0}):ue||qe++}else if(xe&s){xe&le&&(xe=Yi(Fe+1,!0)===1?he:ie),we[Fe]=it._level,it._override&&ve(Fe,it._override);var mt=(xe===he?wt:tt)(it._level);mt<=Q&&ue===0&&qe===0?(ce++,et.push({_level:mt,_override:0,_isolate:1,_isolInitIndex:Fe})):ue++}else if(xe&ye){if(ue>0)ue--;else if(ce>0){for(qe=0;!et[et.length-1]._isolate;)et.pop();var vt=et[et.length-1]._isolInitIndex;vt!=null&&(ut.set(vt,Fe),ut.set(Fe,vt)),et.pop(),ce--}it=et[et.length-1],we[Fe]=it._level,it._override&&ve(Fe,it._override)}else xe&ne?(ue===0&&(qe>0?qe--:!it._isolate&&et.length>1&&(et.pop(),it=et[et.length-1])),we[Fe]=it._level):xe&J&&(we[Fe]=Qe.level);else we[Fe]=it._level,it._override&&xe!==fe&&ve(Fe,it._override)}for(var kt=[],Ft=null,pt=Qe.start;pt<=Qe.end;pt++){var Kt=B[pt];if(!(Kt&u)){var dn=we[pt],Sn=Kt&s,bn=Kt===ye;Ft&&dn===Ft._level?(Ft._end=pt,Ft._endsWithIsolInit=Sn):kt.push(Ft={_start:pt,_end:pt,_level:dn,_startsWithPDI:bn,_endsWithIsolInit:Sn})}}for(var ii=[],vr=0;vr<kt.length;vr++){var fi=kt[vr];if(!fi._startsWithPDI||fi._startsWithPDI&&!ut.has(fi._start)){for(var Ai=[Ft=fi],_i=void 0;Ft&&Ft._endsWithIsolInit&&(_i=ut.get(Ft._end))!=null;)for(var Si=vr+1;Si<kt.length;Si++)if(kt[Si]._start===_i){Ai.push(Ft=kt[Si]);break}for(var hi=[],Pr=0;Pr<Ai.length;Pr++)for(var xo=Ai[Pr],Vn=xo._start;Vn<=xo._end;Vn++)hi.push(Vn);for(var Hs=we[hi[0]],ee=Qe.level,Se=hi[0]-1;Se>=0;Se--)if(!(B[Se]&u)){ee=we[Se];break}var Ue=hi[hi.length-1],ke=we[Ue],Te=Qe.level;if(!(B[Ue]&s)){for(var lt=Ue+1;lt<=Qe.end;lt++)if(!(B[lt]&u)){Te=we[lt];break}}ii.push({_seqIndices:hi,_sosType:Math.max(ee,Hs)%2?H:N,_eosType:Math.max(Te,ke)%2?H:N})}}for(var yt=0;yt<ii.length;yt++){var Tt=ii[yt],je=Tt._seqIndices,Lt=Tt._sosType,Ot=Tt._eosType,xt=we[je[0]]&1?H:N;if(ge.get(V))for(var Zt=0;Zt<je.length;Zt++){var wn=je[Zt];if(B[wn]&V){for(var pn=Lt,En=Zt-1;En>=0;En--)if(!(B[je[En]]&u)){pn=B[je[En]];break}ve(wn,pn&(s|ye)?se:pn)}}if(ge.get(F))for(var Mt=0;Mt<je.length;Mt++){var ft=je[Mt];if(B[ft]&F)for(var Qt=Mt-1;Qt>=-1;Qt--){var zt=Qt===-1?Lt:B[je[Qt]];if(zt&o){zt===$&&ve(ft,W);break}}}if(ge.get($))for(var xn=0;xn<je.length;xn++){var ri=je[xn];B[ri]&$&&ve(ri,H)}if(ge.get(I)||ge.get(X))for(var Tn=1;Tn<je.length-1;Tn++){var Hn=je[Tn];if(B[Hn]&(I|X)){for(var an=0,Ci=0,fs=Tn-1;fs>=0&&(an=B[je[fs]],!!(an&u));fs--);for(var Jn=Tn+1;Jn<je.length&&(Ci=B[je[Jn]],!!(Ci&u));Jn++);an===Ci&&(B[Hn]===I?an===F:an&(F|W))&&ve(Hn,an)}}if(ge.get(F))for(var pi=0;pi<je.length;pi++){var Ni=je[pi];if(B[Ni]&F){for(var Yr=pi-1;Yr>=0&&B[je[Yr]]&(G|u);Yr--)ve(je[Yr],F);for(pi++;pi<je.length&&B[je[pi]]&(G|u|F);pi++)B[je[pi]]!==F&&ve(je[pi],F)}}if(ge.get(G)||ge.get(I)||ge.get(X))for(var qr=0;qr<je.length;qr++){var Ua=je[qr];if(B[Ua]&(G|I|X)){ve(Ua,se);for(var Ee=qr-1;Ee>=0&&B[je[Ee]]&u;Ee--)ve(je[Ee],se);for(var Ze=qr+1;Ze<je.length&&B[je[Ze]]&u;Ze++)ve(je[Ze],se)}}if(ge.get(F))for(var Ht=0,Jt=Lt;Ht<je.length;Ht++){var yr=je[Ht],Qn=B[yr];Qn&F?Jt===N&&ve(yr,N):Qn&o&&(Jt=Qn)}if(ge.get(l)){var hs=H|F|W,so=hs|N,Ir=[];{for(var Kr=[],Ri=0;Ri<je.length;Ri++)if(B[je[Ri]]&l){var Yt=Re[je[Ri]],An=void 0;if(R(Yt)!==null)if(Kr.length<63)Kr.push({char:Yt,seqIndex:Ri});else break;else if((An=U(Yt))!==null)for(var Ln=Kr.length-1;Ln>=0;Ln--){var gn=Kr[Ln].char;if(gn===An||gn===U(k(Yt))||R(k(gn))===Yt){Ir.push([Kr[Ln].seqIndex,Ri]),Kr.length=Ln;break}}}Ir.sort(function(Pi,Bi){return Pi[0]-Bi[0]})}for(var jn=0;jn<Ir.length;jn++){for(var _o=Ir[jn],Wn=_o[0],Gs=_o[1],Hu=!1,xr=0,aa=Wn+1;aa<Gs;aa++){var la=je[aa];if(B[la]&so){Hu=!0;var ps=B[la]&hs?H:N;if(ps===xt){xr=ps;break}}}if(Hu&&!xr){xr=Lt;for(var So=Wn-1;So>=0;So--){var ca=je[So];if(B[ca]&so){var ji=B[ca]&hs?H:N;ji!==xt?xr=ji:xr=xt;break}}}if(xr){if(B[je[Wn]]=B[je[Gs]]=xr,xr!==xt){for(var Wi=Wn+1;Wi<je.length;Wi++)if(!(B[je[Wi]]&u)){v(Re[je[Wi]])&V&&(B[je[Wi]]=xr);break}}if(xr!==xt){for(var oo=Gs+1;oo<je.length;oo++)if(!(B[je[oo]]&u)){v(Re[je[oo]])&V&&(B[je[oo]]=xr);break}}}}for(var Cs=0;Cs<je.length;Cs++)if(B[je[Cs]]&l){for(var ka=Cs,ua=Cs,_r=Lt,da=Cs-1;da>=0;da--)if(B[je[da]]&u)ka=da;else{_r=B[je[da]]&hs?H:N;break}for(var Zr=Ot,bo=Cs+1;bo<je.length;bo++)if(B[je[bo]]&(l|u))ua=bo;else{Zr=B[je[bo]]&hs?H:N;break}for(var Xi=ka;Xi<=ua;Xi++)B[je[Xi]]=_r===Zr?_r:xt;Cs=ua}}}for(var Oi=Qe.start;Oi<=Qe.end;Oi++){var wo=we[Oi],Jr=B[Oi];if(wo&1?Jr&(N|F|W)&&we[Oi]++:Jr&H?we[Oi]++:Jr&(W|F)&&(we[Oi]+=2),Jr&u&&(we[Oi]=Oi===0?Qe.level:we[Oi-1]),Oi===Qe.end||v(Re[Oi])&(oe|J))for(var Mo=Oi;Mo>=0&&v(Re[Mo])&d;Mo--)we[Mo]=Qe.level}}return{levels:we,paragraphs:Oe};function Yi(Pi,Bi){for(var bi=Pi;bi<Re.length;bi++){var si=B[bi];if(si&(H|$))return 1;if(si&(J|N)||Bi&&si===ye)return 0;if(si&s){var Lr=Eo(bi);bi=Lr===-1?Re.length:Lr}}return 0}function Eo(Pi){for(var Bi=1,bi=Pi+1;bi<Re.length;bi++){var si=B[bi];if(si&J)break;if(si&ye){if(--Bi===0)return bi}else si&s&&Bi++}return-1}}var Xe="14>1,j>2,t>2,u>2,1a>g,2v3>
43671,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",Ie;function Y(){if(!Ie){var Re=M(Xe,!0),He=Re.map,Q=Re.reverseMap;Q.forEach(function(B,pe){He.set(pe,B)}),Ie=He}}function Ce(Re){return Y(),Ie.get(Re)||null}function Le(Re,He,Q,B){var pe=Re.length;Q=Math.max(0,Q==null?0:+Q),B=Math.min(pe-1,B==null?pe-1:+B);for(var ge=new Map,ve=Q;ve<=B;ve++)if(He[ve]&1){var we=Ce(Re[ve]);we!==null&&ge.set(ve,we)}return ge}function Ge(Re,He,Q,B){var pe=Re.length;Q=Math.max(0,Q==null?0:+Q),B=Math.min(pe-1,B==null?pe-1:+B);var ge=[];return He.paragraphs.forEach(function(ve){var we=Math.max(Q,ve.start),ut=Math.min(B,ve.end);if(we<ut){for(var Oe=He.levels.slice(we,ut+1),Qe=ut;Qe>=we&&v(Re[Qe])&d;Qe--)Oe[Qe]=ve.level;for(var at=ve.level,Ke=1/0,tt=0;tt<Oe.length;tt++){var wt=Oe[tt];wt>at&&(at=wt),wt<Ke&&(Ke=wt|1)}for(var nt=at;nt>=Ke;nt--)for(var et=0;et<Oe.length;et++)if(Oe[et]>=nt){for(var it=et;et+1<Oe.length&&Oe[et+1]>=nt;)et++;et>it&&ge.push([it+we,et+we])}}}),ge}function Ae(Re,He,Q,B){var pe=$e(Re,He,Q,B),ge=[].concat(Re);return pe.forEach(function(ve,we){ge[we]=(He.levels[ve]&1?Ce(Re[ve]):null)||Re[ve]}),ge.join("")}function $e(Re,He,Q,B){for(var pe=Ge(Re,He,Q,B),ge=[],ve=0;ve<Re.length;ve++)ge[ve]=ve;return pe.forEach(function(we){for(var ut=we[0],Oe=we[1],Qe=ge.slice(ut,Oe+1),at=Qe.length;at--;)ge[Oe-at]=Qe[at]}),ge}return e.closingToOpeningBracket=U,e.getBidiCharType=v,e.getBidiCharTypeName=y,e.getCanonicalBracket=k,e.getEmbeddingLevels=ze,e.getMirroredCharacter=Ce,e.getMirroredCharactersMap=Le,e.getReorderSegments=Ge,e.getReorderedIndices=$e,e.getReorderedString=Ae,e.openingToClosingBracket=R,Object.defineProperty(e,"__esModule",{value:!0}),e})({});return r}const Z2=/\bvoid\s+main\s*\(\s*\)\s*{/g;function Ix(r){const e=/^[ \t]*#include +<([\w\d./]+)>/gm;function t(n,i){let s=cn[i];return s?Ix(s):n}return r.replace(e,t)}const Gr=[];for(let r=0;r<256;r++)Gr[r]=(r<16?"0":"")+r.toString(16);function AU(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Gr[r&255]+Gr[r>>8&255]+Gr[r>>16&255]+Gr[r>>24&255]+"-"+Gr[e&255]+Gr[e>>8&255]+"-"+Gr[e>>16&15|64]+Gr[e>>24&255]+"-"+Gr[t&63|128]+Gr[t>>8&255]+"-"+Gr[t>>16&255]+Gr[t>>24&255]+Gr[n&255]+Gr[n>>8&255]+Gr[n>>16&255]+Gr[n>>24&255]).toUpperCase()}const fu=Object.assign||function(){let r=arguments[0];for(let e=1,t=arguments.length;e<t;e++){let n=arguments[e];if(n)for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},CU=Date.now(),Zb=new WeakMap,Jb=new Map;let RU=1e10;function Lx(r,e){const t=DU(e);let n=Zb.get(r);if(n||Zb.set(r,n=Object.create(null)),n[t])return new n[t];const i=`_onBeforeCompile${t}`,s=function(d,p){r.onBeforeCompile.call(this,d,p);const m=this.customProgramCacheKey()+"|"+d.vertexShader+"|"+d.fragmentShader;let v=Jb[m];if(!v){const y=PU(this,d,e,t);v=Jb[m]=y}d.vertexShader=v.vertexShader,d.fragmentShader=v.fragmentShader,fu(d.uniforms,this.uniforms),e.timeUniform&&(d.uniforms[e.timeUniform]={get value(){return Date.now()-CU}}),this[i]&&this[i](d)},o=function(){return l(e.chained?r:r.clone())},l=function(d){const p=Object.create(d,u);return Object.defineProperty(p,"baseMaterial",{value:r}),Object.defineProperty(p,"id",{value:RU++}),p.uuid=AU(),p.uniforms=fu({},d.uniforms,e.uniforms),p.defines=fu({},d.defines,e.defines),p.defines[`TROIKA_DERIVED_MATERIAL_${t}`]="",p.extensions=fu({},d.extensions,e.extensions),p._listeners=void 0,p},u={constructor:{value:o},isDerivedMaterial:{value:!0},type:{get:()=>r.type,set:d=>{r.type=d}},isDerivedFrom:{writable:!0,configurable:!0,value:function(d){const p=this.baseMaterial;return d===p||p.isDerivedMaterial&&p.isDerivedFrom(d)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return r.customProgramCacheKey()+"|"+t}},onBeforeCompile:{get(){return s},set(d){this[i]=d}},copy:{writable:!0,configurable:!0,value:function(d){return r.copy.call(this,d),!r.isShaderMaterial&&!r.isDerivedMaterial&&(fu(this.extensions,d.extensions),fu(this.defines,d.defines),fu(this.uniforms,up.clone(d.uniforms)
4367)),this}},clone:{writable:!0,configurable:!0,value:function(){const d=new r.constructor;return l(d).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let d=this._depthMaterial;return d||(d=this._depthMaterial=Lx(r.isDerivedMaterial?r.getDepthMaterial():new Pp({depthPacking:Ep}),e),d.defines.IS_DEPTH_MATERIAL="",d.uniforms=this.uniforms),d}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let d=this._distanceMaterial;return d||(d=this._distanceMaterial=Lx(r.isDerivedMaterial?r.getDistanceMaterial():new V0,e),d.defines.IS_DISTANCE_MATERIAL="",d.uniforms=this.uniforms),d}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:d,_distanceMaterial:p}=this;d&&d.dispose(),p&&p.dispose(),r.dispose.call(this)}}};return n[t]=o,new o}function PU(r,{vertexShader:e,fragmentShader:t},n,i){let{vertexDefs:s,vertexMainIntro:o,vertexMainOutro:l,vertexTransform:u,fragmentDefs:d,fragmentMainIntro:p,fragmentMainOutro:m,fragmentColorTransform:v,customRewriter:y,timeUniform:x}=n;if(s=s||"",o=o||"",l=l||"",d=d||"",p=p||"",m=m||"",(u||y)&&(e=Ix(e)),(v||y)&&(t=t.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,` 4368//!BEGIN_POST_CHUNK $1 4369$& 4370//!END_POST_CHUNK 4371`),t=Ix(t)),y){let M=y({vertexShader:e,fragmentShader:t});e=M.vertexShader,t=M.fragmentShader}if(v){let M=[];t=t.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,S=>(M.push(S),"")),m=`${v} 4372${M.join(` 4373`)} 4374${m}`}if(x){const M=` 4375uniform float ${x}; 4376`;s=M+s,d=M+d}return u&&(e=`vec3 troika_position_${i}; 4377vec3 troika_normal_${i}; 4378vec2 troika_uv_${i}; 4379${e} 4380`,s=`${s} 4381void troikaVertexTransform${i}(inout vec3 position, inout vec3 normal, inout vec2 uv) { 4382 ${u} 4383} 4384`,o=` 4385troika_position_${i} = vec3(position); 4386troika_normal_${i} = vec3(normal); 4387troika_uv_${i} = vec2(uv); 4388troikaVertexTransform${i}(troika_position_${i}, troika_normal_${i}, troika_uv_${i}); 4389${o} 4390`,e=e.replace(/\b(position|normal|uv)\b/g,(M,S,w,A)=>/\battribute\s+vec[23]\s+$/.test(A.substr(0,w))?S:`troika_${S}_${i}`),r.map&&r.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${i}`))),e=Qb(e,i,s,o,l),t=Qb(t,i,d,p,m),{vertexShader:e,fragmentShader:t}}function Qb(r,e,t,n,i){return(n||i||t)&&(r=r.replace(Z2,` 4391${t} 4392void troikaOrigMain${e}() {`),r+=` 4393void main() { 4394 ${n} 4395 troikaOrigMain${e}(); 4396 ${i} 4397}`),r}function IU(r,e){return r==="uniforms"?void 0:typeof e=="function"?e.toString():e}let LU=0;const $b=new Map;function DU(r){const e=JSON.stringify(r,IU);let t=$b.get(e);return t==null&&$b.set(e,t=++LU),t}/*! 4398Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering. 4399Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE 4400*/function UU(){return typeof window>"u"&&(self.window=self),(function(r){var e={parse:function(i){var s=e._bin,o=new Uint8Array(i);if(s.readASCII(o,0,4)=="ttcf"){var l=4;s.readUshort(o,l),l+=2,s.readUshort(o,l),l+=2;var u=s.readUint(o,l);l+=4;for(var d=[],p=0;p<u;p++){var m=s.readUint(o,l);l+=4,d.push(e._readFont(o,m))}return d}return[e._readFont(o,0)]},_readFont:function(i,s){var o=e._bin,l=s;o.readFixed(i,s),s+=4;var u=o.readUshort(i,s);s+=2,o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2;for(var d=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],p={_data:i,_offset:l},m={},v=0;v<u;v++){var y=o.readASCII(i,s,4);s+=4,o.readUint(i,s),s+=4;var x=o.readUint(i,s);s+=4;var M=o.readUint(i,s);s+=4,m[y]={offset:x,length:M}}for(v=0;v<d.length;v++){var S=d[v];m[S]&&(p[S.trim()]=e[S.trim()].parse(i,m[S].offset,m[S].length,p))}return p},_tabOffset:function(i,s,o){for(var l=e._bin,u=l.readUshort(i,o+4),d=o+12,p=0;p<u;p++){var m=l.readASCII(i,d,4);d+=4,l.readUint(i,d),d+=4;var v=l.readUint(i,d);if(d+=4,l.readUint(i,d),d+=4,m==s)return v}return 0}};e._bin={readFixed:function(i,s){return(i[s]<<8|i[s+1])+(i[s+2]<<8|i[s+3])/65540},readF2dot14:function(i,s){return e._bin.readShort(i,s)/16384},readInt:function(i,s){return e._bin._view(i).getInt32(s)},readInt8:function(i,s){return e._bin._view(i).getInt8(s)},readShort:function(i,s){return e._bin._view(i).getInt16(s)},readUshort:function(i,s){return e._bin._view(i).getUint16(s)},readUshorts:function(i,s,o){for(var l=[],u=0;u<o;u++)l.push(e._bin.readUshort(i,s+2*u));return l},readUint:function(i,s){return e._bin._view(i).getUint32(s)},readUint64:function(i,s){return 4294967296*e._bin.readUint(i,s)+e._bin.readUint(i,s+4)},readASCII:function(i,s,o){for(var l="",u=0;u<o;u++)l+=String.fromCharCode(i[s+u]);return l},readUnicode:function(i,s,o){for(var l="",u=0;u<o;u++){var d=i[s++]<<8|i[s++];l+=String.fromCharCode(d)}return l},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(i,s,o){var l=e._bin._tdec;return l&&s==0&&o==i.length?l.decode(i):e._bin.readASCII(i,s,o)},readBytes:function(i,s,o){for(var l=[],u=0;u<o;u++)l.push(i[s+u]);return l},readASCIIArray:function(i,s,o){for(var l=[],u=0;u<o;u++)l.push(String.fromCharCode(i[s+u]));return l},_view:function(i){return i._dataView||(i._dataView=i.buffer?new DataView(i.buffer,i.byteOffset,i.byteLength):new DataView(new Uint8Array(i).buffer))}},e._lctf={},e._lctf.parse=function(i,s,o,l,u){var d=e._bin,p={},m=s;d.readFixed(i,s),s+=4;var v=d.readUshort(i,s);s+=2;var y=d.readUshort(i,s);s+=2;var x=d.readUshort(i,s);return s+=2,p.scriptList=e._lctf.readScriptList(i,m+v),p.featureList=e._lctf.readFeatureList(i,m+y),p.lookupList=e._lctf.readLookupList(i,m+x,u),p},e._lctf.readLookupList=function(i,s,o){var l=e._bin,u=s,d=[],p=l.readUshort(i,s);s+=2;for(var m=0;m<p;m++){var v=l.readUshort(i,s);s+=2;var y=e._lctf.readLookupTable(i,u+v,o);d.push(y)}return d},e._lctf.readLookupTable=function(i,s,o){var l=e._bin,u=s,d={tabs:[]};d.ltype=l.readUshort(i,s),s+=2,d.flag=l.readUshort(i,s),s+=2;var p=l.readUshort(i,s);s+=2;for(var m=d.ltype,v=0;v<p;v++){var y=l.readUshort(i,s);s+=2;var x=o(i,m,u+y,d);d.tabs.push(x)}return d},e._lctf.numOfOnes=function(i){for(var s=0,o=0;o<32;o++)(i>
4400>>o&1)!=0&&s++;return s},e._lctf.readClassDef=function(i,s){var o=e._bin,l=[],u=o.readUshort(i,s);if(s+=2,u==1){var d=o.readUshort(i,s);s+=2;var p=o.readUshort(i,s);s+=2;for(var m=0;m<p;m++)l.push(d+m),l.push(d+m),l.push(o.readUshort(i,s)),s+=2}if(u==2){var v=o.readUshort(i,s);for(s+=2,m=0;m<v;m++)l.push(o.readUshort(i,s)),s+=2,l.push(o.readUshort(i,s)),s+=2,l.push(o.readUshort(i,s)),s+=2}return l},e._lctf.getInterval=function(i,s){for(var o=0;o<i.length;o+=3){var l=i[o],u=i[o+1];if(i[o+2],l<=s&&s<=u)return o}return-1},e._lctf.readCoverage=function(i,s){var o=e._bin,l={};l.fmt=o.readUshort(i,s),s+=2;var u=o.readUshort(i,s);return s+=2,l.fmt==1&&(l.tab=o.readUshorts(i,s,u)),l.fmt==2&&(l.tab=o.readUshorts(i,s,3*u)),l},e._lctf.coverageIndex=function(i,s){var o=i.tab;if(i.fmt==1)return o.indexOf(s);if(i.fmt==2){var l=e._lctf.getInterval(o,s);if(l!=-1)return o[l+2]+(s-o[l])}return-1},e._lctf.readFeatureList=function(i,s){var o=e._bin,l=s,u=[],d=o.readUshort(i,s);s+=2;for(var p=0;p<d;p++){var m=o.readASCII(i,s,4);s+=4;var v=o.readUshort(i,s);s+=2;var y=e._lctf.readFeatureTable(i,l+v);y.tag=m.trim(),u.push(y)}return u},e._lctf.readFeatureTable=function(i,s){var o=e._bin,l=s,u={},d=o.readUshort(i,s);s+=2,d>0&&(u.featureParams=l+d);var p=o.readUshort(i,s);s+=2,u.tab=[];for(var m=0;m<p;m++)u.tab.push(o.readUshort(i,s+2*m));return u},e._lctf.readScriptList=function(i,s){var o=e._bin,l=s,u={},d=o.readUshort(i,s);s+=2;for(var p=0;p<d;p++){var m=o.readASCII(i,s,4);s+=4;var v=o.readUshort(i,s);s+=2,u[m.trim()]=e._lctf.readScriptTable(i,l+v)}return u},e._lctf.readScriptTable=function(i,s){var o=e._bin,l=s,u={},d=o.readUshort(i,s);s+=2,d>0&&(u.default=e._lctf.readLangSysTable(i,l+d));var p=o.readUshort(i,s);s+=2;for(var m=0;m<p;m++){var v=o.readASCII(i,s,4);s+=4;var y=o.readUshort(i,s);s+=2,u[v.trim()]=e._lctf.readLangSysTable(i,l+y)}return u},e._lctf.readLangSysTable=function(i,s){var o=e._bin,l={};o.readUshort(i,s),s+=2,l.reqFeature=o.readUshort(i,s),s+=2;var u=o.readUshort(i,s);return s+=2,l.features=o.readUshorts(i,s,u),l},e.CFF={},e.CFF.parse=function(i,s,o){var l=e._bin;(i=new Uint8Array(i.buffer,s,o))[s=0],i[++s],i[++s],i[++s],s++;var u=[];s=e.CFF.readIndex(i,s,u);for(var d=[],p=0;p<u.length-1;p++)d.push(l.readASCII(i,s+u[p],u[p+1]-u[p]));s+=u[u.length-1];var m=[];s=e.CFF.readIndex(i,s,m);var v=[];for(p=0;p<m.length-1;p++)v.push(e.CFF.readDict(i,s+m[p],s+m[p+1]));s+=m[m.length-1];var y=v[0],x=[];s=e.CFF.readIndex(i,s,x);var M=[];for(p=0;p<x.length-1;p++)M.push(l.readASCII(i,s+x[p],x[p+1]-x[p]));if(s+=x[x.length-1],e.CFF.readSubrs(i,s,y),y.CharStrings){s=y.CharStrings,x=[],s=e.CFF.readIndex(i,s,x);var S=[];for(p=0;p<x.length-1;p++)S.push(l.readBytes(i,s+x[p],x[p+1]-x[p]));y.CharStrings=S}if(y.ROS){s=y.FDArray;var w=[];for(s=e.CFF.readIndex(i,s,w),y.FDArray=[],p=0;p<w.length-1;p++){var A=e.CFF.readDict(i,s+w[p],s+w[p+1]);e.CFF._readFDict(i,A,M),y.FDArray.push(A)}s+=w[w.length-1],s=y.FDSelect,y.FDSelect=[];var T=i[s];if(s++,T!=3)throw T;var R=l.readUshort(i,s);for(s+=2,p=0;p<R+1;p++)y.FDSelect.push(l.readUshort(i,s),i[s+2]),s+=3}return y.Encoding&&(y.Encoding=e.CFF.readEncoding(i,y.Encoding,y.CharStrings.length)),y.charset&&(y.charset=e.CFF.readCharset(i,y.charset,y.CharStrings.length)),e.CFF._readFDict(i,y,M),y},e.CFF._readFDict=function(i,s,o){var l;for(var u in s.Private&&(l=s.Private[1],s.Private=e.CFF.readDict(i,l,l+s.Private[0]),s.Private.Subrs&&e.CFF.readSubrs(i,l+s.Private.Subrs,s.Private)),s)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(u)!=-1&&(s[u]=o[s[u]-426+35])},e.CFF.readSubrs=function(i,s,o){var l=e._bin,u=[];s=e.CFF.readIndex(i,s,u);var d,p=u.length;d=p<1240?107:p<33900?1131:32768,o.Bias=d,o.Subrs=[];for(var m=0;m<u.length-1;m++)o.Subrs.push(l.readBytes(i,s+u[m],u[m+1]-u[m]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(i,s){for(var o=0;o<i.charset.length;o++)if(i.charset[o]==s)return o;return-1},e.CFF.glyphBySE=function(i,s){return s<0||s>
4400255?-1:e.CFF.glyphByUnicode(i,e.CFF.tableSE[s])},e.CFF.readEncoding=function(i,s,o){e._bin;var l=[".notdef"],u=i[s];if(s++,u!=0)throw"error: unknown encoding format: "+u;var d=i[s];s++;for(var p=0;p<d;p++)l.push(i[s+p]);return l},e.CFF.readCharset=function(i,s,o){var l=e._bin,u=[".notdef"],d=i[s];if(s++,d==0)for(var p=0;p<o;p++){var m=l.readUshort(i,s);s+=2,u.push(m)}else{if(d!=1&&d!=2)throw"error: format: "+d;for(;u.length<o;){m=l.readUshort(i,s),s+=2;var v=0;for(d==1?(v=i[s],s++):(v=l.readUshort(i,s),s+=2),p=0;p<=v;p++)u.push(m),m++}}return u},e.CFF.readIndex=function(i,s,o){var l=e._bin,u=l.readUshort(i,s)+1,d=i[s+=2];if(s++,d==1)for(var p=0;p<u;p++)o.push(i[s+p]);else if(d==2)for(p=0;p<u;p++)o.push(l.readUshort(i,s+2*p));else if(d==3)for(p=0;p<u;p++)o.push(16777215&l.readUint(i,s+3*p-1));else if(u!=1)throw"unsupported offset size: "+d+", count: "+u;return(s+=u*d)-1},e.CFF.getCharString=function(i,s,o){var l=e._bin,u=i[s],d=i[s+1];i[s+2],i[s+3],i[s+4];var p=1,m=null,v=null;u<=20&&(m=u,p=1),u==12&&(m=100*u+d,p=2),21<=u&&u<=27&&(m=u,p=1),u==28&&(v=l.readShort(i,s+1),p=3),29<=u&&u<=31&&(m=u,p=1),32<=u&&u<=246&&(v=u-139,p=1),247<=u&&u<=250&&(v=256*(u-247)+d+108,p=2),251<=u&&u<=254&&(v=256*-(u-251)-d-108,p=2),u==255&&(v=l.readInt(i,s+1)/65535,p=5),o.val=v??"o"+m,o.size=p},e.CFF.readCharString=function(i,s,o){for(var l=s+o,u=e._bin,d=[];s<l;){var p=i[s],m=i[s+1];i[s+2],i[s+3],i[s+4];var v=1,y=null,x=null;p<=20&&(y=p,v=1),p==12&&(y=100*p+m,v=2),p!=19&&p!=20||(y=p,v=2),21<=p&&p<=27&&(y=p,v=1),p==28&&(x=u.readShort(i,s+1),v=3),29<=p&&p<=31&&(y=p,v=1),32<=p&&p<=246&&(x=p-139,v=1),247<=p&&p<=250&&(x=256*(p-247)+m+108,v=2),251<=p&&p<=254&&(x=256*-(p-251)-m-108,v=2),p==255&&(x=u.readInt(i,s+1)/65535,v=5),d.push(x??"o"+y),s+=v}return d},e.CFF.readDict=function(i,s,o){for(var l=e._bin,u={},d=[];s<o;){var p=i[s],m=i[s+1];i[s+2],i[s+3],i[s+4];var v=1,y=null,x=null;if(p==28&&(x=l.readShort(i,s+1),v=3),p==29&&(x=l.readInt(i,s+1),v=5),32<=p&&p<=246&&(x=p-139,v=1),247<=p&&p<=250&&(x=256*(p-247)+m+108,v=2),251<=p&&p<=254&&(x=256*-(p-251)-m-108,v=2),p==255)throw x=l.readInt(i,s+1)/65535,v=5,"unknown number";if(p==30){var M=[];for(v=1;;){var S=i[s+v];v++;var w=S>>4,A=15&S;if(w!=15&&M.push(w),A!=15&&M.push(A),A==15)break}for(var T="",R=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],U=0;U<M.length;U++)T+=R[M[U]];x=parseFloat(T)}p<=21&&(y=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][p],v=1,p==12&&(y=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][m],v=2)),y!=null?(u[y]=d.length==1?d[0]:d,d=[]):d.push(x),s+=v}return u},e.cmap={},e.cmap.parse=function(i,s,o){i=new Uint8Array(i.buffer,s,o),s=0;var l=e._bin,u={};l.readUshort(i,s),s+=2;var d=l.readUshort(i,s);s+=2;var p=[];u.tables=[];for(var m=0;m<d;m++){var v=l.readUshort(i,s);s+=2;var y=l.readUshort(i,s);s+=2;var x=l.readUint(i,s);s+=4;var M="p"+v+"e"+y,S=p.indexOf(x);if(S==-1){var w;S=u.tables.length,p.push(x);var A=l.readUshort(i,x);A==0?w=e.cmap.parse0(i,x):A==4?w=e.cmap.parse4(i,x):A==6?w=e.cmap.parse6(i,x):A==12?w=e.cmap.parse12(i,x):console.debug("unknown format: "+A,v,y,x),u.tables.push(w)}if(u[M]!=null)throw"multiple tables for one platform+encoding";u[M]=S}return u},e.cmap.parse0=function(i,s){var o=e._bin,l={};l.format=o.readUshort(i,s),s+=2;var u=o.readUshort(i,s);s+=2,o.readUshort(i,s),s+=2,l.map=[];for(var d=0;d<u-6;d++)l.map.push(i[s+d]);return l},e.cmap.parse4=function(i,s){var o=e._bin,l=s,u={};u.format=o.readUshort(i,s),s+=2;var d=o.readUshort(i,s);s+=2,o.readUshort(i,s),s+=2;var p=o.readUshort(i,s);s+=2;var m=p/2;
4400u.searchRange=o.readUshort(i,s),s+=2,u.entrySelector=o.readUshort(i,s),s+=2,u.rangeShift=o.readUshort(i,s),s+=2,u.endCount=o.readUshorts(i,s,m),s+=2*m,s+=2,u.startCount=o.readUshorts(i,s,m),s+=2*m,u.idDelta=[];for(var v=0;v<m;v++)u.idDelta.push(o.readShort(i,s)),s+=2;for(u.idRangeOffset=o.readUshorts(i,s,m),s+=2*m,u.glyphIdArray=[];s<l+d;)u.glyphIdArray.push(o.readUshort(i,s)),s+=2;return u},e.cmap.parse6=function(i,s){var o=e._bin,l={};l.format=o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2,l.firstCode=o.readUshort(i,s),s+=2;var u=o.readUshort(i,s);s+=2,l.glyphIdArray=[];for(var d=0;d<u;d++)l.glyphIdArray.push(o.readUshort(i,s)),s+=2;return l},e.cmap.parse12=function(i,s){var o=e._bin,l={};l.format=o.readUshort(i,s),s+=2,s+=2,o.readUint(i,s),s+=4,o.readUint(i,s),s+=4;var u=o.readUint(i,s);s+=4,l.groups=[];for(var d=0;d<u;d++){var p=s+12*d,m=o.readUint(i,p+0),v=o.readUint(i,p+4),y=o.readUint(i,p+8);l.groups.push([m,v,y])}return l},e.glyf={},e.glyf.parse=function(i,s,o,l){for(var u=[],d=0;d<l.maxp.numGlyphs;d++)u.push(null);return u},e.glyf._parseGlyf=function(i,s){var o=e._bin,l=i._data,u=e._tabOffset(l,"glyf",i._offset)+i.loca[s];if(i.loca[s]==i.loca[s+1])return null;var d={};if(d.noc=o.readShort(l,u),u+=2,d.xMin=o.readShort(l,u),u+=2,d.yMin=o.readShort(l,u),u+=2,d.xMax=o.readShort(l,u),u+=2,d.yMax=o.readShort(l,u),u+=2,d.xMin>=d.xMax||d.yMin>=d.yMax)return null;if(d.noc>0){d.endPts=[];for(var p=0;p<d.noc;p++)d.endPts.push(o.readUshort(l,u)),u+=2;var m=o.readUshort(l,u);if(u+=2,l.length-u<m)return null;d.instructions=o.readBytes(l,u,m),u+=m;var v=d.endPts[d.noc-1]+1;for(d.flags=[],p=0;p<v;p++){var y=l[u];if(u++,d.flags.push(y),(8&y)!=0){var x=l[u];u++;for(var M=0;M<x;M++)d.flags.push(y),p++}}for(d.xs=[],p=0;p<v;p++){var S=(2&d.flags[p])!=0,w=(16&d.flags[p])!=0;S?(d.xs.push(w?l[u]:-l[u]),u++):w?d.xs.push(0):(d.xs.push(o.readShort(l,u)),u+=2)}for(d.ys=[],p=0;p<v;p++)S=(4&d.flags[p])!=0,w=(32&d.flags[p])!=0,S?(d.ys.push(w?l[u]:-l[u]),u++):w?d.ys.push(0):(d.ys.push(o.readShort(l,u)),u+=2);var A=0,T=0;for(p=0;p<v;p++)A+=d.xs[p],T+=d.ys[p],d.xs[p]=A,d.ys[p]=T}else{var R;d.parts=[];do{R=o.readUshort(l,u),u+=2;var U={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(d.parts.push(U),U.glyphIndex=o.readUshort(l,u),u+=2,1&R){var k=o.readShort(l,u);u+=2;var N=o.readShort(l,u);u+=2}else k=o.readInt8(l,u),u++,N=o.readInt8(l,u),u++;2&R?(U.m.tx=k,U.m.ty=N):(U.p1=k,U.p2=N),8&R?(U.m.a=U.m.d=o.readF2dot14(l,u),u+=2):64&R?(U.m.a=o.readF2dot14(l,u),u+=2,U.m.d=o.readF2dot14(l,u),u+=2):128&R&&(U.m.a=o.readF2dot14(l,u),u+=2,U.m.b=o.readF2dot14(l,u),u+=2,U.m.c=o.readF2dot14(l,u),u+=2,U.m.d=o.readF2dot14(l,u),u+=2)}while(32&R);if(256&R){var H=o.readUshort(l,u);for(u+=2,d.instr=[],p=0;p<H;p++)d.instr.push(l[u]),u++}}return d},e.GDEF={},e.GDEF.parse=function(i,s,o,l){var u=s;s+=4;var d=e._bin.readUshort(i,s);return{glyphClassDef:d===0?null:e._lctf.readClassDef(i,u+d)}},e.GPOS={},e.GPOS.parse=function(i,s,o,l){return e._lctf.parse(i,s,o,l,e.GPOS.subt)},e.GPOS.subt=function(i,s,o,l){var u=e._bin,d=o,p={};if(p.fmt=u.readUshort(i,o),o+=2,s==1||s==2||s==3||s==7||s==8&&p.fmt<=2){var m=u.readUshort(i,o);o+=2,p.coverage=e._lctf.readCoverage(i,m+d)}if(s==1&&p.fmt==1){var v=u.readUshort(i,o);o+=2,v!=0&&(p.pos=e.GPOS.readValueRecord(i,o,v))}else if(s==2&&p.fmt>=1&&p.fmt<=2){v=u.readUshort(i,o),o+=2;var y=u.readUshort(i,o);o+=2;var x=e._lctf.numOfOnes(v),M=e._lctf.numOfOnes(y);if(p.fmt==1){p.pairsets=[];var S=u.readUshort(i,o);o+=2;for(var w=0;w<S;w++){var A=d+u.readUshort(i,o);o+=2;var T=u.readUshort(i,A);A+=2;for(var R=[],U=0;U<T;U++){var k=u.readUshort(i,A);A+=2,v!=0&&(W=e.GPOS.readValueRecord(i,A,v),A+=2*x),y!=0&&(X=e.GPOS.readValueRecord(i,A,y),A+=2*M),R.push({gid2:k,val1:W,val2:X})}p.pairsets.push(R)}}if(p.fmt==2){var N=u.readUshort(i,o);o+=2;var H=u.readUshort(i,o);o+=2;var F=u.readUshort(i,o);o+=2;var I=u.readUshort(i,o);for(o+=2,p.classDef1=e._lctf.readClassDef(i,d+N),p.classDef2=e._lctf.readClassDef(i,d+H),p.matrix=[],w=0;w<F;w++){var G=[];for(U=0;U<I;U++){var W=null,X=null;v!=0&&(W=e.GPOS.readValueRecord(i,o,v),o+=2*x),y!=0&&(X=e.GPOS.readValueRecord(i,o,y),o+=2*M),G.push({val1:W,val2:X})}p.matrix.push(G)}}}else if(s==4&&p.fmt==1)p.markCoverage=e._lctf.readCoverage(i,u.readUshort(i,o)+d),p.baseCoverage=e._lctf.readCoverage(i,u.readUshort(i,o+2)+d),p.markClassCount=u.readUshort(i,o+4),p.markArray=e.GPOS.readMarkArray(i,u.readUshort(i,o+6)+d),p.baseArray=e.GPOS.readBaseArray(i,u.readUshort(i,o+8)+d,p.markClassCount);else if(s==6&&p.fmt==1)p.mark1Coverage=e._lctf.readCoverage(i,u.readUshort(i,o)+d),p.mark2Coverage=e._lctf.readCoverage(i,u.readUshort(i,o+2)+d),p.markClassCount=u.readUshort(i,o+4),p.mark1Array=e.GPOS.readMarkArray(i,u.readUshort(i,o+6)+d),p.mark2Array=e.GPOS.readBaseArray(i,u.readUshort(i,o+8)+d,p.markClassCount);else{if(s==9&&p.fmt==1){var J=u.readUshort(i,o);o+=2;var oe=u.readUint(i,o);if(o+=4,l.ltype==9)l.ltype=J;else if(l.ltype!=J)throw"invalid extension substitution";return e.GPOS.subt(i,l.ltype,d+oe)}console.debug("unsupported GPOS table LookupType",s,"format",p.fmt)}return p},e.GPOS.readValueRecord=function(i,s,o){var l=e._bin,u=[];return u.push(1&o?l.readShort(i,s):0),s+=1&o?2:0,u.push(2&o?l.readShort(i,s):0),s+=2&o?2:0,u.push(4&o?l.readShort(i,s):0),s+=4&o?2:0,u.push(8&o?l.readShort(i,s):0),s+=8&o?2:0,u},e.GPOS.readBaseArray=function(i,s,o){var l=e._bin,u=[],d=s,p=l.readUshort(i,s);s+=2;for(var m=0;m<p;m++){for(var v=[],y=0;y<o;
4400y++)v.push(e.GPOS.readAnchorRecord(i,d+l.readUshort(i,s))),s+=2;u.push(v)}return u},e.GPOS.readMarkArray=function(i,s){var o=e._bin,l=[],u=s,d=o.readUshort(i,s);s+=2;for(var p=0;p<d;p++){var m=e.GPOS.readAnchorRecord(i,o.readUshort(i,s+2)+u);m.markClass=o.readUshort(i,s),l.push(m),s+=4}return l},e.GPOS.readAnchorRecord=function(i,s){var o=e._bin,l={};return l.fmt=o.readUshort(i,s),l.x=o.readShort(i,s+2),l.y=o.readShort(i,s+4),l},e.GSUB={},e.GSUB.parse=function(i,s,o,l){return e._lctf.parse(i,s,o,l,e.GSUB.subt)},e.GSUB.subt=function(i,s,o,l){var u=e._bin,d=o,p={};if(p.fmt=u.readUshort(i,o),o+=2,s!=1&&s!=2&&s!=4&&s!=5&&s!=6)return null;if(s==1||s==2||s==4||s==5&&p.fmt<=2||s==6&&p.fmt<=2){var m=u.readUshort(i,o);o+=2,p.coverage=e._lctf.readCoverage(i,d+m)}if(s==1&&p.fmt>=1&&p.fmt<=2){if(p.fmt==1)p.delta=u.readShort(i,o),o+=2;else if(p.fmt==2){var v=u.readUshort(i,o);o+=2,p.newg=u.readUshorts(i,o,v),o+=2*p.newg.length}}else if(s==2&&p.fmt==1){v=u.readUshort(i,o),o+=2,p.seqs=[];for(var y=0;y<v;y++){var x=u.readUshort(i,o)+d;o+=2;var M=u.readUshort(i,x);p.seqs.push(u.readUshorts(i,x+2,M))}}else if(s==4)for(p.vals=[],v=u.readUshort(i,o),o+=2,y=0;y<v;y++){var S=u.readUshort(i,o);o+=2,p.vals.push(e.GSUB.readLigatureSet(i,d+S))}else if(s==5&&p.fmt==2){if(p.fmt==2){var w=u.readUshort(i,o);o+=2,p.cDef=e._lctf.readClassDef(i,d+w),p.scset=[];var A=u.readUshort(i,o);for(o+=2,y=0;y<A;y++){var T=u.readUshort(i,o);o+=2,p.scset.push(T==0?null:e.GSUB.readSubClassSet(i,d+T))}}}else if(s==6&&p.fmt==3){if(p.fmt==3){for(y=0;y<3;y++){v=u.readUshort(i,o),o+=2;for(var R=[],U=0;U<v;U++)R.push(e._lctf.readCoverage(i,d+u.readUshort(i,o+2*U)));o+=2*v,y==0&&(p.backCvg=R),y==1&&(p.inptCvg=R),y==2&&(p.ahedCvg=R)}v=u.readUshort(i,o),o+=2,p.lookupRec=e.GSUB.readSubstLookupRecords(i,o,v)}}else{if(s==7&&p.fmt==1){var k=u.readUshort(i,o);o+=2;var N=u.readUint(i,o);if(o+=4,l.ltype==9)l.ltype=k;else if(l.ltype!=k)throw"invalid extension substitution";return e.GSUB.subt(i,l.ltype,d+N)}console.debug("unsupported GSUB table LookupType",s,"format",p.fmt)}return p},e.GSUB.readSubClassSet=function(i,s){var o=e._bin.readUshort,l=s,u=[],d=o(i,s);s+=2;for(var p=0;p<d;p++){var m=o(i,s);s+=2,u.push(e.GSUB.readSubClassRule(i,l+m))}return u},e.GSUB.readSubClassRule=function(i,s){var o=e._bin.readUshort,l={},u=o(i,s),d=o(i,s+=2);s+=2,l.input=[];for(var p=0;p<u-1;p++)l.input.push(o(i,s)),s+=2;return l.substLookupRecords=e.GSUB.readSubstLookupRecords(i,s,d),l},e.GSUB.readSubstLookupRecords=function(i,s,o){for(var l=e._bin.readUshort,u=[],d=0;d<o;d++)u.push(l(i,s),l(i,s+2)),s+=4;return u},e.GSUB.readChainSubClassSet=function(i,s){var o=e._bin,l=s,u=[],d=o.readUshort(i,s);s+=2;for(var p=0;p<d;p++){var m=o.readUshort(i,s);s+=2,u.push(e.GSUB.readChainSubClassRule(i,l+m))}return u},e.GSUB.readChainSubClassRule=function(i,s){for(var o=e._bin,l={},u=["backtrack","input","lookahead"],d=0;d<u.length;d++){var p=o.readUshort(i,s);s+=2,d==1&&p--,l[u[d]]=o.readUshorts(i,s,p),s+=2*l[u[d]].length}return p=o.readUshort(i,s),s+=2,l.subst=o.readUshorts(i,s,2*p),s+=2*l.subst.length,l},e.GSUB.readLigatureSet=function(i,s){var o=e._bin,l=s,u=[],d=o.readUshort(i,s);s+=2;for(var p=0;p<d;p++){var m=o.readUshort(i,s);s+=2,u.push(e.GSUB.readLigature(i,l+m))}return u},e.GSUB.readLigature=function(i,s){var o=e._bin,l={chain:[]};l.nglyph=o.readUshort(i,s),s+=2;var u=o.readUshort(i,s);s+=2;for(var d=0;d<u-1;d++)l.chain.push(o.readUshort(i,s)),s+=2;return l},e.head={},e.head.parse=function(i,s,o){var l=e._bin,u={};return l.readFixed(i,s),s+=4,u.fontRevision=l.readFixed(i,s),s+=4,l.readUint(i,s),s+=4,l.readUint(i,s),s+=4,u.flags=l.readUshort(i,s),s+=2,u.unitsPerEm=l.readUshort(i,s),s+=2,u.created=l.readUint64(i,s),s+=8,u.modified=l.readUint64(i,s),s+=8,u.xMin=l.readShort(i,s),s+=2,u.yMin=l.readShort(i,s),s+=2,u.xMax=l.readShort(i,s),s+=2,u.yMax=l.readShort(i,s),s+=2,u.macStyle=l.readUshort(i,s),s+=2,u.lowestRecPPEM=l.readUshort(i,s),s+=2,u.fontDirectionHint=l.readShort(i,s),s+=2,u.indexToLocFormat=l.readShort(i,s),s+=2,u.glyphDataFormat=l.readShort(i,s),s+=2,u},e.hhea={},e.hhea.parse=function(i,s,o){var l=e._bin,u={};return l.readFixed(i,s),s+=4,u.ascender=l.readShort(i,s),s+=2,u.descender=l.readShort(i,s),s+=2,u.lineGap=l.readShort(i,s),s+=2,u.advanceWidthMax=l.readUshort(i,s),s+=2,u.minLeftSideBearing=l.readShort(i,s),s+=2,u.minRightSideBearing=l.readShort(i,s),s+=2,u.xMaxExtent=l.readShort(i,s),s+=2,u.caretSlopeRise=l.readShort(i,s),s+=2,u.caretSlopeRun=l.readShort(i,s),s+=2,u.caretOffset=l.readShort(i,s),s+=2,s+=8,u.metricDataFormat=l.readShort(i,s),s+=2,u.numberOfHMetrics=l.readUshort(i,s),s+=2,u},e.hmtx={},e.hmtx.parse=function(i,s,o,l){for(var u=e._bin,d={aWidth:[],lsBearing:[]},p=0,m=0,v=0;v<l.maxp.numGlyphs;v++)v<l.hhea.numberOfHMetrics&&(p=u.readUshort(i,s),s+=2,m=u.readShort(i,s),s+=2),d.aWidth.push(p),d.lsBearing.push(m);return d},e.kern={},e.kern.parse=function(i,s,o,l){var u=e._bin,d=u.readUshort(i,s);if(s+=2,d==1)return e.kern.parseV1(i,s-2,o,l);var p=u.readUshort(i,s);s+=2;for(var m={glyph1:[],rval:[]},v=0;v<p;v++){s+=2,o=u.readUshort(i,s),s+=2;var y=u.readUshort(i,s);s+=2;var x=y>>>8;if((x&=15)!=0)throw"unknown kern table format: "+x;s=e.kern.readFormat0(i,s,m)}return m},e.kern.parseV1=function(i,s,o,l){var u=e._bin;u.readFixed(i,s),s+=4;var d=u.readUint(i,s);s+=4;for(var p={glyph1:[],rval:[]},m=0;m<d;m++){u.readUint(i,s),s+=4;var v=u.readUshort(i,s);s+=2,u.readUshort(i,s),s+=2;var y=v>>>8;if((y&=15)!=0)throw"unknown kern table format: "+y;s=e.kern.readFormat0(i,s,p)}return p},e.kern.readFormat0=function(i,s,o){var l=e._bin,u=-1,d=l.readUshort(i,s);s+=2,l.readUshort(i,s),s+=2,l.readUshort(i,s),s+=2,l.readUshort(i,s),s+=2;for(var p=0;p<d;p++){var m=l.readUshort(i,s);s+=2;var v=l.readUshort(i,s);s+=2;var y=l.readShort(i,s);s+=2,m!=u&&(o.glyph1.push(m),o.rval.push({glyph2:[],vals:[]}));var x=o.rval[o.rval.length-1];x.glyph2.push(v),x.vals.push(y),u=m}return s},e.loca={},e.loca.parse=function(i,s,o,l){var u=e._bin,d=[],p=l.head.indexToLocFormat,m=l.maxp.numGlyphs+1;if(p==0)for(var v=0;v<m;v++)d.push(u.readUshort(i,s+(v<<1))<<1);if(p==1)for(v=0;v<m;v++)d.push(u.readUint(i,s+(v<<2)));return d},e.maxp={},e.maxp.parse=function(i,s,o){var l=e._bin,u={},d=l.readUint(i,s);return s+=4,u.numGlyphs=l.readUshort(i,s),s+=2,d==65536&&(u.maxPoints=l.readUshort(i,s),s+=2,u.maxContours=l.readUshort(i,s),s+=2,u.maxCompositePoints=l.readUshort(i,s),s+=2,u.maxCompositeContours=l.readUshort(i,s),s+=2,u.maxZones=l.readUshort(i,s),s+=2,u.maxTwilightPoints=l.readUshort(i,s),s+=2,u.maxStorage=l.readUshort(i,s),s+=2,u.maxFunctionDefs=l.readUshort(i,s),s+=2,u.maxInstructionDefs=l.readUshort(i,s),s+=2,u.maxStackElements=l.readUshort(i,s),s+=2,u.maxSizeOfInstru
4400ctions=l.readUshort(i,s),s+=2,u.maxComponentElements=l.readUshort(i,s),s+=2,u.maxComponentDepth=l.readUshort(i,s),s+=2),u},e.name={},e.name.parse=function(i,s,o){var l=e._bin,u={};l.readUshort(i,s),s+=2;var d=l.readUshort(i,s);s+=2,l.readUshort(i,s);for(var p,m=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],v=s+=2,y=0;y<d;y++){var x=l.readUshort(i,s);s+=2;var M=l.readUshort(i,s);s+=2;var S=l.readUshort(i,s);s+=2;var w=l.readUshort(i,s);s+=2;var A=l.readUshort(i,s);s+=2;var T=l.readUshort(i,s);s+=2;var R,U=m[w],k=v+12*d+T;if(x==0)R=l.readUnicode(i,k,A/2);else if(x==3&&M==0)R=l.readUnicode(i,k,A/2);else if(M==0)R=l.readASCII(i,k,A);else if(M==1)R=l.readUnicode(i,k,A/2);else if(M==3)R=l.readUnicode(i,k,A/2);else{if(x!=1)throw"unknown encoding "+M+", platformID: "+x;R=l.readASCII(i,k,A),console.debug("reading unknown MAC encoding "+M+" as ASCII")}var N="p"+x+","+S.toString(16);u[N]==null&&(u[N]={}),u[N][U!==void 0?U:w]=R,u[N]._lang=S}for(var H in u)if(u[H].postScriptName!=null&&u[H]._lang==1033)return u[H];for(var H in u)if(u[H].postScriptName!=null&&u[H]._lang==0)return u[H];for(var H in u)if(u[H].postScriptName!=null&&u[H]._lang==3084)return u[H];for(var H in u)if(u[H].postScriptName!=null)return u[H];for(var H in u){p=H;break}return console.debug("returning name table with languageID "+u[p]._lang),u[p]},e["OS/2"]={},e["OS/2"].parse=function(i,s,o){var l=e._bin.readUshort(i,s);s+=2;var u={};if(l==0)e["OS/2"].version0(i,s,u);else if(l==1)e["OS/2"].version1(i,s,u);else if(l==2||l==3||l==4)e["OS/2"].version2(i,s,u);else{if(l!=5)throw"unknown OS/2 table version: "+l;e["OS/2"].version5(i,s,u)}return u},e["OS/2"].version0=function(i,s,o){var l=e._bin;return o.xAvgCharWidth=l.readShort(i,s),s+=2,o.usWeightClass=l.readUshort(i,s),s+=2,o.usWidthClass=l.readUshort(i,s),s+=2,o.fsType=l.readUshort(i,s),s+=2,o.ySubscriptXSize=l.readShort(i,s),s+=2,o.ySubscriptYSize=l.readShort(i,s),s+=2,o.ySubscriptXOffset=l.readShort(i,s),s+=2,o.ySubscriptYOffset=l.readShort(i,s),s+=2,o.ySuperscriptXSize=l.readShort(i,s),s+=2,o.ySuperscriptYSize=l.readShort(i,s),s+=2,o.ySuperscriptXOffset=l.readShort(i,s),s+=2,o.ySuperscriptYOffset=l.readShort(i,s),s+=2,o.yStrikeoutSize=l.readShort(i,s),s+=2,o.yStrikeoutPosition=l.readShort(i,s),s+=2,o.sFamilyClass=l.readShort(i,s),s+=2,o.panose=l.readBytes(i,s,10),s+=10,o.ulUnicodeRange1=l.readUint(i,s),s+=4,o.ulUnicodeRange2=l.readUint(i,s),s+=4,o.ulUnicodeRange3=l.readUint(i,s),s+=4,o.ulUnicodeRange4=l.readUint(i,s),s+=4,o.achVendID=[l.readInt8(i,s),l.readInt8(i,s+1),l.readInt8(i,s+2),l.readInt8(i,s+3)],s+=4,o.fsSelection=l.readUshort(i,s),s+=2,o.usFirstCharIndex=l.readUshort(i,s),s+=2,o.usLastCharIndex=l.readUshort(i,s),s+=2,o.sTypoAscender=l.readShort(i,s),s+=2,o.sTypoDescender=l.readShort(i,s),s+=2,o.sTypoLineGap=l.readShort(i,s),s+=2,o.usWinAscent=l.readUshort(i,s),s+=2,o.usWinDescent=l.readUshort(i,s),s+=2},e["OS/2"].version1=function(i,s,o){var l=e._bin;return s=e["OS/2"].version0(i,s,o),o.ulCodePageRange1=l.readUint(i,s),s+=4,o.ulCodePageRange2=l.readUint(i,s),s+=4},e["OS/2"].version2=function(i,s,o){var l=e._bin;return s=e["OS/2"].version1(i,s,o),o.sxHeight=l.readShort(i,s),s+=2,o.sCapHeight=l.readShort(i,s),s+=2,o.usDefault=l.readUshort(i,s),s+=2,o.usBreak=l.readUshort(i,s),s+=2,o.usMaxContext=l.readUshort(i,s),s+=2},e["OS/2"].version5=function(i,s,o){var l=e._bin;return s=e["OS/2"].version2(i,s,o),o.usLowerOpticalPointSize=l.readUshort(i,s),s+=2,o.usUpperOpticalPointSize=l.readUshort(i,s),s+=2},e.post={},e.post.parse=function(i,s,o){var l=e._bin,u={};return u.version=l.readFixed(i,s),s+=4,u.italicAngle=l.readFixed(i,s),s+=4,u.underlinePosition=l.readShort(i,s),s+=2,u.underlineThickness=l.readShort(i,s),s+=2,u},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(i,s){var o=i.cmap,l=-1;
4400if(o.p0e4!=null?l=o.p0e4:o.p3e1!=null?l=o.p3e1:o.p1e0!=null?l=o.p1e0:o.p0e3!=null&&(l=o.p0e3),l==-1)throw"no familiar platform and encoding!";var u=o.tables[l];if(u.format==0)return s>=u.map.length?0:u.map[s];if(u.format==4){for(var d=-1,p=0;p<u.endCount.length;p++)if(s<=u.endCount[p]){d=p;break}return d==-1||u.startCount[d]>s?0:65535&(u.idRangeOffset[d]!=0?u.glyphIdArray[s-u.startCount[d]+(u.idRangeOffset[d]>>1)-(u.idRangeOffset.length-d)]:s+u.idDelta[d])}if(u.format==12){if(s>u.groups[u.groups.length-1][1])return 0;for(p=0;p<u.groups.length;p++){var m=u.groups[p];if(m[0]<=s&&s<=m[1])return m[2]+(s-m[0])}return 0}throw"unknown cmap table format "+u.format},e.U.glyphToPath=function(i,s){var o={cmds:[],crds:[]};if(i.SVG&&i.SVG.entries[s]){var l=i.SVG.entries[s];return l==null?o:(typeof l=="string"&&(l=e.SVG.toPath(l),i.SVG.entries[s]=l),l)}if(i.CFF){var u={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:i.CFF.Private?i.CFF.Private.defaultWidthX:0,open:!1},d=i.CFF,p=i.CFF.Private;if(d.ROS){for(var m=0;d.FDSelect[m+2]<=s;)m+=2;p=d.FDArray[d.FDSelect[m+1]].Private}e.U._drawCFF(i.CFF.CharStrings[s],u,d,p,o)}else i.glyf&&e.U._drawGlyf(s,i,o);return o},e.U._drawGlyf=function(i,s,o){var l=s.glyf[i];l==null&&(l=s.glyf[i]=e.glyf._parseGlyf(s,i)),l!=null&&(l.noc>-1?e.U._simpleGlyph(l,o):e.U._compoGlyph(l,s,o))},e.U._simpleGlyph=function(i,s){for(var o=0;o<i.noc;o++){for(var l=o==0?0:i.endPts[o-1]+1,u=i.endPts[o],d=l;d<=u;d++){var p=d==l?u:d-1,m=d==u?l:d+1,v=1&i.flags[d],y=1&i.flags[p],x=1&i.flags[m],M=i.xs[d],S=i.ys[d];if(d==l)if(v){if(!y){e.U.P.moveTo(s,M,S);continue}e.U.P.moveTo(s,i.xs[p],i.ys[p])}else y?e.U.P.moveTo(s,i.xs[p],i.ys[p]):e.U.P.moveTo(s,(i.xs[p]+M)/2,(i.ys[p]+S)/2);v?y&&e.U.P.lineTo(s,M,S):x?e.U.P.qcurveTo(s,M,S,i.xs[m],i.ys[m]):e.U.P.qcurveTo(s,M,S,(M+i.xs[m])/2,(S+i.ys[m])/2)}e.U.P.closePath(s)}},e.U._compoGlyph=function(i,s,o){for(var l=0;l<i.parts.length;l++){var u={cmds:[],crds:[]},d=i.parts[l];e.U._drawGlyf(d.glyphIndex,s,u);for(var p=d.m,m=0;m<u.crds.length;m+=2){var v=u.crds[m],y=u.crds[m+1];o.crds.push(v*p.a+y*p.b+p.tx),o.crds.push(v*p.c+y*p.d+p.ty)}for(m=0;m<u.cmds.length;m++)o.cmds.push(u.cmds[m])}},e.U._getGlyphClass=function(i,s){var o=e._lctf.getInterval(s,i);return o==-1?0:s[o+2]},e.U._applySubs=function(i,s,o,l){for(var u=i.length-s-1,d=0;d<o.tabs.length;d++)if(o.tabs[d]!=null){var p,m=o.tabs[d];if(!m.coverage||(p=e._lctf.coverageIndex(m.coverage,i[s]))!=-1){if(o.ltype==1)i[s],m.fmt==1?i[s]=i[s]+m.delta:i[s]=m.newg[p];else if(o.ltype==4)for(var v=m.vals[p],y=0;y<v.length;y++){var x=v[y],M=x.chain.length;if(!(M>u)){for(var S=!0,w=0,A=0;A<M;A++){for(;i[s+w+(1+A)]==-1;)w++;x.chain[A]!=i[s+w+(1+A)]&&(S=!1)}if(S){for(i[s]=x.nglyph,A=0;A<M+w;A++)i[s+A+1]=-1;break}}}else if(o.ltype==5&&m.fmt==2)for(var T=e._lctf.getInterval(m.cDef,i[s]),R=m.cDef[T+2],U=m.scset[R],k=0;k<U.length;k++){var N=U[k],H=N.input;if(!(H.length>u)){for(S=!0,A=0;A<H.length;A++){var F=e._lctf.getInterval(m.cDef,i[s+1+A]);if(T==-1&&m.cDef[F+2]!=H[A]){S=!1;break}}if(S){var I=N.substLookupRecords;for(y=0;y<I.length;y+=2)I[y],I[y+1]}}}else if(o.ltype==6&&m.fmt==3){if(!e.U._glsCovered(i,m.backCvg,s-m.backCvg.length)||!e.U._glsCovered(i,m.inptCvg,s)||!e.U._glsCovered(i,m.ahedCvg,s+m.inptCvg.length))continue;var G=m.lookupRec;for(k=0;k<G.length;k+=2){T=G[k];var W=l[G[k+1]];e.U._applySubs(i,s+T,W,l)}}}}},e.U._glsCovered=function(i,s,o){for(var l=0;l<s.length;l++)if(e._lctf.coverageIndex(s[l],i[o+l])==-1)return!1;return!0},e.U.glyphsToPath=function(i,s,o){for(var l={cmds:[],crds:[]},u=0,d=0;d<s.length;d++){var p=s[d];if(p!=-1){for(var m=d<s.length-1&&s[d+1]!=-1?s[d+1]:0,v=e.U.glyphToPath(i,p),y=0;y<v.crds.length;y+=2)l.crds.push(v.crds[y]+u),l.crds.push(v.crds[y+1]);for(o&&l.cmds.push(o),y=0;y<v.cmds.length;y++)l.cmds.push(v.cmds[y]);o&&l.cmds.push("X"),u+=i.hmtx.aWidth[p],d<s.length-1&&(u+=e.U.getPairAdjustment(i,p,m))}}return l},e.U.P={},e.U.P.moveTo=function(i,s,o){i.cmds.push("M"),i.crds.push(s,o)},e.U.P.lineTo=function(i,s,o){i.cmds.push("L"),i.crds.push(s,o)},e.U.P.curveTo=function(i,s,o,l,u,d,p){i.cmds.push("C"),i.crds.push(s,o,l,u,d,p)},e.U.P.qcurveTo=function(i,s,o,l,u){i.cmds.push("Q"),i.crds.push(s,o,l,u)},e.U.P.closePath=function(i){i.cmds.push("Z")},e.U._drawCFF=function(i,s,o,l,u){for(var d=s.stack,p=s.nStems,m=s.haveWidth,v=s.width,y=s.open,x=0,M=s.x,S=s.y,w=0,A=0,T=0,R=0,U=0,k=0,N=0,H=0,F=0,I=0,G={val:0,size:0};x<i.length;){e.CFF.getCharString(i,x,G);var W=G.val;if(x+=G.size,W=="o1"||W=="o18")d.length%2!=0&&!m&&(v=d.shift()+l.nominalWidthX),p+=d.length>>1,d.length=0,m=!0;else if(W=="o3"||W=="o23")d.length%2!=0&&!m&&(v=d.shift()+l.nominalWidthX),p+=d.length>>1,d.length=0,m=!0;else if(W=="o4")d.length>1&&!m&&(v=d.shift()+l.nominalWidthX,m=!0),y&&e.U.P.closePath(u),S+=d.pop(),e.U.P.moveTo(u,M,S),y=!0;else if(W=="o5")for(;d.length>0;)M+=d.shift(),S+=d.shift(),e.U.P.lineTo(u,M,S);else if(W=="o6"||W=="o7")for(var X=d.length,J=W=="o6",oe=0;oe<X;oe++){var se=d.shift();J?M+=se:S+=se,J=!J,e.U.P.lineTo(u,M,S)}else if(W=="o8"||W=="o24"){X=d.length;for(var fe=0;fe+6<=X;)w=M+d.shift(),A=S+d.shift(),T=w+d.shift(),R=A+d.shift(),M=T+d.shift(),S=R+d.shift(),e.U.P.curveTo(u,w,A,T,R,M,S),fe+=6;W=="o24"&&(M+=d.shift(),S+=d.shift(),e.U.P.lineTo(u,M,S))}else{if(W=="o11")break;
4400if(W=="o1234"||W=="o1235"||W=="o1236"||W=="o1237")W=="o1234"&&(A=S,T=(w=M+d.shift())+d.shift(),I=R=A+d.shift(),k=R,H=S,M=(N=(U=(F=T+d.shift())+d.shift())+d.shift())+d.shift(),e.U.P.curveTo(u,w,A,T,R,F,I),e.U.P.curveTo(u,U,k,N,H,M,S)),W=="o1235"&&(w=M+d.shift(),A=S+d.shift(),T=w+d.shift(),R=A+d.shift(),F=T+d.shift(),I=R+d.shift(),U=F+d.shift(),k=I+d.shift(),N=U+d.shift(),H=k+d.shift(),M=N+d.shift(),S=H+d.shift(),d.shift(),e.U.P.curveTo(u,w,A,T,R,F,I),e.U.P.curveTo(u,U,k,N,H,M,S)),W=="o1236"&&(w=M+d.shift(),A=S+d.shift(),T=w+d.shift(),I=R=A+d.shift(),k=R,N=(U=(F=T+d.shift())+d.shift())+d.shift(),H=k+d.shift(),M=N+d.shift(),e.U.P.curveTo(u,w,A,T,R,F,I),e.U.P.curveTo(u,U,k,N,H,M,S)),W=="o1237"&&(w=M+d.shift(),A=S+d.shift(),T=w+d.shift(),R=A+d.shift(),F=T+d.shift(),I=R+d.shift(),U=F+d.shift(),k=I+d.shift(),N=U+d.shift(),H=k+d.shift(),Math.abs(N-M)>Math.abs(H-S)?M=N+d.shift():S=H+d.shift(),e.U.P.curveTo(u,w,A,T,R,F,I),e.U.P.curveTo(u,U,k,N,H,M,S));else if(W=="o14"){if(d.length>0&&!m&&(v=d.shift()+o.nominalWidthX,m=!0),d.length==4){var V=d.shift(),$=d.shift(),Z=d.shift(),O=d.shift(),j=e.CFF.glyphBySE(o,Z),re=e.CFF.glyphBySE(o,O);e.U._drawCFF(o.CharStrings[j],s,o,l,u),s.x=V,s.y=$,e.U._drawCFF(o.CharStrings[re],s,o,l,u)}y&&(e.U.P.closePath(u),y=!1)}else if(W=="o19"||W=="o20")d.length%2!=0&&!m&&(v=d.shift()+l.nominalWidthX),p+=d.length>>1,d.length=0,m=!0,x+=p+7>>3;else if(W=="o21")d.length>2&&!m&&(v=d.shift()+l.nominalWidthX,m=!0),S+=d.pop(),M+=d.pop(),y&&e.U.P.closePath(u),e.U.P.moveTo(u,M,S),y=!0;else if(W=="o22")d.length>1&&!m&&(v=d.shift()+l.nominalWidthX,m=!0),M+=d.pop(),y&&e.U.P.closePath(u),e.U.P.moveTo(u,M,S),y=!0;else if(W=="o25"){for(;d.length>6;)M+=d.shift(),S+=d.shift(),e.U.P.lineTo(u,M,S);w=M+d.shift(),A=S+d.shift(),T=w+d.shift(),R=A+d.shift(),M=T+d.shift(),S=R+d.shift(),e.U.P.curveTo(u,w,A,T,R,M,S)}else if(W=="o26")for(d.length%2&&(M+=d.shift());d.length>0;)w=M,A=S+d.shift(),M=T=w+d.shift(),S=(R=A+d.shift())+d.shift(),e.U.P.curveTo(u,w,A,T,R,M,S);else if(W=="o27")for(d.length%2&&(S+=d.shift());d.length>0;)A=S,T=(w=M+d.shift())+d.shift(),R=A+d.shift(),M=T+d.shift(),S=R,e.U.P.curveTo(u,w,A,T,R,M,S);else if(W=="o10"||W=="o29"){var ne=W=="o10"?l:o;if(d.length==0)console.debug("error: empty stack");else{var ie=d.pop(),he=ne.Subrs[ie+ne.Bias];s.x=M,s.y=S,s.nStems=p,s.haveWidth=m,s.width=v,s.open=y,e.U._drawCFF(he,s,o,l,u),M=s.x,S=s.y,p=s.nStems,m=s.haveWidth,v=s.width,y=s.open}}else if(W=="o30"||W=="o31"){var le=d.length,ye=(fe=0,W=="o31");for(fe+=le-(X=-3&le);fe<X;)ye?(A=S,T=(w=M+d.shift())+d.shift(),S=(R=A+d.shift())+d.shift(),X-fe==5?(M=T+d.shift(),fe++):M=T,ye=!1):(w=M,A=S+d.shift(),T=w+d.shift(),R=A+d.shift(),M=T+d.shift(),X-fe==5?(S=R+d.shift(),fe++):S=R,ye=!0),e.U.P.curveTo(u,w,A,T,R,M,S),fe+=4}else{if((W+"").charAt(0)=="o")throw console.debug("Unknown operation: "+W,i),W;d.push(W)}}}s.x=M,s.y=S,s.nStems=p,s.haveWidth=m,s.width=v,s.open=y};var t=e,n={Typr:t};return r.Typr=t,r.default=n,Object.defineProperty(r,"__esModule",{value:!0}),r})({}).Typr}/*! 4401Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate 4402(https://github.com/101arrowz/fflate) for use in Troika text rendering. 4403Original licenses apply: 4404- fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT) 4405- woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2) 4406*/function kU(){return(function(r){var e=Uint8Array,t=Uint16Array,n=Uint32Array,i=new e([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]),s=new e([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]),o=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(W,X){for(var J=new t(31),oe=0;oe<31;++oe)J[oe]=X+=1<<W[oe-1];var se=new n(J[30]);for(oe=1;oe<30;++oe)for(var fe=J[oe];fe<J[oe+1];++fe)se[fe]=fe-J[oe]<<5|oe;return[J,se]},u=l(i,2),d=u[0],p=u[1];d[28]=258,p[258]=28;for(var m=l(s,0)[0],v=new t(32768),y=0;y<32768;++y){var x=(43690&y)>>>1|(21845&y)<<1;x=(61680&(x=(52428&x)>>>2|(13107&x)<<2))>>>4|(3855&x)<<4,v[y]=((65280&x)>>>8|(255&x)<<8)>>>1}var M=function(W,X,J){for(var oe=W.length,se=0,fe=new t(X);se<oe;++se)++fe[W[se]-1];var V,$=new t(X);for(se=0;se<X;++se)$[se]=$[se-1]+fe[se-1]<<1;{V=new t(1<<X);var Z=15-X;for(se=0;se<oe;++se)if(W[se])for(var O=se<<4|W[se],j=X-W[se],re=$[W[se]-1]++<<j,ne=re|(1<<j)-1;re<=ne;++re)V[v[re]>>>Z]=O}return V},S=new e(288);for(y=0;y<144;++y)S[y]=8;for(y=144;y<256;++y)S[y]=9;for(y=256;y<280;++y)S[y]=7;for(y=280;y<288;++y)S[y]=8;var w=new e(32);for(y=0;y<32;++y)w[y]=5;var A=M(S,9),T=M(w,5),R=function(W){for(var X=W[0],J=1;J<W.length;++J)W[J]>X&&(X=W[J]);return X},U=function(W,X,J){var oe=X/8|0;return(W[oe]|W[oe+1]<<8)>>(7&X)&J},k=function(W,X){var J=X/8|0;return(W[J]|W[J+1]<<8|W[J+2]<<16)>>(7&X)}
4406,N=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],H=function(W,X,J){var oe=new Error(X||N[W]);if(oe.code=W,Error.captureStackTrace&&Error.captureStackTrace(oe,H),!J)throw oe;return oe},F=function(W,X,J){var oe=W.length;if(!oe||J&&!J.l&&oe<5)return X||new e(0);var se=!X||J,fe=!J||J.i;J||(J={}),X||(X=new e(3*oe));var V,$=function(it){var ue=X.length;if(it>ue){var qe=new e(Math.max(2*ue,it));qe.set(X),X=qe}},Z=J.f||0,O=J.p||0,j=J.b||0,re=J.l,ne=J.d,ie=J.m,he=J.n,le=8*oe;do{if(!re){J.f=Z=U(W,O,1);var ye=U(W,O+1,3);if(O+=3,!ye){var ze=W[(Q=((V=O)/8|0)+(7&V&&1)+4)-4]|W[Q-3]<<8,Xe=Q+ze;if(Xe>oe){fe&&H(0);break}se&&$(j+ze),X.set(W.subarray(Q,Xe),j),J.b=j+=ze,J.p=O=8*Xe;continue}if(ye==1)re=A,ne=T,ie=9,he=5;else if(ye==2){var Ie=U(W,O,31)+257,Y=U(W,O+10,15)+4,Ce=Ie+U(W,O+5,31)+1;O+=14;for(var Le=new e(Ce),Ge=new e(19),Ae=0;Ae<Y;++Ae)Ge[o[Ae]]=U(W,O+3*Ae,7);O+=3*Y;var $e=R(Ge),Re=(1<<$e)-1,He=M(Ge,$e);for(Ae=0;Ae<Ce;){var Q,B=He[U(W,O,Re)];if(O+=15&B,(Q=B>>>4)<16)Le[Ae++]=Q;else{var pe=0,ge=0;for(Q==16?(ge=3+U(W,O,3),O+=2,pe=Le[Ae-1]):Q==17?(ge=3+U(W,O,7),O+=3):Q==18&&(ge=11+U(W,O,127),O+=7);ge--;)Le[Ae++]=pe}}var ve=Le.subarray(0,Ie),we=Le.subarray(Ie);ie=R(ve),he=R(we),re=M(ve,ie),ne=M(we,he)}else H(1);if(O>le){fe&&H(0);break}}se&&$(j+131072);for(var ut=(1<<ie)-1,Oe=(1<<he)-1,Qe=O;;Qe=O){var at=(pe=re[k(W,O)&ut])>>>4;if((O+=15&pe)>le){fe&&H(0);break}if(pe||H(2),at<256)X[j++]=at;else{if(at==256){Qe=O,re=null;break}var Ke=at-254;if(at>264){var tt=i[Ae=at-257];Ke=U(W,O,(1<<tt)-1)+d[Ae],O+=tt}var wt=ne[k(W,O)&Oe],nt=wt>>>4;if(wt||H(3),O+=15&wt,we=m[nt],nt>3&&(tt=s[nt],we+=k(W,O)&(1<<tt)-1,O+=tt),O>le){fe&&H(0);break}se&&$(j+131072);for(var et=j+Ke;j<et;j+=4)X[j]=X[j-we],X[j+1]=X[j+1-we],X[j+2]=X[j+2-we],X[j+3]=X[j+3-we];j=et}}J.l=re,J.p=Qe,J.b=j,re&&(Z=1,J.m=ie,J.d=ne,J.n=he)}while(!Z);return j==X.length?X:(function(it,ue,qe){(qe==null||qe>it.length)&&(qe=it.length);var ce=new(it instanceof t?t:it instanceof n?n:e)(qe-ue);return ce.set(it.subarray(ue,qe)),ce})(X,0,j)},I=new e(0),G=typeof TextDecoder<"u"&&new TextDecoder;try{G.decode(I,{stream:!0})}catch{}return r.convert_streams=function(W){var X=new DataView(W),J=0;function oe(){var Ie=X.getUint16(J);return J+=2,Ie}function se(){var Ie=X.getUint32(J);return J+=4,Ie}function fe(Ie){ze.setUint16(Xe,Ie),Xe+=2}function V(Ie){ze.setUint32(Xe,Ie),Xe+=4}for(var $={signature:se(),flavor:se(),length:se(),numTables:oe(),reserved:oe(),totalSfntSize:se(),majorVersion:oe(),minorVersion:oe(),metaOffset:se(),metaLength:se(),metaOrigLength:se(),privOffset:se(),privLength:se()},Z=0;Math.pow(2,Z)<=$.numTables;)Z++;Z--;for(var O=16*Math.pow(2,Z),j=16*$.numTables-O,re=12,ne=[],ie=0;ie<$.numTables;ie++)ne.push({tag:se(),offset:se(),compLength:se(),origLength:se(),origChecksum:se()}),re+=16;var he,le=new Uint8Array(12+16*ne.length+ne.reduce((function(Ie,Y){return Ie+Y.origLength+4}),0)),ye=le.buffer,ze=new DataView(ye),Xe=0;return V($.flavor),fe($.numTables),fe(O),fe(Z),fe(j),ne.forEach((function(Ie){V(Ie.tag),V(Ie.origChecksum),V(re),V(Ie.origLength),Ie.outOffset=re,(re+=Ie.origLength)%4!=0&&(re+=4-re%4)})),ne.forEach((function(Ie){var Y,Ce=W.slice(Ie.offset,Ie.offset+Ie.compLength);if(Ie.compLength!=Ie.origLength){var Le=new Uint8Array(Ie.origLength);Y=new Uint8Array(Ce,2),F(Y,Le)}else Le=new Uint8Array(Ce);le.set(Le,Ie.outOffset);var Ge=0;(re=Ie.outOffset+Ie.origLength)%4!=0&&(Ge=4-re%4),le.set(new Uint8Array(Ge).buffer,Ie.outOffset+Ie.origLength),he=re+Ge})),ye.slice(0,he)},Object.defineProperty(r,"__esModule",{value:!0}),r})({}).convert_streams}function FU(r,e){const t={M:2,L:2,Q:4,C:6,Z:0},n={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},i=1,s=2,o=4,l=8,u=16,d=32;let p;function m(N){if(!p){const H={R:s,L:i,D:o,C:u,U:d,T:l};p=new Map;for(let F in n){let I=0;n[F].split(",").forEach(G=>{let[W,X]=G.split("+");W=parseInt(W,36),X=X?parseInt(X,36):0,p.set(I+=W,H[F]);for(let J=X;J--;)p.set(++I,H[F])})}}return p.get(N)||d}const v=1,y=2,x=3,M=4,S=[null,"isol","init","fina","medi"];function w(N){const H=new Uint8Array(N.length);let F=d,I=v,G=-1;for(let W=0;W<N.length;W++){const X=N.codePointAt(W);let J=m(X)|0,oe=v;J&l||(F&(i|o|u)?J&(s|o|u)?(oe=x,(I===v||I===x)&&H[G]++):J&(i|d)&&(I===y||I===M)&&H[G]--:F&(s|d)&&(I===y||I===M)&&H[G]--,I=H[W]=oe,F=J,G=W,X>65535&&W++)}return H}function A(N,H){const F=[];for(let G=0;G<H.length;G++){const W=H.codePointAt(G);W>65535&&G++,F.push(r.U.codeToGlyph(N,W))}const I=N.GSUB;if(I){const{lookupList:G,featureList:W}=I;let X;const J=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,oe=[];W.forEach(se=>{if(J.test(se.tag))for(let fe=0;fe<se.tab.length;
4406fe++){if(oe[se.tab[fe]])continue;oe[se.tab[fe]]=!0;const V=G[se.tab[fe]],$=/^(isol|init|fina|medi)$/.test(se.tag);$&&!X&&(X=w(H));for(let Z=0;Z<F.length;Z++)(!X||!$||S[X[Z]]===se.tag)&&r.U._applySubs(F,Z,V,G)}})}return F}function T(N,H){const F=new Int16Array(H.length*3);let I=0;for(;I<H.length;I++){const J=H[I];if(J===-1)continue;F[I*3+2]=N.hmtx.aWidth[J];const oe=N.GPOS;if(oe){const se=oe.lookupList;for(let fe=0;fe<se.length;fe++){const V=se[fe];for(let $=0;$<V.tabs.length;$++){const Z=V.tabs[$];if(V.ltype===1){if(r._lctf.coverageIndex(Z.coverage,J)!==-1&&Z.pos){X(Z.pos,I);break}}else if(V.ltype===2){let O=null,j=G();if(j!==-1){const re=r._lctf.coverageIndex(Z.coverage,H[j]);if(re!==-1){if(Z.fmt===1){const ne=Z.pairsets[re];for(let ie=0;ie<ne.length;ie++)ne[ie].gid2===J&&(O=ne[ie])}else if(Z.fmt===2){const ne=r.U._getGlyphClass(H[j],Z.classDef1),ie=r.U._getGlyphClass(J,Z.classDef2);O=Z.matrix[ne][ie]}if(O){O.val1&&X(O.val1,j),O.val2&&X(O.val2,I);break}}}}else if(V.ltype===4){const O=r._lctf.coverageIndex(Z.markCoverage,J);if(O!==-1){const j=G(W),re=j===-1?-1:r._lctf.coverageIndex(Z.baseCoverage,H[j]);if(re!==-1){const ne=Z.markArray[O],ie=Z.baseArray[re][ne.markClass];F[I*3]=ie.x-ne.x+F[j*3]-F[j*3+2],F[I*3+1]=ie.y-ne.y+F[j*3+1];break}}}else if(V.ltype===6){const O=r._lctf.coverageIndex(Z.mark1Coverage,J);if(O!==-1){const j=G();if(j!==-1){const re=H[j];if(R(N,re)===3){const ne=r._lctf.coverageIndex(Z.mark2Coverage,re);if(ne!==-1){const ie=Z.mark1Array[O],he=Z.mark2Array[ne][ie.markClass];F[I*3]=he.x-ie.x+F[j*3]-F[j*3+2],F[I*3+1]=he.y-ie.y+F[j*3+1];break}}}}}}}}else if(N.kern&&!N.cff){const se=G();if(se!==-1){const fe=N.kern.glyph1.indexOf(H[se]);if(fe!==-1){const V=N.kern.rval[fe].glyph2.indexOf(J);V!==-1&&(F[se*3+2]+=N.kern.rval[fe].vals[V])}}}}return F;function G(J){for(let oe=I-1;oe>=0;oe--)if(H[oe]!==-1&&(!J||J(H[oe])))return oe;return-1}function W(J){return R(N,J)===1}function X(J,oe){for(let se=0;se<3;se++)F[oe*3+se]+=J[se]||0}}function R(N,H){const F=N.GDEF&&N.GDEF.glyphClassDef;return F?r.U._getGlyphClass(H,F):0}function U(...N){for(let H=0;H<N.length;H++)if(typeof N[H]=="number")return N[H]}function k(N){const H=Object.create(null),F=N["OS/2"],I=N.hhea,G=N.head.unitsPerEm,W=U(F&&F.sTypoAscender,I&&I.ascender,G),X={unitsPerEm:G,ascender:W,descender:U(F&&F.sTypoDescender,I&&I.descender,0),capHeight:U(F&&F.sCapHeight,W),xHeight:U(F&&F.sxHeight,W),lineGap:U(F&&F.sTypoLineGap,I&&I.lineGap),supportsCodePoint(J){return r.U.codeToGlyph(N,J)>0},forEachGlyph(J,oe,se,fe){let V=0;const $=1/X.unitsPerEm*oe,Z=A(N,J);let O=0;const j=T(N,Z);return Z.forEach((re,ne)=>{if(re!==-1){let ie=H[re];if(!ie){const{cmds:he,crds:le}=r.U.glyphToPath(N,re);let ye="",ze=0;for(let Le=0,Ge=he.length;Le<Ge;Le++){const Ae=t[he[Le]];ye+=he[Le];for(let $e=1;$e<=Ae;$e++)ye+=($e>1?",":"")+le[ze++]}let Xe,Ie,Y,Ce;if(le.length){Xe=Ie=1/0,Y=Ce=-1/0;for(let Le=0,Ge=le.length;Le<Ge;Le+=2){let Ae=le[Le],$e=le[Le+1];Ae<Xe&&(Xe=Ae),$e<Ie&&(Ie=$e),Ae>Y&&(Y=Ae),$e>Ce&&(Ce=$e)}}else Xe=Y=Ie=Ce=0;ie=H[re]={index:re,advanceWidth:N.hmtx.aWidth[re],xMin:Xe,yMin:Ie,xMax:Y,yMax:Ce,path:ye}}fe.call(null,ie,V+j[ne*3]*$,j[ne*3+1]*$,O),V+=j[ne*3+2]*$,se&&(V+=se*oe)}O+=J.codePointAt(O)>65535?2:1}),V}};return X}return function(H){const F=new Uint8Array(H,0,4),I=r._bin.readASCII(F,0,4);if(I==="wOFF")H=e(H);else if(I==="wOF2")throw new Error("woff2 fonts not supported");return k(r.parse(H)[0])}}const NU=Mf({name:"Typr Font Parser",dependencies:[UU,kU,FU],init(r,e,t){const n=r(),i=e();return t(n,i)}});/*!
4407Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver) 4408for use in Troika text rendering. 4409Original MIT license applies 4410*/function OU(){return(function(r){var e=function(){this.buckets=new Map};e.prototype.add=function(T){var R=T>>5;this.buckets.set(R,(this.buckets.get(R)||0)|1<<(31&T))},e.prototype.has=function(T){var R=this.buckets.get(T>>5);return R!==void 0&&(R&1<<(31&T))!=0},e.prototype.serialize=function(){var T=[];return this.buckets.forEach((function(R,U){T.push((+U).toString(36)+":"+R.toString(36))})),T.join(",")},e.prototype.deserialize=function(T){var R=this;this.buckets.clear(),T.split(",").forEach((function(U){var k=U.split(":");R.buckets.set(parseInt(k[0],36),parseInt(k[1],36))}))};var t=Math.pow(2,8),n=t-1,i=~n;function s(T){var R=(function(k){return k&i})(T).toString(16),U=(function(k){return(k&i)+t-1})(T).toString(16);return"codepoint-index/plane"+(T>>16)+"/"+R+"-"+U+".json"}function o(T,R){var U=T&n,k=R.codePointAt(U/6|0);return((k=(k||48)-48)&1<<U%6)!=0}function l(T,R){var U;(U=T,U.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map((function(k){return k.split("-").map((function(N){return parseInt(N.trim(),16)}))}))).forEach((function(k){var N=k[0],H=k[1];H===void 0&&(H=N),R(N,H)}))}function u(T,R){l(T,(function(U,k){for(var N=U;N<=k;N++)R(N)}))}var d={},p={},m=new WeakMap,v="https://cdn.jsdelivr.net/gh/lojjic/[email protected]/packages/data";function y(T){var R=m.get(T);return R||(R=new e,u(T.ranges,(function(U){return R.add(U)})),m.set(T,R)),R}var x,M=new Map;function S(T,R,U){return T[R]?R:T[U]?U:(function(k){for(var N in k)return N})(T)}function w(T,R){var U=R;if(!T.includes(U)){U=1/0;for(var k=0;k<T.length;k++)Math.abs(T[k]-R)<Math.abs(U-R)&&(U=T[k])}return U}function A(T){return x||(x=new Set,u("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",(function(R){x.add(R)}))),x.has(T)}return r.CodePointSet=e,r.clearCache=function(){d={},p={}},r.getFontsForString=function(T,R){R===void 0&&(R={});var U,k=R.lang;k===void 0&&(k=new RegExp("\\p{Script=Hangul}","u").test(U=T)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(U)?"ja":"en");var N=R.category;N===void 0&&(N="sans-serif");var H=R.style;H===void 0&&(H="normal");var F=R.weight;F===void 0&&(F=400);var I=(R.dataUrl||v).replace(/\/$/g,""),G=new Map,W=new Uint8Array(T.length),X={},J={},oe=new Array(T.length),se=new Map,fe=!1;function V(O){var j=M.get(O);return j||(j=fetch(I+"/"+O).then((function(re){if(!re.ok)throw new Error(re.statusText);return re.json().then((function(ne){if(!Array.isArray(ne)||ne[0]!==1)throw new Error("Incorrect schema version; need 1, got "+ne[0]);return ne[1]}))})).catch((function(re){if(I!==v)return fe||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+I+'", trying default CDN. '+re.message),fe=!0),I=v,M.delete(O),V(O);throw re})),M.set(O,j)),j}for(var $=function(O){var j=T.codePointAt(O),re=s(j);oe[O]=re,d[re]||se.has(re)||se.set(re,V(re).then((function(ne){d[re]=ne}))),j>65535&&(O++,Z=O)},Z=0;Z<T.length;Z++)$(Z);return Promise.all(se.values()).then((function(){se.clear();for(var O=function(re){var ne=T.codePointAt(re),ie=null,he=d[oe[re]],le=void 0;for(var ye in he){var ze=J[ye];if(ze===void 0&&(ze=J[ye]=new RegExp(ye).test(k||"en")),ze){for(var Xe in le=ye,he[ye])if(o(ne,he[ye][Xe])){ie=Xe;break}break}}if(!ie){e:for(var Ie in he)if(Ie!==le){for(var Y in he[Ie])if(o(ne,he[Ie][Y])){ie=Y;break e}}}ie||(console.debug("No font coverage for U+"+ne.toString(16)),ie="latin"),oe[re]=ie,p[ie]||se.has(ie)||se.set(ie,V("font-meta/"+ie+".json").then((function(Ce){p[ie]=Ce}))),ne>65535&&(re++,j=re)},j=0;j<T.length;j++)O(j);return Promise.all(se.values())})).then((function(){for(var O,j=null,re=0;re<T.length;re++){var ne=T.codePointAt(re);if(j&&(A(ne)||y(j).has(ne)))W[re]=W[re-1];else{j=p[oe[re]];var ie=X[j.id];if(!ie){var he=j.typeforms,le=S(he,N,"sans-serif"),ye=S(he[le],H,"normal"),ze=w((O=he[le])===null||O===void 0?void 0:O[ye],F);ie=X[j.id]=I+"/font-files/"+j.id+"/"+le+"."+ye+"."+ze+".woff"}var Xe=G.get(ie);Xe==null&&(Xe=G.size,G.set(ie,Xe)),W[re]=Xe}ne>65535&&(re++,W[re]=W[re-1])}return{fontUrls:Array.from(G.keys()),chars:W}}))}
4410,Object.defineProperty(r,"__esModule",{value:!0}),r})({})}function BU(r,e){const t=Object.create(null),n=Object.create(null);function i(o,l){const u=d=>{console.error(`Failure loading font ${o}`,d)};try{const d=new XMLHttpRequest;d.open("get",o,!0),d.responseType="arraybuffer",d.onload=function(){if(d.status>=400)u(new Error(d.statusText));else if(d.status>0)try{const p=r(d.response);p.src=o,l(p)}catch(p){u(p)}},d.onerror=u,d.send()}catch(d){u(d)}}function s(o,l){let u=t[o];u?l(u):n[o]?n[o].push(l):(n[o]=[l],i(o,d=>{d.src=o,t[o]=d,n[o].forEach(p=>p(d)),delete n[o]}))}return function(o,l,{lang:u,fonts:d=[],style:p="normal",weight:m="normal",unicodeFontsURL:v}={}){const y=new Uint8Array(o.length),x=[];o.length||A();const M=new Map,S=[];if(p!=="italic"&&(p="normal"),typeof m!="number"&&(m=m==="bold"?700:400),d&&!Array.isArray(d)&&(d=[d]),d=d.slice().filter(R=>!R.lang||R.lang.test(u)).reverse(),d.length){let N=0;(function H(F=0){for(let I=F,G=o.length;I<G;I++){const W=o.codePointAt(I);if(N===1&&x[y[I-1]].supportsCodePoint(W)||I>0&&/\s/.test(o[I]))y[I]=y[I-1],N===2&&(S[S.length-1][1]=I);else for(let X=y[I],J=d.length;X<=J;X++)if(X===J){const oe=N===2?S[S.length-1]:S[S.length]=[I,I];oe[1]=I,N=2}else{y[I]=X;const{src:oe,unicodeRange:se}=d[X];if(!se||T(W,se)){const fe=t[oe];if(!fe){s(oe,()=>{H(I)});return}if(fe.supportsCodePoint(W)){let V=M.get(fe);typeof V!="number"&&(V=x.length,x.push(fe),M.set(fe,V)),y[I]=V,N=1;break}}}W>65535&&I+1<G&&(y[I+1]=y[I],I++,N===2&&(S[S.length-1][1]=I))}w()})()}else S.push([0,o.length-1]),w();function w(){if(S.length){const R=S.map(U=>o.substring(U[0],U[1]+1)).join(` 4411`);e.getFontsForString(R,{lang:u||void 0,style:p,weight:m,dataUrl:v}).then(({fontUrls:U,chars:k})=>{const N=x.length;let H=0;S.forEach(I=>{for(let G=0,W=I[1]-I[0];G<=W;G++)y[I[0]+G]=k[H++]+N;H++});let F=0;U.forEach((I,G)=>{s(I,W=>{x[G+N]=W,++F===U.length&&A()})})})}else A()}function A(){l({chars:y,fonts:x})}function T(R,U){for(let k=0;k<U.length;k++){const[N,H=N]=U[k];if(N<=R&&R<=H)return!0}return!1}}}const zU=Mf({name:"FontResolver",dependencies:[BU,NU,OU],init(r,e,t){return r(e,t())}});function HU(r,e){const n=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,i="[^\\S\\u00A0]",s=new RegExp(`${i}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function o({text:x,lang:M,fonts:S,style:w,weight:A,preResolvedFonts:T,unicodeFontsURL:R},U){const k=({chars:N,fonts:H})=>{let F,I;const G=[];for(let W=0;W<N.length;W++)N[W]!==I?(I=N[W],G.push(F={start:W,end:W,fontObj:H[N[W]]})):F.end=W;U(G)};T?k(T):r(x,k,{lang:M,fonts:S,style:w,weight:A,unicodeFontsURL:R})}function l({text:x="",font:M,lang:S,sdfGlyphSize:w=64,fontSize:A=400,fontWeight:T=1,fontStyle:R="normal",letterSpacing:U=0,lineHeight:k="normal",maxWidth:N=1/0,direction:H,textAlign:F="left",textIndent:I=0,whiteSpace:G="normal",overflowWrap:W="normal",anchorX:X=0,anchorY:J=0,metricsOnly:oe=!1,unicodeFontsURL:se,preResolvedFonts:fe=null,includeCaretPositions:V=!1,chunkedBoundsSize:$=8192,colorRanges:Z=null},O){const j=m(),re={fontLoad:0,typesetting:0};x.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),x=x.replace(/\r\n/g,` 4412`).replace(/\r/g,` 4413`)),A=+A,U=+U,N=+N,k=k||"normal",I=+I,o({text:x,lang:S,style:R,weight:T,fonts:typeof M=="string"?[{src:M}]:M,unicodeFontsURL:se,preResolvedFonts:fe},ne=>{re.fontLoad=m()-j;const ie=isFinite(N);let he=null,le=null,ye=null,ze=null,Xe=null,Ie=null,Y=null,Ce=null,Le=0,Ge=0,Ae=G!=="nowrap";const $e=new Map,Re=m();let He=I,Q=0,B=new v;const pe=[B];ne.forEach(Oe=>{const{fontObj:Qe}=Oe,{ascender:at,descender:Ke,unitsPerEm:tt,lineGap:wt,capHeight:nt,xHeight:et}=Qe;let it=$e.get(Qe);if(!it){const xe=A/tt,De=k==="normal"?(at-Ke+wt)*xe:k*A,rt=(De-(at-Ke)*xe)/2,mt=Math.min(De,(at-Ke)*xe),vt=(at+Ke)/2*xe+mt/2;it={index:$e.size,src:Qe.src,fontObj:Qe,fontSizeMult:xe,unitsPerEm:tt,ascender:at*xe,descender:Ke*xe,capHeight:nt*xe,xHeight:et*xe,lineHeight:De,baseline:-rt-at*xe,caretTop:vt,caretBottom:vt-mt},$e.set(Qe,it)}const{fontSizeMult:ue}=it,qe=x.slice(Oe.start,Oe.end+1);let ce,Fe;Qe.forEachGlyph(qe,A,U,(xe,De,rt,mt)=>{De+=Q,mt+=Oe.start,ce=De,Fe=xe;const vt=x.charAt(mt),kt=xe.advanceWidth*ue,Ft=B.count;let pt;if("isEmpty"in xe||(xe.isWhitespace=!!vt&&new RegExp(i).test(vt),xe.canBreakAfter=!!vt&&s.test(vt),xe.isEmpty=xe.xMin===xe.xMax||xe.yMin===xe.yMax||n.test(vt)),!xe.isWhitespace&&!xe.isEmpty&&Ge++,Ae&&ie&&!xe.isWhitespace&&De+kt+He>N&&Ft){if(B.glyphAt(Ft-1).glyphObj.canBreakAfter)pt=new v,He=-De;else for(let dn=Ft;dn--;)if(dn===0&&W==="break-word"){pt=new v,He=-De;break}else if(B.glyphAt(dn).glyphObj.canBreakAfter){pt=B.splitAt(dn+1);const Sn=pt.glyphAt(0).x;He-=Sn;for(let bn=pt.count;bn--;)pt.glyphAt(bn).x-=Sn;break}pt&&(B.isSoftWrapped=!0,B=pt,pe.push(B),Le=N)}let Kt=B.glyphAt(B.count);Kt.glyphObj=xe,Kt.x=De+He,Kt.y=rt,Kt.width=kt,Kt.charIndex=mt,Kt.fontData=it,vt===`
4414`&&(B=new v,pe.push(B),He=-(De+kt+U*A)+I)}),Q=ce+Fe.advanceWidth*ue+U*A});let ge=0;pe.forEach(Oe=>{let Qe=!0;for(let at=Oe.count;at--;){const Ke=Oe.glyphAt(at);Qe&&!Ke.glyphObj.isWhitespace&&(Oe.width=Ke.x+Ke.width,Oe.width>Le&&(Le=Oe.width),Qe=!1);let{lineHeight:tt,capHeight:wt,xHeight:nt,baseline:et}=Ke.fontData;tt>Oe.lineHeight&&(Oe.lineHeight=tt);const it=et-Oe.baseline;it<0&&(Oe.baseline+=it,Oe.cap+=it,Oe.ex+=it),Oe.cap=Math.max(Oe.cap,Oe.baseline+wt),Oe.ex=Math.max(Oe.ex,Oe.baseline+nt)}Oe.baseline-=ge,Oe.cap-=ge,Oe.ex-=ge,ge+=Oe.lineHeight});let ve=0,we=0;if(X&&(typeof X=="number"?ve=-X:typeof X=="string"&&(ve=-Le*(X==="left"?0:X==="center"?.5:X==="right"?1:d(X)))),J&&(typeof J=="number"?we=-J:typeof J=="string"&&(we=J==="top"?0:J==="top-baseline"?-pe[0].baseline:J==="top-cap"?-pe[0].cap:J==="top-ex"?-pe[0].ex:J==="middle"?ge/2:J==="bottom"?ge:J==="bottom-baseline"?-pe[pe.length-1].baseline:d(J)*ge)),!oe){const Oe=e.getEmbeddingLevels(x,H);he=new Uint16Array(Ge),le=new Uint8Array(Ge),ye=new Float32Array(Ge*2),ze={},Y=[1/0,1/0,-1/0,-1/0],Ce=[],V&&(Ie=new Float32Array(x.length*4)),Z&&(Xe=new Uint8Array(Ge*3));let Qe=0,at=-1,Ke=-1,tt,wt;if(pe.forEach((nt,et)=>{let{count:it,width:ue}=nt;if(it>0){let qe=0;for(let mt=it;mt--&&nt.glyphAt(mt).glyphObj.isWhitespace;)qe++;let ce=0,Fe=0;if(F==="center")ce=(Le-ue)/2;else if(F==="right")ce=Le-ue;else if(F==="justify"&&nt.isSoftWrapped){let mt=0;for(let vt=it-qe;vt--;)nt.glyphAt(vt).glyphObj.isWhitespace&&mt++;Fe=(Le-ue)/mt}if(Fe||ce){let mt=0;for(let vt=0;vt<it;vt++){let kt=nt.glyphAt(vt);const Ft=kt.glyphObj;kt.x+=ce+mt,Fe!==0&&Ft.isWhitespace&&vt<it-qe&&(mt+=Fe,kt.width+=Fe)}}const xe=e.getReorderSegments(x,Oe,nt.glyphAt(0).charIndex,nt.glyphAt(nt.count-1).charIndex);for(let mt=0;mt<xe.length;mt++){const[vt,kt]=xe[mt];let Ft=1/0,pt=-1/0;for(let Kt=0;Kt<it;Kt++)if(nt.glyphAt(Kt).charIndex>=vt){let dn=Kt,Sn=Kt;for(;Sn<it;Sn++){let bn=nt.glyphAt(Sn);if(bn.charIndex>kt)break;Sn<it-qe&&(Ft=Math.min(Ft,bn.x),pt=Math.max(pt,bn.x+bn.width))}for(let bn=dn;bn<Sn;bn++){const ii=nt.glyphAt(bn);ii.x=pt-(ii.x+ii.width-Ft)}break}}let De;const rt=mt=>De=mt;for(let mt=0;mt<it;mt++){const vt=nt.glyphAt(mt);De=vt.glyphObj;const kt=De.index,Ft=Oe.levels[vt.charIndex]&1;if(Ft){const pt=e.getMirroredCharacter(x[vt.charIndex]);pt&&vt.fontData.fontObj.forEachGlyph(pt,0,0,rt)}if(V){const{charIndex:pt,fontData:Kt}=vt,dn=vt.x+ve,Sn=vt.x+vt.width+ve;Ie[pt*4]=Ft?Sn:dn,Ie[pt*4+1]=Ft?dn:Sn,Ie[pt*4+2]=nt.baseline+Kt.caretBottom+we,Ie[pt*4+3]=nt.baseline+Kt.caretTop+we;const bn=pt-at;bn>1&&p(Ie,at,bn),at=pt}if(Z){const{charIndex:pt}=vt;for(;pt>Ke;)Ke++,Z.hasOwnProperty(Ke)&&(wt=Z[Ke])}if(!De.isWhitespace&&!De.isEmpty){const pt=Qe++,{fontSizeMult:Kt,src:dn,index:Sn}=vt.fontData,bn=ze[dn]||(ze[dn]={});bn[kt]||(bn[kt]={path:De.path,pathBounds:[De.xMin,De.yMin,De.xMax,De.yMax]});const ii=vt.x+ve,vr=vt.y+nt.baseline+we;ye[pt*2]=ii,ye[pt*2+1]=vr;const fi=ii+De.xMin*Kt,Ai=vr+De.yMin*Kt,_i=ii+De.xMax*Kt,Si=vr+De.yMax*Kt;fi<Y[0]&&(Y[0]=fi),Ai<Y[1]&&(Y[1]=Ai),_i>Y[2]&&(Y[2]=_i),Si>Y[3]&&(Y[3]=Si),pt%$===0&&(tt={start:pt,end:pt,rect:[1/0,1/0,-1/0,-1/0]},Ce.push(tt)),tt.end++;const hi=tt.rect;if(fi<hi[0]&&(hi[0]=fi),Ai<hi[1]&&(hi[1]=Ai),_i>hi[2]&&(hi[2]=_i),Si>hi[3]&&(hi[3]=Si),he[pt]=kt,le[pt]=Sn,Z){const Pr=pt*3;Xe[Pr]=wt>>16&255,Xe[Pr+1]=wt>>8&255,Xe[Pr+2]=wt&255}}}}}),Ie){const nt=x.length-at;nt>1&&p(Ie,at,nt)}}const ut=[];$e.forEach(({index:Oe,src:Qe,unitsPerEm:at,ascender:Ke,descender:tt,lineHeight:wt,capHeight:nt,xHeight:et})=>{ut[Oe]={src:Qe,unitsPerEm:at,ascender:Ke,descender:tt,lineHeight:wt,capHeight:nt,xHeight:et}}),re.typesetting=m()-Re,O({glyphIds:he,glyphFontIndices:le,glyphPositions:ye,glyphData:ze,fontData:ut,caretPositions:Ie,glyphColors:Xe,chunkedBounds:Ce,fontSize:A,topBaseline:we+pe[0].baseline,blockBounds:[ve,we-ge,ve+Le,we],visibleBounds:Y,timings:re})})}function u(x,M){l({...x,metricsOnly:!0},S=>{const[w,A,T,R]=S.blockBounds;M({width:T-w,height:R-A})})}function d(x){let M=x.match(/^([\d.]+)%$/),S=M?parseFloat(M[1]):NaN;return isNaN(S)?0:S/100}function p(x,M,S){const w=x[M*4],A=x[M*4+1],T=x[M*4+2],R=x[M*4+3],U=(A-w)/S;for(let k=0;k<S;k++){const N=(M+k)*4;x[N]=w+U*k,x[N+1]=w+U*(k+1),x[N+2]=T,x[N+3]=R}}function m(){return(self.performance||Date).now()}function v(){this.data=[]}const y=["glyphObj","x","y","width","charIndex","fontData"];return v.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/y.length)},glyphAt(x){let M=v.flyweight;return M.data=this.data,M.index=x,M},splitAt(x){let M=new v;
4414return M.data=this.data.splice(x*y.length),M}},v.flyweight=y.reduce((x,M,S,w)=>(Object.defineProperty(x,M,{get(){return this.data[this.index*y.length+S]},set(A){this.data[this.index*y.length+S]=A}}),x),{data:null,index:0}),{typeset:l,measure:u}}const Ru=()=>(self.performance||Date).now(),fv=K2();let ew;function GU(r,e,t,n,i,s,o,l,u,d,p=!0){return p?jU(r,e,t,n,i,s,o,l,u,d).then(null,m=>(ew||(console.warn("WebGL SDF generation failed, falling back to JS",m),ew=!0),nw(r,e,t,n,i,s,o,l,u,d))):nw(r,e,t,n,i,s,o,l,u,d)}const Wg=[],VU=5;let Dx=0;function J2(){const r=Ru();for(;Wg.length&&Ru()-r<VU;)Wg.shift()();Dx=Wg.length?setTimeout(J2,0):0}const jU=(...r)=>new Promise((e,t)=>{Wg.push(()=>{const n=Ru();try{fv.webgl.generateIntoCanvas(...r),e({timing:Ru()-n})}catch(i){t(i)}}),Dx||(Dx=setTimeout(J2,0))}),WU=4,XU=2e3,tw={};let YU=0;function nw(r,e,t,n,i,s,o,l,u,d){const p="TroikaTextSDFGenerator_JS_"+YU++%WU;let m=tw[p];return m||(m=tw[p]={workerModule:Mf({name:p,workerId:p,dependencies:[K2,Ru],init(v,y){const x=v().javascript.generate;return function(...M){const S=y();return{textureData:x(...M),timing:y()-S}}},getTransferables(v){return[v.textureData.buffer]}}),requests:0,idleTimer:null}),m.requests++,clearTimeout(m.idleTimer),m.workerModule(r,e,t,n,i,s).then(({textureData:v,timing:y})=>{const x=Ru(),M=new Uint8Array(v.length*4);for(let S=0;S<v.length;S++)M[S*4+d]=v[S];return fv.webglUtils.renderImageData(o,M,l,u,r,e,1<<3-d),y+=Ru()-x,--m.requests===0&&(m.idleTimer=setTimeout(()=>{MU(p)},XU)),{timing:y}})}function qU(r){r._warm||(fv.webgl.isSupported(r),r._warm=!0)}const KU=fv.webglUtils.resizeWebGLCanvasWithoutClearing,Nh={unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},ZU=new St;function $d(){return(self.performance||Date).now()}const iw=Object.create(null);function Q2(r,e){r=$U({},r);const t=$d(),n=[];if(r.font&&n.push({label:"user",src:ek(r.font)}),r.font=n,r.text=""+r.text,r.sdfGlyphSize=r.sdfGlyphSize||Nh.sdfGlyphSize,r.unicodeFontsURL=r.unicodeFontsURL||Nh.unicodeFontsURL,r.colorRanges!=null){let v={};for(let y in r.colorRanges)if(r.colorRanges.hasOwnProperty(y)){let x=r.colorRanges[y];typeof x!="number"&&(x=ZU.set(x).getHex()),v[y]=x}r.colorRanges=v}Object.freeze(r);const{textureWidth:i,sdfExponent:s}=Nh,{sdfGlyphSize:o}=r,l=i/o*4;let u=iw[o];if(!u){const v=document.createElement("canvas");v.width=i,v.height=o*256/l,u=iw[o]={glyphCount:0,sdfGlyphSize:o,sdfCanvas:v,sdfTexture:new di(v,void 0,void 0,void 0,ni,ni),contextLost:!1,glyphsByFont:new Map},u.sdfTexture.generateMipmaps=!1,JU(u)}const{sdfTexture:d,sdfCanvas:p}=u;tE(r).then(v=>{const{glyphIds:y,glyphFontIndices:x,fontData:M,glyphPositions:S,fontSize:w,timings:A}=v,T=[],R=new Float32Array(y.length*4);let U=0,k=0;const N=$d(),H=M.map(X=>{let J=u.glyphsByFont.get(X.src);return J||u.glyphsByFont.set(X.src,J=new Map),J});y.forEach((X,J)=>{const oe=x[J],{src:se,unitsPerEm:fe}=M[oe];let V=H[oe].get(X);if(!V){const{path:re,pathBounds:ne}=v.glyphData[se][X],ie=Math.max(ne[2]-ne[0],ne[3]-ne[1])/o*(Nh.sdfMargin*o+.5),he=u.glyphCount++,le=[ne[0]-ie,ne[1]-ie,ne[2]+ie,ne[3]+ie];H[oe].set(X,V={path:re,atlasIndex:he,sdfViewBox:le}),T.push(V)}const{sdfViewBox:$}=V,Z=S[k++],O=S[k++],j=w/fe;R[U++]=Z+$[0]*j,R[U++]=O+$[1]*j,R[U++]=Z+$[2]*j,R[U++]=O+$[3]*j,y[J]=V.atlasIndex}),A.quads=(A.quads||0)+($d()-N);const F=$d();A.sdf={};const I=p.height,G=Math.ceil(u.glyphCount/l),W=Math.pow(2,Math.ceil(Math.log2(G*o)));W>I&&(console.info(`Increasing SDF texture size ${I}->${W}`),KU(p,i,W),d.dispose()),Promise.all(T.map(X=>$2(X,u,r.gpuAccelerateSDF).then(({timing:J})=>{A.sdf[X.atlasIndex]=J}))).then(()=>{T.length&&!u.contextLost&&(eE(u),d.needsUpdate=!0),A.sdfTotal=$d()-F,A.total=$d()-t,e(Object.freeze({parameters:r,sdfTexture:d,sdfGlyphSize:o,sdfExponent:s,glyphBounds:R,glyphAtlasIndices:y,glyphColors:v.glyphColors,caretPositions:v.caretPositions,chunkedBounds:v.chunkedBounds,ascender:v.ascender,descender:v.descender,lineHeight:v.lineHeight,capHeight:v.capHeight,xHeight:v.xHeight,topBaseline:v.topBaseline,blockBounds:v.blockBounds,visibleBounds:v.visibleBounds,timings:v.timings}))})}),Promise.resolve().then(()=>{u.contextLost||qU(p)})}function $2({path:r,atlasIndex:e,sdfViewBox:t},{sdfGlyphSize:n,sdfCanvas:i,contextLost:s},o){if(s)return Promise.resolve({timing:-1});const{textureWidth:l,sdfExponent:u}=Nh,d=Math.max(t[2]-t[0],t[3]-t[1]),p=Math.floor(e/4),m=p%(l/n)*n,v=Math.floor(p/(l/n))*n,y=e%4;return GU(n,n,r,t,d,u,i,m,v,y,o)}function JU(r){const e=r.sdfCanvas;e.addEventListener("webglcontextlost",t=>{console.log("Context Lost",t),t.preventDefault(),r.contextLost=!0}),e.addEventListener("webglcontextrestored",t=>{console.log("Context Restored",t),r.contextLost=!1;const n=[];r.glyphsByFont.forEach(i=>
4414{i.forEach(s=>{n.push($2(s,r,!0))})}),Promise.all(n).then(()=>{eE(r),r.sdfTexture.needsUpdate=!0})})}function QU({font:r,characters:e,sdfGlyphSize:t},n){let i=Array.isArray(e)?e.join(` 4415`):""+e;Q2({font:r,sdfGlyphSize:t,text:i},n)}function $U(r,e){for(let t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}let Ug;function ek(r){return Ug||(Ug=typeof document>"u"?{}:document.createElement("a")),Ug.href=r,Ug.href}function eE(r){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:t}=r,{width:n,height:i}=e,s=r.sdfCanvas.getContext("webgl");let o=t.image.data;(!o||o.length!==n*i*4)&&(o=new Uint8Array(n*i*4),t.image={width:n,height:i,data:o},t.flipY=!1,t.isDataTexture=!0),s.readPixels(0,0,n,i,s.RGBA,s.UNSIGNED_BYTE,o)}}const tk=Mf({name:"Typesetter",dependencies:[HU,zU,TU],init(r,e,t){return r(e,t())}}),tE=Mf({name:"Typesetter",dependencies:[tk],init(r){return function(e){return new Promise(t=>{r.typeset(e,t)})}},getTransferables(r){const e=[];for(let t in r)r[t]&&r[t].buffer&&e.push(r[t].buffer);return e}});tE.onMainThread;const rw={};function nk(r){let e=rw[r];return e||(e=rw[r]=new bl(1,1,r,r).translate(.5,.5,0)),e}const ik="aTroikaGlyphBounds",sw="aTroikaGlyphIndex",rk="aTroikaGlyphColor";class sk extends uv{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new hr,this.boundingBox=new ir}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let t=nk(e);["position","normal","uv"].forEach(n=>{this.attributes[n]=t.attributes[n].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,n,i,s){this.updateAttributeData(ik,e,4),this.updateAttributeData(sw,t,1),this.updateAttributeData(rk,s,3),this._blockBounds=n,this._chunkedBounds=i,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:n}=this;if(t){const{PI:i,floor:s,min:o,max:l,sin:u,cos:d}=Math,p=i/2,m=i*2,v=Math.abs(t),y=e[0]/v,x=e[2]/v,M=s((y+p)/m)!==s((x+p)/m)?-v:o(u(y)*v,u(x)*v),S=s((y-p)/m)!==s((x-p)/m)?v:l(u(y)*v,u(x)*v),w=s((y+i)/m)!==s((x+i)/m)?v*2:l(v-d(y)*v,v-d(x)*v);n.min.set(M,e[1],t<0?-w:0),n.max.set(S,e[3],t<0?0:w)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(sw).count,n=this._chunkedBounds;if(n)for(let i=n.length;i--;){t=n[i].end;let s=n[i].rect;if(s[1]<e.w&&s[3]>e.y&&s[0]<e.z&&s[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,n){const i=this.getAttribute(e);t?i&&i.array.length===t.length?(i.array.set(t),i.needsUpdate=!0):(this.setAttribute(e,new Pu(t,n)),delete this._maxInstanceCount,this.dispose()):i&&this.deleteAttribute(e)}}const ok=` 4416uniform vec2 uTroikaSDFTextureSize; 4417uniform float uTroikaSDFGlyphSize; 4418uniform vec4 uTroikaTotalBounds; 4419uniform vec4 uTroikaClipRect; 4420uniform mat3 uTroikaOrient; 4421uniform bool uTroikaUseGlyphColors; 4422uniform float uTroikaEdgeOffset; 4423uniform float uTroikaBlurRadius; 4424uniform vec2 uTroikaPositionOffset; 4425uniform float uTroikaCurveRadius; 4426attribute vec4 aTroikaGlyphBounds; 4427attribute float aTroikaGlyphIndex; 4428attribute vec3 aTroikaGlyphColor; 4429varying vec2 vTroikaGlyphUV; 4430varying vec4 vTroikaTextureUVBounds; 4431varying float vTroikaTextureChannel; 4432varying vec3 vTroikaGlyphColor; 4433varying vec2 vTroikaGlyphDimensions; 4434`,ak=` 4435vec4 bounds = aTroikaGlyphBounds; 4436bounds.xz += uTroikaPositionOffset.x; 4437bounds.yw -= uTroikaPositionOffset.y; 4438 4439vec4 outlineBounds = vec4( 4440 bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius, 4441 bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius 4442); 4443vec4 clippedBounds = vec4( 4444 clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw), 4445 clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw) 4446); 4447 4448vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy); 4449 4450position.xy = mix(bounds.xy, bounds.zw, clippedXY); 4451 4452uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy); 4453 4454float rad = uTroikaCurveRadius; 4455if (rad != 0.0) { 4456 float angle = position.x / rad; 4457 position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad); 4458 normal.xz = vec2(sin(angle), cos(angle)); 4459} 4460 4461position = uTroikaOrient * position; 4462normal = uTroikaOrient * normal; 4463 4464vTroikaGlyphUV = clippedXY.xy; 4465vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]); 4466 4467 4468float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize; 4469vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize; 4470vec2 txStartUV = txUvPerSquare * vec2( 4471 mod(floor(aTroikaGlyphIndex / 4.0), txCols), 4472 floor(floor(aTroikaGlyphIndex / 4.0) / txCols) 4473); 4474vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare); 4475vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0); 4476`,lk=` 4477uniform sampler2D uTroikaSDFTexture; 4478uniform vec2 uTroikaSDFTextureSize; 4479uniform float uTroikaSDFGlyphSize; 4480uniform float uTroikaSDFExponent; 4481uniform float uTroikaEdgeOffset; 4482uniform float uTroikaFillOpacity; 4483uniform float uTroikaBlurRadius; 4484uniform vec3 uTroikaStrokeColor; 4485uniform float uTroikaStrokeWidth; 4486uniform float uTroikaStrokeOpacity; 4487uniform bool uTroikaSDFDebug; 4488varying vec2 vTroikaGlyphUV; 4489varying vec4 vTroikaTextureUVBounds; 4490varying float vTroikaTextureChannel; 4491varying vec2 vTroikaGlyphDimensions; 4492 4493float troikaSdfValueToSignedDistance(float alpha) { 4494 // Inverse of exponential encoding in webgl-sdf-generator 4495 4496 float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y); 4497 float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension; 4498 float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0); 4499 return signedDist; 4500} 4501 4502float troikaGlyphUvToSdfValue(vec2 glyphUV) { 4503 vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV); 4504 vec4 rgba = texture2D(uTroikaSDFTexture, textureUV); 4505 float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1 4506 return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a; 4507} 4508 4509float troikaGlyphUvToDistance(vec2 uv) { 4510 return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv)); 4511} 4512 4513float troikaGetAADist() { 4514 4515 #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300 4516 return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5; 4517 #else 4518 return vTroikaGlyphDimensions.x / 64.0; 4519 #endif 4520} 4521 4522float troikaGetFragDistValue() { 4523 vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize); 4524 float distance = troikaGlyphUvToDistance(clampedGlyphUV); 4525 4526 // Extrapolate distance when outside bounds: 4527 distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 4528 length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions); 4529 4530 4531 4532 return distance; 4533} 4534 4535float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) { 4536 #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL) 4537 float alpha = step(-distanceOffset, -distance); 4538 #else 4539 4540 float alpha = smoothstep( 4541 distanceOffset + aaDist, 4542 distanceOffset - aaDist, 4543 distance 4544 ); 4545 #endif 4546 4547 return alpha; 4548} 4549`,ck=` 4550float aaDist = troikaGetAADist(); 4551float fragDistance = troikaGetFragDistValue(); 4552float edgeAlpha = uTroikaSDFDebug ? 4553 troikaGlyphUvToSdfValue(vTroikaGlyphUV) : 4554 troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius)); 4555 4556#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL) 4557vec4 fillRGBA = gl_FragColor; 4558fillRGBA.a *= uTroikaFillOpacity; 4559vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity); 4560if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb; 4561gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep( 4562 -uTroikaStrokeWidth - aaDist, 4563 -uTroikaStrokeWidth + aaDist, 4564 fragDistance 4565));
4566gl_FragColor.a *= edgeAlpha; 4567#endif 4568 4569if (edgeAlpha == 0.0) { 4570 discard; 4571} 4572`;function uk(r){const e=Lx(r,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new We},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new fn(0,0,0,0)},uTroikaClipRect:{value:new fn(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new We},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new St},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new on},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:ok,vertexTransform:ak,fragmentDefs:lk,fragmentColorTransform:ck,customRewriter({vertexShader:t,fragmentShader:n}){let i=/\buniform\s+vec3\s+diffuse\b/;return i.test(n)&&(n=n.replace(i,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),i.test(t)||(t=t.replace(Z2,`uniform vec3 diffuse; 4573$& 4574vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; 4575`))),{vertexShader:t,fragmentShader:n}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const z1=new Sl({color:16777215,side:os,transparent:!0}),ow=8421504,aw=new Xt,kg=new te,$y=new te,Dh=[],dk=new te,ex="+x+y";function lw(r){return Array.isArray(r)?r[0]:r}let nE=()=>{const r=new ui(new bl(1,1),z1);return nE=()=>r,r},iE=()=>{const r=new ui(new bl(1,1,32,1),z1);return iE=()=>r,r};const fk={type:"syncstart"},hk={type:"synccomplete"},rE=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],pk=rE.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let sE=class extends ui{constructor(){const e=new sk;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=ow,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=ex,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(fk),Q2({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach(i=>i&&i())})),this.dispatchEvent(hk),e&&e()})))}onBeforeRender(e,t,n,i,s,o){this.sync(),s.isTroikaTextMaterial&&this._prepareForRender(s)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return uk(e)}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=z1.clone());if((!e||!e.isDerivedFrom(t))&&(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function n(){t.removeEventListener("dispose",n),e.dispose()})),this.hasOutline()){let n=e._outlineMtl;return n||(n=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),n.isTextOutlineMaterial=!0,n.depthWrite=!1,n.map=null,e.addEventListener("dispose",function i(){e.removeEventListener("dispose",i),n.dispose()})),[n,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return lw(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return lw(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){const t=e.isTextOutlineMaterial,n=e.uniforms,i=this.textRenderInfo;if(i){const{sdfTexture:l,blockBounds:u}=i;n.uTroikaSDFTexture.value=l,n.uTroikaSDFTextureSize.value.set(l.image.width,l.image.height),n.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,n.uTroikaSDFExponent.value=i.sdfExponent,n.uTroikaTotalBounds.value.fromArray(u),n.uTroikaUseGlyphColors.value=!t&&!!i.glyphColors;let d=0,p=0,m=0,v,y,x,M=0,S=0;if(t){let{outlineWidth:A,outlineOffsetX:T,outlineOffsetY:R,outlineBlur:U,outlineOpacity:k}=this;d=this._parsePercent(A)||0,p=Math.max(0,this._parsePercent(U)||0),v=k,M=this._parsePercent(T)||0,S=this._parsePercent(R)||0}else m=Math.max(0,this._parsePercent(this.strokeWidth)||0),m&&(x=this.strokeColor,n.uTroikaStrokeColor.value.set(x??ow),y=this.strokeOpacity,y==null&&(y=1)),v=this.fillOpacity;n.uTroikaEdgeOffset.value=d,n.uTroikaPositionOffset.value.set(M,S),n.uTroikaBlurRadius.value=p,n.uTroikaStrokeWidth.value=m,n.uTroikaStrokeOpacity.value=y,n.uTroikaFillOpacity.value=v??1,n.uTroikaCurveRadius.value=this.curveRadius||0;let w=this.clipRect;if(w&&Array.isArray(w)&&w.length===4)n.uTroikaClipRect.value.fromArray(w);else{const A=(this.fontSize||.1)*100;n.uTroikaClipRect.value.set(u[0]-A,u[1]-A,u[2]+A,u[3]+A)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const s=t?this.outlineColor||0:this.color;if(s==null)delete e.color;else{const l=e.hasOwnProperty("color")?e.color:e.color=new St;(s!==l._input||typeof s=="object")&&l.set(l._input=s)}let o=this.orientation||ex;if(o!==e._orientation){let l=n.uTroikaOrient.value;o=o.replace(/[^-+xyz]/g,"");let u=o!==ex&&o.match(/^([-+])([xyz])([-+])([xyz])$/);if(u){let[,d,p,m,v]=u;kg.set(0,0,0)[p]=d==="-"?1:-1,$y.set(0,0,0)[v]=m==="-"?-1:1,aw.lookAt(dk,kg.cross($y),$y),l.setFromMatrix4(aw)}else l.identity();e._orientation=o}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new We){t.copy(e);const n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new We){return kg.copy(e),this.localPositionToTextCoords(this.worldToLocal(kg),t)}raycast(e,t){const{textRenderInfo:n,curveRadius:i}=this;if(n){const s=n.blockBounds,o=i?iE():nE(),l=o.geometry,{position:u,uv:d}=l.attributes;for(let p=0;p<d.count;p++){let m=s[0]+d.getX(p)*(s[2]-s[0]);const v=s[1]+d.getY(p)*(s[3]-s[1]);let y=0;i&&(y=i-Math.cos(m/i)*i,m=Math.sin(m/i)*i),u.setXYZ(p,m,v,y)}l.boundingSphere=this.geometry.boundingSphere,l.boundingBox=this.geometry.boundingBox,o.matrixWorld=this.matrixWorld,o.material.side=this.material.side,Dh.length=0,o.raycast(e,Dh);for(let p=0;p<Dh.length;p++)Dh[p].object=this,t.push(Dh[p])}}copy(e){const t=this.geometry;return super.copy(e),this.geometry=t,pk.forEach(n=>{this[n]=e[n]}),this}clone(){return new this.constructor().copy(this)}};
4575rE.forEach(r=>{const e="_private_"+r;Object.defineProperty(sE.prototype,r,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});new ir;new St;const H1=K.forwardRef(({sdfGlyphSize:r=64,anchorX:e="center",anchorY:t="middle",font:n,fontSize:i=1,children:s,characters:o,onSync:l,...u},d)=>{const p=Bs(({invalidate:x})=>x),[m]=K.useState(()=>new sE),[v,y]=K.useMemo(()=>{const x=[];let M="";return K.Children.forEach(s,S=>{typeof S=="string"||typeof S=="number"?M+=S:x.push(S)}),[x,M]},[s]);return dD(()=>new Promise(x=>QU({font:n,characters:o},x)),["troika-text",n,o]),K.useLayoutEffect(()=>void m.sync(()=>{p(),l&&l(m)})),K.useEffect(()=>()=>m.dispose(),[m]),K.createElement("primitive",vc({object:m,ref:d,font:n,text:y,anchorX:e,anchorY:t,fontSize:i,sdfGlyphSize:r},u),v)}),mk=K.forwardRef(({makeDefault:r,camera:e,regress:t,domElement:n,enableDamping:i=!0,keyEvents:s=!1,onChange:o,onStart:l,onEnd:u,...d},p)=>{const m=Bs(k=>k.invalidate),v=Bs(k=>k.camera),y=Bs(k=>k.gl),x=Bs(k=>k.events),M=Bs(k=>k.setEvents),S=Bs(k=>k.set),w=Bs(k=>k.get),A=Bs(k=>k.performance),T=e||v,R=n||x.connected||y.domElement,U=K.useMemo(()=>new gU(T),[T]);return us(()=>{U.enabled&&U.update()},-1),K.useEffect(()=>(s&&U.connect(s===!0?R:s),U.connect(R),()=>void U.dispose()),[s,R,t,U,m]),K.useEffect(()=>{const k=F=>{m(),t&&A.regress(),o&&o(F)},N=F=>{l&&l(F)},H=F=>{u&&u(F)};return U.addEventListener("change",k),U.addEventListener("start",N),U.addEventListener("end",H),()=>{U.removeEventListener("start",N),U.removeEventListener("end",H),U.removeEventListener("change",k)}},[o,l,u,U,m,M]),K.useEffect(()=>{if(r){const k=w().controls;return S({controls:U}),()=>S({controls:k})}},[r,U]),K.createElement("primitive",vc({ref:p,object:U,enableDamping:i},d))}),gk=K.createContext(null);/** 4576 * postprocessing v6.39.1 build Fri Apr 17 2026 4577 * https://github.com/pmndrs/postprocessing 4578 * Copyright 2015-2026 Raoul van Rüschen 4579 * @license Zlib 4580 */var vk=(()=>{const r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new qt;return t.setAttribute("position",new zn(r,3)),t.setAttribute("uv",new zn(e,2)),t})(),ds=class Ux{static get fullscreenGeometry(){return vk}constructor(e="Pass",t=new dp,n=new ta){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthBlit=!1,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new ui(Ux.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new dp),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=na){}render(e,t,n,i,s){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,n){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof xi||t instanceof Rr||t instanceof di||t instanceof Ux)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},yk=class extends ds{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(r,e,t,n,i){const s=r.state.buffers.stencil;s.setLocked(!1),s.setTest(!1)}},xk=`#ifdef COLOR_WRITE 4581#include <common> 4582#include <dithering_pars_fragment> 4583#ifdef FRAMEBUFFER_PRECISION_HIGH 4584uniform mediump sampler2D inputBuffer; 4585#else 4586uniform lowp sampler2D inputBuffer; 4587#endif 4588#endif 4589#ifdef DEPTH_WRITE 4590#include <packing> 4591#ifdef GL_FRAGMENT_PRECISION_HIGH 4592uniform highp sampler2D depthBuffer; 4593#else 4594uniform mediump sampler2D depthBuffer; 4595#endif 4596float readDepth(const in vec2 uv){ 4597#if DEPTH_PACKING == 3201 4598return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 4599#else 4600return texture2D(depthBuffer,uv).r; 4601#endif 4602} 4603#endif 4604#ifdef USE_WEIGHTS 4605uniform vec4 channelWeights; 4606#endif 4607uniform float opacity;varying vec2 vUv;void main(){ 4608#ifdef COLOR_WRITE 4609vec4 texel=texture2D(inputBuffer,vUv); 4610#ifdef USE_WEIGHTS 4611texel*=channelWeights; 4612#endif 4613gl_FragColor=opacity*texel; 4614#ifdef COLOR_SPACE_CONVERSION 4615#include <colorspace_fragment> 4616#endif 4617#include <dithering_fragment> 4618#else 4619gl_FragColor=vec4(0.0); 4620#endif 4621#ifdef DEPTH_WRITE 4622gl_FragDepth=readDepth(vUv); 4623#endif 4624}`,G1="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",oE=class extends Vi{constructor(){super({name:"CopyMaterial",defines:{COLOR_SPACE_CONVERSION:"1",DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new hn(null),depthBuffer:new hn(null),channelWeights:new hn(null),opacity:new hn(1)},blending:Wr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:xk,vertexShader:G1}),this.depthFunc=R0}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(r){const e=r!==null;this.colorWrite!==e&&(e?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=e,this.needsUpdate=!0),this.uniforms.inputBuffer.value=r}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(r){const e=r!==null;this.depthWrite!==e&&(e?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=e,this.depthWrite=e,this.needsUpdate=!0),this.uniforms.depthBuffer.value=r}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}get colorSpaceConversion(){return this.defines.COLOR_SPACE_CONVERSION!==void 0}set colorSpaceConversion(r){this.colorSpaceConversion!==r&&(r?this.defines.COLOR_SPACE_CONVERSION=!0:delete this.defines.COLOR_SPACE_CONVERSION,this.needsUpdate=!0)}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(r){r!==null?(this.defines.USE_WEIGHTS="1",this.uniforms.channelWeights.value=r):delete this.defines.USE_WEIGHTS,this.needsUpdate=!0}setInputBuffer(r){this.uniforms.inputBuffer.value=r}getOpacity(r){return this.uniforms.opacity.value}setOpacity(r){this.uniforms.opacity.value=r}},_k=class extends ds{constructor(r,e=!0){super("CopyPass"),this.fullscreenMaterial=new oE,this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new xi(1,1,{minFilter:ni,magFilter:ni,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(r){this.autoResize=r}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(r){this.autoResize=r}render(r,e,t,n,i){this.fullscreenMaterial.inputBuffer=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){this.autoResize&&this.renderTarget.setSize(r,e)}initialize(r,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==pr?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":r!==null&&r.outputColorSpace
vendor: 4,192 bytes, line 4624
4624===Bn&&(this.renderTarget.texture.colorSpace=Bn))}},cw=new St,V1=class extends ds{constructor(r=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=r,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(r,e,t){this.color=r,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(r){this.overrideClearColor=r}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(r){this.overrideClearAlpha=r}render(r,e,t,n,i){const s=this.overrideClearColor,o=this.overrideClearAlpha,l=r.getClearAlpha(),u=s!==null,d=o>=0;u?(r.getClearColor(cw),r.setClearColor(s,d?o:l)):d&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),u?r.setClearColor(cw,l):d&&r.setClearAlpha(l)}},Sk=class extends ds{constructor(r,e){super("MaskPass",r,e),this.needsSwap=!1,this.clearPass=new V1(!1,!1,!0),this.inverse=!1}set mainScene(r){this.scene=r}set mainCamera(r){this.camera=r}get inverted(){return this.inverse}set inverted(r){this.inverse=r}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(r){this.inverted=r}render(r,e,t,n,i){const s=r.getContext(),o=r.state.buffers,l=this.scene,u=this.camera,d=this.clearPass,p=this.inverted?0:1,m=1-p;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,p,4294967295),o.stencil.setClear(m),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?d.render(r,null):(d.render(r,e),d.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(l,u)):(r.setRenderTarget(e),r.render(l,u),r.setRenderTarget(t),r.render(l,u)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}},tx=1/1e3,bk=1e3,wk=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(r){typeof document<"u"&&document.hidden!==void 0&&(r?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=r)}get delta(){return this._delta*tx}get fixedDelta(){return this._fixedDelta*tx}set fixedDelta(r){this._fixedDelta=r*bk}get elapsed(){return this._elapsed*tx}update(r){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(r!==void 0?r:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(r){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},Mk=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,n,s,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new _k,this.depthTexture=null,this.depthRenderTarget=null,this.passes=[],this.timer=new wk,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples}set multisampling(e){const t=this.inputBuffer,n=this.multisampling;n>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):n!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new We),n=e.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;
4624i===pr&&e.outputColorSpace===Bn&&(this.inputBuffer.texture.colorSpace=Bn,this.outputBuffer.texture.colorSpace=Bn,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const s of this.passes)s.initialize(e,n,i)}}replaceRenderer(e,t=!0){const n=this.renderer,i=n.domElement.parentNode;return this.setRenderer(e),t&&i!==null&&(i.removeChild(n.domElement),i.appendChild(e.domElement)),n}createDepthTexture(){const e=this.inputBuffer,t=new H0;this.depthTexture=t,e.stencilBuffer?(t.format=mc,t.type=pc):t.type=as;const n=t.clone();return n.name="EffectComposer.StableDepth",this.depthRenderTarget=new xi(e.width,e.height,{depthBuffer:!0,stencilBuffer:e.stencilBuffer,depthTexture:n}),n}blitDepthBuffer(e){const t=this.renderer,n=this.depthRenderTarget,i=t.properties,s=t.getContext();t.setRenderTarget(n);const o=i.get(e).__webglFramebuffer,l=i.get(n).__webglFramebuffer,u=e.stencilBuffer?s.DEPTH_BUFFER_BIT|s.STENCIL_BUFFER_BIT:s.DEPTH_BUFFER_BIT;s.bindFramebuffer(s.READ_FRAMEBUFFER,o),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,l),s.blitFramebuffer(0,0,e.width,e.height,0,0,n.width,n.height,u,s.NEAREST),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),t.setRenderTarget(null)}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.depthRenderTarget.dispose(),this.depthRenderTarget=null,this.inputBuffer.depthTexture=null,this.outputBuffer.depthTexture=null;for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,n,i){const s=this.renderer,o=s===null?new We:s.getDrawingBufferSize(new We),l={minFilter:ni,magFilter:ni,stencilBuffer:t,depthBuffer:e,type:n},u=new xi(o.width,o.height,l);return i>0&&(u.samples=i),n===pr&&s!==null&&s.outputColorSpace===Bn&&(u.texture.colorSpace=Bn),u.texture.name="EffectComposer.Buffer",u.texture.generateMipmaps=!1,u}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const n=this.passes,i=this.renderer,s=i.getDrawingBufferSize(new We),o=i.getContext().getContextAttributes().alpha,l=this.inputBuffer.texture.type;if(e.renderer=i,e.setSize(s.width,s.height),e.initialize(i,o,l),this.autoRenderToScreen&&(n.length>0&&(n[n.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?n.splice(t,0,e):n.push(e),this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const u=this.createDepthTexture();for(e of n)e.setDepthTexture(u)}else{const u=this.depthRenderTarget.depthTexture;e.setDepthTexture(u)}}removePass(e){const t=this.passes,n=t.indexOf(e);if(n!==-1&&t.splice(n,1).length>0){if(this.depthTexture!==null){const o=(u,d)=>u||d.needsDepthTexture;if(!t.reduce(o,!1)){const u=this.depthRenderTarget.depthTexture;e.getDepthTexture()===u&&e.setDepthTexture(null),this.deleteDepthTexture()}}this.autoRenderToScreen&&n===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,n=this.copyPass;let i=this.inputBuffer,s=this.outputBuffer,o,l=!1;
vendor: 5,197 bytes, line 4624
4624e===void 0&&(this.timer.update(),e=this.timer.getDelta());for(const u of this.passes)if(u.enabled){if(i.depthTexture=this.depthTexture,s.depthTexture=null,u.render(t,i,s,e,l),u.needsDepthBlit&&this.depthRenderTarget!==null&&this.blitDepthBuffer(i),u.needsSwap){if(l){n.renderToScreen=u.renderToScreen;const d=t.getContext(),p=t.state.buffers.stencil;p.setFunc(d.NOTEQUAL,1,4294967295),n.render(t,i,s,e,l),p.setFunc(d.EQUAL,1,4294967295)}o=i,i=s,s=o}u instanceof Sk?l=!0:u instanceof yk&&(l=!1)}}setSize(e,t,n){const i=this.renderer,s=i.getSize(new We);(e===void 0||t===void 0)&&(e=s.width,t=s.height),(s.width!==e||s.height!==t)&&i.setSize(e,t,n);const o=i.getDrawingBufferSize(new We);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height),this.depthRenderTarget!==null&&this.depthRenderTarget.setSize(o.width,o.height);for(const l of this.passes)l.setSize(o.width,o.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),ds.fullscreenGeometry.dispose()}},La={NONE:0,DEPTH:1,CONVOLUTION:2},Fn={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Ek=class{constructor(){this.shaderParts=new Map([[Fn.FRAGMENT_HEAD,null],[Fn.FRAGMENT_MAIN_UV,null],[Fn.FRAGMENT_MAIN_IMAGE,null],[Fn.VERTEX_HEAD,null],[Fn.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=La.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=ia}},nx=!1,uw=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case os:t=this.materialsFlatShadedDoubleSide;break;case dr:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case os:t=this.materialsDoubleSide;break;case dr:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(r){if(!(r instanceof Vi))return r.clone();const e=r.uniforms,t=new Map;for(const i in e){const s=e[i].value;s.isRenderTargetTexture&&(e[i].value=null,t.set(i,s))}const n=r.clone();for(const i of t)e[i[0]].value=i[1],n.uniforms[i[0]].value=i[1];return n}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){const e=this.materials=[this.cloneMaterial(r),this.cloneMaterial(r),this.cloneMaterial(r)];for(const t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Da;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},r.uniforms),n.side=dr,n}),this.materialsDoubleSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},r.uniforms),n.side=os,n}),this.materialsFlatShaded=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=dr,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=os,n})}}render(r,e,t){const n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,nx){const i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(const s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{const i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){const r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return nx}static set workaroundEnabled(r){nx=r}},oc=-1,fr=class extends ro{constructor(r=null,e=oc,t=oc,n=1){super(),r!==null&&this.addEventListener("change",()=>r.setSize(this.baseSize.width,this.baseSize.height)),this.baseSize=new We(1,1),this.preferredSize=new We(e,t),this.target=this.preferredSize,this.s=n,this.effectiveSize=new We,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const r=this.baseSize,e=this.preferredSize,t=this.effectiveSize,n=this.scale;e.width!==oc?t.width=e.width:e.height!==oc?t.width=Math.round(e.height*(r.width/
vendor: 9,631 bytes, line 4624
4624Math.max(r.height,1))):t.width=Math.round(r.width*n),e.height!==oc?t.height=e.height:e.width!==oc?t.height=Math.round(e.width/Math.max(r.width/Math.max(r.height,1),1)):t.height=Math.round(r.height*n)}get width(){return this.effectiveSize.width}set width(r){this.preferredWidth=r}get height(){return this.effectiveSize.height}set height(r){this.preferredHeight=r}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(r){this.s!==r&&(this.s=r,this.preferredSize.setScalar(oc),this.dispatchEvent({type:"change"}))}getScale(){return this.scale}setScale(r){this.scale=r}get baseWidth(){return this.baseSize.width}set baseWidth(r){this.baseSize.width!==r&&(this.baseSize.width=r,this.dispatchEvent({type:"change"}))}getBaseWidth(){return this.baseWidth}setBaseWidth(r){this.baseWidth=r}get baseHeight(){return this.baseSize.height}set baseHeight(r){this.baseSize.height!==r&&(this.baseSize.height=r,this.dispatchEvent({type:"change"}))}getBaseHeight(){return this.baseHeight}setBaseHeight(r){this.baseHeight=r}setBaseSize(r,e){(this.baseSize.width!==r||this.baseSize.height!==e)&&(this.baseSize.set(r,e),this.dispatchEvent({type:"change"}))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(r){this.preferredSize.width!==r&&(this.preferredSize.width=r,this.dispatchEvent({type:"change"}))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(r){this.preferredWidth=r}get preferredHeight(){return this.preferredSize.height}set preferredHeight(r){this.preferredSize.height!==r&&(this.preferredSize.height=r,this.dispatchEvent({type:"change"}))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(r){this.preferredHeight=r}setPreferredSize(r,e){(this.preferredSize.width!==r||this.preferredSize.height!==e)&&(this.preferredSize.set(r,e),this.dispatchEvent({type:"change"}))}copy(r){this.s=r.scale,this.baseSize.set(r.baseWidth,r.baseHeight),this.preferredSize.set(r.preferredWidth,r.preferredHeight),this.dispatchEvent({type:"change"})}static get AUTO_SIZE(){return oc}},Tk=class{constructor(r=0){this.nextId=r}getNextId(){return this.nextId++}reset(r=0){return this.nextId=r,this}},ix=new Tk(2),Ak=class extends Set{constructor(r,e=ix.getNextId()){super(),this.exclusive=!1,this._layer=e,(this._layer<1||this._layer>31)&&(console.warn("Layer out of range, resetting to 2"),ix.reset(2),this._layer=ix.getNextId()),r!==void 0&&this.set(r)}get layer(){return this._layer}set layer(r){const e=this._layer;for(const t of this)t.layers.disable(e),t.layers.enable(r);this._layer=r}getLayer(){return this.layer}setLayer(r){this.layer=r}isExclusive(){return this.exclusive}setExclusive(r){this.exclusive=r}clear(){const r=this.layer;for(const e of this)e.layers.disable(r);return super.clear()}set(r){this.clear();for(const e of r)this.add(e);return this}indexOf(r){return this.has(r)?0:-1}add(r){return this.exclusive?r.layers.set(this.layer):r.layers.enable(this.layer),super.add(r)}delete(r){return this.has(r)&&r.layers.disable(this.layer),super.delete(r)}toggle(r){let e;return this.has(r)?(this.delete(r),e=!1):(this.add(r),e=!0),e}setVisible(r){for(const e of this)r?e.layers.enable(0):e.layers.disable(0);return this}},vn={ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Ck="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Rk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,src.a*opacity);}",Pk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=(dst.rgb+src.rgb)*0.5;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Ik="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.xy,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Lk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/max(b,1e-9))),vec3(1.0),step(1.0,a));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Dk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Uk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",kk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=abs(dst.rgb-src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Fk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb/max(src.rgb,1e-9);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Nk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-2.0*dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Ok="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb,1.0);vec3 b=min(src.rgb,1.0);vec3 c=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Bk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=step(1.0,dst.rgb+src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",zk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.x,a.yz));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Hk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Gk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=src.rgb*max(1.0-dst.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Vk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",jk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Wk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb+src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Xk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(2.0*src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Yk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.xy,b.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",qk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Kk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-abs(1.0-dst.rgb-src.rgb),0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Zk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,opacity);}",Jk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=2.0*src.rgb*dst.rgb;vec3 b=1.0-2.0*(1.0-src.rgb)*(1.0-dst.rgb);vec3 c=mix(a,b,step(0.5,dst.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Qk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 c=mix(mix(src2,dst.rgb,step(0.5*dst.rgb,src.rgb)),max(src2-1.0,vec3(0.0)),step(dst.rgb,src2-1.0));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",$k="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb*dst.rgb/max(1.0-src.rgb,1e-9),1.0);vec3 c=mix(a,src.rgb,step(1.0,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",eF="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.x,b.y,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",tF="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-min(dst.rgb*src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",nF="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 d=dst.rgb+(src2-1.0);vec3 w=step(0.5,src.rgb);vec3 a=dst.rgb-(1.0-src2)*dst.rgb*(1.0-dst.rgb);vec3 b=mix(d*(sqrt(dst.rgb)-dst.rgb),d*dst.rgb*((16.0*dst.rgb-12.0)*dst.rgb+3.0),w*(1.0-step(0.25,dst.rgb)));vec3 c=mix(a,b,w);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",iF="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return src;}",rF="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",sF="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=mix(max(1.0-min((1.0-dst.rgb)/(2.0*src.rgb),1.0),0.0),min(dst.rgb/(2.0*(1.0-src.rgb)),1.0),step(0.5,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",oF=new Map([[vn.ADD,Ck],[vn.ALPHA,Rk],[vn.AVERAGE,Pk],[vn.COLOR,Ik],[vn.COLOR_BURN,Lk],[vn.COLOR_DODGE,Dk],[vn.DARKEN,Uk],[vn.DIFFERENCE,kk
vendor: 11,726 bytes, lines 4624-4662
4624],[vn.DIVIDE,Fk],[vn.DST,null],[vn.EXCLUSION,Nk],[vn.HARD_LIGHT,Ok],[vn.HARD_MIX,Bk],[vn.HUE,zk],[vn.INVERT,Hk],[vn.INVERT_RGB,Gk],[vn.LIGHTEN,Vk],[vn.LINEAR_BURN,jk],[vn.LINEAR_DODGE,Wk],[vn.LINEAR_LIGHT,Xk],[vn.LUMINOSITY,Yk],[vn.MULTIPLY,qk],[vn.NEGATION,Kk],[vn.NORMAL,Zk],[vn.OVERLAY,Jk],[vn.PIN_LIGHT,Qk],[vn.REFLECT,$k],[vn.SATURATION,eF],[vn.SCREEN,tF],[vn.SOFT_LIGHT,nF],[vn.SRC,iF],[vn.SUBTRACT,rF],[vn.VIVID_LIGHT,sF]]),aF=class extends ro{constructor(r,e=1){super(),this._blendFunction=r,this.opacity=new hn(e)}getOpacity(){return this.opacity.value}setOpacity(r){this.opacity.value=r}get blendFunction(){return this._blendFunction}set blendFunction(r){this._blendFunction=r,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r}getShaderCode(){return oF.get(this.blendFunction)}},kx=class extends ro{constructor(r,e,{attributes:t=La.NONE,blendFunction:n=vn.NORMAL,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:l=null}={}){super(),this.name=r,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=l,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new aF(n),this.blendMode.addEventListener("change",u=>this.setChanged()),this._inputColorSpace=ia,this._outputColorSpace=Qo}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(r){this._inputColorSpace=r,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(r){this._outputColorSpace=r,this.setChanged()}set mainScene(r){}set mainCamera(r){}getName(){return this.name}setRenderer(r){this.renderer=r}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(r,e=na){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(const r of Object.keys(this)){const e=this[r];(e instanceof xi||e instanceof Rr||e instanceof di||e instanceof ds)&&this[r].dispose()}}},j1={MEDIUM:2,LARGE:3},lF=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4625uniform mediump sampler2D inputBuffer; 4626#else 4627uniform lowp sampler2D inputBuffer; 4628#endif 4629varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; 4630#include <colorspace_fragment> 4631}`,cF="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",uF=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],dF=class extends Vi{constructor(r=new fn){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new hn(null),texelSize:new hn(new fn),scale:new hn(1),kernel:new hn(0)},blending:Wr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:lF,vertexShader:cF}),this.setTexelSize(r.x,r.y),this.kernelSize=j1.MEDIUM}set inputBuffer(r){this.uniforms.inputBuffer.value=r}setInputBuffer(r){this.inputBuffer=r}get kernelSequence(){return uF[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(r){this.uniforms.scale.value=r}getScale(){return this.uniforms.scale.value}setScale(r){this.uniforms.scale.value=r}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(r){this.uniforms.kernel.value=r}setKernel(r){this.kernel=r}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e,r*.5,e*.5)}setSize(r,e){const t=1/r,n=1/e;this.uniforms.texelSize.value.set(t,n,t*.5,n*.5)}},fF=class extends ds{constructor({kernelSize:r=j1.MEDIUM,resolutionScale:e=.5,width:t=fr.AUTO_SIZE,height:n=fr.AUTO_SIZE,resolutionX:i=t,resolutionY:s=n}={}){super("KawaseBlurPass"),this.renderTargetA=new xi(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new fr(this,i,s,e);o.addEventListener("change",l=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new dF,this._blurMaterial.kernelSize=r,this.copyMaterial=new oE}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(r){this._blurMaterial=r}get dithering(){return this.copyMaterial.dithering}set dithering(r){this.copyMaterial.dithering=r}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(r){this.blurMaterial.kernelSize=r}get width(){return this.resolution.width}set width(r){this.resolution.preferredWidth=r}get height(){return this.resolution.height}set height(r){this.resolution.preferredHeight=r}get scale(){return this.blurMaterial.scale}set scale(r){this.blurMaterial.scale=r}getScale(){return this.blurMaterial.scale}setScale(r){this.blurMaterial.scale=r}getKernelSize(){return this.kernelSize}setKernelSize(r){this.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){const s=this.scene,o=this.camera,l=this.renderTargetA,u=this.renderTargetB,d=this.blurMaterial,p=d.kernelSequence;let m=e;this.fullscreenMaterial=d;for(let v=0,y=p.length;v<y;++v){const x=(v&1)===0?l:u;d.kernel=p[v],d.inputBuffer=m.texture,r.setRenderTarget(x),r.render(s,o),m=x}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=m.texture,r.setRenderTarget(this.renderToScreen?null:t),r.render(s,o)}setSize(r,e){const t=this.resolution;t.setBaseSize(r,e);const n=t.width,i=t.height;this.renderTargetA.setSize(n,i),this.renderTargetB.setSize(n,i),this.blurMaterial.setSize(r,e)}initialize(r,e,t){t!==void 0&&(this.renderTargetA.texture.type=t,this.renderTargetB.texture.type=t,t!==pr?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):r!==null&&r.outputColorSpace===Bn&&(this.renderTargetA.texture.colorSpace=Bn,this.renderTargetB.texture.colorSpace=Bn))}static get AUTO_SIZE(){return fr.AUTO_SIZE}},hF=`#include <common> 4632#ifdef FRAMEBUFFER_PRECISION_HIGH 4633uniform mediump sampler2D inputBuffer; 4634#else 4635uniform lowp sampler2D inputBuffer; 4636#endif 4637#ifdef RANGE 4638uniform vec2 range; 4639#elif defined(THRESHOLD) 4640uniform float threshold;uniform float smoothing; 4641#endif 4642varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0; 4643#ifdef RANGE 4644float low=step(range.x,l);float high=step(l,range.y);mask=low*high; 4645#elif defined(THRESHOLD) 4646mask=smoothstep(threshold,threshold+smoothing,l); 4647#endif 4648#ifdef COLOR 4649gl_FragColor=texel*mask; 4650#else 4651gl_FragColor=vec4(l*mask); 4652#endif 4653}`,pF=class extends Vi{constructor(r=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:Du.replace(/\D+/g,"")},uniforms:{inputBuffer:new hn(null),threshold:new hn(0),smoothing:new hn(1),range:new hn(null)},blending:Wr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:hF,vertexShader:G1}),this.colorOutput=r,this.luminanceRange=e}set inputBuffer(r){this.uniforms.inputBuffer.value=r}setInputBuffer(r){this.uniforms.inputBuffer.value=r}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.smoothing>0||r>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=r}getThreshold(){return this.threshold}setThreshold(r){this.threshold=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.threshold>0||r>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=r}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(r){this.smoothing=r}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(r){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(r){return this.colorOutput}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.luminanceRange!==null}set useRange(r){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(r){r!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=r,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(r){this.luminanceRange=r}},mF=class extends ds{constructor({renderTarget:r,luminanceRange:e,colorOutput:t,resolutionScale:n=1,width:i=fr.AUTO_SIZE,height:s=fr.AUTO_SIZE,resolutionX:o=i,resolutionY:l=s}={}){super("LuminancePass"),this.fullscreenMaterial=new pF(t,e),this.needsSwap=!1,this.renderTarget=r,this.renderTarget===void 0&&(this.renderTarget=new xi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const u=this.resolution=new fr(this,o,l,n);u.addEventListener("change",d=>this.setSize(u.baseWidth,u.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(r,e,t,n,i){const s=this.fullscreenMaterial;s.inputBuffer=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){const t=this.resolution;t.setBaseSize(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){t!==void 0&&t!==pr&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},gF=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4654uniform mediump sampler2D inputBuffer; 4655#else 4656uniform lowp sampler2D inputBuffer; 4657#endif 4658#define WEIGHT_INNER 0.125 4659#define WEIGHT_OUTER 0.05556 4660varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; 4661#include <colorspace_fragment> 4662}`,vF="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;
4662vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",yF=class extends Vi{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new hn(null),texelSize:new hn(new We)},blending:Wr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:gF,vertexShader:vF})}set inputBuffer(r){this.uniforms.inputBuffer.value=r}setSize(r,e){this.uniforms.texelSize.value.set(1/r,1/e)}},xF=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4663uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; 4664#else 4665uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; 4666#endif 4667uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); 4668#include <colorspace_fragment> 4669}`,_F="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",SF=class extends Vi{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new hn(null),supportBuffer:new hn(null),texelSize:new hn(new We),radius:new hn(.85)},blending:Wr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:xF,vertexShader:_F})}set inputBuffer(r){this.uniforms.inputBuffer.value=r}set supportBuffer(r){this.uniforms.supportBuffer.value=r}get radius(){return this.uniforms.radius.value}set radius(r){this.uniforms.radius.value=r}setSize(r,e){this.uniforms.texelSize.value.set(1/r,1/e)}},bF=class extends ds{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new xi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new yF,this.upsamplingMaterial=new SF,this.resolution=new We}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(r){if(this.levels!==r){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t<r;++t){const n=e.clone();n.texture.name="Downsampling.Mipmap"+t,this.downsamplingMipmaps.push(n)}this.upsamplingMipmaps.push(e);for(let t=1,n=r-1;t<n;++t){const i=e.clone();i.texture.name="Upsampling.Mipmap"+t,this.upsamplingMipmaps.push(i)}this.setSize(this.resolution.x,this.resolution.y)}}get radius(){return this.upsamplingMaterial.radius}set radius(r){this.upsamplingMaterial.radius=r}render(r,e,t,n,i){const{scene:s,camera:o}=this,{downsamplingMaterial:l,upsamplingMaterial:u}=this,{downsamplingMipmaps:d,upsamplingMipmaps:p}=this;let m=e;this.fullscreenMaterial=l;for(let v=0,y=d.length;v<y;++v){const x=d[v];l.setSize(m.width,m.height),l.inputBuffer=m.texture,r.setRenderTarget(x),r.render(s,o),m=x}this.fullscreenMaterial=u;for(let v=p.length-1;v>=0;--v){const y=p[v];
4669u.setSize(m.width,m.height),u.inputBuffer=m.texture,u.supportBuffer=d[v].texture,r.setRenderTarget(y),r.render(s,o),m=y}}setSize(r,e){const t=this.resolution;t.set(r,e);let n=t.width,i=t.height;for(let s=0,o=this.downsamplingMipmaps.length;s<o;++s)n=Math.round(n*.5),i=Math.round(i*.5),this.downsamplingMipmaps[s].setSize(n,i),s<this.upsamplingMipmaps.length&&this.upsamplingMipmaps[s].setSize(n,i)}initialize(r,e,t){if(t!==void 0){const n=this.downsamplingMipmaps.concat(this.upsamplingMipmaps);for(const i of n)i.texture.type=t;if(t!==pr)this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1";else if(r!==null&&r.outputColorSpace===Bn)for(const i of n)i.texture.colorSpace=Bn}}dispose(){super.dispose();for(const r of this.downsamplingMipmaps.concat(this.upsamplingMipmaps))r.dispose()}},wF=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4670uniform mediump sampler2D map; 4671#else 4672uniform lowp sampler2D map; 4673#endif 4674uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,MF=class extends kx{constructor({blendFunction:r=vn.SCREEN,luminanceThreshold:e=1,luminanceSmoothing:t=.03,mipmapBlur:n=!0,intensity:i=1,radius:s=.85,levels:o=8,kernelSize:l=j1.LARGE,resolutionScale:u=.5,width:d=fr.AUTO_SIZE,height:p=fr.AUTO_SIZE,resolutionX:m=d,resolutionY:v=p}={}){super("BloomEffect",wF,{blendFunction:r,uniforms:new Map([["map",new hn(null)],["intensity",new hn(i)]])}),this.renderTarget=new xi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new fF({kernelSize:l}),this.luminancePass=new mF({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new bF,this.mipmapBlurPass.enabled=n,this.mipmapBlurPass.radius=s,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=n?this.mipmapBlurPass.texture:this.renderTarget.texture;const y=this.resolution=new fr(this,m,v,u);y.addEventListener("change",x=>this.setSize(y.baseWidth,y.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(r){this.resolution.preferredWidth=r}get height(){return this.resolution.height}set height(r){this.resolution.preferredHeight=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(r){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getIntensity(){return this.intensity}setIntensity(r){this.intensity=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){const n=this.renderTarget,i=this.luminancePass;i.enabled?(i.render(r,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(r,i.renderTarget):this.blurPass.render(r,i.renderTarget,n)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(r,e):this.blurPass.render(r,e,n)}setSize(r,e){const t=this.resolution;t.setBaseSize(r,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(r,e),this.mipmapBlurPass.setSize(r,e)}initialize(r,e,t){this.blurPass.initialize(r,e,t),this.luminancePass.initialize(r,e,t),this.mipmapBlurPass.initialize(r,e,t),t!==void 0&&(this.renderTarget.texture.type=t,r!==null&&r.outputColorSpace===Bn&&(this.renderTarget.texture.colorSpace=Bn))}},EF=class extends ds{constructor(r,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=r,this.input=e}setInput(r){this.input=r}render(r,e,t,n,i){const s=this.fullscreenMaterial.uniforms;e!==null&&s!==void 0&&s[this.input]!==void 0&&(s[this.input].value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){t!==void 0&&t!==pr&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},W1=class extends ds{constructor(r,e,t=null){super("RenderPass",r,e),this.needsSwap=!1,this.needsDepthBlit=!0,this.clearPass=new V1,this.overrideMaterialManager=t===null?null:new uw(t),this.ignoreBackgroun
vendor: 4,167 bytes, lines 4674-4704
4674d=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(r){this.scene=r}set mainCamera(r){this.camera=r}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){const r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){const e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uw(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(r){this.overrideMaterial=r}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getSelection(){return this.selection}setSelection(r){this.selection=r}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(r){this.ignoreBackground=r}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(r){this.skipShadowMapUpdate=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){const s=this.scene,o=this.camera,l=this.selection,u=o.layers.mask,d=s.background,p=r.shadowMap.autoUpdate,m=this.renderToScreen?null:e;l!==null&&o.layers.set(l.getLayer()),this.skipShadowMapUpdate&&(r.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(s.background=null),this.clearPass.enabled&&this.clearPass.render(r,e),r.setRenderTarget(m),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),o.layers.mask=u,s.background=d,r.shadowMap.autoUpdate=p}},Zh={KEEP_MAX_DEPTH:1,DISCARD_MAX_DEPTH:2},TF=class extends ds{constructor(r,e,{renderTarget:t,resolutionScale:n=1,width:i=fr.AUTO_SIZE,height:s=fr.AUTO_SIZE,resolutionX:o=i,resolutionY:l=s}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new W1(r,e,new Pp({depthPacking:Ep}));const u=this.renderPass;u.skipShadowMapUpdate=!0,u.ignoreBackground=!0,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new xi(1,1,{minFilter:yi,magFilter:yi}),this.renderTarget.texture.name="DepthPass.Target");const d=this.resolution=new fr(this,o,l,n);d.addEventListener("change",p=>this.setSize(d.baseWidth,d.baseHeight))}set mainScene(r){this.renderPass.mainScene=r}set mainCamera(r){this.renderPass.mainCamera=r}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){const s=this.renderToScreen?null:this.renderTarget;this.renderPass.render(r,s)}setSize(r,e){const t=this.resolution;t.setBaseSize(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){const n=r.capabilities.reversedDepthBuffer?0:16777215,i=this.renderPass.clearPass;i.overrideClearColor=new St(n),i.overrideClearAlpha=1}},AF=`#include <common> 4675#include <packing> 4676#ifdef GL_FRAGMENT_PRECISION_HIGH 4677uniform highp sampler2D depthBuffer0;uniform highp sampler2D depthBuffer1; 4678#else 4679uniform mediump sampler2D depthBuffer0;uniform mediump sampler2D depthBuffer1; 4680#endif 4681uniform sampler2D inputBuffer;uniform vec2 cameraNearFar;float getViewZ(const in float depth){ 4682#ifdef PERSPECTIVE_CAMERA 4683return perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); 4684#else 4685return orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); 4686#endif 4687}varying vec2 vUv;void main(){vec2 depth; 4688#if DEPTH_PACKING_0 == 3201 4689depth.x=unpackRGBAToDepth(texture2D(depthBuffer0,vUv)); 4690#else 4691depth.x=texture2D(depthBuffer0,vUv).r; 4692#endif 4693#if DEPTH_PACKING_1 == 3201 4694depth.y=unpackRGBAToDepth(texture2D(depthBuffer1,vUv)); 4695#else 4696depth.y=texture2D(depthBuffer1,vUv).r; 4697#endif 4698#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH) 4699float a=cameraNearFar.y/(cameraNearFar.y-cameraNearFar.x);float b=cameraNearFar.y*cameraNearFar.x/(cameraNearFar.x-cameraNearFar.y);float c=log2(cameraNearFar.y+1.0);float d=pow(2.0,depth.x*c)-1.0;depth.x=a+b/d;d=pow(2.0,depth.y*c)-1.0;depth.y=a+b/d; 4700#elif defined(USE_REVERSED_DEPTH_BUFFER) 4701depth.x=1.0-depth.x;depth.y=1.0-depth.y; 4702#endif 4703bool isMaxDepth=(depth.x==1.0); 4704#ifdef PERSPECTIVE_CAMERA
4705depth.x=viewZToOrthographicDepth(getViewZ(depth.x),cameraNearFar.x,cameraNearFar.y);depth.y=viewZToOrthographicDepth(getViewZ(depth.y),cameraNearFar.x,cameraNearFar.y); 4706#endif 4707#if DEPTH_TEST_STRATEGY == 0 4708bool keep=depthTest(depth.x,depth.y); 4709#elif DEPTH_TEST_STRATEGY == 1 4710bool keep=isMaxDepth||depthTest(depth.x,depth.y); 4711#else 4712bool keep=!isMaxDepth&&depthTest(depth.x,depth.y); 4713#endif 4714if(keep){gl_FragColor=texture2D(inputBuffer,vUv);}else{discard;}}`,CF=class extends Vi{constructor(){super({name:"DepthMaskMaterial",defines:{DEPTH_EPSILON:"0.0001",DEPTH_PACKING_0:"0",DEPTH_PACKING_1:"0",DEPTH_TEST_STRATEGY:Zh.KEEP_MAX_DEPTH},uniforms:{inputBuffer:new hn(null),depthBuffer0:new hn(null),depthBuffer1:new hn(null),cameraNearFar:new hn(new We(1,1))},blending:Wr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:AF,vertexShader:G1}),this.depthMode=qg}set depthBuffer0(r){this.uniforms.depthBuffer0.value=r}set depthPacking0(r){this.defines.DEPTH_PACKING_0=r.toFixed(0),this.needsUpdate=!0}setDepthBuffer0(r,e=na){this.depthBuffer0=r,this.depthPacking0=e}set depthBuffer1(r){this.uniforms.depthBuffer1.value=r}set depthPacking1(r){this.defines.DEPTH_PACKING_1=r.toFixed(0),this.needsUpdate=!0}setDepthBuffer1(r,e=na){this.depthBuffer1=r,this.depthPacking1=e}get maxDepthStrategy(){return Number(this.defines.DEPTH_TEST_STRATEGY)}set maxDepthStrategy(r){this.defines.DEPTH_TEST_STRATEGY=r.toFixed(0),this.needsUpdate=!0}get keepFar(){return this.maxDepthStrategy}set keepFar(r){this.maxDepthStrategy=r?Zh.KEEP_MAX_DEPTH:Zh.DISCARD_MAX_DEPTH}getMaxDepthStrategy(){return this.maxDepthStrategy}setMaxDepthStrategy(r){this.maxDepthStrategy=r}get epsilon(){return Number(this.defines.DEPTH_EPSILON)}set epsilon(r){this.defines.DEPTH_EPSILON=r.toFixed(16),this.needsUpdate=!0}getEpsilon(){return this.epsilon}setEpsilon(r){this.epsilon=r}get depthMode(){return Number(this.defines.DEPTH_MODE)}set depthMode(r){let e;switch(r){case Yx:e="false";break;case R0:e="true";break;case Jh:e="abs(d1 - d0) <= DEPTH_EPSILON";break;case P0:e="abs(d1 - d0) > DEPTH_EPSILON";break;case qg:e="d0 > d1";break;case pf:e="d0 >= d1";break;case qx:e="d0 <= d1";break;case Kx:default:e="d0 < d1";break}this.defines.DEPTH_MODE=r.toFixed(0),this.defines["depthTest(d0, d1)"]=e,this.needsUpdate=!0}getDepthMode(){return this.depthMode}setDepthMode(r){this.depthMode=r}adoptCameraSettings(r){this.copyCameraSettings(r)}copyCameraSettings(r){r&&(this.uniforms.cameraNearFar.value.set(r.near,r.far),r instanceof ci?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},RF=class extends MF{constructor(r,e,t){super(t),this.setAttributes(this.getAttributes()|La.DEPTH),this.camera=e,this.depthPass=new TF(r,e),this.clearPass=new V1(!0,!1,!1),this.clearPass.overrideClearColor=new St(0),this.depthMaskPass=new EF(new CF);const n=this.depthMaskMaterial;n.copyCameraSettings(e),n.depthBuffer1=this.depthPass.texture,n.depthPacking1=Ep,n.depthMode=Jh,this.renderTargetMasked=new xi(1,1,{depthBuffer:!1}),this.renderTargetMasked.texture.name="Bloom.Masked",this.selection=new Ak,this._inverted=!1,this._ignoreBackground=!1}set mainScene(r){this.depthPass.mainScene=r}set mainCamera(r){this.camera=r,this.depthPass.mainCamera=r,this.depthMaskMaterial.copyCameraSettings(r)}getSelection(){return this.selection}get depthMaskMaterial(){return this.depthMaskPass.fullscreenMaterial}get inverted(){return this._inverted}set inverted(r){this._inverted=r,this.depthMaskMaterial.depthMode=r?P0:Jh}isInverted(){return this.inverted}setInverted(r){this.inverted=r}get ignoreBackground(){return this._ignoreBackground}set ignoreBackground(r){this._ignoreBackground=r,this.depthMaskMaterial.maxDepthStrategy=r?Zh.DISCARD_MAX_DEPTH:Zh.KEEP_MAX_DEPTH}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(r){this.ignoreBackground=r}setDepthTexture(r,e=na){this.depthMaskMaterial.depthBuffer0=r,this.depthMaskMaterial.depthPacking0=e}update(r,e,t){const n=this.camera,i=this.selection,s=this.inverted;let o=e;if(this.ignoreBackground||!s||i.size>0){const l=n.layers.mask;n.layers.set(i.layer),this.depthPass.render(r),n.layers.mask=l,o=this.renderTargetMasked,this.clearPass.render(r,o),this.depthMaskPass.render(r,e,o)}super.update(r,o,t)}setSize(r,e){super.setSize(r,e),this.renderTargetMasked.setSize(r,e),this.depthPass.setSize(r,e)}initialize(r,e,t){super.initialize(r,e,t),this.clearPass.initialize(r,e,t),this.depthPass.initialize(r,e,t),this.depthMaskPass.initialize(r,e,t),r!==null&&r.capabilities.logarithmicDepthBuffer&&(this.depthMaskPass.fullscreenMaterial.defines.LOG_DEPTH="1"),t!==void 0&&(this.renderTargetMasked.texture.type=t,r!==null&&r.outputColorSpace
vendor: 15,364 bytes, lines 4714-4792
4714===Bn&&(this.renderTargetMasked.texture.colorSpace=Bn))}},PF=`#include <packing> 4715#ifdef GL_FRAGMENT_PRECISION_HIGH 4716uniform highp sampler2D depthBuffer; 4717#else 4718uniform mediump sampler2D depthBuffer; 4719#endif 4720#ifdef DOWNSAMPLE_NORMALS 4721uniform lowp sampler2D normalBuffer; 4722#endif 4723varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){ 4724#if DEPTH_PACKING == 3201 4725return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 4726#else 4727return texture2D(depthBuffer,uv).r; 4728#endif 4729}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]<maxDistance){remaining[j++]=i;}else{rejected[k++]=i;}}for(;j<3;++j){remaining[j]=rejected[--k];}vec3 s=vec3(samples[remaining[0]],samples[remaining[1]],samples[remaining[2]]);c=(s.x+s.y+s.z)/3.0;distances[0]=abs(c-s.x);distances[1]=abs(c-s.y);distances[2]=abs(c-s.z);float minDistance=min(distances[0],min(distances[1],distances[2]));for(i=0;i<3;++i){if(distances[i]==minDistance){break;}}return remaining[i];}void main(){float d[4];d[0]=readDepth(vUv0);d[1]=readDepth(vUv1);d[2]=readDepth(vUv2);d[3]=readDepth(vUv3);int index=findBestDepth(d); 4730#ifdef DOWNSAMPLE_NORMALS 4731vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1).rgb;n[2]=texture2D(normalBuffer,vUv2).rgb;n[3]=texture2D(normalBuffer,vUv3).rgb; 4732#else 4733vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0); 4734#endif 4735gl_FragColor=vec4(n[index],d[index]);}`,IF="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",LF=class extends Vi{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new hn(null),normalBuffer:new hn(null),texelSize:new hn(new We)},blending:Wr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:PF,vertexShader:IF})}set depthBuffer(r){this.uniforms.depthBuffer.value=r}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setDepthBuffer(r,e=na){this.depthBuffer=r,this.depthPacking=e}set normalBuffer(r){this.uniforms.normalBuffer.value=r,r!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(r){this.normalBuffer=r}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}setSize(r,e){this.uniforms.texelSize.value.set(1/r,1/e)}},DF=class extends ds{constructor({normalBuffer:r=null,resolutionScale:e=.5,width:t=fr.AUTO_SIZE,height:n=fr.AUTO_SIZE,resolutionX:i=t,resolutionY:s=n}={}){super("DepthDownsamplingPass");const o=new LF;o.normalBuffer=r,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new xi(1,1,{minFilter:yi,magFilter:yi,depthBuffer:!1,type:as}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const l=this.resolution=new fr(this,i,s,e);l.addEventListener("change",u=>this.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(r,e=na){this.fullscreenMaterial.depthBuffer=r,this.fullscreenMaterial.depthPacking=e}render(r,e,t,n,i){r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){const t=this.resolution;t.setBaseSize(r,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(r,e)}initialize(r,e,t){const n=r.getContext();if(!(n.getExtension("EXT_color_buffer_float")||n.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},UF=`#include <common> 4736#include <packing> 4737#include <dithering_pars_fragment> 4738#define packFloatToRGBA(v) packDepthToRGBA(v) 4739#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) 4740#ifdef FRAMEBUFFER_PRECISION_HIGH 4741uniform mediump sampler2D inputBuffer; 4742#else 4743uniform lowp sampler2D inputBuffer; 4744#endif 4745#if DEPTH_PACKING == 3201 4746uniform lowp sampler2D depthBuffer; 4747#elif defined(GL_FRAGMENT_PRECISION_HIGH) 4748uniform highp sampler2D depthBuffer; 4749#else 4750uniform mediump sampler2D depthBuffer; 4751#endif 4752uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){ 4753#if DEPTH_PACKING == 3201 4754float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv)); 4755#else 4756float depth=texture2D(depthBuffer,uv).r; 4757#endif 4758#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH) 4759float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d; 4760#elif defined(USE_REVERSED_DEPTH_BUFFER) 4761depth=1.0-depth; 4762#endif 4763return depth;}float getViewZ(const in float depth){ 4764#ifdef PERSPECTIVE_CAMERA 4765return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); 4766#else 4767return orthographicDepthToViewZ(depth,cameraNear,cameraFar); 4768#endif 4769}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0; 4770#ifdef ENCODE_OUTPUT 4771#include <colorspace_fragment> 4772#endif 4773#include <dithering_fragment> 4774}`,kF="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",FF=class extends Vi{constructor(r,e,t,n,i=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:Du.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new hn(null),depthBuffer:new hn(null),resolution:new hn(new We),texelSize:new hn(new We),cameraNear:new hn(.3),cameraFar:new hn(1e3),aspect:new hn(1),time:new hn(0)},blending:Wr,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:i}),r&&this.setShaderParts(r),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(n)}set inputBuffer(r){this.uniforms.inputBuffer.value=r}setInputBuffer(r){this.uniforms.inputBuffer.value=r}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(r){this.uniforms.depthBuffer.value=r}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setDepthBuffer(r,e=na){this.depthBuffer=r,this.depthPacking=e}setShaderData(r){this.setShaderParts(r.shaderParts),this.setDefines(r.defines),this.setUniforms(r.uniforms),this.setExtensions(r.extensions)}setShaderParts(r){return this.fragmentShader=UF.replace(Fn.FRAGMENT_HEAD,r.get(Fn.FRAGMENT_HEAD)||"").replace(Fn.FRAGMENT_MAIN_UV,r.get(Fn.FRAGMENT_MAIN_UV)||"").replace(Fn.FRAGMENT_MAIN_IMAGE,r.get(Fn.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=kF.replace(Fn.VERTEX_HEAD,r.get(Fn.VERTEX_HEAD)||"").replace(Fn.VERTEX_MAIN_SUPPORT,r.get(Fn.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(r){for(const e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(const e of r.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(r){this.extensions={};for(const e of r)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){this.encodeOutput!==r&&(r?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(r){return this.encodeOutput}setOutputEncodingEnabled(r){this.encodeOutput=r}get time(){return this.uniforms.time.value}set time(r){this.uniforms.time.value=r}setDeltaTime(r){this.uniforms.time.value+=r}adoptCameraSettings(r){this.copyCameraSettings(r)}copyCameraSettings(r){r&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof ci?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){const t=this.uniforms;t.resolution.value.set(r,e),t.texelSize.value.set(1/r,1/e),t.aspect.value=r/e}static get Section(){return Fn}};function dw(r,e,t){for(const n of e){const i="$1"+r+n.charAt(0).toUpperCase()+n.slice(1),s=new RegExp("([^\\.])(\\b"+n+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(s,i))}}function NF(r,e,t){let n=e.getFragmentShader(),i=e.getVertexShader();const s=n!==void 0&&/mainImage/.test(n),o=n!==void 0&&/mainUv/.test(n);if(t.attributes|=e.getAttributes(),n===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&(t.attributes&La.CONVOLUTION)!==0)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!s&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const l=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,u=t.shaderParts;let d=u.get(Fn.FRAGMENT_HEAD)||"",p=u.get(Fn.FRAGMENT_MAIN_UV)||"",m=u.get(Fn.FRAGMENT_MAIN_IMAGE)||"",v=u.get(Fn.VERTEX_HEAD)||"",y=u.get(Fn.VERTEX_MAIN_SUPPORT)||"";const x=new Set,M=new Set;if(o&&(p+=` ${r}MainUv(UV); 4775`,t.uvTransformation=!0),i!==null&&/mainSupport/.test(i)){const A=/mainSupport *\([\w\s]*?uv\s*?\)/.test(i);y+=` ${r}MainSupport(`,y+=A?`vUv); 4776`:`); 4777`;for(const T of i.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const R of T[1].split(/\s*,\s*/))t.varyings.add(R),x.add(R),M.add(R);for(const T of i.matchAll(l))M.add(T[1])}for(const A of n.matchAll(l))M.add(A[1]);for(const A of e.defines.keys())M.add(A.replace(/\([\w\s,]*\)/g,""));for(const A of e.uniforms.keys())M.add(A);M.delete("while"),M.delete("for"),M.delete("if"),e.uniforms.forEach((A,T)=>t.uniforms.set(r+T.charAt(0).toUpperCase()+T.slice(1),A)),e.defines.forEach((A,T)=>t.defines.set(r+T.charAt(0).toUpperCase()+T.slice(1),A));const S=new Map([["fragment",n],["vertex",i]]);dw(r,M,t.defines),dw(r,M,S),n=S.get("fragment"),i=S.get("vertex");const w=e.blendMode;if(t.blendModes.set(w.blendFunction,w),s){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(m+=e.inputColorSpace===Bn?`color0 = sRGBTransferOETF(color0); 4778 `:`color0 = sRGBToLinear(color0); 4779 `),e.outputColorSpace!==Qo?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const A=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;m+=`${r}MainImage(color0, UV, `,(t.attributes&La.DEPTH)!==0&&A.test(n)&&(m+="depth, ",t.readDepth=!0),m+=`color1); 4780 `;const T=r+"BlendOpacity";t.uniforms.set(T,w.opacity),m+=`color0 = blend${w.blendFunction}(color0, color1, ${T}); 4781 4782 `,d+=`uniform float ${T}; 4783 4784`}if(d+=n+` 4785`,i!==null&&(v+=i+` 4786`),u.set(Fn.FRAGMENT_HEAD,d),u.set(Fn.FRAGMENT_MAIN_UV,p),u.set(Fn.FRAGMENT_MAIN_IMAGE,m),u.set(Fn.VERTEX_HEAD,v),u.set(Fn.VERTEX_MAIN_SUPPORT,y),e.extensions!==null)for(const A of e.extensions)t.extensions.add(A)}}var OF=class extends ds{constructor(r,...e){super("EffectPass"),this.fullscreenMaterial=new FF(null,null,null,r),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(r){for(const e of this.effects)e.mainScene=r}set mainCamera(r){this.fullscreenMaterial.copyCameraSettings(r);for(const e of this.effects)e.mainCamera=r}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(r){this.fullscreenMaterial.encodeOutput=r}get dithering(){return this.fullscreenMaterial.dithering}set dithering(r){const e=this.fullscreenMaterial;e.dithering=r,e.needsUpdate=!0}setEffects(r){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=r.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const r=new Ek;let e=0;for(const o of this.effects)if(o.blendMode.blendFunction===vn.DST)r.attributes|=o.getAttributes()&La.DEPTH;else{if((r.attributes&o.getAttributes()&La.CONVOLUTION)!==0)throw new Error(`Convolution effects cannot be merged (${o.name})`);NF("e"+e++,o,r)}let t=r.shaderParts.get(Fn.FRAGMENT_HEAD),n=r.shaderParts.get(Fn.FRAGMENT_MAIN_IMAGE),i=r.shaderParts.get(Fn.FRAGMENT_MAIN_UV);const s=/\bblend\b/g;for(const o of r.blendModes.values())t+=o.getShaderCode().replace(s,`blend${o.blendFunction}`)+` 4787`;(r.attributes&La.DEPTH)!==0?(r.readDepth&&(n=`float depth = readDepth(UV); 4788 4789 `+n),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,r.colorSpace===Bn&&(n+=`color0 = sRGBToLinear(color0); 4790 `),r.uvTransformation?(i=`vec2 transformedUv = vUv; 4791`+i,r.defines.set("UV","transformedUv")):r.defines.set("UV","vUv"),r.shaderParts.set(Fn.FRAGMENT_HEAD,t),r.shaderParts.set(Fn.FRAGMENT_MAIN_IMAGE,n),r.shaderParts.set(Fn.FRAGMENT_MAIN_UV,i);for(const[o,l]of r.shaderParts)l!==null&&r.shaderParts.set(o,l.trim().replace(/^#/,` 4792#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(r)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(r,e=na){this.fullscreenMaterial.depthBuffer=r,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(r,e)}render(r,e,t,n,i){for(const s of this.effects)s.update(r,e,n);if(!this.skipRendering||this.renderToScreen){const s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=n*this.timeScale,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}}setSize(r,e){this.fullscreenMaterial.setSize(r,e);for(const t of this.effects)t.setSize(r,e)}initialize(r,e,t){this.renderer=r;for(const n of this.effects)n.initialize(r,e,t);this.updateMaterial(),t!==void 0&&t!==pr&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const r of this.effects)r.removeEventListener("change",this.listener),r.dispose()}handleEvent(r){switch(r.type){case"change":this.recompile();break}}},BF=class extends ds{constructor(r,e,{renderTarget:t,resolutionScale:n=1,width:i=fr.AUTO_SIZE,height:s=fr.AUTO_SIZE,resolutionX:o=i,resolutionY:l=s}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new W1(r,e,new M1);const u=this.renderPass;
4792u.ignoreBackground=!0,u.skipShadowMapUpdate=!0;const d=u.getClearPass();d.overrideClearColor=new St(7829503),d.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new xi(1,1,{minFilter:yi,magFilter:yi}),this.renderTarget.texture.name="NormalPass.Target");const p=this.resolution=new fr(this,o,l,n);p.addEventListener("change",m=>this.setSize(p.baseWidth,p.baseHeight))}set mainScene(r){this.renderPass.mainScene=r}set mainCamera(r){this.renderPass.mainCamera=r}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){const s=this.renderToScreen?null:this.renderTarget;this.renderPass.render(r,s,s)}setSize(r,e){const t=this.resolution;t.setBaseSize(r,e),this.renderTarget.setSize(t.width,t.height)}};const aE=K.createContext(null),fw=r=>(r.getAttributes()&La.CONVOLUTION)===La.CONVOLUTION,zF=YE.memo(K.forwardRef(({children:r,camera:e,scene:t,resolutionScale:n,enabled:i=!0,renderPriority:s=1,autoClear:o=!0,depthBuffer:l,enableNormalPass:u,stencilBuffer:d,multisampling:p=8,frameBufferType:m=Uu},v)=>{const{gl:y,scene:x,camera:M,size:S}=Bs(),w=t||x,A=e||M,[T,R,U]=K.useMemo(()=>{const H=lU(),F=new Mk(y,{depthBuffer:l,stencilBuffer:d,multisampling:p>0&&H?p:0,frameBufferType:m});F.addPass(new W1(w,A));let I=null,G=null;return u&&(G=new BF(w,A),G.enabled=!1,F.addPass(G),n!==void 0&&H&&(I=new DF({normalBuffer:G.texture,resolutionScale:n}),I.enabled=!1,F.addPass(I))),[F,G,I]},[A,y,l,d,p,m,w,u,n]);K.useEffect(()=>T==null?void 0:T.setSize(S.width,S.height),[T,S]),us((H,F)=>{if(i){const I=y.autoClear;y.autoClear=o,d&&!o&&y.clearStencil(),T.render(F),y.autoClear=I}},i?s:0);const k=K.useRef(null);K.useLayoutEffect(()=>{var H;const F=[],I=(H=k.current)==null?void 0:H.__r3f;if(I&&T){const G=I.objects;for(let W=0;W<G.length;W++){const X=G[W];if(X instanceof kx){const J=[X];if(!fw(X)){let se=null;for(;(se=G[W+1])instanceof kx&&!fw(se);)J.push(se),W++}const oe=new OF(A,...J);F.push(oe)}else X instanceof ds&&F.push(X)}for(const W of F)T==null||T.addPass(W);R&&(R.enabled=!0),U&&(U.enabled=!0)}return()=>{for(const G of F)T==null||T.removePass(G);R&&(R.enabled=!1),U&&(U.enabled=!1)}},[T,r,A,R,U]),K.useEffect(()=>{const H=y.toneMapping;return y.toneMapping=ea,()=>{y.toneMapping=H}},[y]);const N=K.useMemo(()=>({composer:T,normalPass:R,downSamplingPass:U,resolutionScale:n,camera:A,scene:w}),[T,R,U,n,A,w]);return K.useImperativeHandle(v,()=>T,[T]),E.jsx(aE.Provider,{value:N,children:E.jsx("group",{ref:k,children:r})})})),Fg=r=>typeof r=="object"&&r!=null&&"current"in r?r.current:r,HF=(r,e)=>r.layers.enable(e.selection.layer),GF=(r,e)=>r.layers.disable(e.selection.layer),VF=K.forwardRef(function({selection:e=[],selectionLayer:t=10,lights:n=[],inverted:i=!1,ignoreBackground:s=!1,luminanceThreshold:o,luminanceSmoothing:l,intensity:u,width:d,height:p,kernelSize:m,mipmapBlur:v,...y},x){n.length===0&&console.warn("SelectiveBloom requires lights to work.");const M=Bs(R=>R.invalidate),{scene:S,camera:w}=K.useContext(aE),A=K.useMemo(()=>{const R=new RF(S,w,{blendFunction:vn.ADD,luminanceThreshold:o,luminanceSmoothing:l,intensity:u,width:d,height:p,kernelSize:m,mipmapBlur:v,...y});return R.inverted=i,R.ignoreBackground=s,R},[S,w,o,l,u,d,p,m,v,i,s,y]),T=K.useContext(gk);return K.useEffect(()=>{if(!T&&e)return A.selection.set(Array.isArray(e)?e.map(Fg):[Fg(e)]),M(),()=>{A.selection.clear(),M()}},[A,e,T,M]),K.useEffect(()=>{A.selection.layer=t,M()},[A,M,t]),K.useEffect(()=>{if(n&&n.length>0)return n.forEach(R=>HF(Fg(R),A)),M(),()=>{n.forEach(R=>GF(Fg(R),A)),M()}},[A,M,n,t]),K.useEffect(()=>{var R;if(T&&T.enabled&&(R=T.selected)!=null&&R.length)return A.selection.set(T.selected),M(),()=>{A.selection.clear(),M()}},[T,A.selection,M]),E.jsx("primitive",{ref:x,object:A,dispose:null})}),Fx=[{id:"inter",label:"Inter",woffUrl:"https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/files/inter-latin-700-normal.woff",cssFamily:'"Inter", sans-serif'},{id:"orbitron",label:"Orbitron",woffUrl:"https://cdn.jsdelivr.net/npm/@fontsource/orbitron/files/orbitron-latin-700-normal.woff",cssFamily:'"Orbitron", sans-serif'},{id:"oxanium",label:"Oxanium",woffUrl:"https://cdn.jsdelivr.net/npm/@fontsource/oxanium/files/oxanium-latin-700-normal.woff",cssFamily:'"Oxanium", sans-serif'},{id:"turretroad",label:"Turret Road",woffUrl:"https://cdn.jsdelivr.net/npm/@fontsource/turret-road/files/turret-road-latin-700-normal.woff",cssFamily:'"Turret Road", sans-serif'},{id:"chakrapetch",label:"Chakra Petch",woffUrl:"https://cdn.jsdelivr.net/npm/@fontsource/chakra-petch/files/chakra-petch-latin-700-normal.woff",cssFamily:'"Chakra Petch", sans-serif'},{id:"kodemono",label:"Kode Mono",woffUrl:"https://cdn.jsdelivr.net/npm/@fontsource/kode-mono/files/kode-mono-latin-700-normal.woff",cssFamily:'"Kode Mono", monospace'},{id:"quantico",label:"Quantico",woffUrl:"https://cdn.jsdelivr.net/npm/@fontsource/quantico/files/quantico-latin-700-normal.woff",cssFamily:'"Quantico", sans-serif'},{id:"iceland",label:"Iceland",woffUrl:"https://cdn.jsdelivr.net/npm/@fontsource/iceland/files/iceland-latin-400-normal.woff",cssFamily:'"Iceland", sans-serif',sizeScale:1.3}];function xf(r){return Fx.find(e=>e.id===r)??Fx[0]}const jF="https://fonts.googleapis.com/css2?family=Orbitron:wght@700&family=Oxanium:wght@700&family=Turret+Road:wght@700&family=Chakra+Petch:wght@700&family=Kode+Mono:wght@700&family=Quantico:wght@700&family=Iceland&dis
4792play=swap",lE=12,Op=lE,Bp=lE,_p=2.8,X1=1.6,cE=.045,Y1={subdomainColor:"#00D4FF",subdomainLabelColor:"#c8eeff",territoryStyle:"B",territoryColor:"",orbitalColor:"#1a3d50",stationColor:"#dff5ff",aboutText:"I help organisations identify where AI creates value, shape the right product direction, and turn early uncertainty into practical concepts, workshops, PoCs and MVPs.",territoryFont:"inter",subdomainFont:"inter"},rn={human:"#ff668c",technology:"#00d9ff",nature:"#5cffb0",space:"#b690ff",society:"#ffbd45",creativity:"#ff7d3d",station:"#ffffff"},yn={human:-Math.PI*.95,technology:-Math.PI*.62,nature:-Math.PI*.28,space:Math.PI*.05,society:Math.PI*.48,creativity:Math.PI*.82};function Un(r){return[Math.round(Op*Math.cos(r)*10)/10,0,Math.round(Bp*Math.sin(r)*10)/10]}const $o=[{id:"human",label:"Human",color:rn.human,clusterCenter:Un(yn.human),formation:"sphere",radius:2.8},{id:"technology",label:"Technology",color:rn.technology,clusterCenter:Un(yn.technology),formation:"sphere",radius:2.8},{id:"nature",label:"Nature",color:rn.nature,clusterCenter:Un(yn.nature),formation:"sphere",radius:2.8},{id:"space",label:"Space",color:rn.space,clusterCenter:Un(yn.space),formation:"sphere",radius:2.8},{id:"society",label:"Society",color:rn.society,clusterCenter:Un(yn.society),formation:"sphere",radius:2.8},{id:"creativity",label:"Creativity",color:rn.creativity,clusterCenter:Un(yn.creativity),formation:"sphere",radius:2.8}],WF=[{id:"human",label:"Human",description:"Health, learning, identity, vulnerability and adaptation.",group:"human",color:rn.human,size:1.4,tags:["territory"],position:Un(yn.human)},{id:"technology",label:"Technology",description:"AI, XR, interfaces, systems and tools.",group:"technology",color:rn.technology,size:1.4,tags:["territory"],position:Un(yn.technology)},{id:"nature",label:"Nature",description:"Ecology, evolution, planetary systems and post-natural thinking.",group:"nature",color:rn.nature,size:1.4,tags:["territory"],position:Un(yn.nature)},{id:"space",label:"Space",description:"Exoplanets, satellites, stratosphere, habitats and future civilisation.",group:"space",color:rn.space,size:1.4,tags:["territory"],position:Un(yn.space)},{id:"society",label:"Society",description:"Organisations, governance, institutions, communities and collective intelligence.",group:"society",color:rn.society,size:1.4,tags:["territory"],position:Un(yn.society)},{id:"creativity",label:"Creativity",description:"Storytelling, games, visual culture, worldbuilding and speculative design.",group:"creativity",color:rn.creativity,size:1.4,tags:["territory"],position:Un(yn.creativity)}],uE=[{id:"health",label:"Health",description:"Wellbeing and vulnerability.",group:"human",color:rn.human,size:.55,tags:["subdomain"],parentId:"human",position:Un(yn.human)},{id:"learning",label:"Learning",description:"Education, mentoring and learning by making.",group:"human",color:rn.human,size:.55,tags:["subdomain"],parentId:"human",position:Un(yn.human)},{id:"identity",label:"Identity",description:"Selfhood, belonging and agency.",group:"human",color:rn.human,size:.55,tags:["subdomain"],parentId:"human",position:Un(yn.human)},{id:"neurodiversity",label:"Neurodiversity",description:"Cognitive diversity as adaptation lens.",group:"human",color:rn.human,size:.55,tags:["subdomain"],parentId:"human",position:Un(yn.human)},{id:"ai",label:"AI",description:"Generative AI, agents and decision support.",group:"technology",color:rn.technology,size:.55,tags:["subdomain"],parentId:"technology",position:Un(yn.technology)},{id:"xr",label:"XR",description:"Spatial computing and immersive interfaces.",group:"technology",color:rn.technology,size:.55,tags:["subdomain"],parentId:"technology",position:Un(yn.technology)},{id:"interfaces",label:"Interfaces",description:"Interaction models and dashboards.",group:"technology",color:rn.technology,size:.55,tags:["subdomain"],parentId:"technology",position:Un(yn.technology)},{id:"systems",label:"Systems",description:"Complexity, networks and emergence.",group:"technology",color:rn.technology,size:.55,tags:["subdomain"],parentId:"technology",position:Un(yn.technology)},{id:"ecology",label:"Ecology",description:"Ecosystems and adaptation.",group:"nature",color:rn.nature,size:.55,tags:["subdomain"],parentId:"nature",position:Un(yn.nature)},{id:"evolution",label:"Evolution",description:"Biological, cultural and technological change.",group:"nature",color:rn.nature,size:.55,tags:["subdomain"],parentId:"nature",position:Un(yn.nature)},{id:"exoplanets",label:"Exoplanets",description:"Worlds beyond Earth.",group:"space",color:rn.space,size:.55,tags:["subdomain"],parentId:"space",position:Un(yn.space)},{id:"satellites",label:"Satellites",description:"Orbital systems and mission concepts.",group:"space",color:rn.space,size:.55,tags:["subdomain"],parentId:"space",position:Un(yn.space)},{id:"stratosphere",label:"Stratosphere",description:"Near-space and high-altitude systems.",group:"space",color:rn.space,size:.55,tags:["subdomain"],parentId:"space",position:Un(yn.space)},{id:"habitats",label:"Habitats",description:"Designed environments for hostile conditions.",group:"space",color:rn.space,size:.55,tags:["subdomain"],parentId:"space",position:Un(yn.space)},{id:"governance",label:"Governance",description:"Decision rights and risk.",group:"society",color:rn.society,size:.55,tags:["subdomain"],parentId:"society",position:Un(yn.society)},{id:"enterprise",label:"Enterprise",description:"Transformation and innovation systems.",group:"society",color:rn.society,size:.55,tags:["subdomain"],parentId:"society",position:Un(yn.society)},{id:"community",label:"Community",description:"Networks and public engagement.",group:"society",color:rn.society,size:.55,tags:["subdomain"],parentId:"society",position:Un(yn.society)},{id:"storytelling",label:"Storytelling",description:"Narrative systems.",group:"creativity",color:rn.creativity,size:.55,tags:["subdomain"],parentId:"creativity",position:Un(yn.creativity)},{id:"games",label:"Games",description:"Playable systems.",group:"creativity",color:rn.creativity,size:.55,tags:["subdomain"],parentId:"creativity",position:Un(yn.creativity)},{id:"worldbuilding",label:"Worldbuilding",description:"Believable worlds and futures.",group:"creativity",color:rn.creativity,size:.55,tags:["subdomain"],parentId:"creativity",position:Un(yn.creativity)}],XF=[{id:"smartlander",label:"SmartLander",description:"Autonomous landing and space interface concept.",group:"station",color:rn.station,size:.35,tags:["station"],position:[13,3.2,0]},{id:"nausolaris",label:"NauSolaris",description:"Solar, satellite and educational space futures concept.",group:"station",color:rn.station,size:.35,tags:["station"],position:[9,2.6,-7]},{id:"kepler",label:"Kepler",description:"Speculative exoplanet project.",group:"station",color:rn.station,size:.35,tags:["station"],position:[0,4.5,-10]},{id:"ai-mapping",label:"AI Mapping",description:"AI opportunity mapping and governance workshop material.",group:"station",color:rn.station,size:.35,tags:["station"],position:[-8,-2.8,-6]},{id:"wellness",label:"Wellness App",description:"Health, behaviour and AI support concept.",group:"station",color:rn.station,size:.35,tags:["station"],position:[-13,-3,0]},{id:"heavy-earth",label:"Heavy Earth",description:"Speculative game world about gravity and adaptation.",group:"station",color:rn.station,size:.35,tags:["station"],position:[-8,-4,6]},{id:"nexus",label:"Nexus",description:"Navigable intellectual map.",group:"station",color:rn.station,size:.35,tags:["station"],position:[0,1.8,10]},{id:"future-mfg",label:"Future Manufacturing",description:"Decision-support concepts for industrial operations.",group:"station",color:rn.station,size:.35,tags:["station"],position:[9,-2.4,6]}],Fi=[...WF,...uE,...XF],YF=[["kepler","exoplanets"],["kepler","storytelling"],["kepler","worldbuilding"],["kepler","games"],["smartlander","stratosphere"],["smartlander","satellites"],["smartlander","interfaces"],["smartlander","ai"],["nausolaris","satellites"],["nausolaris","learning"],["nausolaris","stratosphere"],["heavy-earth","worldbuilding"],["heavy-earth","games"],["heavy-earth","ecology"],["heavy-earth","human"],["nexus","systems"],["nexus","interfaces"],["nexus","worldbuilding"],["ai-ma
4792pping","ai"],["ai-mapping","governance"],["ai-mapping","enterprise"],["wellness","health"],["wellness","ai"],["wellness","human"],["future-mfg","enterprise"],["future-mfg","systems"],["future-mfg","interfaces"]],Sp=YF.map(([r,e],t)=>({id:`link-${t}`,source:r,target:e,type:"dashed",color:"#fff0a8",thickness:.6})),qF=[{nodeId:"kepler",activities:[{label:"Book",type:"Publication"},{label:"Board game",type:"Prototype"},{label:"Masterclass",type:"Education"},{label:"World bible",type:"Publication"}],linkedSubdomainIds:["exoplanets","storytelling","worldbuilding","games"]},{nodeId:"smartlander",activities:[{label:"Prototype",type:"Prototype"},{label:"White paper",type:"Publication"},{label:"Masterclass",type:"Education"}],linkedSubdomainIds:["stratosphere","satellites","interfaces","ai"]},{nodeId:"nausolaris",activities:[{label:"Masterclass",type:"Education"},{label:"White paper",type:"Publication"},{label:"Workshop",type:"Workshop"}],linkedSubdomainIds:["satellites","learning","stratosphere"]},{nodeId:"heavy-earth",activities:[{label:"World bible",type:"Publication"},{label:"Game prototype",type:"Prototype"},{label:"Exhibition",type:"Public experience"}],linkedSubdomainIds:["worldbuilding","games","ecology","human"]},{nodeId:"nexus",activities:[{label:"Interface",type:"Prototype"},{label:"Essay",type:"Publication"},{label:"Exhibition",type:"Public experience"}],linkedSubdomainIds:["systems","interfaces","worldbuilding"]},{nodeId:"ai-mapping",activities:[{label:"Workshop",type:"Workshop"},{label:"Canvas",type:"Prototype"},{label:"Consulting",type:"Advisory"},{label:"Hackathon",type:"Hackathon"}],linkedSubdomainIds:["ai","governance","enterprise"]},{nodeId:"wellness",activities:[{label:"App screens",type:"Prototype"},{label:"Scenario map",type:"Publication"}],linkedSubdomainIds:["health","ai","human"]},{nodeId:"future-mfg",activities:[{label:"Dashboard",type:"Prototype"},{label:"Workshop",type:"Workshop"},{label:"Consulting",type:"Advisory"}],linkedSubdomainIds:["enterprise","systems","interfaces"]}],KF=[{id:"reach-strato",label:"How can I reach the stratosphere in 6 months?",description:"A near-space learning and prototyping route.",nodeIds:["space","technology","learning","stratosphere","satellites","interfaces","ai","smartlander","nausolaris"]},{id:"human-ai-agency",label:"Can AI increase human agency?",description:"A human-technology route through AI, learning, governance and agency.",nodeIds:["human","technology","society","ai","learning","neurodiversity","governance","enterprise","ai-mapping","nexus","wellness"]},{id:"worlds-emerge",label:"How do worlds emerge?",description:"A worldbuilding route across narrative, games and simulation.",nodeIds:["creativity","technology","nature","worldbuilding","storytelling","games","xr","systems","heavy-earth","kepler","nexus"]},{id:"next-earth",label:"What comes after Earth?",description:"A space-futures route.",nodeIds:["space","nature","creativity","exoplanets","habitats","satellites","storytelling","worldbuilding","kepler","smartlander","nausolaris"]}];function zp(r){return qF.find(e=>e.nodeId===r)}function vo(r){return Fi.find(e=>e.id===r)}function Hp(r){return uE.filter(e=>e.parentId===r)}const ZF=Fi.filter(r=>{var e;return(e=r.tags)==null?void 0:e.includes("station")}),tr=.09,cc=()=>{},dE=new Set,Nx=11,fE={},hE=Math.PI/3,JF=Math.sin(hE),QF=Math.cos(hE),rx=9,pE={human:1,technology:-1,nature:1,space:-1,society:1,creativity:-1};function nr(r,e,t){return r+(e-r)*t}function Ox(r,e,t=96){const n=[];for(let i=0;i<=t;i++){const s=i/t*Math.PI*2;n.push(new te(r*Math.cos(s),0,e*Math.sin(s)))}return n}function q1(r,e){const t=r.current;t&&(typeof t.fillOpacity=="number"?t.fillOpacity=nr(t.fillOpacity,e,tr):t.material&&(t.material.transparent=!0,t.material.opacity=nr(t.material.opacity??1,e,tr)))}const $F={current:0},mE={territory:!0,subdomain:!0,station:!0},Cr=K.createContext({activeNodeIds:dE,selectedStationId:null,selectedTerritoryId:null,highlightedStationForTerritory:null,enabledGroups:fE,legendVisibility:mE,paused:!1,orbitalTimeRef:$F,onNodeClick:cc,onConnectionClick:cc,customNodes:[],customLinks:[],selectedSubdomainId:null,customSubdomains:[],removedSubdomainIds:new Set,hoverPausedRef:{current:!1},onCargoHover:r=>{},onCargoClick:r=>{},globalConfig:Y1,nodeExtras:{},activeStepNodeId:null,routeActive:!1,autoRotate:!1}),hw=new te(0,52,68),eN=new te(0,18,26),tN=.45;function nN(r){return 1-Math.pow(1-r,3)}function iN({onComplete:r}){const{camera:e}=Bs(),t=K.useRef(0),n=K.useRef(!1);return K.useEffect(()=>{e.position.copy(hw),e.lookAt(0,0,0)},[e]),us((i,s)=>{if(n.current)return;t.current=Math.min(1,t.current+s*tN);const o=nN(t.current);e.position.lerpVectors(hw,eN,o),e.lookAt(0,0,0),t.current>=1&&(n.current=!0,r())}),null}function rN(){const r=K.useContext(Cr),e=K.useRef(r);e.current=r;const t=K.useRef(null);return us(({clock:n})=>{const i=n.getElapsedTime();t.current!==null&&!e.current.paused&&!e.current.hoverPausedRef.current&&(e.current.orbitalTimeRef.current+=i-t.current),t.current=i}),null}function hv(r){return new te(rx*Math.cos(r),rx*Math.sin(r)*JF,rx*Math.sin(r)*QF)}function _f(r,e){var i,s;const t=e.find(o=>o.id===r);if(t!=null&&t.position)return new te(...t.position);const n=Fi.find(o=>o.id===r);if(!n)return null;if((i=n.tags)!=null&&i.includes("station")&&n.position)return new te(...n.position);if((s=n.tags)!=null&&s.includes("territory")){const o=yn[n.id];return o===void 0?null:n.id==="space"?hv(o):new te(Op*Math.cos(o),0,Bp*Math.sin(o))}return null}function Bx(r,e){const t=_f(r,e);if(t)return t;const n=Fi.find(i=>i.id===r);return n!=null&&n.parentId?_f(n.parentId,e):null}function gE({points:r,ringRef:e,dashed:t=!1}){const n=K.useContext(Cr),i=K.useRef(n);return i.current=n,us(()=>{var d,p;const s=(d=e.current)==null?void 0:d.material;if(!s)return;const{activeNodeIds:o,globalConfig:l}=i.current,u=o.size>0;
4792s.opacity=nr(s.opacity??.55,u?.14:.55,tr),(p=s.color)==null||p.set(l.orbitalColor)}),E.jsx(Rx,{ref:e,points:r,color:"#1a3d50",lineWidth:.9,transparent:!0,opacity:.55,dashed:t,dashSize:t?.28:void 0,gapSize:t?.38:void 0})}function sN(){const r=K.useMemo(()=>Ox(Op,Bp),[]),e=K.useRef(null);return E.jsx(gE,{points:r,ringRef:e})}function oN(){const r=K.useMemo(()=>{const t=[];for(let n=0;n<=96;n++)t.push(hv(n/96*Math.PI*2));return t},[]),e=K.useRef(null);return E.jsx(gE,{points:r,ringRef:e,dashed:!0})}function aN(){const r=K.useRef(null),e=K.useRef(0),t=K.useContext(Cr),n=K.useRef(t);n.current=t;const i=$o.find(s=>s.id==="space");return us((s,o)=>{r.current&&(n.current.autoRotate&&(e.current+=o*.06),r.current.rotation.x=e.current)}),E.jsxs("group",{ref:r,children:[E.jsx(oN,{}),E.jsx(vE,{group:i})]})}function lN({node:r,index:e,total:t}){var w;const n=K.useRef(null),i=K.useRef(null),s=K.useRef(null),o=K.useRef(null),l=K.useRef(!1),u=K.useMemo(()=>Math.PI*2/t*e,[e,t]),d=K.useContext(Cr),p=K.useRef(d);p.current=d,us(()=>{var V,$;const A=p.current.orbitalTimeRef.current,T=pE[r.parentId??""]??1,R=u+T*A*cE;(V=n.current)==null||V.position.set(_p*Math.cos(R),0,X1*Math.sin(R));const{activeNodeIds:U,enabledGroups:k,selectedSubdomainId:N,selectedTerritoryId:H,selectedStationId:F,legendVisibility:I,globalConfig:G}=p.current,W=k[r.parentId??""]!==!1,X=U.size===0||U.has(r.id)||U.has(r.parentId??""),J=W&&X&&I.subdomain?1:0,oe=N===r.id;let se=!1;oe?se=!0:H?se=r.parentId===H:F?se=U.has(r.id):N?se=U.has(r.parentId??""):U.size>0&&(se=U.has(r.id)),l.current&&(se=!0);const fe=W&&se&&I.subdomain?1:0;if(($=i.current)==null||$.scale.setScalar(oe?1:.85),s.current){const Z=s.current.material;oe?(Z.color.set(16777215),Z.opacity=nr(Z.opacity,1*J,tr)):(Z.color.set(G.subdomainColor),Z.opacity=nr(Z.opacity,.88*J,tr))}if(o.current){o.current.color=G.subdomainLabelColor;const Z=(oe?1:.72)*fe;q1(o,Z);const O=o.current.fillOpacity??0;o.current.visible=O>.005}});const{onNodeClick:m,nodeExtras:v,globalConfig:y}=K.useContext(Cr),x=xf(y.subdomainFont??"inter"),M=x.woffUrl,S=x.sizeScale??1;return E.jsxs("group",{ref:n,children:[E.jsxs("mesh",{onClick:()=>m(r.id),onPointerEnter:A=>{A.stopPropagation(),l.current=!0},onPointerOver:A=>{A.stopPropagation(),l.current=!0},onPointerLeave:()=>{l.current=!1},onPointerOut:()=>{l.current=!1},children:[E.jsx("sphereGeometry",{args:[.6,8,8]}),E.jsx("meshBasicMaterial",{transparent:!0,opacity:0,depthWrite:!1})]}),E.jsx("group",{ref:i,children:E.jsxs("mesh",{ref:s,children:[E.jsx("sphereGeometry",{args:[.07,10,10]}),E.jsx("meshBasicMaterial",{color:"#00D4FF",transparent:!0,opacity:.88,toneMapped:!1})]})}),E.jsx(dv,{children:E.jsx(H1,{ref:o,position:[0,.36,0],fontSize:.16*S,color:"#c8eeff",font:M,letterSpacing:.07,anchorX:"center",anchorY:"bottom",fillOpacity:0,children:(((w=v[r.id])==null?void 0:w.labelOverride)??r.label).toUpperCase()})})]})}function vE({group:r}){const e=K.useRef(null),t=K.useRef(null),n=K.useRef(null),i=K.useRef(null),s=K.useRef(null),o=K.useRef(null),l=K.useRef(null),u=yn[r.id],d=K.useMemo(()=>Ox(_p,X1,64),[]),p=K.useMemo(()=>Ox(1.55,1.55,80),[]);K.useEffect(()=>
4792{const U=[t.current,n.current,i.current].filter(Boolean);return U.forEach(k=>k.layers.enable(Nx)),()=>U.forEach(k=>k.layers.disable(Nx))},[]);const m=K.useContext(Cr),v=K.useRef(m);v.current=m;const{customSubdomains:y,removedSubdomainIds:x}=m,M=K.useMemo(()=>{const U=Hp(r.id).filter(N=>!x.has(N.id)),k=y.filter(N=>N.parentId===r.id);return[...U,...k]},[r.id,y,x]);us(()=>{var $,Z,O,j;if(!e.current)return;r.id==="space"?e.current.position.copy(hv(u)):e.current.position.set(Op*Math.cos(u),0,Bp*Math.sin(u));const{activeNodeIds:U,enabledGroups:k,legendVisibility:N,globalConfig:H}=v.current,F=k[r.id]!==!1,I=U.size===0||U.has(r.id),G=F&&I&&N.territory?1:0,W=H.territoryStyle,X=H.territoryColor||r.color;let J,oe,se,fe;if(W==="A"?(J=.2,oe=.2,se=.2,fe=0):W==="B"?(J=.07,oe=0,se=1,fe=0):W==="C"?(J=0,oe=.2,se=1,fe=0):(J=0,oe=0,se=1,fe=.5),t.current){const re=t.current.material;re.opacity=nr(re.opacity,J*G,tr),re.color.set(X)}if(n.current){const re=n.current.material;re.opacity=nr(re.opacity,oe*G,tr),re.color.set(X)}if(i.current){const re=i.current.material;re.opacity=nr(re.opacity,se*G,tr),re.color.set(X)}const V=($=s.current)==null?void 0:$.material;if(V&&(V.opacity=nr(V.opacity??.22,.22*G,tr),(Z=V.color)==null||Z.set(X)),(O=o.current)!=null&&O.material){const re=o.current.material;re.opacity=nr(re.opacity??0,fe*G,tr),(j=re.color)==null||j.set(X)}if(l.current){l.current.color=X,q1(l,.88*G);const re=l.current.fillOpacity??0;l.current.visible=re>.005}});const{onNodeClick:S,globalConfig:w}=K.useContext(Cr),A=xf(w.territoryFont??"inter"),T=A.woffUrl,R=A.sizeScale??1;return E.jsxs("group",{ref:e,scale:r.id==="space"?.72:1,children:[E.jsx(Rx,{ref:s,points:d,color:r.color,lineWidth:.45,transparent:!0,opacity:.22,dashed:!0,dashSize:.12,gapSize:.18}),M.map((U,k)=>E.jsx(lN,{node:U,index:k,total:M.length},U.id)),E.jsxs("mesh",{ref:t,renderOrder:1,onClick:U=>{U.stopPropagation(),S(r.id)},children:[E.jsx("sphereGeometry",{args:[1.55,20,20]}),E.jsx("meshBasicMaterial",{color:r.color,transparent:!0,opacity:.055,depthWrite:!1,toneMapped:!1})]}),E.jsxs("mesh",{ref:n,renderOrder:2,children:[E.jsx("sphereGeometry",{args:[.9,20,20]}),E.jsx("meshBasicMaterial",{color:r.color,transparent:!0,opacity:.13,depthWrite:!1,toneMapped:!1})]}),E.jsxs("mesh",{ref:i,renderOrder:3,children:[E.jsx("sphereGeometry",{args:[.44,20,20]}),E.jsx("meshBasicMaterial",{color:r.color,transparent:!0,opacity:1,depthWrite:!1,toneMapped:!1})]}),E.jsx(Rx,{ref:o,points:p,color:r.color,lineWidth:1.2,transparent:!0,opacity:0}),E.jsx(dv,{children:E.jsx(H1,{ref:l,position:[0,1.5,0],fontSize:.38*R,color:r.color,font:T,letterSpacing:.15,anchorX:"center",anchorY:"bottom",fillOpacity:0,children:r.label.toUpperCase()})})]})}function cN({act:r,stationId:e,actIdx:t,onCargoClick:n}){const[i,s]=K.useState(!1),o=i?"#FF6B00":"rgba(160,60,0,0.7)",l=i?"1.5px":"1px",u=d=>({position:"absolute",width:7,height:7,pointerEvents:"none",borderColor:o,borderStyle:"solid",borderWidth:0,...d});return E.jsxs("div",{onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:d=>{d.stopPropagation(),n({kind:"activity",stationId:e,actIdx:t})},style:{position:"relative",padding:"5px 12px 5px 10px",background:i?"rgba(180,55,0,0.18)":"transparent",cursor:"pointer",minWidth:170,transition:"background 0.14s",userSelect:"none"},children:[E.jsx("span",{style:{...u({top:0,left:0}),borderTopWidth:l,borderLeftWidth:l}}),E.jsx("span",{style:{...u({top:0,right:0}),borderTopWidth:l,borderRightWidth:l}}),E.jsx("span",{style:{...u({bottom:0,left:0}),borderBottomWidth:l,borderLeftWidth:l}}),E.jsx("span",{style:{...u({bottom:0,right:0}),borderBottomWidth:l,borderRightWidth:l}}),E.jsx("span",{style:{display:"block",fontSize:8,letterSpacing:"0.18em",textTransform:"uppercase",color:i?"#FF6B00":"rgba(160,80,10,0.85)",marginBottom:1},children:r.type}),E.jsx("span",{style:{display:"block",fontSize:11,color:i?"#ffd0a0":"rgba(200,130,60,0.7)",transition:"color 0.14s"},children:r.label})]})}function uN({node:r}){const e=zp(r.id),{nodeExtras:t,onCargoClick:n}=K.useContext(Cr),i=t[r.id],s=(i==null?void 0:i.removedActivityIndices)??[],o=(i==null?void 0:i.customActivities)??[],l=((e==null?void 0:e.activities)??[]).map((u,d)=>({act:u,i:d})).filter(({i:u})=>!s.includes(u));return l.length===0&&o.length===0?null:E.jsx(V2,{position:[1.6,.4,0],style:{pointerEvents:"none"},zIndexRange:[10,20],children:E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto",whiteSpace:"nowrap"},children:[l.map(({act:u,i:d})=>E.jsx(cN,{act:u,stationId:r.id,actIdx:d,onCargoClick:n},d)),o.map(u=>E.jsx(dN,{act:u,stationId:r.id,onCargoClick:n},u.id))]})})}function dN({act:r,stationId:e,onCargoClick:t}){const[n,i]=K.useState(!1),s=n?"#FF6B00":"rgba(160,60,0,0.7)",o=n?"1.5px":"1px",l=u=>({position:"absolute",width:7,height:7,pointerEvents:"none",borderColor:s,borderStyle:"solid",borderWidth:0,...u});return E.jsxs("div",{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:u=>{u.stopPropagation(),t({kind:"customActivity",stationId:e,activityId:r.id})},style:{position:"relative",padding:"5px 12px 5px 10px",background:n?"rgba(180,55,0,0.18)":"transparent",curs
4792or:"pointer",minWidth:170,transition:"background 0.14s",userSelect:"none"},children:[E.jsx("span",{style:{...l({top:0,left:0}),borderTopWidth:o,borderLeftWidth:o}}),E.jsx("span",{style:{...l({top:0,right:0}),borderTopWidth:o,borderRightWidth:o}}),E.jsx("span",{style:{...l({bottom:0,left:0}),borderBottomWidth:o,borderLeftWidth:o}}),E.jsx("span",{style:{...l({bottom:0,right:0}),borderBottomWidth:o,borderRightWidth:o}}),E.jsx("span",{style:{display:"block",fontSize:8,letterSpacing:"0.18em",textTransform:"uppercase",color:n?"#FF6B00":"rgba(160,80,10,0.85)",marginBottom:1},children:r.type}),E.jsx("span",{style:{display:"block",fontSize:11,color:n?"#ffd0a0":"rgba(200,130,60,0.7)",transition:"color 0.14s"},children:r.label})]})}function pw({node:r}){var A;const e=r.position??[0,0,0],t=.275,n=K.useRef(null),i=K.useRef(null),s=K.useRef(!1),o=K.useRef(null),l=K.useRef(null),{hLine:u,vLine:d}=K.useMemo(()=>{const T=new qt().setFromPoints([new te(-t,0,0),new te(t,0,0)]),R=new qt().setFromPoints([new te(0,0,-t),new te(0,0,t)]),U=new Ar({color:13168383,transparent:!0,opacity:.82}),k=new Ar({color:13168383,transparent:!0,opacity:.82});return o.current=U,l.current=k,{hLine:new cs(T,U),vLine:new cs(R,k)}},[]);K.useEffect(()=>()=>{u.geometry.dispose(),u.material.dispose(),d.geometry.dispose(),d.material.dispose()},[u,d]),K.useEffect(()=>()=>{s.current=!1},[]);const p=K.useContext(Cr),m=K.useRef(p);m.current=p,us(({clock:T})=>{var J,oe;const{activeNodeIds:R,selectedStationId:U,legendVisibility:k}=m.current,N=R.size===0||R.has(r.id),H=U===r.id,F=N&&k.station?1:0,I=m.current.globalConfig.stationColor;if(n.current){const se=n.current.material;se.color.set(I),se.opacity=nr(se.opacity,F,tr),n.current.scale.setScalar(H?1+.25*Math.sin(T.getElapsedTime()*4):1)}const G=(H?1:.82)*F;o.current&&(o.current.opacity=nr(o.current.opacity,G,tr),(J=o.current.color)==null||J.set(I)),l.current&&(l.current.opacity=nr(l.current.opacity,G,tr),(oe=l.current.color)==null||oe.set(I));const X=H||R.size>0&&R.has(r.id)||s.current?1:0;if(i.current){i.current.color=I,q1(i,.85*X);const se=i.current.fillOpacity??0;i.current.visible=se>.005}});const{onNodeClick:v,selectedStationId:y,nodeExtras:x,globalConfig:M}=K.useContext(Cr),S=xf(M.subdomainFont??"inter"),w=S.sizeScale??1;return E.jsxs("group",{position:e,onClick:T=>{T.stopPropagation(),v(r.id)},children:[E.jsx("primitive",{object:u}),E.jsx("primitive",{object:d}),E.jsxs("mesh",{onPointerEnter:T=>{T.stopPropagation(),s.current=!0},onPointerOver:T=>{T.stopPropagation(),s.current=!0},onPointerLeave:()=>{s.current=!1},onPointerOut:()=>{s.current=!1},children:[E.jsx("sphereGeometry",{args:[1.2,8,8]}),E.jsx("meshBasicMaterial",{transparent:!0,opacity:0,depthWrite:!1})]}),E.jsxs("mesh",{ref:n,children:[E.jsx("sphereGeometry",{args:[.11,12,12]}),E.jsx("meshBasicMaterial",{color:"#00D4FF",transparent:!0,opacity:1,toneMapped:!1})]}),E.jsx(dv,{children:E.jsx(H1,{ref:i,position:[0,.54,0],fontSize:.27*w,color:"#dff5ff",font:S.woffUrl,letterSpacing:.1,anchorX:"center",anchorY:"bottom",fillOpacity:0,children:(((A=x[r.id])==null?void 0:A.labelOverride)??r.label).toUpperCase()})}),y===r.id&&E.jsx(uN,{node:r})]})}const pv=36;function mv(r,e,t){const n=e.x-r.x,i=e.y-r.y,s=e.z-r.z,o=Math.sqrt(n*n+i*i+s*s)||1,l=Math.min(6,o*.38);t.set((r.x+e.x)/2,Math.max(r.y,e.y)+l,(r.z+e.z)/2)}function K1(r,e){return e?hv(r):new te(Op*Math.cos(r),0,Bp*Math.sin(r))}function gv(r,e,t){const n=new te(...r),i=K1(e,t),s=new te;return mv(n,i,s),new Nu(n,s,i)}function yE(r,e,t){const n=new te;let i=.4,s=.99;for(let o=0;o<22;o++){const l=(i+s)/2;r.getPoint(l,n),n.distanceTo(e)<t?s=l:i=l}return(i+s)/2}function fN({stationId:r,sourcePos:e,baseAngle:t,spaceOrbit:n,targetGroupId:i}){const s=K.useContext(Cr),o=K.useRef(s);o.current=s;const{mat:l,line:u,hitPoints:d}=K.useMemo(()=>{const p=gv(e,t,n),m=p.getPoints(pv),v=new qt().setFromPoints(m),y=new gc({color:13154400,transparent:!0,opacity:0,depthWrite:!1,dashSize:.22,gapSize:.14}),x=new cs(v,y);x.computeLineDistances();const M=[.2,.45,.7].map(S=>p.getPoint(S));return{mat:y,line:x,hitPoints:M}},[]);return K.useEffect(()=>()=>{u.geometry.dispose(),l.dispose()},[u,l]),us(()=>{const{selectedStationId:p,selectedTerritoryId:m,activeNodeIds:v,highlightedStationForTerritory:y,routeActive:x}=o.current;let M;x?M=!1:m?M=i===m&&y===r:M=p===r||v.size>0&&v.has(r),l.opacity=nr(l.opacity,M?.76:0,tr)}),E.jsxs(E.Fragment,{children:[E.jsx("primitive",{object:u}),d.map((p,m)=>E.jsxs("mesh",{position:[p.x,p.y,p.z],onClick:v=>{v.stopPropagation(),o.current.onNodeClick(r)}
4792,children:[E.jsx("sphereGeometry",{args:[.4,6,6]}),E.jsx("meshBasicMaterial",{transparent:!0,opacity:0,depthWrite:!1})]},m))]})}const Ng=10;function hN({stationId:r,sourcePos:e,baseAngle:t,spaceOrbit:n,targetGroupId:i,splitSubdomainIds:s,forkT:o}){const l=K.useContext(Cr),u=K.useRef(l);u.current=l;const d=K.useMemo(()=>{const p=gv(e,t,n),m=K1(t,n),v=o??yE(p,m,_p),y=p.getPoint(v),x=Math.max(4,Math.round(pv*v)),M=Array.from({length:x+1},(X,J)=>p.getPoint(J/x*v)),S=new qt().setFromPoints(M),w=new gc({color:13154400,transparent:!0,opacity:0,depthWrite:!1,dashSize:.22,gapSize:.14}),A=new cs(S,w);A.computeLineDistances();const T=Hp(i),R=T.length,U=[];for(const X of s){const J=T.findIndex(O=>O.id===X);if(J<0)continue;const oe=Math.PI*2/R*J,se=pE[i]??1,fe=new Float32Array((Ng+1)*3);for(let O=0;O<=Ng;O++)fe[O*3]=y.x,fe[O*3+1]=y.y,fe[O*3+2]=y.z;const V=new qt;V.setAttribute("position",new Pt(fe,3));const $=new gc({color:13154400,transparent:!0,opacity:0,depthWrite:!1,dashSize:.11,gapSize:.09}),Z=new cs(V,$);U.push({line:Z,mat:$,geo:V,phase:oe,dir:se})}const k=[.2,.6].map(X=>p.getPoint(X*v)),N=y.clone(),H=new te,F=new te,I=new te,G=new Nu(N,F,H),W=m.clone();return{mMat:w,mainLine:A,secEntries:U,hitPts:k,fT:v,tCenterClone:W,_v2:H,_ctrl:F,_pt:I,_bez:G}},[]);return K.useEffect(()=>()=>{d.mainLine.geometry.dispose(),d.mMat.dispose(),d.secEntries.forEach(p=>{p.geo.dispose(),p.mat.dispose()})},[d]),us(()=>{const{selectedStationId:p,selectedTerritoryId:m,activeNodeIds:v,orbitalTimeRef:y,highlightedStationForTerritory:x,routeActive:M}=u.current;let S;M?S=!1:m?S=i===m&&x===r:S=p===r||v.size>0&&v.has(r);const w=S?.76:0;d.mMat.opacity=nr(d.mMat.opacity,w,tr);const A=S?.52:0,T=y.current,{tCenterClone:R,_v2:U,_ctrl:k,_pt:N,_bez:H}=d;for(const F of d.secEntries){F.mat.opacity=nr(F.mat.opacity,A,tr);const I=F.phase+F.dir*T*cE;U.set(R.x+_p*Math.cos(I),R.y,R.z+X1*Math.sin(I)),mv(H.v0,U,k),H.v1.copy(k),H.v2.copy(U);const G=F.geo.attributes.position;for(let W=0;W<=Ng;W++)H.getPoint(W/Ng,N),G.setXYZ(W,N.x,N.y,N.z);G.needsUpdate=!0,F.line.computeLineDistances()}}),E.jsxs(E.Fragment,{children:[E.jsx("primitive",{object:d.mainLine}),d.secEntries.map((p,m)=>E.jsx("primitive",{object:p.line},m)),d.hitPts.map((p,m)=>E.jsxs("mesh",{position:[p.x,p.y,p.z],onClick:v=>{v.stopPropagation(),u.current.onNodeClick(r)},children:[E.jsx("sphereGeometry",{args:[.4,6,6]}),E.jsx("meshBasicMaterial",{transparent:!0,opacity:0,depthWrite:!1})]},m))]})}function pN({stationId:r,sourcePos:e,baseAngle:t,spaceOrbit:n,offset:i,forkT:s}){const o=K.useContext(Cr),l=K.useRef(o);l.current=o;const u=K.useRef(null),d=K.useRef(null),p=K.useRef(null),m=K.useRef(i),v=.032,y=K.useMemo(()=>gv(e,t,n),[]),x=K.useMemo(()=>new te(0,1,0),[]),M=K.useMemo(()=>new te,[]),S=K.useMemo(()=>{const T=new Float32Array([-.14,.14,0,-.07500000000000001,.14,0,-.14,.14,0,-.14,.07500000000000001,0,.07500000000000001,.14,0,.14,.14,0,.14,.14,0,.14,.07500000000000001,0,-.14,-.14,0,-.07500000000000001,-.14,0,-.14,-.14,0,-.14,-.07500000000000001,0,.07500000000000001,-.14,0,.14,-.14,0,.14,-.14,0,.14,-.07500000000000001,0]),R=new qt;R.setAttribute("position",new Pt(T,3));const U=new Ar({color:16758528,transparent:!0,opacity:0,depthWrite:!1,toneMapped:!1});return p.current=U,new ra(R,U)},[]);return K.useEffect(()=>()=>{S.geometry.dispose(),S.material.dispose()},[S]),us((w,A)=>{const{selectedStationId:T}=l.current,R=T===r,U=u.current;if(!U||!d.current)return;const k=d.current.material,N=R?.85:0;if(k.opacity=nr(k.opacity,N,tr*2),p.current&&(p.current.opacity=nr(p.current.opacity,N,tr*2)),!R&&k.opacity<.01)return;const H=s??1;m.current=(m.current+A*v)%H;const F=y.getPoint(m.current),I=y.getTangent(m.current,M).normalize();U.position.copy(F),I.lengthSq()>1e-4&&d.current.quaternion.setFromUnitVectors(x,I)}),E.jsxs("group",{ref:u,children:[E.jsxs("mesh",{ref:d,children:[E.jsx("coneGeometry",{args:[.055,.18,4]}),E.jsx("meshBasicMaterial",{color:"#c8b860",transparent:!0,opacity:0,toneMapped:!1,depthWrite:!1})]}),E.jsx(dv,{children:E.jsx("primitive",{object:S})})]})}function mN({nodeId:r,brief:e,nodeLabel:t,stepNum:n,totalSteps:i,onPrev:s,onNext:o,onClose:l,isFirst:u,isLast:d,images:p}){var N,H,F;const[m,v]=K.useState(null);K.useEffect(()=>
4792{v(null)},[r]);const{customNodes:y,nodeExtras:x}=K.useContext(Cr),M=K.useMemo(()=>Bx(r,y),[r,y]),S=K.useMemo(()=>Fi.find(I=>I.id===r)??y.find(I=>I.id===r),[r,y]),w=x[r]??{},A=w.imageUrl,T=w.links??[],R=(N=S==null?void 0:S.tags)!=null&&N.includes("territory")?"Territory":(H=S==null?void 0:S.tags)!=null&&H.includes("station")?"Station":"Domain",U=(F=S==null?void 0:S.tags)!=null&&F.includes("territory")?3.8:2.4;if(!M)return null;const k=I=>({background:I?"transparent":"rgba(0,212,255,0.05)",border:"none",color:I?"rgba(0,212,255,0.18)":"rgba(0,212,255,0.72)",fontSize:16,lineHeight:1,cursor:I?"default":"pointer",padding:"11px 0",fontFamily:"inherit",transition:"background 0.15s, color 0.15s",flex:1,textAlign:"center",fontWeight:700});return E.jsx(V2,{position:[M.x,M.y+U,M.z],center:!0,zIndexRange:[100,200],children:E.jsxs("div",{style:{fontFamily:'Inter, "Segoe UI", sans-serif',background:"rgba(3,8,16,0.93)",backdropFilter:"blur(16px)",border:"1px solid rgba(0,212,255,0.18)",borderLeft:"2px solid rgba(0,212,255,0.5)",width:272,maxHeight:360,display:"flex",flexDirection:"column",pointerEvents:"auto",overflow:"hidden",position:"relative"},children:[E.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"10px 12px 8px",scrollbarWidth:"thin",scrollbarColor:"rgba(0,212,255,0.2) transparent"},children:[E.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:7},children:[E.jsx("span",{style:{fontSize:7,letterSpacing:"0.2em",textTransform:"uppercase",color:"rgba(0,212,255,0.62)",padding:"1px 5px",border:"1px solid rgba(0,212,255,0.22)",background:"rgba(0,212,255,0.06)"},children:R}),E.jsxs("span",{style:{fontSize:7,letterSpacing:"0.14em",color:"rgba(0,212,255,0.35)"},children:[n," / ",i]})]}),E.jsx("div",{style:{fontSize:14,fontWeight:700,letterSpacing:"0.04em",color:"#e9fbff",marginBottom:8,lineHeight:1.2,fontFamily:'var(--subdomain-font, "Inter", sans-serif)'},children:t}),e&&E.jsx("div",{style:{fontSize:11,color:"rgba(180,210,220,0.78)",lineHeight:1.6,marginBottom:10},children:e}),A&&E.jsx("img",{src:A,alt:t,style:{width:"100%",marginBottom:10,objectFit:"cover",maxHeight:120,opacity:.88}}),T.length>0&&E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3},children:T.map((I,G)=>E.jsxs("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:W=>W.stopPropagation(),style:{fontSize:10,color:"#00D4FF",textDecoration:"none",opacity:.8,transition:"opacity 0.15s"},onMouseEnter:W=>W.currentTarget.style.opacity="1",onMouseLeave:W=>W.currentTarget.style.opacity="0.8",children:[I.label||I.url," â"]},G))}),p&&p.length>0&&E.jsx("div",{style:{display:"flex",gap:5,marginTop:10,flexWrap:"wrap"},children:p.map((I,G)=>E.jsxs("div",{onClick:W=>{W.stopPropagation(),v(G)},style:{width:64,height:46,cursor:"pointer",flexShrink:0,border:"1px solid rgba(0,212,255,0.22)",overflow:"hidden",position:"relative",transition:"border-color 0.15s"},onMouseEnter:W=>W.currentTarget.style.borderColor="rgba(0,212,255,0.6)",onMouseLeave:W=>W.currentTarget.style.borderColor="rgba(0,212,255,0.22)",title:I.caption??"View image",children:[E.jsx("img",{src:I.url,alt:I.caption??`Image ${G+1}`,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}),E.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(0,0,0,0)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,color:"rgba(255,255,255,0)",transition:"background 0.15s, color 0.15s"},onMouseEnter:W=>{W.currentTarget.style.background="rgba(0,0,0,0.45)",W.currentTarget.style.color="rgba(255,255,255,0.85)"},onMouseLeave:W=>{W.currentTarget.style.background="rgba(0,0,0,0)",W.currentTarget.style.color="rgba(255,255,255,0)"},children:"â¶"})]},G))})]}),m!==null&&p&&p.length>0&&(()=>{const I=p[m],G=m>0,W=m<p.length-1;return E.jsxs("div",{style:{position:"absolute",inset:0,zIndex:10,background:"rgba(3,8,16,0.97)",display:"flex",flexDirection:"column",pointerEvents:"auto"},onClick:X=>X.stopPropagation(),children:[E.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 10px",borderBottom:"1px solid rgba(0,212,255,0.14)",flexShrink:0},children:[E.jsxs("span",{style:{fontSize:9,color:"rgba(0,212,255,0.45)",letterSpacing:"0.12em"},children:[m+1," / ",p.length]}),E.jsx("button",{onClick:()=>v(null),style:{background:"none",border:"none",color:"rgba(255,107,107,0.7)",fontSize:16,cursor:"pointer",padding:"0 2px",lineHeight:1},onMouseEnter:X=>
4792X.currentTarget.style.color="#ff6b6b",onMouseLeave:X=>X.currentTarget.style.color="rgba(255,107,107,0.7)",children:"â"})]}),E.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",padding:8},children:E.jsx("img",{src:I.url,alt:I.caption??`Image ${m+1}`,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block"}})}),I.caption&&E.jsx("div",{style:{padding:"5px 10px",fontSize:9,color:"rgba(180,210,220,0.65)",lineHeight:1.4,flexShrink:0,borderTop:"1px solid rgba(0,212,255,0.09)",fontStyle:"italic"},children:I.caption}),p.length>1&&E.jsxs("div",{style:{display:"flex",alignItems:"stretch",borderTop:"1px solid rgba(0,212,255,0.14)",background:"rgba(0,0,0,0.25)",flexShrink:0},children:[E.jsx("button",{disabled:!G,onClick:()=>v(X=>X!==null?X-1:0),style:{flex:1,background:"none",border:"none",padding:"9px 0",color:G?"rgba(0,212,255,0.72)":"rgba(0,212,255,0.2)",fontSize:14,cursor:G?"pointer":"default"},children:"â"}),E.jsx("span",{style:{width:1,background:"rgba(0,212,255,0.14)"}}),E.jsx("button",{disabled:!W,onClick:()=>v(X=>X!==null?X+1:0),style:{flex:1,background:"none",border:"none",padding:"9px 0",color:W?"rgba(0,212,255,0.72)":"rgba(0,212,255,0.2)",fontSize:14,cursor:W?"pointer":"default"},children:"â¶"})]})]})})(),E.jsxs("div",{style:{display:"flex",alignItems:"stretch",borderTop:"1px solid rgba(0,212,255,0.14)",background:"rgba(0,0,0,0.25)"},children:[E.jsx("button",{disabled:u,onClick:I=>{I.stopPropagation(),s()},style:k(u),onMouseEnter:I=>{u||(I.currentTarget.style.background="rgba(0,212,255,0.10)",I.currentTarget.style.color="#00D4FF")},onMouseLeave:I=>{u||(I.currentTarget.style.background="rgba(0,212,255,0.05)",I.currentTarget.style.color="rgba(0,212,255,0.72)")},children:"â"}),E.jsx("span",{style:{width:1,background:"rgba(0,212,255,0.14)",flexShrink:0}}),d?E.jsx("button",{onClick:I=>{I.stopPropagation(),l()},style:{...k(!1),color:"rgba(255,107,107,0.75)",fontSize:18},onMouseEnter:I=>{I.currentTarget.style.background="rgba(255,107,107,0.08)",I.currentTarget.style.color="#ff6b6b"},onMouseLeave:I=>{I.currentTarget.style.background="rgba(0,212,255,0.05)",I.currentTarget.style.color="rgba(255,107,107,0.75)"},title:"Close route",children:"â"}):E.jsx("button",{onClick:I=>{I.stopPropagation(),o()},style:k(!1),onMouseEnter:I=>{I.currentTarget.style.background="rgba(0,212,255,0.10)",I.currentTarget.style.color="#00D4FF"},onMouseLeave:I=>{I.currentTarget.style.background="rgba(0,212,255,0.05)",I.currentTarget.style.color="rgba(0,212,255,0.72)"},children:"â¶"})]})]})})}function gN({fromId:r,toId:e}){const{customNodes:t}=K.useContext(Cr),n=K.useMemo(()=>Bx(r,t),[r,t]),i=K.useMemo(()=>Bx(e,t),[e,t]),{mat:s,line:o}=K.useMemo(()=>{const u=new gc({color:16758528,dashSize:.35,gapSize:.22,transparent:!0,opacity:0,depthWrite:!1}),d=new qt;d.setFromPoints([new te,new te]);const p=new cs(d,u);return p.computeLineDistances(),{mat:u,line:p}},[]);return K.useEffect(()=>()=>{o.geometry.dispose(),s.dispose()},[o,s]),K.useEffect(()=>{if(!n||!i)return;const u=[n.clone(),i.clone()];o.geometry.setFromPoints(u),o.computeLineDistances()},[n,i,o]),us((u,d)=>{s.opacity=nr(s.opacity,n&&i?.72:0,tr),s.dashOffset=((s.dashOffset??0)-d*.55)%1}),!n||!i||n.distanceTo(i)<.5?null:E.jsx("primitive",{object:o})}function vN({pairs:r}){return r.length===0?null:E.jsx(E.Fragment,{children:r.map(([e,t])=>E.jsx(gN,{fromId:e,toId:t},`${e}â${t}`))})}function yN(){const{nodeExtras:r,customNodes:e,customSubdomains:t,removedSubdomainIds:n}=K.useContext(Cr),i=K.useMemo(()=>{var d,p;const s=new Map;function o(m,v,y,x,M,S){const w=`${m}-${y}`;let A=s.get(w);A||(A={stationId:m,sourcePos:v,targetGroupId:y,baseAngle:x,spaceOrbit:y==="space",direct:!1,subdomainIds:new Set},s.set(w,A)),M&&(A.direct=!0),S&&A.subdomainIds.add(S)}for(const m of Sp){const v=Fi.find(w=>w.id===m.source),y=Fi.find(w=>w.id===m.target);if(!((d=v==null?void 0:v.tags)!=null&&d.includes("station"))||!y)continue;const x=!!((p=y.tags)!=null&&p.includes("territory")),M=x?y.id:y.parentId??y.group??"",S=yn[M];S!==void 0&&o(v.id,v.position??[0,0,0],M,S,x,x?void 0:y.id)}const l=[...Fi.filter(m=>{var v;return(v=m.tags)==null?void 0:v.includes("station")}),...e.filter(m=>{var v;return(v=m.tags)==null?void 0:v.includes("station")})];for(const[m,v]of Object.entries(r)){if(!v.connectedDomainIds)continue;const y=l.find(x=>x.id===m);if(y)for(const x of v.connectedDomainIds){const M=yn[x]!==void 0;let S,w;if(M)S=x;else{const T=Fi.find(R=>R.id===x);S=(T==null?void 0:T.parentId)??(T==null?void 0:T.group)??"",w=x}const A=yn[S];A!==void 0&&o(m,y.position??[0,0,0],S,A,M,w)}}const u=[];for(const[m,v]of s){const y={id:`link__${m}`,stationId:v.stationId,sourcePos:v.sourcePos,targetGroupId:v.targetGroupId,baseAngle:v.baseAngle,spaceOrbit:v.spaceOrbit};if(v.direct||v.subdomainIds.size===0){u.push(y);continue}const x=Hp(v.targetGroupId).filter(w=>!n.has(w.id)),M=t.filter(w=>w.parentId===v.targetGroupId),S=x.length+M.length;if(v.subdomainIds.size>=S)u.push(y);else{const w=gv(v.sourcePos,v.baseAngle,v.spaceOrbit),A=K1(v.baseAngle,v.spaceOrbit),T=yE(w,A,_p);u.push({...y,splitSubdomainIds:Array.from(v.subdomainIds),forkT:T})}}return u},[r,e,t,n]);return E.jsxs(E.Fragment,{children:[i.map(s=>s.splitSubdomainIds?E.jsx(hN,{...s,splitSubdomainIds:s.splitSubdomainIds},s.id):E.jsx(fN,{...s},s.id)),i.flatMap(s=>[0,.5].map(o=>E.jsx(pN,{...s,offset:o},`${s.id}-ship-${o}`)))]})}function xN({linkId:r,sourceId:e,targetId:t,sourceWorldPos:n,targetWorldPos:i}){const s=K.useContext(Cr),o=K.useRef(s);o.current=s;const{mat:l,line:u,hitPoints:d}=K.useMemo(()=>{const p=n.clone(),m=i.clone(),v=new te;mv(p,m,v);const y=new Nu(p,v,m),x=y.getPoints(pv),M=new qt().setFromPoints(x),S=new gc({color:8308968,transparent:!0,opacity:0,depthWrite:!1,dashSize:.22,gapSize:.14}),w=new cs(M,S);w.computeLineDistances();const A=[.1,.3,.5,.7,.9].map(T=>y.getPoint(T));return{mat:S,line:w,hitPoints:A}},[]);return K.useEffect(()=>()=>{u.geometry.dispose(),l.dispose()},[u,l]),us(()=>{const{activeNodeIds:p,selectedStationId:m,selectedTerritoryId:v,routeActive:y}=o.current,x=!y&&!v&&(p.has(e)||p.has(t)||m===e||m===t);l.opacity=nr(l.opacity,x?.76:0,tr)}),E.jsxs(E.Fragment,{children:[E.jsx("primitive",{object:u}),d.map((p,m)=>E.jsxs("mesh",{position:[p.x,p.y,p.z],onClick:v=>{v.stopPropagation(),o.current.onConnectionClick(r)},children:[E.jsx("sphereGeometry",{args:[.4,6,6]}),E.jsx("meshBasicMaterial",{transparent:!0,opacity:0,depthWrite:!1})]},m))]})}function _N({sourceWorldPos:r,targetWorldPos:e}){const{mat:t,line:n}
4792=K.useMemo(()=>{const i=r.clone(),s=e.clone(),o=new te;mv(i,s,o);const u=new Nu(i,o,s).getPoints(pv),d=new qt().setFromPoints(u),p=new gc({color:54527,transparent:!0,opacity:.55,depthWrite:!1,dashSize:.18,gapSize:.18}),m=new cs(d,p);return m.computeLineDistances(),{mat:p,line:m}},[]);return K.useEffect(()=>()=>{n.geometry.dispose(),t.dispose()},[n,t]),E.jsx("primitive",{object:n})}function SN({customLinks:r,customNodes:e}){return E.jsx(E.Fragment,{children:r.map(t=>{const n=_f(t.sourceId,e),i=_f(t.targetId,e);return!n||!i?null:E.jsx(xN,{linkId:t.id,sourceId:t.sourceId,targetId:t.targetId,sourceWorldPos:n,targetWorldPos:i},t.id)})})}function bN(){return E.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,-1.5,0],children:[E.jsx("planeGeometry",{args:[500,500]}),E.jsx("meshBasicMaterial",{transparent:!0,opacity:0,depthWrite:!1})]})}function wN({activeNodeIds:r=dE,selectedStationId:e=null,selectedTerritoryId:t=null,highlightedStationForTerritory:n=null,enabledGroups:i=fE,legendVisibility:s=mE,paused:o=!1,autoRotate:l=!1,onNodeClick:u=cc,onConnectionClick:d=cc,onIntroComplete:p=cc,customNodes:m=[],customLinks:v=[],previewLink:y=null,selectedSubdomainId:x=null,customSubdomains:M=[],removedSubdomainIds:S=new Set,onCargoHover:w=V=>{},onCargoClick:A=V=>{},globalConfig:T=Y1,nodeExtras:R={},activeStepNodeId:U=null,activeStepBrief:k="",activeStepLabel:N="",activeStepNum:H=1,totalSteps:F=1,onStepPrev:I=cc,onStepNext:G=cc,onStepClose:W=cc,isFirstStep:X=!1,isLastStep:J=!1,activeStepImages:oe=null,routeActive:se=!1,routeSequencePairs:fe=[]}){const V=K.useRef(0),$=K.useRef(!1),[Z,O]=K.useState(!1),j=K.useRef(()=>{O(!0),p()});j.current=()=>{O(!0),p()};const re=K.useMemo(()=>({activeNodeIds:r,selectedStationId:e,selectedTerritoryId:t,highlightedStationForTerritory:n,enabledGroups:i,legendVisibility:s,paused:o,orbitalTimeRef:V,onNodeClick:u,onConnectionClick:d,customNodes:m,customLinks:v,selectedSubdomainId:x,customSubdomains:M,removedSubdomainIds:S,hoverPausedRef:$,onCargoHover:w,onCargoClick:A,globalConfig:T,nodeExtras:R,activeStepNodeId:U,routeActive:se,autoRotate:l}),[r,e,t,n,i,s,o,u,d,m,v,x,M,S,w,A,T,R,U,se,l]),ne=K.useMemo(()=>{if(!y)return null;const ie=_f(y.sourceId,m),he=_f(y.targetId,m);return ie&&he?{src:ie,tgt:he}:null},[y,m]);return E.jsxs(Cr.Provider,{value:re,children:[E.jsx(rN,{}),!Z&&E.jsx(iN,{onComplete:()=>j.current()}),E.jsx(mk,{enabled:Z,enablePan:!1,minPolarAngle:Math.PI*.08,maxPolarAngle:Math.PI*.44,minDistance:18,maxDistance:55,enableDamping:!0,dampingFactor:.06,autoRotate:l&&!o,autoRotateSpeed:.35}),E.jsx(zF,{multisampling:0,children:E.jsx(VF,{selectionLayer:Nx,luminanceThreshold:0,luminanceSmoothing:.3,intensity:1.1,radius:.75})}),E.jsx(bN,{}),E.jsx(sN,{}),E.jsx(aN,{}),$o.filter(ie=>ie.id!=="space").map(ie=>E.jsx(vE,{group:ie},ie.id)),ZF.map(ie=>E.jsx(pw,{node:ie},ie.id)),m.map(ie=>E.jsx(pw,{node:ie},ie.id)),E.jsx(yN,{}),E.jsx(SN,{customLinks:v,customNodes:m}),E.jsx(vN,{pairs:fe}),ne&&E.jsx(_N,{sourceWorldPos:ne.src,targetWorldPos:ne.tgt},`${ne.src.x.toFixed(2)}-${ne.tgt.x.toFixed(2)}`),U&&E.jsx(mN,{nodeId:U,brief:k,nodeLabel:N,stepNum:H,totalSteps:F,onPrev:I,onNext:G,onClose:W,isFirst:X,isLast:J,images:oe})]})}const mw=11,ac="1.5px solid rgba(0,212,255,0.42)",Og=r=>({position:"absolute",width:mw,height:mw,pointerEvents:"none",...r});function bp({children:r,style:e}){return E.jsxs("div",{style:{background:"rgba(3,8,16,0.88)",backdropFilter:"blur(10px)",border:"1px solid rgba(0,212,255,0.1)",position:"relative",pointerEvents:"auto",...e},children:[E.jsx("span",{style:Og({top:-1,left:-1,borderTop:ac,borderLeft:ac})}),E.jsx("span",{style:Og({top:-1,right:-1,borderTop:ac,borderRight:ac})}),E.jsx("span",{style:Og({bottom:-1,left:-1,borderBottom:ac,borderLeft:ac})}),E.jsx("span",{style:Og({bottom:-1,right:-1,borderBottom:ac,borderRight:ac})}),r]})}const Bt={eyebrow:{fontSize:9,letterSpacing:"0.22em",textTransform:"uppercase",color:"#00D4FF",marginBottom:8},body:{fontSize:11,color:"rgba(168,189,198,0.82)",lineHeight:1.55,margin:0},divider:{height:1,background:"rgba(0,212,255,0.08)"},smallBtn:{padding:"5px 10px",background:"rgba(7,17,26,0.6)",border:"1px solid rgba(34,57,70,0.7)",color:"#7a96a2",curs
4792or:"pointer",fontSize:9,letterSpacing:"0.14em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto"}},gw=[{id:"about",label:"About"},{id:"routes",label:"Routes"},{id:"config",label:"Config"}];function MN({adminMode:r=!1,activeTab:e,onTabToggle:t,activeRouteId:n,enabledGroups:i,onRouteClick:s,onGroupToggle:o,legendVisibility:l,onToggleLegend:u,linkMode:d,onToggleLinkMode:p,linkModeSource:m,linkModeSourceLabel:v,customLinks:y,stationForm:x,onShowStationForm:M,onStationFormChange:S,onPlaceStation:w,onCancelStationForm:A,globalConfig:T,onGlobalConfigChange:R,customRoutes:U,onRouteLabelChange:k,onRouteDelete:N,onRouteConfigure:H,onRouteAdd:F,onExportSeed:I,onImportSeed:G,themes:W,activeThemeId:X,onThemeClick:J,onThemesChange:oe,allStations:se}){const fe=r?gw:gw.filter(V=>V.id!=="config");return E.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:0},children:[E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:1,pointerEvents:"auto"},children:fe.map(V=>E.jsx(EN,{label:V.label,active:e===V.id,onClick:()=>t(V.id)},V.id))}),E.jsx("div",{style:{width:e?240:0,overflow:"hidden",transition:"width 0.22s ease",flexShrink:0},children:E.jsxs(bp,{style:{width:240,maxHeight:"calc(100vh - 126px)",display:"flex",flexDirection:"column",borderLeft:"none",marginLeft:4},children:[e==="about"&&E.jsx(TN,{aboutText:T.aboutText}),e==="routes"&&E.jsx(AN,{activeRouteId:n,customRoutes:U,onRouteClick:s,themes:W,activeThemeId:X,onThemeClick:J}),e==="config"&&E.jsx(RN,{linkMode:d,onToggleLinkMode:p,linkModeSource:m,linkModeSourceLabel:v,customLinks:y,stationForm:x,onShowStationForm:M,onStationFormChange:S,onPlaceStation:w,onCancelStationForm:A,globalConfig:T,onGlobalConfigChange:R,customRoutes:U,onRouteLabelChange:k,onRouteDelete:N,onRouteConfigure:H,onRouteAdd:F,enabledGroups:i,onGroupToggle:o,legendVisibility:l,onToggleLegend:u,onExportSeed:I,onImportSeed:G,themes:W,onThemesChange:oe,allStations:se})]})})]})}function EN({label:r,active:e,onClick:t}){return E.jsx("button",{onClick:t,style:{width:28,height:80,background:e?"rgba(0,212,255,0.09)":"rgba(3,8,16,0.88)",border:"1px solid rgba(0,212,255,0.1)",borderRight:e?"1.5px solid rgba(0,212,255,0.5)":"1px solid rgba(0,212,255,0.1)",color:e?"#e9fbff":"#00D4FF",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center",outline:"none",transition:"color 0.2s, background 0.2s, border-color 0.2s"},children:E.jsx("span",{style:{writingMode:"vertical-lr",transform:"rotate(180deg)",fontSize:8,letterSpacing:"0.22em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif',userSelect:"none"},children:r})})}function TN({aboutText:r}){return E.jsxs("div",{style:{padding:"15px 16px 16px",overflowY:"auto",flex:1,minHeight:0},children:[E.jsx("div",{style:Bt.eyebrow,children:"About"}),E.jsx("p",{style:Bt.body,children:r})]})}function AN({activeRouteId:r,customRoutes:e,onRouteClick:t,themes:n,activeThemeId:i,onThemeClick:s}){return E.jsx(E.Fragment,{children:E.jsxs("div",{style:{padding:"13px 16px",flex:1,overflowY:"auto",minHeight:0},children:[E.jsx("div",{style:Bt.eyebrow,children:"Question Routes"}),E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:e.map(o=>E.jsx(DN,{route:o,active:r===o.id,onClick:()=>t(o)},o.id))}),E.jsxs("div",{style:{marginTop:18},children:[E.jsx("div",{style:Bt.eyebrow,children:"Themes"}),E.jsx("p",{style:{...Bt.body,marginBottom:9},children:"Click a theme to filter stations. Click again to clear."}),n.length===0?E.jsx("p",{style:{...Bt.body,color:"#3a5060",fontSize:10},children:"No themes defined. Add in Config."}):E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:n.map(o=>E.jsx(IN,{theme:o,active:i===o.id,onClick:()=>s(o.id)},o.id))})]})]})})}const CN=[{id:"A",label:"A â Solid",desc:"Uniform filled sphere, same hue throughout"},{id:"B",label:"B â Glow + Body",desc:"Bright core + dimmed outer volume (default)"}
4792,{id:"C",label:"C â Tight Glow",desc:"Bright core, small tight glow, faint outer"},{id:"D",label:"D â Core + Ring",desc:"Bright core only + 50% opacity outline ring"}];function Ta({label:r,children:e,defaultOpen:t=!1}){const[n,i]=K.useState(t);return E.jsxs("div",{style:{marginBottom:2},children:[E.jsxs("button",{onClick:()=>i(s=>!s),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"7px 10px",background:n?"rgba(0,212,255,0.07)":"rgba(7,17,26,0.5)",border:"1px solid rgba(0,212,255,0.14)",color:n?"#00D4FF":"#7a96a2",cursor:"pointer",fontSize:9,letterSpacing:"0.2em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif',textAlign:"left",pointerEvents:"auto"},children:[r,E.jsx("span",{style:{fontSize:10,marginLeft:6},children:n?"â¾":"â¸"})]}),n&&E.jsx("div",{style:{padding:"10px 10px 4px",background:"rgba(0,212,255,0.02)",border:"1px solid rgba(0,212,255,0.08)",borderTop:"none",marginBottom:6},children:e})]})}function vw({label:r,value:e,previewText:t,onChange:n}){const i=xf(e);return E.jsxs("div",{style:{marginBottom:12},children:[E.jsx("div",{style:{fontSize:9,letterSpacing:"0.18em",textTransform:"uppercase",color:"#5a7a8a",marginBottom:5},children:r}),E.jsx("select",{value:e,onChange:s=>n(s.target.value),style:{width:"100%",boxSizing:"border-box",background:"rgba(7,17,26,0.8)",border:"1px solid rgba(34,57,70,0.7)",color:"#c8dde8",fontSize:10,padding:"5px 7px",outline:"none",cursor:"pointer",fontFamily:'Inter, "Segoe UI", sans-serif'},children:Fx.map(s=>E.jsx("option",{value:s.id,children:s.label},s.id))}),E.jsx("div",{style:{marginTop:5,fontSize:11,letterSpacing:"0.12em",textTransform:"uppercase",color:"rgba(0,212,255,0.55)",fontFamily:i.cssFamily,padding:"4px 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}function Uh({label:r,value:e,onChange:t,showReset:n,onReset:i,emptyLabel:s}){return E.jsxs("div",{style:{marginBottom:10},children:[E.jsx("div",{style:{fontSize:9,letterSpacing:"0.18em",textTransform:"uppercase",color:"#5a7a8a",marginBottom:5},children:r}),E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[E.jsx("input",{type:"color",value:e||"#00D4FF",onChange:o=>t(o.target.value),style:{width:32,height:24,border:"none",cursor:"pointer",background:"none",padding:0}}),E.jsx("span",{style:{...Bt.body,fontFamily:"monospace",fontSize:10},children:e?e.toUpperCase():s??"â"}),n&&e&&E.jsx("button",{onClick:i,style:{...Bt.smallBtn,padding:"2px 6px",fontSize:8,marginLeft:"auto"},children:"Reset"})]})]})}function RN({linkMode:r,onToggleLinkMode:e,linkModeSource:t,linkModeSourceLabel:n,customLinks:i,stationForm:s,onShowStationForm:o,onStationFormChange:l,onPlaceStation:u,onCancelStationForm:d,globalConfig:p,onGlobalConfigChange:m,customRoutes:v,onRouteLabelChange:y,onRouteDelete:x,onRouteConfigure:M,onRouteAdd:S,enabledGroups:w,onGroupToggle:A,legendVisibility:T,onToggleLegend:R,onExportSeed:U,onImportSeed:k,themes:N,onThemesChange:H,allStations:F}){return E.jsxs("div",{style:{padding:"15px 16px 16px",overflowY:"auto",flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:0},children:[E.jsxs(Ta,{label:"About",children:[E.jsx("p",{style:{...Bt.body,marginBottom:8,fontSize:10},children:"Text shown in the About tab."}),E.jsx("textarea",{value:p.aboutText,onChange:I=>m({...p,aboutText:I.target.value}),rows:5,style:{width:"100%",boxSizing:"border-box",background:"rgba(0,212,255,0.04)",border:"1px solid rgba(0,212,255,0.15)",color:"#c8dde8",fontSize:11,padding:"6px 8px",outline:"none",fontFamily:'Inter, "Segoe UI", sans-serif',resize:"vertical"},placeholder:"About textâ¦"})]}),E.jsx("div",{style:{height:6}}),E.jsxs(Ta,{label:"Colour",defaultOpen:!0,children:[E.jsx(Uh,{label:"Subdomain dots",value:p.subdomainColor,onChange:I=>m({...p,subdomainColor:I})}),E.jsx(Uh,{label:"Subdomain labels",value:p.subdomainLabelColor,onChange:I=>m({...p,subdomainLabelColor:I})}),E.jsx(Uh,{label:"Stations",value:p.stationColor,onChange:I=>m({...p,stationColor:I})}),E.jsx(Uh,{label:"Territory (override)",value:p.territoryColor,onChange:I=>m({...p,territoryColor:I}),showReset:!0,onReset:()=>m({...p,territoryColor:""}),emptyLabel:"per-territory"}),E.jsx(Uh,{label:"Orbital rings",value:p.orbitalColor,onChange:I=>m({...p,orbitalColor:I})}),E.jsx("div",{style:{...Bt.divider,margin:"10px 0"}}),E.jsx("div",{style:{fontSize:9,letterSpacing:"0.18em",textTransform:"uppercase",color:"#5a7a8a",marginBottom:7},children:"Territory Style"}),E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:CN.map(I=>{const G=p.territoryStyle===I.id;return E.jsxs("button",{onClick:()=>m({...p,territoryStyle:I.id}),style:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"6px 9px",background:G?"rgba(0,212,255,0.10)":"rgba(7,17,26,0.6)",border:G?"1px solid rgba(0,212,255,0.45)":"1px solid rgba(34,57,70,0.5)",color:G?"#00D4FF":"#7a96a2",curs
4792or:"pointer",textAlign:"left",fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto"},children:[E.jsx("span",{style:{fontSize:9,letterSpacing:"0.12em",textTransform:"uppercase",fontWeight:600},children:I.label}),E.jsx("span",{style:{fontSize:8,color:G?"rgba(0,212,255,0.7)":"#4a6a7a",marginTop:1},children:I.desc})]},I.id)})})]}),E.jsx("div",{style:{height:6}}),E.jsxs(Ta,{label:"Fonts",children:[E.jsx(vw,{label:"Territory labels",value:p.territoryFont??"inter",previewText:"TERRITORY",onChange:I=>m({...p,territoryFont:I})}),E.jsx(vw,{label:"Subdomain labels",value:p.subdomainFont??"inter",previewText:"SUBDOMAIN",onChange:I=>m({...p,subdomainFont:I})})]}),E.jsx("div",{style:{height:6}}),E.jsxs(Ta,{label:"Question Routes",children:[E.jsx("p",{style:{...Bt.body,marginBottom:10,fontSize:10},children:"Edit or add routes. Each route defines a question and the nodes it reveals."}),E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:v.map(I=>E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[E.jsx("input",{value:I.label,onChange:G=>y(I.id,G.target.value),style:{flex:1,background:"rgba(0,212,255,0.04)",border:"1px solid rgba(0,212,255,0.12)",color:"#c8dde8",fontSize:10,padding:"5px 7px",outline:"none",fontFamily:'Inter, "Segoe UI", sans-serif'}}),E.jsx("button",{onClick:()=>M(I),title:"Configure",style:{...Bt.smallBtn,padding:"5px 8px",color:"#00D4FF",borderColor:"rgba(0,212,255,0.25)"},children:"â"}),E.jsx("button",{onClick:()=>x(I.id),title:"Delete",style:{...Bt.smallBtn,padding:"5px 8px",color:"#ff6b6b",borderColor:"rgba(255,80,80,0.2)"},children:"â"})]},I.id))}),E.jsx("button",{onClick:S,style:{...gl("#00D4FF"),marginTop:10,width:"100%"},children:"+ Add Route"})]}),E.jsx("div",{style:{height:6}}),E.jsxs(Ta,{label:"Themes",children:[E.jsx("p",{style:{...Bt.body,marginBottom:10,fontSize:10},children:"Group stations by theme. Click a theme in Routes to filter the scene."}),E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:N.map(I=>E.jsx(LN,{theme:I,allStations:F,onChange:G=>H(N.map(W=>W.id===G.id?G:W)),onDelete:()=>H(N.filter(G=>G.id!==I.id))},I.id))}),E.jsx("button",{onClick:()=>H([...N,{id:`theme_${Date.now()}`,label:"New Theme",stationIds:[]}]),style:{...gl("#00D4FF"),marginTop:10,width:"100%"},children:"+ Add Theme"})]}),E.jsx("div",{style:{height:6}}),E.jsx(Ta,{label:"Territories",children:E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3},children:$o.map(I=>{const G=w[I.id]!==!1;return E.jsxs("div",{onClick:()=>A(I.id),style:Bg(G),children:[E.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:rn[I.id],flexShrink:0,boxShadow:G?`0 0 5px ${rn[I.id]}80`:"none",transition:"box-shadow 0.3s"}}),E.jsx("span",{style:{fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:G?"#b5c8cf":"#3a5060"},children:I.label}),E.jsx("span",{style:{marginLeft:"auto",fontSize:8,letterSpacing:"0.12em",textTransform:"uppercase",color:"#2a4050"},children:G?"on":"dim"})]},I.id)})})}),E.jsx("div",{style:{height:6}}),E.jsx(Ta,{label:"Legend",children:E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3},children:[E.jsxs("div",{onClick:()=>R("station"),style:Bg(T.station),children:[E.jsxs("span",{style:{position:"relative",width:8,height:8,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:[E.jsx("span",{style:{position:"absolute",width:8,height:1.5,background:T.station?"#c8eeff":"#2a4050",borderRadius:1,transition:"background 0.25s"}}),E.jsx("span",{style:{position:"absolute",width:1.5,height:8,background:T.station?"#c8eeff":"#2a4050",borderRadius:1,transition:"background 0.25s"}})]}),E.jsx("span",{style:{fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:T.station?"#b5c8cf":"#3a5060"},children:"Station"}),E.jsx("span",{style:{marginLeft:"auto",fontSize:8,letterSpacing:"0.12em",textTransform:"uppercase",color:"#2a4050"},children:T.station?"on":"dim"})]}),E.jsxs("div",{onClick:()=>R("territory"),style:Bg(T.territory),children:[E.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:T.territory?"rgba(0,212,255,0.75)":"rgba(0,212,255,0.2)",boxShadow:T.territory?"0 0 5px rgba(0,212,255,0.5)":"none",flexShrink:0,transition:"all 0.25s"}}),E.jsx("span",{style:{fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:T.territory?"#b5c8cf":"#3a5060"},children:"Territory"}),E.jsx("span",{style:{marginLeft:"auto",fontSize:8,letterSpacing:"0.12em",textTransform:"uppercase",color:"#2a4050"},children:T.territory?"on":"dim"})]}),E.jsxs("div",{onClick:()=>R("subdomain"),style:Bg(T.subdomain),children:[E.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:T.subdomain?"#00D4FF":"rgba(0,212,255,0.2)",flexShrink:0,transition:"all 0.25s"}}),E.jsx("span",{style:{fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:T.subdomain?"#b5c8cf":"#3a5060"},children:"Subdomain"}),E.jsx("span",{style:{marginLeft:"auto",fontSize:8,letterSpacing:"0.12em",textTransform:"uppercase",color:"#2a4050"},children:T.subdomain?"on":"dim"})]})]})}),E.jsx("div",{style:{height:6}}),E.jsxs(Ta,{label:"Link Mode",children:[E.jsx("p",{style:{...Bt.body,marginBottom:10,fontSize:10},children:"Enable, then click two nodes to define a cargo connection."}),E.jsx("button",{onClick:e,style:kN(r),children:r?"â On":"â Off"}),r&&E.jsx("div",{style:{marginTop:10,padding:"8px 10px",background:"rgba(0,212,255,0.04)",border:"1px solid rgba(0,212,255,0.12)"},children:t?E.jsxs("p",{style:{...Bt.body,fontSize:10,margin:0},children:["Source: ",E.jsx("span",{style:{color:"#FFB700"},children:n}),E.jsx("br",{}),"Click another node to connect."]}):E.jsx("p",{style:{...Bt.body,color:"#00D4FF",fontSize:10,margin:0},children:"Click a node to set source."})}),i.length>0&&E.jsxs("div",{style:{marginTop:10,fontSize:9,letterSpacing:"0.14em",textTransform:"uppercase",color:"#4a6a7a"},children:[i.length," connection",i.length!==1?"s":""," active"]})]}),E.jsx("div",{style:{height:6}}),E.jsxs(Ta,{label:"New Station",children:[E.jsx("p",{style:{...Bt.body,marginBottom:10,fontSize:10},children:"Place a new station. Fill in details and connect to existing nodes."}),s?E.jsx(PN,{form:s,onChange:l,onPlace:u,onCancel:d}):E.jsx("button",{onClick:o,style:gl("#FFB700"),children:"+ Place Station"})]}),E.jsx("div",{style:{height:6}}),E.jsxs(Ta,{label:"Data",children:[E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,marginBottom:10,padding:"5px 8px",background:"rgba(0,212,255,0.04)",border:"1px solid rgba(0,212,255,0.10)"},children:[E.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"#00D4FF",boxShadow:"0 0 4px #00D4FF",flexShrink:0}}),E.jsx("span",{style:{fontSize:9,color:"rgba(0,212,255,0.65)",letterSpacing:"0.12em",textTransform:"uppercase"},children:"Auto-saved to browser"})]}),E.jsx("p",{style:{...Bt.body,marginBottom:10,fontSize:10},children:"All changes save automatically to browser storage. Download a backup file to preserve data across devices or browser resets."}),E.jsxs("div",{style:{marginBottom:10,padding:"8px 10px",background:"rgba(255,183,0,0.05)",border:"1px solid rgba(255,183,0,0.18)",fontSize:9,color:"rgba(255,183,0,0.75)",lineHeight:1.8,letterSpacing:"0.04em"},children:[E.jsx("div",{style:{letterSpacing:"0.18em",textTransform:"uppercase",marginBottom:4,color:"rgba(255,183,0,0.5)"},children:"To deploy"}),E.jsxs("div",{children:["1. Save File â â rename to ",E.jsx("span",{style:{fontFamily:"monospace",color:"rgba(255,183,0,0.9)"},children:"portfolio-content.json"})]}),E.jsxs("div",{children:["2. Drop into ",E.jsx("span",{style:{fontFamily:"monospace",color:"rgba(255,183,0,0.9)"},children:"dev/public/"})]}),E.jsxs("div",{children:["3. Run ",E.jsx("span",{style:{fontFamily:"monospace",color:"rgba(255,183,0,0.9)"},children:"npm run build"})," in ",E.jsx("span",{style:{fontFamily:"monospace",color:"rgba(255,183,0,0.9)"},children:"dev/"})]}),E.jsxs("div",{children:["4. Upload ",E.jsx("span",{style:{fontFamily:"monospace",color:"rgba(255,183,0,0.9)"},children:"dist/"})," â GoDaddy root"]})]}),E.jsxs("div",{style:{display:"flex",gap:6},children:[E.jsx("button",{onClick:U,style:{...gl("#00D4FF"),flex:1,pointerEvents:"auto"},children:"Save File â"}),E.jsxs("label",{style:{...gl("#FFB700"),flex:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto"},children:["Load File â",E.jsx("input",{type:"file",accept:".json",style:{display:"none"},onChange:I=>{var X;const G=(X=I.target.files)==null?void 0:X[0];if(!G)return;const W=new FileReader;W.onload=()=>{typeof W.result=="string"&&k(W.result)},W.readAsText(G),I.target.value=""}})]})]})]})]})}function PN({form:r,onChange:e,onPlace:t,onCancel:n}){const i=(l,u,d)=>{const p=[...r.links];p[l]={...p[l],[u]:d},e({links:p})},s=()=>e({links:[...r.links,{label:"",url:""}]}),o=l=>e({links:r.links.filter((u,d)=>d!==l)});return E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[E.jsx("input",{placeholder:"Station label *",value:r.label,onChange:l=>e({label:l.target.value}),style:sf}),E.jsx("textarea",{placeholder:"Descriptionâ¦",value:r.description,onChange:l=>e({description:l.target.value}),style:{...sf,resize:"vertical",minHeight:52}}
4792),E.jsx("input",{placeholder:"Image URL (optional)",value:r.imageUrl,onChange:l=>e({imageUrl:l.target.value}),style:sf}),r.links.map((l,u)=>E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,padding:"6px 8px",background:"rgba(0,212,255,0.03)",border:"1px solid rgba(0,212,255,0.08)"},children:[E.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[E.jsxs("span",{style:{fontSize:8,letterSpacing:"0.14em",textTransform:"uppercase",color:"#4a6a7a",flex:1},children:["Link ",u+1]}),E.jsx("button",{onClick:()=>o(u),style:{background:"none",border:"none",color:"#3d5a68",cursor:"pointer",fontSize:11,padding:"0 2px"},children:"Ã"})]}),E.jsx("input",{placeholder:"Label",value:l.label,onChange:d=>i(u,"label",d.target.value),style:sf}),E.jsx("input",{placeholder:"URL",value:l.url,onChange:d=>i(u,"url",d.target.value),style:sf})]},u)),E.jsx("button",{onClick:s,style:{...gl("rgba(0,212,255,0.6)"),fontSize:9,padding:"5px 8px"},children:"+ Add Link"}),E.jsxs("div",{style:{display:"flex",gap:6,marginTop:4},children:[E.jsx("button",{onClick:t,disabled:!r.label,style:{...gl("#FFB700"),flex:1,opacity:r.label?1:.4},children:"Place"}),E.jsx("button",{onClick:n,style:{...gl("#3d5a68"),flex:1},children:"Cancel"})]})]})}function IN({theme:r,active:e,onClick:t}){const n=r.stationIds.length,[i,s]=K.useState(!1);return E.jsxs("button",{onClick:t,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,padding:"8px 11px",background:e?"rgba(255,183,0,0.09)":i?"rgba(255,183,0,0.04)":"rgba(7,17,26,0.55)",border:`1px solid ${e?"rgba(255,183,0,0.38)":i?"rgba(255,183,0,0.4)":"rgba(34,57,70,0.65)"}`,color:e?"#FFB700":i?"rgba(255,183,0,0.8)":"#c0d6e0",cursor:"pointer",fontSize:11,pointerEvents:"auto",transition:"border-color 0.2s, background 0.2s, color 0.2s",fontFamily:'Inter, "Segoe UI", sans-serif',boxShadow:e?"0 0 12px rgba(255,183,0,0.1)":"none"},children:[E.jsx("span",{style:{letterSpacing:"0.08em",textTransform:"uppercase",fontSize:10,fontWeight:e?600:400},children:r.label}),E.jsxs("span",{style:{fontSize:8,letterSpacing:"0.12em",textTransform:"uppercase",color:e?"rgba(255,183,0,0.65)":"#3a5060",flexShrink:0},children:[n," station",n!==1?"s":""]})]})}function LN({theme:r,allStations:e,onChange:t,onDelete:n}){const[i,s]=K.useState(""),o=e.filter(l=>!r.stationIds.includes(l.id));return E.jsxs("div",{style:{padding:"8px 10px",background:"rgba(0,212,255,0.03)",border:"1px solid rgba(0,212,255,0.10)",marginBottom:2},children:[E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,marginBottom:7},children:[E.jsx("input",{value:r.label,onChange:l=>t({...r,label:l.target.value}),style:{...sf,flex:1,fontSize:10},placeholder:"Theme name"}),E.jsx("button",{onClick:n,title:"Delete theme",style:{...Bt.smallBtn,padding:"5px 7px",color:"#ff6b6b",borderColor:"rgba(255,80,80,0.2)",flexShrink:0},children:"â"})]}),r.stationIds.length>0&&E.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:7},children:r.stationIds.map(l=>{const u=e.find(d=>d.id===l);return E.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3,padding:"2px 5px 2px 8px",background:"rgba(255,183,0,0.1)",border:"1px solid rgba(255,183,0,0.25)",fontSize:9,color:"#FFB700",letterSpacing:"0.1em",textTransform:"uppercase"},children:[(u==null?void 0:u.label)??l,E.jsx("button",{onClick:()=>t({...r,stationIds:r.stationIds.filter(d=>d!==l)}),style:{background:"none",border:"none",color:"rgba(255,183,0,0.6)",cursor:"pointer",fontSize:11,padding:"0 0 0 2px",lineHeight:1},children:"Ã"})]},l)})}),o.length>0&&E.jsxs("div",{style:{display:"flex",gap:5},children:[E.jsxs("select",{value:i,onChange:l=>s(l.target.value),style:{flex:1,background:"#0d1f2d",border:"1px solid rgba(0,212,255,0.2)",color:"#c8dde8",fontSize:10,padding:"4px 6px",colorScheme:"dark",outline:"none"},children:[E.jsx("option",{value:"",style:{background:"#0d1f2d"},children:"Add stationâ¦"}),o.map(l=>E.jsx("option",{value:l.id,style:{background:"#0d1f2d"},children:l.label},l.id))]}),E.jsx("button",{onClick:()=>
4792{i&&(t({...r,stationIds:[...r.stationIds,i]}),s(""))},disabled:!i,style:{...gl("#00D4FF"),opacity:i?1:.4,fontSize:9,padding:"4px 9px"},children:"Add"})]})]})}function DN({route:r,active:e,onClick:t}){const[n,i]=K.useState(!1);return E.jsx("button",{onClick:t,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{...UN(e),borderColor:e?"rgba(0,212,255,0.38)":n?"rgba(0,212,255,0.45)":"rgba(34,57,70,0.65)",background:e?"rgba(0,212,255,0.09)":n?"rgba(0,212,255,0.04)":"rgba(7,17,26,0.55)"},children:r.label})}const UN=r=>({width:"100%",textAlign:"left",padding:"9px 11px",background:r?"rgba(0,212,255,0.09)":"rgba(7,17,26,0.55)",border:`1px solid ${r?"rgba(0,212,255,0.38)":"rgba(34,57,70,0.65)"}`,color:r?"#00D4FF":"#c0d6e0",cursor:"pointer",fontSize:11.5,lineHeight:1.4,pointerEvents:"auto",transition:"border-color 0.2s, background 0.2s, color 0.2s",boxShadow:r?"0 0 14px rgba(0,212,255,0.1), inset 0 0 0 1px rgba(0,212,255,0.06)":"none",fontFamily:'Inter, "Segoe UI", sans-serif'}),Bg=r=>({display:"flex",alignItems:"center",gap:8,cursor:"pointer",padding:"4px 5px",opacity:r?1:.38,transition:"opacity 0.25s",pointerEvents:"auto"}),kN=r=>({padding:"6px 12px",background:r?"rgba(0,212,255,0.1)":"rgba(7,17,26,0.6)",border:`1px solid ${r?"rgba(0,212,255,0.4)":"rgba(34,57,70,0.7)"}`,color:r?"#00D4FF":"#7a96a2",cursor:"pointer",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto",transition:"all 0.2s",textAlign:"left"}),sf={background:"rgba(7,17,26,0.7)",border:"1px solid rgba(34,57,70,0.8)",color:"#c8dde8",fontSize:11,padding:"6px 8px",fontFamily:'Inter, "Segoe UI", sans-serif',outline:"none",width:"100%",boxSizing:"border-box"},gl=r=>({padding:"7px 12px",background:"rgba(7,17,26,0.6)",border:`1px solid ${r}55`,color:r,cursor:"pointer",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto"});var FN=Cw();function zx(r,e,t){var s,o;const n=(s=t[r])==null?void 0:s.labelOverride;if(n)return n;const i=e.find(l=>l.id===r);return i?i.label:((o=vo(r))==null?void 0:o.label)??r}function yw({activeRoute:r,selectedNode:e,revealedIds:t,customLinks:n,customNodes:i,configOpen:s,nodeExtras:o,selectedLinkId:l,customSubdomains:u,removedSubdomainIds:d,selectedCargo:p,highlightedStationForTerritory:m,onHighlightStationForTerritory:v,onUpdateCustomNode:y,onUpdateNodeExtra:x,onDetachCargo:M,onDeleteLink:S,onDeselectLink:w,onAddCargoToLink:A,onAddSubdomain:T,onRemoveSubdomain:R,onDeselectCargo:U,onSelectCargo:k,activeStepNodeId:N=null,onJumpToStep:H,mobile:F=!1}){var G,W,X;const I=!l&&!e&&!r;return E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[E.jsx(bp,{style:{width:F?"100%":298,maxHeight:F?"none":"calc(100vh - 88px)",display:"flex",flexDirection:"column"},children:E.jsx("div",{style:Hx,children:l?E.jsx(HN,{linkId:l,customLinks:n,customNodes:i,nodeExtras:o,onDetachCargo:M,onDeleteLink:S,onDeselectLink:w,onAddCargoToLink:A}):(G=e==null?void 0:e.tags)!=null&&G.includes("station")?E.jsx(zN,{station:e,customLinks:n,customNodes:i,configOpen:s,nodeExtras:o,onUpdateCustomNode:y,onUpdateNodeExtra:x,onSelectCargo:k,customSubdomains:u}):(W=e==null?void 0:e.tags)!=null&&W.includes("territory")?E.jsx(GN,{node:e,configOpen:s,nodeExtras:o,onUpdateNodeExtra:x,customSubdomains:u,removedSubdomainIds:d,onAddSubdomain:T,onRemoveSubdomain:R,customNodes:i,highlightedStationId:m,onHighlightStation:v}):(X=e==null?void 0:e.tags)!=null&&X.includes("subdomain")?E.jsx(VN,{node:e,configOpen:s,nodeExtras:o,onUpdateNodeExtra:x}):r?E.jsx(WN,{route:r,revealedIds:t,customNodes:i,nodeExtras:o,onJumpToStep:H}):E.jsx(NN,{})})}),p&&E.jsxs(bp,{style:{width:F?"100%":298,maxHeight:F?"none":"calc(60vh)",display:"flex",flexDirection:"column"},children:[E.jsx("button",{onClick:U,style:{position:"absolute",top:6,right:8,background:"none",border:"none",color:"rgba(0,212,255,0.45)",cursor:"pointer",fontSize:13,lineHeight:1,padding:"2px 3px",pointerEvents:"auto",zIndex:1,fontFamily:"inherit"},onMouseEnter:J=>J.currentTarget.style.color="rgba(0,212,255,0.9)",onMouseLeave:J=>J.currentTarget.style.color="rgba(0,212,255,0.45)",children:"â"}),E.jsx("div",{style:Hx,children:E.jsx(jN,{cargo:p,nodeExtras:o,customSubdomains:u,customLinks:n,configOpen:s,onUpdateNodeExtra:x,onDeselectCargo:U})})]}),I&&!F&&E.jsx(ON,{customNodes:i,nodeExtras:o})]})}const Hx={flex:1,overflowY:"auto",minHeight:0,padding:"15px 16px 16px",scrollbarWidth:"thin",scrollbarColor:"rgba(0,212,255,0.3) transparent"};function NN(){return E.jsxs(E.Fragment,{children:[E.jsx("div",{style:Bt.eyebrow,children:"Selected"}),E.jsx("h2",{style:zu,children:"Pick a node or station"}),E.jsx("p",{style:Bt.body,children:"Hop between orbits from one interest to another, or across interplanetary projects, to see the synergic curiosity routes that connect the nodes in my mind."})]})}function ON({customNodes:r,nodeExtras:e}){var v;const t=K.useMemo(()=>[...Fi.filter(y=>{var x;return(x=y.tags)==null?void 0:x.includes("station")}),...r.filter(y=>{var x;return(x=y.tags)==null?void 0:x.includes("station")})],[r]),[n,i]=K.useState(0),[s,o]=K.useState(!1);if(K.useEffect(()=>{if(t.length===0||s)return;const y=setInterval(()=>i(x=>(x+1)%t.length),4e3);return()=>clearInterval(y)},[t.length,s]),t.length===0)return null;const l=t[n],u=e[l.id]??{},d=u.labelOverride??l.label,p=u.descriptionOverride??l.description,m=(v=u.images)!=null&&v.length?u.images:u.imageUrl?[{url:u.imageUrl}]:[];return E.jsx(bp,{style:{width:298,maxHeight:"calc(55vh)",display:"flex",flexDirection:"column"},children:E.jsxs("div",{style:Hx,children:[E.jsx("div",{style:{display:"flex",gap:2,marginBottom:10},children:t.map((y,x)=>E.jsx("div",{onClick:()=>i(x),style:{height:2,flex:1,cursor:"pointer",background:x===n?"rgba(0,212,255,0.75)":"rgba(0,212,255,0.12)",transition:"background 0.3s"}},x))}),E.jsx("div",{style:Bt.eyebrow,children:"Station Preview"}),E.jsx("h2",{style:zu,children:d}),p&&E.jsx("p",{style:{...Bt.body,marginBottom:14},children:p}),m.length>0&&E.jsx(Gp,{images:m,onModalOpenChange:o})]})})}function Gp({images:r,onModalOpenChange:e}){const[t,n]=K.useState(0),[i,s]=K.useState(!1);K.useEffect(()=>{n(0)},[r]);const o=()=>{s(!0),e==null||e(!0)},l=()=>{s(!1),e==null||e(!1)};if(r.length===0)return null;const u=Math.min(t,r.length-1),d=r[u];return E.jsxs(E.Fragment,{children:[E.jsxs("div",{style:{position:"relative",marginBottom:12},children:[E.jsx("img",{src:d.url,alt:d.caption??"",onClick:o,style:{width:"100%",maxHeight:160,objectFit:"cover",opacity:.9,cursor:"zoom-in",display:"block"}}),r.length>1&&E.jsxs(E.Fragment,{children:[E.jsx("button",{onClick:p=>{p.stopPropagation(),n(m=>(m-1+r.length)%r.length)},style:xw("left"),children:"â¹"}),E.jsx("button",{onClick:p=>{p.stopPropagation(),n(m=>(m+1)%r.length)},style:xw("right"),children:"âº"}),E.jsxs("div",{style:{position:"absolute",bottom:6,right:8,fontSize:9,color:"rgba(255,255,255,0.7)",background:"rgba(0,0,0,0.55)",padding:"1px 6px",letterSpacing:"0.06em"},children:[u+1,"/",r.length]})]}),d.caption&&E.jsx("div",{style:{fontSize:9,color:"#4a6a7a",letterSpacing:"0.1em",padding:"4px 0 0",textTransform:"uppercase"},children:d.caption})]}),i&&E.jsx(BN,{images:r,startIdx:u,onClose:l})]})}function BN({images:r,startIdx:e,onClose:t}){const[n,i]=K.useState(e),s=r[n];return K.useEffect(()=>{const o=l=>{l.key==="Escape"&&t(),l.key==="ArrowLeft"&&i(u=>(u-1+r.length)%r.length),l.key==="ArrowRight"&&i(u=>(u+1)%r.length)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r.length,t]),FN.createPortal(E.jsx("div",{onClick:t,style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(3,8,16,0.94)",backdropFilter:"blur(10px)",display:"flex",alignItems:"center",justifyContent:"center"},children:E.jsxs("div",{onClick:o=>o.stopPropagation(),style:{position:"relative",maxWidth:"min(90vw, 960px)",maxHeight:"92vh",display:"flex",flexDirection:"column",alignItems:"center",gap:12},children:[E.jsx("button",{onClick:t,style:{position:"absolute",top:-36,right:0,background:"none",border:"none",color:"rgba(0,212,255,0.55)",cursor:"pointer",fontSize:18,padding:"4px 8px",pointerEvents:"auto"},children:"â"}),E.jsx("img",{src:s.url,alt:s.caption??"",style:{maxWidth:"100%",maxHeight:"78vh",objectFit:"contain",border:"1px solid rgba(0,212,255,0.13)"}}),s.caption&&E.jsx("div",{style:{fontSize:11,color:"#7a96a2",letterSpacing:"0.12em",textTransform:"uppercase",textAlign:"center"},children:s.caption}),r.length>1&&E.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[E.jsx("button",{onClick:()=>i(o=>(o-1+r.length)%r.length),style:{...jr,fontSize:18,padding:"6px 16px",pointerEvents:"auto"},children:"â¹"}
4792),E.jsxs("span",{style:{fontSize:10,color:"#4a6a7a",letterSpacing:"0.1em"},children:[n+1," / ",r.length]}),E.jsx("button",{onClick:()=>i(o=>(o+1)%r.length),style:{...jr,fontSize:18,padding:"6px 16px",pointerEvents:"auto"},children:"âº"})]})]})}),document.body)}function xw(r){return{position:"absolute",top:"50%",transform:"translateY(-50%)",[r==="left"?"left":"right"]:6,background:"rgba(3,8,16,0.72)",border:"1px solid rgba(0,212,255,0.22)",color:"#00D4FF",cursor:"pointer",fontSize:20,padding:"3px 9px",pointerEvents:"auto",lineHeight:1,zIndex:1}}function fc({title:r,defaultOpen:e=!0,children:t}){const[n,i]=K.useState(e);return E.jsxs("div",{children:[E.jsxs("div",{onClick:()=>i(s=>!s),style:{fontSize:9,letterSpacing:"0.18em",textTransform:"uppercase",color:"#4a6a7a",paddingTop:12,paddingBottom:7,borderTop:"1px solid rgba(0,212,255,0.08)",marginTop:4,cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",userSelect:"none"},children:[E.jsx("span",{children:r}),E.jsx("span",{style:{fontSize:7,letterSpacing:0,color:"#3a5060"},children:n?"â²":"â¼"})]}),n&&E.jsx("div",{children:t})]})}const Gx=["Publication","Prototype","Education","Workshop","Advisory","Hackathon","Public experience","Research"];function zN({station:r,customLinks:e,customNodes:t,configOpen:n,nodeExtras:i,onUpdateCustomNode:s,onUpdateNodeExtra:o,onSelectCargo:l,customSubdomains:u}){var O;const[d,p]=K.useState(Gx[0]),[m,v]=K.useState(""),[y,x]=K.useState(""),M=zp(r.id),S=i[r.id]??{},w=S.labelOverride??r.label,A=S.descriptionOverride??r.description,T=S.imageUrl,R=(O=S.images)!=null&&O.length?S.images:T?[{url:T}]:[],U=S.links??[],k=e.filter(j=>j.sourceId===r.id||j.targetId===r.id),N=S.customActivities??[],H=S.removedActivityIndices??[],F=(M==null?void 0:M.linkedSubdomainIds)??[],I=S.connectedDomainIds!==void 0?S.connectedDomainIds:F,W=[...$o.map(j=>({id:j.id,label:j.label,kind:"territory"})),...Fi.filter(j=>{var re;return(re=j.tags)==null?void 0:re.includes("subdomain")}).map(j=>({id:j.id,label:j.label,kind:"subdomain"})),...u.map(j=>({id:j.id,label:j.label,kind:"subdomain"}))].filter(j=>!I.includes(j.id)),X=j=>{o(r.id,{connectedDomainIds:I.filter(re=>re!==j)})},J=()=>{y&&(o(r.id,{connectedDomainIds:[...I,y]}),x(""))},oe=j=>{var ie;const re=$o.find(he=>he.id===j);if(re)return re.label;const ne=u.find(he=>he.id===j);return ne?ne.label:((ie=vo(j))==null?void 0:ie.label)??j},se=j=>$o.some(re=>re.id===j)?"Territory":"Domain",fe=I.map(j=>u.find(re=>re.id===j)??vo(j)).filter(j=>!!j),V=()=>{if(!m.trim())return;const j={id:`ca_${Date.now()}`,type:d,label:m.trim()};o(r.id,{customActivities:[...N,j]}),v("")},$=j=>{o(r.id,{customActivities:N.filter(re=>re.id!==j)})},Z=j=>{o(r.id,{removedActivityIndices:[...H,j]})};return E.jsxs(E.Fragment,{children:[E.jsx("div",{style:Bt.eyebrow,children:"Station"}),n?E.jsx(Z1,{label:w,description:A,imageUrl:T??"",images:S.images??[],links:U,onLabelChange:j=>{t.some(ne=>ne.id===r.id)?s(r.id,{label:j}):o(r.id,{labelOverride:j})},onDescChange:j=>{t.some(ne=>ne.id===r.id)?s(r.id,{description:j}):o(r.id,{descriptionOverride:j})},onExtraChange:j=>o(r.id,j)}):E.jsxs(E.Fragment,{children:[E.jsx("h2",{style:zu,children:w}),E.jsx("p",{style:{...Bt.body,marginBottom:14},children:A}),R.length>0&&E.jsx(Gp,{images:R}),U.length>0&&E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:14},children:U.map((j,re)=>E.jsxs("a",{href:j.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:11,color:"#00D4FF",textDecoration:"none",opacity:.85},children:[j.label||j.url," â"]},re))})]}),n&&E.jsx(fc,{title:"Connected Domains",defaultOpen:!1,children:n?E.jsxs("div",{style:{paddingBottom:10},children:[I.map(j=>E.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 0",borderBottom:"1px solid rgba(0,212,255,0.06)"},children:[E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1},children:[E.jsx("span",{style:{fontSize:8,letterSpacing:"0.14em",textTransform:"uppercase",color:"#4a6a7a"},children:se(j)}),E.jsx("span",{style:{fontSize:11,color:"#c8dde8"},children:oe(j)})]}),E.jsx("button",{onClick:()=>X(j),style:{background:"none",border:"none",color:"#3d5a68",cursor:"pointer",fontSize:14,padding:"0 4px",pointerEvents:"auto"},children:"Ã"})]},j)),I.length===0&&E.jsx("p",{style:{...Bt.body,fontSize:11,opacity:.45,margin:"4px 0 6px"},children:"No domains linked."}),W.length>0&&E.jsxs("div",{style:{display:"flex",gap:5,marginTop:8},children:[E.jsxs("select",{value:y,onChange:j=>x(j.target.value),style:{...Xx,flex:1,maxWidth:"none"},children:[E.jsx("option",{value:"",children:"â pick domain â"}),E.jsx("optgroup",{label:"Territories",children:$o.filter(j=>
4792!I.includes(j.id)).map(j=>E.jsx("option",{value:j.id,children:j.label},j.id))}),E.jsx("optgroup",{label:"Subdomains",children:[...Fi.filter(j=>{var re;return((re=j.tags)==null?void 0:re.includes("subdomain"))&&!I.includes(j.id)}),...u.filter(j=>!I.includes(j.id))].map(j=>E.jsx("option",{value:j.id,children:j.label},j.id))})]}),E.jsx("button",{onClick:J,disabled:!y,style:{...jr,color:"rgba(0,212,255,0.7)",borderColor:"rgba(0,212,255,0.2)",pointerEvents:"auto",opacity:y?1:.4,whiteSpace:"nowrap"},children:"+ Add"})]})]}):E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,paddingBottom:8},children:fe.map(j=>E.jsx(xE,{node:j},j.id))})}),n&&E.jsxs(fc,{title:"Cargo",defaultOpen:!0,children:[((M==null?void 0:M.activities)??[]).map((j,re)=>{if(H.includes(re))return null;const ne=i[`${r.id}_act_${re}`],ie=(ne==null?void 0:ne.labelOverride)??j.label,he=Vx[j.type]??"#8199a4";return E.jsxs("div",{style:jx,children:[E.jsxs("span",{onClick:()=>l({kind:"activity",stationId:r.id,actIdx:re}),style:{display:"contents",cursor:"pointer"},children:[E.jsx("span",{style:{...Wx,background:`${he}22`,color:he,borderColor:`${he}44`},children:j.type}),E.jsx("span",{style:{flex:1,fontSize:11,color:"#c8dde8",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ie}),E.jsx("span",{style:{fontSize:10,color:"#2a4a5a"},children:"âº"})]}),n&&E.jsx("button",{onClick:le=>{le.stopPropagation(),Z(re)},style:_w,title:"Remove",children:"Ã"})]},re)}),N.map(j=>{const re=Vx[j.type]??"#8199a4";return E.jsxs("div",{style:jx,children:[E.jsxs("span",{onClick:()=>l({kind:"customActivity",stationId:r.id,activityId:j.id}),style:{display:"contents",cursor:"pointer"},children:[E.jsx("span",{style:{...Wx,background:`${re}22`,color:re,borderColor:`${re}44`},children:j.type}),E.jsx("span",{style:{flex:1,fontSize:11,color:"#c8dde8",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j.label}),E.jsx("span",{style:{fontSize:10,color:"#2a4a5a"},children:"âº"})]}),E.jsx("button",{onClick:ne=>{ne.stopPropagation(),$(j.id)},style:_w,children:"Ã"})]},j.id)}),n&&E.jsxs("div",{style:{display:"flex",gap:5,marginTop:8,alignItems:"center"},children:[E.jsx("select",{value:d,onChange:j=>p(j.target.value),style:Xx,children:Gx.map(j=>E.jsx("option",{value:j,children:j},j))}),E.jsx("input",{value:m,onChange:j=>v(j.target.value),onKeyDown:j=>j.key==="Enter"&&V(),placeholder:"Titleâ¦",style:YN}),E.jsx("button",{onClick:V,style:qN,children:"+"})]})]}),k.length>0&&E.jsx(fc,{title:"Connections",defaultOpen:!0,children:E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,paddingBottom:8},children:k.map(j=>{const re=j.sourceId===r.id?j.targetId:j.sourceId,ne=zx(re,t,i);return E.jsxs("div",{children:[E.jsxs("div",{style:{fontSize:9,letterSpacing:"0.14em",textTransform:"uppercase",color:"#7ec8e8",marginBottom:4},children:["â ",ne]}),j.cargo.map((ie,he)=>E.jsx(XN,{cargo:ie},he))]},j.id)})})})]})}function Z1({label:r,description:e,imageUrl:t,images:n,links:i,onLabelChange:s,onDescChange:o,onExtraChange:l}){const[u,d]=K.useState(""),[p,m]=K.useState(""),v=(A,T,R)=>{const U=[...i];U[A]={...U[A],[T]:R},l({links:U})},y=()=>l({links:[...i,{label:"",url:""}]}),x=A=>l({links:i.filter((T,R)=>R!==A)}),M=()=>{u.trim()&&(l({images:[...n,{url:u.trim(),caption:p.trim()||void 0}]}),d(""),m(""))},S=A=>l({images:n.filter((T,R)=>R!==A)}),w=(A,T)=>{const R=[...n];R[A]={...R[A],...T,caption:(T.caption??R[A].caption)||void 0},l({images:R})};return E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:7,marginBottom:14},children:[E.jsx("input",{value:r,onChange:A=>s(A.target.value),placeholder:"Title",style:Ei}),E.jsx("textarea",{value:e,onChange:A=>o(A.target.value),placeholder:"Blurbâ¦",style:{...Ei,resize:"vertical",minHeight:60}}),E.jsx("input",{value:t,onChange:A=>l({imageUrl:A.target.value||void 0}),placeholder:"Image URL (single)",style:Ei}),E.jsx("div",{style:{fontSize:8,letterSpacing:"0.18em",textTransform:"uppercase",color:"#4a6a7a",marginTop:4},children:"Gallery"}),n.map((A,T)=>E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,padding:"5px 7px",background:"rgba(0,212,255,0.03)",border:"1px solid rgba(0,212,255,0.08)"},children:[E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[E.jsxs("span",{style:{fontSize:8,letterSpacing:"0.1em",color:"#4a6a7a",flex:1},children:["Image ",T+1]}),E.jsx("button",{onClick:()=>S(T),style:{background:"none",border:"none",color:"#3d5a68",cursor:"pointer",fontSize:12,padding:"0 2px",pointerEvents:"auto"},children:"Ã"})]}),E.jsx("input",{value:A.url,onChange:R=>w(T,{url:R.target.value}),placeholder:"Image URL",style:{...Ei,fontSize:10}}),E.jsx("input",{value:A.caption??"",onChange:R=>w(T,{caption:R.target.value}),placeholder:"Caption (optional)",style:{...Ei,fontSize:10}})]},T)),E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"5px 7px",background:"rgba(0,212,255,0.02)",border:"1px dashed rgba(0,212,255,0.1)"},children:[E.jsx("input",{value:u,onChange:A=>d(A.target.value),placeholder:"Image URL",style:{...Ei,fontSize:10}}),E.jsx("input",{value:p,onChange:A=>m(A.target.value),placeholder:"Caption (optional)",style:{...Ei,fontSize:10}}),E.jsx("button",{onClick:M,disabled:!u.trim(),style:{...jr,color:"rgba(0,212,255,0.7)",borderColor:"rgba(0,212,255,0.2)",opacity:u.trim()?1:.4,pointerEvents:"auto"},children:"+ Add Image"})]}),i.map((A,T)=>E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"6px 8px",background:"rgba(0,212,255,0.03)",border:"1px solid rgba(0,212,255,0.08)"},children:[E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[E.jsxs("span",{style:{fontSize:8,letterSpacing:"0.12em",textTransform:"uppercase",color:"#4a6a7a",flex:1},children:["Link ",T+1]}),E.jsx("button",{onClick:()=>x(T),style:{background:"none",border:"none",color:"#3d5a68",cursor:"pointer",fontSize:12,padding:"0 2px",pointerEvents:"auto"},children:"Ã"})]}),E.jsx("input",{value:A.label,onChange:R=>v(T,"label",R.target.value),placeholder:"Label",style:Ei}),E.jsx("input",{value:A.url,onChange:R=>v(T,"url",R.target.value),placeholder:"URL",style:Ei})]},T)),E.jsx("button",{onClick:y,style:{...jr,color:"rgba(0,212,255,0.7)",borderColor:"rgba(0,212,255,0.2)",pointerEvents:"auto"},children:"+ Add Link"}),t&&!n.length&&E.jsx("img",{src:t,alt:"",style:{width:"100%",maxHeight:120,objectFit:"cover",opacity:.85}})]})}function HN({linkId:r,customLinks:e,customNodes:t,nodeExtras:n,onDetachCargo:i,onDeleteLink:s,onDeselectLink:o,onAddCargoToLink:l}){const u=e.find(R=>R.id===r),[d,p]=K.useState(""),[m,v]=K.useState(""),[y,x]=K.useState(""),[M,S]=K.useState(!1);if(!u)return E.jsxs(E.Fragment,{children:[E.jsx("div",{style:Bt.eyebrow,children:"Connection"}),E.jsx("p",{style:{...Bt.body,opacity:.5},children:"Connection not found."}),E.jsx("button",{onClick:o,style:{...jr,marginTop:8,pointerEvents:"auto"},children:"â Back"})]});const w=zx(u.sourceId,t,n),A=zx(u.targetId,t,n),T=()=>{!d||!m||(l(r,{type:d,blurb:m,...y?{url:y}:{}}),p(""),v(""),x(""),S(!1))};return E.jsxs(E.Fragment,{children:[E.jsx("div",{style:Bt.eyebrow,children:"Connection"}),E.jsxs("div",{style:{fontSize:13,color:"#c8dde8",marginBottom:14,lineHeight:1.4},children:[E.jsx("span",{style:{color:"#FFB700"},children:w}),E.jsx("span",{style:{color:"#4a6a7a",margin:"0 7px"},children:"â"}),E.jsx("span",{style:{color:"#FFB700"},children:A})]}),u.cargo.length===0&&E.jsx("p",{style:{...Bt.body,opacity:.5,marginBottom:10},children:"No cargo yet."}),u.cargo.map((R,U)=>E.jsxs("div",{style:{...Vp,marginBottom:4,position:"relative"},children:[E.jsx("span",{style:{...Lu,color:"#7ec8e8",borderColor:"rgba(126,200,232,0.18)"},children:R.type}),E.jsx("span",{style:{fontSize:11,color:"#c8dde8"},children:R.blurb}),R.url&&E.jsxs("a",{href:R.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:10,
4792color:"#00D4FF",textDecoration:"none"},children:[R.url," â"]}),E.jsx("button",{onClick:()=>i(r,U),style:{position:"absolute",top:4,right:6,background:"none",border:"none",color:"#3d5a68",cursor:"pointer",fontSize:12,padding:0,pointerEvents:"auto"},title:"Remove cargo",children:"Ã"})]},U)),M?E.jsxs("div",{style:{marginTop:8,display:"flex",flexDirection:"column",gap:5},children:[E.jsx("input",{placeholder:"Cargo type",value:d,onChange:R=>p(R.target.value),style:Ei}),E.jsx("textarea",{placeholder:"Blurbâ¦",value:m,onChange:R=>v(R.target.value),style:{...Ei,resize:"vertical",minHeight:48}}),E.jsx("input",{placeholder:"URL (optional)",value:y,onChange:R=>x(R.target.value),style:Ei}),E.jsxs("div",{style:{display:"flex",gap:5},children:[E.jsx("button",{onClick:T,disabled:!d||!m,style:{...jr,flex:1,color:"#00D4FF",borderColor:"rgba(0,212,255,0.25)",opacity:d&&m?1:.4,pointerEvents:"auto"},children:"Add"}),E.jsx("button",{onClick:()=>S(!1),style:{...jr,flex:1,pointerEvents:"auto"},children:"Cancel"})]})]}):E.jsx("button",{onClick:()=>S(!0),style:{...jr,marginTop:8,color:"#7ec8e8",borderColor:"rgba(126,200,232,0.25)",pointerEvents:"auto"},children:"+ Add Cargo"}),E.jsx("div",{style:{...Bt.divider,margin:"14px 0"}}),E.jsxs("div",{style:{display:"flex",gap:6},children:[E.jsx("button",{onClick:o,style:{...jr,flex:1,pointerEvents:"auto"},children:"â Back"}),E.jsx("button",{onClick:()=>s(r),style:{...jr,flex:1,color:"#ff668c",borderColor:"rgba(255,102,140,0.3)",pointerEvents:"auto"},children:"Delete Connection"})]})]})}function GN({node:r,configOpen:e,nodeExtras:t,onUpdateNodeExtra:n,customSubdomains:i,removedSubdomainIds:s,onAddSubdomain:o,onRemoveSubdomain:l,customNodes:u,highlightedStationId:d,onHighlightStation:p}){var fe;const[m,v]=K.useState(""),[y,x]=K.useState(""),M=rn[r.id]??"#8199a4",S=t[r.id]??{},w=S.labelOverride??r.label,A=S.descriptionOverride??r.description,T=S.imageUrl??"",R=(fe=S.images)!=null&&fe.length?S.images:T?[{url:T}]:[],U=S.links??[],k=Hp(r.id),N=new Set(k.map(V=>V.id)),H=[...k.filter(V=>!s.has(V.id)),...i.filter(V=>V.parentId===r.id)],F=Fi.filter(V=>{var $;return($=V.tags)!=null&&$.includes("station")?Sp.some(Z=>Z.source===V.id&&(Z.target===r.id||N.has(Z.target))):!1}),I=S.connectedStationIds!==void 0?S.connectedStationIds:F.map(V=>V.id),G=V=>{var O,j;const $=(O=t[V])==null?void 0:O.labelOverride;if($)return $;const Z=u.find(re=>re.id===V);return Z?Z.label:((j=vo(V))==null?void 0:j.label)??V},X=[...Fi.filter(V=>{var $;return($=V.tags)==null?void 0:$.includes("station")}),...u.filter(V=>{var $;return($=V.tags)==null?void 0:$.includes("station")})].filter(V=>!I.includes(V.id)),J=V=>{n(r.id,{connectedStationIds:I.filter($=>$!==V)})},oe=()=>{y&&(n(r.id,{connectedStationIds:[...I,y]}),x(""))},se=I.map(V=>u.find($=>$.id===V)??vo(V)).filter(V=>!!V);return E.jsxs(E.Fragment,{children:[E.jsx("div",{style:{...Bt.eyebrow,color:M},children:"Territory"}),e?E.jsx(Z1,{label:w,description:A,imageUrl:T,images:S.images??[],links:U,onLabelChange:V=>n(r.id,{labelOverride:V}),onDescChange:V=>n(r.id,{descriptionOverride:V}),onExtraChange:V=>n(r.id,V)}):E.jsxs(E.Fragment,{children:[E.jsx("h2",{style:{...zu,color:M},children:w}),E.jsx("p",{style:{...Bt.body,marginBottom:14},children:A}),R.length>0&&E.jsx(Gp,{images:R}),U.length>0&&E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:14},children:U.map((V,$)=>E.jsxs("a",{href:V.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:11,color:"#00D4FF",textDecoration:"none",opacity:.85},children:[V.label||V.url," â"]},$))})]}),(H.length>0||e)&&E.jsx(fc,{title:"Subdomains",defaultOpen:!0,children:e?E.jsxs("div",{style:{paddingBottom:10},children:[H.map(V=>E.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 0",borderBottom:"1px solid rgba(0,212,255,0.06)"},children:[E.jsx("span",{style:{fontSize:11,color:"#c8dde8",fontFamily:'var(--subdomain-font, "Inter", sans-serif)'},children:V.label}),E.jsx("button",{onClick:()=>l(V.id,!i.some($=>$.id===V.id)),style:{background:"none",border:"none",color:"#3d5a68",cursor:"pointer",fontSize:14,padding:"0 4px",pointerEvents:"auto"},children:"Ã"})]},V.id)),E.jsxs("div",{style:{display:"flex",gap:5,marginTop:8},children:[E.jsx("input",{value:m,onChange:V=>v(V.target.value),placeholder:"Subdomain name",style:{...Ei,flex:1}}),E.jsx("button",{onClick:()=>{m.trim()&&(o(r.id,m.trim()),v(""))},style:{...jr,color:"rgba(0,212,255,0.7)",borderColor:"rgba(0,212,255,0.2)",pointerEvents:"auto",whiteSpace:"nowrap"},children:"+ Add"})]})]}):E.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:5,paddingBottom:10},children:H.map(V=>E.jsx("span",{style:{padding:"3px 8px",border:`1px solid ${M}44`,borderRadius:4,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:M,opacity:.85,fontFamily:'var(--subdomain-font, "Inter", sans-serif)'},children:V.label},V.id))})}),e&&E.jsx(fc,{title:"Connect Stations",defaultOpen:!0,children:e?E.jsxs("div",{style:{paddingBottom:10},children:[I.map(V=>E.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 0",borderBottom:"1px solid rgba(0,212,255,0.06)"},children:[E.jsx("span",{style:{fontSize:11,color:"#c8dde8"},children:G(V)}),E.jsx("button",{onClick:()=>J(V),style:{background:"none",border:"none",color:"#3d5a68",cursor:"pointer",fontSize:14,padding:"0 4px",pointerEvents:"auto"},children:"Ã"})]},V)),I.length===0&&E.jsx("p",{style:{...Bt.body,fontSize:11,opacity:.45,margin:"4px 0 6px"},children:"No stations linked."}),X.length>0&&E.jsxs("div",{style:{display:"flex",gap:5,marginTop:8},children:[E.jsxs("select",{value:y,onChange:V=>x(V.target.value),style:{...Xx,flex:1,maxWidth:"none"},children:[E.jsx("option",{value:"",children:"â pick station â"}),X.map(V=>{var $;return E.jsx("option",{value:V.id,children:(($=t[V.id])==null?void 0:$.labelOverride)??
4792V.label},V.id)})]}),E.jsx("button",{onClick:oe,disabled:!y,style:{...jr,color:"rgba(0,212,255,0.7)",borderColor:"rgba(0,212,255,0.2)",pointerEvents:"auto",opacity:y?1:.4,whiteSpace:"nowrap"},children:"+ Add"})]})]}):E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3,paddingBottom:8},children:se.map(V=>{var O;const $=d===V.id,Z=((O=t[V.id])==null?void 0:O.labelOverride)??V.label;return E.jsxs("div",{onClick:()=>p($?null:V.id),style:{...jx,border:$?"1px solid rgba(0,212,255,0.45)":"1px solid rgba(34,57,70,0.6)",background:$?"rgba(0,212,255,0.07)":"rgba(7,17,26,0.55)"},children:[E.jsx("span",{style:{...Wx,background:"rgba(200,238,255,0.08)",color:"#c8eeff",borderColor:"rgba(200,238,255,0.18)"},children:"Station"}),E.jsx("span",{style:{flex:1,fontSize:11,color:"#c8dde8",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Z}),E.jsx("span",{style:{fontSize:10,color:$?"#00D4FF":"#2a4a5a"},children:$?"â":"âº"})]},V.id)})})})]})}function VN({node:r,configOpen:e,nodeExtras:t,onUpdateNodeExtra:n}){var y;
4792const i=r.parentId?vo(r.parentId):null,s=rn[r.parentId??""]??"#FFB700",o=t[r.id]??{},l=o.labelOverride??r.label,u=o.descriptionOverride??r.description,d=o.imageUrl??"",p=(y=o.images)!=null&&y.length?o.images:d?[{url:d}]:[],m=o.links??[],v=Fi.filter(x=>{var M;return(M=x.tags)!=null&&M.includes("station")?Sp.some(S=>S.source===x.id&&S.target===r.id):!1});return E.jsxs(E.Fragment,{children:[E.jsx("div",{style:{...Bt.eyebrow,color:"#FFB700"},children:"Subdomain"}),e?E.jsx(Z1,{label:l,description:u,imageUrl:d,images:o.images??[],links:m,onLabelChange:x=>n(r.id,{labelOverride:x}),onDescChange:x=>n(r.id,{descriptionOverride:x}),onExtraChange:x=>n(r.id,x)}):E.jsxs(E.Fragment,{children:[E.jsx("h2",{style:{...zu,color:"#FFB700"},children:l}),E.jsx("p",{style:{...Bt.body,marginBottom:14},children:u}),p.length>0&&E.jsx(Gp,{images:p}),m.length>0&&E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:14},children:m.map((x,M)=>E.jsxs("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:11,color:"#00D4FF",textDecoration:"none",opacity:.85},children:[x.label||x.url," â"]},M))})]}),e&&i&&E.jsx(fc,{title:"Parent Territory",defaultOpen:!0,children:E.jsxs("div",{style:{...Vp,borderColor:`${s}44`,marginBottom:10},children:[E.jsx("span",{style:{...Lu,color:s},children:"Territory"}),i.label]})}),e&&E.jsx(fc,{title:"Connected Stations",defaultOpen:!0,children:E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,paddingBottom:8},children:v.length>0?v.map(x=>E.jsx(xE,{node:x},x.id)):E.jsx("p",{style:{...Bt.body,fontSize:11,opacity:.55},children:"No direct station link."})})})]})}function jN({cargo:r,nodeExtras:e,customSubdomains:t,customLinks:n,configOpen:i,onUpdateNodeExtra:s,onDeselectCargo:o}){var v;if(r.kind==="activity"){const y=zp(r.stationId),x=y==null?void 0:y.activities[r.actIdx];if(!x)return E.jsx("p",{style:{...Bt.body,opacity:.5},children:"Not found."});const M=`${r.stationId}_act_${r.actIdx}`,S=e[M]??{},w=S.links??[];return E.jsx(sx,{configOpen:i,type:x.type,title:S.labelOverride??x.label,blurb:S.descriptionOverride??"",imageUrl:S.imageUrl??"",images:S.images??[],links:w,onTitleChange:A=>s(M,{labelOverride:A}),onBlurbChange:A=>s(M,{descriptionOverride:A}),onImageChange:A=>s(M,{imageUrl:A}),onImagesChange:A=>s(M,{images:A}),onLinksChange:A=>s(M,{links:A}),onBack:o})}if(r.kind==="customActivity"){const y=((v=e[r.stationId])==null?void 0:v.customActivities)??[],x=y.find(S=>S.id===r.activityId);if(!x)return E.jsx("p",{style:{...Bt.body,opacity:.5},children:"Not found."});const M=S=>{const w=y.map(A=>A.id===x.id?{...A,...S}:A);s(r.stationId,{customActivities:w})};return E.jsx(sx,{configOpen:i,type:x.type,title:x.label,blurb:x.blurb??"",imageUrl:x.imageUrl??"",images:x.images??[],links:x.links??[],onTypeChange:i?S=>M({type:S}):void 0,onTitleChange:S=>M({label:S}),onBlurbChange:S=>M({blurb:S}),onImageChange:S=>M({imageUrl:S}),onImagesChange:S=>M({images:S}),onLinksChange:S=>M({links:S}),onBack:o})}const l=n.find(y=>y.id===r.linkId),u=l==null?void 0:l.cargo[r.cargoIdx];if(!u)return E.jsx("p",{style:{...Bt.body,opacity:.5},children:"Not found."});const d=`cl_${r.linkId}_${r.cargoIdx}`,p=e[d]??{},m=p.links??[];return E.jsx(sx,{configOpen:i,type:u.type,title:p.labelOverride??u.blurb,blurb:p.descriptionOverride??"",imageUrl:p.imageUrl??"",images:p.images??[],links:m,onTitleChange:y=>s(d,{labelOverride:y}),onBlurbChange:y=>s(d,{descriptionOverride:y}),onImageChange:y=>s(d,{imageUrl:y}),onImagesChange:y=>s(d,{images:y}),onLinksChange:y=>s(d,{links:y}),onBack:o})}function sx({configOpen:r,type:e,title:t,blurb:n,imageUrl:i,images:s,links:o,onTypeChange:l,onTitleChange:u,onBlurbChange:d,onImageChange:p,onImagesChange:m,onLinksChange:v,onBack:y}){const[x,M]=K.useState(""),[S,w]=K.useState(""),[A,T]=K.useState(""),[R,U]=K.useState(""),k=Vx[e]??"#8199a4",N=()=>{S.trim()&&(v([...o,{label:x.trim(),url:S.trim()}]),M(""),w(""))},H=X=>v(o.filter((J,oe)=>oe!==X)),F=()=>{A.trim()&&(m([...s,{url:A.trim(),caption:R.trim()||void 0}]),T(""),U(""))},I=X=>m(s.filter((J,oe)=>oe!==X)),G=(X,J)=>{const oe=[...s];oe[X]={...oe[X],...J,caption:(J.caption??oe[X].caption)||void 0},m(oe)},W=s.length?s:i?[{url:i}]:[];return r?E.jsxs(E.Fragment,{children:[E.jsx("div",{style:Bt.eyebrow,children:"Cargo"}),l?E.jsxs("div",{style:{marginBottom:8},children:[E.jsx("div",{style:ef,children:"Type"}
4792),E.jsx("select",{value:e,onChange:X=>l(X.target.value),style:{...Ei,cursor:"pointer"},children:Gx.map(X=>E.jsx("option",{value:X,children:X},X))})]}):E.jsx("span",{style:{...Lu,display:"inline-block",marginBottom:12,color:k,borderColor:`${k}33`,padding:"2px 7px"},children:e}),E.jsxs("div",{style:{marginBottom:8},children:[E.jsx("div",{style:{...ef},children:"Title"}),E.jsx("input",{value:t,onChange:X=>u(X.target.value),style:Ei,placeholder:"Titleâ¦"})]}),E.jsxs("div",{style:{marginBottom:8},children:[E.jsx("div",{style:ef,children:"Blurb"}),E.jsx("textarea",{value:n,onChange:X=>d(X.target.value),style:{...Ei,resize:"vertical",minHeight:64},placeholder:"Blurbâ¦"})]}),E.jsxs("div",{style:{marginBottom:8},children:[E.jsx("div",{style:ef,children:"Image URL (single)"}),E.jsx("input",{value:i,onChange:X=>p(X.target.value),style:Ei,placeholder:"https://â¦"}),i&&!s.length&&E.jsx("img",{src:i,alt:"",style:{width:"100%",maxHeight:100,objectFit:"cover",marginTop:6,opacity:.85}})]}),E.jsxs("div",{style:{marginBottom:12},children:[E.jsx("div",{style:ef,children:"Gallery"}),s.map((X,J)=>E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,padding:"5px 7px",marginBottom:4,background:"rgba(0,212,255,0.03)",border:"1px solid rgba(0,212,255,0.08)"},children:[E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[E.jsxs("span",{style:{fontSize:8,color:"#4a6a7a",flex:1},children:["Image ",J+1]}),E.jsx("button",{onClick:()=>I(J),style:{background:"none",border:"none",color:"#3d5a68",cursor:"pointer",fontSize:12,padding:"0 2px",pointerEvents:"auto"},children:"Ã"})]}),E.jsx("input",{value:X.url,onChange:oe=>G(J,{url:oe.target.value}),placeholder:"Image URL",style:{...Ei,fontSize:10}}),E.jsx("input",{value:X.caption??"",onChange:oe=>G(J,{caption:oe.target.value}),placeholder:"Caption (optional)",style:{...Ei,fontSize:10}})]},J)),E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"5px 7px",background:"rgba(0,212,255,0.02)",border:"1px dashed rgba(0,212,255,0.1)"},children:[E.jsx("input",{value:A,onChange:X=>T(X.target.value),placeholder:"Image URL",style:{...Ei,fontSize:10}}),E.jsx("input",{value:R,onChange:X=>U(X.target.value),placeholder:"Caption (optional)",style:{...Ei,fontSize:10}}),E.jsx("button",{onClick:F,disabled:!A.trim(),style:{...jr,color:"rgba(0,212,255,0.7)",borderColor:"rgba(0,212,255,0.2)",opacity:A.trim()?1:.4,pointerEvents:"auto"},children:"+ Add Image"})]})]}),E.jsxs("div",{style:{marginBottom:10},children:[E.jsx("div",{style:ef,children:"Links"}),o.length>0&&E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:6},children:o.map((X,J)=>E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[E.jsxs("a",{href:X.url,target:"_blank",rel:"noopener noreferrer",style:{flex:1,fontSize:10,color:"#00D4FF",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[X.label||X.url," â"]}),E.jsx("button",{onClick:()=>H(J),style:{...jr,padding:"2px 6px",color:"#ff668c",borderColor:"rgba(255,102,140,0.3)",flexShrink:0,pointerEvents:"auto"},children:"Ã"})]},J))}),E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[E.jsx("input",{value:x,onChange:X=>M(X.target.value),style:Ei,placeholder:"Label (optional)"}),E.jsx("input",{value:S,onChange:X=>w(X.target.value),style:Ei,placeholder:"URL"}),E.jsx("button",{onClick:N,disabled:!S.trim(),style:{...jr,color:"#00D4FF",borderColor:"rgba(0,212,255,0.25)",opacity:S.trim()?1:.4,pointerEvents:"auto"},children:"+ Add Link"})]})]}),E.jsx("button",{onClick:y,style:{...jr,pointerEvents:"auto"},children:"â Back"})]}):E.jsxs(E.Fragment,{children:[E.jsx("div",{style:Bt.eyebrow,children:"Cargo"}),E.jsx("span",{style:{...Lu,display:"inline-block",marginBottom:10,color:k,borderColor:`${k}33`,padding:"2px 7px"},children:e}),E.jsx("h3",{style:{...zu,fontSize:15,margin:"0 0 8px"},children:t}),n&&E.jsx("p",{style:{...Bt.body,marginBottom:12},children:n}),W.length>0&&E.jsx(Gp,{images:W}),o.length>0&&E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5,marginBottom:12},children:o.map((X,J)=>E.jsxs("a",{href:X.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:11,color:"#00D4FF",textDecoration:"none",opacity:.85},children:[X.label||X.url," â"]},J))})]})}function WN({route:r,revealedIds:e,customNodes:t,nodeExtras:n,onJumpToStep:i}){const s=r.nodeIds.filter(d=>e.has(d)).length,o=r.nodeIds.length,[l,u]=K.useState(null);return E.jsxs(E.Fragment,{children:[E.jsx("div",{style:Bt.eyebrow,children:"Question Route"}),E.jsx("h2",{style:zu,children:r.label}),E.jsx("p",{style:{...Bt.body,marginBottom:14},children:r.description}),E.jsx(fc,{title:`Sequence · ${s} / ${o}`,defaultOpen:!1,children:E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,paddingTop:4},children:r.nodeIds.map((d,p)=>{var w,A,T;const m=vo(d)??t.find(R=>R.id===d),v=((w=n[d])==null?void 0:w.labelOverride)??(m==null?void 0:m.label)??d;if(!m&&!v)return null;const y=e.has(d),x=(A=m==null?void 0:m.tags)!=null&&A.includes("territory")?"Territory":(T=m==null?void 0:m.tags)!=null&&T.includes("station")?"Station":"Domain",M=!!i,S=l===p;return E.jsxs("div",{onClick:M?()=>i(p):void 0,onMouseEnter:M?()=>u(p):void 0,onMouseLeave:M?()=>u(null):void 0,style:{...Vp,opacity:y?1:.28,transition:"opacity 0.4s, border-color 0.15s, background 0.15s",cursor:M?"pointer":"default",borderColor:S?"rgba(0,212,255,0.4)":"rgba(34,57,70,0.65)",background:S?"rgba(0,212,255,0.06)":"rgba(7,17,26,0.55)",flexDirection:"row",alignItems:"center",gap:8},children:[E.jsx("span",{style:{fontSize:9,color:y?"rgba(0,212,255,0.6)":"rgba(0,212,255,0.2)",fontVariantNumeric:"tabular-nums",minWidth:16,flexShrink:0,letterSpacing:"0.06em"},children:p+1}),E.jsx("span",{style:{...Lu,display:"inline-block",borderBottom:"none",paddingBottom:0,marginBottom:0,padding:"1px 4px",border:"1px solid rgba(34,57,70,0.45)",background:"rgba(7,17,26,0.4)",flexShrink:0},children:x}),E.jsx("span",{style:{flex:1,fontSize:11,color:"#c8dde8",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v}),M&&E.jsx("span",{style:{fontSize:11,color:S?"rgba(0,212,255,0.8)":"rgba(0,212,255,0.2)",flexShrink:0},children:"â¶"})]},d)})})})]})}function xE({node:r}){var t,n;const e=(t=r.tags)!=null&&t.includes("territory")?"Territory":(n=r.tags)!=null&&n.includes("station")?"Station":"Domain";return E.jsxs("div",{style:Vp,children:[E.jsx("span",{style:Lu,children:e}),r.label]})}function XN({cargo:r}){return E.jsxs("div",{style:{...Vp,marginBottom:3},children:[E.jsx("span",{style:{...Lu,color:"#7ec8e8",borderColor:"rgba(126,200,232,0.18)"},children:r.type}),E.jsx("span",{style:{fontSize:11,color:"#c8dde8"},children:r.blurb}),r.url&&E.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:10,
4792color:"#00D4FF",marginTop:2,textDecoration:"none",opacity:.85},children:[r.url," â"]})]})}const Vx={Publication:"#00D4FF",Prototype:"#FFB700",Education:"#5cffb0",Workshop:"#b690ff",Advisory:"#ff7d3d",Hackathon:"#ff668c","Public experience":"#7ec8e8",Research:"#a0e0ff"},zu={fontSize:20,fontWeight:700,letterSpacing:"0.04em",color:"#e9fbff",margin:"4px 0 10px",lineHeight:1.1,fontFamily:'var(--territory-font, "Inter", sans-serif)'},Vp={padding:"7px 10px",background:"rgba(7,17,26,0.55)",border:"1px solid rgba(34,57,70,0.65)",color:"#c8dde8",fontSize:12,display:"flex",flexDirection:"column",gap:2},Lu={display:"block",color:"#4a6a7a",fontSize:9,letterSpacing:"0.16em",textTransform:"uppercase",borderBottom:"1px solid rgba(34,57,70,0.4)",paddingBottom:3,marginBottom:2},ef={fontSize:8,letterSpacing:"0.18em",textTransform:"uppercase",color:"#4a6a7a",marginBottom:4},Ei={background:"rgba(7,17,26,0.7)",border:"1px solid rgba(34,57,70,0.8)",color:"#c8dde8",fontSize:11,padding:"6px 8px",fontFamily:'Inter, "Segoe UI", sans-serif',outline:"none",width:"100%",boxSizing:"border-box"},jr={padding:"5px 10px",background:"rgba(7,17,26,0.6)",border:"1px solid rgba(34,57,70,0.7)",color:"#7a96a2",cursor:"pointer",fontSize:9,letterSpacing:"0.14em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif'},jx={display:"flex",alignItems:"center",gap:6,padding:"5px 8px",marginBottom:3,background:"rgba(7,17,26,0.55)",border:"1px solid rgba(34,57,70,0.6)",cursor:"pointer",transition:"border-color 0.15s, background 0.15s"},Wx={fontSize:8,letterSpacing:"0.12em",textTransform:"uppercase",padding:"2px 5px",border:"1px solid transparent",flexShrink:0},_w={background:"none",border:"none",color:"#ff668c",cursor:"pointer",fontSize:14,padding:"0 2px",lineHeight:1,flexShrink:0},Xx={background:"rgba(7,17,26,0.7)",border:"1px solid rgba(34,57,70,0.8)",color:"#c8dde8",fontSize:9,padding:"5px 5px",fontFamily:'Inter, "Segoe UI", sans-serif',outline:"none",flexShrink:0,maxWidth:100},YN={flex:1,background:"rgba(7,17,26,0.7)",border:"1px solid rgba(34,57,70,0.8)",color:"#c8dde8",fontSize:10,padding:"5px 7px",fontFamily:'Inter, "Segoe UI", sans-serif',outline:"none",minWidth:0},qN={padding:"5px 10px",background:"rgba(0,212,255,0.08)",border:"1px solid rgba(0,212,255,0.25)",color:"#00D4FF",cursor:"pointer",fontSize:13,fontFamily:'Inter, "Segoe UI", sans-serif',flexShrink:0};function KN({activeTab:r,onTabToggle:e}){return E.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,minHeight:60,paddingBottom:"env(safe-area-inset-bottom)",display:"flex",alignItems:"center",justifyContent:"center",gap:48,background:"rgba(3,8,16,0.94)",backdropFilter:"blur(16px)",borderTop:"1px solid rgba(0,212,255,0.12)",pointerEvents:"auto",zIndex:30,fontFamily:'Inter, "Segoe UI", sans-serif'},children:[E.jsx(Sw,{label:"About",active:r==="about",onClick:()=>e("about"),children:E.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",children:[E.jsx("circle",{cx:12,cy:7,r:4}),E.jsx("path",{d:"M4 21c0-4.42 3.58-8 8-8s8 3.58 8 8"})]})}),E.jsx(Sw,{label:"Routes",active:r==="routes",onClick:()=>e("routes"),children:E.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",children:[E.jsx("circle",{cx:12,cy:12,r:9}),E.jsx("path",{d:"M12 3v3M12 18v3M3 12h3M18 12h3"}),E.jsx("circle",{cx:12,cy:12,r:2.5,fill:"currentColor"})]})})]})}function Sw({label:r,active:e,onClick:t,children:n}){return E.jsxs("button",{onClick:t,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer",color:e?"#00D4FF":"rgba(0,212,255,0.35)",padding:"6px 14px",transition:"color 0.18s"},children:[n,E.jsx("span",{style:{fontSize:7,letterSpacing:"0.22em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif'},children:r})]})}function ZN({activeTab:r,aboutText:e,customRoutes:t,activeRouteId:n,themes:i,activeThemeId:s,onClose:o,onRouteClick:l,onThemeClick:u}){return r?E.jsxs(E.Fragment,{children:[E.jsx("div",{onClick:o,style:{position:"absolute",inset:0,zIndex:31,background:"rgba(3,8,16,0.55)"}}),E.jsxs("div",{style:{position:"absolute",bottom:60,left:"50%",transform:"translateX(-50%)",width:"min(calc(100vw - 24px), 380px)",maxHeight:"calc(70vh - 60px)",zIndex:32,background:"rgba(3,8,16,0.97)",backdropFilter:"blur(18px)",border:"1px solid rgba(0,212,255,0.16)",display:"flex",flexDirection:"column",fontFamily:'Inter, "Segoe UI", sans-serif'},children:[E.jsx(J1,{}),E.jsxs("div",{style:{padding:"12px 16px 10px",borderBottom:"1px solid rgba(0,212,255,0.08)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[E.jsx("span",{style:{fontSize:9,letterSpacing:"0.22em",textTransform:"uppercase",color:"#00D4FF"},children:r==="about"?"About":"Routes"}),E.jsx("button",{onClick:o,style:{background:"none",border:"none",color:"rgba(0,212,255,0.4)",cursor:"pointer",fontSize:16,lineHeight:1,padding:"2px 4px",pointerEvents:"auto"},children:"â"})]}),E.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"14px 16px 16px",scrollbarWidth:"thin",scrollbarColor:"rgba(0,212,255,0.25) transparent"},children:[r==="about"&&E.jsx("p",{style:{fontSize:13,color:"rgba(168,189,198,0.88)",lineHeight:1.75,margin:0},children:e}),r==="routes"&&E.jsx(JN,{customRoutes:t,activeRouteId:n,themes:i,activeThemeId:s,onRouteClick:l,onThemeClick:u})]})]})]}):null}function JN({customRoutes:r,activeRouteId:e,themes:t,activeThemeId:n,onRouteClick:i,onThemeClick:s}){return E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:18},children:[r.length>0&&E.jsxs("div",{children:[E.jsx("div",{style:bw,children:"Question Routes"}),E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:r.map(o=>{const l=e===o.id;return E.jsxs("button",{onClick:()=>i(o),style:{width:"100%",textAlign:"left",padding:"12px 14px",background:l?"rgba(0,212,255,0.09)":"rgba(7,17,26,0.6)",border:`1px solid ${l?"rgba(0,212,255,0.35)":"rgba(34,57,70,0.65)"}`,color:l?"#00D4FF":"#c0d6e0",cursor:"pointer",fontSize:13,lineHeight:1.4,fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto",boxShadow:l?"0 0 14px rgba(0,212,255,0.1)":"none"},children:[o.label,o.description&&E.jsx("span",{style:{display:"block",fontSize:10,
4792color:l?"rgba(0,212,255,0.55)":"rgba(168,189,198,0.45)",marginTop:3,lineHeight:1.4},children:o.description})]},o.id)})})]}),t.length>0&&E.jsxs("div",{children:[E.jsx("div",{style:bw,children:"Themes"}),E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:t.map(o=>{const l=n===o.id;return E.jsxs("button",{onClick:()=>s(o.id),style:{width:"100%",textAlign:"left",padding:"12px 14px",background:l?"rgba(255,183,0,0.09)":"rgba(7,17,26,0.6)",border:`1px solid ${l?"rgba(255,183,0,0.35)":"rgba(34,57,70,0.65)"}`,color:l?"#FFB700":"#c0d6e0",cursor:"pointer",fontSize:13,fontFamily:'Inter, "Segoe UI", sans-serif',display:"flex",alignItems:"center",justifyContent:"space-between",pointerEvents:"auto",boxShadow:l?"0 0 14px rgba(255,183,0,0.08)":"none"},children:[E.jsx("span",{style:{letterSpacing:"0.04em"},children:o.label}),E.jsxs("span",{style:{fontSize:9,letterSpacing:"0.1em",textTransform:"uppercase",color:l?"rgba(255,183,0,0.5)":"rgba(168,189,198,0.3)",flexShrink:0,marginLeft:8},children:[o.stationIds.length," stations"]})]},o.id)})})]})]})}function QN({onOk:r,onCancel:e}){return E.jsx("div",{style:{position:"absolute",inset:0,zIndex:50,background:"rgba(3,8,16,0.75)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 28px",pointerEvents:"auto"},children:E.jsxs("div",{style:{position:"relative",width:"100%",maxWidth:340,background:"rgba(3,8,16,0.97)",border:"1px solid rgba(0,212,255,0.18)",padding:"28px 24px 22px",fontFamily:'Inter, "Segoe UI", sans-serif'},children:[E.jsx(J1,{}),E.jsx("div",{style:{fontSize:9,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(0,212,255,0.45)",marginBottom:14},children:"Theme"}),E.jsx("p",{style:{fontSize:14,color:"#e9fbff",lineHeight:1.65,marginBottom:24,letterSpacing:"0.01em"},children:"Click on the floating points on the screen to view more"}),E.jsxs("div",{style:{display:"flex",gap:10},children:[E.jsx("button",{onClick:e,style:ww("rgba(34,57,70,0.8)","#7a96a2"),children:"Cancel"}),E.jsx("button",{onClick:r,style:ww("rgba(0,212,255,0.12)","#00D4FF"),children:"OK"})]})]})})}function $N({onClose:r,children:e}){return E.jsx("div",{style:{position:"absolute",inset:0,zIndex:40,display:"flex",alignItems:"center",justifyContent:"center",padding:"12px 12px 72px",pointerEvents:"none"},children:E.jsxs("div",{style:{position:"relative",width:"100%",maxWidth:400,maxHeight:"100%",background:"rgba(3,8,16,0.96)",backdropFilter:"blur(16px)",border:"1px solid rgba(0,212,255,0.16)",display:"flex",flexDirection:"column",overflow:"hidden",pointerEvents:"auto"},children:[E.jsx(J1,{}),E.jsx("button",{onClick:r,style:{position:"absolute",top:10,right:12,zIndex:2,background:"none",border:"none",color:"rgba(0,212,255,0.45)",cursor:"pointer",fontSize:18,lineHeight:1,padding:"4px 6px",fontFamily:"inherit"},onTouchStart:t=>{t.currentTarget.style.color="#00D4FF"},onTouchEnd:t=>{t.currentTarget.style.color="rgba(0,212,255,0.45)"},children:"â"}),E.jsx("div",{style:{flex:1,overflowY:"auto",minHeight:0,scrollbarWidth:"thin",scrollbarColor:"rgba(0,212,255,0.25) transparent"},children:e})]})})}function eO({route:r,stepIndex:e,stepLabel:t,viewAllActive:n,onPrev:i,onNext:s,onViewAll:o,onExit:l}){const u=r.nodeIds.length,d=e===0,p=e>=u-1,m=(e+1)/u;return E.jsxs("div",{style:{position:"absolute",bottom:60,left:"50%",transform:"translateX(-50%)",width:"min(calc(100vw - 24px), 380px)",zIndex:30,background:"rgba(3,8,16,0.95)",backdropFilter:"blur(16px)",border:"1px solid rgba(0,212,255,0.14)",padding:"11px 14px 10px",fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto"},children:[E.jsx("div",{style:{fontSize:8,letterSpacing:"0.2em",textTransform:"uppercase",color:"rgba(0,212,255,0.42)",marginBottom:5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.label}),E.jsxs("div",{style:{fontSize:11,color:"#c8dde8",marginBottom:9,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",letterSpacing:"0.06em",textTransform:"uppercase",display:"flex",alignItems:"baseline",gap:8},children:[E.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:t}),E.jsxs("span",{style:{fontSize:8,color:"rgba(0,212,255,0.38)",flexShrink:0}
4792,children:[e+1,"/",u]})]}),E.jsxs("div",{style:{display:"flex",gap:7,alignItems:"center"},children:[E.jsx("button",{onClick:i,disabled:d||n,style:zg(d||n),children:"â Prev"}),E.jsx("button",{onClick:s,disabled:p||n,style:zg(p||n),children:"Next â¶"}),E.jsx("button",{onClick:o,disabled:p||n,style:{...zg(p||n),marginLeft:"auto",fontSize:9,letterSpacing:"0.1em",textTransform:"uppercase"},children:"All"}),E.jsx("button",{onClick:l,style:{...zg(!1),color:"rgba(0,212,255,0.38)",padding:"7px 10px"},children:"â"})]}),E.jsx("div",{style:{marginTop:9,height:1,background:"rgba(0,212,255,0.07)"},children:E.jsx("div",{style:{height:"100%",width:`${m*100}%`,background:"linear-gradient(90deg, rgba(0,212,255,0.55), rgba(0,212,255,0.22))",transition:"width 0.3s ease"}})})]})}function J1(){const r="1.5px solid rgba(0,212,255,0.28)",t={position:"absolute",width:10,height:10,pointerEvents:"none"};return E.jsxs(E.Fragment,{children:[E.jsx("span",{style:{...t,top:-1,left:-1,borderTop:r,borderLeft:r}}),E.jsx("span",{style:{...t,top:-1,right:-1,borderTop:r,borderRight:r}}),E.jsx("span",{style:{...t,bottom:-1,left:-1,borderBottom:r,borderLeft:r}}),E.jsx("span",{style:{...t,bottom:-1,right:-1,borderBottom:r,borderRight:r}})]})}const bw={fontSize:9,letterSpacing:"0.22em",textTransform:"uppercase",color:"rgba(0,212,255,0.45)",marginBottom:9,fontFamily:'Inter, "Segoe UI", sans-serif'};function ww(r,e){return{flex:1,padding:"11px 16px",background:r,border:`1px solid ${e}44`,color:e,cursor:"pointer",fontSize:12,letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto"}}function zg(r){return{padding:"7px 11px",background:"rgba(7,17,26,0.65)",border:`1px solid ${r?"rgba(34,57,70,0.4)":"rgba(34,57,70,0.75)"}`,color:r?"rgba(0,212,255,0.18)":"rgba(0,212,255,0.72)",cursor:r?"default":"pointer",fontSize:11,fontFamily:'Inter, "Segoe UI", sans-serif'}}const tO=$o.map(r=>({id:r.id,label:r.label})),nO=Fi.filter(r=>{var e;return(e=r.tags)==null?void 0:e.includes("subdomain")}),iO=Fi.filter(r=>{var e;return(e=r.tags)==null?void 0:e.includes("station")});function rO(r,e){var i;const t=[...Fi,...e],n=$o.find(s=>s.id===r);return n?n.label:((i=t.find(s=>
4792s.id===r))==null?void 0:i.label)??r}function sO(r,e){var i;if($o.find(s=>s.id===r))return{text:"T",color:"rgba(0,212,255,0.55)"};const n=[...Fi,...e].find(s=>s.id===r);return(i=n==null?void 0:n.tags)!=null&&i.includes("subdomain")?{text:"S",color:"rgba(180,120,255,0.65)"}:{text:"â
",color:"rgba(255,183,0,0.7)"}}function ox({label:r,options:e,onAdd:t}){var s;const[n,i]=K.useState(((s=e[0])==null?void 0:s.id)??"");return E.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",marginBottom:6},children:[E.jsx("span",{style:{...Bt.body,fontSize:10,minWidth:70,color:"#6a8a98"},children:r}),E.jsx("select",{value:n,onChange:o=>i(o.target.value),style:uO,children:e.map(o=>E.jsx("option",{value:o.id,style:{background:"#0d1f2d",color:"#c8dde8"},children:o.label},o.id))}),E.jsx("button",{onClick:()=>n&&t(n),style:Q1,children:"+ Add"})]})}function oO({index:r,total:e,nodeId:t,brief:n,images:i,extraNodes:s,onBriefChange:o,onImagesChange:l,onMoveUp:u,onMoveDown:d,onRemove:p}){const[m,v]=K.useState(""),y=sO(t,s),x=rO(t,s),M=r===0,S=r===e-1;return E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5,padding:"8px 10px",background:"rgba(0,212,255,0.03)",border:"1px solid rgba(0,212,255,0.10)",marginBottom:5},children:[E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[E.jsx("span",{style:{fontSize:9,color:"rgba(0,212,255,0.35)",letterSpacing:"0.1em",minWidth:18,textAlign:"right"},children:r+1}),E.jsx("span",{style:{fontSize:8,letterSpacing:"0.16em",color:y.color,border:`1px solid ${y.color}`,padding:"1px 4px",flexShrink:0},children:y.text}),E.jsx("span",{style:{flex:1,fontSize:11,color:"#c8dde8",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x}),E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,flexShrink:0},children:[E.jsx("button",{onClick:u,disabled:M,title:"Move up",style:Mw(M),children:"â²"}),E.jsx("button",{onClick:d,disabled:S,title:"Move down",style:Mw(S),children:"â¼"})]}),E.jsx("button",{onClick:p,title:"Remove from sequence",style:Ew,children:"Ã"})]}),E.jsx("textarea",{value:n,onChange:w=>o(w.target.value),placeholder:"Billboard text for this step⦠(leave blank to use node default)",style:{...dc,minHeight:44,resize:"vertical",fontSize:10,color:n?"#c8dde8":"rgba(100,140,160,0.6)"}}),E.jsxs("div",{style:{borderTop:"1px solid rgba(0,212,255,0.08)",paddingTop:7},children:[E.jsxs("div",{style:{fontSize:8,letterSpacing:"0.16em",textTransform:"uppercase",color:"rgba(0,212,255,0.38)",marginBottom:6},children:["Images · ",i.length]}),i.map((w,A)=>E.jsxs("div",{style:{display:"flex",gap:6,alignItems:"flex-start",marginBottom:5},children:[E.jsx("img",{src:w.url,alt:"",style:{width:46,height:34,objectFit:"cover",flexShrink:0,opacity:.8},onError:T=>{T.target.style.opacity="0.2"}}),E.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:3},children:[E.jsx("div",{style:{fontSize:9,color:"#4a6a7a",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.url}),E.jsx("input",{value:w.caption??"",onChange:T=>{const R=[...i];R[A]={...R[A],caption:T.target.value||void 0},l(R)},placeholder:"Captionâ¦",style:{...dc,fontSize:9,padding:"3px 6px"}})]}),E.jsx("button",{onClick:()=>l(i.filter((T,R)=>R!==A)),style:{...Ew,fontSize:13,alignSelf:"center"},children:"Ã"})]},A)),E.jsxs("div",{style:{display:"flex",gap:4},children:[E.jsx("input",{value:m,onChange:w=>v(w.target.value),onKeyDown:w=>{w.key==="Enter"&&m.trim()&&(l([...i,{url:m.trim()}]),v(""))},placeholder:"Image URLâ¦",style:{...dc,flex:1,fontSize:9,padding:"4px 6px"}}),E.jsx("button",{onClick:()=>{m.trim()&&(l([...i,{url:m.trim()}]),v(""))},style:{...Q1,fontSize:9,padding:"4px 8px"},children:"+ Add"})]})]})]})}function aO({route:r,extraNodes:e,onSave:t,onClose:n}){const i=U=>({...U,links:[...U.links??[]],nodeIds:[...U.nodeIds],stepBriefs:U.nodeIds.map((k,N)=>{var H;return((H=U.stepBriefs)==null?void 0:H[N])??""}),stepImages:U.nodeIds.map((k,N)=>{var H;return((H=U.stepImages)==null?void 0:H[N])??[]})}),[s,o]=K.useState(()=>i(r)),[l,u]=K.useState(""),[d,p]=K.useState(""),m=U=>o(k=>({...k,...U})),v=U=>{s.nodeIds.includes(U)||m({nodeIds:[...s.nodeIds,U],stepBriefs:[...s.stepBriefs??[],""],stepImages:[...s.stepImages??[],[]]})},y=U=>{const k=s.nodeIds.filter((F,I)=>I!==U),N=(s.stepBriefs??[]).filter((F,I)=>I!==U),H=(s.stepImages??[]).filter((F,I)=>I!==U);m({nodeIds:k,stepBriefs:N,stepImages:H})},x=(U,k)=>{const N=U+k;if(N<0||N>=s.nodeIds.length)return;const H=[...s.nodeIds],F=[...s.stepBriefs??[]],I=[...s.stepImages??[]];[H[U],H[N]]=[H[N],H[U]],[F[U],F[N]]=[F[N],F[U]],[I[U],I[N]]=[I[N],I[U]],m({no
4792deIds:H,stepBriefs:F,stepImages:I})},M=(U,k)=>{const N=[...s.stepBriefs??[]];N[U]=k,m({stepBriefs:N})},S=(U,k)=>{const N=[...s.stepImages??[]];N[U]=k,m({stepImages:N})},w=()=>{if(!l.trim()||!d.trim())return;const U={label:l.trim(),url:d.trim()};m({links:[...s.links??[],U]}),u(""),p("")},A=U=>m({links:(s.links??[]).filter((k,N)=>N!==U)}),T=[...nO,...e.filter(U=>{var k;return(k=U.tags)==null?void 0:k.includes("subdomain")})].map(U=>({id:U.id,label:U.label})),R=[...iO,...e.filter(U=>{var k;return(k=U.tags)==null?void 0:k.includes("station")})].map(U=>({id:U.id,label:U.label}));return E.jsx("div",{style:lO,onClick:U=>U.target===U.currentTarget&&n(),children:E.jsxs(bp,{style:cO,children:[E.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[E.jsx("span",{style:{...Bt.eyebrow,marginBottom:0},children:"Configure Route"}),E.jsx("button",{onClick:n,style:{...Bt.smallBtn,padding:"4px 10px"},children:"â Close"})]}),E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,overflowY:"auto",maxHeight:"calc(80vh - 80px)",paddingRight:2},children:[E.jsxs("div",{children:[E.jsx("div",{style:tf,children:"Question / Title"}),E.jsx("input",{value:s.label,onChange:U=>m({label:U.target.value}),style:dc,placeholder:"Question or route titleâ¦"})]}),E.jsxs("div",{children:[E.jsx("div",{style:tf,children:"Blurb"}),E.jsx("textarea",{value:s.description,onChange:U=>m({description:U.target.value}),style:{...dc,minHeight:56,resize:"vertical"},placeholder:"Short description shown in the Routes panelâ¦"})]}),E.jsxs("div",{children:[E.jsx("div",{style:tf,children:"Image URL"}),E.jsx("input",{value:s.imageUrl??"",onChange:U=>m({imageUrl:U.target.value}),style:dc,placeholder:"https://â¦"}),s.imageUrl&&E.jsx("img",{src:s.imageUrl,alt:"",style:{marginTop:6,maxWidth:"100%",maxHeight:100,objectFit:"cover",opacity:.85}})]}),E.jsxs("div",{children:[E.jsx("div",{style:tf,children:"Links"}),(s.links??[]).map((U,k)=>E.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",marginBottom:5},children:[E.jsx("span",{style:{...Bt.body,flex:1,fontSize:10},children:U.label}),E.jsx("a",{href:U.url,target:"_blank",rel:"noopener noreferrer",style:{...Bt.body,fontSize:9,color:"#00D4FF",flex:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:U.url}),E.jsx("button",{onClick:()=>A(k),style:{...Bt.smallBtn,padding:"2px 6px",color:"#ff6b6b"},children:"Ã"})]},k)),E.jsxs("div",{style:{display:"flex",gap:5,marginTop:4},children:[E.jsx("input",{value:l,onChange:U=>u(U.target.value),style:{...dc,flex:1},placeholder:"Label"}),E.jsx("input",{value:d,onChange:U=>p(U.target.value),style:{...dc,flex:2},placeholder:"https://â¦"}),E.jsx("button",{onClick:w,style:Q1,children:"+"})]})]}),E.jsx("div",{style:Bt.divider}),E.jsxs("div",{children:[E.jsx("div",{style:tf,children:"Sequence"}),E.jsx("p",{style:{...Bt.body,fontSize:9,marginBottom:10,color:"rgba(100,160,180,0.7)"},children:"Order defines playback. Each step has its own billboard text â shown in the floating panel during route playback only. Leave blank to use the node's default description."}),s.nodeIds.length===0&&E.jsx("p",{style:{...Bt.body,fontSize:10,opacity:.4,marginBottom:8},children:"No nodes added yet. Use the pickers below."}),s.nodeIds.map((U,k)=>{var N,H;return E.jsx(oO,{index:k,total:s.nodeIds.length,nodeId:U,brief:((N=s.stepBriefs)==null?void 0:N[k])??"",images:((H=s.stepImages)==null?void 0:H[k])??[],extraNodes:e,onBriefChange:F=>M(k,F),onImagesChange:F=>S(k,F),onMoveUp:()=>x(k,-1),onMoveDown:()=>x(k,1),onRemove:()=>y(k)},`${U}-${k}`)})]}),E.jsxs("div",{children:[E.jsx("div",{style:{...tf,marginTop:4},children:"Add to Sequence"}),E.jsx(ox,{label:"Territory",options:tO,onAdd:v}),E.jsx(ox,{label:"Subdomain",options:T,onAdd:v}),E.jsx(ox,{label:"Station",options:R,onAdd:v})]})]}),E.jsxs("div",{style:{marginTop:16,display:"flex",justifyContent:"flex-end",gap:8},children:[E.jsx("button",{onClick:n,style:Bt.smallBtn,children:"Cancel"}),E.jsx("button",{onClick:()=>{t(s),n()},style:{...Bt.smallBtn,background:"rgba(0,212,255,0.12)",borderColor:"rgba(0,212,255,0.4)",color:"#00D4FF"},children:"Save Route"})]})]})})}const lO={position:"fixed",inset:0,background:"rgba(0,0,0,0.65)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9e3},cO={width:560,maxWidth:"95vw",padding:24,maxHeight:"88vh",display:"flex",flexDirection:"column"},tf={fontSize:9,letterSpacing:"0.2em",textTransform:"uppercase",color:"#00D4FF",marginBottom:5},dc={width:"100%",boxSizing:"border-box",background:"rgba(0,212,255,0.04)",border:"1px solid rgba(0,212,255,0.15)",color:"#c8dde8",fontSize:11,padding:"6px 8px",outline:"none",fontFamily:'Inter, "Segoe UI", sans-serif'},uO={flex:1,background:"#0d1f2d",border:"1px solid rgba(0,212,255,0.22)",color:"#c8dde8",fontSize:10,padding:"4px 6px",outline:"none",fontFamily:'Inter, "Segoe UI", sans-serif',colorScheme:"dark"},Q1={padding:"4px 10px",background:"rgba(0,212,255,0.08)",border:"1px solid rgba(0,212,255,0.25)",color:"#00D4FF",cursor:"pointer",fontSize:10,fontFamily:'Inter, "Segoe UI", sans-serif',whiteSpace:"nowrap"},Mw=r=>({background:"none",border:"1px solid rgba(0,212,255,0.12)",color:r?"rgba(0,212,255,0.15)":"rgba(0,212,255,0.5)",cursor:r?"default":"pointer",fontSize:7,lineHeight:1,padding:"2px 4px",fontFamily:"inherit"}),Ew={background:"none",border:"none",color:"rgba(255,107,107,0.55)",cursor:"pointer",fontSize:14,lineHeight:1,padding:"0 3px",flexShrink:0};function dO({color:r="rgba(0,212,255,0.32)"}){const t={position:"absolute",width:8,height:8,pointerEvents:"none"},n=`1.5px solid ${r}`;return E.jsxs(E.Fragment,{children:[E.jsx("span",{style:{...t,top:0,left:0,borderTop:n,borderLeft:n}}),E.jsx("span",{style:{...t,top:0,right:0,borderTop:n,borderRight:n}}),E.jsx("span",{style:{...t,bottom:0,left:0,borderBottom:n,borderLeft:n}}),E.jsx("span",{style:{...t,bottom:0,right:0,borderBottom:n,borderRight:n}})]})}function Tw({onClick:r,disabled:e,children:t}){return E.jsx("button",{onClick:r,disabled:e,style:{background:"none",border:"none",color:e?"rgba(0,212,255,0.18)":"rgba(0,212,255,0.62)",fontSize:11,lineHeight:1,cursor:e?"default":"pointer",padding:"3px 5px",fontFamily:"inherit",transition:"color 0.15s"},onMouseEnter:n=>{e||(n.currentTarget.style.color="#00D4FF")},onMouseLeave:n=>{e||(n.currentTarget.style.color="rgba(0,212,255,0.62)")},children:t})}function fO({route:r,stepIndex:e,stepLabel:t,viewAllActive:n,onPrev:i,onNext:s,onJumpTo:o,onViewAll:l,onExit:u}){const d=r.nodeIds.length,p=e===0,m=e>=d-1,v=(e+1)/d;return E.jsx("div",{style:{position:"absolute",bottom:40,left:"50%",transform:"translateX(-50%)",zIndex:15,fontFamily:'Inter, "Segoe UI", sans-serif',pointerEvents:"auto",userSelect:"none"},children:E.jsxs("div",{style:{position:"relative",background:"rgba(3,8,16,0.92)",backdropFilter:"blur(16px)",border:"1px solid rgba(0,212,255,0.12)",padding:"10px 18px 9px",display:"flex",flexDirection:"column",alignItems:"center",gap:7,minWidth:360},children:[E.jsx(dO,{}),E.jsx("div",{style:{fontSize:8,letterSpacing:"0.2em",textTransform:"uppercase",color:"rgba(0,212,255,0.48)",maxWidth:340,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.label}),E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[E.jsx(Tw,{onClick:i,disabled:p||n,children:"â"}),E.jsx("div",{style:{display:"flex",alignItems:"center",gap:5},children:r.nodeIds.map((y,x)=>{const M=x<=e,S=x===e;return E.jsx("button",{onClick:()=>{n||o(x)},title:`Step ${x+1}`,style:{width:S?10:6,height:S?10:6,borderRadius:"50%",background:S?"#00D4FF":M?"rgba(0,212,255,0.38)":"rgba(0,212,255,0.10)",border:S?"1px solid rgba(0,212,255,0.85)":"1px solid transparent",boxShadow:S?"0 0 7px rgba(0,212,255,0.65)":"none",cursor:n?"default":"pointer",padding:0,transition:"all 0.22s",flexShrink:0}},x)})}),E.jsx(Tw,{onClick:s,disabled:m||n,children:"â¶"}),E.jsx("span",{style:{width:1,height:14,background:"rgba(0,212,255,0.14)",flexShrink:0}}),E.jsx("button",{onClick:l,disabled:m||n,style:{background:"none",border:"1px solid rgba(0,212,255,0.18)",color:m||n?"rgba(0,212,255,0.22)":"rgba(0,212,255,0.65)",fontSize:8,letterSpacing:"0.18em",textTransform:"uppercase",padding:"3px 8px",cursor:m||n?"default":"pointer",fontFamily:"inherit",transition:"color 0.18s, border-color 0.18s"},onMouseEnter:y=>{!m&&!n&&(y.currentTarget.style.color="#00D4FF",y.currentTarget.style.borderColor="rgba(0,212,255,0.45)")},onMouseLeave:y=>{!m&&!n&&(y.currentTarget.style.color="rgba(0,212,255,0.65)",y.currentTarget.style.borderColor="rgba(0,212,255,0.18)")},children:n?"···":"View All"}),E.jsx("button",{onClick:u,style:{background:"none",border:"none",color:"rgba(0,212,255,0.32)",fontSize:14,lineHeight:1,cursor:"pointer",padding:"0 3px",fontFamily:"inherit",transition:"color 0.15s"},onMouseEnter:y=>y.currentTarget.style.color="rgba(0,212,255,0.8)",onMouseLeave:y=>y.currentTarget.style.color="rgba(0,212,255,0.32)",children:"â"})]}),E.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[E.jsx("span",{style:{fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"#c8dde8",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),E.jsxs("span",{style:{fontSize:8,letterSpacing:"0.14em",color:"rgba(0,212,255,0.38)",flexShrink:0}
4792,children:[e+1," / ",d]})]}),E.jsx("div",{style:{width:"100%",height:1,background:"rgba(0,212,255,0.07)",marginTop:2},children:E.jsx("div",{style:{height:"100%",width:`${v*100}%`,background:"linear-gradient(90deg, rgba(0,212,255,0.6), rgba(0,212,255,0.25))",transition:"width 0.32s ease"}})})]})})}const hu=new Set,hO=Object.fromEntries($o.map(r=>[r.id,!0])),pO=9e3,mO=[{id:"theme_space",label:"Space",stationIds:["smartlander","nausolaris","kepler"]},{id:"theme_ai",label:"AI",stationIds:["ai-mapping","nexus","wellness","future-mfg"]},{id:"theme_enterprise",label:"Enterprise",stationIds:["future-mfg","kepler","wellness"]},{id:"theme_games",label:"Games",stationIds:["nexus","heavy-earth"]}];function lc(r,e){try{return JSON.parse(localStorage.getItem(r)??"null")??e}catch{return e}}function gO({visible:r,onClick:e}){const t="#FFB700",n=`1.5px solid ${t}`,i=10;return E.jsxs("button",{onClick:e,"aria-label":"Deselect",style:{position:"absolute",top:72,right:330,width:36,height:36,background:"transparent",border:"none",padding:0,cursor:"pointer",outline:"none",pointerEvents:r?"auto":"none",opacity:r?1:0,transition:"opacity 0.3s ease"},children:[E.jsx("span",{style:{position:"absolute",top:0,left:0,width:i,height:i,borderTop:n,borderLeft:n}}),E.jsx("span",{style:{position:"absolute",top:0,right:0,width:i,height:i,borderTop:n,borderRight:n}}),E.jsx("span",{style:{position:"absolute",bottom:0,left:0,width:i,height:i,borderBottom:n,borderLeft:n}}),E.jsx("span",{style:{position:"absolute",bottom:0,right:0,width:i,height:i,borderBottom:n,borderRight:n}}),E.jsxs("svg",{width:16,height:16,viewBox:"0 0 22 22",fill:"none",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)"},children:[E.jsx("line",{x1:"4",y1:"4",x2:"18",y2:"18",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),E.jsx("line",{x1:"18",y1:"4",x2:"4",y2:"18",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"})]})]})}function vO({card:r,sourceLabel:e,targetLabel:t,onChange:n,onAddCargo:i,onConfirm:s,onCancel:o}){const l="#00D4FF",u="#FFB700",d="1.5px solid rgba(0,212,255,0.42)",p={position:"absolute",width:11,height:11,pointerEvents:"none"};return E.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:30,pointerEvents:"auto",fontFamily:'Inter, "Segoe UI", sans-serif'},children:E.jsxs("div",{style:{width:320,background:"rgba(3,8,16,0.95)",backdropFilter:"blur(14px)",border:"1px solid rgba(0,212,255,0.1)",position:"relative",padding:"18px 18px 16px"},children:[E.jsx("span",{style:{...p,top:-1,left:-1,borderTop:d,borderLeft:d}}),E.jsx("span",{style:{...p,top:-1,right:-1,borderTop:d,borderRight:d}}),E.jsx("span",{style:{...p,bottom:-1,left:-1,borderBottom:d,borderLeft:d}}),E.jsx("span",{style:{...p,bottom:-1,right:-1,borderBottom:d,borderRight:d}}),E.jsx("div",{style:{fontSize:9,letterSpacing:"0.22em",textTransform:"uppercase",color:l,marginBottom:12},children:"Define Connection"}),E.jsxs("div",{style:{fontSize:12,color:"#c8dde8",marginBottom:14},children:[E.jsx("span",{style:{color:u},children:e}),E.jsx("span",{style:{color:"#4a6a7a",margin:"0 7px"},children:"â"}),E.jsx("span",{style:{color:u},children:t})]}),r.cargo.length>0&&E.jsx("div",{style:{marginBottom:12,display:"flex",flexDirection:"column",gap:4},children:r.cargo.map((m,v)=>E.jsxs("div",{style:{padding:"5px 8px",background:"rgba(7,17,26,0.55)",border:"1px solid rgba(34,57,70,0.65)",fontSize:11,color:"#c8dde8"},children:[E.jsxs("span",{style:{color:"#7ec8e8",fontSize:9,textTransform:"uppercase",letterSpacing:"0.12em"},children:[m.type,": "]}),m.blurb,m.url&&E.jsx("span",{style:{color:l,marginLeft:6,fontSize:10},children:"â"})]},v))}),E.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[E.jsx("input",{placeholder:"Cargo type",value:r.draftType,onChange:m=>n({draftType:m.target.value}),style:ax}),E.jsx("textarea",{placeholder:"Blurbâ¦",value:r.draftBlurb,onChange:m=>n({draftBlurb:m.target.value}),style:{...ax,resize:"vertical",minHeight:56}}),E.jsx("input",{placeholder:"Link URL (optional)",value:r.draftUrl,onChange:m=>n({draftUrl:m.target.value}),style:ax}),E.jsx("button",{onClick:i,disabled:!r.draftType||!r.draftBlurb,style:{...lx("#7ec8e8"),opacity:r.draftType&&r.draftBlurb?1:.4,cursor:r.draftType&&r.draftBlurb?"pointer":"default"},children:"+ Add Cargo"})]}),E.jsxs("div",{style:{display:"flex",gap:8,marginTop:14},children:[E.jsx("button",{onClick:s,style:{...lx(l),flex:1},children:"Connect"}),E.jsx("button",{onClick:o,style:{...lx("#3d5a68"),flex:1},children:"Cancel"})]})]})})}const ax={background:"rgba(7,17,26,0.7)",border:"1px solid rgba(34,57,70,0.8)",color:"#c8dde8",fontSize:11,padding:"6px 8px",fontFamily:'Inter, "Segoe UI", sans-serif',outline:"none",width:"100%",boxSizing:"border-box"},lx=r=>({padding:"7px 12px",background:"rgba(7,17,26,0.6)",border:`1px solid ${r}55`,color:r,cursor:"pointer",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:'Inter, "Segoe UI", sans-serif'});function yO({selectedLinkId:r,customLinks:e,onSelectCargo:t,onClose:n}){const i="#00D4FF",s="#FFB700",o="1.5px solid rgba(0,212,255,0.35)",l={position:"absolute",width:10,height:10,pointerEvents:"none"},u=r.startsWith("station:"),d=u?r.slice(8):null,p=d?zp(d):null,m=u?null:e.find(y=>y.id===r),v=p?p.activities.map(y=>({label:y.label,type:y.type})):m?m.cargo.map(y=>({label:y.blurb,type:y.type})):[];return v.length===0?null:E.jsx("div",{style:{position:"absolute",bottom:80,left:"50%",transform:"translateX(-50%)",zIndex:20,pointerEvents:"auto",fontFamily:'Inter, "Segoe UI", sans-serif',minWidth:240,maxWidth:320},children:E.jsxs("div",{style:{background:"rgba(3,8,16,0.94)",backdropFilter:"blur(14px)",border:"1px solid rgba(0,212,255,0.12)",padding:"14px 16px 12px",position:"relative"}
4792,children:[E.jsx("span",{style:{...l,top:-1,left:-1,borderTop:o,borderLeft:o}}),E.jsx("span",{style:{...l,top:-1,right:-1,borderTop:o,borderRight:o}}),E.jsx("span",{style:{...l,bottom:-1,left:-1,borderBottom:o,borderLeft:o}}),E.jsx("span",{style:{...l,bottom:-1,right:-1,borderBottom:o,borderRight:o}}),E.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:10},children:[E.jsx("div",{style:{fontSize:9,letterSpacing:"0.22em",textTransform:"uppercase",color:i},children:d?"Station Cargo":"Link Cargo"}),E.jsx("button",{onClick:n,style:{background:"none",border:"none",cursor:"pointer",color:"#4a6a7a",fontSize:14,lineHeight:1,padding:"0 2px"},children:"Ã"})]}),E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:v.map((y,x)=>E.jsxs("button",{onClick:()=>{d?t({kind:"activity",stationId:d,actIdx:x}):m&&t({kind:"customCargo",linkId:m.id,cargoIdx:x}),n()},style:{display:"flex",alignItems:"center",gap:8,background:"rgba(0,212,255,0.04)",border:"1px solid rgba(0,212,255,0.1)",padding:"6px 10px",cursor:"pointer",textAlign:"left",width:"100%",transition:"background 0.15s"},onMouseEnter:M=>M.currentTarget.style.background="rgba(0,212,255,0.10)",onMouseLeave:M=>M.currentTarget.style.background="rgba(0,212,255,0.04)",children:[E.jsx("span",{style:{fontSize:9,letterSpacing:"0.12em",textTransform:"uppercase",color:s,flexShrink:0},children:y.type}),E.jsx("span",{style:{fontSize:11,color:"#c8dde8",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.label})]},x))})]})})}function xO({fading:r}){return E.jsxs("div",{style:{position:"absolute",inset:0,background:"#030810",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:0,opacity:r?0:1,transition:"opacity 0.9s ease",pointerEvents:r?"none":"auto",fontFamily:'Inter, "Segoe UI", sans-serif'},children:[E.jsx("div",{style:{fontSize:9,letterSpacing:"0.28em",textTransform:"uppercase",color:"#3a5a6a",marginBottom:14},children:"AI · Design · Product"}),E.jsx("div",{style:{fontSize:28,fontWeight:700,letterSpacing:"0.2em",textTransform:"uppercase",color:"#e9fbff",textShadow:"0 0 24px rgba(0,212,255,0.18)"},children:"Marco Morales"}),E.jsx("div",{style:{display:"flex",gap:8,marginTop:36},children:[0,1,2].map(e=>E.jsx("div",{style:{width:5,height:5,borderRadius:"50%",background:"#00D4FF",animation:`loading-pulse 1.3s ease-in-out ${e*.22}s infinite`}},e))})]})}function _O(){const r="1px solid rgba(0,212,255,0.14)",t={position:"absolute",width:22,height:22,pointerEvents:"none"};return E.jsxs(E.Fragment,{children:[E.jsx("div",{style:{...t,top:12,left:12,borderTop:r,borderLeft:r}}),E.jsx("div",{style:{...t,top:12,right:12,borderTop:r,borderRight:r}}),E.jsx("div",{style:{...t,bottom:12,left:12,borderBottom:r,borderLeft:r}}),E.jsx("div",{style:{...t,bottom:12,right:12,borderBottom:r,borderRight:r}})]})}function SO(){var fs,Jn,pi,Ni,Yr,qr,Ua;const[r]=K.useState(()=>typeof window<"u"&&window.location.hash==="#admin"),[e,t]=K.useState(null),[n,i]=K.useState(null),[s,o]=K.useState(hu),[l,u]=K.useState(null),[d,p]=K.useState(hO),[m,v]=K.useState({territory:!0,subdomain:!0,station:!0}),[y,x]=K.useState(()=>lc("portfolio:globalConfig",Y1)),[M,S]=K.useState(()=>lc("portfolio:customRoutes",null)??KF.map(Ze=>({...Ze,links:[...Ze.links??[]],nodeIds:[...Ze.nodeIds]}))),[w,A]=K.useState(null),[T,R]=K.useState(!1),[U,k]=K.useState(()=>lc("portfolio:themes",mO)),[N,H]=K.useState(null),[F,I]=K.useState(()=>typeof window<"u"&&window.innerWidth<768),[G,W]=K.useState(null),[X,J]=K.useState(null);K.useEffect(()=>{const Ee=()=>I(window.innerWidth<768);return window.addEventListener("resize",Ee,{passive:!0}),()=>window.removeEventListener("resize",Ee)},[]);const[oe,se]=K.useState(-1),[fe,V]=K.useState(!1),[$,Z]=K.useState(!1),[O,j]=K.useState(!0);K.useEffect(()=>{const Ee=setTimeout(()=>Z(!0),1400),Ze=setTimeout(()=>j(!1),2400);return()=>{clearTimeout(Ee),clearTimeout(Ze)}},[]);const[re,ne]=K.useState(!1),ie=K.useRef(null),he=K.useCallback(()=>{ne(!1),ie.current&&clearTimeout(ie.current),ie.current=setTimeout(()=>ne(!0),pO)},[]);K.useEffect(()=>(he(),window.addEventListener("mousemove",he,{passive:!0}),window.addEventListener("mousedown",he,{passive:!0}),window.addEventListener("touchstart",he,{passive:!0}),window.addEventListener("keydown",he,{passive:!0}),()=>{ie.current&&clearTimeout(ie.current),window.removeEventListener("mousemove",he),window.removeEventListener("mousedown",he),window.removeEventListener("touchstart",he),window.removeEventListener("keydown",he)}),[he]);const le=K.useRef(null),ye=K.useCallback(Ee=>{le.current&&(clearInterval(le.current),le.current=null),t(Ee),i(null),se(0),o(new Set([Ee.nodeIds[0]])),R(!0),V(!1)},[]);K.useEffect(()=>()=>{le.current&&clearInterval(le.current)},[]);const ze=K.useCallback(Ee=>{if(!e)return;const Ze=Math.max(0,Math.min(e.nodeIds.length-1,Ee));se(Ze),o(new Set(e.nodeIds.slice(0,Ze+1)))},[e]),Xe=K.useCallback(()=>{oe>0&&ze(oe-1)},[oe,ze]),Ie=K.useCallback(()=>{e&&ze(Math.min(oe+1,e.nodeIds.length-1))},[e,oe,ze]),Y=K.useCallback(()=>
4792{if(!e||fe)return;le.current&&(clearInterval(le.current),le.current=null),V(!0);let Ee=oe+1;le.current=setInterval(()=>{Ee++,o(new Set(e.nodeIds.slice(0,Ee))),se(Ee-1),Ee>=e.nodeIds.length&&(clearInterval(le.current),le.current=null,V(!1))},220)},[e,oe,fe]),[Ce,Le]=K.useState(()=>lc("portfolio:customNodes",[])),[Ge,Ae]=K.useState(()=>lc("portfolio:customLinks",[])),[$e,Re]=K.useState(()=>lc("portfolio:nodeExtras",{})),[He,Q]=K.useState(()=>lc("portfolio:customSubdomains",[])),[B,pe]=K.useState(()=>lc("portfolio:removedSubdomainIds",[])),[ge,ve]=K.useState(null);K.useEffect(()=>{localStorage.setItem("portfolio:customNodes",JSON.stringify(Ce))},[Ce]),K.useEffect(()=>{localStorage.setItem("portfolio:customLinks",JSON.stringify(Ge))},[Ge]),K.useEffect(()=>{localStorage.setItem("portfolio:nodeExtras",JSON.stringify($e))},[$e]),K.useEffect(()=>{localStorage.setItem("portfolio:customSubdomains",JSON.stringify(He))},[He]),K.useEffect(()=>{localStorage.setItem("portfolio:removedSubdomainIds",JSON.stringify(B))},[B]),K.useEffect(()=>{localStorage.setItem("portfolio:customRoutes",JSON.stringify(M))},[M]),K.useEffect(()=>{localStorage.setItem("portfolio:globalConfig",JSON.stringify(y))},[y]),K.useEffect(()=>{localStorage.setItem("portfolio:themes",JSON.stringify(U))},[U]);const[we]=K.useState(()=>localStorage.getItem("portfolio:customRoutes")!==null);K.useEffect(()=>{we||fetch("/portfolio-content.json").then(Ee=>{if(!Ee.ok)throw new Error("not found");return Ee.json()}).then(Ee=>Si(JSON.stringify(Ee))).catch(()=>{})},[]),K.useEffect(()=>{const Ee=document.createElement("link");return Ee.rel="stylesheet",Ee.href=jF,document.head.appendChild(Ee),()=>{document.head.removeChild(Ee)}},[]),K.useEffect(()=>{const Ee=xf(y.territoryFont??"inter");document.documentElement.style.setProperty("--territory-font",Ee.cssFamily)},[y.territoryFont]),K.useEffect(()=>{const Ee=xf(y.subdomainFont??"inter");document.documentElement.style.setProperty("--subdomain-font",Ee.cssFamily)},[y.subdomainFont]);const[ut,Oe]=K.useState(null),Qe=K.useCallback(Ee=>Oe(Ze=>Ze===Ee?null:Ee),[]),[at,Ke]=K.useState(!1),[tt,wt]=K.useState(null),[nt,et]=K.useState(null),it=K.useCallback(()=>{Ke(Ee=>(Ee&&(wt(null),et(null)),!Ee))},[]),ue=K.useCallback(Ee=>{tt?tt!==Ee&&(et({sourceId:tt,targetId:Ee,cargo:[],draftType:"",draftBlurb:"",draftUrl:""}),wt(null)):wt(Ee)},[tt]),qe=K.useCallback(()=>{if(!nt||!nt.draftType||!nt.draftBlurb)return;const Ee={type:nt.draftType,blurb:nt.draftBlurb,...nt.draftUrl?{url:nt.draftUrl}:{}};et(Ze=>Ze?{...Ze,cargo:[...Ze.cargo,Ee],draftType:"",draftBlurb:"",draftUrl:""}:null)},[nt]),ce=K.useCallback(()=>{nt&&(Ae(Ee=>[...Ee,{id:`cl_${Date.now()}`,sourceId:nt.sourceId,targetId:nt.targetId,cargo:nt.cargo}]),et(null))},[nt]),[Fe,xe]=K.useState(null),De=K.useCallback(Ee=>xe(Ee),[]),rt=K.useCallback(()=>xe(null),[]),mt=K.useCallback((Ee,Ze)=>{Ae(Ht=>Ht.map(Jt=>Jt.id===Ee?{...Jt,cargo:Jt.cargo.filter((yr,Qn)=>Qn!==Ze)}:Jt))},[]),vt=K.useCallback(Ee=>{Ae(Ze=>Ze.filter(Ht=>Ht.id!==Ee)),xe(null)},[]),kt=K.useCallback((Ee,Ze)=>{Ae(Ht=>Ht.map(Jt=>Jt.id===Ee?{...Jt,cargo:[...Jt.cargo,Ze]}:Jt))},[]),Ft=K.useCallback((Ee,Ze)=>{const Jt={id:`csub_${Date.now()}`,label:Ze,description:"",group:Ee,color:"#00D4FF",size:.55,tags:["subdomain"],parentId:Ee,position:[0,0,0]};Q(yr=>[...yr,Jt])},[]),pt=K.useCallback((Ee,Ze)=>{Ze?pe(Ht=>[...Ht,Ee]):Q(Ht=>Ht.filter(Jt=>Jt.id!==Ee))},[]),Kt=K.useCallback(Ee=>{},[]),dn=K.useCallback(Ee=>{ri.current=!0,ve(Ee),xe(null)},[]),Sn=K.useCallback(()=>ve(null),[]),bn=K.useCallback((Ee,Ze)=>{S(Ht=>Ht.map(Jt=>Jt.id===Ee?{...Jt,label:Ze}:Jt))},[]),ii=K.useCallback(Ee=>{S(Ze=>Ze.filter(Ht=>Ht.id!==Ee))},[]),vr=K.useCallback(Ee=>{A(Ee)},[]),fi=K.useCallback(Ee=>{S(Ze=>Ze.map(Ht=>Ht.id===Ee.id?Ee:Ht)),A(null)},[]),Ai=K.useCallback(()=>{const Ze={id:`route_${Date.now()}`,label:"New routeâ¦",description:"",nodeIds:[]};S(Ht=>[...Ht,Ze]),A(Ze)},[]),_i=K.useCallback(()=>{const Ee={customNodes:Ce,customLinks:Ge,nodeExtras:$e,customSubdomains:He,removedSubdomainIds:B,customRoutes:M,globalConfig:y,themes:U},Ze=new Blob([JSON.stringify(Ee,null,2)],{type:"application/json"}),Ht=URL.createObjectURL(Ze),Jt=document.createElement("a");Jt.href=Ht,Jt.download=`portfolio-${new Date().toISOString().slice(0,10)}.json`,Jt.click(),URL.revokeObjectURL(Ht)},[Ce,Ge,$e,He,B,M,y]),Si=K.useCallback(Ee=>{try{const Ze=JSON.parse(Ee);Ze.customNodes&&Le(Ze.customNodes),Ze.customLinks&&Ae(Ze.customLinks),Ze.nodeExtras&&Re(Ze.nodeExtras),Ze.customSubdomains&&Q(Ze.customSubdomains),Ze.removedSubdomainIds&&pe(Ze.removedSubdomainIds),Ze.customRoutes&&S(Ze.customRoutes),Ze.globalConfig&&x(Ze.globalConfig),Ze.themes&&k(Ze.themes)}
4792catch{console.warn("Import failed: invalid JSON")}},[]),hi=K.useCallback(Ee=>{v(Ze=>({...Ze,[Ee]:!Ze[Ee]}))},[]),Pr=K.useCallback((Ee,Ze)=>{Le(Ht=>Ht.map(Jt=>Jt.id===Ee?{...Jt,...Ze}:Jt))},[]),xo=K.useCallback((Ee,Ze)=>{Re(Ht=>({...Ht,[Ee]:{...Ht[Ee],...Ze}}))},[]),[Vn,Hs]=K.useState(null),ee=K.useCallback(()=>{if(!(Vn!=null&&Vn.label))return;const Ee=`cs_${Date.now()}`,Ze=Math.random()*Math.PI*2,Ht=3+Math.random()*5,Jt=(Math.random()-.5)*6,yr={id:Ee,label:Vn.label,description:Vn.description,group:"station",color:"#ffffff",size:.35,tags:["station"],position:[Math.round(Ht*Math.cos(Ze)*10)/10,Math.round(Jt*10)/10,Math.round(Ht*Math.sin(Ze)*10)/10]};Le(Qn=>[...Qn,yr]),(Vn.imageUrl||Vn.links.length>0)&&Re(Qn=>({...Qn,[Ee]:{imageUrl:Vn.imageUrl||void 0,links:Vn.links.length>0?Vn.links:void 0}})),Hs(null),Ke(!0),wt(Ee)},[Vn]),Se=K.useCallback(Ee=>{var hs,so,Ir,Kr,Ri,Yt;le.current&&(clearInterval(le.current),le.current=null);const Ze=Ce.find(An=>An.id===Ee);if(Ze){t(null),R(!0),i(Ze),xe(null);const An=new Set([Ee]);Ge.forEach(Ln=>{Ln.sourceId===Ee&&An.add(Ln.targetId),Ln.targetId===Ee&&An.add(Ln.sourceId)}),(so=(hs=$e[Ee])==null?void 0:hs.connectedDomainIds)==null||so.forEach(Ln=>{An.add(Ln);const gn=vo(Ln)??He.find(jn=>jn.id===Ln);gn!=null&&gn.parentId&&An.add(gn.parentId)}),o(An);return}const Jt=He.find(An=>An.id===Ee)??vo(Ee);if(!Jt)return;const yr=Ee===(n==null?void 0:n.id);t(null),R(!0),i(Jt),xe(null),yr||(ve(null),u(null));const Qn=new Set([Ee]);if((Ir=Jt.tags)!=null&&Ir.includes("station")){const An=$e[Ee];((An==null?void 0:An.connectedDomainIds)??((Kr=zp(Ee))==null?void 0:Kr.linkedSubdomainIds)??[]).forEach(gn=>{Qn.add(gn);const jn=vo(gn)??He.find(_o=>_o.id===gn);jn!=null&&jn.parentId&&Qn.add(jn.parentId)}),Ge.forEach(gn=>{gn.sourceId===Ee&&Qn.add(gn.targetId),gn.targetId===Ee&&Qn.add(gn.sourceId)})}else if((Ri=Jt.tags)!=null&&Ri.includes("territory")){const An=Hp(Ee);An.forEach(gn=>Qn.add(gn.id));const Ln=new Set(An.map(gn=>gn.id));Sp.forEach(gn=>{var _o;const jn=Fi.find(Wn=>Wn.id===gn.source);(_o=jn==null?void 0:jn.tags)!=null&&_o.includes("station")&&(gn.target===Ee||Ln.has(gn.target))&&Qn.add(jn.id)})}else(Yt=Jt.tags)!=null&&Yt.includes("subdomain")&&(Jt.parentId&&Qn.add(Jt.parentId),Sp.forEach(An=>{var gn;const Ln=Fi.find(jn=>jn.id===An.source);(gn=Ln==null?void 0:Ln.tags)!=null&&gn.includes("station")&&An.target===Ee&&Qn.add(Ln.id)}));o(Qn)},[Ce,Ge,He,n]),Ue=K.useCallback(Ee=>{if(xn.current=!0,ri.current){ri.current=!1;return}if(at){ue(Ee);return}Se(Ee)},[at,ue,Se]),ke=K.useCallback(()=>{le.current&&(clearInterval(le.current),le.current=null),t(null),i(null),o(hu),R(!1),ve(null),xe(null),u(null),se(-1),V(!1),H(null)},[]),Te=K.useCallback(()=>{i(null),o(hu),ve(null),xe(null),u(null),se(-1),V(!1),R(!1)},[]),lt=K.useCallback(Ee=>{W(null),ye(Ee)},[ye]),yt=K.useCallback(Ee=>{W(null),J(Ee)},[]),Tt=K.useCallback(()=>{X&&(le.current&&(clearInterval(le.current),le.current=null),t(null),i(null),o(hu),R(!1),ve(null),xe(null),u(null),se(-1),V(!1),H(Ee=>Ee===X?null:X)),J(null)},[X]),je=K.useCallback(Ee=>{le.current&&(clearInterval(le.current),le.current=null),t(null),i(null),o(hu),R(!1),ve(null),xe(null),u(null),se(-1),V(!1),H(Ze=>Ze===Ee?null:Ee)},[]),Lt=K.useCallback(Ee=>{p(Ze=>({...Ze,[Ee]:Ze[Ee]===!1}))},[]),Ot=K.useMemo(()=>{if(N){const Ee=U.find(Ze=>Ze.id===N);return Ee?new Set(Ee.stationIds):hu}return!e&&!n?hu:s},[N,U,e,n,s]),xt=e?e.nodeIds[oe]??null:null,Zt=xt?vo(xt)??Ce.find(Ee
4792=>Ee.id===xt):null,wn=(((fs=$e[xt??""])==null?void 0:fs.labelOverride)??(Zt==null?void 0:Zt.label)??"").toUpperCase(),pn=((Jn=e==null?void 0:e.stepBriefs)==null?void 0:Jn[oe])??(Zt==null?void 0:Zt.description)??"",En=(((Ni=(pi=e==null?void 0:e.stepImages)==null?void 0:pi[oe])==null?void 0:Ni.length)??0)>0?e.stepImages[oe]:null,Mt=re&&!T&&!e&&!n,ft=K.useMemo(()=>{if(!e||s.size<2)return[];const Ee=e.nodeIds.filter(Ht=>s.has(Ht)),Ze=[];for(let Ht=1;Ht<Ee.length;Ht++)Ze.push([Ee[Ht-1],Ee[Ht]]);return Ze},[e,s]),Qt=K.useMemo(()=>new Set(B),[B]),zt=K.useMemo(()=>[...Fi.filter(Ee=>{var Ze;return(Ze=Ee.tags)==null?void 0:Ze.includes("station")}).map(Ee=>({id:Ee.id,label:Ee.label})),...Ce.filter(Ee=>{var Ze;return(Ze=Ee.tags)==null?void 0:Ze.includes("station")}).map(Ee=>({id:Ee.id,label:Ee.label}))],[Ce]),xn=K.useRef(!1),ri=K.useRef(!1),Tn=K.useRef(0);K.useEffect(()=>{const Ee=()=>{xn.current=!1,Tn.current=Date.now()};return window.addEventListener("pointerdown",Ee,{passive:!0}),()=>window.removeEventListener("pointerdown",Ee)},[]);const Hn=K.useCallback(()=>{if(ri.current){ri.current=!1;return}xn.current||Date.now()-Tn.current>250||(e||n||N)&&ke()},[e,n,N,ke]),an=K.useCallback(Ee=>{var Jt,yr;if(!Ee)return"";const Ze=(Jt=$e[Ee])==null?void 0:Jt.labelOverride;if(Ze)return Ze;const Ht=Ce.find(Qn=>Qn.id===Ee);return Ht?Ht.label:((yr=vo(Ee))==null?void 0:yr.label)??Ee},[Ce,$e]),Ci=nt?{sourceId:nt.sourceId,targetId:nt.targetId}:null;return E.jsxs("div",{style:{width:"100vw",height:"100vh",overflow:"hidden",background:"#030810",position:"relative"},ref:Ee=>{Ee&&Ee.style.setProperty("height","100dvh")},children:[E.jsx(QD,{camera:{position:[0,18,26],fov:45,near:.1,far:200},gl:{antialias:!0,alpha:!1},style:{position:"absolute",inset:0},onPointerMissed:Hn,children:E.jsx(K.Suspense,{fallback:null,children:E.jsx(wN,{activeNodeIds:Ot,selectedStationId:(Yr=n==null?void 0:n.tags)!=null&&Yr.includes("station")?n.id:null,selectedTerritoryId:(qr=n==null?void 0:n.tags)!=null&&qr.includes("territory")?n.id:null,selectedSubdomainId:(Ua=n==null?void 0:n.tags)!=null&&Ua.includes("subdomain")?n.id:null,highlightedStationForTerritory:l,enabledGroups:d,legendVisibility:m,globalConfig:y,paused:T||!!Fe,autoRotate:Mt,onNodeClick:Ue,onConnectionClick:De,customNodes:Ce,customLinks:Ge,customSubdomains:He,removedSubdomainIds:Qt,onCargoHover:Kt,onCargoClick:dn,nodeExtras:$e,previewLink:Ci,activeStepNodeId:xt,activeStepBrief:pn,activeStepLabel:wn,activeStepNum:oe+1,totalSteps:(e==null?void 0:e.nodeIds.length)??1,onStepPrev:Xe,onStepNext:Ie,onStepClose:ke,isFirstStep:oe===0,isLastStep:oe>=((e==null?void 0:e.nodeIds.length)??1)-1,activeStepImages:En,routeActive:!!e||!!N,routeSequencePairs:ft})})}),O&&E.jsx(xO,{fading:$}),w&&E.jsx(aO,{route:w,extraNodes:[...Ce,...He],onSave:fi,onClose:()=>A(null)}),Fe&&!Fe.startsWith("station:")&&E.jsx(yO,{selectedLinkId:Fe,customLinks:Ge,onSelectCargo:Ee=>{ve(Ee)},onClose:()=>xe(null)}),E.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:10,fontFamily:'Inter, "Segoe UI", sans-serif'},children:[E.jsx(_O,{}),!F&&E.jsx(gO,{visible:!!n,onClick:ke}),E.jsxs("header",{style:{position:"absolute",top:18,left:20,right:20,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[E.jsxs("div",{children:[E.jsx("div",{style:{fontSize:F?8:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"#8199a4",marginBottom:4},children:"AI · Design · Product"}),E.jsx("div",{style:{fontSize:F?17:22,fontWeight:700,letterSpacing:"0.18em",textTransform:"uppercase",color:"#e9fbff",textShadow:"0 0 18px rgba(0,212,255,0.2)",lineHeight:1},children:"Marco Morales"}),E.jsx("div",{style:{fontSize:9,letterSpacing:"0.2em",textTransform:"uppercase",color:"#3d5a68",marginTop:5},children:"Thinker, Builder"})]}),!F&&E.jsxs("div",{style:{fontSize:9,letterSpacing:"0.16em",textTransform:"uppercase",color:"#3d5a68",textAlign:"right",lineHeight:2.2},children:[E.jsx("div",{children:"Amsterdam"}),E.jsx("div",{children:"Working Globally"})]})]}),!F&&E.jsxs(E.Fragment,{children:[E.jsx("div",{style:{position:"absolute",top:108,left:16},children:E.jsx(MN,{adminMode:r,activeTab:ut,onTabToggle:Qe,activeRouteId:(e==null?void 0:e.id)??null,enabledGroups:d,onRouteClick:ye,onGroupToggle:Lt,linkMode:at,onToggleLinkMode:it,linkModeSource:tt,linkModeSourceLabel:an(tt),customLinks:Ge,stationForm:Vn,onShowStationForm:()=>Hs({label:"",description:"",imageUrl:"",links:[]}),onStationFormChange:Ee=>Hs(Ze=>Ze?{...Ze,...Ee}:null),onPlaceStation:ee,onCancelStationForm:()=>Hs(null),legendVisibility:m,onToggleLegend:hi,globalConfig:y,onGlobalConfigChange:x,customRoutes:M,onRouteLabelChange:bn,onRouteDelete:ii,onRouteConfigure:vr,onRouteAdd:Ai,onExportSeed:_i,onImportSeed:Si,themes:U,activeThemeId:N,onThemeClick:je,onThemesChange:k,allStations:zt})}),E.jsx("div",{style:{position:"absolute",top:70,right:16},children:E.jsx(yw,{activeRoute:e,selectedNode:n,revealedIds:s,customLinks:Ge,customNodes:Ce,configOpen:ut==="config",nodeExtras:$e,selectedLinkId:Fe,selectedCargo:ge,customSubdomains:He,removedSubdomainIds:Qt,highlightedStationForTerritory:l,onHighlightStationForTerritory:u,onUpdateCustomNode:Pr,onUpdateNodeExtra:xo,onDetachCargo:mt,onDeleteLink:vt,onDeselectLink:rt,onAddCargoToLink:kt,onAddSubdomain:Ft,onRemoveSubdomain:pt,onDeselectCargo:Sn,onSelectCargo:Ee=>ve(Ee),activeStepNodeId:xt,onJumpToStep:ze})}),e&&E.jsx(fO,{route:e,stepIndex:oe,stepLabel:wn,viewAllActive:fe,onPrev:Xe,onNext:Ie,onJumpTo:ze,onViewAll:Y,onExit:ke}),E.jsx("div",{style:{position:"absolute",bottom:18,left:20,fontSize:9,letterSpacing:"0.2em",textTransform:"uppercase",color:"#1e3340"},children:"Amsterdam â Working Globally"}),E.jsx("a",{href:"mailto:[email protected]",style:{position:"absolute",bottom:18,right:20,fontSize:9,letterSpacing:"0.2em",textTransform:"uppercase",color:"#00D4FF",textDecoration:"none",opacity:.7,pointerEvents:"auto",transition:"opacity 0.2s"},onMouseEnter:Ee=>Ee.currentTarget.style.opacity="1",onMouseLeave:Ee=>Ee.currentTarget.style.opacity="0.7",children:"Let's Build What Matters â"})]})]}),F&&E.jsxs(E.Fragment,{children:[E.jsx(KN,{activeTab:G,onTabToggle:Ee=>W(Ze=>Ze===Ee?null:Ee)}),G&&E.jsx(ZN,{activeTab:G,aboutText:y.aboutText??"",customRoutes:M,activeRouteId:(e==null?void 0:e.id)??null,themes:U,activeThemeId:N,onClose:()=>W(null),onRouteClick:lt,onThemeClick:yt}),X&&E.jsx(QN,{onOk:Tt,onCancel:()=>J(null)}),e&&E.jsx(eO,{route:e,stepIndex:oe,stepLabel:wn,viewAllActive:fe,onPrev:Xe,onNext:Ie,onViewAll:Y,onExit:ke}),n&&E.jsx($N,{onClose:Te,children:E.jsx(yw,{mobile:!0,activeRoute:e,selectedNode:n,revealedIds:s,customLinks:Ge,customNodes:Ce,configOpen:!1,nodeExtras:$e,selectedLinkId:Fe,selectedCargo:ge,customSubdomains:He,removedSubdomainIds:Qt,highlightedStationForTerritory:l,onHighlightStationForTerritory:u,onUpdateCustomNode:Pr,onUpdateNodeExtra:xo,onDetachCargo:mt,onDeleteLink:vt,onDeselectLink:rt,onAddCargoToLink:kt,onAddSubdomain:Ft,onRemoveSubdomain:pt,onDeselectCargo:Sn,onSelectCargo:Ee=>ve(Ee),activeStepNodeId:xt,onJumpToStep:ze})})]}),nt&&E.jsx("div",{style:{position:"absolute",inset:0,zIndex:20,pointerEvents:"none"},children:E.jsx(vO,{card:nt,sourceLabel:an(nt.sourceId),targetLabel:an(nt.targetId),onChange:Ee=>et(Ze=>Ze?{...Ze,...Ee}:null),onAddCargo:qe,onConfirm:ce,onCancel:()=>et(null)})})]})}$E().then(()=>{Rw.createRoot(document.getElementById("root")).render(E.jsx(K.StrictMode,{children:E.jsx(SO,{})}))});
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.