PageSourceSearch

https://goatcoin.meme/assets/index-Dx-uAfri.js

js goatcoin.meme collected 2026-10-09 22:41:27 UTC 876,183 bytes, 4,198 lines download raw bytes

vendor: 4,289 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BlueprintPage-DFSr4Z7z.js","assets/BlueprintPage-CseGLq-e.css"])))=>i.map(i=>d[i]);
2(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function t(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=t(r);fetch(r.href,a)}})();const JS="modulepreload",ey=function(s){return"/"+s},Fg={},ty=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let u=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),h=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=u(t.map(d=>{if(d=ey(d),d in Fg)return;Fg[d]=!0;const p=d.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":JS,p||(v.as="script"),v.crossOrigin="",v.href=d,h&&v.setAttribute("nonce",h),document.head.appendChild(v),p)return new Promise((x,M)=>{v.addEventListener("load",x),v.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return r.then(u=>{for(const c of u||[])c.status==="rejected"&&a(c.reason);return e().catch(a)})};var Oh={exports:{}},_a={},kh={exports:{}},vt={};/**
3 * @license React
4 * react.production.min.js
5 *
6 * Copyright (c) Facebook, Inc. and its affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var Og;function ny(){if(Og)return vt;Og=1;var s=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function v(k){return k===null||typeof k!="object"?null:(k=m&&k[m]||k["@@iterator"],typeof k=="function"?k:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,b={};function y(k,Q,De){this.props=k,this.context=Q,this.refs=b,this.updater=De||x}y.prototype.isReactComponent={},y.prototype.setState=function(k,Q){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,Q,"setState")},y.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function S(){}S.prototype=y.prototype;function P(k,Q,De){this.props=k,this.context=Q,this.refs=b,this.updater=De||x}var U=P.prototype=new S;U.constructor=P,M(U,y.prototype),U.isPureReactComponent=!0;var T=Array.isArray,N=Object.prototype.hasOwnProperty,R={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function w(k,Q,De){var He,Be={},ae=null,ve=null;if(Q!=null)for(He in Q.ref!==void 0&&(ve=Q.ref),Q.key!==void 0&&(ae=""+Q.key),Q)N.call(Q,He)&&!F.hasOwnProperty(He)&&(Be[He]=Q[He]);var pe=arguments.length-2;if(pe===1)Be.children=De;else if(1<pe){for(var Fe=Array(pe),Qe=0;Qe<pe;Qe++)Fe[Qe]=arguments[Qe+2];Be.children=Fe}if(k&&k.defaultProps)for(He in pe=k.defaultProps,pe)Be[He]===void 0&&(Be[He]=pe[He]);return{$$typeof:s,type:k,key:ae,ref:ve,props:Be,_owner:R.current}}function L(k,Q){return{$$typeof:s,type:k.type,key:Q,ref:k.ref,props:k.props,_owner:k._owner}}
vendor: 11,623 bytes, lines 10-34
10function z(k){return typeof k=="object"&&k!==null&&k.$$typeof===s}function B(k){var Q={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(De){return Q[De]})}var G=/\/+/g;function J(k,Q){return typeof k=="object"&&k!==null&&k.key!=null?B(""+k.key):Q.toString(36)}function oe(k,Q,De,He,Be){var ae=typeof k;(ae==="undefined"||ae==="boolean")&&(k=null);var ve=!1;if(k===null)ve=!0;else switch(ae){case"string":case"number":ve=!0;break;case"object":switch(k.$$typeof){case s:case e:ve=!0}}if(ve)return ve=k,Be=Be(ve),k=He===""?"."+J(ve,0):He,T(Be)?(De="",k!=null&&(De=k.replace(G,"$&/")+"/"),oe(Be,Q,De,"",function(Qe){return Qe})):Be!=null&&(z(Be)&&(Be=L(Be,De+(!Be.key||ve&&ve.key===Be.key?"":(""+Be.key).replace(G,"$&/")+"/")+k)),Q.push(Be)),1;if(ve=0,He=He===""?".":He+":",T(k))for(var pe=0;pe<k.length;pe++){ae=k[pe];var Fe=He+J(ae,pe);ve+=oe(ae,Q,De,Fe,Be)}else if(Fe=v(k),typeof Fe=="function")for(k=Fe.call(k),pe=0;!(ae=k.next()).done;)ae=ae.value,Fe=He+J(ae,pe++),ve+=oe(ae,Q,De,Fe,Be);else if(ae==="object")throw Q=String(k),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return ve}function Y(k,Q,De){if(k==null)return k;var He=[],Be=0;return oe(k,He,"","",function(ae){return Q.call(De,ae,Be++)}),He}function ie(k){if(k._status===-1){var Q=k._result;Q=Q(),Q.then(function(De){(k._status===0||k._status===-1)&&(k._status=1,k._result=De)},function(De){(k._status===0||k._status===-1)&&(k._status=2,k._result=De)}),k._status===-1&&(k._status=0,k._result=Q)}if(k._status===1)return k._result.default;throw k._result}var K={current:null},$={transition:null},le={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:$,ReactCurrentOwner:R};function ue(){throw Error("act(...) is not supported in production builds of React.")}return vt.Children={map:Y,forEach:function(k,Q,De){Y(k,function(){Q.apply(this,arguments)},De)},count:function(k){var Q=0;return Y(k,function(){Q++}),Q},toArray:function(k){return Y(k,function(Q){return Q})||[]},only:function(k){if(!z(k))throw Error("React.Children.only expected to receive a single React element child.");return k}},vt.Component=y,vt.Fragment=t,vt.Profiler=r,vt.PureComponent=P,vt.StrictMode=n,vt.Suspense=h,vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=le,vt.act=ue,vt.cloneElement=function(k,Q,De){if(k==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+k+".");var He=M({},k.props),Be=k.key,ae=k.ref,ve=k._owner;if(Q!=null){if(Q.ref!==void 0&&(ae=Q.ref,ve=R.current),Q.key!==void 0&&(Be=""+Q.key),k.type&&k.type.defaultProps)var pe=k.type.defaultProps;for(Fe in Q)N.call(Q,Fe)&&!F.hasOwnProperty(Fe)&&(He[Fe]=Q[Fe]===void 0&&pe!==void 0?pe[Fe]:Q[Fe])}var Fe=arguments.length-2;if(Fe===1)He.children=De;else if(1<Fe){pe=Array(Fe);for(var Qe=0;Qe<Fe;Qe++)pe[Qe]=arguments[Qe+2];He.children=pe}return{$$typeof:s,type:k.type,key:Be,ref:ae,props:He,_owner:ve}},vt.createContext=function(k){return k={$$typeof:u,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},k.Provider={$$typeof:a,_context:k},k.Consumer=k},vt.createElement=w,vt.createFactory=function(k){var Q=w.bind(null,k);return Q.type=k,Q},vt.createRef=function(){return{current:null}},vt.forwardRef=function(k){return{$$typeof:c,render:k}},vt.isValidElement=z,vt.lazy=function(k){return{$$typeof:p,_payload:{_status:-1,_result:k},_init:ie}},vt.memo=function(k,Q){return{$$typeof:d,type:k,compare:Q===void 0?null:Q}},vt.startTransition=function(k){var Q=$.transition;$.transition={};try{k()}finally{$.transition=Q}},vt.unstable_act=ue,vt.useCallback=function(k,Q){return K.current.useCallback(k,Q)},vt.useContext=function(k){return K.current.useContext(k)},vt.useDebugValue=function(){},vt.useDeferredValue=function(k){return K.current.useDeferredValue(k)},vt.useEffect=function(k,Q){return K.current.useEffect(k,Q)},vt.useId=function(){return K.current.useId()},vt.useImperativeHandle=function(k,Q,De){return K.current.useImperativeHandle(k,Q,De)},vt.useInsertionEffect=function(k,Q){return K.current.useInsertionEffect(k,Q)},vt.useLayoutEffect=function(k,Q){return K.current.useLayoutEffect(k,Q)},vt.useMemo=function(k,Q){return K.current.useMemo(k,Q)},vt.useReducer=function(k,Q,De){return K.current.useReducer(k,Q,De)},vt.useRef=function(k){return K.current.useRef(k)},vt.useState=function(k){return K.current.useState(k)},vt.useSyncExternalStore=function(k,Q,De){return K.current.useSyncExternalStore(k,Q,De)},vt.useTransition=function(){return K.current.useTransition()},vt.version="18.3.1",vt}var kg;function Xd(){return kg||(kg=1,kh.exports=ny()),kh.exports}/**
11 * @license React
12 * react-jsx-runtime.production.min.js
13 *
14 * Copyright (c) Facebook, Inc. and its affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var Bg;function iy(){if(Bg)return _a;Bg=1;var s=Xd(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(c,h,d){var p,m={},v=null,x=null;d!==void 0&&(v=""+d),h.key!==void 0&&(v=""+h.key),h.ref!==void 0&&(x=h.ref);for(p in h)n.call(h,p)&&!a.hasOwnProperty(p)&&(m[p]=h[p]);if(c&&c.defaultProps)for(p in h=c.defaultProps,h)m[p]===void 0&&(m[p]=h[p]);return{$$typeof:e,type:c,key:v,ref:x,props:m,_owner:r.current}}return _a.Fragment=t,_a.jsx=u,_a.jsxs=u,_a}var zg;function sy(){return zg||(zg=1,Oh.exports=iy()),Oh.exports}var D=sy(),bt=Xd(),ql={},Bh={exports:{}},Xn={},zh={exports:{}},Vh={};/**
19 * @license React
20 * scheduler.production.min.js
21 *
22 * Copyright (c) Facebook, Inc. and its affiliates.
23 *
24 * This source code is licensed under the MIT license found in the
25 * LICENSE file in the root directory of this source tree.
26 */var Vg;function ry(){return Vg||(Vg=1,(function(s){function e($,le){var ue=$.length;$.push(le);e:for(;0<ue;){var k=ue-1>>>1,Q=$[k];if(0<r(Q,le))$[k]=le,$[ue]=Q,ue=k;else break e}}function t($){return $.length===0?null:$[0]}function n($){if($.length===0)return null;var le=$[0],ue=$.pop();if(ue!==le){$[0]=ue;e:for(var k=0,Q=$.length,De=Q>>>1;k<De;){var He=2*(k+1)-1,Be=$[He],ae=He+1,ve=$[ae];if(0>r(Be,ue))ae<Q&&0>r(ve,Be)?($[k]=ve,$[ae]=ue,k=ae):($[k]=Be,$[He]=ue,k=He);else if(ae<Q&&0>r(ve,ue))$[k]=ve,$[ae]=ue,k=ae;else break e}}return le}function r($,le){var ue=$.sortIndex-le.sortIndex;return ue!==0?ue:$.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;s.unstable_now=function(){return a.now()}}else{var u=Date,c=u.now();s.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,m=null,v=3,x=!1,M=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U($){for(var le=t(d);le!==null;){if(le.callback===null)n(d);else if(le.startTime<=$)n(d),le.sortIndex=le.expirationTime,e(h,le);else break;le=t(d)}}function T($){if(b=!1,U($),!M)if(t(h)!==null)M=!0,ie(N);else{var le=t(d);le!==null&&K(T,le.startTime-$)}}function N($,le){M=!1,b&&(b=!1,S(w),w=-1),x=!0;var ue=v;try{for(U(le),m=t(h);m!==null&&(!(m.expirationTime>le)||$&&!B());){var k=m.callback;if(typeof k=="function"){m.callback=null,v=m.priorityLevel;var Q=k(m.expirationTime<=le);le=s.unstable_now(),typeof Q=="function"?m.callback=Q:m===t(h)&&n(h),U(le)}else n(h);m=t(h)}if(m!==null)var De=!0;else{var He=t(d);He!==null&&K(T,He.startTime-le),De=!1}return De}finally{m=null,v=ue,x=!1}}var R=!1,F=null,w=-1,L=5,z=-1;function B(){return!(s.unstable_now()-z<L)}function G(){if(F!==null){var $=s.unstable_now();z=$;var le=!0;try{le=F(!0,$)}finally{le?J():(R=!1,F=null)}}else R=!1}var J;if(typeof P=="function")J=function(){P(G)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,Y=oe.port2;oe.port1.onmessage=G,J=function(){Y.postMessage(null)}}else J=function(){y(G,0)};function ie($){F=$,R||(R=!0,J())}function K($,le){w=y(function(){$(s.unstable_now())},le)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function($){$.callback=null},s.unstable_continueExecution=function(){M||x||(M=!0,ie(N))},s.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<$?Math.floor(1e3/$):5},s.unstable_getCurrentPriorityLevel=function(){return v},s.unstable_getFirstCallbackNode=function(){return t(h)},s.unstable_next=function($){switch(v){case 1:case 2:case 3:var le=3;break;default:le=v}var ue=v;v=le;try{return $()}finally{v=ue}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function($,le){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ue=v;v=$;try{return le()}finally{v=ue}},s.unstable_scheduleCallback=function($,le,ue){var k=s.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?k+ue:k):ue=k,$){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=ue+Q,$={id:p++,callback:le,priorityLevel:$,startTime:ue,expirationTime:Q,sortIndex:-1},ue>k?($.sortIndex=ue,e(d,$),t(h)===null&&$===t(d)&&(b?(S(w),w=-1):b=!0,K(T,ue-k))):($.sortIndex=Q,e(h,$),M||x||(M=!0,ie(N))),$},s.unstable_shouldYield=B,s.unstable_wrapCallback=function($){var le=v;return function(){var ue=v;v=le;try{return $.apply(this,arguments)}finally{v=ue}}}})(Vh)),Vh}var Hg;function oy(){return Hg||(Hg=1,zh.exports=ry()),zh.exports}/**
27 * @license React
28 * react-dom.production.min.js
29 *
30 * Copyright (c) Facebook, Inc. and its affiliates.
31 *
32 * This source code is licensed under the MIT license found in the
33 * LICENSE file in the root directory of this source tree.
34 */var Gg;function ay(){if(Gg)return Xn;Gg=1;var s=Xd(),e=oy();function t(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,l=1;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,r={};function a(i,o){u(i,o),u(i+"Capture",o)}function u(i,o){for(r[i]=o,i=0;i<o.length;i++)n.add(o[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=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(i){return h.call(m,i)?!0:h.call(p,i)?!1:d.test(i)?m[i]=!0:(p[i]=!0,!1)}function x(i,o,l,f){if(l!==null&&l.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return f?!1:l!==null?!l.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function M(i,o,l,f){if(o===null||typeof o>"u"||x(i,o,l,f))return!0;
vendor: 27,769 bytes, lines 34-38
34if(f)return!1;if(l!==null)switch(l.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function b(i,o,l,f,g,_,C){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=l,this.propertyName=i,this.type=o,this.sanitizeURL=_,this.removeEmptyString=C}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){y[i]=new b(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];y[o]=new b(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){y[i]=new b(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){y[i]=new b(i,2,!1,i,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(i){y[i]=new b(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){y[i]=new b(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){y[i]=new b(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){y[i]=new b(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){y[i]=new b(i,5,!1,i.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function P(i){return i[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(i){var o=i.replace(S,P);y[o]=new b(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(S,P);y[o]=new b(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(S,P);y[o]=new b(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){y[i]=new b(i,1,!1,i.toLowerCase(),null,!1,!1)}),y.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){y[i]=new b(i,1,!1,i.toLowerCase(),null,!0,!0)});function U(i,o,l,f){var g=y.hasOwnProperty(o)?y[o]:null;(g!==null?g.type!==0:f||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(M(o,l,g,f)&&(l=null),f||g===null?v(o)&&(l===null?i.removeAttribute(o):i.setAttribute(o,""+l)):g.mustUseProperty?i[g.propertyName]=l===null?g.type===3?!1:"":l:(o=g.attributeName,f=g.attributeNamespace,l===null?i.removeAttribute(o):(g=g.type,l=g===3||g===4&&l===!0?"":""+l,f?i.setAttributeNS(f,o,l):i.setAttribute(o,l))))}var T=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,N=Symbol.for("react.element"),R=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),B=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),$=Symbol.iterator;function le(i){return i===null||typeof i!="object"?null:(i=$&&i[$]||i["@@iterator"],typeof i=="function"?i:null)}var ue=Object.assign,k;function Q(i){if(k===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);k=o&&o[1]||""}return`
35`+k+i}var De=!1;function He(i,o){if(!i||De)return"";De=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(he){var f=he}Reflect.construct(i,[],o)}else{try{o.call()}catch(he){f=he}i.call(o.prototype)}else{try{throw Error()}catch(he){f=he}i()}}catch(he){if(he&&f&&typeof he.stack=="string"){for(var g=he.stack.split(`
36`),_=f.stack.split(`
37`),C=g.length-1,O=_.length-1;1<=C&&0<=O&&g[C]!==_[O];)O--;for(;1<=C&&0<=O;C--,O--)if(g[C]!==_[O]){if(C!==1||O!==1)do if(C--,O--,0>O||g[C]!==_[O]){var V=`
38`+g[C].replace(" at new "," at ");return i.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",i.displayName)),V}while(1<=C&&0<=O);break}}}finally{De=!1,Error.prepareStackTrace=l}return(i=i?i.displayName||i.name:"")?Q(i):""}function Be(i){switch(i.tag){case 5:return Q(i.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return i=He(i.type,!1),i;case 11:return i=He(i.type.render,!1),i;case 1:return i=He(i.type,!0),i;default:return""}}function ae(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case F:return"Fragment";case R:return"Portal";case L:return"Profiler";case w:return"StrictMode";case J:return"Suspense";case oe:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case B:return(i.displayName||"Context")+".Consumer";case z:return(i._context.displayName||"Context")+".Provider";case G:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Y:return o=i.displayName||null,o!==null?o:ae(i.type)||"Memo";case ie:o=i._payload,i=i._init;try{return ae(i(o))}catch{}}return null}function ve(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(o);case 8:return o===w?"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 o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function pe(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Fe(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Qe(i){var o=Fe(i)?"checked":"value",l=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),f=""+i[o];if(!i.hasOwnProperty(o)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var g=l.get,_=l.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return g.call(this)},set:function(C){f=""+C,_.call(this,C)}}),Object.defineProperty(i,o,{enumerable:l.enumerable}),{getValue:function(){return f},setValue:function(C){f=""+C},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Je(i){i._valueTracker||(i._valueTracker=Qe(i))}function Ft(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var l=o.getValue(),f="";return i&&(f=Fe(i)?i.checked?"true":"false":i.value),i=f,i!==l?(o.setValue(i),!0):!1}function ht(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Mt(i,o){var l=o.checked;return ue({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??i._wrapperState.initialChecked})}function _t(i,o){var l=o.defaultValue==null?"":o.defaultValue,f=o.checked!=null?o.checked:o.defaultChecked;l=pe(o.value!=null?o.value:l),i._wrapperState={initialChecked:f,initialValue:l,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ft(i,o){o=o.checked,o!=null&&U(i,"checked",o,!1)}function kt(i,o){ft(i,o);var l=pe(o.value),f=o.type;if(l!=null)f==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+l):i.value!==""+l&&(i.value=""+l);else if(f==="submit"||f==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?Gt(i,o.type,l):o.hasOwnProperty("defaultValue")&&Gt(i,o.type,pe(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function Ht(i,o,l){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var f=o.type;if(!(f!=="submit"&&f!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,l||o===i.value||(i.value=o),i.defaultValue=o}l=i.name,l!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,l!==""&&(i.name=l)}function Gt(i,o,l){(o!=="number"||ht(i.ownerDocument)!==i)&&(l==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+l&&(i.defaultValue=""+l))}var Bt=Array.isArray;function tt(i,o,l,f){if(i=i.options,o){o={};for(var g=0;g<l.length;g++)o["$"+l[g]]=!0;for(l=0;l<i.length;l++)g=o.hasOwnProperty("$"+i[l].value),i[l].selected!==g&&(i[l].selected=g),g&&f&&(i[l].defaultSelected=!0)}else{for(l=""+pe(l),o=null,g=0;g<i.length;g++){if(i[g].value===l){i[g].selected=!0,f&&(i[g].defaultSelected=!0);return}o!==null||i[g].disabled||(o=i[g])}o!==null&&(o.selected=!0)}}function mt(i,o){if(o.dangerouslySetInnerHTML!=null)throw Error(t(91));return ue({},o,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function H(i,o){var l=o.value;if(l==null){if(l=o.children,o=o.defaultValue,l!=null){if(o!=null)throw Error(t(92));if(Bt(l)){if(1<l.length)throw Error(t(93));l=l[0]}o=l}o==null&&(o=""),l=o}i._wrapperState={initialValue:pe(l)}}function gn(i,o){var l=pe(o.value),f=pe(o.defaultValue);l!=null&&(l=""+l,l!==i.value&&(i.value=l),o.defaultValue==null&&i.defaultValue!==l&&(i.defaultValue=l)),f!=null&&(i.defaultValue=""+f)}function Ct(i){var o=i.textContent;o===i._wrapperState.initialValue&&o!==""&&o!==null&&(i.value=o)}function I(i){switch(i){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 E(i,o){return i==null||i==="http://www.w3.org/1999/xhtml"?I(o):i==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var j,re=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,l,f,g){MSApp.execUnsafeLocalFunction(function(){return i(o,l,f,g)})}:i})(function(i,o){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=o;else{for(j=j||document.createElement("div"),j.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=j.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function fe(i,o){if(o){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=o;return}}i.textContent=o}var Me={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},Re=["Webkit","ms","Moz","O"];Object.keys(Me).forEach(function(i){Re.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),Me[o]=Me[i]})});function de(i,o,l){return o==null||typeof o=="boolean"||o===""?"":l||typeof o!="number"||o===0||Me.hasOwnProperty(i)&&Me[i]?(""+o).trim():o+"px"}function ge(i,o){i=i.style;for(var l in o)if(o.hasOwnProperty(l)){var f=l.indexOf("--")===0,g=de(l,o[l],f);l==="float"&&(l="cssFloat"),f?i.setProperty(l,g):i[l]=g}}var Ne=ue({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 Ye(i,o){if(o){if(Ne[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(t(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(t(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(t(61))}if(o.style!=null&&typeof o.style!="object")throw Error(t(62))}}function Le(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){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 Ae=null;function et(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var nt=null,rt=null,W=null;function Ce(i){if(i=ia(i)){if(typeof nt!="function")throw Error(t(280));var o=i.stateNode;o&&(o=ll(o),nt(i.stateNode,i.type,o))}}function me(i){rt?W?W.push(i):W=[i]:rt=i}function Pe(){if(rt){var i=rt,o=W;if(W=rt=null,Ce(i),o)for(i=0;i<o.length;i++)Ce(o[i])}}function Ie(i,o){return i(o)}function _e(){}var Xe=!1;function Ge(i,o,l){if(Xe)return i(o,l);Xe=!0;try{return Ie(i,o,l)}finally{Xe=!1,(rt!==null||W!==null)&&(_e(),Pe())}}function Ut(i,o){var l=i.stateNode;if(l===null)return null;var f=ll(l);if(f===null)return null;l=f[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(t(231,o,typeof l));return l}var Pt=!1;if(c)try{var En={};Object.defineProperty(En,"passive",{get:function(){Pt=!0}}),window.addEventListener("test",En,En),window.removeEventListener("test",En,En)}catch{Pt=!1}function si(i,o,l,f,g,_,C,O,V){var he=Array.prototype.slice.call(arguments,3);try{o.apply(l,he)}catch(Se){this.onError(Se)}}var $s=!1,Pr=null,qs=!1,Ys=null,oc={onError:function(i){$s=!0,Pr=i}};function Wa(i,o,l,f,g,_,C,O,V){$s=!1,Pr=null,si.apply(oc,arguments)}function Xa(i,o,l,f,g,_,C,O,V){if(Wa.apply(this,arguments),$s){if($s){var he=Pr;$s=!1,Pr=null}else throw Error(t(198));qs||(qs=!0,Ys=he)}}function Nn(i){var o=i,l=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(l=o.return),i=o.return;while(i)}return o.tag===3?l:null}function Nr(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function Oo(i){if(Nn(i)!==i)throw Error(t(188))}function $a(i){var o=i.alternate;if(!o){if(o=Nn(i),o===null)throw Error(t(188));return o!==i?null:i}for(var l=i,f=o;;){var g=l.return;if(g===null)break;var _=g.alternate;if(_===null){if(f=g.return,f!==null){l=f;continue}break}if(g.child===_.child){for(_=g.child;_;){if(_===l)return Oo(g),i;if(_===f)return Oo(g),o;_=_.sibling}throw Error(t(188))}if(l.return!==f.return)l=g,f=_;else{for(var C=!1,O=g.child;O;){if(O===l){C=!0,l=g,f=_;break}if(O===f){C=!0,f=g,l=_;break}O=O.sibling}if(!C){for(O=_.child;O;){if(O===l){C=!0,l=_,f=g;break}if(O===f){C=!0,f=_,l=g;break}O=O.sibling}if(!C)throw Error(t(189))}}if(l.alternate!==f)throw Error(t(190))}if(l.tag!==3)throw Error(t(188));return l.stateNode.current===l?i:o}function Ks(i){return i=$a(i),i!==null?ko(i):null}function ko(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var o=ko(i);if(o!==null)return o;i=i.sibling}return null}var js=e.unstable_scheduleCallback,Bo=e.unstable_cancelCallback,qa=e.unstable_shouldYield,ac=e.unstable_requestPaint,Kt=e.unstable_now,lc=e.unstable_getCurrentPriorityLevel,zo=e.unstable_ImmediatePriority,A=e.unstable_UserBlockingPriority,q=e.unstable_NormalPriority,ce=e.unstable_LowPriority,te=e.unstable_IdlePriority,ee=null,Te=null;function ze(i){if(Te&&typeof Te.onCommitFiberRoot=="function")try{Te.onCommitFiberRoot(ee,i,void 0,(i.current.flags&128)===128)}catch{}}var be=Math.clz32?Math.clz32:lt,$e=Math.log,Ze=Math.LN2;function lt(i){return i>>>=0,i===0?32:31-($e(i)/Ze|0)|0}var ut=64,Ke=4194304;function yt(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function zt(i,o){var l=i.pendingLanes;if(l===0)return 0;var f=0,g=i.suspendedLanes,_=i.pingedLanes,C=l&268435455;if(C!==0){var O=C&~g;O!==0?f=yt(O):(_&=C,_!==0&&(f=yt(_)))}else C=l&~g,C!==0?f=yt(C):_!==0&&(f=yt(_));if(f===0)return 0;if(o!==0&&o!==f&&(o&g)===0&&(g=f&-f,_=o&-o,g>=_||g===16&&(_&4194240)!==0))return o;if((f&4)!==0&&(f|=l&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=f;0<o;)l=31-be(o),g=1<<l,f|=i[l],o&=~g;return f}function qt(i,o){switch(i){case 1:case 2:case 4:return o+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 o+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 Lt(i,o){for(var l=i.suspendedLanes,f=i.pingedLanes,g=i.expirationTimes,_=i.pendingLanes;0<_;){var C=31-be(_),O=1<<C,V=g[C];V===-1?((O&l)===0||(O&f)!==0)&&(g[C]=qt(O,o)):V<=o&&(i.expiredLanes|=O),_&=~O}}function nn(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Oe(){var i=ut;return ut<<=1,(ut&4194240)===0&&(ut=64),i}function vn(i){for(var o=[],l=0;31>l;l++)o.push(i);return o}function pt(i,o,l){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-be(o),i[o]=l}function kn(i,o){var l=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var f=i.eventTimes;for(i=i.expirationTimes;0<l;){var g=31-be(l),_=1<<g;o[g]=0,f[g]=-1,i[g]=-1,l&=~_}}function Bn(i,o){var l=i.entangledLanes|=o;for(i=i.entanglements;l;){var f=31-be(l),g=1<<f;g&o|i[f]&o&&(i[f]|=o),l&=~g}}var gt=0;function Wi(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Nt,Wt,pi,Dt,mi,Pi=!1,Qs=[],ps=null,ms=null,gs=null,Vo=new Map,Ho=new Map,vs=[],yx="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 xp(i,o){switch(i){case"focusin":case"focusout":ps=null;break;case"dragenter":case"dragleave":ms=null;break;case"mouseover":case"mouseout":gs=null;break;case"pointerover":case"pointerout":Vo.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ho.delete(o.pointerId)}}function Go(i,o,l,f,g,_){return i===null||i.nativeEvent!==_?(i={blockedOn:o,domEventName:l,eventSystemFlags:f,nativeEvent:_,targetContainers:[g]},o!==null&&(o=ia(o),o!==null&&Wt(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),i)}function Mx(i,o,l,f,g){switch(o){case"focusin":return ps=Go(ps,i,o,l,f,g),!0;case"dragenter":return ms=Go(ms,i,o,l,f,g),!0;case"mouseover":return gs=Go(gs,i,o,l,f,g),!0;case"pointerover":var _=g.pointerId;return Vo.set(_,Go(Vo.get(_)||null,i,o,l,f,g)),!0;case"gotpointercapture":return _=g.pointerId,Ho.set(_,Go(Ho.get(_)||null,i,o,l,f,g)),!0}return!1}function Sp(i){var o=Zs(i.target);if(o!==null){var l=Nn(o);if(l!==null){if(o=l.tag,o===13){if(o=Nr(l),o!==null){i.blockedOn=o,mi(i.priority,function(){pi(l)});return}}else if(o===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Ya(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var l=cc(i.domEventName,i.eventSystemFlags,o[0],i.nativeEvent);if(l===null){l=i.nativeEvent;var f=new l.constructor(l.type,l);Ae=f,l.target.dispatchEvent(f),Ae=null}else return o=ia(l),o!==null&&Wt(o),i.blockedOn=l,!1;o.shift()}return!0}function yp(i,o,l){Ya(i)&&l.delete(o)}function Ex(){Pi=!1,ps!==null&&Ya(ps)&&(ps=null),ms!==null&&Ya(ms)&&(ms=null),gs!==null&&Ya(gs)&&(gs=null),Vo.forEach(yp),Ho.forEach(yp)}function Wo(i,o){i.blockedOn===o&&(i.blockedOn=null,Pi||(Pi=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Ex)))}function Xo(i){function o(g){return Wo(g,i)}if(0<Qs.length){Wo(Qs[0],i);for(var l=1;l<Qs.length;l++){var f=Qs[l];f.blockedOn===i&&(f.blockedOn=null)}}for(ps!==null&&Wo(ps,i),ms!==null&&Wo(ms,i),gs!==null&&Wo(gs,i),Vo.forEach(o),Ho.forEach(o),l=0;l<vs.length;l++)f=vs[l],f.blockedOn===i&&(f.blockedOn=null);for(;0<vs.length&&(l=vs[0],l.blockedOn===null);)Sp(l),l.blockedOn===null&&vs.shift()}var Lr=T.ReactCurrentBatchConfig,Ka=!0;function wx(i,o,l,f){var g=gt,_=Lr.transition;Lr.transition=null;try{gt=1,uc(i,o,l,f)}finally{gt=g,Lr.transition=_}}function bx(i,o,l,f){var g=gt,_=Lr.transition;Lr.transition=null;try{gt=4,uc(i,o,l,f)}finally{gt=g,Lr.transition=_}}function uc(i,o,l,f){if(Ka){var g=cc(i,o,l,f);if(g===null)Cc(i,o,f,ja,l),xp(i,f);else if(Mx(g,i,o,l,f))f.stopPropagation();else if(xp(i,f),o&4&&-1<yx.indexOf(i)){for(;g!==null;){var _=ia(g);if(_!==null&&Nt(_),_=cc(i,o,l,f),_===null&&Cc(i,o,f,ja,l),_===g)break;g=_}g!==null&&f.stopPropagation()}else Cc(i,o,f,null,l)}}var ja=null;function cc(i,o,l,f){if(ja=null,i=et(f),i=Zs(i),i!==null)if(o=Nn(i),o===null)i=null;else if(l=o.tag,l===13){if(i=Nr(o),i!==null)return i;i=null}else if(l===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null);return ja=i,null}function Mp(i){switch(i){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(lc()){case zo:return 1;case A:return 4;case q:case ce:return 16;case te:return 536870912;default:return 16}default:return 16}}var _s=null,hc=null,Qa=null;function Ep(){if(Qa)return Qa;var i,o=hc,l=o.length,f,g="value"in _s?_s.value:_s.textContent,_=g.length;for(i=0;i<l&&o[i]===g[i];i++);var C=l-i;for(f=1;f<=C&&o[l-f]===g[_-f];f++);return Qa=g.slice(i,1<f?1-f:void 0)}function Za(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Ja(){return!0}function wp(){return!1}function Kn(i){function o(l,f,g,_,C){this._reactName=l,this._targetInst=g,this.type=f,this.nativeEvent=_,this.target=C,this.currentTarget=null;for(var O in i)i.hasOwnProperty(O)&&(l=i[O],this[O]=l?l(_):_[O]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Ja:wp,this.isPropagationStopped=wp,this}return ue(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ja)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ja)},persist:function(){},isPersistent:Ja}),o}var Dr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fc=Kn(Dr),$o=ue({},Dr,{view:0,detail:0}),Tx=Kn($o),dc,pc,qo,el=ue({},$o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==qo&&(qo&&i.type==="mousemove"?(dc=i.screenX-qo.screenX,pc=i.screenY-qo.screenY):pc=dc=0,qo=i),dc)},movementY:function(i){return"movementY"in i?i.movementY:pc}}),bp=Kn(el),Cx=ue({},el,{dataTransfer:0}),Ax=Kn(Cx),Rx=ue({},$o,{relatedTarget:0}),mc=Kn(Rx),Px=ue({},Dr,{animationName:0,elapsedTime:0,pseudoElement:0}),Nx=Kn(Px),Lx=ue({},Dr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Dx=Kn(Lx),Ix=ue({},Dr,{data:0}),Tp=Kn(Ix),Ux={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fx={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"},Ox={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kx(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=Ox[i])?!!o[i]:!1}function gc(){return kx}var Bx=ue({},$o,{key:function(i){if(i.key){var o=Ux[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Za(i),i===13?"Enter":String.fromCharCode(i)):i.type==="
38keydown"||i.type==="keyup"?Fx[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gc,charCode:function(i){return i.type==="keypress"?Za(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Za(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),zx=Kn(Bx),Vx=ue({},el,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cp=Kn(Vx),Hx=ue({},$o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gc}),Gx=Kn(Hx),Wx=ue({},Dr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xx=Kn(Wx),$x=ue({},el,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),qx=Kn($x),Yx=[9,13,27,32],vc=c&&"CompositionEvent"in window,Yo=null;c&&"documentMode"in document&&(Yo=document.documentMode);var Kx=c&&"TextEvent"in window&&!Yo,Ap=c&&(!vc||Yo&&8<Yo&&11>=Yo),Rp=" ",Pp=!1;function Np(i,o){switch(i){case"keyup":return Yx.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lp(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ir=!1;function jx(i,o){switch(i){case"compositionend":return Lp(o);case"keypress":return o.which!==32?null:(Pp=!0,Rp);case"textInput":return i=o.data,i===Rp&&Pp?null:i;default:return null}}function Qx(i,o){if(Ir)return i==="compositionend"||!vc&&Np(i,o)?(i=Ep(),Qa=hc=_s=null,Ir=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Ap&&o.locale!=="ko"?null:o.data;default:return null}}var Zx={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 Dp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Zx[i.type]:o==="textarea"}function Ip(i,o,l,f){me(f),o=rl(o,"onChange"),0<o.length&&(l=new fc("onChange","change",null,l,f),i.push({event:l,listeners:o}))}var Ko=null,jo=null;function Jx(i){Zp(i,0)}function tl(i){var o=Br(i);if(Ft(o))return i}function eS(i,o){if(i==="change")return o}var Up=!1;if(c){var _c;if(c){var xc="oninput"in document;if(!xc){var Fp=document.createElement("div");Fp.setAttribute("oninput","return;"),xc=typeof Fp.oninput=="function"}_c=xc}else _c=!1;Up=_c&&(!document.documentMode||9<document.documentMode)}function Op(){Ko&&(Ko.detachEvent("onpropertychange",kp),jo=Ko=null)}function kp(i){if(i.propertyName==="value"&&tl(jo)){var o=[];Ip(o,jo,i,et(i)),Ge(Jx,o)}}function tS(i,o,l){i==="focusin"?(Op(),Ko=o,jo=l,Ko.attachEvent("onpropertychange",kp)):i==="focusout"&&Op()}function nS(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return tl(jo)}function iS(i,o){if(i==="click")return tl(o)}function sS(i,o){if(i==="input"||i==="change")return tl(o)}function rS(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var gi=typeof Object.is=="function"?Object.is:rS;function Qo(i,o){if(gi(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var l=Object.keys(i),f=Object.keys(o);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var g=l[f];if(!h.call(o,g)||!gi(i[g],o[g]))return!1}return!0}function Bp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function zp(i,o){var l=Bp(i);i=0;for(var f;l;){if(l.nodeType===3){if(f=i+l.textContent.length,i<=o&&f>=o)return{node:l,offset:o-i};i=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Bp(l)}}function Vp(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Vp(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Hp(){for(var i=window,o=ht();o instanceof i.HTMLIFrameElement;){try{var l=typeof o.contentWindow.location.href=="string"}catch{l=!1}if(l)i=o.contentWindow;else break;o=ht(i.document)}return o}function Sc(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function oS(i){var o=Hp(),l=i.focusedElem,f=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&Vp(l.ownerDocument.documentElement,l)){if(f!==null&&Sc(l)){if(o=f.start,i=f.end,i===void 0&&(i=o),"selectionStart"in l)l.selectionStart=o,l.selectionEnd=Math.min(i,l.value.length);else if(i=(o=l.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var g=l.textContent.length,_=Math.min(f.start,g);f=f.end===void 0?_:Math.min(f.end,g),!i.extend&&_>f&&(g=f,f=_,_=g),g=zp(l,_);var C=zp(l,f);g&&C&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==C.node||i.focusOffset!==C.offset)&&(o=o.createRange(),o.setStart(g.node,g.offset),i.removeAllRanges(),_>f?(i.addRange(o),i.extend(C.node,C.offset)):(o.setEnd(C.node,C.offset),i.addRange(o)))}}for(o=[],i=l;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<o.length;l++)i=o[l],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var aS=c&&"documentMode"in document&&11>=document.documentMode,Ur=null,yc=null,Zo=null,Mc=!1;function Gp(i,o,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Mc||Ur==null||Ur!==ht(f)||(f=Ur,"selectionStart"in f&&Sc(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focu
vendor: 13,089 bytes, lines 38-39
38sNode:f.focusNode,focusOffset:f.focusOffset}),Zo&&Qo(Zo,f)||(Zo=f,f=rl(yc,"onSelect"),0<f.length&&(o=new fc("onSelect","select",null,o,l),i.push({event:o,listeners:f}),o.target=Ur)))}function nl(i,o){var l={};return l[i.toLowerCase()]=o.toLowerCase(),l["Webkit"+i]="webkit"+o,l["Moz"+i]="moz"+o,l}var Fr={animationend:nl("Animation","AnimationEnd"),animationiteration:nl("Animation","AnimationIteration"),animationstart:nl("Animation","AnimationStart"),transitionend:nl("Transition","TransitionEnd")},Ec={},Wp={};c&&(Wp=document.createElement("div").style,"AnimationEvent"in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),"TransitionEvent"in window||delete Fr.transitionend.transition);function il(i){if(Ec[i])return Ec[i];if(!Fr[i])return i;var o=Fr[i],l;for(l in o)if(o.hasOwnProperty(l)&&l in Wp)return Ec[i]=o[l];return i}var Xp=il("animationend"),$p=il("animationiteration"),qp=il("animationstart"),Yp=il("transitionend"),Kp=new Map,jp="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 xs(i,o){Kp.set(i,o),a(o,[i])}for(var wc=0;wc<jp.length;wc++){var bc=jp[wc],lS=bc.toLowerCase(),uS=bc[0].toUpperCase()+bc.slice(1);xs(lS,"on"+uS)}xs(Xp,"onAnimationEnd"),xs($p,"onAnimationIteration"),xs(qp,"onAnimationStart"),xs("dblclick","onDoubleClick"),xs("focusin","onFocus"),xs("focusout","onBlur"),xs(Yp,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jo="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(" "),cS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jo));function Qp(i,o,l){var f=i.type||"unknown-event";i.currentTarget=l,Xa(f,o,void 0,i),i.currentTarget=null}function Zp(i,o){o=(o&4)!==0;for(var l=0;l<i.length;l++){var f=i[l],g=f.event;f=f.listeners;e:{var _=void 0;if(o)for(var C=f.length-1;0<=C;C--){var O=f[C],V=O.instance,he=O.currentTarget;if(O=O.listener,V!==_&&g.isPropagationStopped())break e;Qp(g,O,he),_=V}else for(C=0;C<f.length;C++){if(O=f[C],V=O.instance,he=O.currentTarget,O=O.listener,V!==_&&g.isPropagationStopped())break e;Qp(g,O,he),_=V}}}if(qs)throw i=Ys,qs=!1,Ys=null,i}function Xt(i,o){var l=o[Dc];l===void 0&&(l=o[Dc]=new Set);var f=i+"__bubble";l.has(f)||(Jp(o,i,2,!1),l.add(f))}function Tc(i,o,l){var f=0;o&&(f|=4),Jp(l,i,f,o)}var sl="_reactListening"+Math.random().toString(36).slice(2);function ea(i){if(!i[sl]){i[sl]=!0,n.forEach(function(l){l!=="selectionchange"&&(cS.has(l)||Tc(l,!1,i),Tc(l,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[sl]||(o[sl]=!0,Tc("selectionchange",!1,o))}}function Jp(i,o,l,f){switch(Mp(o)){case 1:var g=wx;break;case 4:g=bx;break;default:g=uc}l=g.bind(null,o,l,i),g=void 0,!Pt||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),f?g!==void 0?i.addEventListener(o,l,{capture:!0,passive:g}):i.addEventListener(o,l,!0):g!==void 0?i.addEventListener(o,l,{passive:g}):i.addEventListener(o,l,!1)}function Cc(i,o,l,f,g){var _=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var C=f.tag;if(C===3||C===4){var O=f.stateNode.containerInfo;if(O===g||O.nodeType===8&&O.parentNode===g)break;if(C===4)for(C=f.return;C!==null;){var V=C.tag;if((V===3||V===4)&&(V=C.stateNode.containerInfo,V===g||V.nodeType===8&&V.parentNode===g))return;C=C.return}for(;O!==null;){if(C=Zs(O),C===null)return;if(V=C.tag,V===5||V===6){f=_=C;continue e}O=O.parentNode}}f=f.return}Ge(function(){var he=_,Se=et(l),ye=[];e:{var xe=Kp.get(i);if(xe!==void 0){var ke=fc,We=i;switch(i){case"keypress":if(Za(l)===0)break e;case"keydown":case"keyup":ke=zx;break;case"focusin":We="focus",ke=mc;break;case"focusout":We="blur",ke=mc;break;case"beforeblur":case"afterblur":ke=mc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=bp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=Ax;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=Gx;break;case Xp:case $p:case qp:ke=Nx;break;case Yp:ke=Xx;break;case"scroll":ke=Tx;break;case"wheel":ke=qx;break;case"copy":case"cut":case"paste":ke=Dx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=Cp}var qe=(o&4)!==0,en=!qe&&i==="scroll",Z=qe?xe!==null?xe+"Capture":null:xe;qe=[];for(var X=he,ne;X!==null;){ne=X;var Ee=ne.stateNode;if(ne.tag===5&&Ee!==null&&(ne=Ee,Z!==null&&(Ee=Ut(X,Z),Ee!=null&&qe.push(ta(X,Ee,ne)))),en)break;X=X.return}0<qe.length&&(xe=new ke(xe,We,null,l,Se),ye.push({event:xe,listeners:qe}))}}if((o&7)===0){e:{if(xe=i==="mouseover"||i==="pointerover",ke=i==="mouseout"||i==="pointerout",xe&&l!==Ae&&(We=l.relatedTarget||l.fromElement)&&(Zs(We)||We[Xi]))break e;if((ke||xe)&&(xe=Se.window===Se?Se:(xe=Se.ownerDocument)?xe.defaultView||xe.parentWindow:window,ke?(We=l.relatedTarget||l.toElement,ke=he,We=We?Zs(We):null,We!==null&&(en=Nn(We),We!==en||We.tag!==5&&We.tag!==6)&&(We=null)):(ke=null,We=he),ke!==We)){if(qe=bp,Ee="onMouseLeave",Z="onMouseEnter",X="mouse",(i==="pointerout"||i==="pointerover")&&(qe=Cp,Ee="onPointerLeave",Z="onPointerEnter",X="pointer"),en=ke==null?xe:Br(ke),ne=We==null?xe:Br(We),xe=new qe(Ee,X+"leave",ke,l,Se),xe.target=en,xe.relatedTarget=ne,Ee=null,Zs(Se)===he&&(qe=new qe(Z,X+"enter",We,l,Se),qe.target=ne,qe.relatedTarget=en,Ee=qe),en=Ee,ke&&We)t:{for(qe=ke,Z=We,X=0,ne=qe;ne;ne=Or(ne))X++;for(ne=0,Ee=Z;Ee;Ee=Or(Ee))ne++;for(;0<X-ne;)qe=Or(qe),X--;for(;0<ne-X;)Z=Or(Z),ne--;for(;X--;){if(qe===Z||Z!==null&&qe===Z.alternate)break t;qe=Or(qe),Z=Or(Z)}qe=null}else qe=null;ke!==null&&em(ye,xe,ke,qe,!1),We!==null&&en!==null&&em(ye,en,We,qe,!0)}}e:{if(xe=he?Br(he):window,ke=xe.nodeName&&xe.nodeName.toLowerCase(),ke==="select"||ke==="input"&&xe.type==="file")var je=eS;else if(Dp(xe))if(Up)je=sS;else{je=nS;var it=tS}else(ke=xe.nodeName)&&ke.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&(je=iS);if(je&&(je=je(i,he))){Ip(ye,je,l,Se);break e}it&&it(i,xe,he),i==="focusout"&&(it=xe._wrapperState)&&it.controlled&&xe.type==="number"&&Gt(xe,"number",xe.value)}switch(it=he?Br(he):window,i){case"focusin":(Dp(it)||it.contentEditable==="true")&&(Ur=it,yc=he,Zo=null);break;case"focusout":Zo=yc=Ur=null;break;case"mousedown":Mc=!0;break;case"contextmenu":case"mouseup":case"dragend":Mc=!1,Gp(ye,l,Se);break;case"selectionchange":if(aS)break;case"keydown":case"keyup":Gp(ye,l,Se)}var st;if(vc)e:{switch(i){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Ir?Np(i,l)&&(ot="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(ot="onCompositionStart");ot&&(Ap&&l.locale!=="ko"&&(Ir||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Ir&&(st=Ep()):(_s=Se,hc="value"in _s?_s.value:_s.textContent,Ir=!0)),it=rl(he,ot),0<it.length&&(ot=new Tp(ot,i,null,l,Se),ye.push({event:ot,listeners:it}),st?ot.data=st:(st=Lp(l),st!==null&&(ot.data=st)))),(st=Kx?jx(i,l):Qx(i,l))&&(he=rl(he,"onBeforeInput"),0<he.length&&(Se=new Tp("onBeforeInput","beforeinput",null,l,Se),ye.push({event:Se,listeners:he}),Se.data=st))}Zp(ye,o)})}function ta(i,o,l){return{instance:i,listener:o,currentTarget:l}}function rl(i,o){for(var l=o+"Capture",f=[];i!==null;){var g=i,_=g.stateNode;g.tag===5&&_!==null&&(g=_,_=Ut(i,l),_!=null&&f.unshift(ta(i,_,g)),_=Ut(i,o),_!=null&&f.push(ta(i,_,g))),i=i.return}return f}function Or(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function em(i,o,l,f,g){for(var _=o._reactName,C=[];l!==null&&l!==f;){var O=l,V=O.alternate,he=O.stateNode;if(V!==null&&V===f)break;O.tag===5&&he!==null&&(O=he,g?(V=Ut(l,_),V!=null&&C.unshift(ta(l,V,O))):g||(V=Ut(l,_),V!=null&&C.push(ta(l,V,O)))),l=l.return}C.length!==0&&i.push({event:o,listeners:C})}var hS=/\r\n?/g,fS=/\u0000|\uFFFD/g;function tm(i){return(typeof i=="string"?i:""+i).replace(hS,`
39`).replace(fS,"")}function ol(i,o,l){if(o=tm(o),tm(i)!==o&&l)throw Error(t(425))}function al(){}var Ac=null,Rc=null;function Pc(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Nc=typeof setTimeout=="function"?setTimeout:void 0,dS=typeof clearTimeout=="function"?clearTimeout:void 0,nm=typeof Promise=="function"?Promise:void 0,pS=typeof queueMicrotask=="function"?queueMicrotask:typeof nm<"u"?function(i){return nm.resolve(null).then(i).catch(mS)}:Nc;function mS(i){setTimeout(function(){throw i})}function Lc(i,o){var l=o,f=0;do{var g=l.nextSibling;if(i.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"){if(f===0){i.removeChild(g),Xo(o);return}f--}else l!=="$"&&l!=="$?"&&l!=="$!"||f++;l=g}while(l);Xo(o)}function Ss(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return i}function im(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"){if(o===0)return i;o--}else l==="/$"&&o++}i=i.previousSibling}return null}var kr=Math.random().toString(36).slice(2),Ni="__reactFiber$"+kr,na="__reactProps$"+kr,Xi="__reactContainer$"+kr,Dc="__reactEvents$"+kr,gS="__reactListeners$"+kr,vS="__reactHandles$"+kr;function Zs(i){var o=i[Ni];if(o)return o;for(var l=i.parentNode;l;){if(o=l[Xi]||l[Ni]){if(l=o.alternate,o.child!==null||l!==null&&l.child!==null)for(i=im(i);i!==null;){if(l=i[Ni])return l;i=im(i)}return o}i=l,l=i.parentNode}return null}function ia(i){return i=i[Ni]||i[Xi],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Br(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(t(33))}function ll(i){return i[na]||null}var Ic=[],zr=-1;function ys(i){return{current:i}}function $t(i){0>zr||(i.current=Ic[zr],Ic[zr]=null,zr--)}function Vt(i,o){zr++,Ic[zr]=i.current,i.current=o}var Ms={},wn=ys(Ms),zn=ys(!1),Js=Ms;function Vr(i,o){var l=i.type.contextTypes;if(!l)return Ms;var f=i.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===o)return f.__reactInternalMemoizedMaskedChildContext;var g={},_;for(_ in l)g[_]=o[_];return f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=g),g}function Vn(i){return i=i.childContextTypes,i!=null}function ul(){$t(zn),$t(wn)}function sm(i,o,l){if(wn.current!==Ms)throw Error(t(168));Vt(wn,o),Vt(zn,l)}function rm(i,o,l){var f=i.stateNode;if(o=o.childContextTypes,typeof f.getChildContext!="function")return l;f=f.getChildContext();for(var g in f)if(!(g in o))throw Error(t(108,ve(i)||"Unknown",g));return ue({},l,f)}function cl(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ms,Js=wn.current,Vt(wn,i),Vt(zn,zn.current),!0}function om(i,o,l){var f=i.stateNode;if(!f)throw Error(t(169));l?(i=rm(i,o,Js),f.__reactInternalMemoizedMergedChildContext=i,$t(zn),$t(wn),Vt(wn,i)):$t(zn),Vt(zn,l)}var $i=null,hl=!1,Uc=!1;function am(i){$i===null?$i=[i]:$i.push(i)}function _S(i){hl=!0,am(i)}function Es(){if(!Uc&&$i!==null){Uc=!0;var i=0,o=gt;try{var l=$i;for(gt=1;i<l.length;i++){var f=l[i];do f=f(!0);while(f!==null)}$i=null,hl=!1}catch(g){throw $i!==null&&($i=$i.slice(i+1)),js(zo,Es),g}finally{gt=o,Uc=!1}}return null}var Hr=[],Gr=0,fl=null,dl=0,ri=[],oi=0,er=null,qi=1,Yi="";function tr(i,o){Hr[Gr++]=dl,Hr[Gr++]=fl,fl=i,dl=o}function lm(i,o,l){ri[oi++]=qi,ri[oi++]=Yi,ri[oi++]=er,er=i;var f=qi;i=Yi;var g=32-be(f)-1;f&=~(1<<g),l+=1;var _=32-be(o)+g;
vendor: 6,453 bytes, line 39
39if(30<_){var C=g-g%5;_=(f&(1<<C)-1).toString(32),f>>=C,g-=C,qi=1<<32-be(o)+g|l<<g|f,Yi=_+i}else qi=1<<_|l<<g|f,Yi=i}function Fc(i){i.return!==null&&(tr(i,1),lm(i,1,0))}function Oc(i){for(;i===fl;)fl=Hr[--Gr],Hr[Gr]=null,dl=Hr[--Gr],Hr[Gr]=null;for(;i===er;)er=ri[--oi],ri[oi]=null,Yi=ri[--oi],ri[oi]=null,qi=ri[--oi],ri[oi]=null}var jn=null,Qn=null,Yt=!1,vi=null;function um(i,o){var l=ci(5,null,null,0);l.elementType="DELETED",l.stateNode=o,l.return=i,o=i.deletions,o===null?(i.deletions=[l],i.flags|=16):o.push(l)}function cm(i,o){switch(i.tag){case 5:var l=i.type;return o=o.nodeType!==1||l.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(i.stateNode=o,jn=i,Qn=Ss(o.firstChild),!0):!1;case 6:return o=i.pendingProps===""||o.nodeType!==3?null:o,o!==null?(i.stateNode=o,jn=i,Qn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(l=er!==null?{id:qi,overflow:Yi}:null,i.memoizedState={dehydrated:o,treeContext:l,retryLane:1073741824},l=ci(18,null,null,0),l.stateNode=o,l.return=i,i.child=l,jn=i,Qn=null,!0):!1;default:return!1}}function kc(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Bc(i){if(Yt){var o=Qn;if(o){var l=o;if(!cm(i,o)){if(kc(i))throw Error(t(418));o=Ss(l.nextSibling);var f=jn;o&&cm(i,o)?um(f,l):(i.flags=i.flags&-4097|2,Yt=!1,jn=i)}}else{if(kc(i))throw Error(t(418));i.flags=i.flags&-4097|2,Yt=!1,jn=i}}}function hm(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;jn=i}function pl(i){if(i!==jn)return!1;if(!Yt)return hm(i),Yt=!0,!1;var o;if((o=i.tag!==3)&&!(o=i.tag!==5)&&(o=i.type,o=o!=="head"&&o!=="body"&&!Pc(i.type,i.memoizedProps)),o&&(o=Qn)){if(kc(i))throw fm(),Error(t(418));for(;o;)um(i,o),o=Ss(o.nextSibling)}if(hm(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(t(317));e:{for(i=i.nextSibling,o=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"){if(o===0){Qn=Ss(i.nextSibling);break e}o--}else l!=="$"&&l!=="$!"&&l!=="$?"||o++}i=i.nextSibling}Qn=null}}else Qn=jn?Ss(i.stateNode.nextSibling):null;return!0}function fm(){for(var i=Qn;i;)i=Ss(i.nextSibling)}function Wr(){Qn=jn=null,Yt=!1}function zc(i){vi===null?vi=[i]:vi.push(i)}var xS=T.ReactCurrentBatchConfig;function sa(i,o,l){if(i=l.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(t(309));var f=l.stateNode}if(!f)throw Error(t(147,i));var g=f,_=""+i;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===_?o.ref:(o=function(C){var O=g.refs;C===null?delete O[_]:O[_]=C},o._stringRef=_,o)}if(typeof i!="string")throw Error(t(284));if(!l._owner)throw Error(t(290,i))}return i}function ml(i,o){throw i=Object.prototype.toString.call(o),Error(t(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i))}function dm(i){var o=i._init;return o(i._payload)}function pm(i){function o(Z,X){if(i){var ne=Z.deletions;ne===null?(Z.deletions=[X],Z.flags|=16):ne.push(X)}}function l(Z,X){if(!i)return null;for(;X!==null;)o(Z,X),X=X.sibling;return null}function f(Z,X){for(Z=new Map;X!==null;)X.key!==null?Z.set(X.key,X):Z.set(X.index,X),X=X.sibling;return Z}function g(Z,X){return Z=Ns(Z,X),Z.index=0,Z.sibling=null,Z}function _(Z,X,ne){return Z.index=ne,i?(ne=Z.alternate,ne!==null?(ne=ne.index,ne<X?(Z.flags|=2,X):ne):(Z.flags|=2,X)):(Z.flags|=1048576,X)}function C(Z){return i&&Z.alternate===null&&(Z.flags|=2),Z}function O(Z,X,ne,Ee){return X===null||X.tag!==6?(X=Nh(ne,Z.mode,Ee),X.return=Z,X):(X=g(X,ne),X.return=Z,X)}function V(Z,X,ne,Ee){var je=ne.type;return je===F?Se(Z,X,ne.props.children,Ee,ne.key):X!==null&&(X.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===ie&&dm(je)===X.type)?(Ee=g(X,ne.props),Ee.ref=sa(Z,X,ne),Ee.return=Z,Ee):(Ee=Bl(ne.type,ne.key,ne.props,null,Z.mode,Ee),Ee.ref=sa(Z,X,ne),Ee.return=Z,Ee)}function he(Z,X,ne,Ee){return X===null||X.tag!==4||X.stateNode.containerInfo!==ne.containerInfo||X.stateNode.implementation!==ne.implementation?(X=Lh(ne,Z.mode,Ee),X.return=Z,X):(X=g(X,ne.children||[]),X.return=Z,X)}function Se(Z,X,ne,Ee,je){return X===null||X.tag!==7?(X=ur(ne,Z.mode,Ee,je),X.return=Z,X):(X=g(X,ne),X.return=Z,X)}function ye(Z,X,ne){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Nh(""+X,Z.mode,ne),X.return=Z,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case N:return ne=Bl(X.type,X.key,X.props,null,Z.mode,ne),ne.ref=sa(Z,null,X),ne.return=Z,ne;case R:return X=Lh(X,Z.mode,ne),X.return=Z,X;case ie:var Ee=X._init;return ye(Z,Ee(X._payload),ne)}if(Bt(X)||le(X))return X=ur(X,Z.mode,ne,null),X.return=Z,X;ml(Z,X)}return null}function xe(Z,X,ne,Ee){var je=X!==null?X.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return je!==null?null:O(Z,X,""+ne,Ee);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case N:return ne.key===je?V(Z,X,ne,Ee):null;case R:return ne.key===je?he(Z,X,ne,Ee):null;case ie:return je=ne._init,xe(Z,X,je(ne._payload),Ee)}if(Bt(ne)||le(ne))return je!==null?null:Se(Z,X,ne,Ee,null);ml(Z,ne)}return null}function ke(Z,X,ne,Ee,je){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number")return Z=Z.get(ne)||null,O(X,Z,""+Ee,je);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case N:return Z=Z.get(Ee.key===null?ne:Ee.key)||null,V(X,Z,Ee,je);case R:return Z=Z.get(Ee.key===null?ne:Ee.key)||null,he(X,Z,Ee,je);case ie:var it=Ee._init;return ke(Z,X,ne,it(Ee._payload),je)}if(Bt(Ee)||le(Ee))return Z=Z.get(ne)||null,Se(X,Z,Ee,je,null);ml(X,Ee)}return null}function We(Z,X,ne,Ee){for(var je=null,it=null,st=X,ot=X=0,dn=null;st!==null&&ot<ne.length;ot++){st.index>ot?(dn=st,st=null):dn=st.sibling;var At=xe(Z,st,ne[ot],Ee);if(At===null){st===null&&(st=dn);break}i&&st&&At.alternate===null&&o(Z,st),X=_(At,X,ot),it===null?je=At:it.sibling=At,it=At,st=dn}if(ot===ne.length)return l(Z,st),Yt&&tr(Z,ot),je;if(st===null){for(;ot<ne.length;ot++)st=ye(Z,ne[ot],Ee),st!==null&&(X=_(st,X,ot),it===null?je=st:it.sibling=st,it=st);return Yt&&tr(Z,ot),je}for(st=f(Z,st);ot<ne.length;ot++)dn=ke(st,Z,ot,ne[ot],Ee),dn!==null&&(i&&dn.alternate!==null&&st.delete(dn.key===null?ot:dn.key),X=_(dn,X,ot),it===null?je=dn:it.sibling=dn,it=dn);return i&&st.forEach(function(Ls){return o(Z,Ls)}),Yt&&tr(Z,ot),je}function qe(Z,X,ne,Ee){var je=le(ne);if(typeof je!="function")throw Error(t(150));if(ne=je.call(ne),ne==null)throw Error(t(151));for(var it=je=null,st=X,ot=X=0,dn=null,At=ne.next();st!==null&&!At.done;ot++,At=ne.next()){st.index>ot?(dn=st,st=null):dn=st.sibling;var Ls=xe(Z,st,At.value,Ee);
vendor: 7,294 bytes, line 39
39if(Ls===null){st===null&&(st=dn);break}i&&st&&Ls.alternate===null&&o(Z,st),X=_(Ls,X,ot),it===null?je=Ls:it.sibling=Ls,it=Ls,st=dn}if(At.done)return l(Z,st),Yt&&tr(Z,ot),je;if(st===null){for(;!At.done;ot++,At=ne.next())At=ye(Z,At.value,Ee),At!==null&&(X=_(At,X,ot),it===null?je=At:it.sibling=At,it=At);return Yt&&tr(Z,ot),je}for(st=f(Z,st);!At.done;ot++,At=ne.next())At=ke(st,Z,ot,At.value,Ee),At!==null&&(i&&At.alternate!==null&&st.delete(At.key===null?ot:At.key),X=_(At,X,ot),it===null?je=At:it.sibling=At,it=At);return i&&st.forEach(function(ZS){return o(Z,ZS)}),Yt&&tr(Z,ot),je}function en(Z,X,ne,Ee){if(typeof ne=="object"&&ne!==null&&ne.type===F&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case N:e:{for(var je=ne.key,it=X;it!==null;){if(it.key===je){if(je=ne.type,je===F){if(it.tag===7){l(Z,it.sibling),X=g(it,ne.props.children),X.return=Z,Z=X;break e}}else if(it.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===ie&&dm(je)===it.type){l(Z,it.sibling),X=g(it,ne.props),X.ref=sa(Z,it,ne),X.return=Z,Z=X;break e}l(Z,it);break}else o(Z,it);it=it.sibling}ne.type===F?(X=ur(ne.props.children,Z.mode,Ee,ne.key),X.return=Z,Z=X):(Ee=Bl(ne.type,ne.key,ne.props,null,Z.mode,Ee),Ee.ref=sa(Z,X,ne),Ee.return=Z,Z=Ee)}return C(Z);case R:e:{for(it=ne.key;X!==null;){if(X.key===it)if(X.tag===4&&X.stateNode.containerInfo===ne.containerInfo&&X.stateNode.implementation===ne.implementation){l(Z,X.sibling),X=g(X,ne.children||[]),X.return=Z,Z=X;break e}else{l(Z,X);break}else o(Z,X);X=X.sibling}X=Lh(ne,Z.mode,Ee),X.return=Z,Z=X}return C(Z);case ie:return it=ne._init,en(Z,X,it(ne._payload),Ee)}if(Bt(ne))return We(Z,X,ne,Ee);if(le(ne))return qe(Z,X,ne,Ee);ml(Z,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,X!==null&&X.tag===6?(l(Z,X.sibling),X=g(X,ne),X.return=Z,Z=X):(l(Z,X),X=Nh(ne,Z.mode,Ee),X.return=Z,Z=X),C(Z)):l(Z,X)}return en}var Xr=pm(!0),mm=pm(!1),gl=ys(null),vl=null,$r=null,Vc=null;function Hc(){Vc=$r=vl=null}function Gc(i){var o=gl.current;$t(gl),i._currentValue=o}function Wc(i,o,l){for(;i!==null;){var f=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),i===l)break;i=i.return}}function qr(i,o){vl=i,Vc=$r=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(Hn=!0),i.firstContext=null)}function ai(i){var o=i._currentValue;if(Vc!==i)if(i={context:i,memoizedValue:o,next:null},$r===null){if(vl===null)throw Error(t(308));$r=i,vl.dependencies={lanes:0,firstContext:i}}else $r=$r.next=i;return o}var nr=null;function Xc(i){nr===null?nr=[i]:nr.push(i)}function gm(i,o,l,f){var g=o.interleaved;return g===null?(l.next=l,Xc(o)):(l.next=g.next,g.next=l),o.interleaved=l,Ki(i,f)}function Ki(i,o){i.lanes|=o;var l=i.alternate;for(l!==null&&(l.lanes|=o),l=i,i=i.return;i!==null;)i.childLanes|=o,l=i.alternate,l!==null&&(l.childLanes|=o),l=i,i=i.return;return l.tag===3?l.stateNode:null}var ws=!1;function $c(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vm(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function ji(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function bs(i,o,l){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(Et&2)!==0){var g=f.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),f.pending=o,Ki(i,l)}return g=f.interleaved,g===null?(o.next=o,Xc(f)):(o.next=g.next,g.next=o),f.interleaved=o,Ki(i,l)}function _l(i,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194240)!==0)){var f=o.lanes;f&=i.pendingLanes,l|=f,o.lanes=l,Bn(i,l)}}function _m(i,o){var l=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var g=null,_=null;if(l=l.firstBaseUpdate,l!==null){do{var C={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};_===null?g=_=C:_=_.next=C,l=l.next}while(l!==null);_===null?g=_=o:_=_.next=o}else g=_=o;l={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:_,shared:f.shared,effects:f.effects},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=o:i.next=o,l.lastBaseUpdate=o}function xl(i,o,l,f){var g=i.updateQueue;ws=!1;var _=g.firstBaseUpdate,C=g.lastBaseUpdate,O=g.shared.pending;if(O!==null){g.shared.pending=null;var V=O,he=V.next;V.next=null,C===null?_=he:C.next=he,C=V;var Se=i.alternate;Se!==null&&(Se=Se.updateQueue,O=Se.lastBaseUpdate,O!==C&&(O===null?Se.firstBaseUpdate=he:O.next=he,Se.lastBaseUpdate=V))}if(_!==null){var ye=g.baseState;C=0,Se=he=V=null,O=_;do{var xe=O.lane,ke=O.eventTime;if((f&xe)===xe){Se!==null&&(Se=Se.next={eventTime:ke,lane:0,tag:O.tag,payload:O.payload,callback:O.callback,next:null});e:{var We=i,qe=O;switch(xe=o,ke=l,qe.tag){case 1:if(We=qe.payload,typeof We=="function"){ye=We.call(ke,ye,xe);break e}ye=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=qe.payload,xe=typeof We=="function"?We.call(ke,ye,xe):We,xe==null)break e;ye=ue({},ye,xe);break e;case 2:ws=!0}}O.callback!==null&&O.lane!==0&&(i.flags|=64,xe=g.effects,xe===null?g.effects=[O]:xe.push(O))}else ke={eventTime:ke,lane:xe,tag:O.tag,payload:O.payload,callback:O.callback,next:null},Se===null?(he=Se=ke,V=ye):Se=Se.next=ke,C|=xe;if(O=O.next,O===null){if(O=g.shared.pending,O===null)break;xe=O,O=xe.next,xe.next=null,g.lastBaseUpdate=xe,g.shared.pending=null}}while(!0);if(Se===null&&(V=ye),g.baseState=V,g.firstBaseUpdate=he,g.lastBaseUpdate=Se,o=g.shared.interleaved,o!==null){g=o;do C|=g.lane,g=g.next;while(g!==o)}else _===null&&(g.shared.lanes=0);rr|=C,i.lanes=C,i.memoizedState=ye}}function xm(i,o,l){if(i=o.effects,o.effects=null,i!==null)for(o=0;o<i.length;o++){var f=i[o],g=f.callback;if(g!==null){if(f.callback=null,f=l,typeof g!="function")throw Error(t(191,g));g.call(f)}}}var ra={},Li=ys(ra),oa=ys(ra),aa=ys(ra);function ir(i){if(i===ra)throw Error(t(174));return i}function qc(i,o){switch(Vt(aa,o),Vt(oa,i),Vt(Li,ra),i=o.nodeType,i){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:E(null,"");break;default:i=i===8?o.parentNode:o,o=i.namespaceURI||null,i=i.tagName,o=E(o,i)}$t(Li),Vt(Li,o)}function Yr(){$t(Li),$t(oa),$t(aa)}function Sm(i){ir(aa.current);var o=ir(Li.current),l=E(o,i.type);o!==l&&(Vt(oa,i),Vt(Li,l))}function Yc(i){oa.current===i&&($t(Li),$t(oa))}var jt=ys(0);function Sl(i){for(var o=i;o!==null;){if(o.tag===13){var l=o.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Kc=[];function jc(){for(var i=0;i<Kc.length;i++)Kc[i]._workInProgressVersionPrimary=null;Kc.length=0}var yl=T.ReactCurrentDispatcher,Qc=T.ReactCurrentBatchConfig,sr=0,Qt=null,an=null,hn=null,Ml=!1,la=!1,ua=0,SS=0;function bn(){throw Error(t(321))}function Zc(i,o){if(o===null)return!1;for(var l=0;l<o.length&&l<i.length;l++)if(!gi(i[l],o[l]))return!1;return!0}
vendor: 4,576 bytes, line 39
39function Jc(i,o,l,f,g,_){if(sr=_,Qt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,yl.current=i===null||i.memoizedState===null?wS:bS,i=l(f,g),la){_=0;do{if(la=!1,ua=0,25<=_)throw Error(t(301));_+=1,hn=an=null,o.updateQueue=null,yl.current=TS,i=l(f,g)}while(la)}if(yl.current=bl,o=an!==null&&an.next!==null,sr=0,hn=an=Qt=null,Ml=!1,o)throw Error(t(300));return i}function eh(){var i=ua!==0;return ua=0,i}function Di(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?Qt.memoizedState=hn=i:hn=hn.next=i,hn}function li(){if(an===null){var i=Qt.alternate;i=i!==null?i.memoizedState:null}else i=an.next;var o=hn===null?Qt.memoizedState:hn.next;if(o!==null)hn=o,an=i;else{if(i===null)throw Error(t(310));an=i,i={memoizedState:an.memoizedState,baseState:an.baseState,baseQueue:an.baseQueue,queue:an.queue,next:null},hn===null?Qt.memoizedState=hn=i:hn=hn.next=i}return hn}function ca(i,o){return typeof o=="function"?o(i):o}function th(i){var o=li(),l=o.queue;if(l===null)throw Error(t(311));l.lastRenderedReducer=i;var f=an,g=f.baseQueue,_=l.pending;if(_!==null){if(g!==null){var C=g.next;g.next=_.next,_.next=C}f.baseQueue=g=_,l.pending=null}if(g!==null){_=g.next,f=f.baseState;var O=C=null,V=null,he=_;do{var Se=he.lane;if((sr&Se)===Se)V!==null&&(V=V.next={lane:0,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),f=he.hasEagerState?he.eagerState:i(f,he.action);else{var ye={lane:Se,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null};V===null?(O=V=ye,C=f):V=V.next=ye,Qt.lanes|=Se,rr|=Se}he=he.next}while(he!==null&&he!==_);V===null?C=f:V.next=O,gi(f,o.memoizedState)||(Hn=!0),o.memoizedState=f,o.baseState=C,o.baseQueue=V,l.lastRenderedState=f}if(i=l.interleaved,i!==null){g=i;do _=g.lane,Qt.lanes|=_,rr|=_,g=g.next;while(g!==i)}else g===null&&(l.lanes=0);return[o.memoizedState,l.dispatch]}function nh(i){var o=li(),l=o.queue;if(l===null)throw Error(t(311));l.lastRenderedReducer=i;var f=l.dispatch,g=l.pending,_=o.memoizedState;if(g!==null){l.pending=null;var C=g=g.next;do _=i(_,C.action),C=C.next;while(C!==g);gi(_,o.memoizedState)||(Hn=!0),o.memoizedState=_,o.baseQueue===null&&(o.baseState=_),l.lastRenderedState=_}return[_,f]}function ym(){}function Mm(i,o){var l=Qt,f=li(),g=o(),_=!gi(f.memoizedState,g);if(_&&(f.memoizedState=g,Hn=!0),f=f.queue,ih(bm.bind(null,l,f,i),[i]),f.getSnapshot!==o||_||hn!==null&&hn.memoizedState.tag&1){if(l.flags|=2048,ha(9,wm.bind(null,l,f,g,o),void 0,null),fn===null)throw Error(t(349));(sr&30)!==0||Em(l,o,g)}return g}function Em(i,o,l){i.flags|=16384,i={getSnapshot:o,value:l},o=Qt.updateQueue,o===null?(o={lastEffect:null,stores:null},Qt.updateQueue=o,o.stores=[i]):(l=o.stores,l===null?o.stores=[i]:l.push(i))}function wm(i,o,l,f){o.value=l,o.getSnapshot=f,Tm(o)&&Cm(i)}function bm(i,o,l){return l(function(){Tm(o)&&Cm(i)})}function Tm(i){var o=i.getSnapshot;i=i.value;try{var l=o();return!gi(i,l)}catch{return!0}}function Cm(i){var o=Ki(i,1);o!==null&&yi(o,i,1,-1)}function Am(i){var o=Di();return typeof i=="function"&&(i=i()),o.memoizedState=o.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:i},o.queue=i,i=i.dispatch=ES.bind(null,Qt,i),[o.memoizedState,i]}function ha(i,o,l,f){return i={tag:i,create:o,destroy:l,deps:f,next:null},o=Qt.updateQueue,o===null?(o={lastEffect:null,stores:null},Qt.updateQueue=o,o.lastEffect=i.next=i):(l=o.lastEffect,l===null?o.lastEffect=i.next=i:(f=l.next,l.next=i,i.next=f,o.lastEffect=i)),i}function Rm(){return li().memoizedState}function El(i,o,l,f){var g=Di();Qt.flags|=i,g.memoizedState=ha(1|o,l,void 0,f===void 0?null:f)}function wl(i,o,l,f){var g=li();f=f===void 0?null:f;var _=void 0;if(an!==null){var C=an.memoizedState;if(_=C.destroy,f!==null&&Zc(f,C.deps)){g.memoizedState=ha(o,l,_,f);return}}Qt.flags|=i,g.memoizedState=ha(1|o,l,_,f)}function Pm(i,o){return El(8390656,8,i,o)}function ih(i,o){return wl(2048,8,i,o)}function Nm(i,o){return wl(4,2,i,o)}function Lm(i,o){return wl(4,4,i,o)}function Dm(i,o){if(typeof o=="function")return i=i(),o(i),function(){o(null)};if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function Im(i,o,l){return l=l!=null?l.concat([i]):null,wl(4,4,Dm.bind(null,o,i),l)}function sh(){}function Um(i,o){var l=li();o=o===void 0?null:o;var f=l.memoizedState;return f!==null&&o!==null&&Zc(o,f[1])?f[0]:(l.memoizedState=[i,o],i)}function Fm(i,o){var l=li();o=o===void 0?null:o;var f=l.memoizedState;return f!==null&&o!==null&&Zc(o,f[1])?f[0]:(i=i(),l.memoizedState=[i,o],i)}
vendor: 5,015 bytes, line 39
39function Om(i,o,l){return(sr&21)===0?(i.baseState&&(i.baseState=!1,Hn=!0),i.memoizedState=l):(gi(l,o)||(l=Oe(),Qt.lanes|=l,rr|=l,i.baseState=!0),o)}function yS(i,o){var l=gt;gt=l!==0&&4>l?l:4,i(!0);var f=Qc.transition;Qc.transition={};try{i(!1),o()}finally{gt=l,Qc.transition=f}}function km(){return li().memoizedState}function MS(i,o,l){var f=Rs(i);if(l={lane:f,action:l,hasEagerState:!1,eagerState:null,next:null},Bm(i))zm(o,l);else if(l=gm(i,o,l,f),l!==null){var g=Dn();yi(l,i,f,g),Vm(l,o,f)}}function ES(i,o,l){var f=Rs(i),g={lane:f,action:l,hasEagerState:!1,eagerState:null,next:null};if(Bm(i))zm(o,g);else{var _=i.alternate;if(i.lanes===0&&(_===null||_.lanes===0)&&(_=o.lastRenderedReducer,_!==null))try{var C=o.lastRenderedState,O=_(C,l);if(g.hasEagerState=!0,g.eagerState=O,gi(O,C)){var V=o.interleaved;V===null?(g.next=g,Xc(o)):(g.next=V.next,V.next=g),o.interleaved=g;return}}catch{}finally{}l=gm(i,o,g,f),l!==null&&(g=Dn(),yi(l,i,f,g),Vm(l,o,f))}}function Bm(i){var o=i.alternate;return i===Qt||o!==null&&o===Qt}function zm(i,o){la=Ml=!0;var l=i.pending;l===null?o.next=o:(o.next=l.next,l.next=o),i.pending=o}function Vm(i,o,l){if((l&4194240)!==0){var f=o.lanes;f&=i.pendingLanes,l|=f,o.lanes=l,Bn(i,l)}}var bl={readContext:ai,useCallback:bn,useContext:bn,useEffect:bn,useImperativeHandle:bn,useInsertionEffect:bn,useLayoutEffect:bn,useMemo:bn,useReducer:bn,useRef:bn,useState:bn,useDebugValue:bn,useDeferredValue:bn,useTransition:bn,useMutableSource:bn,useSyncExternalStore:bn,useId:bn,unstable_isNewReconciler:!1},wS={readContext:ai,useCallback:function(i,o){return Di().memoizedState=[i,o===void 0?null:o],i},useContext:ai,useEffect:Pm,useImperativeHandle:function(i,o,l){return l=l!=null?l.concat([i]):null,El(4194308,4,Dm.bind(null,o,i),l)},useLayoutEffect:function(i,o){return El(4194308,4,i,o)},useInsertionEffect:function(i,o){return El(4,2,i,o)},useMemo:function(i,o){var l=Di();return o=o===void 0?null:o,i=i(),l.memoizedState=[i,o],i},useReducer:function(i,o,l){var f=Di();return o=l!==void 0?l(o):o,f.memoizedState=f.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},f.queue=i,i=i.dispatch=MS.bind(null,Qt,i),[f.memoizedState,i]},useRef:function(i){var o=Di();return i={current:i},o.memoizedState=i},useState:Am,useDebugValue:sh,useDeferredValue:function(i){return Di().memoizedState=i},useTransition:function(){var i=Am(!1),o=i[0];return i=yS.bind(null,i[1]),Di().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,l){var f=Qt,g=Di();if(Yt){if(l===void 0)throw Error(t(407));l=l()}else{if(l=o(),fn===null)throw Error(t(349));(sr&30)!==0||Em(f,o,l)}g.memoizedState=l;var _={value:l,getSnapshot:o};return g.queue=_,Pm(bm.bind(null,f,_,i),[i]),f.flags|=2048,ha(9,wm.bind(null,f,_,l,o),void 0,null),l},useId:function(){var i=Di(),o=fn.identifierPrefix;if(Yt){var l=Yi,f=qi;l=(f&~(1<<32-be(f)-1)).toString(32)+l,o=":"+o+"R"+l,l=ua++,0<l&&(o+="H"+l.toString(32)),o+=":"}else l=SS++,o=":"+o+"r"+l.toString(32)+":";return i.memoizedState=o},unstable_isNewReconciler:!1},bS={readContext:ai,useCallback:Um,useContext:ai,useEffect:ih,useImperativeHandle:Im,useInsertionEffect:Nm,useLayoutEffect:Lm,useMemo:Fm,useReducer:th,useRef:Rm,useState:function(){return th(ca)},useDebugValue:sh,useDeferredValue:function(i){var o=li();return Om(o,an.memoizedState,i)},useTransition:function(){var i=th(ca)[0],o=li().memoizedState;return[i,o]},useMutableSource:ym,useSyncExternalStore:Mm,useId:km,unstable_isNewReconciler:!1},TS={readContext:ai,useCallback:Um,useContext:ai,useEffect:ih,useImperativeHandle:Im,useInsertionEffect:Nm,useLayoutEffect:Lm,useMemo:Fm,useReducer:nh,useRef:Rm,useState:function(){return nh(ca)},useDebugValue:sh,useDeferredValue:function(i){var o=li();return an===null?o.memoizedState=i:Om(o,an.memoizedState,i)},useTransition:function(){var i=nh(ca)[0],o=li().memoizedState;return[i,o]},useMutableSource:ym,useSyncExternalStore:Mm,useId:km,unstable_isNewReconciler:!1};function _i(i,o){if(i&&i.defaultProps){o=ue({},o),i=i.defaultProps;for(var l in i)o[l]===void 0&&(o[l]=i[l]);return o}return o}function rh(i,o,l,f){o=i.memoizedState,l=l(f,o),l=l==null?o:ue({},o,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var Tl={isMounted:function(i){return(i=i._reactInternals)?Nn(i)===i:!1},enqueueSetState:function(i,o,l){i=i._reactInternals;var f=Dn(),g=Rs(i),_=ji(f,g);_.payload=o,l!=null&&(_.callback=l),o=bs(i,_,g),o!==null&&(yi(o,i,g,f),_l(o,i,g))},enqueueReplaceState:function(i,o,l){i=i._reactInternals;var f=Dn(),g=Rs(i),_=ji(f,g);_.tag=1,_.payload=o,l!=null&&(_.callback=l),o=bs(i,_,g),o!==null&&(yi(o,i,g,f),_l(o,i,g))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var l=Dn(),f=Rs(i),g=ji(l,f);g.tag=2,o!=null&&(g.callback=o),o=bs(i,g,f),o!==null&&(yi(o,i,f,l),_l(o,i,f))}};function Hm(i,o,l,f,g,_,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,_,C):o.prototype&&o.prototype.isPureReactComponent?!Qo(l,f)||!Qo(g,_):!0}
vendor: 4,653 bytes, lines 39-41
39function Gm(i,o,l){var f=!1,g=Ms,_=o.contextType;return typeof _=="object"&&_!==null?_=ai(_):(g=Vn(o)?Js:wn.current,f=o.contextTypes,_=(f=f!=null)?Vr(i,g):Ms),o=new o(l,_),i.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Tl,i.stateNode=o,o._reactInternals=i,f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=_),o}function Wm(i,o,l,f){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(l,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(l,f),o.state!==i&&Tl.enqueueReplaceState(o,o.state,null)}function oh(i,o,l,f){var g=i.stateNode;g.props=l,g.state=i.memoizedState,g.refs={},$c(i);var _=o.contextType;typeof _=="object"&&_!==null?g.context=ai(_):(_=Vn(o)?Js:wn.current,g.context=Vr(i,_)),g.state=i.memoizedState,_=o.getDerivedStateFromProps,typeof _=="function"&&(rh(i,o,_,l),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(o=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),o!==g.state&&Tl.enqueueReplaceState(g,g.state,null),xl(i,l,g,f),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function Kr(i,o){try{var l="",f=o;do l+=Be(f),f=f.return;while(f);var g=l}catch(_){g=`
40Error generating stack: `+_.message+`
41`+_.stack}return{value:i,source:o,stack:g,digest:null}}function ah(i,o,l){return{value:i,source:null,stack:l??null,digest:o??null}}function lh(i,o){try{console.error(o.value)}catch(l){setTimeout(function(){throw l})}}var CS=typeof WeakMap=="function"?WeakMap:Map;function Xm(i,o,l){l=ji(-1,l),l.tag=3,l.payload={element:null};var f=o.value;return l.callback=function(){Dl||(Dl=!0,Eh=f),lh(i,o)},l}function $m(i,o,l){l=ji(-1,l),l.tag=3;var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=o.value;l.payload=function(){return f(g)},l.callback=function(){lh(i,o)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){lh(i,o),typeof f!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var C=o.stack;this.componentDidCatch(o.value,{componentStack:C!==null?C:""})}),l}function qm(i,o,l){var f=i.pingCache;if(f===null){f=i.pingCache=new CS;var g=new Set;f.set(o,g)}else g=f.get(o),g===void 0&&(g=new Set,f.set(o,g));g.has(l)||(g.add(l),i=VS.bind(null,i,o,l),o.then(i,i))}function Ym(i){do{var o;if((o=i.tag===13)&&(o=i.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return i;i=i.return}while(i!==null);return null}function Km(i,o,l,f,g){return(i.mode&1)===0?(i===o?i.flags|=65536:(i.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(o=ji(-1,1),o.tag=2,bs(l,o,1))),l.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var AS=T.ReactCurrentOwner,Hn=!1;function Ln(i,o,l,f){o.child=i===null?mm(o,null,l,f):Xr(o,i.child,l,f)}function jm(i,o,l,f,g){l=l.render;var _=o.ref;return qr(o,g),f=Jc(i,o,l,f,_,g),l=eh(),i!==null&&!Hn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~g,Qi(i,o,g)):(Yt&&l&&Fc(o),o.flags|=1,Ln(i,o,f,g),o.child)}function Qm(i,o,l,f,g){if(i===null){var _=l.type;return typeof _=="function"&&!Ph(_)&&_.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(o.tag=15,o.type=_,Zm(i,o,_,f,g)):(i=Bl(l.type,null,f,o,o.mode,g),i.ref=o.ref,i.return=o,o.child=i)}if(_=i.child,(i.lanes&g)===0){var C=_.memoizedProps;if(l=l.compare,l=l!==null?l:Qo,l(C,f)&&i.ref===o.ref)return Qi(i,o,g)}return o.flags|=1,i=Ns(_,f),i.ref=o.ref,i.return=o,o.child=i}function Zm(i,o,l,f,g){if(i!==null){var _=i.memoizedProps;if(Qo(_,f)&&i.ref===o.ref)if(Hn=!1,o.pendingProps=f=_,(i.lanes&g)!==0)(i.flags&131072)!==0&&(Hn=!0);else return o.lanes=i.lanes,Qi(i,o,g)}return uh(i,o,l,f,g)}function Jm(i,o,l){var f=o.pendingProps,g=f.children,_=i!==null?i.memoizedState:null;if(f.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},Vt(Qr,Zn),Zn|=l;else{if((l&1073741824)===0)return i=_!==null?_.baseLanes|l:l,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:i,cachePool:null,transitions:null},o.updateQueue=null,Vt(Qr,Zn),Zn|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=_!==null?_.baseLanes:l,Vt(Qr,Zn),Zn|=f}else _!==null?(f=_.baseLanes|l,o.memoizedState=null):f=l,Vt(Qr,Zn),Zn|=f;return Ln(i,o,g,l),o.child}function eg(i,o){var l=o.ref;(i===null&&l!==null||i!==null&&i.ref!==l)&&(o.flags|=512,o.flags|=2097152)}
vendor: 37,505 bytes, line 41
41function uh(i,o,l,f,g){var _=Vn(l)?Js:wn.current;return _=Vr(o,_),qr(o,g),l=Jc(i,o,l,f,_,g),f=eh(),i!==null&&!Hn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~g,Qi(i,o,g)):(Yt&&f&&Fc(o),o.flags|=1,Ln(i,o,l,g),o.child)}function tg(i,o,l,f,g){if(Vn(l)){var _=!0;cl(o)}else _=!1;if(qr(o,g),o.stateNode===null)Al(i,o),Gm(o,l,f),oh(o,l,f,g),f=!0;else if(i===null){var C=o.stateNode,O=o.memoizedProps;C.props=O;var V=C.context,he=l.contextType;typeof he=="object"&&he!==null?he=ai(he):(he=Vn(l)?Js:wn.current,he=Vr(o,he));var Se=l.getDerivedStateFromProps,ye=typeof Se=="function"||typeof C.getSnapshotBeforeUpdate=="function";ye||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==f||V!==he)&&Wm(o,C,f,he),ws=!1;var xe=o.memoizedState;C.state=xe,xl(o,f,C,g),V=o.memoizedState,O!==f||xe!==V||zn.current||ws?(typeof Se=="function"&&(rh(o,l,Se,f),V=o.memoizedState),(O=ws||Hm(o,l,O,f,xe,V,he))?(ye||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(o.flags|=4194308)):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=V),C.props=f,C.state=V,C.context=he,f=O):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{C=o.stateNode,vm(i,o),O=o.memoizedProps,he=o.type===o.elementType?O:_i(o.type,O),C.props=he,ye=o.pendingProps,xe=C.context,V=l.contextType,typeof V=="object"&&V!==null?V=ai(V):(V=Vn(l)?Js:wn.current,V=Vr(o,V));var ke=l.getDerivedStateFromProps;(Se=typeof ke=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==ye||xe!==V)&&Wm(o,C,f,V),ws=!1,xe=o.memoizedState,C.state=xe,xl(o,f,C,g);var We=o.memoizedState;O!==ye||xe!==We||zn.current||ws?(typeof ke=="function"&&(rh(o,l,ke,f),We=o.memoizedState),(he=ws||Hm(o,l,he,f,xe,We,V)||!1)?(Se||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(f,We,V),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(f,We,V)),typeof C.componentDidUpdate=="function"&&(o.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=We),C.props=f,C.state=We,C.context=V,f=he):(typeof C.componentDidUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(o.flags|=1024),f=!1)}return ch(i,o,l,f,_,g)}function ch(i,o,l,f,g,_){eg(i,o);var C=(o.flags&128)!==0;if(!f&&!C)return g&&om(o,l,!1),Qi(i,o,_);f=o.stateNode,AS.current=o;var O=C&&typeof l.getDerivedStateFromError!="function"?null:f.render();return o.flags|=1,i!==null&&C?(o.child=Xr(o,i.child,null,_),o.child=Xr(o,null,O,_)):Ln(i,o,O,_),o.memoizedState=f.state,g&&om(o,l,!0),o.child}function ng(i){var o=i.stateNode;o.pendingContext?sm(i,o.pendingContext,o.pendingContext!==o.context):o.context&&sm(i,o.context,!1),qc(i,o.containerInfo)}function ig(i,o,l,f,g){return Wr(),zc(g),o.flags|=256,Ln(i,o,l,f),o.child}var hh={dehydrated:null,treeContext:null,retryLane:0};function fh(i){return{baseLanes:i,cachePool:null,transitions:null}}function sg(i,o,l){var f=o.pendingProps,g=jt.current,_=!1,C=(o.flags&128)!==0,O;if((O=C)||(O=i!==null&&i.memoizedState===null?!1:(g&2)!==0),O?(_=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),Vt(jt,g&1),i===null)return Bc(o),i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((o.mode&1)===0?o.lanes=1:i.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(C=f.children,i=f.fallback,_?(f=o.mode,_=o.child,C={mode:"hidden",children:C},(f&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=C):_=zl(C,f,0,null),i=ur(i,f,l,null),_.return=o,i.return=o,_.sibling=i,o.child=_,o.child.memoizedState=fh(l),o.memoizedState=hh,i):dh(o,C));if(g=i.memoizedState,g!==null&&(O=g.dehydrated,O!==null))return RS(i,o,C,f,O,g,l);if(_){_=f.fallback,C=o.mode,g=i.child,O=g.sibling;var V={mode:"hidden",children:f.children};return(C&1)===0&&o.child!==g?(f=o.child,f.childLanes=0,f.pendingProps=V,o.deletions=null):(f=Ns(g,V),f.subtreeFlags=g.subtreeFlags&14680064),O!==null?_=Ns(O,_):(_=ur(_,C,l,null),_.flags|=2),_.return=o,f.return=o,f.sibling=_,o.child=f,f=_,_=o.child,C=i.child.memoizedState,C=C===null?fh(l):{baseLanes:C.baseLanes|l,cachePool:null,transitions:C.transitions},_.memoizedState=C,_.childLanes=i.childLanes&~l,o.memoizedState=hh,f}return _=i.child,i=_.sibling,f=Ns(_,{mode:"visible",children:f.children}),(o.mode&1)===0&&(f.lanes=l),f.return=o,f.sibling=null,i!==null&&(l=o.deletions,l===null?(o.deletions=[i],o.flags|=16):l.push(i)),o.child=f,o.memoizedState=null,f}function dh(i,o){return o=zl({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function Cl(i,o,l,f){return f!==null&&zc(f),Xr(o,i.child,null,l),i=dh(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function RS(i,o,l,f,g,_,C){if(l)return o.flags&256?(o.flags&=-257,f=ah(Error(t(422))),Cl(i,o,C,f)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(_=f.fallback,g=o.mode,f=zl({mode:"visible",children:f.children},g,0,null),_=ur(_,g,C,null),_.flags|=2,f.return=o,_.return=o,f.sibling=_,o.child=f,(o.mode&1)!==0&&Xr(o,i.child,null,C),o.child.memoizedState=fh(C),o.memoizedState=hh,_);if((o.mode&1)===0)return Cl(i,o,C,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var O=f.dgst;return f=O,_=Error(t(419)),f=ah(_,f,void 0),Cl(i,o,C,f)}if(O=(C&i.childLanes)!==0,Hn||O){if(f=fn,f!==null){switch(C&-C){case 4:g=2;break;case 16:g=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:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(f.suspendedLanes|C))!==0?0:g,g!==0&&g!==_.retryLane&&(_.retryLane=g,Ki(i,g),yi(f,i,g,-1))}return Rh(),f=ah(Error(t(421))),Cl(i,o,C,f)}return g.data==="$?"?(o.flags|=128,o.child=i.child,o=HS.bind(null,i),g._reactRetry=o,null):(i=_.treeContext,Qn=Ss(g.nextSibling),jn=o,Yt=!0,vi=null,i!==null&&(ri[oi++]=qi,ri[oi++]=Yi,ri[oi++]=er,qi=i.id,Yi=i.overflow,er=o),o=dh(o,f.children),o.flags|=4096,o)}function rg(i,o,l){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),Wc(i.return,o,l)}function ph(i,o,l,f,g){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:g}:(_.isBackwards=o,_.rendering=null,_.renderingStartTime=0,_.last=f,_.tail=l,_.tailMode=g)}function og(i,o,l){var f=o.pendingProps,g=f.revealOrder,_=f.tail;if(Ln(i,o,f.children,l),f=jt.current,(f&2)!==0)f=f&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&rg(i,l,o);else if(i.tag===19)rg(i,l,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}f&=1}if(Vt(jt,f),(o.mode&1)===0)o.memoizedState=null;else switch(g){case"forwards":for(l=o.child,g=null;l!==null;)i=l.alternate,i!==null&&Sl(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=o.child,o.child=null):(g=l.sibling,l.sibling=null),ph(o,!1,g,l,_);break;case"backwards":for(l=null,g=o.child,o.child=null;g!==null;){if(i=g.alternate,i!==null&&Sl(i)===null){o.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}ph(o,!0,l,null,_);break;case"together":ph(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Al(i,o){(o.mode&1)===0&&i!==null&&(i.alternate=null,o.alternate=null,o.flags|=2)}function Qi(i,o,l){if(i!==null&&(o.dependencies=i.dependencies),rr|=o.lanes,(l&o.childLanes)===0)return null;if(i!==null&&o.child!==i.child)throw Error(t(153));if(o.child!==null){for(i=o.child,l=Ns(i,i.pendingProps),o.child=l,l.return=o;i.sibling!==null;)i=i.sibling,l=l.sibling=Ns(i,i.pendingProps),l.return=o;l.sibling=null}return o.child}function PS(i,o,l){switch(o.tag){case 3:ng(o),Wr();break;case 5:Sm(o);break;case 1:Vn(o.type)&&cl(o);break;case 4:qc(o,o.stateNode.containerInfo);break;case 10:var f=o.type._context,g=o.memoizedProps.value;Vt(gl,f._currentValue),f._currentValue=g;break;case 13:if(f=o.memoizedState,f!==null)return f.dehydrated!==null?(Vt(jt,jt.current&1),o.flags|=128,null):(l&o.child.childLanes)!==0?sg(i,o,l):(Vt(jt,jt.current&1),i=Qi(i,o,l),i!==null?i.sibling:null);Vt(jt,jt.current&1);break;case 19:if(f=(l&o.childLanes)!==0,(i.flags&128)!==0){if(f)return og(i,o,l);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Vt(jt,jt.current),f)break;return null;case 22:case 23:return o.lanes=0,Jm(i,o,l)}return Qi(i,o,l)}var ag,mh,lg,ug;ag=function(i,o){for(var l=o.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},mh=function(){},lg=function(i,o,l,f){var g=i.memoizedProps;if(g!==f){i=o.stateNode,ir(Li.current);var _=null;switch(l){case"input":g=Mt(i,g),f=Mt(i,f),_=[];break;case"select":g=ue({},g,{value:void 0}),f=ue({},f,{value:void 0}),_=[];break;case"textarea":g=mt(i,g),f=mt(i,f),_=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(i.onclick=al)}Ye(l,f);var C;l=null;for(he in g)if(!f.hasOwnProperty(he)&&g.hasOwnProperty(he)&&g[he]!=null)if(he==="style"){var O=g[he];for(C in O)O.hasOwnProperty(C)&&(l||(l={}),l[C]="")}else he!=="dangerouslySetInnerHTML"&&he!=="children"&&he!=="suppressContentEditableWarning"&&he!=="suppressHydrationWarning"&&he!=="autoFocus"&&(r.hasOwnProperty(he)?_||(_=[]):(_=_||[]).push(he,null));for(he in f){var V=f[he];if(O=g!=null?g[he]:void 0,f.hasOwnProperty(he)&&V!==O&&(V!=null||O!=null))if(he==="style")if(O){for(C in O)!O.hasOwnProperty(C)||V&&V.hasOwnProperty(C)||(l||(l={}),l[C]="");for(C in V)V.hasOwnProperty(C)&&O[C]!==V[C]&&(l||(l={}),l[C]=V[C])}else l||(_||(_=[]),_.push(he,l)),l=V;else he==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,O=O?O.__html:void 0,V!=null&&O!==V&&(_=_||[]).push(he,V)):he==="children"?typeof V!="string"&&typeof V!="number"||(_=_||[]).push(he,""+V):he!=="suppressContentEditableWarning"&&he!=="suppressHydrationWarning"&&(r.hasOwnProperty(he)?(V!=null&&he==="onScroll"&&Xt("scroll",i),_||O===V||(_=[])):(_=_||[]).push(he,V))}l&&(_=_||[]).push("style",l);var he=_;(o.updateQueue=he)&&(o.flags|=4)}},ug=function(i,o,l,f){l!==f&&(o.flags|=4)};function fa(i,o){if(!Yt)switch(i.tailMode){case"hidden":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function Tn(i){var o=i.alternate!==null&&i.alternate.child===i.child,l=0,f=0;if(o)for(var g=i.child;g!==null;)l|=g.lanes|g.childLanes,f|=g.subtreeFlags&14680064,f|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)l|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=f,i.childLanes=l,o}function NS(i,o,l){var f=o.pendingProps;switch(Oc(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(o),null;case 1:return Vn(o.type)&&ul(),Tn(o),null;case 3:return f=o.stateNode,Yr(),$t(zn),$t(wn),jc(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(pl(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,vi!==null&&(Th(vi),vi=null))),mh(i,o),Tn(o),null;case 5:Yc(o);var g=ir(aa.current);if(l=o.type,i!==null&&o.stateNode!=null)lg(i,o,l,f,g),i.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!f){if(o.stateNode===null)throw Error(t(166));return Tn(o),null}if(i=ir(Li.current),pl(o)){f=o.stateNode,l=o.type;var _=o.memoizedProps;switch(f[Ni]=o,f[na]=_,i=(o.mode&1)!==0,l){case"dialog":Xt("cancel",f),Xt("close",f);break;case"iframe":case"object":case"embed":Xt("load",f);break;case"video":case"audio":for(g=0;g<Jo.length;g++)Xt(Jo[g],f);break;case"source":Xt("error",f);break;case"img":case"image":case"link":Xt("error",f),Xt("load",f);break;case"details":Xt("toggle",f);break;case"input":_t(f,_),Xt("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!_.multiple},Xt("invalid",f);break;case"textarea":H(f,_),Xt("invalid",f)}Ye(l,_),g=null;for(var C in _)if(_.hasOwnProperty(C)){var O=_[C];C==="children"?typeof O=="string"?f.textContent!==O&&(_.suppressHydrationWarning!==!0&&ol(f.textContent,O,i),g=["children",O]):typeof O=="number"&&f.textContent!==""+O&&(_.suppressHydrationWarning!==!0&&ol(f.textContent,O,i),g=["children",""+O]):r.hasOwnProperty(C)&&O!=null&&C==="onScroll"&&Xt("scroll",f)}switch(l){case"input":Je(f),Ht(f,_,!0);break;case"textarea":Je(f),Ct(f);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(f.onclick=al)}f=g,o.updateQueue=f,f!==null&&(o.flags|=4)}else{C=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=I(l)),i==="http://www.w3.org/1999/xhtml"?l==="script"?(i=C.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof f.is=="string"?i=C.createElement(l,{is:f.is}):(i=C.createElement(l),l==="select"&&(C=i,f.multiple?C.multiple=!0:f.size&&(C.size=f.size))):i=C.createElementNS(i,l),i[Ni]=o,i[na]=f,ag(i,o,!1,!1),o.stateNode=i;e:{switch(C=Le(l,f),l){case"dialog":Xt("cancel",i),Xt("close",i),g=f;break;case"iframe":case"object":case"embed":Xt("load",i),g=f;break;case"video":case"audio":for(g=0;g<Jo.length;g++)Xt(Jo[g],i);g=f;break;case"source":Xt("error",i),g=f;break;case"img":case"image":case"link":Xt("error",i),Xt("load",i),g=f;break;case"details":Xt("toggle",i),g=f;break;case"input":_t(i,f),g=Mt(i,f),Xt("invalid",i);break;case"option":g=f;break;case"select":i._wrapperState={wasMultiple:!!f.multiple},g=ue({},f,{value:void 0}),Xt("invalid",i);break;case"textarea":H(i,f),g=mt(i,f),Xt("invalid",i);break;default:g=f}Ye(l,g),O=g;for(_ in O)if(O.hasOwnProperty(_)){var V=O[_];_==="style"?ge(i,V):_==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&re(i,V)):_==="children"?typeof V=="string"?(l!=="textarea"||V!=="")&&fe(i,V):typeof V=="number"&&fe(i,""+V):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(r.hasOwnProperty(_)?V!=null&&_==="onScroll"&&Xt("scroll",i):V!=null&&U(i,_,V,C))}switch(l){case"input":Je(i),Ht(i,f,!1);break;case"textarea":Je(i),Ct(i);break;case"option":f.value!=null&&i.setAttribute("value",""+pe(f.value));break;case"select":i.multiple=!!f.multiple,_=f.value,_!=null?tt(i,!!f.multiple,_,!1):f.defaultValue!=null&&tt(i,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=al)}switch(l){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return Tn(o),null;case 6:if(i&&o.stateNode!=null)ug(i,o,i.memoizedProps,f);else{if(typeof f!="string"&&o.stateNode===null)throw Error(t(166));if(l=ir(aa.current),ir(Li.current),pl(o)){if(f=o.stateNode,l=o.memoizedProps,f[Ni]=o,(_=f.nodeValue!==l)&&(i=jn,i!==null))switch(i.tag){case 3:ol(f.nodeValue,l,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&ol(f.nodeValue,l,(i.mode&1)!==0)}_&&(o.flags|=4)}else f=(l.nodeType===9?l:l.ownerDocument).createTextNode(f),f[Ni]=o,o.stateNode=f}return Tn(o),null;case 13:if($t(jt),f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Yt&&Qn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)fm(),Wr(),o.flags|=98560,_=!1;else if(_=pl(o),f!==null&&f.dehydrated!==null){if(i===null){if(!_)throw Error(t(318));if(_=o.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(t(317));_[Ni]=o}else Wr(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Tn(o),_=!1}else vi!==null&&(Th(vi),vi=null),_=!0;if(!_)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=l,o):(f=f!==null,f!==(i!==null&&i.memoizedState!==null)&&f&&(o.child.flags|=8192,(o.mode&1)!==0&&(i===null||(jt.current&1)!==0?ln===0&&(ln=3):Rh())),o.updateQueue!==null&&(o.flags|=4),Tn(o),null);case 4:return Yr(),mh(i,o),i===null&&ea(o.stateNode.containerInfo),Tn(o),null;case 10:return Gc(o.type._context),Tn(o),null;case 17:return Vn(o.type)&&ul(),Tn(o),null;case 19:if($t(jt),_=o.memoizedState,_===null)return Tn(o),null;if(f=(o.flags&128)!==0,C=_.rendering,C===null)if(f)fa(_,!1);else{if(ln!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(C=Sl(i),C!==null){for(o.flags|=128,fa(_,!1),f=C.updateQueue,f!==null&&(o.updateQueue=f,o.flags|=4),o.subtreeFlags=0,f=l,l=o.child;l!==null;)_=l,i=f,_.flags&=14680066,C=_.alternate,C===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=C.childLanes,_.lanes=C.lanes,_.child=C.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=C.memoizedProps,_.memoizedState=C.memoizedState,_.updateQueue=C.updateQueue,_.type=C.type,i=C.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),l=l.sibling;return Vt(jt,jt.current&1|2),o.child}i=i.sibling}_.tail!==null&&Kt()>Zr&&(o.flags|=128,f=!0,fa(_,!1),o.lanes=4194304)}else{if(!f)if(i=Sl(C),i!==null){if(o.flags|=128,f=!0,l=i.updateQueue,l!==null&&(o.updateQueue=l,o.flags|=4),fa(_,!0),_.tail===null&&_.tailMode==="hidden"&&!C.alternate&&!Yt)return Tn(o),null}else 2*Kt()-_.renderingStartTime>Zr&&l!==1073741824&&(o.flags|=128,f=!0,fa(_,!1),o.lanes=4194304);_.isBackwards?(C.sibling=o.child,o.child=C):(l=_.last,l!==null?l.sibling=C:o.child=C,_.last=C)}return _.tail!==null?(o=_.tail,_.rendering=o,_.tail=o.sibling,_.renderingStartTime=Kt(),o.sibling=null,l=jt.current,Vt(jt,f?l&1|2:l&1),o):(Tn(o),null);case 22:case 23:return Ah(),f=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==f&&(o.flags|=8192),f&&(o.mode&1)!==0?(Zn&1073741824)!==0&&(Tn(o),o.subtreeFlags&6&&(o.flags|=8192)):Tn(o),null;case 24:return null;case 25:return null}throw Error(t(156,o.tag))}function LS(i,o){switch(Oc(o),o.tag){case 1:return Vn(o.type)&&ul(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Yr(),$t(zn),$t(wn),jc(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Yc(o),null;case 13:if($t(jt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(t(340));Wr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return $t(jt),null;case 4:return Yr(),null;case 10:return Gc(o.type._context),null;case 22:case 23:return Ah(),null;case 24:return null;default:return null}}var Rl=!1,Cn=!1,DS=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function jr(i,o){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(f){Zt(i,o,f)}else l.current=null}function gh(i,o,l){try{l()}catch(f){Zt(i,o,f)}}var cg=!1;function IS(i,o){if(Ac=Ka,i=Hp(),Sc(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var g=f.anchorOffset,_=f.focusNode;f=f.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var C=0,O=-1,V=-1,he=0,Se=0,ye=i,xe=null;t:for(;;){for(var ke;ye!==l||g!==0&&ye.nodeType!==3||(O=C+g),ye!==_||f!==0&&ye.nodeType!==3||(V=C+f),ye.nodeType===3&&(C+=ye.nodeValue.length),(ke=ye.firstChild)!==null;)xe=ye,ye=ke;for(;;){if(ye===i)break t;if(xe===l&&++he===g&&(O=C),xe===_&&++Se===f&&(V=C),(ke=ye.nextSibling)!==null)break;ye=xe,xe=ye.parentNode}ye=ke}l=O===-1||V===-1?null:{start:O,end:V}}else l=null}l=l||{start:0,end:0}}else l=null;for(Rc={focusedElem:i,selectionRange:l},Ka=!1,Ve=o;Ve!==null;)if(o=Ve,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Ve=i;else for(;Ve!==null;){o=Ve;try{var We=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(We!==null){var qe=We.memoizedProps,en=We.memoizedState,Z=o.stateNode,X=Z.getSnapshotBeforeUpdate(o.elementType===o.type?qe:_i(o.type,qe),en);Z.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var ne=o.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(Ee){Zt(o,o.return,Ee)}if(i=o.sibling,i!==null){i.return=o.return,Ve=i;break}Ve=o.return}return We=cg,cg=!1,We}function da(i,o,l){var f=o.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&i)===i){var _=g.destroy;g.destroy=void 0,_!==void 0&&gh(o,l,_)}g=g.next}while(g!==f)}}function Pl(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do{if((l.tag&i)===i){var f=l.create;l.destroy=f()}l=l.next}while(l!==o)}}function vh(i){var o=i.ref;if(o!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof o=="function"?o(i):o.current=i}}function hg(i){var o=i.alternate;o!==null&&(i.alternate=null,hg(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[Ni],delete o[na],delete o[Dc],delete o[gS],delete o[vS])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function fg(i){return i.tag===5||i.tag===3||i.tag===4}function dg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||fg(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function _h(i,o,l){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?l.nodeType===8?l.parentNode.insertBefore(i,o):l.insertBefore(i,o):(l.nodeType===8?(o=l.parentNode,o.insertBefore(i,l)):(o=l,o.appendChild(i)),l=l._reactRootContainer,l!=null||o.onclick!==null||(o.onclick=al));else if(f!==4&&(i=i.child,i!==null))for(_h(i,o,l),i=i.sibling;i!==null;)_h(i,o,l),i=i.sibling}function xh(i,o,l){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?l.insertBefore(i,o):l.appendChild(i);else if(f!==4&&(i=i.child,i!==null))for(xh(i,o,l),i=i.sibling;i!==null;)xh(i,o,l),i=i.sibling}var _n=null,xi=!1;function Ts(i,o,l){for(l=l.child;l!==null;)pg(i,o,l),l=l.sibling}function pg(i,o,l){if(Te&&typeof Te.onCommitFiberUnmount=="function")try{Te.onCommitFiberUnmount(ee,l)}catch{}switch(l.tag){case 5:Cn||jr(l,o);case 6:var f=_n,g=xi;_n=null,Ts(i,o,l),_n=f,xi=g,_n!==null&&(xi?(i=_n,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):_n.removeChild(l.stateNode));break;case 18:_n!==null&&(xi?(i=_n,l=l.stateNode,i.nodeType===8?Lc(i.parentNode,l):i.nodeType===1&&Lc(i,l),Xo(i)):Lc(_n,l.stateNode));break;case 4:f=_n,g=xi,_n=l.stateNode.containerInfo,xi=!0,Ts(i,o,l),_n=f,xi=g;break;case 0:case 11:case 14:case 15:if(!Cn&&(f=l.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var _=g,C=_.destroy;_=_.tag,C!==void 0&&((_&2)!==0||(_&4)!==0)&&gh(l,o,C),g=g.next}while(g!==f)}Ts(i,o,l);break;case 1:if(!Cn&&(jr(l,o),f=l.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=l.memoizedProps,f.state=l.memoizedState,f.componentWillUnmount()}catch(O){Zt(l,o,O)}Ts(i,o,l);break;case 21:Ts(i,o,l);break;case 22:l.mode&1?(Cn=(f=Cn)||l.memoizedState!==null,Ts(i,o,l),Cn=f):Ts(i,o,l);break;default:Ts(i,o,l)}}function mg(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new DS),o.forEach(function(f){var g=GS.bind(null,i,f);l.has(f)||(l.add(f),f.then(g,g))})}}function Si(i,o){var l=o.deletions;if(l!==null)for(var f=0;f<l.length;f++){var g=l[f];try{var _=i,C=o,O=C;e:for(;O!==null;){switch(O.tag){case 5:_n=O.stateNode,xi=!1;break e;case 3:_n=O.stateNode.containerInfo,xi=!0;break e;case 4:_n=O.stateNode.containerInfo,xi=!0;break e}O=O.return}if(_n===null)throw Error(t(160));pg(_,C,g),_n=null,xi=!1;var V=g.alternate;V!==null&&(V.return=null),g.return=null}catch(he){Zt(g,o,he)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)gg(o,i),o=o.sibling}function gg(i,o){var l=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Si(o,i),Ii(i),f&4){try{da(3,i,i.return),Pl(3,i)}catch(qe){Zt(i,i.return,qe)}try{da(5,i,i.return)}catch(qe){Zt(i,i.return,qe)}}break;case 1:Si(o,i),Ii(i),f&512&&l!==null&&jr(l,l.return);break;case 5:if(Si(o,i),Ii(i),f&512&&l!==null&&jr(l,l.return),i.flags&32){var g=i.stateNode;try{fe(g,"")}catch(qe){Zt(i,i.return,qe)}}if(f&4&&(g=i.stateNode,g!=null)){var _=i.memoizedProps,C=l!==null?l.memoizedProps:_,O=i.type,V=i.updateQueue;if(i.updateQueue=null,V!==null)try{O==="input"&&_.type==="radio"&&_.name!=null&&ft(g,_),Le(O,C);var he=Le(O,_);for(C=0;C<V.length;C+=2){var Se=V[C],ye=V[C+1];Se==="style"?ge(g,ye):Se==="dangerouslySetInnerHTML"?re(g,ye):Se==="children"?fe(g,ye):U(g,Se,ye,he)}switch(O){case"input":kt(g,_);break;case"textarea":gn(g,_);break;case"select":var xe=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!_.multiple;var ke=_.value;ke!=null?tt(g,!!_.multiple,ke,!1):xe!==!!_.multiple&&(_.defaultValue!=null?tt(g,!!_.multiple,_.defaultValue,!0):tt(g,!!_.multiple,_.multiple?[]:"",!1))}g[na]=_}catch(qe){Zt(i,i.return,qe)}}break;case 6:if(Si(o,i),Ii(i),f&4){if(i.stateNode===null)throw Error(t(162));g=i.stateNode,_=i.memoizedProps;try{g.nodeValue=_}catch(qe){Zt(i,i.return,qe)}}break;case 3:if(Si(o,i),Ii(i),f&4&&l!==null&&l.memoizedState.isDehydrated)try{Xo(o.containerInfo)}catch(qe){Zt(i,i.return,qe)}break;case 4:Si(o,i),Ii(i);break;case 13:Si(o,i),Ii(i),g=i.child,g.flags&8192&&(_=g.memoizedState!==null,g.stateNode.isHidden=_,!_||g.alternate!==null&&g.alternate.memoizedState!==null||(Mh=Kt())),f&4&&mg(i);break;case 22:if(Se=l!==null&&l.memoizedState!==null,i.mode&1?(Cn=(he=Cn)||Se,Si(o,i),Cn=he):Si(o,i),Ii(i),f&8192){if(he=i.memoizedState!==null,(i.stateNode.isHidden=he)&&!Se&&(i.mode&1)!==0)for(Ve=i,Se=i.child;Se!==null;){for(ye=Ve=Se;Ve!==null;){switch(xe=Ve,ke=xe.child,xe.tag){case 0:case 11:case 14:case 15:da(4,xe,xe.return);break;case 1:jr(xe,xe.return);var We=xe.stateNode;if(typeof We.componentWillUnmount=="function"){f=xe,l=xe.return;try{o=f,We.props=o.memoizedProps,We.state=o.memoizedState,We.componentWillUnmount()}catch(qe){Zt(f,l,qe)}}break;case 5:jr(xe,xe.return);break;case 22:if(xe.memoizedState!==null){xg(ye);continue}}ke!==null?(ke.return=xe,Ve=ke):xg(ye)}Se=Se.sibling}e:for(Se=null,ye=i;;){if(ye.tag===5){if(Se===null){Se=ye;try{g=ye.stateNode,he?(_=g.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(O=ye.stateNode,V=ye.memoizedProps.style,C=V!=null&&V.hasOwnProperty("display")?V.display:null,O.style.display=de("display",C))}catch(qe){Zt(i,i.return,qe)}}}else if(ye.tag===6){if(Se===null)try{ye.stateNode.nodeValue=he?"":ye.memoizedProps}catch(qe){Zt(i,i.return,qe)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===i)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===i)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===i)break e;Se===ye&&(Se=null),ye=ye.return}Se===ye&&(Se=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:Si(o,i),Ii(i),f&4&&mg(i);break;case 21:break;default:Si(o,i),Ii(i)}}function Ii(i){var o=i.flags;if(o&2){try{e:{for(var l=i.return;l!==null;){if(fg(l)){var f=l;break e}l=l.return}throw Error(t(160))}switch(f.tag){case 5:var g=f.stateNode;f.flags&32&&(fe(g,""),f.flags&=-33);var _=dg(i);xh(i,_,g);break;case 3:case 4:var C=f.stateNode.containerInfo,O=dg(i);_h(i,O,C);break;default:throw Error(t(161))}}catch(V){Zt(i,i.return,V)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function US(i,o,l){Ve=i,vg(i)}function vg(i,o,l){for(var f=(i.mode&1)!==0;Ve!==null;){var g=Ve,_=g.child;if(g.tag===22&&f){var C=g.memoizedState!==null||Rl;if(!C){var O=g.alternate,V=O!==null&&O.memoizedState!==null||Cn;O=Rl;var he=Cn;if(Rl=C,(Cn=V)&&!he)for(Ve=g;Ve!==null;)C=Ve,V=C.child,C.tag===22&&C.memoizedState!==null?Sg(g):V!==null?(V.return=C,Ve=V):Sg(g);for(;_!==null;)Ve=_,vg(_),_=_.sibling;Ve=g,Rl=O,Cn=he}_g(i)}else(g.subtreeFlags&8772)!==0&&_!==null?(_.return=g,Ve=_):_g(i)}}function _g(i){for(;Ve!==null;){var o=Ve;if((o.flags&8772)!==0){var l=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:Cn||Pl(5,o);break;case 1:var f=o.stateNode;if(o.flags&4&&!Cn)if(l===null)f.componentDidMount();else{var g=o.elementType===o.type?l.memoizedProps:_i(o.type,l.memoizedProps);f.componentDidUpdate(g,l.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var _=o.updateQueue;_!==null&&xm(o,_,f);break;case 3:var C=o.updateQueue;if(C!==null){if(l=null,o.child!==null)switch(o.child.tag){case 5:l=o.child.stateNode;break;case 1:l=o.child.stateNode}xm(o,C,l)}break;case 5:var O=o.stateNode;if(l===null&&o.flags&4){l=O;var V=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&l.focus();break;case"img":V.src&&(l.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var he=o.alternate;if(he!==null){var Se=he.memoizedState;if(Se!==null){var ye=Se.dehydrated;ye!==null&&Xo(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Cn||o.flags&512&&vh(o)}catch(xe){Zt(o,o.return,xe)}}if(o===i){Ve=null;break}if(l=o.sibling,l!==null){l.return=o.return,Ve=l;break}Ve=o.return}}function xg(i){for(;Ve!==null;){var o=Ve;if(o===i){Ve=null;break}var l=o.sibling;if(l!==null){l.return=o.return,Ve=l;break}Ve=o.return}}function Sg(i){for(;Ve!==null;){var o=Ve;try{switch(o.tag){case 0:case 11:case 15:var l=o.return;try{Pl(4,o)}catch(V){Zt(o,l,V)}break;case 1:var f=o.stateNode;if(typeof f.componentDidMount=="function"){var g=o.return;try{f.componentDidMount()}catch(V){Zt(o,g,V)}}var _=o.return;try{vh(o)}catch(V){Zt(o,_,V)}break;case 5:var C=o.return;try{vh(o)}catch(V){Zt(o,C,V)}}}catch(V){Zt(o,o.return,V)}if(o===i){Ve=null;break}var O=o.sibling;if(O!==null){O.return=o.return,Ve=O;break}Ve=o.return}}var FS=Math.ceil,Nl=T.ReactCurrentDispatcher,Sh=T.ReactCurrentOwner,ui=T.ReactCurrentBatchConfig,Et=0,fn=null,sn=null,xn=0,Zn=0,Qr=ys(0),ln=0,pa=null,rr=0,Ll=0,yh=0,ma=null,Gn=null,Mh=0,Zr=1/0,Zi=null,Dl=!1,Eh=null,Cs=null,Il=!1,As=null,Ul=0,ga=0,wh=null,Fl=-1,Ol=0;function Dn(){return(Et&6)!==0?Kt():Fl!==-1?Fl:Fl=Kt()}function Rs(i){return(i.mode&1)===0?1:(Et&2)!==0&&xn!==0?xn&-xn:xS.transition!==null?(Ol===0&&(Ol=Oe()),Ol):(i=gt,i!==0||(i=window.event,i=i===void 0?16:Mp(i.type)),i)}function yi(i,o,l,f){if(50<ga)throw ga=0,wh=null,Error(t(185));pt(i,l,f),((Et&2)===0||i!==fn)&&(i===fn&&((Et&2)===0&&(Ll|=l),ln===4&&Ps(i,xn)),Wn(i,f),l===1&&Et===0&&(o.mode&1)===0&&(Zr=Kt()+500,hl&&Es()))}function Wn(i,o){var l=i.callbackNode;Lt(i,o);var f=zt(i,i===fn?xn:0);if(f===0)l!==null&&Bo(l),i.callbackNode=null,i.callbackPriority=0;else if(o=f&-f,i.callbackPriority!==o){if(l!=null&&Bo(l),o===1)i.tag===0?_S(Mg.bind(null,i)):am(Mg.bind(null,i)),pS(function(){(Et&6)===0&&Es()}),l=null;else{switch(Wi(f)){case 1:l=zo;break;case 4:l=A;break;case 16:l=q;break;case 536870912:l=te;break;default:l=q}l=Pg(l,yg.bind(null,i))}i.callbackPriority=o,i.callbackNode=l}}function yg(i,o){if(Fl=-1,Ol=0,(Et&6)!==0)throw Error(t(327));var l=i.callbackNode;if(Jr()&&i.callbackNode!==l)return null;var f=zt(i,i===fn?xn:0);if(f===0)return null;if((f&30)!==0||(f&i.expiredLanes)!==0||o)o=kl(i,f);else{o=f;var g=Et;Et|=2;var _=wg();(fn!==i||xn!==o)&&(Zi=null,Zr=Kt()+500,ar(i,o));do try{BS();break}catch(O){Eg(i,O)}while(!0);Hc(),Nl.current=_,Et=g,sn!==null?o=0:(fn=null,xn=0,o=ln)}if(o!==0){if(o===2&&(g=nn(i),g!==0&&(f=g,o=bh(i,g))),o===1)throw l=pa,ar(i,0),Ps(i,f),Wn(i,Kt()),l;if(o===6)Ps(i,f);else{if(g=i.current.alternate,(f&30)===0&&!OS(g)&&(o=kl(i,f),o===2&&(_=nn(i),_!==0&&(f=_,o=bh(i,_))),o===1))throw l=pa,ar(i,0),Ps(i,f),Wn(i,Kt()),l;switch(i.finishedWork=g,i.finishedLanes=f,o){case 0:case 1:throw Error(t(345));case 2:lr(i,Gn,Zi);break;case 3:if(Ps(i,f),(f&130023424)===f&&(o=Mh+500-Kt(),10<o)){if(zt(i,0)!==0)break;if(g=i.suspendedLanes,(g&f)!==f){Dn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Nc(lr.bind(null,i,Gn,Zi),o);break}lr(i,Gn,Zi);break;case 4:if(Ps(i,f),(f&4194240)===f)break;for(o=i.eventTimes,g=-1;0<f;){var C=31-be(f);_=1<<C,C=o[C],C>g&&(g=C),f&=~_}if(f=g,f=Kt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*FS(f/1960))-f,10<f){i.timeoutHandle=Nc(lr.bind(null,i,Gn,Zi),f);break}lr(i,Gn,Zi);break;case 5:lr(i,Gn,Zi);break;default:throw Error(t(329))}}}return Wn(i,Kt()),i.callbackNode===l?yg.bind(null,i):null}function bh(i,o){var l=ma;return i.current.memoizedState.isDehydrated&&(ar(i,o).flags|=256),i=kl(i,o),i!==2&&(o=Gn,Gn=l,o!==null&&Th(o)),i}function Th(i){Gn===null?Gn=i:Gn.push.apply(Gn,i)}function OS(i){for(var o=i;;){if(o.flags&16384){var l=o.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var f=0;f<l.length;f++){var g=l[f],_=g.getSnapshot;g=g.value;try{if(!gi(_(),g))return!1}catch{return!1}}}if(l=o.child,o.subtreeFlags&16384&&l!==null)l.return=o,o=l;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ps(i,o){for(o&=~yh,o&=~Ll,i.suspendedLanes|=o,i.pingedLanes&=~o,i=i.expirationTimes;0<o;){var l=31-be(o),f=1<<l;i[l]=-1,o&=~f}}function Mg(i){if((Et&6)!==0)throw Error(t(327));Jr();var o=zt(i,0);if((o&1)===0)return Wn(i,Kt()),null;var l=kl(i,o);if(i.tag!==0&&l===2){var f=nn(i);f!==0&&(o=f,l=bh(i,f))}if(l===1)throw l=pa,ar(i,0),Ps(i,o),Wn(i,Kt()),l;if(l===6)throw Error(t(345));return i.finishedWork=i.current.alternate,i.finishedLanes=o,lr(i,Gn,Zi),Wn(i,Kt()),null}function Ch(i,o){var l=Et;Et|=1;try{return i(o)}finally{Et=l,Et===0&&(Zr=Kt()+500,hl&&Es())}}function or(i){As!==null&&As.tag===0&&(Et&6)===0&&Jr();var o=Et;Et|=1;var l=ui.transition,f=gt;try{if(ui.transition=null,gt=1,i)return i()}finally{gt=f,ui.transition=l,Et=o,(Et&6)===0&&Es()}}function Ah(){Zn=Qr.current,$t(Qr)}function ar(i,o){i.finishedWork=null,i.finishedLanes=0;var l=i.timeoutHandle;if(l!==-1&&(i.timeoutHandle=-1,dS(l)),sn!==null)for(l=sn.return;l!==null;){var f=l;switch(Oc(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&ul();break;case 3:Yr(),$t(zn),$t(wn),jc();break;case 5:Yc(f);break;case 4:Yr();break;case 13:$t(jt);break;case 19:$t(jt);break;case 10:Gc(f.type._context);break;case 22:case 23:Ah()}l=l.return}if(fn=i,sn=i=Ns(i.current,null),xn=Zn=o,ln=0,pa=null,yh=Ll=rr=0,Gn=ma=null,nr!==null){for(o=0;o<nr.length;o++)if(l=nr[o],f=l.interleaved,f!==null){l.interleaved=null;var g=f.next,_=l.pending;if(_!==null){var C=_.next;_.next=g,f.next=C}l.pending=f}nr=null}return i}function Eg(i,o){do{var l=sn;try{if(Hc(),yl.current=bl,Ml){for(var f=Qt.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}Ml=!1}if(sr=0,hn=an=Qt=null,la=!1,ua=0,Sh.current=null,l===null||l.return===null){ln=1,pa=o,sn=null;break}e:{var _=i,C=l.return,O=l,V=o;if(o=xn,O.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var he=V,Se=O,ye=Se.tag;if((Se.mode&1)===0&&(ye===0||ye===11||ye===15)){var xe=Se.alternate;xe?(Se.updateQueue=xe.updateQueue,Se.memoizedState=xe.memoizedState,Se.lanes=xe.lanes):(Se.updateQueue=null,Se.memoizedState=null)}var ke=Ym(C);if(ke!==null){ke.flags&=-257,Km(ke,C,O,_,o),ke.mode&1&&qm(_,he,o),o=ke,V=he;var We=o.updateQueue;if(We===null){var qe=new Set;qe.add(V),o.updateQueue=qe}else We.add(V);break e}else{if((o&1)===0){qm(_,he,o),Rh();break e}V=Error(t(426))}}else if(Yt&&O.mode&1){var en=Ym(C);if(en!==null){(en.flags&65536)===0&&(en.flags|=256),Km(en,C,O,_,o),zc(Kr(V,O));break e}}_=V=Kr(V,O),ln!==4&&(ln=2),ma===null?ma=[_]:ma.push(_),_=C;do{switch(_.tag){case 3:_.flags|=65536,o&=-o,_.lanes|=o;var Z=Xm(_,V,o);_m(_,Z);break e;case 1:O=V;var X=_.type,ne=_.stateNode;if((_.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(Cs===null||!Cs.has(ne)))){_.flags|=65536,o&=-o,_.lanes|=o;var Ee=$m(_,O,o);_m(_,Ee);break e}}_=_.return}while(_!==null)}Tg(l)}catch(je){o=je,sn===l&&l!==null&&(sn=l=l.return);continue}break}while(!0)}function wg(){var i=Nl.current;return Nl.current=bl,i===null?bl:i}function Rh(){(ln===0||ln===3||ln===2)&&(ln=4),fn===null||(rr&268435455)===0&&(Ll&268435455)===0||Ps(fn,xn)}function kl(i,o){var l=Et;Et|=2;var f=wg();(fn!==i||xn!==o)&&(Zi=null,ar(i,o));do try{kS();break}catch(g){Eg(i,g)}while(!0);if(Hc(),Et=l,Nl.current=f,sn!==null)throw Error(t(261));return fn=null,xn=0,ln}function kS(){for(;sn!==null;)bg(sn)}function BS(){for(;sn!==null&&!qa();)bg(sn)}function bg(i){var o=Rg(i.alternate,i,Zn);i.memoizedProps=i.pendingProps,o===null?Tg(i):sn=o,Sh.current=null}function Tg(i){var o=i;do{var l=o.alternate;if(i=o.return,(o.flags&32768)===0){if(l=NS(l,o,Zn),l!==null){sn=l;return}}else{if(l=LS(l,o),l!==null){l.flags&=32767,sn=l;return}
vendor: 4,567 bytes, line 41
41if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{ln=6,sn=null;return}}if(o=o.sibling,o!==null){sn=o;return}sn=o=i}while(o!==null);ln===0&&(ln=5)}function lr(i,o,l){var f=gt,g=ui.transition;try{ui.transition=null,gt=1,zS(i,o,l,f)}finally{ui.transition=g,gt=f}return null}function zS(i,o,l,f){do Jr();while(As!==null);if((Et&6)!==0)throw Error(t(327));l=i.finishedWork;var g=i.finishedLanes;if(l===null)return null;if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(t(177));i.callbackNode=null,i.callbackPriority=0;var _=l.lanes|l.childLanes;if(kn(i,_),i===fn&&(sn=fn=null,xn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Il||(Il=!0,Pg(q,function(){return Jr(),null})),_=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||_){_=ui.transition,ui.transition=null;var C=gt;gt=1;var O=Et;Et|=4,Sh.current=null,IS(i,l),gg(l,i),oS(Rc),Ka=!!Ac,Rc=Ac=null,i.current=l,US(l),ac(),Et=O,gt=C,ui.transition=_}else i.current=l;if(Il&&(Il=!1,As=i,Ul=g),_=i.pendingLanes,_===0&&(Cs=null),ze(l.stateNode),Wn(i,Kt()),o!==null)for(f=i.onRecoverableError,l=0;l<o.length;l++)g=o[l],f(g.value,{componentStack:g.stack,digest:g.digest});if(Dl)throw Dl=!1,i=Eh,Eh=null,i;return(Ul&1)!==0&&i.tag!==0&&Jr(),_=i.pendingLanes,(_&1)!==0?i===wh?ga++:(ga=0,wh=i):ga=0,Es(),null}function Jr(){if(As!==null){var i=Wi(Ul),o=ui.transition,l=gt;try{if(ui.transition=null,gt=16>i?16:i,As===null)var f=!1;else{if(i=As,As=null,Ul=0,(Et&6)!==0)throw Error(t(331));var g=Et;for(Et|=4,Ve=i.current;Ve!==null;){var _=Ve,C=_.child;if((Ve.flags&16)!==0){var O=_.deletions;if(O!==null){for(var V=0;V<O.length;V++){var he=O[V];for(Ve=he;Ve!==null;){var Se=Ve;switch(Se.tag){case 0:case 11:case 15:da(8,Se,_)}var ye=Se.child;if(ye!==null)ye.return=Se,Ve=ye;else for(;Ve!==null;){Se=Ve;var xe=Se.sibling,ke=Se.return;if(hg(Se),Se===he){Ve=null;break}if(xe!==null){xe.return=ke,Ve=xe;break}Ve=ke}}}var We=_.alternate;if(We!==null){var qe=We.child;if(qe!==null){We.child=null;do{var en=qe.sibling;qe.sibling=null,qe=en}while(qe!==null)}}Ve=_}}if((_.subtreeFlags&2064)!==0&&C!==null)C.return=_,Ve=C;else e:for(;Ve!==null;){if(_=Ve,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:da(9,_,_.return)}var Z=_.sibling;if(Z!==null){Z.return=_.return,Ve=Z;break e}Ve=_.return}}var X=i.current;for(Ve=X;Ve!==null;){C=Ve;var ne=C.child;if((C.subtreeFlags&2064)!==0&&ne!==null)ne.return=C,Ve=ne;else e:for(C=X;Ve!==null;){if(O=Ve,(O.flags&2048)!==0)try{switch(O.tag){case 0:case 11:case 15:Pl(9,O)}}catch(je){Zt(O,O.return,je)}if(O===C){Ve=null;break e}var Ee=O.sibling;if(Ee!==null){Ee.return=O.return,Ve=Ee;break e}Ve=O.return}}if(Et=g,Es(),Te&&typeof Te.onPostCommitFiberRoot=="function")try{Te.onPostCommitFiberRoot(ee,i)}catch{}f=!0}return f}finally{gt=l,ui.transition=o}}return!1}function Cg(i,o,l){o=Kr(l,o),o=Xm(i,o,1),i=bs(i,o,1),o=Dn(),i!==null&&(pt(i,1,o),Wn(i,o))}function Zt(i,o,l){if(i.tag===3)Cg(i,i,l);else for(;o!==null;){if(o.tag===3){Cg(o,i,l);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Cs===null||!Cs.has(f))){i=Kr(l,i),i=$m(o,i,1),o=bs(o,i,1),i=Dn(),o!==null&&(pt(o,1,i),Wn(o,i));break}}o=o.return}}function VS(i,o,l){var f=i.pingCache;f!==null&&f.delete(o),o=Dn(),i.pingedLanes|=i.suspendedLanes&l,fn===i&&(xn&l)===l&&(ln===4||ln===3&&(xn&130023424)===xn&&500>Kt()-Mh?ar(i,0):yh|=l),Wn(i,o)}function Ag(i,o){o===0&&((i.mode&1)===0?o=1:(o=Ke,Ke<<=1,(Ke&130023424)===0&&(Ke=4194304)));var l=Dn();i=Ki(i,o),i!==null&&(pt(i,o,l),Wn(i,l))}function HS(i){var o=i.memoizedState,l=0;o!==null&&(l=o.retryLane),Ag(i,l)}function GS(i,o){var l=0;switch(i.tag){case 13:var f=i.stateNode,g=i.memoizedState;g!==null&&(l=g.retryLane);break;case 19:f=i.stateNode;break;default:throw Error(t(314))}f!==null&&f.delete(o),Ag(i,l)}var Rg;Rg=function(i,o,l){if(i!==null)if(i.memoizedProps!==o.pendingProps||zn.current)Hn=!0;else{if((i.lanes&l)===0&&(o.flags&128)===0)return Hn=!1,PS(i,o,l);Hn=(i.flags&131072)!==0}else Hn=!1,Yt&&(o.flags&1048576)!==0&&lm(o,dl,o.index);switch(o.lanes=0,o.tag){case 2:var f=o.type;Al(i,o),i=o.pendingProps;var g=Vr(o,wn.current);qr(o,l),g=Jc(null,o,f,i,g,l);var _=eh();return o.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Vn(f)?(_=!0,cl(o)):_=!1,o.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,$c(o),g.updater=Tl,o.stateNode=g,g._reactInternals=o,oh(o,f,i,l),o=ch(null,o,f,!0,_,l)):(o.tag=0,Yt&&_&&Fc(o),Ln(null,o,g,l),o=o.child),o;case 16:f=o.elementType;
vendor: 10,862 bytes, line 41
41e:{switch(Al(i,o),i=o.pendingProps,g=f._init,f=g(f._payload),o.type=f,g=o.tag=XS(f),i=_i(f,i),g){case 0:o=uh(null,o,f,i,l);break e;case 1:o=tg(null,o,f,i,l);break e;case 11:o=jm(null,o,f,i,l);break e;case 14:o=Qm(null,o,f,_i(f.type,i),l);break e}throw Error(t(306,f,""))}return o;case 0:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:_i(f,g),uh(i,o,f,g,l);case 1:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:_i(f,g),tg(i,o,f,g,l);case 3:e:{if(ng(o),i===null)throw Error(t(387));f=o.pendingProps,_=o.memoizedState,g=_.element,vm(i,o),xl(o,f,null,l);var C=o.memoizedState;if(f=C.element,_.isDehydrated)if(_={element:f,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},o.updateQueue.baseState=_,o.memoizedState=_,o.flags&256){g=Kr(Error(t(423)),o),o=ig(i,o,f,l,g);break e}else if(f!==g){g=Kr(Error(t(424)),o),o=ig(i,o,f,l,g);break e}else for(Qn=Ss(o.stateNode.containerInfo.firstChild),jn=o,Yt=!0,vi=null,l=mm(o,null,f,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Wr(),f===g){o=Qi(i,o,l);break e}Ln(i,o,f,l)}o=o.child}return o;case 5:return Sm(o),i===null&&Bc(o),f=o.type,g=o.pendingProps,_=i!==null?i.memoizedProps:null,C=g.children,Pc(f,g)?C=null:_!==null&&Pc(f,_)&&(o.flags|=32),eg(i,o),Ln(i,o,C,l),o.child;case 6:return i===null&&Bc(o),null;case 13:return sg(i,o,l);case 4:return qc(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=Xr(o,null,f,l):Ln(i,o,f,l),o.child;case 11:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:_i(f,g),jm(i,o,f,g,l);case 7:return Ln(i,o,o.pendingProps,l),o.child;case 8:return Ln(i,o,o.pendingProps.children,l),o.child;case 12:return Ln(i,o,o.pendingProps.children,l),o.child;case 10:e:{if(f=o.type._context,g=o.pendingProps,_=o.memoizedProps,C=g.value,Vt(gl,f._currentValue),f._currentValue=C,_!==null)if(gi(_.value,C)){if(_.children===g.children&&!zn.current){o=Qi(i,o,l);break e}}else for(_=o.child,_!==null&&(_.return=o);_!==null;){var O=_.dependencies;if(O!==null){C=_.child;for(var V=O.firstContext;V!==null;){if(V.context===f){if(_.tag===1){V=ji(-1,l&-l),V.tag=2;var he=_.updateQueue;if(he!==null){he=he.shared;var Se=he.pending;Se===null?V.next=V:(V.next=Se.next,Se.next=V),he.pending=V}}_.lanes|=l,V=_.alternate,V!==null&&(V.lanes|=l),Wc(_.return,l,o),O.lanes|=l;break}V=V.next}}else if(_.tag===10)C=_.type===o.type?null:_.child;else if(_.tag===18){if(C=_.return,C===null)throw Error(t(341));C.lanes|=l,O=C.alternate,O!==null&&(O.lanes|=l),Wc(C,l,o),C=_.sibling}else C=_.child;if(C!==null)C.return=_;else for(C=_;C!==null;){if(C===o){C=null;break}if(_=C.sibling,_!==null){_.return=C.return,C=_;break}C=C.return}_=C}Ln(i,o,g.children,l),o=o.child}return o;case 9:return g=o.type,f=o.pendingProps.children,qr(o,l),g=ai(g),f=f(g),o.flags|=1,Ln(i,o,f,l),o.child;case 14:return f=o.type,g=_i(f,o.pendingProps),g=_i(f.type,g),Qm(i,o,f,g,l);case 15:return Zm(i,o,o.type,o.pendingProps,l);case 17:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:_i(f,g),Al(i,o),o.tag=1,Vn(f)?(i=!0,cl(o)):i=!1,qr(o,l),Gm(o,f,g),oh(o,f,g,l),ch(null,o,f,!0,i,l);case 19:return og(i,o,l);case 22:return Jm(i,o,l)}throw Error(t(156,o.tag))};function Pg(i,o){return js(i,o)}function WS(i,o,l,f){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(i,o,l,f){return new WS(i,o,l,f)}function Ph(i){return i=i.prototype,!(!i||!i.isReactComponent)}function XS(i){if(typeof i=="function")return Ph(i)?1:0;if(i!=null){if(i=i.$$typeof,i===G)return 11;if(i===Y)return 14}return 2}function Ns(i,o){var l=i.alternate;return l===null?(l=ci(i.tag,o,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=o,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,o=i.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function Bl(i,o,l,f,g,_){var C=2;if(f=i,typeof i=="function")Ph(i)&&(C=1);else if(typeof i=="string")C=5;else e:switch(i){case F:return ur(l.children,g,_,o);case w:C=8,g|=8;break;case L:return i=ci(12,l,o,g|2),i.elementType=L,i.lanes=_,i;case J:return i=ci(13,l,o,g),i.elementType=J,i.lanes=_,i;case oe:return i=ci(19,l,o,g),i.elementType=oe,i.lanes=_,i;case K:return zl(l,g,_,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case z:C=10;break e;case B:C=9;break e;case G:C=11;break e;case Y:C=14;break e;case ie:C=16,f=null;break e}throw Error(t(130,i==null?i:typeof i,""))}return o=ci(C,l,o,g),o.elementType=i,o.type=f,o.lanes=_,o}function ur(i,o,l,f){return i=ci(7,i,f,o),i.lanes=l,i}function zl(i,o,l,f){return i=ci(22,i,f,o),i.elementType=K,i.lanes=l,i.stateNode={isHidden:!1},i}function Nh(i,o,l){return i=ci(6,i,null,o),i.lanes=l,i}function Lh(i,o,l){return o=ci(4,i.children!==null?i.children:[],i.key,o),o.lanes=l,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function $S(i,o,l,f,g){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vn(0),this.expirationTimes=vn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vn(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Dh(i,o,l,f,g,_,C,O,V){return i=new $S(i,o,l,O,V),o===1?(o=1,_===!0&&(o|=8)):o=0,_=ci(3,null,null,o),i.current=_,_.stateNode=i,_.memoizedState={element:f,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},$c(_),i}function qS(i,o,l){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:f==null?null:""+f,children:i,containerInfo:o,implementation:l}}function Ng(i){if(!i)return Ms;i=i._reactInternals;e:{if(Nn(i)!==i||i.tag!==1)throw Error(t(170));var o=i;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Vn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(t(171))}if(i.tag===1){var l=i.type;if(Vn(l))return rm(i,l,o)}return o}function Lg(i,o,l,f,g,_,C,O,V){return i=Dh(l,f,!0,i,g,_,C,O,V),i.context=Ng(null),l=i.current,f=Dn(),g=Rs(l),_=ji(f,g),_.callback=o??null,bs(l,_,g),i.current.lanes=g,pt(i,g,f),Wn(i,f),i}function Vl(i,o,l,f){var g=o.current,_=Dn(),C=Rs(g);return l=Ng(l),o.context===null?o.context=l:o.pendingContext=l,o=ji(_,C),o.payload={element:i},f=f===void 0?null:f,f!==null&&(o.callback=f),i=bs(g,o,C),i!==null&&(yi(i,g,C,_),_l(i,g,C)),C}function Hl(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function Dg(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<o?l:o}}function Ih(i,o){Dg(i,o),(i=i.alternate)&&Dg(i,o)}function YS(){return null}var Ig=typeof reportError=="function"?reportError:function(i){console.error(i)};function Uh(i){this._internalRoot=i}Gl.prototype.render=Uh.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(t(409));Vl(i,o,null,null)},Gl.prototype.unmount=Uh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;or(function(){Vl(null,i,null,null)}),o[Xi]=null}};function Gl(i){this._internalRoot=i}Gl.prototype.unstable_scheduleHydration=function(i){if(i){var o=Dt();i={blockedOn:null,target:i,priority:o};for(var l=0;l<vs.length&&o!==0&&o<vs[l].priority;l++);vs.splice(l,0,i),l===0&&Sp(i)}};function Fh(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Wl(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Ug(){}function KS(i,o,l,f,g){if(g){if(typeof f=="function"){var _=f;f=function(){var he=Hl(C);_.call(he)}}var C=Lg(o,f,i,0,null,!1,!1,"",Ug);return i._reactRootContainer=C,i[Xi]=C.current,ea(i.nodeType===8?i.parentNode:i),or(),C}for(;g=i.lastChild;)i.removeChild(g);if(typeof f=="function"){var O=f;f=function(){var he=Hl(V);O.call(he)}}var V=Dh(i,0,!1,null,null,!1,!1,"",Ug);return i._reactRootContainer=V,i[Xi]=V.current,ea(i.nodeType===8?i.parentNode:i),or(function(){Vl(o,V,l,f)}),V}function Xl(i,o,l,f,g){var _=l._reactRootContainer;if(_){var C=_;if(typeof g=="function"){var O=g;g=function(){var V=Hl(C);O.call(V)}}Vl(o,C,i,g)}else C=KS(l,o,i,g,f);return Hl(C)}Nt=function(i){switch(i.tag){case 3:var o=i.stateNode;if(o.current.memoizedState.isDehydrated){var l=yt(o.pendingLanes);l!==0&&(Bn(o,l|1),Wn(o,Kt()),(Et&6)===0&&(Zr=Kt()+500,Es()))}break;case 13:or(function(){var f=Ki(i,1);if(f!==null){var g=Dn();yi(f,i,1,g)}}),Ih(i,1)}},Wt=function(i){if(i.tag===13){var o=Ki(i,134217728);if(o!==null){var l=Dn();yi(o,i,134217728,l)}Ih(i,134217728)}},pi=function(i){if(i.tag===13){var o=Rs(i),l=Ki(i,o);if(l!==null){var f=Dn();yi(l,i,o,f)}Ih(i,o)}},Dt=function(){return gt},mi=function(i,o){var l=gt;try{return gt=i,o()}finally{gt=l}},nt=function(i,o,l){switch(o){case"input":if(kt(i,l),o=l.name,l.type==="radio"&&o!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<l.length;o++){var f=l[o];if(f!==i&&f.form===i.form){var g=ll(f);if(!g)throw Error(t(90));Ft(f),kt(f,g)}}}break;case"textarea":gn(i,l);break;case"select":o=l.value,o!=null&&tt(i,!!l.multiple,o,!1)}},Ie=Ch,_e=or;var jS={usingClientEntryPoint:!1,Events:[ia,Br,ll,me,Pe,Ch]},va={findFiberByHostInstance:Zs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},QS={bundleType:va.bundleType,version:va.version,rendererPackageName:va.rendererPackageName,rendererConfig:va.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Ks(i),i===null?null:i.stateNode},findFiberByHostInstance:va.findFiberByHostInstance||YS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
41if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$l.isDisabled&&$l.supportsFiber)try{ee=$l.inject(QS),Te=$l}catch{}}return Xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jS,Xn.createPortal=function(i,o){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fh(o))throw Error(t(200));return qS(i,o,null,l)},Xn.createRoot=function(i,o){if(!Fh(i))throw Error(t(299));var l=!1,f="",g=Ig;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onRecoverableError!==void 0&&(g=o.onRecoverableError)),o=Dh(i,1,!1,null,null,l,!1,f,g),i[Xi]=o.current,ea(i.nodeType===8?i.parentNode:i),new Uh(o)},Xn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(t(188)):(i=Object.keys(i).join(","),Error(t(268,i)));return i=Ks(o),i=i===null?null:i.stateNode,i},Xn.flushSync=function(i){return or(i)},Xn.hydrate=function(i,o,l){if(!Wl(o))throw Error(t(200));return Xl(null,i,o,!0,l)},Xn.hydrateRoot=function(i,o,l){if(!Fh(i))throw Error(t(405));var f=l!=null&&l.hydratedSources||null,g=!1,_="",C=Ig;if(l!=null&&(l.unstable_strictMode===!0&&(g=!0),l.identifierPrefix!==void 0&&(_=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),o=Lg(o,null,i,1,l??null,g,!1,_,C),i[Xi]=o.current,ea(i),f)for(i=0;i<f.length;i++)l=f[i],g=l._getVersion,g=g(l._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[l,g]:o.mutableSourceEagerHydrationData.push(l,g);return new Gl(o)},Xn.render=function(i,o,l){if(!Wl(o))throw Error(t(200));return Xl(null,i,o,!1,l)},Xn.unmountComponentAtNode=function(i){if(!Wl(i))throw Error(t(40));return i._reactRootContainer?(or(function(){Xl(null,null,i,!1,function(){i._reactRootContainer=null,i[Xi]=null})}),!0):!1},Xn.unstable_batchedUpdates=Ch,Xn.unstable_renderSubtreeIntoContainer=function(i,o,l,f){if(!Wl(l))throw Error(t(200));if(i==null||i._reactInternals===void 0)throw Error(t(38));return Xl(i,o,l,!1,f)},Xn.version="18.3.1-next-f1338f8080-20240426",Xn}var Wg;function r_(){if(Wg)return Bh.exports;Wg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(e){console.error(e)}}return s(),Bh.exports=ay(),Bh.exports}var Xg;function ly(){if(Xg)return ql;Xg=1;var s=r_();return ql.createRoot=s.createRoot,ql.hydrateRoot=s.hydrateRoot,ql}var uy=ly();const zs="0xa4a357a4bc6a3719c8bb669ccbafbe89f7f9bcc42a2949282952e34760a74777";function cy(){return D.jsxs("header",{className:"topbar",children:[D.jsx("a",{className:"brand",href:"#top","aria-label":"GOATCOIN home",children:D.jsx("span",{className:"brand__wordmark",role:"img","aria-label":"GOATCOIN"})}),D.jsx("a",{className:"btn btn-primary btn-buy",href:`https://hyperion.xyz/swap?from=0x1::aptos_coin::AptosCoin&to=${zs}`,target:"_blank",rel:"noreferrer noopener",children:"BUY ₲OAT"})]})}const hy=[512,1024,2048],fy=[{name:"Goatcoin Wordmark",description:"Primary project wordmark.",previewClass:"brand-kit__preview-img--wide",variants:[{label:"Black",tone:"black",svg:"/brand-kit/goatcoin-black-wordmark.svg",pngStem:"goatcoin-black-wordmark"},{label:"White",tone:"white",svg:"/brand-kit/goatcoin-white-wordmark.svg",pngStem:"goatcoin-white-wordmark"}]},{name:"GOAT Wordmark",description:"Ticker wordmark.",previewClass:"brand-kit__preview-img--wordmark",variants:[{label:"Black",tone:"black",svg:"/brand-kit/goat-wordmark.svg",pngStem:"goat-wordmark-black"},{label:"White",tone:"white",svg:"/brand-kit/goat-wordmark-white.svg",pngStem:"goat-wordmark-white"}]},{name:"₲ Symbol",description:"Solid standalone Goatcoin currency mark.",previewClass:"brand-kit__preview-img--symbol",variants:[{label:"Black",tone:"black",svg:"/brand-kit/g-symbol.svg",pngStem:"g-symbol-black"},{label:"White",tone:"white",svg:"/brand-kit/g-symbol-white.svg",pngStem:"g-symbol-white"}]},{name:"₲ Symbol Outline",description:"Outlined standalone Goatcoin currency mark.",previewClass:"brand-kit__preview-img--symbol",variants:[{label:"Black",tone:"black",svg:"/brand-kit/g-symbol-outline.svg",pngStem:"g-symbol-outline-black"},{label:"White",tone:"white",svg:"/brand-kit/g-symbol-outline-white.svg",pngStem:"g-symbol-outline-white"}]}];function $g(){return D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:D.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function o_({name:s,variant:e}){return D.jsxs("div",{className:"brand-kit__downloads",children:[D.jsxs("a",{className:"brand-kit__download",href:e.svg,download:!0,"aria-label":`Download ${s}, ${e.label}, as SVG`,children:[D.jsx("span",{children:"SVG"}),D.jsx($g,{})]}),hy.map(t=>D.jsxs("a",{className:"brand-kit__download",href:`/brand-kit/${e.pngStem}-${t}.png`,download:!0,"aria-label":`Download ${s}, ${e.label}, as ${t} pixel PNG`,children:[D.jsxs("span",{children:["PNG ",t]}),D.jsx($g,{})]},t))]})}function dy({asset:s,variant:e}){return D.jsxs("section",{className:"brand-kit__variant","aria-label":`${e.label} version`,children:[D.jsx("div",{className:`brand-kit__preview brand-kit__preview--${e.tone}`,children:D.jsx("img",{className:s.previewClass,src:e.svg,alt:`${s.name}, ${e.label.toLowerCase()} version`})}),D.jsxs("div",{className:"brand-kit__variant-head",children:[D.jsx("span",{className:`brand-kit__dot brand-kit__dot--${e.tone}`}),e.label]}),D.jsx(o_,{name:s.name,variant:e})]})}function py(){const s={label:"Full colour",svg:"/brand-kit/GOAT.svg",pngStem:"GOAT"};return D.jsxs("div",{className:"brand-kit",children:[D.jsx("div",{className:"brand-kit__intro",children:D.jsx("p",{children:"Official Goatcoin artwork for press, listings, community and partner use."})}),D.jsxs("section",{className:"brand-kit__asset brand-kit__asset--token",children:[D.jsxs("div",{className:"brand-kit__asset-head",children:[D.jsxs("div",{children:[D.jsx("h3",{children:"GOAT Token Logo"}),D.jsx("p",{children:"Primary Goatcoin logo."})]}),D.jsx("span",{className:"brand-kit__asset-id",children:"01 / 05"})]}),D.jsxs("div",{className:"brand-kit__token-body",children:[D.jsx("div",{className:"brand-kit__preview brand-kit__preview--token",children:D.jsx("img",{src:"/brand-kit/GOAT-512.png",alt:"GOAT token logo"})}),D.jsxs("div",{className:"brand-kit__token-downloads",children:[D.jsx("span",{className:"brand-kit__variant-head",children:"Full colour"}),D.jsx(o_,{name:"GOAT Token Logo",variant:s})]})]})]}),D.jsx("div",{className:"brand-kit__grid",children:fy.map((e,t)=>D.jsxs("section",{className:"brand-kit__asset",children:[D.jsxs("div",{className:"brand-kit__asset-head",children:[D.jsxs("div",{children:[D.jsx("h3",{children:e.name}),D.jsx("p",{children:e.description})]}),D.jsxs("span",{className:"brand-kit__asset-id",children:[String(t+2).padStart(2,"0")," / 05"]})]}),D.jsx("div",{className:"brand-kit__variants",children:e.variants.map(n=>D.jsx(dy,{asset:e,variant:n},n.tone))})]},e.name))})]})}var my=r_();function gy(){const s={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"};return D.jsxs("svg",{viewBox:"0 0 256 256","aria-hidden":"true",focusable:"false",children:[D.jsx("rect",{width:"256",height:"256",fill:"none"}),D.jsx("line",{x1:"56",y1:"56",x2:"200",y2:"200",...s}),D.jsx("line",{x1:"200",y1:"56",x2:"56",y2:"200",...s})]})}function Gf({title:s,onClose:e,children:t,className:n=""}){const r=bt.useRef(null),a=bt.useRef(!1);bt.useEffect(()=>{var h;const c=document.activeElement;return(h=r.current)==null||h.focus(),()=>{c instanceof HTMLElement&&c.focus()}},[]),bt.useEffect(()=>{const c=d=>{d.key==="Escape"&&e()};document.addEventListener("keydown",c);const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=h}},[e]);const u=`modal-title-${s.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return my.createPortal(D.jsx("div",{className:"modal",onPointerDown:c=>{a.current=c.target===c.currentTarget},onClick:c=>{c.target===c.currentTarget&&a.current&&e()},children:D.jsxs("div",{className:`card metric modal__panel${n?` ${n}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":u,children:[D.jsxs("div",{className:"modal__head",children:[D.jsx("span",{id:u,className:"modal__title",children:s}),D.jsxs("button",{type:"button",className:"modal__close",ref:r,onClick:e,children:[D.jsx("span",{className:"sr-only",children:"Close"}),D.jsx(gy,{})]})]}),D.jsx("div",{className:"modal__body",children:t})]})}),document.body)}function vy(){const[s,e]=bt.useState(null);return D.jsxs("footer",{className:"foot",children:[D.jsx("span",{className:"foot__copy",children:"©2026 GOATCOIN"}),D.jsxs("span",{className:"foot__links",children:[D.jsx("button",{type:"button",className:"foot__link",onClick:()=>e("brand"),children:"BRAND KIT"}),D.jsx("a",{className:"foot__link",href:"/llms.txt",target:"_blank",rel:"noopener noreferrer",children:"LLMS.TXT"}),D.jsx("button",{type:"button",className:"foot__link",onClick:()=>e("disclaimer"),children:"¡DISCLAIMER!"})]}),D.jsx("span",{className:"foot__trust",children:"IN ₲OAT WE TRUST"}),s==="brand"&&D.jsx(Gf,{title:"Brand Kit",className:"modal__panel--brand-kit",onClose:()=>e(null),children:D.jsx(py,{})}),s==="disclaimer"&&D.jsx(Gf,{title:"Disclaimer",onClose:()=>e(null),children:D.jsx("p",{className:"modal__note",children:"Goatcoin (GOAT) is a memecoin / digital collectible. Market conditions can be volatile and prices may fluctuate. This website does not constitute a recommendation to buy or sell, and nothing herein should be considered financial, legal or investment advice. References to third-party companies, platforms, and services do not imply endorsement or affiliation."})})]})}function _y(){const s=bt.useRef(null);return bt.useEffect(()=>{const e=s.current;if(!e)return;const t=new IntersectionObserver(([n])=>e.classList.toggle("blueprint--revealed",n.isIntersecting),{rootMargin:"-32% 0px -32% 0px"});return t.observe(e),()=>t.disconnect()},[]),D.jsxs("div",{className:"card span-8 intro",children:[D.jsx("h2",{className:"intro-sheet",children:D.jsxs("a",{className:"blueprint",ref:s,href:"/blueprint",children:[D.jsxs("span",{className:"blueprint__frame",children:[D.jsxs("span",{className:"blueprint__text blueprint__text--rest",children:[D.jsx("span",{className:"blueprint__line blueprint__line--next",children:"NEXT-GENERATION"}),D.jsx("span",{className:"blueprint__line blueprint__line--meme",children:"MEMECOIN"})]}),D.jsxs("span",{className:"blueprint__text blueprint__text--cta","aria-hidden":"true",children:[D.jsxs("span",{className:"blueprint__line blueprint__line--read",children:["READ THE"," ",D.jsx("span",{className:"blueprint__outline",children:"₲OAT"})]}),D.jsx("span",{className:"blueprint__line blueprint__line--blueprint",children:"BLUEPRINT"})]}),D.jsxs("span",{className:"blueprint__note blueprint__note--tl","aria-hidden":"true",children:["deflationary",D.jsx("br",{}),"supply"]}),D.jsxs("span",{className:"blueprint__note blueprint__note--tr","aria-hidden":"true",children:["30ms block",D.jsx("br",{}),"times"]}),D.jsxs("span",{className:"blueprint__note blueprint__note--bl","aria-hidden":"true",children:["confidential",D.jsx("br",{}),"transactions"]}),D.jsx("span",{className:"blueprint__note blueprint__note--br","aria-hidden":"true",children:"quantum-ready"}),D.jsx("span",{className:"blueprint__note blueprint__note--click","aria-hidden":"true",children:"[CLICK TO OPEN]"})]}),D.jsx("span",{className:"sr-only",children:"Read the GOAT blueprint"})]})}),D.jsxs("div",{className:"intro-aptos",children:[D.jsxs("p",{className:"intro-aptos__text",children:[D.jsx("span",{className:"intro-aptos__line",children:"ONLY ON"}),D.jsx("span",{className:"intro-aptos__line",children:"APTOS"})]}),D.jsx("span",{className:"intro-aptos__logo","aria-hidden":"true"})]})]})}/**
42 * @license
43 * Copyright 2010-2026 Three.js Authors
44 * SPDX-License-Identifier: MIT
45 */const $d="185",xy=0,qg=1,Sy=2,bu=1,yy=2,Aa=3,Ws=0,qn=1,ss=2,cs=0,Mo=1,Yg=2,Kg=3,jg=4,My=5,vr=100,Ey=101,wy=102,by=103,Ty=104,Cy=200,Ay=201,Ry=202,Py=203,Wf=204,Xf=205,Ny=206,Ly=207,Dy=208,Iy=209,Uy=210,Fy=211,Oy=212,ky=213,By=214,$f=0,qf=1,Yf=2,Co=3,Kf=4,jf=5,Qf=6,Zf=7,a_=0,zy=1,Vy=2,Ci=0,l_=1,u_=2,c_=3,h_=4,f_=5,d_=6,p_=7,m_=300,yr=301,Ao=302,Hh=303,Gh=304,ju=306,Ia=1e3,rs=1001,Jf=1002,Mn=1003,Hy=1004,Yl=1005,mn=1006,Wh=1007,os=1008,di=1009,g_=1010,v_=1011,Ua=1012,qd=1013,Gi=1014,Bi=1015,fs=1016,Yd=1017,Kd=1018,Fa=1020,__=35902,x_=35899,S_=1021,y_=1022,Ti=1023,ds=1026,xr=1027,M_=1028,jd=1029,Mr=1030,Qd=1031,Zd=1033,Tu=33776,Cu=33777,Au=33778,Ru=33779,ed=35840,td=35841,nd=35842,id=35843,sd=36196,rd=37492,od=37496,ad=37488,ld=37489,Uu=37490,ud=37491,cd=37808,hd=37809,fd=37810,dd=37811,pd=37812,md=37813,gd=37814,vd=37815,_d=37816,xd=37817,Sd=37818,yd=37819,Md=37820,Ed=37821,wd=36492,bd=36494,Td=36495,Cd=36283,Ad=36284,Fu=36285,Rd=36286,Gy=3200,Qg=0,Wy=1,Vs="",Un="srgb",Ou="srgb-linear",ku="linear",It="srgb",eo=7680,Zg=519,Xy=512,$y=513,qy=514,Jd=515,Yy=516,Ky=517,ep=518,jy=519,Jg=35044,ev="300 es",zi=2e3,Bu=2001;function Qy(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}function Oa(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function Zy(){const s=Oa("canvas");return s.style.display="block",s}const tv={};function nv(...s){const e="THREE."+s.shift();console.log(e,...s)}function E_(s){const e=s[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=s[1];t&&t.isStackTrace?s[0]+=" "+t.getLocation():s[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return s}function at(...s){s=E_(s);const e="THREE."+s.shift();{const t=s[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...s)}}function wt(...s){s=E_(s);const e="THREE."+s.shift();{const t=s[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...s)}}function Eo(...s){const e=s.join(" ");e in tv||(tv[e]=!0,at(...s))}function Jy(s,e,t){return new Promise(function(n,r){function a(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:r();break;case s.TIMEOUT_EXPIRED:setTimeout(a,t);break;default:n()}}setTimeout(a,t)})}const eM={[$f]:qf,[Yf]:Qf,[Kf]:Zf,[Co]:jf,[qf]:$f,[Qf]:Yf,[Zf]:Kf,[jf]:Co};class Ar{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){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let a=0,u=r.length;a<u;a++)r[a].call(this,e);e.target=null}}}const An=["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
455","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"],Xh=Math.PI/180,Pd=180/Math.PI;function Ba(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(An[s&255]+An[s>>8&255]+An[s>>16&255]+An[s>>24&255]+"-"+An[e&255]+An[e>>8&255]+"-"+An[e>>16&15|64]+An[e>>24&255]+"-"+An[t&63|128]+An[t>>8&255]+"-"+An[t>>16&255]+An[t>>24&255]+An[n&255]+An[n>>8&255]+An[n>>16&255]+An[n>>24&255]).toLowerCase()}function St(s,e,t){return Math.max(e,Math.min(t,s))}function tM(s,e){return(s%e+e)%e}function $h(s,e,t){return(1-t)*s+t*e}function xa(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function $n(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const pp=class pp{constructor(e=0,t=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("THREE.Vector2: 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("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}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}
vendor: 65,771 bytes, line 45
45roundToZero(){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(St(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),r=Math.sin(t),a=this.x-e.x,u=this.y-e.y;return this.x=a*n-u*r+e.x,this.y=a*r+u*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};pp.prototype.isVector2=!0;let Tt=pp;class Do{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,a,u,c){let h=n[r+0],d=n[r+1],p=n[r+2],m=n[r+3],v=a[u+0],x=a[u+1],M=a[u+2],b=a[u+3];if(m!==b||h!==v||d!==x||p!==M){let y=h*v+d*x+p*M+m*b;y<0&&(v=-v,x=-x,M=-M,b=-b,y=-y);let S=1-c;if(y<.9995){const P=Math.acos(y),U=Math.sin(P);S=Math.sin(S*P)/U,c=Math.sin(c*P)/U,h=h*S+v*c,d=d*S+x*c,p=p*S+M*c,m=m*S+b*c}else{h=h*S+v*c,d=d*S+x*c,p=p*S+M*c,m=m*S+b*c;const P=1/Math.sqrt(h*h+d*d+p*p+m*m);h*=P,d*=P,p*=P,m*=P}}e[t]=h,e[t+1]=d,e[t+2]=p,e[t+3]=m}static multiplyQuaternionsFlat(e,t,n,r,a,u){const c=n[r],h=n[r+1],d=n[r+2],p=n[r+3],m=a[u],v=a[u+1],x=a[u+2],M=a[u+3];return e[t]=c*M+p*m+h*x-d*v,e[t+1]=h*M+p*v+d*m-c*x,e[t+2]=d*M+p*x+c*v-h*m,e[t+3]=p*M-c*m-h*v-d*x,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,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,a=e._z,u=e._order,c=Math.cos,h=Math.sin,d=c(n/2),p=c(r/2),m=c(a/2),v=h(n/2),x=h(r/2),M=h(a/2);switch(u){case"XYZ":this._x=v*p*m+d*x*M,this._y=d*x*m-v*p*M,this._z=d*p*M+v*x*m,this._w=d*p*m-v*x*M;break;case"YXZ":this._x=v*p*m+d*x*M,this._y=d*x*m-v*p*M,this._z=d*p*M-v*x*m,this._w=d*p*m+v*x*M;break;case"ZXY":this._x=v*p*m-d*x*M,this._y=d*x*m+v*p*M,this._z=d*p*M+v*x*m,this._w=d*p*m-v*x*M;break;case"ZYX":this._x=v*p*m-d*x*M,this._y=d*x*m+v*p*M,this._z=d*p*M-v*x*m,this._w=d*p*m+v*x*M;break;case"YZX":this._x=v*p*m+d*x*M,this._y=d*x*m+v*p*M,this._z=d*p*M-v*x*m,this._w=d*p*m-v*x*M;break;case"XZY":this._x=v*p*m-d*x*M,this._y=d*x*m-v*p*M,this._z=d*p*M+v*x*m,this._w=d*p*m+v*x*M;break;default:at("Quaternion: .setFromEuler() encountered an unknown order: "+u)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],a=t[8],u=t[1],c=t[5],h=t[9],d=t[2],p=t[6],m=t[10],v=n+c+m;if(v>0){const x=.5/Math.sqrt(v+1);this._w=.25/x,this._x=(p-h)*x,this._y=(a-d)*x,this._z=(u-r)*x}else if(n>c&&n>m){const x=2*Math.sqrt(1+n-c-m);this._w=(p-h)/x,this._x=.25*x,this._y=(r+u)/x,this._z=(a+d)/x}else if(c>m){const x=2*Math.sqrt(1+c-n-m);this._w=(a-d)/x,this._x=(r+u)/x,this._y=.25*x,this._z=(h+p)/x}else{const x=2*Math.sqrt(1+m-n-c);this._w=(u-r)/x,this._x=(a+d)/x,this._y=(h+p)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(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(St(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,a=e._z,u=e._w,c=t._x,h=t._y,d=t._z,p=t._w;return this._x=n*p+u*c+r*d-a*h,this._y=r*p+u*h+a*c-n*d,this._z=a*p+u*d+n*h-r*c,this._w=u*p-n*c-r*h-a*d,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,a=e._z,u=e._w,c=this.dot(e);c<0&&(n=-n,r=-r,a=-a,u=-u,c=-c);let h=1-t;if(c<.9995){const d=Math.acos(c),p=Math.sin(d);h=Math.sin(h*d)/p,t=Math.sin(t*d)/p,this._x=this._x*h+n*t,this._y=this._y*h+r*t,this._z=this._z*h+a*t,this._w=this._w*h+u*t,this._onChangeCallback()}else this._x=this._x*h+n*t,this._y=this._y*h+r*t,this._z=this._z*h+a*t,this._w=this._w*h+u*t,this.normalize();return 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(),r=Math.sqrt(1-n),a=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),a*Math.sin(t),a*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}}const mp=class mp{constructor(e=0,t=0,n=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("THREE.Vector3: 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("THREE.Vector3: 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(iv.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(iv.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[3]*n+a[6]*r,this.y=a[1]*t+a[4]*n+a[7]*r,this.z=a[2]*t+a[5]*n+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,a=e.elements,u=1/(a[3]*t+a[7]*n+a[11]*r+a[15]);return this.x=(a[0]*t+a[4]*n+a[8]*r+a[12])*u,this.y=(a[1]*t+a[5]*n+a[9]*r+a[13])*u,this.z=(a[2]*t+a[6]*n+a[10]*r+a[14])*u,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,a=e.x,u=e.y,c=e.z,h=e.w,d=2*(u*r-c*n),p=2*(c*t-a*r),m=2*(a*n-u*t);return this.x=t+h*d+u*m-c*p,this.y=n+h*p+c*d-a*m,this.z=r+h*m+a*p-u*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,r=this.z,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r,this.y=a[1]*t+a[5]*n+a[9]*r,this.z=a[2]*t+a[6]*n+a[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this.z=St(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this.z=St(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}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,r=e.y,a=e.z,u=t.x,c=t.y,h=t.z;return this.x=r*h-a*c,this.y=a*u-n*h,this.z=n*c-r*u,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 qh.copy(this).projectOnVector(e),this.sub(qh)}reflect(e){return this.sub(qh.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(St(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*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(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,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}};mp.prototype.isVector3=!0;let se=mp;const qh=new se,iv=new Do,gp=class gp{constructor(e,t,n,r,a,u,c,h,d){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,a,u,c,h,d)}set(e,t,n,r,a,u,c,h,d){const p=this.elements;return p[0]=e,p[1]=r,p[2]=c,p[3]=t,p[4]=a,p[5]=h,p[6]=n,p[7]=u,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,r=t.elements,a=this.elements,u=n[0],c=n[3],h=n[6],d=n[1],p=n[4],m=n[7],v=n[2],x=n[5],M=n[8],b=r[0],y=r[3],S=r[6],P=r[1],U=r[4],T=r[7],N=r[2],R=r[5],F=r[8];return a[0]=u*b+c*P+h*N,a[3]=u*y+c*U+h*R,a[6]=u*S+c*T+h*F,a[1]=d*b+p*P+m*N,a[4]=d*y+p*U+m*R,a[7]=d*S+p*T+m*F,a[2]=v*b+x*P+M*N,a[5]=v*y+x*U+M*R,a[8]=v*S+x*T+M*F,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],r=e[2],a=e[3],u=e[4],c=e[5],h=e[6],d=e[7],p=e[8];return t*u*p-t*c*d-n*a*p+n*c*h+r*a*d-r*u*h}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],a=e[3],u=e[4],c=e[5],h=e[6],d=e[7],p=e[8],m=p*u-c*d,v=c*h-p*a,x=d*a-u*h,M=t*m+n*v+r*x;if(M===0)return this.set(0,0,0,0,0,0,0,0,0);const b=1/M;return e[0]=m*b,e[1]=(r*d-p*n)*b,e[2]=(c*n-r*u)*b,e[3]=v*b,e[4]=(p*t-r*h)*b,e[5]=(r*a-c*t)*b,e[6]=x*b,e[7]=(n*h-d*t)*b,e[8]=(u*t-n*a)*b,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,r,a,u,c){const h=Math.cos(a),d=Math.sin(a);return this.set(n*h,n*d,-n*(h*u+d*c)+u+e,-r*d,r*h,-r*(-d*u+h*c)+c+t,0,0,1),this}scale(e,t){return Eo("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Yh.makeScale(e,t)),this}rotate(e){return Eo("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Yh.makeRotation(-e)),this}translate(e,t){return Eo("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Yh.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 r=0;r<9;r++)if(t[r]!==n[r])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)}};gp.prototype.isMatrix3=!0;let ct=gp;const Yh=new ct,sv=new ct().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),rv=new ct().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function nM(){const s={enabled:!0,workingColorSpace:Ou,spaces:{},convert:function(r,a,u){return this.enabled===!1||a===u||!a||!u||(this.spaces[a].transfer===It&&(r.r=hs(r.r),r.g=hs(r.g),r.b=hs(r.b)),this.spaces[a].primaries!==this.spaces[u].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[u].fromXYZ)),this.spaces[u].transfer===It&&(r.r=wo(r.r),r.g=wo(r.g),r.b=wo(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Vs?ku:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,u){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[u].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return Eo("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return Eo("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(r,a)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[Ou]:{primaries:e,whitePoint:n,transfer:ku,toXYZ:sv,fromXYZ:rv,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Un},outputColorSpaceConfig:{drawingBufferColorSpace:Un}},[Un]:{primaries:e,whitePoint:n,transfer:It,toXYZ:sv,fromXYZ:rv,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Un}}}),s}const xt=nM();function hs(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function wo(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let to;class iM{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{to===void 0&&(to=Oa("canvas")),to.width=e.width,to.height=e.height;const r=to.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=to}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Oa("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),a=r.data;for(let u=0;u<a.length;u++)a[u]=hs(a[u]/255)*255;return n.putImageData(r,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(hs(t[n]/255)*255):t[n]=hs(t[n]);return{data:t,width:e.width,height:e.height}}else return at("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let sM=0;class tp{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:sM++}),this.uuid=Ba(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}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:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let u=0,c=r.length;u<c;u++)r[u].isDataTexture?a.push(Kh(r[u].image)):a.push(Kh(r[u]))}else a=Kh(r);n.url=a}return t||(e.images[this.uuid]=n),n}}function Kh(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?iM.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(at("Texture: Unable to serialize Texture."),{})}let rM=0;const jh=new se;class Pn extends Ar{constructor(e=Pn.DEFAULT_IMAGE,t=Pn.DEFAULT_MAPPING,n=rs,r=rs,a=mn,u=os,c=Ti,h=di,d=Pn.DEFAULT_ANISOTROPY,p=Vs){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:rM++}),this.uuid=Ba(),this.name="",this.source=new tp(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=a,this.minFilter=u,this.anisotropy=d,this.format=c,this.internalFormat=null,this.type=h,this.offset=new Tt(0,0),this.repeat=new Tt(1,1),this.center=new Tt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ct,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(jh).x}get height(){return this.source.getSize(jh).y}get depth(){return this.source.getSize(jh).z}get image(){return this.source.data}set image(e){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)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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.normalized=e.normalized,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.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){at(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){at(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}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.7,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,normalized:this.normalized,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!==m_)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ia:e.x=e.x-Math.floor(e.x);break;case rs:e.x=e.x<0?0:1;break;case Jf: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 Ia:e.y=e.y-Math.floor(e.y);break;case rs:e.y=e.y<0?0:1;break;case Jf: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++}}Pn.DEFAULT_IMAGE=null;Pn.DEFAULT_MAPPING=m_;Pn.DEFAULT_ANISOTROPY=1;const vp=class vp{constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("THREE.Vector4: 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("THREE.Vector4: 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,r=this.z,a=this.w,u=e.elements;return this.x=u[0]*t+u[4]*n+u[8]*r+u[12]*a,this.y=u[1]*t+u[5]*n+u[9]*r+u[13]*a,this.z=u[2]*t+u[6]*n+u[10]*r+u[14]*a,this.w=u[3]*t+u[7]*n+u[11]*r+u[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,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,r,a;const h=e.elements,d=h[0],p=h[4],m=h[8],v=h[1],x=h[5],M=h[9],b=h[2],y=h[6],S=h[10];if(Math.abs(p-v)<.01&&Math.abs(m-b)<.01&&Math.abs(M-y)<.01){if(Math.abs(p+v)<.1&&Math.abs(m+b)<.1&&Math.abs(M+y)<.1&&Math.abs(d+x+S-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const U=(d+1)/2,T=(x+1)/2,N=(S+1)/2,R=(p+v)/4,F=(m+b)/4,w=(M+y)/4;return U>T&&U>N?U<.01?(n=0,r=.707106781,a=.707106781):(n=Math.sqrt(U),r=R/n,a=F/n):T>N?T<.01?(n=.707106781,r=0,a=.707106781):(r=Math.sqrt(T),n=R/r,a=w/r):N<.01?(n=.707106781,r=.707106781,a=0):(a=Math.sqrt(N),n=F/a,r=w/a),this.set(n,r,a,t),this}let P=Math.sqrt((y-M)*(y-M)+(m-b)*(m-b)+(v-p)*(v-p));return Math.abs(P)<.001&&(P=1),this.x=(y-M)/P,this.y=(m-b)/P,this.z=(v-p)/P,this.w=Math.acos((d+x+S-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=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this.z=St(this.z,e.z,t.z),this.w=St(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this.z=St(this.z,e,t),this.w=St(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}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}};vp.prototype.isVector4=!0;let Jt=vp;class oM extends Ar{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:mn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Jt(0,0,e,t),this.scissorTest=!1,this.viewport=new Jt(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:n.depth},a=new Pn(r),u=n.count;for(let c=0;c<u;c++)this.textures[c]=a.clone(),this.textures[c].isRenderTargetTexture=!0,this.textures[c].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){const t={minFilter:mn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}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 r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);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 t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new tp(r)}return 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.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Vi extends oM{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class w_ extends Pn{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Mn,this.minFilter=Mn,this.wrapR=rs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class aM extends Pn{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Mn,this.minFilter=Mn,this.wrapR=rs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ku=class Ku{constructor(e,t,n,r,a,u,c,h,d,p,m,v,x,M,b,y){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,r,a,u,c,h,d,p,m,v,x,M,b,y)}set(e,t,n,r,a,u,c,h,d,p,m,v,x,M,b,y){const S=this.elements;return S[0]=e,S[4]=t,S[8]=n,S[12]=r,S[1]=a,S[5]=u,S[9]=c,S[13]=h,S[2]=d,S[6]=p,S[10]=m,S[14]=v,S[3]=x,S[7]=M,S[11]=b,S[15]=y,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 Ku().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 this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(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){if(e.determinantAffine()===0)return this.identity();const t=this.elements,n=e.elements,r=1/no.setFromMatrixColumn(e,0).length(),a=1/no.setFromMatrixColumn(e,1).length(),u=1/no.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=0,t[8]=n[8]*u,t[9]=n[9]*u,t[10]=n[10]*u,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,r=e.y,a=e.z,u=Math.cos(n),c=Math.sin(n),h=Math.cos(r),d=Math.sin(r),p=Math.cos(a),m=Math.sin(a);if(e.order==="XYZ"){const v=u*p,x=u*m,M=c*p,b=c*m;t[0]=h*p,t[4]=-h*m,t[8]=d,t[1]=x+M*d,t[5]=v-b*d,t[9]=-c*h,t[2]=b-v*d,t[6]=M+x*d,t[10]=u*h}else if(e.order==="YXZ"){const v=h*p,x=h*m,M=d*p,b=d*m;t[0]=v+b*c,t[4]=M*c-x,t[8]=u*d,t[1]=u*m,t[5]=u*p,t[9]=-c,t[2]=x*c-M,t[6]=b+v*c,t[10]=u*h}else if(e.order==="ZXY"){const v=h*p,x=h*m,M=d*p,b=d*m;t[0]=v-b*c,t[4]=-u*m,t[8]=M+x*c,t[1]=x+M*c,t[5]=u*p,t[9]=b-v*c,t[2]=-u*d,t[6]=c,t[10]=u*h}else if(e.order==="ZYX"){const v=u*p,x=u*m,M=c*p,b=c*m;t[0]=h*p,t[4]=M*d-x,t[8]=v*d+b,t[1]=h*m,t[5]=b*d+v,t[9]=x*d-M,t[2]=-d,t[6]=c*h,t[10]=u*h}else if(e.order==="YZX"){const v=u*h,x=u*d,M=c*h,b=c*d;t[0]=h*p,t[4]=b-v*m,t[8]=M*m+x,t[1]=m,t[5]=u*p,t[9]=-c*p,t[2]=-d*p,t[6]=x*m+M,t[10]=v-b*m}else if(e.order==="XZY"){const v=u*h,x=u*d,M=c*h,b=c*d;t[0]=h*p,t[4]=-m,t[8]=d*p,t[1]=v*m+b,t[5]=u*p,t[9]=x*m-M,t[2]=M*m-x,t[6]=c*p,t[10]=b*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(lM,e,uM)}lookAt(e,t,n){const r=this.elements;return Jn.subVectors(e,t),Jn.lengthSq()===0&&(Jn.z=1),Jn.normalize(),Ds.crossVectors(n,Jn),Ds.lengthSq()===0&&(Math.abs(n.z)===1?Jn.x+=1e-4:Jn.z+=1e-4,Jn.normalize(),Ds.crossVectors(n,Jn)),Ds.normalize(),Kl.crossVectors(Jn,Ds),r[0]=Ds.x,r[4]=Kl.x,r[8]=Jn.x,r[1]=Ds.y,r[5]=Kl.y,r[9]=Jn.y,r[2]=Ds.z,r[6]=Kl.z,r[10]=Jn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,a=this.elements,u=n[0],c=n[4],h=n[8],d=n[12],p=n[1],m=n[5],v=n[9],x=n[13],M=n[2],b=n[6],y=n[10],S=n[14],P=n[3],U=n[7],T=n[11],N=n[15],R=r[0],F=r[4],w=r[8],L=r[12],z=r[1],B=r[5],G=r[9],J=r[13],oe=r[2],Y=r[6],ie=r[10],K=r[14],$=r[3],le=r[7],ue=r[11],k=r[15];return a[0]=u*R+c*z+h*oe+d*$,a[4]=u*F+c*B+h*Y+d*le,a[8]=u*w+c*G+h*ie+d*ue,a[12]=u*L+c*J+h*K+d*k,a[1]=p*R+m*z+v*oe+x*$,a[5]=p*F+m*B+v*Y+x*le,a[9]=p*w+m*G+v*ie+x*ue,a[13]=p*L+m*J+v*K+x*k,a[2]=M*R+b*z+y*oe+S*$,a[6]=M*F+b*B+y*Y+S*le,a[10]=M*w+b*G+y*ie+S*ue,a[14]=M*L+b*J+y*K+S*k,a[3]=P*R+U*z+T*oe+N*$,a[7]=P*F+U*B+T*Y+N*le,a[11]=P*w+U*G+T*ie+N*ue,a[15]=P*L+U*J+T*K+N*k,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],r=e[8],a=e[12],u=e[1],c=e[5],h=e[9],d=e[13],p=e[2],m=e[6],v=e[10],x=e[14],M=e[3],b=e[7],y=e[11],S=e[15],P=h*x-d*v,U=c*x-d*m,T=c*v-h*m,N=u*x-d*p,R=u*v-h*p,F=u*m-c*p;return t*(b*P-y*U+S*T)-n*(M*P-y*N+S*R)+r*(M*U-b*N+S*F)-a*(M*T-b*R+y*F)}determinantAffine(){const e=this.elements,t=e[0],n=e[4],r=e[8],a=e[1],u=e[5],c=e[9],h=e[2],d=e[6],p=e[10];return t*(u*p-c*d)-n*(a*p-c*h)+r*(a*d-u*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],a=e[3],u=e[4],c=e[5],h=e[6],d=e[7],p=e[8],m=e[9],v=e[10],x=e[11],M=e[12],b=e[13],y=e[14],S=e[15],P=t*c-n*u,U=t*h-r*u,T=t*d-a*u,N=n*h-r*c,R=n*d-a*c,F=r*d-a*h,w=p*b-m*M,L=p*y-v*M,z=p*S-x*M,B=m*y-v*b,G=m*S-x*b,J=v*S-x*y,oe=P*J-U*G+T*B+N*z-R*L+F*w;if(oe===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const Y=1/oe;return e[0]=(c*J-h*G+d*B)*Y,e[1]=(r*G-n*J-a*B)*Y,e[2]=(b*F-y*R+S*N)*Y,e[3]=(v*R-m*F-x*N)*Y,e[4]=(h*z-u*J-d*L)*Y,e[5]=(t*J-r*z+a*L)*Y,e[6]=(y*T-M*F-S*U)*Y,e[7]=(p*F-v*T+x*U)*Y,e[8]=(u*G-c*z+d*w)*Y,e[9]=(n*z-t*G-a*w)*Y,e[10]=(M*R-b*T+S*P)*Y,e[11]=(m*T-p*R-x*P)*Y,e[12]=(c*L-u*B-h*w)*Y,e[13]=(t*B-n*L+r*w)*Y,e[14]=(b*U-M*N-y*P)*Y,e[15]=(p*N-m*U+v*P)*Y,this}scale(e){const t=this.elements,n=e.x,r=e.y,a=e.z;return t[0]*=n,t[4]*=r,t[8]*=a,t[1]*=n,t[5]*=r,t[9]*=a,t[2]*=n,t[6]*=r,t[10]*=a,t[3]*=n,t[7]*=r,t[11]*=a,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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}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),r=Math.sin(t),a=1-n,u=e.x,c=e.y,h=e.z,d=a*u,p=a*c;return this.set(d*u+n,d*c-r*h,d*h+r*c,0,d*c+r*h,p*c+n,p*h-r*u,0,d*h-r*c,p*h+r*u,a*h*h+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,r,a,u){return this.set(1,n,a,0,e,1,u,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,a=t._x,u=t._y,c=t._z,h=t._w,d=a+a,p=u+u,m=c+c,v=a*d,x=a*p,M=a*m,b=u*p,y=u*m,S=c*m,P=h*d,U=h*p,T=h*m,N=n.x,R=n.y,F=n.z;return r[0]=(1-(b+S))*N,r[1]=(x+T)*N,r[2]=(M-U)*N,r[3]=0,r[4]=(x-T)*R,r[5]=(1-(v+S))*R,r[6]=(y+P)*R,r[7]=0,r[8]=(M+U)*F,r[9]=(y-P)*F,r[10]=(1-(v+b))*F,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const a=this.determinantAffine();if(a===0)return n.set(1,1,1),t.identity(),this;let u=no.set(r[0],r[1],r[2]).length();const c=no.set(r[4],r[5],r[6]).length(),h=no.set(r[8],r[9],r[10]).length();a<0&&(u=-u),Mi.copy(this);const d=1/u,p=1/c,m=1/h;return Mi.elements[0]*=d,Mi.elements[1]*=d,Mi.elements[2]*=d,Mi.elements[4]*=p,Mi.elements[5]*=p,Mi.elements[6]*=p,Mi.elements[8]*=m,Mi.elements[9]*=m,Mi.elements[10]*=m,t.setFromRotationMatrix(Mi),n.x=u,n.y=c,n.z=h,this}makePerspective(e,t,n,r,a,u,c=zi,h=!1){const d=this.elements,p=2*a/(t-e),m=2*a/(n-r),v=(t+e)/(t-e),x=(n+r)/(n-r);let M,b;if(h)M=a/(u-a),b=u*a/(u-a);else if(c===zi)M=-(u+a)/(u-a),b=-2*u*a/(u-a);else if(c===Bu)M=-u/(u-a),b=-u*a/(u-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return d[0]=p,d[4]=0,d[8]=v,d[12]=0,d[1]=0,d[5]=m,d[9]=x,d[13]=0,d[2]=0,d[6]=0,d[10]=M,d[14]=b,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(e,t,n,r,a,u,c=zi,h=!1){const d=this.elements,p=2/(t-e),m=2/(n-r),v=-(t+e)/(t-e),x=-(n+r)/(n-r);let M,b;if(h)M=1/(u-a),b=u/(u-a);else if(c===zi)M=-2/(u-a),b=-(u+a)/(u-a);else if(c===Bu)M=-1/(u-a),b=-a/(u-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return d[0]=p,d[4]=0,d[8]=0,d[12]=v,d[1]=0,d[5]=m,d[9]=0,d[13]=x,d[2]=0,d[6]=0,d[10]=M,d[14]=b,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])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}};Ku.prototype.isMatrix4=!0;let on=Ku;const no=new se,Mi=new on,lM=new se(0,0,0),uM=new se(1,1,1),Ds=new se,Kl=new se,Jn=new se,ov=new on,av=new Do;class Er{constructor(e=0,t=0,n=0,r=Er.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,a=r[0],u=r[4],c=r[8],h=r[1],d=r[5],p=r[9],m=r[2],v=r[6],x=r[10];switch(t){case"XYZ":this._y=Math.asin(St(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-p,x),this._z=Math.atan2(-u,a)):(this._x=Math.atan2(v,d),this._z=0);break;case"YXZ":this._x=Math.asin(-St(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(c,x),this._z=Math.atan2(h,d)):(this._y=Math.atan2(-m,a),this._z=0);break;case"ZXY":this._x=Math.asin(St(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(-m,x),this._z=Math.atan2(-u,d)):(this._y=0,this._z=Math.atan2(h,a));break;case"ZYX":this._y=Math.asin(-St(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(v,x),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-u,d));break;case"YZX":this._z=Math.asin(St(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-p,d),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(c,x));break;case"XZY":this._z=Math.asin(-St(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(v,d),this._y=Math.atan2(c,a)):(this._x=Math.atan2(-p,x),this._y=0);break;default:at("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ov.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ov,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return av.setFromEuler(this),this.setFromQuaternion(av,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}}Er.DEFAULT_ORDER="XYZ";class b_{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 cM=0;const lv=new se,io=new Do,Ji=new on,jl=new se,Sa=new se,hM=new se,fM=new Do,uv=new se(1,0,0),cv=new se(0,1,0),hv=new se(0,0,1),fv={type:"added"},dM={type:"removed"},so={type:"childadded",child:null},Qh={type:"childremoved",child:null};class ni extends Ar{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:cM++}),this.uuid=Ba(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ni.DEFAULT_UP.clone();const e=new se,t=new Er,n=new Do,r=new se(1,1,1);function a(){n.setFromEuler(t,!1)}function u(){t.setFromQuaternion(n,void 0,!1)}t._onChange(a),n._onChange(u),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:r},modelViewMatrix:{value:new on},normalMatrix:{value:new ct}}),this.matrix=new on,this.matrixWorld=new on,this.matrixAutoUpdate=ni.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=ni.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new b_,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return io.setFromAxisAngle(e,t),this.quaternion.multiply(io),this}rotateOnWorldAxis(e,t){return io.setFromAxisAngle(e,t),this.quaternion.premultiply(io),this}rotateX(e){return this.rotateOnAxis(uv,e)}rotateY(e){return this.rotateOnAxis(cv,e)}rotateZ(e){return this.rotateOnAxis(hv,e)}translateOnAxis(e,t){return lv.copy(e).applyQuaternion(this.quaternion),this.position.add(lv.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(uv,e)}translateY(e){return this.translateOnAxis(cv,e)}translateZ(e){return this.translateOnAxis(hv,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ji.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?jl.copy(e):jl.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Sa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ji.lookAt(Sa,jl,this.up):Ji.lookAt(jl,Sa,this.up),this.quaternion.setFromRotationMatrix(Ji),r&&(Ji.extractRotation(r.matrixWorld),io.setFromRotationMatrix(Ji),this.quaternion.premultiply(io.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(wt("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(fv),so.child=e,this.dispatchEvent(so),so.child=null):wt("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(dM),Qh.child=e,this.dispatchEvent(Qh),Qh.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),Ji.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ji.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ji),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(fv),so.child=e,this.dispatchEvent(so),so.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,r=this.children.length;n<r;n++){const u=this.children[n].getObjectByProperty(e,t);if(u!==void 0)return u}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let a=0,u=r.length;a<u;a++)r[a].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(Sa,e,hM),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Sa,fM,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,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;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);const e=this.pivot;if(e!==null){const t=e.x,n=e.y,r=e.z,a=this.matrix.elements;a[12]+=t-a[0]*t-a[4]*n-a[8]*r,a[13]+=n-a[1]*t-a[5]*n-a[9]*r,a[14]+=r-a[2]*t-a[6]*n-a[10]*r}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,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){const r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){const a=this.children;for(let u=0,c=a.length;u<c;u++)a[u].updateWorldMatrix(!1,!0,n)}}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.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(c=>({...c})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(c,h){return c[h.uuid]===void 0&&(c[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const h=c.shapes;if(Array.isArray(h))for(let d=0,p=h.length;d<p;d++){const m=h[d];a(e.shapes,m)}else a(e.shapes,h)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let h=0,d=this.material.length;h<d;h++)c.push(a(e.materials,this.material[h]));r.material=c}else r.material=a(e.materials,this.material);if(this.children.length>0){r.children=[];for(let c=0;c<this.children.length;c++)r.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let c=0;c<this.animations.length;c++){const h=this.animations[c];r.animations.push(a(e.animations,h))}}if(t){const c=u(e.geometries),h=u(e.materials),d=u(e.textures),p=u(e.images),m=u(e.shapes),v=u(e.skeletons),x=u(e.animations),M=u(e.nodes);c.length>0&&(n.geometries=c),h.length>0&&(n.materials=h),d.length>0&&(n.textures=d),p.length>0&&(n.images=p),m.length>0&&(n.shapes=m),v.length>0&&(n.skeletons=v),x.length>0&&(n.animations=x),M.length>0&&(n.nodes=M)}return n.object=r,n;function u(c){const h=[];for(const d in c){const p=c[d];delete p.metadata,h.push(p)}return h}}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.pivot=e.pivot!==null?e.pivot.clone():null,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.static=e.static,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 r=e.children[n];this.add(r.clone())}return this}}ni.DEFAULT_UP=new se(0,1,0);ni.DEFAULT_MATRIX_AUTO_UPDATE=!0;ni.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class _o extends ni{constructor(){super(),this.isGroup=!0,this.type="Group"}}const pM={type:"move"};class Zh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new _o,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 _o,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new _o,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new se,this._grip.eventsEnabled=!1),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 r=null,a=null,u=null;const c=this._targetRay,h=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){u=!0;for(const b of e.hand.values()){const y=t.getJointPose(b,n),S=this._getHandJoint(d,b);y!==null&&(S.matrix.fromArray(y.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.matrixWorldNeedsUpdate=!0,S.jointRadius=y.radius),S.visible=y!==null}const p=d.joints["index-finger-tip"],m=d.joints["thumb-tip"],v=p.position.distanceTo(m.position),x=.02,M=.005;d.inputState.pinching&&v>x+M?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&v<=x-M&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,n),a!==null&&(h.matrix.fromArray(a.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,a.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(a.linearVelocity)):h.hasLinearVelocity=!1,a.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(a.angularVelocity)):h.hasAngularVelocity=!1,h.eventsEnabled&&h.dispatchEvent({type:"gripUpdated",data:e,target:this})));c!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&a!==null&&(r=a),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(pM)))}return c!==null&&(c.visible=r!==null),h!==null&&(h.visible=a!==null),d!==null&&(d.visible=u!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new _o;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const T_={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},Is={h:0,s:0,l:0},Ql={h:0,s:0,l:0};function Jh(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class Rt{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 r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Un){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,xt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=xt.workingColorSpace){return this.r=e,this.g=t,this.b=n,xt.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=xt.workingColorSpace){if(e=tM(e,1),t=St(t,0,1),n=St(n,0,1),t===0)this.r=this.g=this.b=n;else{const a=n<=.5?n*(1+t):n+t-n*t,u=2*n-a;this.r=Jh(u,a,e+1/3),this.g=Jh(u,a,e),this.b=Jh(u,a,e-1/3)}return xt.colorSpaceToWorking(this,r),this}setStyle(e,t=Un){function n(a){a!==void 0&&parseFloat(a)<1&&at("C
45olor: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const u=r[1],c=r[2];switch(u){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:at("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=r[1],u=a.length;if(u===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(u===6)return this.setHex(parseInt(a,16),t);at("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Un){const n=T_[e.toLowerCase()];return n!==void 0?this.setHex(n,t):at("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=hs(e.r),this.g=hs(e.g),this.b=hs(e.b),this}copyLinearToSRGB(e){return this.r=wo(e.r),this.g=wo(e.g),this.b=wo(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Un){return xt.workingToColorSpace(Rn.copy(this),e),Math.round(St(Rn.r*255,0,255))*65536+Math.round(St(Rn.g*255,0,255))*256+Math.round(St(Rn.b*255,0,255))}getHexString(e=Un){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xt.workingColorSpace){xt.workingToColorSpace(Rn.copy(this),t);const n=Rn.r,r=Rn.g,a=Rn.b,u=Math.max(n,r,a),c=Math.min(n,r,a);let h,d;const p=(c+u)/2;if(c===u)h=0,d=0;else{const m=u-c;switch(d=p<=.5?m/(u+c):m/(2-u-c),u){case n:h=(r-a)/m+(r<a?6:0);break;case r:h=(a-n)/m+2;break;case a:h=(n-r)/m+4;break}h/=6}return e.h=h,e.s=d,e.l=p,e}getRGB(e,t=xt.workingColorSpace){return xt.workingToColorSpace(Rn.copy(this),t),e.r=Rn.r,e.g=Rn.g,e.b=Rn.b,e}getStyle(e=Un){xt.workingToColorSpace(Rn.copy(this),e);const t=Rn.r,n=Rn.g,r=Rn.b;return e!==Un?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(Is),this.setHSL(Is.h+e,Is.s+t,Is.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(Is),e.getHSL(Ql);const n=$h(Is.h,Ql.h,t),r=$h(Is.s,Ql.s,t),a=$h(Is.l,Ql.l,t);return this.setHSL(n,r,a),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,r=this.b,a=e.elements;return this.r=a[0]*t+a[3]*n+a[6]*r,this.g=a[1]*t+a[4]*n+a[7]*r,this.b=a[2]*t+a[5]*n+a[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Rn=new Rt;Rt.NAMES=T_;class mM extends ni{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 Er,this.environmentIntensity=1,this.environmentRotation=new Er,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}}const Ei=new se,es=new se,ef=new se,ts=new se,ro=new se,oo=new se,dv=new se,tf=new se,nf=new se,sf=new se,rf=new Jt,of=new Jt,af=new Jt;class bi{constructor(e=new se,t=new se,n=new se){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Ei.subVectors(e,t),r.cross(Ei);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,t,n,r,a){Ei.subVectors(r,t),es.subVectors(n,t),ef.subVectors(e,t);const u=Ei.dot(Ei),c=Ei.dot(es),h=Ei.dot(ef),d=es.dot(es),p=es.dot(ef),m=u*d-c*c;if(m===0)return a.set(0,0,0),null;const v=1/m,x=(d*h-c*p)*v,M=(u*p-c*h)*v;return a.set(1-x-M,M,x)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,ts)===null?!1:ts.x>=0&&ts.y>=0&&ts.x+ts.y<=1}static getInterpolation(e,t,n,r,a,u,c,h){return this.getBarycoord(e,t,n,r,ts)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(a,ts.x),h.addScaledVector(u,ts.y),h.addScaledVector(c,ts.z),h)}static getInterpolatedAttribute(e,t,n,r,a,u){return rf.setScalar(0),of.setScalar(0),af.setScalar(0),rf.fromBufferAttribute(e,t),of.fromBufferAttribute(e,n),af.fromBufferAttribute(e,r),u.setScalar(0),u.addScaledVector(rf,a.x),u.addScaledVector(of,a.y),u.addScaledVector(af,a.z),u}static isFrontFacing(e,t,n,r){return Ei.subVectors(n,t),es.subVectors(e,t),Ei.cross(es).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ei.subVectors(this.c,this.b),es.subVectors(this.a,this.b),Ei.cross(es).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return bi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return bi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,a){return bi.getInterpolation(e,this.a,this.b,this.c,t,n,r,a)}containsPoint(e){return bi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return bi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,a=this.c;let u,c;ro.subVectors(r,n),oo.subVectors(a,n),tf.subVectors(e,n);const h=ro.dot(tf),d=oo.dot(tf);if(h<=0&&d<=0)return t.copy(n);nf.subVectors(e,r);const p=ro.dot(nf),m=oo.dot(nf);if(p>=0&&m<=p)return t.copy(r);const v=h*m-p*d;if(v<=0&&h>=0&&p<=0)return u=h/(h-p),t.copy(n).addScaledVector(ro,u);sf.subVectors(e,a);const x=ro.dot(sf),M=oo.dot(sf);if(M>=0&&x<=M)return t.copy(a);const b=x*d-h*M;if(b<=0&&d>=0&&M<=0)return c=d/(d-M),t.copy(n).addScaledVector(oo,c);const y=p*M-x*m;if(y<=0&&m-p>=0&&x-M>=0)return dv.subVectors(a,r),c=(m-p)/(m-p+(x-M)),t.copy(r).addScaledVector(dv,c);const S=1/(y+b+v);return u=b*S,c=v*S,t.copy(n).addScaledVector(ro,u).addScaledVector(oo,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class za{constructor(e=new se(1/0,1/0,1/0),t=new se(-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(wi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(wi.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=wi.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 a=n.getAttribute("position");if(t===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let u=0,c=a.count;u<c;u++)e.isMesh===!0?e.getVertexPosition(u,wi):wi.fromBufferAttribute(a,u),wi.applyMatrix4(e.matrixWorld),this.expandByPoint(wi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Zl.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Zl.copy(n.boundingBox)),Zl.applyM
vendor: 4,216 bytes, line 45
45atrix4(e.matrixWorld),this.union(Zl)}const r=e.children;for(let a=0,u=r.length;a<u;a++)this.expandByObject(r[a],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,wi),wi.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(ya),Jl.subVectors(this.max,ya),ao.subVectors(e.a,ya),lo.subVectors(e.b,ya),uo.subVectors(e.c,ya),Us.subVectors(lo,ao),Fs.subVectors(uo,lo),cr.subVectors(ao,uo);let t=[0,-Us.z,Us.y,0,-Fs.z,Fs.y,0,-cr.z,cr.y,Us.z,0,-Us.x,Fs.z,0,-Fs.x,cr.z,0,-cr.x,-Us.y,Us.x,0,-Fs.y,Fs.x,0,-cr.y,cr.x,0];return!lf(t,ao,lo,uo,Jl)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,ao,lo,uo,Jl))?!1:(eu.crossVectors(Us,Fs),t=[eu.x,eu.y,eu.z],lf(t,ao,lo,uo,Jl))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,wi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(wi).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:(ns[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ns[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ns[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ns[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ns[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ns[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ns[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ns[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ns),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ns=[new se,new se,new se,new se,new se,new se,new se,new se],wi=new se,Zl=new za,ao=new se,lo=new se,uo=new se,Us=new se,Fs=new se,cr=new se,ya=new se,Jl=new se,eu=new se,hr=new se;function lf(s,e,t,n,r){for(let a=0,u=s.length-3;a<=u;a+=3){hr.fromArray(s,a);const c=r.x*Math.abs(hr.x)+r.y*Math.abs(hr.y)+r.z*Math.abs(hr.z),h=e.dot(hr),d=t.dot(hr),p=n.dot(hr);if(Math.max(-Math.max(h,d,p),Math.min(h,d,p))>c)return!1}return!0}const rn=new se,tu=new Tt;let gM=0;class Hi extends Ar{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:gM++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Jg,this.updateRanges=[],this.gpuType=Bi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;
vendor: 4,176 bytes, line 45
45for(let r=0,a=this.itemSize;r<a;r++)this.array[e+r]=t.array[n+r];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++)tu.fromBufferAttribute(this,t),tu.applyMatrix3(e),this.setXY(t,tu.x,tu.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)rn.fromBufferAttribute(this,t),rn.applyMatrix3(e),this.setXYZ(t,rn.x,rn.y,rn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)rn.fromBufferAttribute(this,t),rn.applyMatrix4(e),this.setXYZ(t,rn.x,rn.y,rn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)rn.fromBufferAttribute(this,t),rn.applyNormalMatrix(e),this.setXYZ(t,rn.x,rn.y,rn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)rn.fromBufferAttribute(this,t),rn.transformDirection(e),this.setXYZ(t,rn.x,rn.y,rn.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=xa(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=$n(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=xa(t,this.array)),t}setX(e,t){return this.normalized&&(t=$n(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=xa(t,this.array)),t}setY(e,t){return this.normalized&&(t=$n(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=xa(t,this.array)),t}setZ(e,t){return this.normalized&&(t=$n(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=xa(t,this.array)),t}setW(e,t){return this.normalized&&(t=$n(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=$n(t,this.array),n=$n(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=$n(t,this.array),n=$n(n,this.array),r=$n(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,a){return e*=this.itemSize,this.normalized&&(t=$n(t,this.array),n=$n(n,this.array),r=$n(r,this.array),a=$n(a,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=a,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!==Jg&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class C_ extends Hi{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class A_ extends Hi{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Fn extends Hi{constructor(e,t,n){super(new Float32Array(e),t,n)}}const vM=new za,Ma=new se,uf=new se;class np{constructor(e=new se,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):vM.setFromPoints(e).getCenter(n);let r=0;for(let a=0,u=e.length;a<u;a++)r=Math.max(r,n.distanceToSquared(e[a]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const 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: 13,303 bytes, line 45
45applyMatrix4(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;Ma.subVectors(e,this.center);const t=Ma.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(Ma,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(uf.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ma.copy(e.center).add(uf)),this.expandByPoint(Ma.copy(e.center).sub(uf))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let _M=0;const hi=new on,cf=new ni,co=new se,ei=new za,Ea=new za,pn=new se;class Ri extends Ar{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:_M++}),this.uuid=Ba(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Qy(e)?A_:C_)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}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 a=new ct().getNormalMatrix(e);n.applyNormalMatrix(a),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return hi.makeRotationFromQuaternion(e),this.applyMatrix4(hi),this}rotateX(e){return hi.makeRotationX(e),this.applyMatrix4(hi),this}rotateY(e){return hi.makeRotationY(e),this.applyMatrix4(hi),this}rotateZ(e){return hi.makeRotationZ(e),this.applyMatrix4(hi),this}translate(e,t,n){return hi.makeTranslation(e,t,n),this.applyMatrix4(hi),this}scale(e,t,n){return hi.makeScale(e,t,n),this.applyMatrix4(hi),this}lookAt(e){return cf.lookAt(e),cf.updateMatrix(),this.applyMatrix4(cf.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(co).negate(),this.translate(co.x,co.y,co.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,a=e.length;r<a;r++){const u=e[r];n.push(u.x,u.y,u.z||0)}this.setAttribute("position",new Fn(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const a=e[r];t.setXYZ(r,a.x,a.y,a.z||0)}e.length>t.count&&at("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new za);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){wt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new se(-1/0,-1/0,-1/0),new se(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const a=t[n];ei.setFromBufferAttribute(a),this.morphTargetsRelative?(pn.addVectors(this.boundingBox.min,ei.min),this.boundingBox.expandByPoint(pn),pn.addVectors(this.boundingBox.max,ei.max),this.boundingBox.expandByPoint(pn)):(this.boundingBox.expandByPoint(ei.min),this.boundingBox.expandByPoint(ei.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&wt('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 np);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){wt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new se,1/0);return}if(e){const n=this.boundingSphere.center;if(ei.setFromBufferAttribute(e),t)for(let a=0,u=t.length;a<u;a++){const c=t[a];Ea.setFromBufferAttribute(c),this.morphTargetsRelative?(pn.addVectors(ei.min,Ea.min),ei.expandByPoint(pn),pn.addVectors(ei.max,Ea.max),ei.expandByPoint(pn)):(ei.expandByPoint(Ea.min),ei.expandByPoint(Ea.max))}ei.getCenter(n);let r=0;for(let a=0,u=e.count;a<u;a++)pn.fromBufferAttribute(e,a),r=Math.max(r,n.distanceToSquared(pn));if(t)for(let a=0,u=t.length;a<u;a++){const c=t[a],h=this.morphTargetsRelative;for(let d=0,p=c.count;d<p;d++)pn.fromBufferAttribute(c,d),h&&(co.fromBufferAttribute(e,d),pn.add(co)),r=Math.max(r,n.distanceToSquared(pn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&wt('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){wt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,a=t.uv;let u=this.getAttribute("tangent");(u===void 0||u.count!==n.count)&&(u=new Hi(new Float32Array(4*n.count),4),this.setAttribute("tangent",u));const c=[],h=[];for(let w=0;w<n.count;w++)c[w]=new se,h[w]=new se;const d=new se,p=new se,m=new se,v=new Tt,x=new Tt,M=new Tt,b=new se,y=new se;function S(w,L,z){d.fromBufferAttribute(n,w),p.fromBufferAttribute(n,L),m.fromBufferAttribute(n,z),v.fromBufferAttribute(a,w),x.fromBufferAttribute(a,L),M.fromBufferAttribute(a,z),p.sub(d),m.sub(d),x.sub(v),M.sub(v);const B=1/(x.x*M.y-M.x*x.y);isFinite(B)&&(b.copy(p).multiplyScalar(M.y).addScaledVector(m,-x.y).multiplyScalar(B),y.copy(m).multiplyScalar(x.x).addScaledVector(p,-M.x).multiplyScalar(B),c[w].add(b),c[L].add(b),c[z].add(b),h[w].add(y),h[L].add(y),h[z].add(y))}let P=this.groups;P.length===0&&(P=[{start:0,count:e.count}]);for(let w=0,L=P.length;w<L;++w){const z=P[w],B=z.start,G=z.count;for(let J=B,oe=B+G;J<oe;J+=3)S(e.getX(J+0),e.getX(J+1),e.getX(J+2))}const U=new se,T=new se,N=new se,R=new se;function F(w){N.fromBufferAttribute(r,w),R.copy(N);const L=c[w];U.copy(L),U.sub(N.multiplyScalar(N.dot(L))).normalize(),T.crossVectors(R,L);const B=T.dot(h[w])<0?-1:1;u.setXYZW(w,U.x,U.y,U.z,B)}for(let w=0,L=P.length;w<L;++w){const z=P[w],B=z.start,G=z.count;for(let J=B,oe=B+G;J<oe;J+=3)F(e.getX(J+0)),F(e.getX(J+1)),F(e.getX(J+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0||n.count!==t.count)n=new Hi(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let v=0,x=n.count;v<x;v++)n.setXYZ(v,0,0,0);const r=new se,a=new se,u=new se,c=new se,h=new se,d=new se,p=new se,m=new se;if(e)for(let v=0,x=e.count;v<x;v+=3){const M=e.getX(v+0),b=e.getX(v+1),y=e.getX(v+2);r.fromBufferAttribute(t,M),a.fromBufferAttribute(t,b),u.fromBufferAttribute(t,y),p.subVectors(u,a),m.subVectors(r,a),p.cross(m),c.fromBufferAttribute(n,M),h.fromBufferAttribute(n,b),d.fromBufferAttribute(n,y),c.add(p),h.add(p),d.add(p),n.setXYZ(M,c.x,c.y,c.z),n.setXYZ(b,h.x,h.y,h.z),n.setXYZ(y,d.x,d.y,d.z)}else for(let v=0,x=t.count;v<x;v+=3)r.fromBufferAttribute(t,v+0),a.fromBufferAttribute(t,v+1),u.fromBufferAttribute(t,v+2),p.subVectors(u,a),m.subVectors(r,a),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++)pn.fromBufferAttribute(e,t),pn.normalize(),e.setXYZ(t,pn.x,pn.y,pn.z)}toNonIndexed(){function e(c,h){const d=c.array,p=c.itemSize,m=c.normalized,v=new d.constructor(h.length*p);let x=0,M=0;for(let b=0,y=h.length;b<y;b++){c.isInterleavedBufferAttribute?x=h[b]*c.data.stride+c.offset:x=h[b]*p;for(let S=0;S<p;S++)v[M++]=d[x++]}return new Hi(v,p,m)}if(this.index===null)return at("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Ri,n=this.index.array,r=this.attributes;for(const c in r){const h=r[c],d=e(h,n);t.setAttribute(c,d)}const a=this.morphAttributes;for(const c in a){const h=[],d=a[c];for(let p=0,m=d.length;p<m;p++){const v=d[p],x=e(v,n);h.push(x)}t.morphAttributes[c]=h}t.morphTargetsRelative=this.morphTargetsRelative;const u=this.groups;for(let c=0,h=u.length;c<h;c++){const d=u[c];t.addGroup(d.start,d.count,d.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?"BufferGeometry":this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){const h=this.parameters;for(const d in h)h[d]!==void 0&&(e[d]=h[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 h in n){const d=n[h];e.data.attributes[h]=d.toJSON(e.data)}const r={};let a=!1;for(const h in this.morphAttributes){const d=this.morphAttributes[h],p=[];for(let m=0,v=d.length;m<v;m++){const x=d[m];p.push(x.toJSON(e.data))}p.length>0&&(r[h]=p,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const u=this.groups;u.length>0&&(e.data.groups=JSON.parse(JSON.stringify(u)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere=c.toJSON()),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());const r=e.attributes;for(const d in r){const p=r[d];this.setAttribute(d,p.clone(t))}const a=e.morphAttributes;for(const d in a){const p=[],m=a[d];for(let v=0,x=m.length;v<x;v++)p.push(m[v].clone(t));this.morphAttributes[d]=p}this.morphTargetsRelative=e.morphTargetsRelative;const u=e.groups;for(let d=0,p=u.length;d<p;d++){const m=u[d];this.addGroup(m.start,m.count,m.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}let xM=0;class Qu extends Ar{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:xM++}),this.uuid=Ba(),this.name="",this.type="Material",this.blending=Mo,this.side=Ws,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Wf,this.blendDst=Xf,this.blendEquation=vr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Rt(0,0,0),this.blendAlpha=0,this.depthFunc=Co,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Zg,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=eo,this.stencilZFail=eo,this.stencilZPass=eo,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.allowOverride=!0,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){at(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){at(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 16,661 bytes, line 45
45n.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.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),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!==Mo&&(n.blending=this.blending),this.side!==Ws&&(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!==Wf&&(n.blendSrc=this.blendSrc),this.blendDst!==Xf&&(n.blendDst=this.blendDst),this.blendEquation!==vr&&(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!==Co&&(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!==Zg&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==eo&&(n.stencilFail=this.stencilFail),this.stencilZFail!==eo&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==eo&&(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.allowOverride===!1&&(n.allowOverride=!1),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 r(a){const u=[];for(const c in a){const h=a[c];delete h.metadata,u.push(h)}return u}if(t){const a=r(e.textures),u=r(e.images);a.length>0&&(n.textures=a),u.length>0&&(n.images=u)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new Rt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let n=e.normalScale;Array.isArray(n)===!1&&(n=[n,n]),this.normalScale=new Tt().fromArray(n)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new Tt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}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 r=t.length;n=new Array(r);for(let a=0;a!==r;++a)n[a]=t[a].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 16,204 bytes, line 45
45adows,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.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const is=new se,hf=new se,nu=new se,Os=new se,ff=new se,iu=new se,df=new se;class SM{constructor(e=new se,t=new se(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,is)),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=is.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(is.copy(this.origin).addScaledVector(this.direction,t),is.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){hf.copy(e).add(t).multiplyScalar(.5),nu.copy(t).sub(e).normalize(),Os.copy(this.origin).sub(hf);const a=e.distanceTo(t)*.5,u=-this.direction.dot(nu),c=Os.dot(this.direction),h=-Os.dot(nu),d=Os.lengthSq(),p=Math.abs(1-u*u);let m,v,x,M;if(p>0)if(m=u*h-c,v=u*c-h,M=a*p,m>=0)if(v>=-M)if(v<=M){const b=1/p;m*=b,v*=b,x=m*(m+u*v+2*c)+v*(u*m+v+2*h)+d}else v=a,m=Math.max(0,-(u*v+c)),x=-m*m+v*(v+2*h)+d;else v=-a,m=Math.max(0,-(u*v+c)),x=-m*m+v*(v+2*h)+d;else v<=-M?(m=Math.max(0,-(-u*a+c)),v=m>0?-a:Math.min(Math.max(-a,-h),a),x=-m*m+v*(v+2*h)+d):v<=M?(m=0,v=Math.min(Math.max(-a,-h),a),x=v*(v+2*h)+d):(m=Math.max(0,-(u*a+c)),v=m>0?a:Math.min(Math.max(-a,-h),a),x=-m*m+v*(v+2*h)+d);else v=u>0?-a:a,m=Math.max(0,-(u*v+c)),x=-m*m+v*(v+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,m),r&&r.copy(hf).addScaledVector(nu,v),x}intersectSphere(e,t){is.subVectors(e.center,this.origin);const n=is.dot(this.direction),r=is.dot(is)-n*n,a=e.radius*e.radius;if(r>a)return null;const u=Math.sqrt(a-r),c=n-u,h=n+u;return h<0?null:c<0?this.at(h,t):this.at(c,t)}intersectsSphere(e){return e.radius<0?!1: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,r,a,u,c,h;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,r=(e.max.x-v.x)*d):(n=(e.max.x-v.x)*d,r=(e.min.x-v.x)*d),p>=0?(a=(e.min.y-v.y)*p,u=(e.max.y-v.y)*p):(a=(e.max.y-v.y)*p,u=(e.min.y-v.y)*p),n>u||a>r||((a>n||isNaN(n))&&(n=a),(u<r||isNaN(r))&&(r=u),m>=0?(c=(e.min.z-v.z)*m,h=(e.max.z-v.z)*m):(c=(e.max.z-v.z)*m,h=(e.min.z-v.z)*m),n>h||c>r)||((c>n||n!==n)&&(n=c),(h<r||r!==r)&&(r=h),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,is)!==null}intersectTriangle(e,t,n,r,a){ff.subVectors(t,e),iu.subVectors(n,e),df.crossVectors(ff,iu);let u=this.direction.dot(df),c;if(u>0){if(r)return null;c=1}else if(u<0)c=-1,u=-u;else return null;Os.subVectors(this.origin,e);const h=c*this.direction.dot(iu.crossVectors(Os,iu));if(h<0)return null;const d=c*this.direction.dot(ff.cross(Os));if(d<0||h+d>u)return null;const p=-c*Os.dot(df);return p<0?null:this.at(p/u,a)}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 zu extends Qu{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Rt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Er,this.combine=a_,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 pv=new on,fr=new SM,su=new np,mv=new se,ru=new se,ou=new se,au=new se,pf=new se,lu=new se,gv=new se,uu=new se;class ti extends ni{constructor(e=new Ri,t=new zu){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,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 r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,u=r.length;a<u;a++){const c=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=a}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,a=n.morphAttributes.position,u=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const c=this.morphTargetInfluences;if(a&&c){lu.set(0,0,0);for(let h=0,d=a.length;h<d;h++){const p=c[h],m=a[h];p!==0&&(pf.fromBufferAttribute(m,e),u?lu.addScaledVector(pf,p):lu.addScaledVector(pf.sub(t),p))}t.add(lu)}return t}raycast(e,t){const n=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),su.copy(n.boundingSphere),su.applyMatrix4(a),fr.copy(e.ray).recast(e.near),!(su.containsPoint(fr.origin)===!1&&(fr.intersectSphere(su,mv)===null||fr.origin.distanceToSquared(mv)>(e.far-e.near)**2))&&(pv.copy(a).invert(),fr.copy(e.ray).applyMatrix4(pv),!(n.boundingBox!==null&&fr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,fr)))}_computeIntersections(e,t,n){let r;const a=this.geometry,u=this.material,c=a.index,h=a.attributes.position,d=a.attributes.uv,p=a.attributes.uv1,m=a.attributes.normal,v=a.groups,x=a.drawRange;if(c!==null)if(Array.isArray(u))for(let M=0,b=v.length;M<b;M++){const y=v[M],S=u[y.materialIndex],P=Math.max(y.start,x.start),U=Math.min(c.count,Math.min(y.start+y.count,x.start+x.count));for(let T=P,N=U;T<N;T+=3){const R=c.getX(T),F=c.getX(T+1),w=c.getX(T+2);r=cu(this,S,e,n,d,p,m,R,F,w),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const M=Math.max(0,x.start),b=Math.min(c.count,x.start+x.count);for(let y=M,S=b;y<S;y+=3){const P=c.getX(y),U=c.getX(y+1),T=c.getX(y+2);r=cu(this,u,e,n,d,p,m,P,U,T),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}else if(h!==void 0)if(Array.isArray(u))for(let M=0,b=v.length;M<b;M++){const y=v[M],S=u[y.materialIndex],P=Math.max(y.start,x.start),U=Math.min(h.count,Math.min(y.start+y.count,x.start+x.count));for(let T=P,N=U;T<N;T+=3){const R=T,F=T+1,w=T+2;r=cu(this,S,e,n,d,p,m,R,F,w),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const M=Math.max(0,x.start),b=Math.min(h.count,x.start+x.count);for(let y=M,S=b;y<S;y+=3){const P=y,U=y+1,T=y+2;r=cu(this,u,e,n,d,p,m,P,U,T),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}}}function yM(s,e,t,n,r,a,u,c){let h;if(e.side===qn?h=n.intersectTriangle(u,a,r,!0,c):h=n.intersectTriangle(r,a,u,e.side===Ws,c),h===null)return null;uu.copy(c),uu.applyMatrix4(s.matrixWorld);const d=t.ray.origin.distanceTo(uu);return d<t.near||d>t.far?null:{distance:d,point:uu.clone(),object:s}}function cu(s,e,t,n,r,a,u,c,h,d){s.getVertexPosition(c,ru),s.getVertexPosition(h,ou),s.getVertexPosition(d,au);const p=yM(s,e,t,n,ru,ou,au,gv);if(p){const m=new se;bi.getBarycoord(gv,ru,ou,au,m),r&&(p.uv=bi.getInterpolatedAttribute(r,c,h,d,m,new Tt)),a&&(p.uv1=bi.getInterpolatedAttribute(a,c,h,d,m,new Tt)),u&&(p.normal=bi.getInterpolatedAttribute(u,c,h,d,m,new se),p.normal.dot(n.direction)>0&&p.normal.multiplyScalar(-1));const v={a:c,b:h,c:d,normal:new se,materialIndex:0};bi.getNormal(ru,ou,au,v.normal),p.face=v,p.barycoord=m}return p}class MM extends Pn{constructor(e=null,t=1,n=1,r,a,u,c,h,d=Mn,p=Mn,m,v){super(null,u,c,h,d,p,r,a,m,v),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const mf=new se,EM=new se,wM=new ct;class gr{constructor(e=new se(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,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=mf.subVectors(n,t).cross(EM.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){const r=e.delta(mf),a=this.normal.dot(r);if(a===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const u=-(e.start.dot(this.normal)+this.constant)/a;return n===!0&&(u<0||u>1)?null:t.copy(e.start).addScaledVector(r,u)}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||wM.getNormalMatrix(e),r=this.coplanarPoint(mf).applyMatrix4(e),a=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(a),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 dr=new np,bM=new Tt(.5,.5),hu=new se;class R_{constructor(e=new gr,t=new gr,n=new gr,r=new gr,a=new gr,u=new gr){this.planes=[e,t,n,r,a,u]}set(e,t,n,r,a,u){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(r),c[4].copy(a),c[5].copy(u),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=zi,n=!1){const r=this.planes,a=e.elements,u=a[0],c=a[1],h=a[2],d=a[3],p=a[4],m=a[5],v=a[6],x=a[7],M=a[8],b=a[9],y=a[10],S=a[11],P=a[12],U=a[13],T=a[14],N=a[15];if(r[0].setComponents(d-u,x-p,S-M,N-P).normalize(),r[1].setComponents(d+u,x+p,S+M,N+P).normalize(),r[2].setComponents(d+c,x+m,S+b,N+U).normalize(),r[3].setComponents(d-c,x-m,S-b,N-U).normalize(),n)r[4].setComponents(h,v,y,T).normalize(),r[5].setComponents(d-h,x-v,S-y,N-T).normalize();else if(r[4].setComponents(d-h,x-v,S-y,N-T).normalize(),t===zi)r[5].setComponents(d+h,x+v,S+y,N+T).normalize();else if(t===Bu)r[5].setComponents(h,v,y,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(),dr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),dr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(dr)}intersectsSprite(e){dr.center.set(0,0,0);const t=bM.distanceTo(e.center);return dr.radius=.7071067811865476+t,dr.applyMatrix4(e.matrixWorld),this.intersectsSphere(dr)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(hu.x=r.normal.x>0?e.max.x:e.min.x,hu.y=r.normal.y>0?e.max.y:e.min.y,hu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(hu)<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)}}class P_ extends Pn{constructor(e=[],t=yr,n,r,a,u,c,h,d,p){super(e,t,n,r,a,u,c,h,d,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Ro extends Pn{constructor(e,t,n=Gi,r,a,u,c=Mn,h=Mn,d,p=ds,m=1){if(p!==ds&&p!==xr)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const v={width:e,height:t,depth:m};super(v,r,a,u,c,h,p,n,d),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new tp(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class TM extends Ro{constructor(e,t=Gi,n=yr,r,a,u=Mn,c=Mn,h,d=ds){const p={width:e,height:e,depth:1},m=[p,p,p,p,p,p];super(e,e,t,n,r,a,u,c,h,d),this.image=m,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class N_ extends Pn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Va extends Ri{constructor(e=1,t=1,n=1,r=1,a=1,u=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:a,depthSegments:u};const c=this;r=Math.floor(r),a=Math.floor(a),u=Math.floor(u);const h=[],d=[],p=[],m=[];let v=0,x=0;M("z","y","x",-1,-1,n,t,e,u,a,0),M("z","y","x",1,-1,n,t,-e,u,a,1),M("x","z","y",1,1,e,n,t,r,u,2),M("x","z","y",1,-1,e,n,-t,r,u,3),M("x","y","z",1,-1,e,t,n,r,a,4),M("x","y","z",-1,-1,e,t,-n,r,a,5),this.setIndex(h),this.setAttribute("position",new Fn(d,3)),this.setAttribute("normal",new Fn(p,3)),this.setAttribute("uv",new Fn(m,2));function M(b,y,S,P,U,T,N,R,F,w,L){const z=T/F,B=N/w,G=T/2,J=N/2,oe=R/2,Y=F+1,ie=w+1;let K=0,$=0;const le=new se;for(let ue=0;ue<ie;ue++){const k=ue*B-J;for(let Q=0;Q<Y;Q++){const De=Q*z-G;le[b]=De*P,le[y]=k*U,le[S]=oe,d.push(le.x,le.y,le.z),le[b]=0,le[y]=0,le[S]=R>0?1:-1,p.push(le.x,le.y,le.z),m.push(Q/F),m.push(1-ue/w),K+=1}}for(let ue=0;ue<w;ue++)for(let k=0;k<F;k++){const Q=v+k+Y*ue,De=v+k+Y*(ue+1),He=v+(k+1)+Y*(ue+1),Be=v+(k+1)+Y*ue;h.push(Q,De,Be),h.push(De,He,Be),$+=6}c.addGroup(x,$,L),x+=$,v+=K}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Va(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class ip extends Ri{constructor(e=1,t=32,n=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radiu
vendor: 4,053 bytes, line 45
45s:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const a=[],u=[],c=[],h=[],d=new se,p=new Tt;u.push(0,0,0),c.push(0,0,1),h.push(.5,.5);for(let m=0,v=3;m<=t;m++,v+=3){const x=n+m/t*r;d.x=e*Math.cos(x),d.y=e*Math.sin(x),u.push(d.x,d.y,d.z),c.push(0,0,1),p.x=(u[v]/e+1)/2,p.y=(u[v+1]/e+1)/2,h.push(p.x,p.y)}for(let m=1;m<=t;m++)a.push(m,m+1,0);this.setIndex(a),this.setAttribute("position",new Fn(u,3)),this.setAttribute("normal",new Fn(c,3)),this.setAttribute("uv",new Fn(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ip(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class sp extends Ri{constructor(e=1,t=1,n=1,r=32,a=1,u=!1,c=0,h=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:a,openEnded:u,thetaStart:c,thetaLength:h};const d=this;r=Math.floor(r),a=Math.floor(a);const p=[],m=[],v=[],x=[];let M=0;const b=[],y=n/2;let S=0;P(),u===!1&&(e>0&&U(!0),t>0&&U(!1)),this.setIndex(p),this.setAttribute("position",new Fn(m,3)),this.setAttribute("normal",new Fn(v,3)),this.setAttribute("uv",new Fn(x,2));function P(){const T=new se,N=new se;let R=0;const F=(t-e)/n;for(let w=0;w<=a;w++){const L=[],z=w/a,B=z*(t-e)+e;for(let G=0;G<=r;G++){const J=G/r,oe=J*h+c,Y=Math.sin(oe),ie=Math.cos(oe);N.x=B*Y,N.y=-z*n+y,N.z=B*ie,m.push(N.x,N.y,N.z),T.set(Y,F,ie).normalize(),v.push(T.x,T.y,T.z),x.push(J,1-z),L.push(M++)}b.push(L)}for(let w=0;w<r;w++)for(let L=0;L<a;L++){const z=b[L][w],B=b[L+1][w],G=b[L+1][w+1],J=b[L][w+1];(e>0||L!==0)&&(p.push(z,B,J),R+=3),(t>0||L!==a-1)&&(p.push(B,G,J),R+=3)}d.addGroup(S,R,0),S+=R}function U(T){const N=M,R=new Tt,F=new se;let w=0;const L=T===!0?e:t,z=T===!0?1:-1;for(let G=1;G<=r;G++)m.push(0,y*z,0),v.push(0,z,0),x.push(.5,.5),M++;const B=M;for(let G=0;G<=r;G++){const oe=G/r*h+c,Y=Math.cos(oe),ie=Math.sin(oe);F.x=L*ie,F.y=y*z,F.z=L*Y,m.push(F.x,F.y,F.z),v.push(0,z,0),R.x=Y*.5+.5,R.y=ie*.5*z+.5,x.push(R.x,R.y),M++}for(let G=0;G<r;G++){const J=N+G,oe=B+G;T===!0?p.push(oe,oe+1,J):p.push(oe+1,oe,J),w+=3}d.addGroup(S,w,T===!0?1:2),S+=w}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sp(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ha extends Ri{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const a=e/2,u=t/2,c=Math.floor(n),h=Math.floor(r),d=c+1,p=h+1,m=e/c,v=t/h,x=[],M=[],b=[],y=[];for(let S=0;S<p;S++){const P=S*v-u;for(let U=0;U<d;U++){const T=U*m-a;M.push(T,-P,0),b.push(0,0,1),y.push(U/c),y.push(1-S/h)}}for(let S=0;S<h;S++)for(let P=0;P<c;P++){const U=P+d*S,T=P+d*(S+1),N=P+1+d*(S+1),R=P+1+d*S;x.push(U,T,R),x.push(T,N,R)}this.setIndex(x),this.setAttribute("position",new Fn(M,3)),this.setAttribute("normal",new Fn(b,3)),this.setAttribute("uv",new Fn(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ha(e.width,e.height,e.widthSegments,e.heightSegments)}}function Po(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const r=s[t][n];if(vv(r))r.isRenderTargetTexture?(at("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone();else if(Array.isArray(r))if(vv(r[0])){const a=[];for(let u=0,c=r.length;u<c;u++)a[u]=r[u].clone();e[t][n]=a}else e[t][n]=r.slice();else e[t][n]=r}}return e}function In(s){const e={};for(let t=0;t<s.length;t++){const n=Po(s[t]);for(const r in n)e[r]=n[r]}return e}function vv(s){return s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)}function CM(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function L_(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:xt.workingColorSpace}const AM={clone:Po,merge:In}
vendor: 2,707 bytes, lines 45-49
45;var RM=`void main() {
46	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
47}`,PM=`void main() {
48	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
49}`;class Ai extends Qu{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=RM,this.fragmentShader=PM,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=Po(e.uniforms),this.uniformsGroups=CM(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.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const u=this.uniforms[r].value;u&&u.isTexture?t.uniforms[r]={type:"t",value:u.toJSON(e).uuid}:u&&u.isColor?t.uniforms[r]={type:"c",value:u.getHex()}:u&&u.isVector2?t.uniforms[r]={type:"v2",value:u.toArray()}:u&&u.isVector3?t.uniforms[r]={type:"v3",value:u.toArray()}:u&&u.isVector4?t.uniforms[r]={type:"v4",value:u.toArray()}:u&&u.isMatrix3?t.uniforms[r]={type:"m3",value:u.toArray()}:u&&u.isMatrix4?t.uniforms[r]={type:"m4",value:u.toArray()}:t.uniforms[r]={value:u}}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 r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(const n in e.uniforms){const r=e.uniforms[n];switch(this.uniforms[n]={},r.type){case"t":this.uniforms[n].value=t[r.value]||null;break;case"c":this.uniforms[n].value=new Rt().setHex(r.value);break;case"v2":this.uniforms[n].value=new Tt().fromArray(r.value);break;case"v3":this.uniforms[n].value=new se().fromArray(r.value);break;case"v4":this.uniforms[n].value=new Jt().fromArray(r.value);break;case"m3":this.uniforms[n].value=new ct().fromArray(r.value);break;
49case"m4":this.uniforms[n].value=new on().fromArray(r.value);break;default:this.uniforms[n].value=r.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(const n in e.extensions)this.extensions[n]=e.extensions[n];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}}class NM extends Ai{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class LM extends Qu{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Gy,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 DM extends Qu{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 gf={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(_v(s)||(this.files[s]=e))},get:function(s){if(this.enabled!==!1&&!_v(s))return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};function _v(s){try{const e=s.slice(s.indexOf(":")+1);return new URL(e).protocol==="blob:"}catch{return!1}}class IM{constructor(e,t,n){const r=this;let a=!1,u=0,c=0,h;const d=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(p){c++,a===!1&&r.onStart!==void 0&&r.onStart(p,u,c),a=!0},this.itemEnd=function(p){u++,r.onProgress!==void 0&&r.onProgress(p,u,c),u===c&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(p){r.onError!==void 0&&r.onError(p)},this.resolveURL=function(p){return p=p.normalize("NFC"),h?h(p):p},this.setURLModifier=function(p){return h=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 x=d[m],M=d[m+1];if(x.global&&(x.lastIndex=0),x.test(p))return M}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const UM=new IM;class rp{constructor(e){this.manager=e!==void 0?e:UM,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,a){n.load(e,r,t,a)})}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}abort(){return this}}rp.DEFAULT_MATERIAL_NAME="__DEFAULT";const ho=new WeakMap;class FM extends rp{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,u=gf.get(`image:${e}`);if(u!==void 0){if(u.complete===!0)a.manager.itemStart(e),setTimeout(function(){t&&t(u),a.manager.itemEnd(e)},0);else{let m=ho.get(u);m===void 0&&(m=[],ho.set(u,m)),m.push({onLoad:t,onError:r})}return u}const c=Oa("img");function h(){p(),t&&t(this);const m=ho.get(this)||[];for(let v=0;v<m.length;v++){const x=m[v];x.onLoad&&x.onLoad(this)}ho.delete(this),a.manager.itemEnd(e)}function d(m){p(),r&&r(m),gf.remove(`image:${e}`);const v=ho.get(this)||[];for(let x=0;x<v.length;x++){const M=v[x];M.onError&&M.onError(m)}ho.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function p(){c.removeEventListener("load",h,!1),c.removeEventListener("error",d,!1)}return c.addEventListener("load",h,!1),c.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),gf.add(`image:${e}`,c),a.manager.itemStart(e),c.src=e,c}}class OM extends rp{constructor(e){super(e)}load(e,t,n,r){const a=new Pn,u=new FM(this.manager);return u.setCrossOrigin(this.crossOrigin),u.setPath(this.path),u.load(e,function(c){a.image=c,a.needsUpdate=!0,t!==void 0&&t(a)},n,r),a}}const fu=new se,du=new Do,Ui=new se;class D_ extends ni{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new on,this.projectionMatrix=new on,this.projectionMatrixInverse=new on,this.coordinateSystem=zi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}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.matrixWorld.decompose(fu,du,Ui),Ui.x===1&&Ui.y===1&&Ui.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(fu,du,Ui.set(1,1,1)).invert()}updateWorldMatrix(e,t,n=!1){super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose(fu,du,Ui),Ui.x===1&&Ui.y===1&&Ui.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(fu,du,Ui.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const ks=new se,xv=new Tt,Sv=new Tt;class fi extends D_{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Pd*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Xh*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 13,235 bytes, lines 49-112
49getEffectiveFOV(){return Pd*2*Math.atan(Math.tan(Xh*.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){ks.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ks.x,ks.y).multiplyScalar(-e/ks.z),ks.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ks.x,ks.y).multiplyScalar(-e/ks.z)}getViewSize(e,t){return this.getViewBounds(e,xv,Sv),t.subVectors(Sv,xv)}setViewOffset(e,t,n,r,a,u){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=r,this.view.width=a,this.view.height=u,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Xh*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,a=-.5*r;const u=this.view;if(this.view!==null&&this.view.enabled){const h=u.fullWidth,d=u.fullHeight;a+=u.offsetX*r/h,t-=u.offsetY*n/d,r*=u.width/h,n*=u.height/d}const c=this.filmOffset;c!==0&&(a+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),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}}class I_ extends D_{constructor(e=-1,t=1,n=1,r=-1,a=.1,u=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=r,this.near=a,this.far=u,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,r,a,u){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=r,this.view.width=a,this.view.height=u,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,r=(this.top+this.bottom)/2;let a=n-e,u=n+e,c=r+t,h=r-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;a+=d*this.view.offsetX,u=a+d*this.view.width,c-=p*this.view.offsetY,h=c-p*this.view.height}this.projectionMatrix.makeOrthographic(a,u,c,h,this.near,this.far,this.coordinateSystem,this.reversedDepth),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 fo=-90,po=1;class kM extends ni{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new fi(fo,po,e,t);r.layers=this.layers,this.add(r);const a=new fi(fo,po,e,t);a.layers=this.layers,this.add(a);const u=new fi(fo,po,e,t);u.layers=this.layers,this.add(u);const c=new fi(fo,po,e,t);c.layers=this.layers,this.add(c);const h=new fi(fo,po,e,t);h.layers=this.layers,this.add(h);const d=new fi(fo,po,e,t);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,a,u,c,h]=t;for(const d of t)this.remove(d);if(e===zi)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),u.up.set(0,0,1),u.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),h.up.set(0,1,0),h.lookAt(0,0,-1);else if(e===Bu)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),u.up.set(0,0,-1),u.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),h.up.set(0,-1,0),h.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:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,u,c,h,d,p]=this.children,m=e.getRenderTarget(),v=e.getActiveCubeFace(),x=e.getActiveMipmapLevel(),M=e.xr.enabled;e.xr.enabled=!1;const b=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let y=!1;e.isWebGLRenderer===!0?y=e.state.buffers.depth.getReversed():y=e.reversedDepthBuffer,e.setRenderTarget(n,0,r),y&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,1,r),y&&e.autoClear===!1&&e.clearDepth(),e.render(t,u),e.setRenderTarget(n,2,r),y&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),e.setRenderTarget(n,3,r),y&&e.autoClear===!1&&e.clearDepth(),e.render(t,h),e.setRenderTarget(n,4,r),y&&e.autoClear===!1&&e.clearDepth(),e.render(t,d),n.texture.generateMipmaps=b,e.setRenderTarget(n,5,r),y&&e.autoClear===!1&&e.clearDepth(),e.render(t,p),e.setRenderTarget(m,v,x),e.xr.enabled=M,n.texture.needsPMREMUpdate=!0}}class BM extends fi{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const _p=class _p{constructor(e,t,n,r){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}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,r){const a=this.elements;return a[0]=e,a[2]=t,a[1]=n,a[3]=r,this}};_p.prototype.isMatrix2=!0;let yv=_p;function Mv(s,e,t,n){const r=zM(n);switch(t){case S_:return s*e;case M_:return s*e/r.components*r.byteLength;case jd:return s*e/r.components*r.byteLength;case Mr:return s*e*2/r.components*r.byteLength;case Qd:return s*e*2/r.components*r.byteLength;case y_:return s*e*3/r.components*r.byteLength;case Ti:return s*e*4/r.components*r.byteLength;case Zd:return s*e*4/r.components*r.byteLength;case Tu:case Cu:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case Au:case Ru:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case td:case id:return Math.max(s,16)*Math.max(e,8)/4;case ed:case nd:return Math.max(s,8)*Math.max(e,8)/2;case sd:case rd:case ad:case ld:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case od:case Uu:case ud:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case cd:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case hd:return Math.floor((s+4)/5)*Math.floor((e+3)/4)*16;case fd:return Math.floor((s+4)/5)*Math.floor((e+4)/5)*16;case dd:return Math.floor((s+5)/6)*Math.floor((e+4)/5)*16;case pd:return Math.floor((s+5)/6)*Math.floor((e+5)/6)*16;case md:return Math.floor((s+7)/8)*Math.floor((e+4)/5)*16;case gd:return Math.floor((s+7)/8)*Math.floor((e+5)/6)*16;case vd:return Math.floor((s+7)/8)*Math.floor((e+7)/8)*16;case _d:return Math.floor((s+9)/10)*Math.floor((e+4)/5)*16;case xd:return Math.floor((s+9)/10)*Math.floor((e+5)/6)*16;case Sd:return Math.floor((s+9)/10)*Math.floor((e+7)/8)*16;case yd:return Math.floor((s+9)/10)*Math.floor((e+9)/10)*16;case Md:return Math.floor((s+11)/12)*Math.floor((e+9)/10)*16;case Ed:return Math.floor((s+11)/12)*Math.floor((e+11)/12)*16;case wd:case bd:case Td:return Math.ceil(s/4)*Math.ceil(e/4)*16;case Cd:case Ad:return Math.ceil(s/4)*Math.ceil(e/4)*8;case Fu:case Rd:return Math.ceil(s/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function zM(s){switch(s){case di:case g_:return{byteLength:1,components:1};case Ua:case v_:case fs:return{byteLength:2,components:1};case Yd:case Kd:return{byteLength:2,components:4};case Gi:case qd:case Bi:return{byteLength:4,components:1};case __:case x_:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${s}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:$d}}));typeof window<"u"&&(window.__THREE__?at("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=$d);/**
50 * @license
51 * Copyright 2010-2026 Three.js Authors
52 * SPDX-License-Identifier: MIT
53 */function U_(){let s=null,e=!1,t=null,n=null;function r(a,u){t(a,u),n=s.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&s!==null&&(n=s.requestAnimationFrame(r),e=!0)},stop:function(){s!==null&&s.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){s=a}}}function VM(s){const e=new WeakMap;function t(c,h){const d=c.array,p=c.usage,m=d.byteLength,v=s.createBuffer();s.bindBuffer(h,v),s.bufferData(h,d,p),c.onUploadCallback();let x;if(d instanceof Float32Array)x=s.FLOAT;else if(typeof Float16Array<"u"&&d instanceof Float16Array)x=s.HALF_FLOAT;else if(d instanceof Uint16Array)c.isFloat16BufferAttribute?x=s.HALF_FLOAT:x=s.UNSIGNED_SHORT;else if(d instanceof Int16Array)x=s.SHORT;else if(d instanceof Uint32Array)x=s.UNSIGNED_INT;else if(d instanceof Int32Array)x=s.INT;else if(d instanceof Int8Array)x=s.BYTE;else if(d instanceof Uint8Array)x=s.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)x=s.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:v,type:x,bytesPerElement:d.BYTES_PER_ELEMENT,version:c.version,size:m}}function n(c,h,d){const p=h.array,m=h.updateRanges;if(s.bindBuffer(d,c),m.length===0)s.bufferSubData(d,0,p);else{m.sort((x,M)=>x.start-M.start);let v=0;for(let x=1;x<m.length;x++){const M=m[v],b=m[x];b.start<=M.start+M.count+1?M.count=Math.max(M.count,b.start+b.count-M.start):(++v,m[v]=b)}m.length=v+1;for(let x=0,M=m.length;x<M;x++){const b=m[x];s.bufferSubData(d,b.start*p.BYTES_PER_ELEMENT,p,b.start,b.count)}h.clearUpdateRanges()}h.onUploadCallback()}function r(c){return c.isInterleavedBufferAttribute&&(c=c.data),e.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const h=e.get(c);h&&(s.deleteBuffer(h.buffer),e.delete(c))}function u(c,h){if(c.isInterleavedBufferAttribute&&(c=c.data),c.isGLBufferAttribute){const p=e.get(c);(!p||p.version<c.version)&&e.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}const d=e.get(c);if(d===void 0)e.set(c,t(c,h));else if(d.version<c.version){if(d.size!==c.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,c,h),d.version=c.version}}return{get:r,remove:a,update:u}}var HM=`#ifdef USE_ALPHAHASH
54	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
55#endif`,GM=`#ifdef USE_ALPHAHASH
56	const float ALPHA_HASH_SCALE = 0.05;
57	float hash2D( vec2 value ) {
58		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
59	}
60	float hash3D( vec3 value ) {
61		return hash2D( vec2( hash2D( value.xy ), value.z ) );
62	}
63	float getAlphaHashThreshold( vec3 position ) {
64		float maxDeriv = max(
65			length( dFdx( position.xyz ) ),
66			length( dFdy( position.xyz ) )
67		);
68		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
69		vec2 pixScales = vec2(
70			exp2( floor( log2( pixScale ) ) ),
71			exp2( ceil( log2( pixScale ) ) )
72		);
73		vec2 alpha = vec2(
74			hash3D( floor( pixScales.x * position.xyz ) ),
75			hash3D( floor( pixScales.y * position.xyz ) )
76		);
77		float lerpFactor = fract( log2( pixScale ) );
78		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
79		float a = min( lerpFactor, 1.0 - lerpFactor );
80		vec3 cases = vec3(
81			x * x / ( 2.0 * a * ( 1.0 - a ) ),
82			( x - 0.5 * a ) / ( 1.0 - a ),
83			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
84		);
85		float threshold = ( x < ( 1.0 - a ) )
86			? ( ( x < a ) ? cases.x : cases.y )
87			: cases.z;
88		return clamp( threshold , 1.0e-6, 1.0 );
89	}
90#endif`,WM=`#ifdef USE_ALPHAMAP
91	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
92#endif`,XM=`#ifdef USE_ALPHAMAP
93	uniform sampler2D alphaMap;
94#endif`,$M=`#ifdef USE_ALPHATEST
95	#ifdef ALPHA_TO_COVERAGE
96	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
97	if ( diffuseColor.a == 0.0 ) discard;
98	#else
99	if ( diffuseColor.a < alphaTest ) discard;
100	#endif
101#endif`,qM=`#ifdef USE_ALPHATEST
102	uniform float alphaTest;
103#endif`,YM=`#ifdef USE_AOMAP
104	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
105	reflectedLight.indirectDiffuse *= ambientOcclusion;
106	#if defined( USE_CLEARCOAT ) 
107		clearcoatSpecularIndirect *= ambientOcclusion;
108	#endif
109	#if defined( USE_SHEEN ) 
110		sheenSpecularIndirect *= ambientOcclusion;
111	#endif
112	#if defined( USE_ENVMAP ) && defined( STANDARD )
113		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
114		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
115	#endif
116#endif`,KM=`#ifdef USE_AOMAP
117	uniform sampler2D aoMap;
118	uniform float aoMapIntensity;
119#endif`,jM=`#ifdef USE_BATCHING
120	#if ! defined( GL_ANGLE_multi_draw )
121	#define gl_DrawID _gl_DrawID
122	uniform int _gl_DrawID;
123	#endif
124	uniform highp sampler2D batchingTexture;
125	uniform highp usampler2D batchingIdTexture;
126	mat4 getBatchingMatrix( const in float i ) {
127		int size = textureSize( batchingTexture, 0 ).x;
128		int j = int( i ) * 4;
129		int x = j % size;
130		int y = j / size;
131		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
132		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
133		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
134		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
135		return mat4( v1, v2, v3, v4 );
136	}
137	float getIndirectIndex( const in int i ) {
138		int size = textureSize( batchingIdTexture, 0 ).x;
139		int x = i % size;
140		int y = i / size;
141		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
142	}
143#endif
144#ifdef USE_BATCHING_COLOR
145	uniform sampler2D batchingColorTexture;
146	vec4 getBatchingColor( const in float i ) {
147		int size = textureSize( batchingColorTexture, 0 ).x;
148		int j = int( i );
149		int x = j % size;
150		int y = j / size;
151		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
152	}
153#endif`,QM=`#ifdef USE_BATCHING
154	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
155#endif`,ZM=`vec3 transformed = vec3( position );
156#ifdef USE_ALPHAHASH
157	vPosition = vec3( position );
158#endif`,JM=`vec3 objectNormal = vec3( normal );
159#ifdef USE_TANGENT
160	vec3 objectTangent = vec3( tangent.xyz );
161#endif`,eE=`float G_BlinnPhong_Implicit( ) {
162	return 0.25;
163}
164float D_BlinnPhong( const in float shininess, const in float dotNH ) {
165	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
166}
167vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
168	vec3 halfDir = normalize( lightDir + viewDir );
169	float dotNH = saturate( dot( normal, halfDir ) );
170	float dotVH = saturate( dot( viewDir, halfDir ) );
171	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
172	float G = G_BlinnPhong_Implicit( );
173	float D = D_BlinnPhong( shininess, dotNH );
174	return F * ( G * D );
175} // validated`,tE=`#ifdef USE_IRIDESCENCE
176	const mat3 XYZ_TO_REC709 = mat3(
177		 3.2404542, -0.9692660,  0.0556434,
178		-1.5371385,  1.8760108, -0.2040259,
179		-0.4985314,  0.0415560,  1.0572252
180	);
181	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
182		vec3 sqrtF0 = sqrt( fresnel0 );
183		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
184	}
185	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
186		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
187	}
188	float IorToFresnel0( float transmittedIor, float incidentIor ) {
189		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
190	}
191	vec3 evalSensitivity( float OPD, vec3 shift ) {
192		float phase = 2.0 * PI * OPD * 1.0e-9;
193		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
194		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
195		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
196		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
197		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 ) );
198		xyz /= 1.0685e-7;
199		vec3 rgb = XYZ_TO_REC709 * xyz;
200		return rgb;
201	}
202	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
203		vec3 I;
204		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
205		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
206		float cosTheta2Sq = 1.0 - sinTheta2Sq;
207		if ( cosTheta2Sq < 0.0 ) {
208			return vec3( 1.0 );
209		}
210		float cosTheta2 = sqrt( cosTheta2Sq );
211		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
212		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
213		float T121 = 1.0 - R12;
214		float phi12 = 0.0;
215		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
216		float phi21 = PI - phi12;
217		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
218		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
219		vec3 phi23 = vec3( 0.0 );
220		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
221		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
222		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
223		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
224		vec3 phi = vec3( phi21 ) + phi23;
225		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
226		vec3 r123 = sqrt( R123 );
227		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
228		vec3 C0 = R12 + Rs;
229		I = C0;
230		vec3 Cm = Rs - T121;
231		for ( int m = 1; m <= 2; ++ m ) {
232			Cm *= r123;
233			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
234			I += Cm * Sm;
235		}
236		return max( I, vec3( 0.0 ) );
237	}
238#endif`,nE=`#ifdef USE_BUMPMAP
239	uniform sampler2D bumpMap;
240	uniform float bumpScale;
241	vec2 dHdxy_fwd() {
242		vec2 dSTdx = dFdx( vBumpMapUv );
243		vec2 dSTdy = dFdy( vBumpMapUv );
244		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
245		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
246		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
247		return vec2( dBx, dBy );
248	}
249	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
250		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
251		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
252		vec3 vN = surf_norm;
253		vec3 R1 = cross( vSigmaY, vN );
254		vec3 R2 = cross( vN, vSigmaX );
255		float fDet = dot( vSigmaX, R1 ) * faceDirection;
256		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
257		return normalize( abs( fDet ) * surf_norm - vGrad );
258	}
259#endif`,iE=`#if NUM_CLIPPING_PLANES > 0
260	vec4 plane;
261	#ifdef ALPHA_TO_COVERAGE
262		float distanceToPlane, distanceGradient;
263		float clipOpacity = 1.0;
264		#pragma unroll_loop_start
265		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
266			plane = clippingPlanes[ i ];
267			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
268			distanceGradient = fwidth( distanceToPlane ) / 2.0;
269			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
270			if ( clipOpacity == 0.0 ) discard;
271		}
272		#pragma unroll_loop_end
273		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
274			float unionClipOpacity = 1.0;
275			#pragma unroll_loop_start
276			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
277				plane = clippingPlanes[ i ];
278				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
279				distanceGradient = fwidth( distanceToPlane ) / 2.0;
280				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
281			}
282			#pragma unroll_loop_end
283			clipOpacity *= 1.0 - unionClipOpacity;
284		#endif
285		diffuseColor.a *= clipOpacity;
286		if ( diffuseColor.a == 0.0 ) discard;
287	#else
288		#pragma unroll_loop_start
289		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
290			plane = clippingPlanes[ i ];
291			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
292		}
293		#pragma unroll_loop_end
294		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
295			bool clipped = true;
296			#pragma unroll_loop_start
297			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
298				plane = clippingPlanes[ i ];
299				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
300			}
301			#pragma unroll_loop_end
302			if ( clipped ) discard;
303		#endif
304	#endif
305#endif`,sE=`#if NUM_CLIPPING_PLANES > 0
306	varying vec3 vClipPosition;
307	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
308#endif`,rE=`#if NUM_CLIPPING_PLANES > 0
309	varying vec3 vClipPosition;
310#endif`,oE=`#if NUM_CLIPPING_PLANES > 0
311	vClipPosition = - mvPosition.xyz;
312#endif`,aE=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
313	diffuseColor *= vColor;
314#endif`,lE=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
315	varying vec4 vColor;
316#endif`,uE=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
317	varying vec4 vColor;
318#endif`,cE=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
319	vColor = vec4( 1.0 );
320#endif
321#ifdef USE_COLOR_ALPHA
322	vColor *= color;
323#elif defined( USE_COLOR )
324	vColor.rgb *= color;
325#endif
326#ifdef USE_INSTANCING_COLOR
327	vColor.rgb *= instanceColor.rgb;
328#endif
329#ifdef USE_BATCHING_COLOR
330	vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
331#endif`,hE=`#define PI 3.141592653589793
332#define PI2 6.283185307179586
333#define PI_HALF 1.5707963267948966
334#define RECIPROCAL_PI 0.3183098861837907
335#define RECIPROCAL_PI2 0.15915494309189535
336#define EPSILON 1e-6
337#ifndef saturate
338#define saturate( a ) clamp( a, 0.0, 1.0 )
339#endif
340#define whiteComplement( a ) ( 1.0 - saturate( a ) )
341float pow2( const in float x ) { return x*x; }
342vec3 pow2( const in vec3 x ) { return x*x; }
343float pow3( const in float x ) { return x*x*x; }
344float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
345float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
346float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
347highp float rand( const in vec2 uv ) {
348	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
349	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
350	return fract( sin( sn ) * c );
351}
352#ifdef HIGH_PRECISION
353	float precisionSafeLength( vec3 v ) { return length( v ); }
354#else
355	float precisionSafeLength( vec3 v ) {
356		float maxComponent = max3( abs( v ) );
357		return length( v / maxComponent ) * maxComponent;
358	}
359#endif
360struct IncidentLight {
361	vec3 color;
362	vec3 direction;
363	bool visible;
364};
365struct ReflectedLight {
366	vec3 directDiffuse;
367	vec3 directSpecular;
368	vec3 indirectDiffuse;
369	vec3 indirectSpecular;
370};
371#ifdef USE_ALPHAHASH
372	varying vec3 vPosition;
373#endif
374vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
375	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
376}
377#define inverseTransformDirection transformDirectionByInverseViewMatrix
378vec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) {
379	return normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz );
380}
381vec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) {
382	return normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz );
383}
384bool isPerspectiveMatrix( mat4 m ) {
385	return m[ 2 ][ 3 ] == - 1.0;
386}
387vec2 equirectUv( in vec3 dir ) {
388	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
389	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
390	return vec2( u, v );
391}
392vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
393	return RECIPROCAL_PI * diffuseColor;
394}
395vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
396	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
397	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
398}
399float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
400	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
401	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
402} // validated`,fE=`#ifdef ENVMAP_TYPE_CUBE_UV
403	#define cubeUV_minMipLevel 4.0
404	#define cubeUV_minTileSize 16.0
405	float getFace( vec3 direction ) {
406		vec3 absDirection = abs( direction );
407		float face = - 1.0;
408		if ( absDirection.x > absDirection.z ) {
409			if ( absDirection.x > absDirection.y )
410				face = direction.x > 0.0 ? 0.0 : 3.0;
411			else
412				face = direction.y > 0.0 ? 1.0 : 4.0;
413		} else {
414			if ( absDirection.z > absDirection.y )
415				face = direction.z > 0.0 ? 2.0 : 5.0;
416			else
417				face = direction.y > 0.0 ? 1.0 : 4.0;
418		}
419		return face;
420	}
421	vec2 getUV( vec3 direction, float face ) {
422		vec2 uv;
423		if ( face == 0.0 ) {
424			uv = vec2( direction.z, direction.y ) / abs( direction.x );
425		} else if ( face == 1.0 ) {
426			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
427		} else if ( face == 2.0 ) {
428			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
429		} else if ( face == 3.0 ) {
430			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
431		} else if ( face == 4.0 ) {
432			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
433		} else {
434			uv = vec2( direction.x, direction.y ) / abs( direction.z );
435		}
436		return 0.5 * ( uv + 1.0 );
437	}
438	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
439		float face = getFace( direction );
440		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
441		mipInt = max( mipInt, cubeUV_minMipLevel );
442		float faceSize = exp2( mipInt );
443		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
444		if ( face > 2.0 ) {
445			uv.y += faceSize;
446			face -= 3.0;
447		}
448		uv.x += face * faceSize;
449		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
450		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
451		uv.x *= CUBEUV_TEXEL_WIDTH;
452		uv.y *= CUBEUV_TEXEL_HEIGHT;
453		#ifdef texture2DGradEXT
454			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
455		#else
456			return texture2D( envMap, uv ).rgb;
457		#endif
458	}
459	#define cubeUV_r0 1.0
460	#define cubeUV_m0 - 2.0
461	#define cubeUV_r1 0.8
462	#define cubeUV_m1 - 1.0
463	#define cubeUV_r4 0.4
464	#define cubeUV_m4 2.0
465	#define cubeUV_r5 0.305
466	#define cubeUV_m5 3.0
467	#define cubeUV_r6 0.21
468	#define cubeUV_m6 4.0
469	float roughnessToMip( float roughness ) {
470		float mip = 0.0;
471		if ( roughness >= cubeUV_r1 ) {
472			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
473		} else if ( roughness >= cubeUV_r4 ) {
474			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
475		} else if ( roughness >= cubeUV_r5 ) {
476			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
477		} else if ( roughness >= cubeUV_r6 ) {
478			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
479		} else {
480			mip = - 2.0 * log2( 1.16 * roughness );		}
481		return mip;
482	}
483	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
484		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
485		float mipF = fract( mip );
486		float mipInt = floor( mip );
487		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
488		if ( mipF == 0.0 ) {
489			return vec4( color0, 1.0 );
490		} else {
491			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
492			return vec4( mix( color0, color1, mipF ), 1.0 );
493		}
494	}
495#endif`,dE=`vec3 transformedNormal = objectNormal;
496#ifdef USE_TANGENT
497	vec3 transformedTangent = objectTangent;
498#endif
499#ifdef USE_BATCHING
500	mat3 bm = mat3( batchingMatrix );
501	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
502	transformedNormal = bm * transformedNormal;
503	#ifdef USE_TANGENT
504		transformedTangent = bm * transformedTangent;
505	#endif
506#endif
507#ifdef USE_INSTANCING
508	mat3 im = mat3( instanceMatrix );
509	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
510	transformedNormal = im * transformedNormal;
511	#ifdef USE_TANGENT
512		transformedTangent = im * transformedTangent;
513	#endif
514#endif
515transformedNormal = normalMatrix * transformedNormal;
516#ifdef FLIP_SIDED
517	transformedNormal = - transformedNormal;
518#endif
519#ifdef USE_TANGENT
520	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
521#endif`,pE=`#ifdef USE_DISPLACEMENTMAP
522	uniform sampler2D displacementMap;
523	uniform float displacementScale;
524	uniform float displacementBias;
525#endif`,mE=`#ifdef USE_DISPLACEMENTMAP
526	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
526placementBias );
527#endif`,gE=`#ifdef USE_EMISSIVEMAP
528	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
529	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
530		emissiveColor = sRGBTransferEOTF( emissiveColor );
531	#endif
532	totalEmissiveRadiance *= emissiveColor.rgb;
533#endif`,vE=`#ifdef USE_EMISSIVEMAP
534	uniform sampler2D emissiveMap;
535#endif`,_E="gl_FragColor = linearToOutputTexel( gl_FragColor );",xE=`vec4 LinearTransferOETF( in vec4 value ) {
536	return value;
537}
538vec4 sRGBTransferEOTF( in vec4 value ) {
539	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 );
540}
541vec4 sRGBTransferOETF( in vec4 value ) {
542	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 );
543}`,SE=`#ifdef USE_ENVMAP
544	#ifdef ENV_WORLDPOS
545		vec3 cameraToFrag;
546		if ( isOrthographic ) {
547			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
548		} else {
549			cameraToFrag = normalize( vWorldPosition - cameraPosition );
550		}
551		vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
552		#ifdef ENVMAP_MODE_REFLECTION
553			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
554		#else
555			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
556		#endif
557	#else
558		vec3 reflectVec = vReflect;
559	#endif
560	#ifdef ENVMAP_TYPE_CUBE
561		vec4 envColor = textureCube( envMap, envMapRotation * reflectVec );
562		#ifdef ENVMAP_BLENDING_MULTIPLY
563			outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
564		#elif defined( ENVMAP_BLENDING_MIX )
565			outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
566		#elif defined( ENVMAP_BLENDING_ADD )
567			outgoingLight += envColor.xyz * specularStrength * reflectivity;
568		#endif
569	#endif
570#endif`,yE=`#ifdef USE_ENVMAP
571	uniform float envMapIntensity;
572	uniform mat3 envMapRotation;
573	#ifdef ENVMAP_TYPE_CUBE
574		uniform samplerCube envMap;
575	#else
576		uniform sampler2D envMap;
577	#endif
578#endif`,ME=`#ifdef USE_ENVMAP
579	uniform float reflectivity;
580	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
581		#define ENV_WORLDPOS
582	#endif
583	#ifdef ENV_WORLDPOS
584		varying vec3 vWorldPosition;
585		uniform float refractionRatio;
586	#else
587		varying vec3 vReflect;
588	#endif
589#endif`,EE=`#ifdef USE_ENVMAP
590	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
591		#define ENV_WORLDPOS
592	#endif
593	#ifdef ENV_WORLDPOS
594		
595		varying vec3 vWorldPosition;
596	#else
597		varying vec3 vReflect;
598		uniform float refractionRatio;
599	#endif
600#endif`,wE=`#ifdef USE_ENVMAP
601	#ifdef ENV_WORLDPOS
602		vWorldPosition = worldPosition.xyz;
603	#else
604		vec3 cameraToVertex;
605		if ( isOrthographic ) {
606			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
607		} else {
608			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
609		}
610		vec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
611		#ifdef ENVMAP_MODE_REFLECTION
612			vReflect = reflect( cameraToVertex, worldNormal );
613		#else
614			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
615		#endif
616	#endif
617#endif`,bE=`#ifdef USE_FOG
618	vFogDepth = - mvPosition.z;
619#endif`,TE=`#ifdef USE_FOG
620	varying float vFogDepth;
621#endif`,CE=`#ifdef USE_FOG
622	#ifdef FOG_EXP2
623		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
624	#else
625		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
626	#endif
627	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
628#endif`,AE=`#ifdef USE_FOG
629	uniform vec3 fogColor;
630	varying float vFogDepth;
631	#ifdef FOG_EXP2
632		uniform float fogDensity;
633	#else
634		uniform float fogNear;
635		uniform float fogFar;
636	#endif
637#endif`,RE=`#ifdef USE_GRADIENTMAP
638	uniform sampler2D gradientMap;
639#endif
640vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
641	float dotNL = dot( normal, lightDirection );
642	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
643	#ifdef USE_GRADIENTMAP
644		return vec3( texture2D( gradientMap, coord ).r );
645	#else
646		vec2 fw = fwidth( coord ) * 0.5;
647		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
648	#endif
649}`,PE=`#ifdef USE_LIGHTMAP
650	uniform sampler2D lightMap;
651	uniform float lightMapIntensity;
652#endif`,NE=`LambertMaterial material;
653material.diffuseColor = diffuseColor.rgb;
654material.specularStrength = specularStrength;`,LE=`varying vec3 vViewPosition;
655struct LambertMaterial {
656	vec3 diffuseColor;
657	float specularStrength;
658};
659void 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 ) {
660	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
661	vec3 irradiance = dotNL * directLight.color;
662	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
663}
664void 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 ) {
665	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
666}
667#define RE_Direct				RE_Direct_Lambert
668#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,DE=`uniform bool receiveShadow;
669uniform vec3 ambientLightColor;
670#if defined( USE_LIGHT_PROBES )
671	uniform vec3 lightProbe[ 9 ];
672#endif
673vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
674	float x = normal.x, y = normal.y, z = normal.z;
675	vec3 result = shCoefficients[ 0 ] * 0.886227;
676	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
677	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
678	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
679	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
680	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
681	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
682	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
683	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
684	return result;
685}
686vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
687	vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
688	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
689	return irradiance;
690}
691vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
692	vec3 irradiance = ambientLightColor;
693	return irradiance;
694}
695float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
696	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
697	if ( cutoffDistance > 0.0 ) {
698		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
699	}
700	return distanceFalloff;
701}
702float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
703	return smoothstep( coneCosine, penumbraCosine, angleCosine );
704}
705#if NUM_DIR_LIGHTS > 0
706	struct DirectionalLight {
707		vec3 direction;
708		vec3 color;
709	};
710	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
711	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
712		light.color = directionalLight.color;
713		light.direction = directionalLight.direction;
714		light.visible = true;
715	}
716#endif
717#if NUM_POINT_LIGHTS > 0
718	struct PointLight {
719		vec3 position;
720		vec3 color;
721		float distance;
722		float decay;
723	};
724	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
725	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
726		vec3 lVector = pointLight.position - geometryPosition;
727		light.direction = normalize( lVector );
728		float lightDistance = length( lVector );
729		light.color = pointLight.color;
730		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
731		light.visible = ( light.color != vec3( 0.0 ) );
732	}
733#endif
734#if NUM_SPOT_LIGHTS > 0
735	struct SpotLight {
736		vec3 position;
737		vec3 direction;
738		vec3 color;
739		float distance;
740		float decay;
741		float coneCos;
742		float penumbraCos;
743	};
744	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
745	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
746		vec3 lVector = spotLight.position - geometryPosition;
747		light.direction = normalize( lVector );
748		float angleCos = dot( light.direction, spotLight.direction );
749		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
750		if ( spotAttenuation > 0.0 ) {
751			float lightDistance = length( lVector );
752			light.color = spotLight.color * spotAttenuation;
753			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
754			light.visible = ( light.color != vec3( 0.0 ) );
755		} else {
756			light.color = vec3( 0.0 );
757			light.visible = false;
758		}
759	}
760#endif
761#if NUM_RECT_AREA_LIGHTS > 0
762	struct RectAreaLight {
763		vec3 color;
764		vec3 position;
765		vec3 halfWidth;
766		vec3 halfHeight;
767	};
768	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
769	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
770#endif
771#if NUM_HEMI_LIGHTS > 0
772	struct HemisphereLight {
773		vec3 direction;
774		vec3 skyColor;
775		vec3 groundColor;
776	};
777	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
778	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
779		float dotNL = dot( normal, hemiLight.direction );
780		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
781		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
782		return irradiance;
783	}
784#endif
785#include <lightprobes_pars_fragment>`,IE=`#ifdef USE_ENVMAP
786	vec3 getIBLIrradiance( const in vec3 normal ) {
787		#ifdef ENVMAP_TYPE_CUBE_UV
788			vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
789			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
790			return PI * envMapColor.rgb * envMapIntensity;
791		#else
792			return vec3( 0.0 );
793		#endif
794	}
795	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
796		#ifdef ENVMAP_TYPE_CUBE_UV
797			vec3 reflectVec = reflect( - viewDir, normal );
798			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
799			reflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix );
800			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
801			return envMapColor.rgb * envMapIntensity;
802		#else
803			return vec3( 0.0 );
804		#endif
805	}
806	#ifdef USE_ANISOTROPY
807		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
808			#ifdef ENVMAP_TYPE_CUBE_UV
809				vec3 bentNormal = cross( bitangent, viewDir );
810				bentNormal = normalize( cross( bentNormal, bitangent ) );
811				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
812				return getIBLRadiance( viewDir, bentNormal, roughness );
813			#else
814				return vec3( 0.0 );
815			#endif
816		}
817	#endif
818#endif`,UE=`ToonMaterial material;
819material.diffuseColor = diffuseColor.rgb;`,FE=`varying vec3 vViewPosition;
820struct ToonMaterial {
821	vec3 diffuseColor;
822};
823void 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 ) {
824	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
825	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
826}
827void 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 ) {
828	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
829}
830#define RE_Direct				RE_Direct_Toon
831#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,OE=`BlinnPhongMaterial material;
832material.diffuseColor = diffuseColor.rgb;
833material.specularColor = specular;
834material.specularShininess = shininess;
835material.specularStrength = specularStrength;`,kE=`varying vec3 vViewPosition;
836struct BlinnPhongMaterial {
837	vec3 diffuseColor;
838	vec3 specularColor;
839	float specularShininess;
840	float specularStrength;
841};
842void 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 ) {
843	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
844	vec3 irradiance = dotNL * directLight.color;
845	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
846	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
847}
848void 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 ) {
849	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
850}
851#define RE_Direct				RE_Direct_BlinnPhong
852#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,BE=`PhysicalMaterial material;
853material.diffuseColor = diffuseColor.rgb;
854material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
855material.metalness = metalnessFactor;
856vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
857float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
858material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
859material.roughness = min( material.roughness, 1.0 );
860#ifdef IOR
861	material.ior = ior;
862	#ifdef USE_SPECULAR
863		float specularIntensityFactor = specularIntensity;
864		vec3 specularColorFactor = specularColor;
865		#ifdef USE_SPECULAR_COLORMAP
866			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
867		#endif
868		#ifdef USE_SPECULAR_INTENSITYMAP
869			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
870		#endif
871		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
872	#else
873		float specularIntensityFactor = 1.0;
874		vec3 specularColorFactor = vec3( 1.0 );
875		material.specularF90 = 1.0;
876	#endif
877	material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
878	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
879#else
880	material.specularColor = vec3( 0.04 );
881	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
882	material.specularF90 = 1.0;
883#endif
884#ifdef USE_CLEARCOAT
885	material.clearcoat = clearcoat;
886	material.clearcoatRoughness = clearcoatRoughness;
887	material.clearcoatF0 = vec3( 0.04 );
888	material.clearcoatF90 = 1.0;
889	#ifdef USE_CLEARCOATMAP
890		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
891	#endif
892	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
893		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
894	#endif
895	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
896	material.clearcoatRoughness += geometryRoughness;
897	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
898#endif
899#ifdef USE_DISPERSION
900	material.dispersion = dispersion;
901#endif
902#ifdef USE_IRIDESCENCE
903	material.iridescence = iridescence;
904	material.iridescenceIOR = iridescenceIOR;
905	#ifdef USE_IRIDESCENCEMAP
906		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
907	#endif
908	#ifdef USE_IRIDESCENCE_THICKNESSMAP
909		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
910	#else
911		material.iridescenceThickness = iridescenceThicknessMaximum;
912	#endif
913#endif
914#ifdef USE_SHEEN
915	material.sheenColor = sheenColor;
916	#ifdef USE_SHEEN_COLORMAP
917		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
918	#endif
919	material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
920	#ifdef USE_SHEEN_ROUGHNESSMAP
921		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
922	#endif
923#endif
924#ifdef USE_ANISOTROPY
925	#ifdef USE_ANISOTROPYMAP
926		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
927		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
928		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
929	#else
930		vec2 anisotropyV = anisotropyVector;
931	#endif
932	material.anisotropy = length( anisotropyV );
933	if( material.anisotropy == 0.0 ) {
934		anisotropyV = vec2( 1.0, 0.0 );
935	} else {
936		anisotropyV /= material.anisotropy;
937		material.anisotropy = saturate( material.anisotropy );
938	}
939	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
940	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
941	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
942#endif`,zE=`uniform sampler2D dfgLUT;
943struct PhysicalMaterial {
944	vec3 diffuseColor;
945	vec3 diffuseContribution;
946	vec3 specularColor;
947	vec3 specularColorBlended;
948	float roughness;
949	float metalness;
950	float specularF90;
951	float dispersion;
952	#ifdef USE_CLEARCOAT
953		float clearcoat;
954		float clearcoatRoughness;
955		vec3 clearcoatF0;
956		float clearcoatF90;
957	#endif
958	#ifdef USE_IRIDESCENCE
959		float iridescence;
960		float iridescenceIOR;
961		float iridescenceThickness;
962		vec3 iridescenceFresnel;
963		vec3 iridescenceF0;
964		vec3 iridescenceFresnelDielectric;
965		vec3 iridescenceFresnelMetallic;
966	#endif
967	#ifdef USE_SHEEN
968		vec3 sheenColor;
969		float sheenRoughness;
970	#endif
971	#ifdef IOR
972		float ior;
973	#endif
974	#ifdef USE_TRANSMISSION
975		float transmission;
976		float transmissionAlpha;
977		float thickness;
978		float attenuationDistance;
979		vec3 attenuationColor;
980	#endif
981	#ifdef USE_ANISOTROPY
982		float anisotropy;
983		float alphaT;
984		vec3 anisotropyT;
985		vec3 anisotropyB;
986	#endif
987};
988vec3 clearcoatSpecularDirect = vec3( 0.0 );
989vec3 clearcoatSpecularIndirect = vec3( 0.0 );
990vec3 sheenSpecularDirect = vec3( 0.0 );
991vec3 sheenSpecularIndirect = vec3(0.0 );
992vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
993    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
994    float x2 = x * x;
995    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
996    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
997}
998float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
999	float a2 = pow2( alpha );
1000	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
1001	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
1002	return 0.5 / max( gv + gl, EPSILON );
1003}
1004float D_GGX( const in float alpha, const in float dotNH ) {
1005	float a2 = pow2( alpha );
1006	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
1007	return RECIPROCAL_PI * a2 / pow2( denom );
1008}
1009#ifdef USE_ANISOTROPY
1010	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 ) {
1011		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
1012		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
1013		return 0.5 / max( gv + gl, EPSILON )
vendor: 7,372 bytes, lines 1013-1172
1013;
1014	}
1015	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
1016		float a2 = alphaT * alphaB;
1017		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
1018		highp float v2 = dot( v, v );
1019		float w2 = a2 / v2;
1020		return RECIPROCAL_PI * a2 * pow2 ( w2 );
1021	}
1022#endif
1023#ifdef USE_CLEARCOAT
1024	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
1025		vec3 f0 = material.clearcoatF0;
1026		float f90 = material.clearcoatF90;
1027		float roughness = material.clearcoatRoughness;
1028		float alpha = pow2( roughness );
1029		vec3 halfDir = normalize( lightDir + viewDir );
1030		float dotNL = saturate( dot( normal, lightDir ) );
1031		float dotNV = saturate( dot( normal, viewDir ) );
1032		float dotNH = saturate( dot( normal, halfDir ) );
1033		float dotVH = saturate( dot( viewDir, halfDir ) );
1034		vec3 F = F_Schlick( f0, f90, dotVH );
1035		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1036		float D = D_GGX( alpha, dotNH );
1037		return F * ( V * D );
1038	}
1039#endif
1040vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1041	vec3 f0 = material.specularColorBlended;
1042	float f90 = material.specularF90;
1043	float roughness = material.roughness;
1044	float alpha = pow2( roughness );
1045	vec3 halfDir = normalize( lightDir + viewDir );
1046	float dotNL = saturate( dot( normal, lightDir ) );
1047	float dotNV = saturate( dot( normal, viewDir ) );
1048	float dotNH = saturate( dot( normal, halfDir ) );
1049	float dotVH = saturate( dot( viewDir, halfDir ) );
1050	vec3 F = F_Schlick( f0, f90, dotVH );
1051	#ifdef USE_IRIDESCENCE
1052		F = mix( F, material.iridescenceFresnel, material.iridescence );
1053	#endif
1054	#ifdef USE_ANISOTROPY
1055		float dotTL = dot( material.anisotropyT, lightDir );
1056		float dotTV = dot( material.anisotropyT, viewDir );
1057		float dotTH = dot( material.anisotropyT, halfDir );
1058		float dotBL = dot( material.anisotropyB, lightDir );
1059		float dotBV = dot( material.anisotropyB, viewDir );
1060		float dotBH = dot( material.anisotropyB, halfDir );
1061		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1062		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1063	#else
1064		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1065		float D = D_GGX( alpha, dotNH );
1066	#endif
1067	return F * ( V * D );
1068}
1069vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1070	const float LUT_SIZE = 64.0;
1071	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1072	const float LUT_BIAS = 0.5 / LUT_SIZE;
1073	float dotNV = saturate( dot( N, V ) );
1074	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1075	uv = uv * LUT_SCALE + LUT_BIAS;
1076	return uv;
1077}
1078float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1079	float l = length( f );
1080	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1081}
1082vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1083	float x = dot( v1, v2 );
1084	float y = abs( x );
1085	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1086	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1087	float v = a / b;
1088	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1089	return cross( v1, v2 ) * theta_sintheta;
1090}
1091vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1092	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1093	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1094	vec3 lightNormal = cross( v1, v2 );
1095	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1096	vec3 T1, T2;
1097	T1 = normalize( V - N * dot( V, N ) );
1098	T2 = - cross( N, T1 );
1099	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
1100	vec3 coords[ 4 ];
1101	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1102	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1103	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1104	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1105	coords[ 0 ] = normalize( coords[ 0 ] );
1106	coords[ 1 ] = normalize( coords[ 1 ] );
1107	coords[ 2 ] = normalize( coords[ 2 ] );
1108	coords[ 3 ] = normalize( coords[ 3 ] );
1109	vec3 vectorFormFactor = vec3( 0.0 );
1110	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1111	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1112	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1113	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1114	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1115	return vec3( result );
1116}
1117#if defined( USE_SHEEN )
1118float D_Charlie( float roughness, float dotNH ) {
1119	float alpha = pow2( roughness );
1120	float invAlpha = 1.0 / alpha;
1121	float cos2h = dotNH * dotNH;
1122	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1123	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1124}
1125float V_Neubelt( float dotNV, float dotNL ) {
1126	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1127}
1128vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1129	vec3 halfDir = normalize( lightDir + viewDir );
1130	float dotNL = saturate( dot( normal, lightDir ) );
1131	float dotNV = saturate( dot( normal, viewDir ) );
1132	float dotNH = saturate( dot( normal, halfDir ) );
1133	float D = D_Charlie( sheenRoughness, dotNH );
1134	float V = V_Neubelt( dotNV, dotNL );
1135	return sheenColor * ( D * V );
1136}
1137#endif
1138float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1139	float dotNV = saturate( dot( normal, viewDir ) );
1140	float r2 = roughness * roughness;
1141	float rInv = 1.0 / ( roughness + 0.1 );
1142	float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
1143	float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
1144	float DG = exp( a * dotNV + b );
1145	return saturate( DG );
1146}
1147vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1148	float dotNV = saturate( dot( normal, viewDir ) );
1149	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1150	return specularColor * fab.x + specularF90 * fab.y;
1151}
1152#ifdef USE_IRIDESCENCE
1153void 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 ) {
1154#else
1155void 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 ) {
1156#endif
1157	float dotNV = saturate( dot( normal, viewDir ) );
1158	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1159	#ifdef USE_IRIDESCENCE
1160		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1161	#else
1162		vec3 Fr = specularColor;
1163	#endif
1164	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1165	float Ess = fab.x + fab.y;
1166	float Ems = 1.0 - Ess;
1167	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1168	singleScatter += FssEss;
1169	multiScatter += Fms * Ems;
1170}
1171vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1172	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 1173-1302
1173	float dotNL = saturate( dot( normal, lightDir ) );
1174	float dotNV = saturate( dot( normal, viewDir ) );
1175	vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
1176	vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
1177	vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
1178	vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
1179	float Ess_V = dfgV.x + dfgV.y;
1180	float Ess_L = dfgL.x + dfgL.y;
1181	float Ems_V = 1.0 - Ess_V;
1182	float Ems_L = 1.0 - Ess_L;
1183	vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
1184	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
1185	float compensationFactor = Ems_V * Ems_L;
1186	vec3 multiScatter = Fms * compensationFactor;
1187	return singleScatter + multiScatter;
1188}
1189#if NUM_RECT_AREA_LIGHTS > 0
1190	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 ) {
1191		vec3 normal = geometryNormal;
1192		vec3 viewDir = geometryViewDir;
1193		vec3 position = geometryPosition;
1194		vec3 lightPos = rectAreaLight.position;
1195		vec3 halfWidth = rectAreaLight.halfWidth;
1196		vec3 halfHeight = rectAreaLight.halfHeight;
1197		vec3 lightColor = rectAreaLight.color;
1198		float roughness = material.roughness;
1199		vec3 rectCoords[ 4 ];
1200		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1201		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1202		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1203		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1204		vec4 t1 = texture2D( ltc_1, uv );
1205		vec4 t2 = texture2D( ltc_2, uv );
1206		mat3 mInv = mat3(
1207			vec3( t1.x, 0, t1.y ),
1208			vec3(    0, 1,    0 ),
1209			vec3( t1.z, 0, t1.w )
1210		);
1211		vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );
1212		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1213		reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1214		#ifdef USE_CLEARCOAT
1215			vec3 Ncc = geometryClearcoatNormal;
1216			vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );
1217			vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );
1218			vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );
1219			mat3 mInvClearcoat = mat3(
1220				vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),
1221				vec3(             0, 1,             0 ),
1222				vec3( t1Clearcoat.z, 0, t1Clearcoat.w )
1223			);
1224			vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;
1225			clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );
1226		#endif
1227	}
1228#endif
1229void 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 ) {
1230	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1231	vec3 irradiance = dotNL * directLight.color;
1232	#ifdef USE_CLEARCOAT
1233		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1234		vec3 ccIrradiance = dotNLcc * directLight.color;
1235		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1236	#endif
1237	#ifdef USE_SHEEN
1238 
1239 		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1240 
1241 		float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1242 		float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
1243 
1244 		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
1245 
1246 		irradiance *= sheenEnergyComp;
1247 
1248 	#endif
1249	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
1250	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
1251}
1252void 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 ) {
1253	vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
1254	#ifdef USE_SHEEN
1255		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1256		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1257		diffuse *= sheenEnergyComp;
1258	#endif
1259	reflectedLight.indirectDiffuse += diffuse;
1260}
1261void 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) {
1262	#ifdef USE_CLEARCOAT
1263		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1264	#endif
1265	#ifdef USE_SHEEN
1266		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
1267 	#endif
1268	vec3 singleScatteringDielectric = vec3( 0.0 );
1269	vec3 multiScatteringDielectric = vec3( 0.0 );
1270	vec3 singleScatteringMetallic = vec3( 0.0 );
1271	vec3 multiScatteringMetallic = vec3( 0.0 );
1272	#ifdef USE_IRIDESCENCE
1273		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1274		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1275	#else
1276		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1277		computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1278	#endif
1279	vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
1280	vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
1281	vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
1282	vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
1283	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1284	vec3 indirectSpecular = radiance * singleScattering;
1285	indirectSpecular += multiScattering * cosineWeightedIrradiance;
1286	vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
1287	#ifdef USE_SHEEN
1288		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1289		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1290		indirectSpecular *= sheenEnergyComp;
1291		indirectDiffuse *= sheenEnergyComp;
1292	#endif
1293	reflectedLight.indirectSpecular += indirectSpecular;
1294	reflectedLight.indirectDiffuse += indirectDiffuse;
1295}
1296#define RE_Direct				RE_Direct_Physical
1297#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1298#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1299#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1300float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1301	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1302}`,
1302VE=`
1303vec3 geometryPosition = - vViewPosition;
1304vec3 geometryNormal = normal;
1305vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1306vec3 geometryClearcoatNormal = vec3( 0.0 );
1307#ifdef USE_CLEARCOAT
1308	geometryClearcoatNormal = clearcoatNormal;
1309#endif
1310#ifdef USE_IRIDESCENCE
1311	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1312	if ( material.iridescenceThickness == 0.0 ) {
1313		material.iridescence = 0.0;
1314	} else {
1315		material.iridescence = saturate( material.iridescence );
1316	}
1317	if ( material.iridescence > 0.0 ) {
1318		material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1319		material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
1320		material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
1321		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1322	}
1323#endif
1324IncidentLight directLight;
1325#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1326	PointLight pointLight;
1327	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1328	PointLightShadow pointLightShadow;
1329	#endif
1330	#pragma unroll_loop_start
1331	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1332		pointLight = pointLights[ i ];
1333		getPointLightInfo( pointLight, geometryPosition, directLight );
1334		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
1335		pointLightShadow = pointLightShadows[ i ];
1336		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1337		#endif
1338		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1339	}
1340	#pragma unroll_loop_end
1341#endif
1342#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1343	SpotLight spotLight;
1344	vec4 spotColor;
1345	vec3 spotLightCoord;
1346	bool inSpotLightMap;
1347	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1348	SpotLightShadow spotLightShadow;
1349	#endif
1350	#pragma unroll_loop_start
1351	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1352		spotLight = spotLights[ i ];
1353		getSpotLightInfo( spotLight, geometryPosition, directLight );
1354		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1355		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1356		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1357		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1358		#else
1359		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1360		#endif
1361		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1362			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1363			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1364			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1365			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1366		#endif
1367		#undef SPOT_LIGHT_MAP_INDEX
1368		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1369		spotLightShadow = spotLightShadows[ i ];
1370		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1371		#endif
1372		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1373	}
1374	#pragma unroll_loop_end
1375#endif
1376#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1377	DirectionalLight directionalLight;
1378	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1379	DirectionalLightShadow directionalLightShadow;
1380	#endif
1381	#pragma unroll_loop_start
1382	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1383		directionalLight = directionalLights[ i ];
1384		getDirectionalLightInfo( directionalLight, directLight );
1385		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1386		directionalLightShadow = directionalLightShadows[ i ];
1387		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1388		#endif
1389		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1390	}
1391	#pragma unroll_loop_end
1392#endif
1393#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1394	RectAreaLight rectAreaLight;
1395	#pragma unroll_loop_start
1396	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1397		rectAreaLight = rectAreaLights[ i ];
1398		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1399	}
1400	#pragma unroll_loop_end
1401#endif
1402#if defined( RE_IndirectDiffuse )
1403	vec3 iblIrradiance = vec3( 0.0 );
1404	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1405	#if defined( USE_LIGHT_PROBES )
1406		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1407	#endif
1408	#if ( NUM_HEMI_LIGHTS > 0 )
1409		#pragma unroll_loop_start
1410		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1411			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1412		}
1413		#pragma unroll_loop_end
1414	#endif
1415	#ifdef USE_LIGHT_PROBES_GRID
1416		vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;
1417		vec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix );
1418		irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );
1419	#endif
1420#endif
1421#if defined( RE_IndirectSpecular )
1422	vec3 radiance = vec3( 0.0 );
1423	vec3 clearcoatRadiance = vec3( 0.0 );
1424#endif`,HE=`#if defined( RE_IndirectDiffuse )
1425	#ifdef USE_LIGHTMAP
1426		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1427		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1428		irradiance += lightMapIrradiance;
1429	#endif
1430	#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )
1431		#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )
1432			iblIrradiance += getIBLIrradiance( geometryNormal );
1433		#endif
1434	#endif
1435#endif
1436#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1437	#ifdef USE_ANISOTROPY
1438		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1439	#else
1440		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1441	#endif
1442	#ifdef USE_CLEARCOAT
1443		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1444	#endif
1445#endif`,GE=`#if defined( RE_IndirectDiffuse )
1446	#if defined( LAMBERT ) || defined( PHONG )
1447		irradiance += iblIrradiance;
1448	#endif
1449	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1450#endif
1451#if defined( RE_IndirectSpecular )
1452	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1453#endif`,WE=`#ifdef USE_LIGHT_PROBES_GRID
1454uniform highp sampler3D probesSH;
1455uniform vec3 probesMin;
1456uniform vec3 probesMax;
1457uniform vec3 probesResolution;
1458vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1459	vec3 res = probesResolution;
1460	vec3 gridRange = probesMax - probesMin;
1461	vec3 resMinusOne = res - 1.0;
1462	vec3 probeSpacing = gridRange / resMinusOne;
1463	vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;
1464	vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );
1465	uvw = uvw * resMinusOne / res + 0.5 / res;
1466	float nz          = res.z;
1467	float paddedSlices = nz + 2.0;
1468	float atlasDepth  = 7.0 * paddedSlices;
1469	float uvZBase     = uvw.z * nz + 1.0;
1470	vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase                       ) / atlasDepth ) );
1471	vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase +       paddedSlices   ) / atlasDepth ) );
1472	vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices   ) / atlasDepth ) );
1473	vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices   ) / atlasDepth ) );
1474	vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices   ) / atlasDepth ) );
1475	vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices   ) / atlasDepth ) );
1476	vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices   ) / atlasDepth ) );
1477	vec3 c0 = s0.xyz;
1478	vec3 c1 = vec3( s0.w, s1.xy );
1479	vec3 c2 = vec3( s1.zw, s2.x );
1480	vec3 c3 = s2.yzw;
1481	vec3 c4 = s3.xyz;
1482	vec3 c5 = vec3( s3.w, s4.xy );
1483	vec3 c6 = vec3( s4.zw, s5.x );
1484	vec3 c7 = s5.yzw;
1485	vec3 c8 = s6.xyz;
1486	float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;
1487	vec3 result = c0 * 0.886227;
1488	result += c1 * 2.0 * 0.511664 * y;
1489	result += c2 * 2.0 * 0.511664 * z;
1490	result += c3 * 2.0 * 0.511664 * x;
1491	result += c4 * 2.0 * 0.429043 * x * y;
1492	result += c5 * 2.0 * 0.429043 * y * z;
1493	result += c6 * ( 0.743125 * z * z - 0.247708 );
1494	result += c7 * 2.0 * 0.429043 * x * z;
1495	result += c8 * 0.429043 * ( x * x - y * y );
1496	return max( result, vec3( 0.0 ) );
1497}
1498#endif`,XE=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1499	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1500#endif`,$E=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1501	uniform float logDepthBufFC;
1502	varying float vFragDepth;
1503	varying float vIsPerspective;
1504#endif`,qE=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1505	varying float vFragDepth;
1506	varying float vIsPerspective;
1507#endif`,YE=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1508	vFragDepth = 1.0 + gl_Position.w;
1509	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1510#endif`,KE=`#ifdef USE_MAP
1511	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1512	#ifdef DECODE_VIDEO_TEXTURE
1513		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1514	#endif
1515	diffuseColor *= sampledDiffuseColor;
1516#endif`,jE=`#ifdef USE_MAP
1517	uniform sampler2D map;
1518#endif`,QE=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1519	#if defined( USE_POINTS_UV )
1520		vec2 uv = vUv;
1521	#else
1522		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1523	#endif
1524#endif
1525#ifdef USE_MAP
1526	diffuseColor *= texture2D( map, uv );
1527#endif
1528#ifdef USE_ALPHAMAP
1529	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1530#endif`,ZE=`#if defined( USE_POINTS_UV )
1531	varying vec2 vUv;
1532#else
1533	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1534		uniform mat3 uvTransform;
1535	#endif
1536#endif
1537#ifdef USE_MAP
1538	uniform sampler2D map;
1539#endif
1540#ifdef USE_ALPHAMAP
1541	uniform sampler2D alphaMap;
1542#endif`,JE=`float metalnessFactor = metalness;
1543#ifdef USE_METALNESSMAP
1544	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1545	metalnessFactor *= texelMetalness.b;
1546#endif`,ew=`#ifdef USE_METALNESSMAP
1547	uniform sampler2D metalnessMap;
1548#endif`,tw=`#ifdef USE_INSTANCING_MORPH
1549	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1550	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1551	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1552		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1553	}
1554#endif`,nw=`#if defined( USE_MORPHCOLORS )
1555	vColor *= morphTargetBaseInfluence;
1556	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1557		#if defined( USE_COLOR_ALPHA )
1558			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1559		#elif defined( USE_COLOR )
1560			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1561		#endif
1562	}
1563#endif`,iw=`#ifdef USE_MORPHNORMALS
1564	objectNormal *= morphTargetBaseInfluence;
1565	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1566		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1567	}
1568#endif`,sw=`#ifdef USE_MORPHTARGETS
1569	#ifndef USE_INSTANCING_MORPH
1570		uniform float morphTargetBaseInfluence;
1571		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1572	#endif
1573	uniform sampler2DArray morphTargetsTexture;
1574	uniform ivec2 morphTargetsTextureSize;
1575	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1576		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1577		int y = texelIndex / morphTargetsTextureSize.x;
1578		int x = texelIndex - y * morphTargetsTextureSize.x;
1579		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1580		return texelFetch( morphTargetsTexture, morphUV, 0 );
1581	}
1582#endif`,rw=`#ifdef USE_MORPHTARGETS
1583	transformed *= morphTargetBaseInfluence;
1584	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1585		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1586	}
1587#endif`,ow=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1588#ifdef FLAT_SHADED
1589	vec3 fdx = dFdx( vViewPosition );
1590	vec3 fdy = dFdy( vViewPosition );
1591	vec3 normal = normalize( cross( fdx, fdy ) );
1592#else
1593	vec3 normal = normalize( vNormal );
1594	#ifdef DOUBLE_SIDED
1595		normal *= faceDirection;
1596	#endif
1597#endif
1598#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1599	#ifdef USE_TANGENT
1600		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1601	#else
1602		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1603		#if defined( USE_NORMALMAP )
1604			vNormalMapUv
1605		#elif defined( USE_CLEARCOAT_NORMALMAP )
1606			vClearcoatNormalMapUv
1607		#else
1608			vUv
1609		#endif
1610		);
1611	#endif
1612	#ifdef DOUBLE_SIDED
1613		tbn[0] *= faceDirection;
1614		tbn[1] *= faceDirection;
1615	#endif
1616#endif
1617#ifdef USE_CLEARCOAT_NORMALMAP
1618	#ifdef USE_TANGENT
1619		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1620	#else
1621		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1622	#endif
1623	#ifdef DOUBLE_SIDED
1624		tbn2[0] *= faceDirection;
1625		tbn2[1] *= faceDirection;
1626	#endif
1627#endif
1628vec3 nonPerturbedNormal = normal;`,aw=`#ifdef USE_NORMALMAP_OBJECTSPACE
1629	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1630	#ifdef FLIP_SIDED
1631		normal = - normal;
1632	#endif
1633	#ifdef DOUBLE_SIDED
1634		normal = normal * faceDirection;
1635	#endif
1636	normal = normalize( normalMatrix * normal );
1637#elif defined( USE_NORMALMAP_TANGENTSPACE )
1638	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1639	#if defined( USE_PACKED_NORMALMAP )
1640		mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );
1641	#endif
1642	mapN.xy *= normalScale;
1643	normal = normalize( tbn * mapN );
1644#elif defined( USE_BUMPMAP )
1645	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1646#endif`,lw=`#ifndef FLAT_SHADED
1647	varying vec3 vNormal;
1648	#ifdef USE_TANGENT
1649		varying vec3 vTangent;
1650		varying vec3 vBitangent;
1651	#endif
1652#endif`,uw=`#ifndef FLAT_SHADED
1653	varying vec3 vNormal;
1654	#ifdef USE_TANGENT
1655		varying vec3 vTangent;
1656		varying vec3 vBitangent;
1657	#endif
1658#endif`,cw=`#ifndef FLAT_SHADED
1659	vNormal = normalize( transformedNormal );
1660	#ifdef USE_TANGENT
1661		vTangent = normalize( transformedTangent );
1662		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1663		#ifdef FLIP_SIDED
1664			vBitangent = - vBitangent;
1665		#endif
1666	#endif
1667#endif`,hw=`#ifdef USE_NORMALMAP
1668	uniform sampler2D normalMap;
1669	uniform vec2 normalScale;
1670#endif
1671#ifdef USE_NORMALMAP_OBJECTSPACE
1672	uniform mat3 normalMatrix;
1673#endif
1674#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1675	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1676		vec3 q0 = dFdx( eye_pos.xyz );
1677		vec3 q1 = dFdy( eye_pos.xyz );
1678		vec2 st0 = dFdx( uv.st );
1679		vec2 st1 = dFdy( uv.st );
1680		vec3 N = surf_norm;
1681		vec3 q1perp = cross( q1, N );
1682		vec3 q0perp = cross( N, q0 );
1683		vec3 T = q1perp * st0.x + q0perp * st1.x;
1684		vec3 B = q1perp * st0.y + q0perp * st1.y;
1685		float det = max( dot( T, T ), dot( B, B ) );
1686		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1687		return mat3( T * scale, B * scale, N );
1688	}
1689#endif`,fw=`#ifdef USE_CLEARCOAT
1690	vec3 clearcoatNormal = nonPerturbedNormal;
1691#endif`,dw=`#ifdef USE_CLEARCOAT_NORMALMAP
1692	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1693	clearcoatMapN.xy *= clearcoatNormalScale;
1694	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1695#endif`,pw=`#ifdef USE_CLEARCOATMAP
1696	uniform sampler2D clearcoatMap;
1697#endif
1698#ifdef USE_CLEARCOAT_NORMALMAP
1699	uniform sampler2D clearcoatNormalMap;
1700	uniform vec2 clearcoatNormalScale;
1701#endif
1702#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1703	uniform sampler2D clearcoatRoughnessMap;
1704#endif`,mw=`#ifdef USE_IRIDESCENCEMAP
1705	uniform sampler2D iridescenceMap;
1706#endif
1707#ifdef USE_IRIDESCENCE_THICKNESSMAP
1708	uniform sampler2D iridescenceThicknessMap;
1709#endif`,gw=`#ifdef OPAQUE
1710diffuseColor.a = 1.0;
1711#endif
1712#ifdef USE_TRANSMISSION
1713diffuseColor.a *= material.transmissionAlpha;
1714#endif
1715gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,vw=`vec3 packNormalToRGB( const in vec3 normal ) {
1716	return normalize( normal ) * 0.5 + 0.5;
1717}
1718vec3 unpackRGBToNormal( const in vec3 rgb ) {
1719	return 2.0 * rgb.xyz - 1.0;
1720}
1721const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1722const float Inv255 = 1. / 255.;
1723const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1724const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1725const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1726const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1727vec4 packDepthToRGBA( const in float v ) {
1728	if( v <= 0.0 )
1729		return vec4( 0., 0., 0., 0. );
1730	if( v >= 1.0 )
1731		return vec4( 1., 1., 1., 1. );
1732	float vuf;
1733	float af = modf( v * PackFactors.a, vuf );
1734	float bf = modf( vuf * ShiftRight8, vuf );
1735	float gf = modf( vuf * ShiftRight8, vuf );
1736	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
1737}
1738vec3 packDepthToRGB( const in float v ) {
1739	if( v <= 0.0 )
1740		return vec3( 0., 0., 0. );
1741	if( v >= 1.0 )
1742		return vec3( 1., 1., 1. );
1743	float vuf;
1744	float bf = modf( v * PackFactors.b, vuf );
1745	float gf = modf( vuf * ShiftRight8, vuf );
1746	return vec3( vuf * Inv255, gf * PackUpscale, bf );
1747}
1748vec2 packDepthToRG( const in float v ) {
1749	if( v <= 0.0 )
1750		return vec2( 0., 0. );
1751	if( v >= 1.0 )
1752		return vec2( 1., 1. );
1753	float vuf;
1754	float gf = modf( v * 256., vuf );
1755	return vec2( vuf * Inv255, gf );
1756}
1757float unpackRGBAToDepth( const in vec4 v ) {
1758	return dot( v, UnpackFactors4 );
1759}
1760float unpackRGBToDepth( const in vec3 v ) {
1761	return dot( v, UnpackFactors3 );
1762}
1763float unpackRGToDepth( const in vec2 v ) {
1764	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
1765}
1766vec4 pack2HalfToRGBA( const in vec2 v ) {
1767	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1768	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1769}
1770vec2 unpackRGBATo2Half( const in vec4 v ) {
1771	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1772}
1773float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1774	return ( viewZ + near ) / ( near - far );
1775}
1776float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1777	#ifdef USE_REVERSED_DEPTH_BUFFER
1778	
1779		return depth * ( far - near ) - far;
1780	#else
1781		return depth * ( near - far ) - near;
1782	#endif
1783}
1784float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1785	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1786}
1787float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1788	
1789	#ifdef USE_REVERSED_DEPTH_BUFFER
1790		return ( near * far ) / ( ( near - far ) * depth - near );
1791	#else
1792		return ( near * far ) / ( ( far - near ) * depth - far );
1793	#endif
1794}`,_w=`#ifdef PREMULTIPLIED_ALPHA
1795	gl_FragColor.rgb *= gl_FragColor.a;
1796#endif`,xw=`vec4 mvPosition = vec4( transformed, 1.0 );
1797#ifdef USE_BATCHING
1798	mvPosition = batchingMatrix * mvPosition;
1799#endif
1800#ifdef USE_INSTANCING
1801	mvPosition = instanceMatrix * mvPosition;
1802#endif
1803mvPosition = modelViewMatrix * mvPosition;
1804gl_Position = projectionMatrix * mvPosition;`,Sw=`#ifdef DITHERING
1805	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1806#endif`,yw=`#ifdef DITHERING
1807	vec3 dithering( vec3 color ) {
1808		float grid_position = rand( gl_FragCoord.xy );
1809		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1810		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1811		return color + dither_shift_RGB;
1812	}
1813#endif`,Mw=`float roughnessFactor = roughness;
1814#ifdef USE_ROUGHNESSMAP
1815	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1816	roughnessFactor *= texelRoughness.g;
1817#endif`,Ew=`#ifdef USE_ROUGHNESSMAP
1818	uniform sampler2D roughnessMap;
1819#endif`,ww=`#if NUM_SPOT_LIGHT_COORDS > 0
1820	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1821#endif
1822#if NUM_SPOT_LIGHT_MAPS > 0
1823	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1824#endif
1825#ifdef USE_SHADOWMAP
1826	#if NUM_DIR_LIGHT_SHADOWS > 0
1827		#if defined( SHADOWMAP_TYPE_PCF )
1828			uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1829		#else
1830			uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1831		#endif
1832		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1833		struct DirectionalLightShadow {
1834			float shadowIntensity;
1835			float shadowBias;
1836			float shadowNormalBias;
1837			float shadowRadius;
1838			vec2 shadowMapSize;
1839		};
1840		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1841	#endif
1842	#if NUM_SPOT_LIGHT_SHADOWS > 0
1843		#if defined( SHADOWMAP_TYPE_PCF )
1844			uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1845		#else
1846			uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1847		#endif
1848		struct SpotLightShadow {
1849			float shadowIntensity;
1850			float shadowBias;
1851			float shadowNormalBias;
1852			float shadowRadius;
1853			vec2 shadowMapSize;
1854		};
1855		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1856	#endif
1857	#if NUM_POINT_LIGHT_SHADOWS > 0
1858		#if defined( SHADOWMAP_TYPE_PCF )
1859			uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1860		#elif defined( SHADOWMAP_TYPE_BASIC )
1861			uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1862		#endif
1863		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1864		struct PointLightShadow {
1865			float shadowIntensity;
1866			float shadowBias;
1867			float shadowNormalBias;
1868			float shadowRadius;
1869			vec2 shadowMapSize;
1870			float shadowCameraNear;
1871			float shadowCameraFar;
1872		};
1873		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1874	#endif
1875	#if defined( SHADOWMAP_TYPE_PCF )
1876		float interleavedGradientNoise( vec2 position ) {
1877			return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
1878		}
1879		vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
1880			const float goldenAngle = 2.399963229728653;
1881			float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
1882			float theta = float( sampleIndex ) * goldenAngle + phi;
1883			return vec2( cos( theta ), sin( theta ) ) * r;
1884		}
1885	#endif
1886	#if defined( SHADOWMAP_TYPE_PCF )
1887		float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1888			float shadow = 1.0;
1889			shadowCoord.xyz /= shadowCoord.w;
1890			shadowCoord.z += shadowBias;
1891			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1892			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1893			if ( frustumTest ) {
1894				vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1895				float radius = shadowRadius * texelSize.x;
1896				float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1897				shadow = (
1898					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
1899					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
1900					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
1901					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
1902					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
1903				) * 0.2;
1904			}
1905			return mix( 1.0, shadow, shadowIntensity );
1906		}
1907	#elif defined( SHADOWMAP_TYPE_VSM )
1908		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1909			float shadow = 1.0;
1910			shadowCoord.xyz /= shadowCoord.w;
1911			#ifdef USE_REVERSED_DEPTH_BUFFER
1912				shadowCoord.z -= shadowBias;
1913			#else
1914				shadowCoord.z += shadowBias;
1915			#endif
1916			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1917			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1918			if ( frustumTest ) {
1919				vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
1920				float mean = distribution.x;
1921				float variance = distribution.y * distribution.y;
1922				#ifdef USE_REVERSED_DEPTH_BUFFER
1923					float hard_shadow = step( mean, shadowCoord.z );
1924				#else
1925					float hard_shadow = step( shadowCoord.z, mean );
1926				#endif
1927				
1928				if ( hard_shadow == 1.0 ) {
1929					shadow = 1.0;
1930				} else {
1931					variance = max( variance, 0.0000001 );
1932					float d = shadowCoord.z - mean;
1933					float p_max = variance / ( variance + d * d );
1934					p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
1935					shadow = max( hard_shadow, p_max );
1936				}
1937			}
1938			return mix( 1.0, shadow, shadowIntensity );
1939		}
1940	#else
1941		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1942			float shadow = 1.0;
1943			shadowCoord.xyz /= shadowCoord.w;
1944			#ifdef USE_REVERSED_DEPTH_BUFFER
1945				shadowCoord.z -= shadowBias;
1946			#else
1947				shadowCoord.z += shadowBias;
1948			#endif
1949			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1950			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1951			if ( frustumTest ) {
1952				float depth = texture2D( shadowMap, shadowCoord.xy ).r;
1953				#ifdef USE_REVERSED_DEPTH_BUFFER
1954					shadow = step( depth, shadowCoord.z );
1955				#else
1956					shadow = step( shadowCoord.z, depth );
1957				#endif
1958			}
1959			return mix( 1.0, shadow, shadowIntensity );
1960		}
1961	#endif
1962	#if NUM_POINT_LIGHT_SHADOWS > 0
1963	#if defined( SHADOWMAP_TYPE_PCF )
1964	float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1965		float shadow = 1.0;
1966		vec3 lightToPosition = shadowCoord.xyz;
1967		vec3 bd3D = normalize( lightToPosition );
1968		vec3 absVec = abs( lightToPosition );
1969		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1970		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
1971			#ifdef USE_REVERSED_DEPTH_BUFFER
1972				float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1973				dp -= shadowBias;
1974			#else
1975				float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1976				dp += shadowBias;
1977			#endif
1978			float texelSize = shadowRadius / shadowMapSize.x;
1979			vec3 absDir = abs( bd3D );
1980			vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
1981			tangent = normalize( cross( bd3D, tangent ) );
1982			vec3 bitangent = cross( bd3D, tangent );
1983			float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1984			vec2 sample0 = vogelDiskSample( 0, 5, phi );
1985			vec2 sample1 = vogelDiskSample( 1, 5, phi );
1986			vec2 sample2 = vogelDiskSample( 2, 5, phi );
1987			vec2 sample3 = vogelDiskSample( 3, 5, phi );
1988			vec2 sample4 = vogelDiskSample( 4, 5, phi );
1989			shadow = (
1990				texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +
1991				texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +
1992				texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +
1993				texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +
1994				texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )
1995			) * 0.2;
1996		}
1997		return mix( 1.0, shadow, shadowIntensity );
1998	}
1999	#elif defined( SHADOWMAP_TYPE_BASIC )
2000	float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
2001		float shadow = 1.0;
2002		vec3 lightToPosition = shadowCoord.xyz;
2003		vec3 absVec = abs( lightToPosition );
2004		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
2005		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
2006			float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
2007			dp += shadowBias;
2008			vec3 bd3D = normalize( lightToPosition );
2009			float depth = textureCube( shadowMap, bd3D ).r;
2010			#ifdef USE_REVERSED_DEPTH_BUFFER
2011				depth = 1.0 - depth;
2012			#endif
2013			shadow = step( dp, depth );
2014		}
2015		return mix( 1.0, shadow, shadowIntensity );
2016	}
2017	#endif
2018	#endif
2019#endif`,bw=`#if NUM_SPOT_LIGHT_COORDS > 0
2020	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
2021	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
2022#endif
2023#ifdef USE_SHADOWMAP
2024	#if NUM_DIR_LIGHT_SHADOWS > 0
2025		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
2026		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
2027		struct DirectionalLightShadow {
2028			float shadowIntensity;
2029			float shadowBias;
2030			float shadowNormalBias;
2031			float shadowRadius;
2032			vec2 shadowMapSize;
2033		};
2034		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
2035	#endif
2036	#if NUM_SPOT_LIGHT_SHADOWS > 0
2037		struct SpotLightShadow {
2038			float shadowIntensity;
2039			float shadowBias;
2040			float shadowNormalBias;
2041			float shadowRadius;
2042			vec2 shadowMapSize;
2043		};
2044		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
2045	#endif
2046	#if NUM_POINT_LIGHT_SHADOWS > 0
2047		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
2048		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
2049		struct PointLightShadow {
2050			float shadowIntensity;
2051			float shadowBias;
2052			float shadowNormalBias;
2053			float shadowRadius;
2054			vec2 shadowMapSize;
2055			float shadowCameraNear;
2056			float shadowCameraFar;
2057		};
2058		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2059	#endif
2060#endif`,Tw=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
2061	#ifdef HAS_NORMAL
2062		vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
2063	#else
2064		vec3 shadowWorldNormal = vec3( 0.0 );
2065	#endif
2066	vec4 shadowWorldPosition;
2067#endif
2068#if defined( USE_SHADOWMAP )
2069	#if NUM_DIR_LIGHT_SHADOWS > 0
2070		#pragma unroll_loop_start
2071		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2072			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
2073			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
2074		}
2075		#pragma unroll_loop_end
2076	#endif
2077	#if NUM_POINT_LIGHT_SHADOWS > 0
2078		#pragma unroll_loop_start
2079		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2080			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
2081			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
2082		}
2083		#pragma unroll_loop_end
2084	#endif
2085#endif
2086#if NUM_SPOT_LIGHT_COORDS > 0
2087	#pragma unroll_loop_start
2088	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
2089		shadowWorldPosition = worldPosition;
2090		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
2091			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
2092		#endif
2093		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
2094	}
2095	#pragma unroll_loop_end
2096#endif`,Cw=`float getShadowMask() {
2097	float shadow = 1.0;
2098	#ifdef USE_SHADOWMAP
2099	#if NUM_DIR_LIGHT_SHADOWS > 0
2100	DirectionalLightShadow directionalLight;
2101	#pragma unroll_loop_start
2102	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2103		directionalLight = directionalLightShadows[ i ];
2104		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
2105	}
2106	#pragma unroll_loop_end
2107	#endif
2108	#if NUM_SPOT_LIGHT_SHADOWS > 0
2109	SpotLightShadow spotLight;
2110	#pragma unroll_loop_start
2111	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
2112		spotLight = spotLightShadows[ i ];
2113		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
2114	}
2115	#pragma unroll_loop_end
2116	#endif
2117	#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
2118	PointLightShadow pointLight;
2119	#pragma unroll_loop_start
2120	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2121		pointLight = pointLightShadows[ i ];
2122		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2123	}
2124	#pragma unroll_loop_end
2125	#endif
2126	#endif
2127	return shadow;
2128}`,Aw=`#ifdef USE_SKINNING
2129	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2130	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2131	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2132	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2133#endif`,Rw=`#ifdef USE_SKINNING
2134	uniform mat4 bindMatrix;
2135	uniform mat4 bindMatrixInverse;
2136	uniform highp sampler2D boneTexture;
2137	mat4 getBoneMatrix( const in float i ) {
2138		int size = textureSize( boneTexture, 0 ).x;
2139		int j = int( i ) * 4;
2140		int x = j % size;
2141		int y = j / size;
2142		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2143		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2144		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2145		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2146		return mat4( v1, v2, v3, v4 );
2147	}
2148#endif`,Pw=`#ifdef USE_SKINNING
2149	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2150	vec4 skinned = vec4( 0.0 );
2151	skinned += boneMatX * skinVertex * skinWeight.x;
2152	skinned += boneMatY * skinVertex * skinWeight.y;
2153	skinned += boneMatZ * skinVertex * skinWeight.z;
2154	skinned += boneMatW * skinVertex * skinWeight.w;
2155	transformed = ( bindMatrixInverse * skinned ).xyz;
2156#endif`,Nw=`#ifdef USE_SKINNING
2157	mat4 skinMatrix = mat4( 0.0 );
2158	skinMatrix += skinWeight.x * boneMatX;
2159	skinMatrix += skinWeight.y * boneMatY;
2160	skinMatrix += skinWeight.z * boneMatZ;
2161	skinMatrix += skinWeight.w * boneMatW;
2162	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2163	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2164	#ifdef USE_TANGENT
2165		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2166	#endif
2167#endif`,Lw=`float specularStrength;
2168#ifdef USE_SPECULARMAP
2169	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2170	specularStrength = texelSpecular.r;
2171#else
2172	specularStrength = 1.0;
2173#endif`,Dw=`#ifdef USE_SPECULARMAP
2174	uniform sampler2D specularMap;
2175#endif`,Iw=`#if defined( TONE_MAPPING )
2176	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2177#endif`,Uw=`#ifndef saturate
2178#define saturate( a ) clamp( a, 0.0, 1.0 )
2179#endif
2180uniform float toneMappingExposure;
2181vec3 LinearToneMapping( vec3 color ) {
2182	return saturate( toneMappingExposure * color );
2183}
2184vec3 ReinhardToneMapping( vec3 color ) {
2185	color *= toneMappingExposure;
2186	return saturate( color / ( vec3( 1.0 ) + color ) );
2187}
2188vec3 CineonToneMapping( vec3 color ) {
2189	color *= toneMappingExposure;
2190	color = max( vec3( 0.0 ), color - 0.004 );
2191	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2192}
2193vec3 RRTAndODTFit( vec3 v ) {
2194	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2195	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2196	return a / b;
2197}
2198vec3 ACESFilmicToneMapping( vec3 color ) {
2199	const mat3 ACESInputMat = mat3(
2200		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2201		vec3( 0.04823, 0.01566, 0.83777 )
2202	);
2203	const mat3 ACESOutputMat = mat3(
2204		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2205		vec3( -0.07367, -0.00605,  1.07602 )
2206	);
2207	color *= toneMappingExposure / 0.6;
2208	color = ACESInputMat * color;
2209	color = RRTAndODTFit( color );
2210	color = ACESOutputMat * color;
2211	return saturate( color );
2212}
2213const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2214	vec3( 1.6605, - 0.1246, - 0.0182 ),
2215	vec3( - 0.5876, 1.1329, - 0.1006 ),
2216	vec3( - 0.0728, - 0.0083, 1.1187 )
2217);
2218const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2219	vec3( 0.6274, 0.0691, 0.0164 ),
2220	vec3( 0.3293, 0.9195, 0.0880 ),
2221	vec3( 0.0433, 0.0113, 0.8956 )
2222);
2223vec3 agxDefaultContrastApprox( vec3 x ) {
2224	vec3 x2 = x * x;
2225	vec3 x4 = x2 * x2;
2226	return + 15.5 * x4 * x2
2227		- 40.14 * x4 * x
2228		+ 31.96 * x4
2229		- 6.868 * x2 * x
2230		+ 0.4298 * x2
2231		+ 0.1191 * x
2232		- 0.00232;
2233}
2234vec3 AgXToneMapping( vec3 color ) {
2235	const mat3 AgXInsetMatrix = mat3(
2236		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2237		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2238		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2239	);
2240	const mat3 AgXOutsetMatrix = mat3(
2241		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2242		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2243		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2244	);
2245	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2246	color *= toneMappingExposure;
2247	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2248	color = AgXInsetMatrix * color;
2249	color = max( color, 1e-10 );	color = log2( color );
2250	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2251	color = clamp( color, 0.0, 1.0 );
2252	color = agxDefaultContrastApprox( color );
2253	color = AgXOutsetMatrix * color;
2254	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2255	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2256	color = clamp( color, 0.0, 1.0 );
2257	return color;
2258}
2259vec3 NeutralToneMapping( vec3 color ) {
2260	const float StartCompression = 0.8 - 0.04;
2261	const float Desaturation = 0.15;
2262	color *= toneMappingExposure;
2263	float x = min( color.r, min( color.g, color.b ) );
2264	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2265	color -= offset;
2266	float peak = max( color.r, max( color.g, color.b ) );
2267	if ( peak < StartCompression ) return color;
2268	float d = 1. - StartCompression;
2269	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2270	color *= newPeak / peak;
2271	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2272	return mix( color, vec3( newPeak ), g );
2273}
2274vec3 CustomToneMapping( vec3 color ) { return color; }`,Fw=`#ifdef USE_TRANSMISSION
2275	material.transmission = transmission;
2276	material.transmissionAlpha = 1.0;
2277	material.thickness = thickness;
2278	material.attenuationDistance = attenuationDistance;
2279	material.attenuationColor = attenuationColor;
2280	#ifdef USE_TRANSMISSIONMAP
2281		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2282	#endif
2283	#ifdef USE_THICKNESSMAP
2284		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2285	#endif
2286	vec3 pos = vWorldPosition;
2287	vec3 v = normalize( cameraPosition - pos );
2288	vec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix );
2289	vec4 transmitted = getIBLVolumeRefraction(
2290		n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,
2291		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2292		material.attenuationColor, material.attenuationDistance );
2293	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2294	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2295#endif`,Ow=`#ifdef USE_TRANSMISSION
2296	uniform float transmission;
2297	uniform float thickness;
2298	uniform float attenuationDistance;
2299	uniform vec3 attenuationColor;
2300	#ifdef USE_TRANSMISSIONMAP
2301		uniform sampler2D transmissionMap;
2302	#endif
2303	#ifdef USE_THICKNESSMAP
2304		uniform sampler2D thicknessMap;
2305	#endif
2306	uniform vec2 transmissionSamplerSize;
2307	uniform sampler2D transmissionSamplerMap;
2308	uniform mat4 modelMatrix;
2309	uniform mat4 projectionMatrix;
2310	varying vec3 vWorldPosition;
2311	float w0( float a ) {
2312		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2313	}
2314	float w1( float a ) {
2315		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2316	}
2317	float w2( float a ){
2318		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2319	}
2320	float w3( float a ) {
2321		return ( 1.0 / 6.0 ) * ( a * a * a );
2322	}
2323	float g0( float a ) {
2324		return w0( a ) + w1( a );
2325	}
2326	float g1( float a ) {
2327		return w2( a ) + w3( a );
2328	}
2329	float h0( float a ) {
2330		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2331	}
2332	float h1( float a ) {
2333		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2334	}
2335	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2336		uv = uv * texelSize.zw + 0.5;
2337		vec2 iuv = floor( uv );
2338		vec2 fuv = fract( uv );
2339		float g0x = g0( fuv.x );
2340		float g1x = g1( fuv.x );
2341		float h0x = h0( fuv.x );
2342		float h1x = h1( fuv.x );
2343		float h0y = h0( fuv.y );
2344		float h1y = h1( fuv.y );
2345		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2346		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2347		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2348		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2349		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2350			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2351	}
2352	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2353		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2354		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2355		vec2 fLodSizeInv = 1.0 / fLodSize;
2356		vec2 cLodSizeInv = 1.0 / cLodSize;
2357		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2358		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2359		return mix( fSample, cSample, fract( lod ) );
2360	}
2361	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2362		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2363		vec3 modelScale;
2364		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2365		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2366		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2367		return normalize( refractionVector ) * thickness * modelScale;
2368	}
2369	float applyIorToRoughness( const in float roughness, const in float ior ) {
2370		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2371	}
2372	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2373		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2374		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2375	}
2376	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2377		if ( isinf( attenuationDistance ) ) {
2378			return vec3( 1.0 );
2379		} else {
2380			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2381			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2382		}
2383	}
2384	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2385		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2386		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2387		const in vec3 attenuationColor, const in float attenuationDistance ) {
2388		vec4 transmittedLight;
2389		vec3 transmittance;
2390		#ifdef USE_DISPERSION
2391			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2392			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2393			for ( int i = 0; i < 3; i ++ ) {
2394				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2395				vec3 refractedRayExit = position + transmissionRay;
2396				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2397				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2398				refractionCoords += 1.0;
2399				refractionCoords /= 2.0;
2400				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2401				transmittedLight[ i ] = transmissionSample[ i ];
2402				transmittedLight.a += transmissionSample.a;
2403				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2404			}
2405			transmittedLight.a /= 3.0;
2406		#else
2407			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2408			vec3 refractedRayExit = position + transmissionRay;
2409			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2410			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2411			refractionCoords += 1.0;
2412			refractionCoords /= 2.0;
2413			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2414			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2415		#endif
2416		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2417		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2418		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2419		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2420	}
2421#endif`,kw=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2422	varying vec2 vUv;
2423#endif
2424#ifdef USE_MAP
2425	varying vec2 vMapUv;
2426#endif
2427#ifdef USE_ALPHAMAP
2428	varying vec2 vAlphaMapUv;
2429#endif
2430#ifdef USE_LIGHTMAP
2431	varying vec2 vLightMapUv;
2432#endif
2433#ifdef USE_AOMAP
2434	varying vec2 vAoMapUv;
2435#endif
2436#ifdef USE_BUMPMAP
2437	varying vec2 vBumpMapUv;
2438#endif
2439#ifdef USE_NORMALMAP
2440	varying vec2 vNormalMapUv;
2441#endif
2442#ifdef USE_EMISSIVEMAP
2443	varying vec2 vEmissiveMapUv;
2444#endif
2445#ifdef USE_METALNESSMAP
2446	varying vec2 vMetalnessMapUv;
2447#endif
2448#ifdef USE_ROUGHNESSMAP
2449	varying vec2 vRoughnessMapUv;
2450#endif
2451#ifdef USE_ANISOTROPYMAP
2452	varying vec2 vAnisotropyMapUv;
2453#endif
2454#ifdef USE_CLEARCOATMAP
2455	varying vec2 vClearcoatMapUv;
2456#endif
2457#ifdef USE_CLEARCOAT_NORMALMAP
2458	varying vec2 vClearcoatNormalMapUv;
2459#endif
2460#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2461	varying vec2 vClearcoatRoughnessMapUv;
2462#endif
2463#ifdef USE_IRIDESCENCEMAP
2464	varying vec2 vIridescenceMapUv;
2465#endif
2466#ifdef USE_IRIDESCENCE_THICKNESSMAP
2467	varying vec2 vIridescenceThicknessMapUv;
2468#endif
2469#ifdef USE_SHEEN_COLORMAP
2470	varying vec2 vSheenColorMapUv;
2471#endif
2472#ifdef USE_SHEEN_ROUGHNESSMAP
2473	varying vec2 vSheenRoughnessMapUv;
2474#endif
2475#ifdef USE_SPECULARMAP
2476	varying vec2 vSpecularMapUv;
2477#endif
2478#ifdef USE_SPECULAR_COLORMAP
2479	varying vec2 vSpecularColorMapUv;
2480#endif
2481#ifdef USE_SPECULAR_INTENSITYMAP
2482	varying vec2 vSpecularIntensityMapUv;
2483#endif
2484#ifdef USE_TRANSMISSIONMAP
2485	uniform mat3 transmissionMapTransform;
2486	varying vec2 vTransmissionMapUv;
2487#endif
2488#ifdef USE_THICKNESSMAP
2489	uniform mat3 thicknessMapTransform;
2490	varying vec2 vThicknessMapUv;
2491#endif`,Bw=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2492	varying vec2 vUv;
2493#endif
2494#ifdef USE_MAP
2495	uniform mat3 mapTransform;
2496	varying vec2 vMapUv;
2497#endif
2498#ifdef USE_ALPHAMAP
2499	uniform mat3 alphaMapTransform;
2500	varying vec2 vAlphaMapUv;
2501#endif
2502#ifdef USE_LIGHTMAP
2503	uniform mat3 lightMapTransform;
2504	varying vec2 vLightMapUv;
2505#endif
2506#ifdef USE_AOMAP
2507	uniform mat3 aoMapTransform;
2508	varying vec2 vAoMapUv;
2509#endif
2510#ifdef USE_BUMPMAP
2511	uniform mat3 bumpMapTransform;
2512	varying vec2 vBumpMapUv;
2513#endif
2514#ifdef USE_NORMALMAP
2515	uniform mat3 normalMapTransform;
2516	varying vec2 vNormalMapUv;
2517#endif
2518#ifdef USE_DISPLACEMENTMAP
2519	uniform mat3 displacementMapTransform;
2520	varying vec2 vDisplacementMapUv;
2521#endif
2522#ifdef USE_EMISSIVEMAP
2523	uniform mat3 emissiveMapTransform;
2524	varying vec2 vEmissiveMapUv;
2525#endif
2526#ifdef USE_METALNESSMAP
2527	uniform mat3 metalnessMapTransform;
2528	varying vec2 vMetalnessMapUv;
2529#endif
2530#ifdef USE_ROUGHNESSMAP
2531	uniform mat3 roughnessMapTransform;
2532	varying vec2 vRoughnessMapUv;
2533#endif
2534#ifdef USE_ANISOTROPYMAP
2535	uniform mat3 anisotropyMapTransform;
2536	varying vec2 vAnisotropyMapUv;
2537#endif
2538#ifdef USE_CLEARCOATMAP
2539	uniform mat3 clearcoatMapTransform;
2540	varying vec2 vClearcoatMapUv;
2541#endif
2542#ifdef USE_CLEARCOAT_NORMALMAP
2543	uniform mat3 clearcoatNormalMapTransform;
2544	varying vec2 vClearcoatNormalMapUv;
2545#endif
2546#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2547	uniform mat3 clearcoatRoughnessMapTransform;
2548	varying vec2 vClearcoatRoughnessMapUv;
2549#endif
2550#ifdef USE_SHEEN_COLORMAP
2551	uniform mat3 sheenColorMapTransform;
2552	varying vec2 vSheenColorMapUv;
2553#endif
2554#ifdef USE_SHEEN_ROUGHNESSMAP
2555	uniform mat3 sheenRoughnessMapTransform;
2556	varying vec2 vSheenRoughnessMapUv;
2557#endif
2558#ifdef USE_IRIDESCENCEMAP
2559	uniform mat3 iridescenceMapTransform;
2560	varying vec2 vIridescenceMapUv;
2561#endif
2562#ifdef USE_IRIDESCENCE_THICKNESSMAP
2563	uniform mat3 iridescenceThicknessMapTransform;
2564	varying vec2 vIridescenceThicknessMapUv;
2565#endif
2566#ifdef USE_SPECULARMAP
2567	uniform mat3 specularMapTransform;
2568	varying vec2 vSpecularMapUv;
2569#endif
2570#ifdef USE_SPECULAR_COLORMAP
2571	uniform mat3 specularColorMapTransform;
2572	varying vec2 vSpecularColorMapUv;
2573#endif
2574#ifdef USE_SPECULAR_INTENSITYMAP
2575	uniform mat3 specularIntensityMapTransform;
2576	varying vec2 vSpecularIntensityMapUv;
2577#endif
2578#ifdef USE_TRANSMISSIONMAP
2579	uniform mat3 transmissionMapTransform;
2580	varying vec2 vTransmissionMapUv;
2581#endif
2582#ifdef USE_THICKNESSMAP
2583	uniform mat3 thicknessMapTransform;
2584	varying vec2 vThicknessMapUv;
2585#endif`,zw=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2586	vUv = vec3( uv, 1 ).xy;
2587#endif
2588#ifdef USE_MAP
2589	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2590#endif
2591#ifdef USE_ALPHAMAP
2592	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2593#endif
2594#ifdef USE_LIGHTMAP
2595	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2596#endif
2597#ifdef USE_AOMAP
2598	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2599#endif
2600#ifdef USE_BUMPMAP
2601	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2602#endif
2603#ifdef USE_NORMALMAP
2604	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2605#endif
2606#ifdef USE_DISPLACEMENTMAP
2607	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2608#endif
2609#ifdef USE_EMISSIVEMAP
2610	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2611#endif
2612#ifdef USE_METALNESSMAP
2613	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2614#endif
2615#ifdef USE_ROUGHNESSMAP
2616	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2617#endif
2618#ifdef USE_ANISOTROPYMAP
2619	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2620#endif
2621#ifdef USE_CLEARCOATMAP
2622	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2623#endif
2624#ifdef USE_CLEARCOAT_NORMALMAP
2625	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2626#endif
2627#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2628	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2629#endif
2630#ifdef USE_IRIDESCENCEMAP
2631	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2632#endif
2633#ifdef USE_IRIDESCENCE_THICKNESSMAP
2634	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2635#endif
2636#ifdef USE_SHEEN_COLORMAP
2637	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2638#endif
2639#ifdef USE_SHEEN_ROUGHNESSMAP
2640	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2641#endif
2642#ifdef USE_SPECULARMAP
2643	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2644#endif
2645#ifdef USE_SPECULAR_COLORMAP
2646	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2647#endif
2648#ifdef USE_SPECULAR_INTENSITYMAP
2649	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2650#endif
2651#ifdef USE_TRANSMISSIONMAP
2652	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2653#endif
2654#ifdef USE_THICKNESSMAP
2655	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2656#endif`,Vw=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2657	vec4 worldPosition = vec4( transformed, 1.0 );
2658	#ifdef USE_BATCHING
2659		worldPosition = batchingMatrix * worldPosition;
2660	#endif
2661	#ifdef USE_INSTANCING
2662		worldPosition = instanceMatrix * worldPosition;
2663	#endif
2664	worldPosition = modelMatrix * worldPosition;
2665#endif`;const Hw=`varying vec2 vUv;
2666uniform mat3 uvTransform;
2667void main() {
2668	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2669	gl_Position = vec4( position.xy, 1.0, 1.0 );
2670}`,Gw=`uniform sampler2D t2D;
2671uniform float backgroundIntensity;
2672varying vec2 vUv;
2673void main() {
2674	vec4 texColor = texture2D( t2D, vUv );
2675	#ifdef DECODE_VIDEO_TEXTURE
2676		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 );
2677	#endif
2678	texColor.rgb *= backgroundIntensity;
2679	gl_FragColor = texColor;
2680	#include <tonemapping_fragment>
2681	#include <colorspace_fragment>
2682}`,Ww=`varying vec3 vWorldDirection;
2683#include <common>
2684void main() {
2685	vWorldDirection = transformDirection( position, modelMatrix );
2686	#include <begin_vertex>
2687	#include <project_vertex>
2688	gl_Position.z = gl_Position.w;
2689}`,Xw=`#ifdef ENVMAP_TYPE_CUBE
2690	uniform samplerCube envMap;
2691#elif defined( ENVMAP_TYPE_CUBE_UV )
2692	uniform sampler2D envMap;
2693#endif
2694uniform float backgroundBlurriness;
2695uniform float backgroundIntensity;
2696uniform mat3 backgroundRotation;
2697varying vec3 vWorldDirection;
2698#include <cube_uv_reflection_fragment>
2699void main() {
2700	#ifdef ENVMAP_TYPE_CUBE
2701		vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );
2702	#elif defined( ENVMAP_TYPE_CUBE_UV )
2703		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2704	#else
2705		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2706	#endif
2707	texColor.rgb *= backgroundIntensity;
2708	gl_FragColor = texColor;
2709	#include <tonemapping_fragment>
2710	#include <colorspace_fragment>
2711}`,$w=`varying vec3 vWorldDirection;
2712#include <common>
2713void main() {
2714	vWorldDirection = transformDirection( position, modelMatrix );
2715	#include <begin_vertex>
2716	#include <project_vertex>
2717	gl_Position.z = gl_Position.w;
2718}`,qw=`uniform samplerCube tCube;
2719uniform float tFlip;
2720uniform float opacity;
2721varying vec3 vWorldDirection;
2722void main() {
2723	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2724	gl_FragColor = texColor;
2725	gl_FragColor.a *= opacity;
2726	#include <tonemapping_fragment>
2727	#include <colorspace_fragment>
2728}`,Yw=`#include <common>
2729#include <batching_pars_vertex>
2730#include <uv_pars_vertex>
2731#include <displacementmap_pars_vertex>
2732#include <morphtarget_pars_vertex>
2733#include <skinning_pars_vertex>
2734#include <logdepthbuf_pars_vertex>
2735#include <clipping_planes_pars_vertex>
2736varying vec2 vHighPrecisionZW;
2737void main() {
2738	#include <uv_vertex>
2739	#include <batching_vertex>
2740	#include <skinbase_vertex>
2741	#include <morphinstance_vertex>
2742	#ifdef USE_DISPLACEMENTMAP
2743		#include <beginnormal_vertex>
2744		#include <morphnormal_vertex>
2745		#include <skinnormal_vertex>
2746	#endif
2747	#include <begin_vertex>
2748	#include <morphtarget_vertex>
2749	#include <skinning_vertex>
2750	#include <displacementmap_vertex>
2751	#include <project_vertex>
2752	#include <logdepthbuf_vertex>
2753	#include <clipping_planes_vertex>
2754	vHighPrecisionZW = gl_Position.zw;
2755}`,Kw=`#if DEPTH_PACKING == 3200
2756	uniform float opacity;
2757#endif
2758#include <common>
2759#include <packing>
2760#include <uv_pars_fragment>
2761#include <map_pars_fragment>
2762#include <alphamap_pars_fragment>
2763#include <alphatest_pars_fragment>
2764#include <alphahash_pars_fragment>
2765#include <logdepthbuf_pars_fragment>
2766#include <clipping_planes_pars_fragment>
2767varying vec2 vHighPrecisionZW;
2768void main() {
2769	vec4 diffuseColor = vec4( 1.0 );
2770	#include <clipping_planes_fragment>
2771	#if DEPTH_PACKING == 3200
2772		diffuseColor.a = opacity;
2773	#endif
2774	#include <map_fragment>
2775	#include <alphamap_fragment>
2776	#include <alphatest_fragment>
2777	#include <alphahash_fragment>
2778	#include <logdepthbuf_fragment>
2779	#ifdef USE_REVERSED_DEPTH_BUFFER
2780		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
2781	#else
2782		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
2783	#endif
2784	#if DEPTH_PACKING == 3200
2785		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2786	#elif DEPTH_PACKING == 3201
2787		gl_FragColor = packDepthToRGBA( fragCoordZ );
2788	#elif DEPTH_PACKING == 3202
2789		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
2790	#elif DEPTH_PACKING == 3203
2791		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2792	#endif
2793}`,jw=`#define DISTANCE
2794varying vec3 vWorldPosition;
2795#include <common>
2796#include <batching_pars_vertex>
2797#include <uv_pars_vertex>
2798#include <displacementmap_pars_vertex>
2799#include <morphtarget_pars_vertex>
2800#include <skinning_pars_vertex>
2801#include <clipping_planes_pars_vertex>
2802void main() {
2803	#include <uv_vertex>
2804	#include <batching_vertex>
2805	#include <skinbase_vertex>
2806	#include <morphinstance_vertex>
2807	#ifdef USE_DISPLACEMENTMAP
2808		#include <beginnormal_vertex>
2809		#include <morphnormal_vertex>
2810		#include <skinnormal_vertex>
2811	#endif
2812	#include <begin_vertex>
2813	#include <morphtarget_vertex>
2814	#include <skinning_vertex>
2815	#include <displacementmap_vertex>
2816	#include <project_vertex>
2817	#include <worldpos_vertex>
2818	#include <clipping_planes_vertex>
2819	vWorldPosition = worldPosition.xyz;
2820}`,Qw=`#define DISTANCE
2821uniform vec3 referencePosition;
2822uniform float nearDistance;
2823uniform float farDistance;
2824varying vec3 vWorldPosition;
2825#include <common>
2826#include <uv_pars_fragment>
2827#include <map_pars_fragment>
2828#include <alphamap_pars_fragment>
2829#include <alphatest_pars_fragment>
2830#include <alphahash_pars_fragment>
2831#include <clipping_planes_pars_fragment>
2832void main() {
2833	vec4 diffuseColor = vec4( 1.0 );
2834	#include <clipping_planes_fragment>
2835	#include <map_fragment>
2836	#include <alphamap_fragment>
2837	#include <alphatest_fragment>
2838	#include <alphahash_fragment>
2839	float dist = length( vWorldPosition - referencePosition );
2840	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2841	dist = saturate( dist );
2842	gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
2843}`,Zw=`varying vec3 vWorldDirection;
2844#include <common>
2845void main() {
2846	vWorldDirection = transformDirection( position, modelMatrix );
2847	#include <begin_vertex>
2848	#include <project_vertex>
2849}`,Jw=`uniform sampler2D tEquirect;
2850varying vec3 vWorldDirection;
2851#include <common>
2852void main() {
2853	vec3 direction = normalize( vWorldDirection );
2854	vec2 sampleUV = equirectUv( direction );
2855	gl_FragColor = texture2D( tEquirect, sampleUV );
2856	#include <tonemapping_fragment>
2857	#include <colorspace_fragment>
2858}`,e1=`uniform float scale;
2859attribute float lineDistance;
2860varying float vLineDistance;
2861#include <common>
2862#include <uv_pars_vertex>
2863#include <color_pars_vertex>
2864#include <fog_pars_vertex>
2865#include <morphtarget_pars_vertex>
2866#include <logdepthbuf_pars_vertex>
2867#include <clipping_planes_pars_vertex>
2868void main() {
2869	vLineDistance = scale * lineDistance;
2870	#include <uv_vertex>
2871	#include <color_vertex>
2872	#include <morphinstance_vertex>
2873	#include <morphcolor_vertex>
2874	#include <begin_vertex>
2875	#include <morphtarget_vertex>
2876	#include <project_vertex>
2877	#include <logdepthbuf_vertex>
2878	#include <clipping_planes_vertex>
2879	#include <fog_vertex>
2880}`,t1=`uniform vec3 diffuse;
2881uniform float opacity;
2882uniform float dashSize;
2883uniform float totalSize;
2884varying float vLineDistance;
2885#include <common>
2886#include <color_pars_fragment>
2887#include <uv_pars_fragment>
2888#include <map_pars_fragment>
2889#include <fog_pars_fragment>
2890#include <logdepthbuf_pars_fragment>
2891#include <clipping_planes_pars_fragment>
2892void main() {
2893	vec4 diffuseColor = vec4( diffuse, opacity );
2894	#include <clipping_planes_fragment>
2895	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2896		discard;
2897	}
2898	vec3 outgoingLight = vec3( 0.0 );
2899	#include <logdepthbuf_fragment>
2900	#include <map_fragment>
2901	#include <color_fragment>
2902	outgoingLight = diffuseColor.rgb;
2903	#include <opaque_fragment>
2904	#include <tonemapping_fragment>
2905	#include <colorspace_fragment>
2906	#include <fog_fragment>
2907	#include <premultiplied_alpha_fragment>
2908}`,n1=`#include <common>
2909#include <batching_pars_vertex>
2910#include <uv_pars_vertex>
2911#include <envmap_pars_vertex>
2912#include <color_pars_vertex>
2913#include <fog_pars_vertex>
2914#include <morphtarget_pars_vertex>
2915#include <skinning_pars_vertex>
2916#include <logdepthbuf_pars_vertex>
2917#include <clipping_planes_pars_vertex>
2918void main() {
2919	#include <uv_vertex>
2920	#include <color_vertex>
2921	#include <morphinstance_vertex>
2922	#include <morphcolor_vertex>
2923	#include <batching_vertex>
2924	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2925		#include <beginnormal_vertex>
2926		#include <morphnormal_vertex>
2927		#include <skinbase_vertex>
2928		#include <skinnormal_vertex>
2929		#include <defaultnormal_vertex>
2930	#endif
2931	#include <begin_vertex>
2932	#include <morphtarget_vertex>
2933	#include <skinning_vertex>
2934	#include <project_vertex>
2935	#include <logdepthbuf_vertex>
2936	#include <clipping_planes_vertex>
2937	#include <worldpos_vertex>
2938	#include <envmap_vertex>
2939	#include <fog_vertex>
2940}`,i1=`uniform vec3 diffuse;
2941uniform float opacity;
2942#ifndef FLAT_SHADED
2943	varying vec3 vNormal;
2944#endif
2945#include <common>
2946#include <dithering_pars_fragment>
2947#include <color_pars_fragment>
2948#include <uv_pars_fragment>
2949#include <map_pars_fragment>
2950#include <alphamap_pars_fragment>
2951#include <alphatest_pars_fragment>
2952#include <alphahash_pars_fragment>
2953#include <aomap_pars_fragment>
2954#include <lightmap_pars_fragment>
2955#include <envmap_common_pars_fragment>
2956#include <envmap_pars_fragment>
2957#include <fog_pars_fragment>
2958#include <specularmap_pars_fragment>
2959#include <logdepthbuf_pars_fragment>
2960#include <clipping_planes_pars_fragment>
2961void main() {
2962	vec4 diffuseColor = vec4( diffuse, opacity );
2963	#include <clipping_planes_fragment>
2964	#include <logdepthbuf_fragment>
2965	#include <map_fragment>
2966	#include <color_fragment>
2967	#include <alphamap_fragment>
2968	#include <alphatest_fragment>
2969	#include <alphahash_fragment>
2970	#include <specularmap_fragment>
2971	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2972	#ifdef USE_LIGHTMAP
2973		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2974		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2975	#else
2976		reflectedLight.indirectDiffuse += vec3( 1.0 );
2977	#endif
2978	#include <aomap_fragment>
2979	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2980	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2981	#include <envmap_fragment>
2982	#include <opaque_fragment>
2983	#include <tonemapping_fragment>
2984	#include <colorspace_fragment>
2985	#include <fog_fragment>
2986	#include <premultiplied_alpha_fragment>
2987	#include <dithering_fragment>
2988}`,s1=`#define LAMBERT
2989varying vec3 vViewPosition;
2990#include <common>
2991#include <batching_pars_vertex>
2992#include <uv_pars_vertex>
2993#include <displacementmap_pars_vertex>
2994#include <envmap_pars_vertex>
2995#include <color_pars_vertex>
2996#include <fog_pars_vertex>
2997#include <normal_pars_vertex>
2998#include <morphtarget_pars_vertex>
2999#include <skinning_pars_vertex>
3000#include <shadowmap_pars_vertex>
3001#include <logdepthbuf_pars_vertex>
3002#include <clipping_planes_pars_vertex>
3003void main() {
3004	#include <uv_vertex>
3005	#include <color_vertex>
3006	#include <morphinstance_vertex>
3007	#include <morphcolor_vertex>
3008	#include <batching_vertex>
3009	#include <beginnormal_vertex>
3010	#include <morphnormal_vertex>
3011	#include <skinbase_vertex>
3012	#include <skinnormal_vertex>
3013	#include <defaultnormal_vertex>
3014	#include <normal_vertex>
3015	#include <begin_vertex>
3016	#include <morphtarget_vertex>
3017	#include <skinning_vertex>
3018	#include <displacementmap_vertex>
3019	#include <project_vertex>
3020	#include <logdepthbuf_vertex>
3021	#include <clipping_planes_vertex>
3022	vViewPosition = - mvPosition.xyz;
3023	#include <worldpos_vertex>
3024	#include <envmap_vertex>
3025	#include <shadowmap_vertex>
3026	#include <fog_vertex>
3027}`,r1=`#define LAMBERT
3028uniform vec3 diffuse;
3029uniform vec3 emissive;
3030uniform float opacity;
3031#include <common>
3032#include <dithering_pars_fragment>
3033#include <color_pars_fragment>
3034#include <uv_pars_fragment>
3035#include <map_pars_fragment>
3036#include <alphamap_pars_fragment>
3037#include <alphatest_pars_fragment>
3038#include <alphahash_pars_fragment>
3039#include <aomap_pars_fragment>
3040#include <lightmap_pars_fragment>
3041#include <emissivemap_pars_fragment>
3042#include <cube_uv_reflection_fragment>
3043#include <envmap_common_pars_fragment>
3044#include <envmap_pars_fragment>
3045#include <envmap_physical_pars_fragment>
3046#include <fog_pars_fragment>
3047#include <bsdfs>
3048#include <lights_pars_begin>
3049#include <normal_pars_fragment>
3050#include <lights_lambert_pars_fragment>
3051#include <shadowmap_pars_fragment>
3052#include <bumpmap_pars_fragment>
3053#include <normalmap_pars_fragment>
3054#include <specularmap_pars_fragment>
3055#include <logdepthbuf_pars_fragment>
3056#include <clipping_planes_pars_fragment>
3057void main() {
3058	vec4 diffuseColor = vec4( diffuse, opacity );
3059	#include <clipping_planes_fragment>
3060	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3061	vec3 totalEmissiveRadiance = emissive;
3062	#include <logdepthbuf_fragment>
3063	#include <map_fragment>
3064	#include <color_fragment>
3065	#include <alphamap_fragment>
3066	#include <alphatest_fragment>
3067	#include <alphahash_fragment>
3068	#include <specularmap_fragment>
3069	#include <normal_fragment_begin>
3070	#include <normal_fragment_maps>
3071	#include <emissivemap_fragment>
3072	#include <lights_lambert_fragment>
3073	#include <lights_fragment_begin>
3074	#include <lights_fragment_maps>
3075	#include <lights_fragment_end>
3076	#include <aomap_fragment>
3077	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3078	#include <envmap_fragment>
3079	#include <opaque_fragment>
3080	#include <tonemapping_fragment>
3081	#include <colorspace_fragment>
3082	#include <fog_fragment>
3083	#include <premultiplied_alpha_fragment>
3084	#include <dithering_fragment>
3085}`,o1=`#define MATCAP
3086varying vec3 vViewPosition;
3087#include <common>
3088#include <batching_pars_vertex>
3089#include <uv_pars_vertex>
3090#include <color_pars_vertex>
3091#include <displacementmap_pars_vertex>
3092#include <fog_pars_vertex>
3093#include <normal_pars_vertex>
3094#include <morphtarget_pars_vertex>
3095#include <skinning_pars_vertex>
3096#include <logdepthbuf_pars_vertex>
3097#include <clipping_planes_pars_vertex>
3098void main() {
3099	#include <uv_vertex>
3100	#include <color_vertex>
3101	#include <morphinstance_vertex>
3102	#include <morphcolor_vertex>
3103	#include <batching_vertex>
3104	#include <beginnormal_vertex>
3105	#include <morphnormal_vertex>
3106	#include <skinbase_vertex>
3107	#include <skinnormal_vertex>
3108	#include <defaultnormal_vertex>
3109	#include <normal_vertex>
3110	#include <begin_vertex>
3111	#include <morphtarget_vertex>
3112	#include <skinning_vertex>
3113	#include <displacementmap_vertex>
3114	#include <project_vertex>
3115	#include <logdepthbuf_vertex>
3116	#include <clipping_planes_vertex>
3117	#include <fog_vertex>
3118	vViewPosition = - mvPosition.xyz;
3119}`,a1=`#define MATCAP
3120uniform vec3 diffuse;
3121uniform float opacity;
3122uniform sampler2D matcap;
3123varying vec3 vViewPosition;
3124#include <common>
3125#include <dithering_pars_fragment>
3126#include <color_pars_fragment>
3127#include <uv_pars_fragment>
3128#include <map_pars_fragment>
3129#include <alphamap_pars_fragment>
3130#include <alphatest_pars_fragment>
3131#include <alphahash_pars_fragment>
3132#include <fog_pars_fragment>
3133#include <normal_pars_fragment>
3134#include <bumpmap_pars_fragment>
3135#include <normalmap_pars_fragmen
3135t>
3136#include <logdepthbuf_pars_fragment>
3137#include <clipping_planes_pars_fragment>
3138void main() {
3139	vec4 diffuseColor = vec4( diffuse, opacity );
3140	#include <clipping_planes_fragment>
3141	#include <logdepthbuf_fragment>
3142	#include <map_fragment>
3143	#include <color_fragment>
3144	#include <alphamap_fragment>
3145	#include <alphatest_fragment>
3146	#include <alphahash_fragment>
3147	#include <normal_fragment_begin>
3148	#include <normal_fragment_maps>
3149	vec3 viewDir = normalize( vViewPosition );
3150	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3151	vec3 y = cross( viewDir, x );
3152	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3153	#ifdef USE_MATCAP
3154		vec4 matcapColor = texture2D( matcap, uv );
3155	#else
3156		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3157	#endif
3158	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3159	#include <opaque_fragment>
3160	#include <tonemapping_fragment>
3161	#include <colorspace_fragment>
3162	#include <fog_fragment>
3163	#include <premultiplied_alpha_fragment>
3164	#include <dithering_fragment>
3165}`,l1=`#define NORMAL
3166#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3167	varying vec3 vViewPosition;
3168#endif
3169#include <common>
3170#include <batching_pars_vertex>
3171#include <uv_pars_vertex>
3172#include <displacementmap_pars_vertex>
3173#include <normal_pars_vertex>
3174#include <morphtarget_pars_vertex>
3175#include <skinning_pars_vertex>
3176#include <logdepthbuf_pars_vertex>
3177#include <clipping_planes_pars_vertex>
3178void main() {
3179	#include <uv_vertex>
3180	#include <batching_vertex>
3181	#include <beginnormal_vertex>
3182	#include <morphinstance_vertex>
3183	#include <morphnormal_vertex>
3184	#include <skinbase_vertex>
3185	#include <skinnormal_vertex>
3186	#include <defaultnormal_vertex>
3187	#include <normal_vertex>
3188	#include <begin_vertex>
3189	#include <morphtarget_vertex>
3190	#include <skinning_vertex>
3191	#include <displacementmap_vertex>
3192	#include <project_vertex>
3193	#include <logdepthbuf_vertex>
3194	#include <clipping_planes_vertex>
3195#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3196	vViewPosition = - mvPosition.xyz;
3197#endif
3198}`,u1=`#define NORMAL
3199uniform float opacity;
3200#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3201	varying vec3 vViewPosition;
3202#endif
3203#include <uv_pars_fragment>
3204#include <normal_pars_fragment>
3205#include <bumpmap_pars_fragment>
3206#include <normalmap_pars_fragment>
3207#include <logdepthbuf_pars_fragment>
3208#include <clipping_planes_pars_fragment>
3209void main() {
3210	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3211	#include <clipping_planes_fragment>
3212	#include <logdepthbuf_fragment>
3213	#include <normal_fragment_begin>
3214	#include <normal_fragment_maps>
3215	gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
3216	#ifdef OPAQUE
3217		gl_FragColor.a = 1.0;
3218	#endif
3219}`,c1=`#define PHONG
3220varying vec3 vViewPosition;
3221#include <common>
3222#include <batching_pars_vertex>
3223#include <uv_pars_vertex>
3224#include <displacementmap_pars_vertex>
3225#include <envmap_pars_vertex>
3226#include <color_pars_vertex>
3227#include <fog_pars_vertex>
3228#include <normal_pars_vertex>
3229#include <morphtarget_pars_vertex>
3230#include <skinning_pars_vertex>
3231#include <shadowmap_pars_vertex>
3232#include <logdepthbuf_pars_vertex>
3233#include <clipping_planes_pars_vertex>
3234void main() {
3235	#include <uv_vertex>
3236	#include <color_vertex>
3237	#include <morphcolor_vertex>
3238	#include <batching_vertex>
3239	#include <beginnormal_vertex>
3240	#include <morphinstance_vertex>
3241	#include <morphnormal_vertex>
3242	#include <skinbase_vertex>
3243	#include <skinnormal_vertex>
3244	#include <defaultnormal_vertex>
3245	#include <normal_vertex>
3246	#include <begin_vertex>
3247	#include <morphtarget_vertex>
3248	#include <skinning_vertex>
3249	#include <displacementmap_vertex>
3250	#include <project_vertex>
3251	#include <logdepthbuf_vertex>
3252	#include <clipping_planes_vertex>
3253	vViewPosition = - mvPosition.xyz;
3254	#include <worldpos_vertex>
3255	#include <envmap_vertex>
3256	#include <shadowmap_vertex>
3257	#include <fog_vertex>
3258}`,h1=`#define PHONG
3259uniform vec3 diffuse;
3260uniform vec3 emissive;
3261uniform vec3 specular;
3262uniform float shininess;
3263uniform float opacity;
3264#include <common>
3265#include <dithering_pars_fragment>
3266#include <color_pars_fragment>
3267#include <uv_pars_fragment>
3268#include <map_pars_fragment>
3269#include <alphamap_pars_fragment>
3270#include <alphatest_pars_fragment>
3271#include <alphahash_pars_fragment>
3272#include <aomap_pars_fragment>
3273#include <lightmap_pars_fragment>
3274#include <emissivemap_pars_fragment>
3275#include <cube_uv_reflection_fragment>
3276#include <envmap_common_pars_fragment>
3277#include <envmap_pars_fragment>
3278#include <envmap_physical_pars_fragment>
3279#include <fog_pars_fragment>
3280#include <bsdfs>
3281#include <lights_pars_begin>
3282#include <normal_pars_fragment>
3283#include <lights_phong_pars_fragment>
3284#include <shadowmap_pars_fragment>
3285#include <bumpmap_pars_fragment>
3286#include <normalmap_pars_fragment>
3287#include <specularmap_pars_fragment>
3288#include <logdepthbuf_pars_fragment>
3289#include <clipping_planes_pars_fragment>
3290void main() {
3291	vec4 diffuseColor = vec4( diffuse, opacity );
3292	#include <clipping_planes_fragment>
3293	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3294	vec3 totalEmissiveRadiance = emissive;
3295	#include <logdepthbuf_fragment>
3296	#include <map_fragment>
3297	#include <color_fragment>
3298	#include <alphamap_fragment>
3299	#include <alphatest_fragment>
3300	#include <alphahash_fragment>
3301	#include <specularmap_fragment>
3302	#include <normal_fragment_begin>
3303	#include <normal_fragment_maps>
3304	#include <emissivemap_fragment>
3305	#include <lights_phong_fragment>
3306	#include <lights_fragment_begin>
3307	#include <lights_fragment_maps>
3308	#include <lights_fragment_end>
3309	#include <aomap_fragment>
3310	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3311	#include <envmap_fragment>
3312	#include <opaque_fragment>
3313	#include <tonemapping_fragment>
3314	#include <colorspace_fragment>
3315	#include <fog_fragment>
3316	#include <premultiplied_alpha_fragment>
3317	#include <dithering_fragment>
3318}`,f1=`#define STANDARD
3319varying vec3 vViewPosition;
3320#ifdef USE_TRANSMISSION
3321	varying vec3 vWorldPosition;
3322#endif
3323#include <common>
3324#include <batching_pars_vertex>
3325#include <uv_pars_vertex>
3326#include <displacementmap_pars_vertex>
3327#include <color_pars_vertex>
3328#include <fog_pars_vertex>
3329#include <normal_pars_vertex>
3330#include <morphtarget_pars_vertex>
3331#include <skinning_pars_vertex>
3332#include <shadowmap_pars_vertex>
3333#include <logdepthbuf_pars_vertex>
3334#include <clipping_planes_pars_vertex>
3335void main() {
3336	#include <uv_vertex>
3337	#include <color_vertex>
3338	#include <morphinstance_vertex>
3339	#include <morphcolor_vertex>
3340	#include <batching_vertex>
3341	#include <beginnormal_vertex>
3342	#include <morphnormal_vertex>
3343	#include <skinbase_vertex>
3344	#include <skinnormal_vertex>
3345	#include <defaultnormal_vertex>
3346	#include <normal_vertex>
3347	#include <begin_vertex>
3348	#include <morphtarget_vertex>
3349	#include <skinning_vertex>
3350	#include <displacementmap_vertex>
3351	#include <project_vertex>
3352	#include <logdepthbuf_vertex>
3353	#include <clipping_planes_vertex>
3354	vViewPosition = - mvPosition.xyz;
3355	#include <worldpos_vertex>
3356	#include <shadowmap_vertex>
3357	#include <fog_vertex>
3358#ifdef USE_TRANSMISSION
3359	vWorldPosition = worldPosition.xyz;
3360#endif
3361}`,d1=`#define STANDARD
3362#ifdef PHYSICAL
3363	#define IOR
3364	#define USE_SPECULAR
3365#endif
3366uniform vec3 diffuse;
3367uniform vec3 emissive;
3368uniform float roughness;
3369uniform float metalness;
3370uniform float opacity;
3371#ifdef IOR
3372	uniform float ior;
3373#endif
3374#ifdef USE_SPECULAR
3375	uniform float specularIntensity;
3376	uniform vec3 specularColor;
3377	#ifdef USE_SPECULAR_COLORMAP
3378		uniform sampler2D specularColorMap;
3379	#endif
3380	#ifdef USE_SPECULAR_INTENSITYMAP
3381		uniform sampler2D specularIntensityMap;
3382	#endif
3383#endif
3384#ifdef USE_CLEARCOAT
3385	uniform float clearcoat;
3386	uniform float clearcoatRoughness;
3387#endif
3388#ifdef USE_DISPERSION
3389	uniform float dispersion;
3390#endif
3391#ifdef USE_IRIDESCENCE
3392	uniform float iridescence;
3393	uniform float iridescenceIOR;
3394	uniform float iridescenceThicknessMinimum;
3395	uniform float iridescenceThicknessMaximum;
3396#endif
3397#ifdef USE_SHEEN
3398	uniform vec3 sheenColor;
3399	uniform float sheenRoughness;
3400	#ifdef USE_SHEEN_COLORMAP
3401		uniform sampler2D sheenColorMap;
3402	#endif
3403	#ifdef USE_SHEEN_ROUGHNESSMAP
3404		uniform sampler2D sheenRoughnessMap;
3405	#endif
3406#endif
3407#ifdef USE_ANISOTROPY
3408	uniform vec2 anisotropyVector;
3409	#ifdef USE_ANISOTROPYMAP
3410		uniform sampler2D anisotropyMap;
3411	#endif
3412#endif
3413varying vec3 vViewPosition;
3414#include <common>
3415#include <dithering_pars_fragment>
3416#include <color_pars_fragment>
3417#include <uv_pars_fragment>
3418#include <map_pars_fragment>
3419#include <alphamap_pars_fragment>
3420#include <alphatest_pars_fragment>
3421#include <alphahash_pars_fragment>
3422#include <aomap_pars_fragment>
3423#include <lightmap_pars_fragment>
3424#include <emissivemap_pars_fragment>
3425#include <iridescence_fragment>
3426#include <cube_uv_reflection_fragment>
3427#include <envmap_common_pars_fragment>
3428#include <envmap_physical_pars_fragment>
3429#include <fog_pars_fragment>
3430#include <lights_pars_begin>
3431#include <normal_pars_fragment>
3432#include <lights_physical_pars_fragment>
3433#include <transmission_pars_fragment>
3434#include <shadowmap_pars_fragment>
3435#include <bumpmap_pars_fragment>
3436#include <normalmap_pars_fragment>
3437#include <clearcoat_pars_fragment>
3438#include <iridescence_pars_fragment>
3439#include <roughnessmap_pars_fragment>
3440#include <metalnessmap_pars_fragment>
3441#include <logdepthbuf_pars_fragment>
3442#include <clipping_planes_pars_fragment>
3443void main() {
3444	vec4 diffuseColor = vec4( diffuse, opacity );
3445	#include <clipping_planes_fragment>
3446	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3447	vec3 totalEmissiveRadiance = emissive;
3448	#include <logdepthbuf_fragment>
3449	#include <map_fragment>
3450	#include <color_fragment>
3451	#include <alphamap_fragment>
3452	#include <alphatest_fragment>
3453	#include <alphahash_fragment>
3454	#include <roughnessmap_fragment>
3455	#include <metalnessmap_fragment>
3456	#include <normal_fragment_begin>
3457	#include <normal_fragment_maps>
3458	#include <clearcoat_normal_fragment_begin>
3459	#include <clearcoat_normal_fragment_maps>
3460	#include <emissivemap_fragment>
3461	#include <lights_physical_fragment>
3462	#include <lights_fragment_begin>
3463	#include <lights_fragment_maps>
3464	#include <lights_fragment_end>
3465	#include <aomap_fragment>
3466	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3467	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3468	#include <transmission_fragment>
3469	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3470	#ifdef USE_SHEEN
3471 
3472		outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
3473 
3474 	#endif
3475	#ifdef USE_CLEARCOAT
3476		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3477		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3478		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3479	#endif
3480	#include <opaque_fragment>
3481	#include <tonemapping_fragment>
3482	#include <colorspace_fragment>
3483	#include <fog_fragment>
3484	#include <premultiplied_alpha_fragment>
3485	#include <dithering_fragment>
3486}`,p1=`#define TOON
3487varying vec3 vViewPosition;
3488#include <common>
3489#include <batching_pars_vertex>
3490#include <uv_pars_vertex>
3491#include <displacementmap_pars_vertex>
3492#include <color_pars_vertex>
3493#include <fog_pars_vertex>
3494#include <normal_pars_vertex>
3495#include <morphtarget_pars_vertex>
3496#include <skinning_pars_vertex>
3497#include <shadowmap_pars_vertex>
3498#include <logdepthbuf_pars_vertex>
3499#include <clipping_planes_pars_vertex>
3500void main() {
3501	#include <uv_vertex>
3502	#include <color_vertex>
3503	#include <morphinstance_vertex>
3504	#include <morphcolor_vertex>
3505	#include <batching_vertex>
3506	#include <beginnormal_vertex>
3507	#include <morphnormal_vertex>
3508	#include <skinbase_vertex>
3509	#include <skinnormal_vertex>
3510	#include <defaultnormal_vertex>
3511	#include <normal_vertex>
3512	#include <begin_vertex>
3513	#include <morphtarget_vertex>
3514	#include <skinning_vertex>
3515	#include <displacementmap_vertex>
3516	#include <project_vertex>
3517	#include <logdepthbuf_vertex>
3518	#include <clipping_planes_vertex>
3519	vViewPosition = - mvPosition.xyz;
3520	#include <worldpos_vertex>
3521	#include <shadowmap_vertex>
3522	#include <fog_vertex>
3523}`,m1=`#define TOON
3524uniform vec3 diffuse;
3525uniform vec3 emissive;
3526uniform float opacity;
3527#include <common>
3528#include <dithering_pars_fragment>
3529#include <color_pars_fragment>
3530#include <uv_pars_fragment>
3531#include <map_pars_fragment>
3532#include <alphamap_pars_fragment>
3533#include <alphatest_pars_fragment>
3534#include <alphahash_pars_fragment>
3535#include <aomap_pars_fragment>
3536#include <lightmap_pars_fragment>
3537#include <emissivemap_pars_fragment>
3538#include <gradientmap_pars_fragment>
3539#include <fog_pars_fragment>
3540#include <bsdfs>
3541#include <lights_pars_begin>
3542#include <normal_pars_fragment>
3543#include <lights_toon_pars_fragment>
3544#include <shadowmap_pars_fragment>
3545#include <bumpmap_pars_fragment>
3546#include <normalmap_pars_fragment>
3547#include <logdepthbuf_pars_fragment>
3548#include <clipping_planes_pars_fragment>
3549void main() {
3550	vec4 diffuseColor = vec4( diffuse, opacity );
3551	#include <clipping_planes_fragment>
3552	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3553	vec3 totalEmissiveRadiance = emissive;
3554	#include <logdepthbuf_fragment>
3555	#include <map_fragment>
3556	#include <color_fragment>
3557	#include <alphamap_fragment>
3558	#include <alphatest_fragment>
3559	#include <alphahash_fragment>
3560	#include <normal_fragment_begin>
3561	#include <normal_fragment_maps>
3562	#include <emissivemap_fragment>
3563	#include <lights_toon_fragment>
3564	#include <lights_fragment_begin>
3565	#include <lights_fragment_maps>
3566	#include <lights_fragment_end>
3567	#include <aomap_fragment>
3568	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3569	#include <opaque_fragment>
3570	#include <tonemapping_fragment>
3571	#include <colorspace_fragment>
3572	#include <fog_fragment>
3573	#include <premultiplied_alpha_fragment>
3574	#include <dithering_fragment>
3575}`,g1=`uniform float size;
3576uniform float scale;
3577#include <common>
3578#include <color_pars_vertex>
3579#include <fog_pars_vertex>
3580#include <morphtarget_pars_vertex>
3581#include <logdepthbuf_pars_vertex>
3582#include <clipping_planes_pars_vertex>
3583#ifdef USE_POINTS_UV
3584	varying vec2 vUv;
3585	uniform mat3 uvTransform;
3586#endif
3587void main() {
3588	#ifdef USE_POINTS_UV
3589		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3590	#endif
3591	#include <color_vertex>
3592	#include <morphinstance_vertex>
3593	#include <morphcolor_vertex>
3594	#include <begin_vertex>
3595	#include <morphtarget_vertex>
3596	#include <project_vertex>
3597	gl_PointSize = size;
3598	#ifdef USE_SIZEATTENUATION
3599		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3600		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3601	#endif
3602	#include <logdepthbuf_vertex>
3603	#include <clipping_planes_vertex>
3604	#include <worldpos_vertex>
3605	#include <fog_vertex>
3606}`,v1=`uniform vec3 diffuse;
3607uniform float opacity;
3608#include <common>
3609#include <color_pars_fragment>
3610#include <map_particle_pars_fragment>
3611#include <alphatest_pars_fragment>
3612#include <alphahash_pars_fragment>
3613#include <fog_pars_fragment>
3614#include <logdepthbuf_pars_fragment>
3615#include <clipping_planes_pars_fragment>
3616void main() {
3617	vec4 diffuseColor = vec4( diffuse, opacity );
3618	#include <clipping_planes_fragment>
3619	vec3 outgoingLight = vec3( 0.0 );
3620	#include <logdepthbuf_fragment>
3621	#include <map_particle_fragment>
3622	#include <color_fragment>
3623	#include <alphatest_fragment>
3624	#include <alphahash_fragment>
3625	outgoingLight = diffuseColor.rgb;
3626	#include <opaque_fragment>
3627	#include <tonemapping_fragment>
3628	#include <colorspace_fragment>
3629	#include <fog_fragment>
3630	#include <premultiplied_alpha_fragment>
3631}`,_1=`#include <common>
3632#include <batching_pars_vertex>
3633#include <fog_pars_vertex>
3634#include <morphtarget_pars_vertex>
3635#include <skinning_pars_vertex>
3636#include <logdepthbuf_pars_vertex>
3637#include <shadowmap_pars_vertex>
3638void main() {
3639	#include <batching_vertex>
3640	#include <beginnormal_vertex>
3641	#include <morphinstance_vertex>
3642	#include <morphnormal_vertex>
3643	#include <skinbase_vertex>
3644	#include <skinnormal_vertex>
3645	#include <defaultnormal_vertex>
3646	#include <begin_vertex>
3647	#include <morphtarget_vertex>
3648	#include <skinning_vertex>
3649	#include <project_vertex>
3650	#include <logdepthbuf_vertex>
3651	#include <worldpos_vertex>
3652	#include <shadowmap_vertex>
3653	#include <fog_vertex>
3654}`,x1=`uniform vec3 color;
3655uniform float opacity;
3656#include <common>
3657#include <fog_pars_fragment>
3658#include <bsdfs>
3659#include <lights_pars_begin>
3660#include <logdepthbuf_pars_fragment>
3661#include <shadowmap_pars_fragment>
3662#include <shadowmask_pars_fragment>
3663void main() {
3664	#include <logdepthbuf_fragment>
3665	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3666	#include <tonemapping_fragment>
3667	#include <colorspace_fragment>
3668	#include <fog_fragment>
3669	#include <premultiplied_alpha_fragment>
3670}`,S1=`uniform float rotation;
3671uniform vec2 center;
3672#include <common>
3673#include <uv_pars_vertex>
3674#include <fog_pars_vertex>
3675#include <logdepthbuf_pars_vertex>
3676#include <clipping_planes_pars_vertex>
3677void main() {
3678	#include <uv_vertex>
3679	vec4 mvPosition = modelViewMatrix[ 3 ];
3680	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3681	#ifndef USE_SIZEATTENUATION
3682		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3683		if ( isPerspective ) scale *= - mvPosition.z;
3684	#endif
3685	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3686	vec2 rotatedPosition;
3687	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3688	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3689	mvPosition.xy += rotatedPosition;
3690	gl_Position = projectionMatrix * mvPosition;
3691	#include <logdepthbuf_vertex>
3692	#include <clipping_planes_vertex>
3693	#include <fog_vertex>
3694}
3694`,y1=`uniform vec3 diffuse;
3695uniform float opacity;
3696#include <common>
3697#include <uv_pars_fragment>
3698#include <map_pars_fragment>
3699#include <alphamap_pars_fragment>
3700#include <alphatest_pars_fragment>
3701#include <alphahash_pars_fragment>
3702#include <fog_pars_fragment>
3703#include <logdepthbuf_pars_fragment>
3704#include <clipping_planes_pars_fragment>
3705void main() {
3706	vec4 diffuseColor = vec4( diffuse, opacity );
3707	#include <clipping_planes_fragment>
3708	vec3 outgoingLight = vec3( 0.0 );
3709	#include <logdepthbuf_fragment>
3710	#include <map_fragment>
3711	#include <alphamap_fragment>
3712	#include <alphatest_fragment>
3713	#include <alphahash_fragment>
3714	outgoingLight = diffuseColor.rgb;
3715	#include <opaque_fragment>
3716	#include <tonemapping_fragment>
3717	#include <colorspace_fragment>
3718	#include <fog_fragment>
3719}`,dt={alphahash_fragment:HM,alphahash_pars_fragment:GM,alphamap_fragment:WM,alphamap_pars_fragment:XM,alphatest_fragment:$M,alphatest_pars_fragment:qM,aomap_fragment:YM,aomap_pars_fragment:KM,batching_pars_vertex:jM,batching_vertex:QM,begin_vertex:ZM,beginnormal_vertex:JM,bsdfs:eE,iridescence_fragment:tE,bumpmap_pars_fragment:nE,clipping_planes_fragment:iE,clipping_planes_pars_fragment:sE,clipping_planes_pars_vertex:rE,clipping_planes_vertex:oE,color_fragment:aE,color_pars_fragment:lE,color_pars_vertex:uE,color_vertex:cE,common:hE,cube_uv_reflection_fragment:fE,defaultnormal_vertex:dE,displacementmap_pars_vertex:pE,displacementmap_vertex:mE,emissivemap_fragment:gE,emissivemap_pars_fragment:vE,colorspace_fragment:_E,colorspace_pars_fragment:xE,envmap_fragment:SE,envmap_common_pars_fragment:yE,envmap_pars_fragment:ME,envmap_pars_vertex:EE,envmap_physical_pars_fragment:IE,envmap_vertex:wE,fog_vertex:bE,fog_pars_vertex:TE,fog_fragment:CE,fog_pars_fragment:AE,gradientmap_pars_fragment:RE,lightmap_pars_fragment:PE,lights_lambert_fragment:NE,lights_lambert_pars_fragment:LE,lights_pars_begin:DE,lights_toon_fragment:UE,lights_toon_pars_fragment:FE,lights_phong_fragment:OE,lights_phong_pars_fragment:kE,lights_physical_fragment:BE,lights_physical_pars_fragment:zE,lights_fragment_begin:VE,lights_fragment_maps:HE,lights_fragment_end:GE,lightprobes_pars_fragment:WE,logdepthbuf_fragment:XE,logdepthbuf_pars_fragment:$E,logdepthbuf_pars_vertex:qE,logdepthbuf_vertex:YE,map_fragment:KE,map_pars_fragment:jE,map_particle_fragment:QE,map_particle_pars_fragment:ZE,metalnessmap_fragment:JE,metalnessmap_pars_fragment:ew,morphinstance_vertex:tw,morphcolor_vertex:nw,morphnormal_vertex:iw,morphtarget_pars_vertex:sw,morphtarget_vertex:rw,normal_fragment_begin:ow,normal_fragment_maps:aw,normal_pars_fragment:lw,normal_pars_vertex:uw,normal_vertex:cw,normalmap_pars_fragment:hw,clearcoat_normal_fragment_begin:fw,clearcoat_normal_fragment_maps:dw,clearcoat_pars_fragment:pw,iridescence_pars_fragment:mw,opaque_fragment:gw,packing:vw,premultiplied_alpha_fragment:_w,project_vertex:xw,dithering_fragment:Sw,dithering_pars_fragment:yw,roughnessmap_fragment:Mw,roughnessmap_pars_fragment:Ew,shadowmap_pars_fragment:ww,shadowmap_pars_vertex:bw,shadowmap_vertex:Tw,shadowmask_pars_fragment:Cw,skinbase_vertex:Aw,skinning_pars_vertex:Rw,skinning_vertex:Pw,skinnormal_vertex:Nw,specularmap_fragment:Lw,specularmap_pars_fragment:Dw,tonemapping_fragment:Iw,tonemapping_pars_fragment:Uw,transmission_fragment:Fw,transmission_pars_fragment:Ow,uv_pars_fragment:kw,uv_pars_vertex:Bw,uv_vertex:zw,worldpos_vertex:Vw,background_vert:Hw,background_frag:Gw,backgroundCube_vert:Ww,backgroundCube_frag:Xw,cube_vert:$w,cube_frag:qw,depth_vert:Yw,depth_frag:Kw,distance_vert:jw,distance_frag:Qw,equirect_vert:Zw,equirect_frag:Jw,linedashed_vert:e1,linedashed_frag:t1,meshbasic_vert:n1,meshbasic_frag:i1,meshlambert_vert:s1,meshlambert_frag:r1,meshmatcap_vert:o1,meshmatcap_frag:a1,meshnormal_vert:l1,meshnormal_frag:u1,meshphong_vert:c1,meshphong_frag:h1,meshphysical_vert:f1,meshphysical_frag:d1,meshtoon_vert:p1,meshtoon_frag:m1,points_vert:g1,points_frag:v1,shadow_vert:_1,shadow_frag:x1,sprite_vert:S1,sprite_frag:y1},Ue={common:{diffuse:{value:new Rt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ct},alphaMap:{value:null},alphaMapTransform:{value:new ct},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ct}},envmap:{envMap:{value:null},envMapRotation:{value:new ct},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ct}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ct}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ct},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ct},normalScale:{value:new Tt(1,1)}}
vendor: 7,572 bytes, line 3719
3719,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ct},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ct}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ct}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ct}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Rt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new se},probesMax:{value:new se},probesResolution:{value:new se}},points:{diffuse:{value:new Rt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ct},alphaTest:{value:0},uvTransform:{value:new ct}},sprite:{diffuse:{value:new Rt(16777215)},opacity:{value:1},center:{value:new Tt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ct},alphaMap:{value:null},alphaMapTransform:{value:new ct},alphaTest:{value:0}}},ki={basic:{uniforms:In([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.fog]),vertexShader:dt.meshbasic_vert,fragmentShader:dt.meshbasic_frag},lambert:{uniforms:In([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,Ue.lights,{emissive:{value:new Rt(0)},envMapIntensity:{value:1}}]),vertexShader:dt.meshlambert_vert,fragmentShader:dt.meshlambert_frag},phong:{uniforms:In([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,Ue.lights,{emissive:{value:new Rt(0)},specular:{value:new Rt(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:dt.meshphong_vert,fragmentShader:dt.meshphong_frag},standard:{uniforms:In([Ue.common,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.roughnessmap,Ue.metalnessmap,Ue.fog,Ue.lights,{emissive:{value:new Rt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:dt.meshphysical_vert,fragmentShader:dt.meshphysical_frag},toon:{uniforms:In([Ue.common,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.gradientmap,Ue.fog,Ue.lights,{emissive:{value:new Rt(0)}}]),vertexShader:dt.meshtoon_vert,fragmentShader:dt.meshtoon_frag},matcap:{uniforms:In([Ue.common,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,{matcap:{value:null}}]),vertexShader:dt.meshmatcap_vert,fragmentShader:dt.meshmatcap_frag},points:{uniforms:In([Ue.points,Ue.fog]),vertexShader:dt.points_vert,fragmentShader:dt.points_frag},dashed:{uniforms:In([Ue.common,Ue.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:dt.linedashed_vert,fragmentShader:dt.linedashed_frag},depth:{uniforms:In([Ue.common,Ue.displacementmap]),vertexShader:dt.depth_vert,fragmentShader:dt.depth_frag},normal:{uniforms:In([Ue.common,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,{opacity:{value:1}}]),vertexShader:dt.meshnormal_vert,fragmentShader:dt.meshnormal_frag},sprite:{uniforms:In([Ue.sprite,Ue.fog]),vertexShader:dt.sprite_vert,fragmentShader:dt.sprite_frag},background:{uniforms:{uvTransform:{value:new ct},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:dt.background_vert,fragmentShader:dt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ct}},vertexShader:dt.backgroundCube_vert,fragmentShader:dt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:dt.cube_vert,fragmentShader:dt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:dt.equirect_vert,fragmentShader:dt.equirect_frag},distance:{uniforms:In([Ue.common,Ue.displacementmap,{referencePosition:{value:new se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:dt.distance_vert,fragmentShader:dt.distance_frag},shadow:{uniforms:In([Ue.lights,Ue.fog,{color:{value:new Rt(0)},opacity:{value:1}}]),vertexShader:dt.shadow_vert,fragmentShader:dt.shadow_frag}};ki.physical={uniforms:In([ki.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ct},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ct},clearcoatNormalScale:{value:new Tt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ct},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ct},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ct},sheen:{value:0},sheenColor:{value:new Rt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ct},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ct},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ct},transmissionSamplerSize:{value:new Tt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ct},attenuationDistance:{value:0},attenuationColor:{value:new Rt(0)},specularColor:{value:new Rt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ct},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ct},anisotropyVector:{value:new Tt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ct}}]),vertexShader:dt.meshphysical_vert,fragmentShader:dt.meshphysical_frag};const pu={r:0,b:0,g:0},M1=new on,F_=new ct;F_.set(-1,0,0,0,1,0,0,0,1);function E1(s,e,t,n,r,a){const u=new Rt(0);let c=r===!0?0:1,h,d,p=null,m=0,v=null;function x(P){let U=P.isScene===!0?P.background:null;if(U&&U.isTexture){const T=P.backgroundBlurriness>0;U=e.get(U,T)}return U}function M(P){let U=!1;const T=x(P);T===null?y(u,c):T&&T.isColor&&(y(T,1),U=!0);const N=s.xr.getEnvironmentBlendMode();N==="additive"?t.buffers.color.setClear(0,0,0,1,a):N==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,a),(s.autoClear||U)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function b(P,U){const T=x(U);T&&(T.isCubeTexture||T.mapping===ju)?(d===void 0&&(d=new ti(new Va(1,1,1),new Ai({name:"Backgroun
3719dCubeMaterial",uniforms:Po(ki.backgroundCube.uniforms),vertexShader:ki.backgroundCube.vertexShader,fragmentShader:ki.backgroundCube.fragmentShader,side:qn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(N,R,F){this.matrixWorld.copyPosition(F.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(d)),d.material.uniforms.envMap.value=T,d.material.uniforms.backgroundBlurriness.value=U.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=U.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(M1.makeRotationFromEuler(U.backgroundRotation)).transpose(),T.isCubeTexture&&T.isRenderTargetTexture===!1&&d.material.uniforms.backgroundRotation.value.premultiply(F_),d.material.toneMapped=xt.getTransfer(T.colorSpace)!==It,(p!==T||m!==T.version||v!==s.toneMapping)&&(d.material.needsUpdate=!0,p=T,m=T.version,v=s.toneMapping),d.layers.enableAll(),P.unshift(d,d.geometry,d.material,0,0,null)):T&&T.isTexture&&(h===void 0&&(h=new ti(new Ha(2,2),new Ai({name:"BackgroundMaterial",uniforms:Po(ki.background.uniforms),vertexShader:ki.background.vertexShader,fragmentShader:ki.background.fragmentShader,side:Ws,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(h)),h.material.uniforms.t2D.value=T,h.material.uniforms.backgroundIntensity.value=U.backgroundIntensity,h.material.toneMapped=xt.getTransfer(T.colorSpace)!==It,T.matrixAutoUpdate===!0&&T.updateMatrix(),h.material.uniforms.uvTransform.value.copy(T.matrix),(p!==T||m!==T.version||v!==s.toneMapping)&&(h.material.needsUpdate=!0,p=T,m=T.version,v=s.toneMapping),h.layers.enableAll(),P.unshift(h,h.geometry,h.material,0,0,null))}function y(P,U){P.getRGB(pu,L_(s)),t.buffers.color.setClear(pu.r,pu.g,pu.b,U,a)}function S(){d!==void 0&&(d.geometry.dispose(),d.material.dispose(),d=void 0),h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0)}return{getClearColor:function(){return u},setClearColor:function(P,U=1){u.set(P),c=U,y(u,c)},getClearAlpha:function(){return c},setClearAlpha:function(P){c=P,y(u,c)},render:M,addToRenderList:b,dispose:S}}function w1(s,e){const t=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},r=v(null);let a=r,u=!1;function c(B,G,J,oe,Y){let ie=!1;const K=m(B,oe,J,G);a!==K&&(a=K,d(a.object)),ie=x(B,oe,J,Y),ie&&M(B,oe,J,Y),Y!==null&&e.update(Y,s.ELEMENT_ARRAY_BUFFER),(ie||u)&&(u=!1,T(B,G,J,oe),Y!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.get(Y).buffer))}function h(){return s.createVertexArray()}function d(B){return s.bindVertexArray(B)}function p(B){return s.deleteVertexArray(B)}function m(B,G,J,oe){const Y=oe.wireframe===!0;let ie=n[G.id];ie===void 0&&(ie={},n[G.id]=ie);const K=B.isInstancedMesh===!0?B.id:0;let $=ie[K];$===void 0&&($={},ie[K]=$);let le=$[J.id];le===void 0&&(le={},$[J.id]=le);let ue=le[Y];return ue===void 0&&(ue=v(h()),le[Y]=ue),ue}function v(B){const G=[],J=[],oe=[];for(let Y=0;Y<t;Y++)G[Y]=0,J[Y]=0,oe[Y]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:G,enabledAttributes:J,attributeDivisors:oe,object:B,attributes:{},index:null}}function x(B,G,J,oe){const Y=a.attributes,ie=G.attributes;let K=0;const $=J.getAttributes();for(const le in $)if($[le].location>=0){const k=Y[le];let Q=ie[le];if(Q===void 0&&(le==="instanceMatrix"&&B.instanceMatrix&&(Q=B.instanceMatrix),le==="instanceColor"&&B.instanceColor&&(Q=B.instanceColor)),k===void 0||k.attribute!==Q||Q&&k.data!==Q.data)return!0;K++}return a.attributesNum!==K||a.index!==oe}function M(B,G,J,oe){const Y={},ie=G.attributes;let K=0;const $=J.getAttributes();for(const le in $)if($[le].location>=0){let k=ie[le];k===void 0&&(le==="instanceMatrix"&&B.instanceMatrix&&(k=B.instanceMatrix),le==="instanceColor"&&B.instanceColor&&(k=B.instanceColor));const Q={};Q.attribute=k,k&&k.data&&(Q.data=k.data),Y[le]=Q,K++}a.attributes=Y,a.attributesNum=K,a.index=oe}function b(){const B=a.newAttributes;for(let G=0,J=B.length;G<J;G++)B[G]=0}function y(B){S(B,0)}function S(B,G){const J=a.newAttributes,oe=a.enabledAttributes,Y=a.attributeDivisors;J[B]=1,oe[B]===0&&(s.enableVertexAttribArray(B),oe[B]=1),Y[B]!==G&&(s.vertexAttribDivisor(B,G),Y[B]=G)}function P(){const B=a.newAttributes,G=a.enabledAttributes;for(let J=0,oe=G.length;J<oe;J++)G[J]!==B[J]&&(s.disableVertexAttribArray(J),G[J]=0)}function U(B,G,J,oe,Y,ie,K){K===!0?s.vertexAttribIPointer(B,G,J,Y,ie):s.vertexAttribPointer(B,G,J,oe,Y,ie)}function T(B,G,J,oe){b();const Y=oe.attributes,ie=J.getAttributes(),K=G.defaultAttributeValues;for(const $ in ie){const le=ie[$];if(le.location>=0){let ue=Y[$];if(ue===void 0&&($==="instanceMatrix"&&B.instanceMatrix&&(ue=B.instanceMatrix),$==="instanceColor"&&B.instanceColor&&(ue=B.instanceColor)),ue!==void 0){const k=ue.normalized,Q=ue.itemSize,De=e.get(ue);if(De===void 0)continue;const He=De.buffer,Be=De.type,ae=De.bytesPerElement,ve=Be===s.INT||Be===s.UNSIGNED_INT||ue.gpuType===qd;
vendor: 9,292 bytes, line 3719
3719if(ue.isInterleavedBufferAttribute){const pe=ue.data,Fe=pe.stride,Qe=ue.offset;if(pe.isInstancedInterleavedBuffer){for(let Je=0;Je<le.locationSize;Je++)S(le.location+Je,pe.meshPerAttribute);B.isInstancedMesh!==!0&&oe._maxInstanceCount===void 0&&(oe._maxInstanceCount=pe.meshPerAttribute*pe.count)}else for(let Je=0;Je<le.locationSize;Je++)y(le.location+Je);s.bindBuffer(s.ARRAY_BUFFER,He);for(let Je=0;Je<le.locationSize;Je++)U(le.location+Je,Q/le.locationSize,Be,k,Fe*ae,(Qe+Q/le.locationSize*Je)*ae,ve)}else{if(ue.isInstancedBufferAttribute){for(let pe=0;pe<le.locationSize;pe++)S(le.location+pe,ue.meshPerAttribute);B.isInstancedMesh!==!0&&oe._maxInstanceCount===void 0&&(oe._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let pe=0;pe<le.locationSize;pe++)y(le.location+pe);s.bindBuffer(s.ARRAY_BUFFER,He);for(let pe=0;pe<le.locationSize;pe++)U(le.location+pe,Q/le.locationSize,Be,k,Q*ae,Q/le.locationSize*pe*ae,ve)}}else if(K!==void 0){const k=K[$];if(k!==void 0)switch(k.length){case 2:s.vertexAttrib2fv(le.location,k);break;case 3:s.vertexAttrib3fv(le.location,k);break;case 4:s.vertexAttrib4fv(le.location,k);break;default:s.vertexAttrib1fv(le.location,k)}}}}P()}function N(){L();for(const B in n){const G=n[B];for(const J in G){const oe=G[J];for(const Y in oe){const ie=oe[Y];for(const K in ie)p(ie[K].object),delete ie[K];delete oe[Y]}}delete n[B]}}function R(B){if(n[B.id]===void 0)return;const G=n[B.id];for(const J in G){const oe=G[J];for(const Y in oe){const ie=oe[Y];for(const K in ie)p(ie[K].object),delete ie[K];delete oe[Y]}}delete n[B.id]}function F(B){for(const G in n){const J=n[G];for(const oe in J){const Y=J[oe];if(Y[B.id]===void 0)continue;const ie=Y[B.id];for(const K in ie)p(ie[K].object),delete ie[K];delete Y[B.id]}}}function w(B){for(const G in n){const J=n[G],oe=B.isInstancedMesh===!0?B.id:0,Y=J[oe];if(Y!==void 0){for(const ie in Y){const K=Y[ie];for(const $ in K)p(K[$].object),delete K[$];delete Y[ie]}delete J[oe],Object.keys(J).length===0&&delete n[G]}}}function L(){z(),u=!0,a!==r&&(a=r,d(a.object))}function z(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:c,reset:L,resetDefaultState:z,dispose:N,releaseStatesOfGeometry:R,releaseStatesOfObject:w,releaseStatesOfProgram:F,initAttributes:b,enableAttribute:y,disableUnusedAttributes:P}}function b1(s,e,t){let n;function r(h){n=h}function a(h,d){s.drawArrays(n,h,d),t.update(d,n,1)}function u(h,d,p){p!==0&&(s.drawArraysInstanced(n,h,d,p),t.update(d,n,p))}function c(h,d,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,h,0,d,0,p);let v=0;for(let x=0;x<p;x++)v+=d[x];t.update(v,n,1)}this.setMode=r,this.render=a,this.renderInstances=u,this.renderMultiDraw=c}function T1(s,e,t,n){let r;function a(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const F=e.get("EXT_texture_filter_anisotropic");r=s.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function u(F){return!(F!==Ti&&n.convert(F)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function c(F){const w=F===fs&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(F!==di&&n.convert(F)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&F!==Bi&&!w)}function h(F){if(F==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";F="mediump"}return F==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let d=t.precision!==void 0?t.precision:"highp";const p=h(d);p!==d&&(at("WebGLRenderer:",d,"not supported, using",p,"instead."),d=p);const m=t.logarithmicDepthBuffer===!0,v=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control");t.reversedDepthBuffer===!0&&v===!1&&at("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const x=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),M=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),b=s.getParameter(s.MAX_TEXTURE_SIZE),y=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),S=s.getParameter(s.MAX_VERTEX_ATTRIBS),P=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),U=s.getParameter(s.MAX_VARYING_VECTORS),T=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),N=s.getParameter(s.MAX_SAMPLES),R=s.getParameter(s.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:h,textureFormatReadable:u,textureTypeReadable:c,precision:d,logarithmicDepthBuffer:m,reversedDepthBuffer:v,maxTextures:x,maxVertexTextures:M,maxTextureSize:b,maxCubemapSize:y,maxAttributes:S,maxVertexUniforms:P,maxVaryings:U,maxFragmentUniforms:T,maxSamples:N,samples:R}}function C1(s){const e=this;let t=null,n=0,r=!1,a=!1;const u=new gr,c=new ct,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(m,v){const x=m.length!==0||v||n!==0||r;return r=v,n=m.length,x},this.beginShadows=function(){a=!0,p(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(m,v){t=p(m,v,0)},this.setState=function(m,v,x){const M=m.clippingPlanes,b=m.clipIntersection,y=m.clipShadows,S=s.get(m);if(!r||M===null||M.length===0||a&&!y)a?p(null):d();else{const P=a?0:n,U=P*4;let T=S.clippingState||null;h.value=T,T=p(M,v,U,x);for(let N=0;N!==U;++N)T[N]=t[N];S.clippingState=T,this.numIntersection=b?this.numPlanes:0,this.numPlanes+=P}};function d(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function p(m,v,x,M){const b=m!==null?m.length:0;let y=null;if(b!==0){if(y=h.value,M!==!0||y===null){const S=x+b*4,P=v.matrixWorldInverse;c.getNormalMatrix(P),(y===null||y.length<S)&&(y=new Float32Array(S));for(let U=0,T=x;U!==b;++U,T+=4)u.copy(m[U]).applyMatrix4(P,c),u.normal.toArray(y,T),y[T+3]=u.constant}h.value=y,h.needsUpdate=!0}return e.numPlanes=b,e.numIntersection=0,y}}const Hs=4,Ev=[.125,.215,.35,.446,.526,.582],_r=20,A1=256,wa=new I_,wv=new Rt;let vf=null,_f=0,xf=0,Sf=!1;const R1=new se;class bv{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,a={}){const{size:u=256,position:c=R1}=a;vf=this._renderer.getRenderTarget(),_f=this._renderer.getActiveCubeFace(),xf=this._renderer.getActiveMipmapLevel(),Sf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(u);const h=this._allocateTargets();return h.depthBuffer=!0,this._sceneToCubeUV(e,n,r,h,c),t>0&&this._blur(h,0,0,t),this._applyPMREM(h),this._cleanup(h),h}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Av(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Cv(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.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._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(vf,_f,xf),this._renderer.xr.enabled=Sf,e.scissorTest=!1,mo(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===yr||e.mapping===Ao?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),vf=this._renderer.getRenderTarget(),_f=this._renderer.getActiveCubeFace(),xf=this._renderer.getActiveMipmapLevel(),Sf=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:mn,minFilter:mn,generateMipmaps:!1,type:fs,format:Ti,colorSpace:Ou,depthBuffer:!1},r=Tv(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Tv(e,t,n);const{_lodMax:a}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=P1(a)),this._blurMaterial=L1(a,e,t),this._ggxMaterial=N1(a,e,t)}return r}_compileMaterial(e){const t=new ti(new Ri,e);this._renderer.compile(t,wa)}_sceneToCubeUV(e,t,n,r,a){const h=new fi(90,1,t,n),d=[1,-1,1,1,1,1],p=[1,1,1,-1,-1,-1],m=this._renderer,v=m.autoClear,x=m.toneMapping;m.getClearColor(wv),m.toneMapping=Ci,m.autoClear=!1,m.state.buffers.depth.getReversed()&&(m.setRenderTarget(r),m.clearDepth(),m.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new ti(new Va,new zu({name:"PMREM.Backgroun
3719d",side:qn,depthWrite:!1,depthTest:!1})));const b=this._backgroundBox,y=b.material;let S=!1;const P=e.background;P?P.isColor&&(y.color.copy(P),e.background=null,S=!0):(y.color.copy(wv),S=!0);for(let U=0;U<6;U++){const T=U%3;T===0?(h.up.set(0,d[U],0),h.position.set(a.x,a.y,a.z),h.lookAt(a.x+p[U],a.y,a.z)):T===1?(h.up.set(0,0,d[U]),h.position.set(a.x,a.y,a.z),h.lookAt(a.x,a.y+p[U],a.z)):(h.up.set(0,d[U],0),h.position.set(a.x,a.y,a.z),h.lookAt(a.x,a.y,a.z+p[U]));const N=this._cubeSize;mo(r,T*N,U>2?N:0,N,N),m.setRenderTarget(r),S&&m.render(b,h),m.render(e,h)}m.toneMapping=x,m.autoClear=v,e.background=P}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===yr||e.mapping===Ao;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Av()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Cv());const a=r?this._cubemapMaterial:this._equirectMaterial,u=this._lodMeshes[0];u.material=a;const c=a.uniforms;c.envMap.value=e;const h=this._cubeSize;mo(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(u,wa)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodMeshes.length;for(let a=1;a<r;a++)this._applyGGXFilter(e,a-1,a);t.autoClear=n}_applyGGXFilter(e,t,n){const r=this._renderer,a=this._pingPongRenderTarget,u=this._ggxMaterial,c=this._lodMeshes[n];c.material=u;const h=u.uniforms,d=n/(this._lodMeshes.length-1),p=t/(this._lodMeshes.length-1),m=Math.sqrt(d*d-p*p),v=0+d*1.25,x=m*v,{_lodMax:M}=this,b=this._sizeLods[n],y=3*b*(n>M-Hs?n-M+Hs:0),S=4*(this._cubeSize-b);h.envMap.value=e.texture,h.roughness.value=x,h.mipInt.value=M-t,mo(a,y,S,3*b,2*b),r.setRenderTarget(a),r.render(c,wa),h.envMap.value=a.texture,h.roughness.value=0,h.mipInt.value=M-n,mo(e,y,S,3*b,2*b),r.setRenderTarget(e),r.render(c,wa)}_blur(e,t,n,r,a){const u=this._pingPongRenderTarget;this._halfBlur(e,u,t,n,r,"latitudinal",a),this._halfBlur(u,e,n,n,r,"longitudinal",a)}_halfBlur(e,t,n,r,a,u,c){const h=this._renderer,d=this._blurMaterial;u!=="latitudinal"&&u!=="longitudinal"&&wt("blur direction must be either latitudinal or longitudinal!");const p=3,m=this._lodMeshes[r];m.material=d;const v=d.uniforms,x=this._sizeLods[n]-1,M=isFinite(a)?Math.PI/(2*x):2*Math.PI/(2*_r-1),b=a/M,y=isFinite(a)?1+Math.floor(p*b):_r;y>_r&&at(`sigmaRadians, ${a}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${_r}`);const S=[];let P=0;for(let F=0;F<_r;++F){const w=F/b,L=Math.exp(-w*w/2);S.push(L),F===0?P+=L:F<y&&(P+=2*L)}for(let F=0;F<S.length;F++)S[F]=S[F]/P;v.envMap.value=e.texture,v.samples.value=y,v.weights.value=S,v.latitudinal.value=u==="latitudinal",c&&(v.poleAxis.value=c);const{_lodMax:U}=this;v.dTheta.value=M,v.mipInt.value=U-n;const T=this._sizeLods[r],N=3*T*(r>U-Hs?r-U+Hs:0),R=4*(this._cubeSize-T);mo(t,N,R,3*T,2*T),h.setRenderTarget(t),h.render(m,wa)}}function P1(s){const e=[],t=[],n=[];let r=s;const a=s-Hs+1+Ev.length;for(let u=0;u<a;u++){const c=Math.pow(2,r);e.push(c);let h=1/c;u>s-Hs?h=Ev[u-s+Hs-1]:u===0&&(h=0),t.push(h);const d=1/(c-2),p=-d,m=1+d,v=[p,p,m,p,m,m,p,p,m,m,p,m],x=6,M=6,b=3,y=2,S=1,P=new Float32Array(b*M*x),U=new Float32Array(y*M*x),T=new Float32Array(S*M*x);for(let R=0;R<x;R++){const F=R%3*2/3-1,w=R>2?0:-1,L=[F,w,0,F+2/3,w,0,F+2/3,w+1,0,F,w,0,F+2/3,w+1,0,F,w+1,0];P.set(L,b*M*R),U.set(v,y*M*R);const z=[R,R,R,R,R,R];T.set(z,S*M*R)}const N=new Ri;N.setAttribute("position",new Hi(P,b)),N.setAttribute("uv",new Hi(U,y)),N.setAttribute("faceIndex",new Hi(T,S)),n.push(new ti(N,null)),r>Hs&&r--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function Tv(s,e,t){const n=new Vi(s,e,t);return n.texture.mapping=ju,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function mo(s,e,t,n,r){s.viewport.set(e,t,n,r),s.scissor.set(e,t,n,r)}function N1(s,e,t){return new Ai({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:A1,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Zu(),fragmentShader:`
3720
3721			precision highp float;
3722			precision highp int;
3723
3724			varying vec3 vOutputDirection;
3725
3726			uniform sampler2D envMap;
3727			uniform float roughness;
3728			uniform float mipInt;
3729
3730			#define ENVMAP_TYPE_CUBE_UV
3731			#include <cube_uv_reflection_fragment>
3732
3733			#define PI 3.14159265359
3734
3735			// Van der Corput radical inverse
3736			float radicalInverse_VdC(uint bits) {
3737				bits = (bits << 16u) | (bits >> 16u);
3738				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
3739				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
3740				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
3741				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
3742				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
3743			}
3744
3745			// Hammersley sequence
3746			vec2 hammersley(uint i, uint N) {
3747				return vec2(float(i) / float(N), radicalInverse_VdC(i));
3748			}
3749
3750			// GGX VNDF importance sampling (Eric Heitz 2018)
3751			// "Sampling the GGX Distribution of Visible Normals"
3752			// https://jcgt.org/published/0007/04/01/
3753			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
3754				float alpha = roughness * roughness;
3755
3756				// Section 4.1: Orthonormal basis
3757				vec3 T1 = vec3(1.0, 0.0, 0.0);
3758				vec3 T2 = cross(V, T1);
3759
3760				// Section 4.2: Parameterization of projected area
3761				float r = sqrt(Xi.x);
3762				float phi = 2.0 * PI * Xi.y;
3763				float t1 = r * cos(phi);
3764				float t2 = r * sin(phi);
3765				float s = 0.5 * (1.0 + V.z);
3766				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
3767
3768				// Section 4.3: Reprojection onto hemisphere
3769				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
3770
3771				// Section 3.4: Transform back to ellipsoid configuration
3772				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
3773			}
3774
3775			void main() {
3776				vec3 N = normalize(vOutputDirection);
3777				vec3 V = N; // Assume view direction equals normal for pre-filtering
3778
3779				vec3 prefilteredColor = vec3(0.0);
3780				float totalWeight = 0.0;
3781
3782				// For very low roughness, just sample the environment directly
3783				if (roughness < 0.001) {
3784					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
3785					return;
3786				}
3787
3788				// Tangent space basis for VNDF sampling
3789				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
3790				vec3 tangent = normalize(cross(up, N));
3791				vec3 bitangent = cross(N, tangent);
3792
3793				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
3794					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
3795
3796					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
3797					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
3798
3799					// Transform H back to world space
3800					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
3801					vec3 L = normalize(2.0 * dot(V, H) * H - V);
3802
3803					float NdotL = max(dot(N, L), 0.0);
3804
3805					if(NdotL > 0.0) {
3806						// Sample environment at fixed mip level
3807						// VNDF importance sampling handles the distribution filtering
3808						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
3809
3810						// Weight by NdotL for the split-sum approximation
3811						// VNDF PDF naturally accounts for the visible microfacet distribution
3812						prefilteredColor += sampleColor * NdotL;
3813						totalWeight += NdotL;
3814					}
3815				}
3816
3817				if (totalWeight > 0.0) {
3818					prefilteredColor = prefilteredColor / totalWeight;
3819				}
3820
3821				gl_FragColor = vec4(prefilteredColor, 1.0);
3822			}
3823		`,blending:cs,depthTest:!1,depthWrite:!1})}function L1(s,e,t){const n=new Float32Array(_r),r=new se(0,1,0);return new Ai({name:"SphericalGaussianBlur",defines:{n:_r,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Zu(),fragmentShader:`
3824
3825			precision mediump float;
3826			precision mediump int;
3827
3828			varying vec3 vOutputDirection;
3829
3830			uniform sampler2D envMap;
3831			uniform int samples;
3832			uniform float weights[ n ];
3833			uniform bool latitudinal;
3834			uniform float dTheta;
3835			uniform float mipInt;
3836			uniform vec3 poleAxis;
3837
3838			#define ENVMAP_TYPE_CUBE_UV
3839			#include <cube_uv_reflection_fragment>
3840
3841			vec3 getSample( float theta, vec3 axis ) {
3842
3843				float cosTheta = cos( theta );
3844				// Rodrigues' axis-angle rotation
3845				vec3 sampleDirection = vOutputDirection * cosTheta
3846					+ cross( axis, vOutputDirection ) * sin( theta )
3847					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3848
3849				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3850
3851			}
3852
3853			void main() {
3854
3855				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3856
3857				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3858
3859					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3860
3861				}
3862
3863				axis = normalize( axis );
3864
3865				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3866				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3867
3868				for ( int i = 1; i < n; i++ ) {
3869
3870					if ( i >= samples ) {
3871
3872						break;
3873
3874					}
3875
3876					float theta = dTheta * float( i );
3877					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3878					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3879
3880				}
3881
3882			}
3883		`,blending:cs,depthTest:!1,depthWrite:!1})}function Cv(){return new Ai({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Zu(),fragmentShader:`
3884
3885			precision mediump float;
3886			precision mediump int;
3887
3888			varying vec3 vOutputDirection;
3889
3890			uniform sampler2D envMap;
3891
3892			#include <common>
3893
3894			void main() {
3895
3896				vec3 outputDirection = normalize( vOutputDirection );
3897				vec2 uv = equirectUv( outputDirection );
3898
3899				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3900
3901			}
3902		`,blending:cs,depthTest:!1,depthWrite:!1})}function Av(){return new Ai({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Zu(),fragmentShader:`
3903
3904			precision mediump float;
3905			precision mediump int;
3906
3907			uniform float flipEnvMap;
3908
3909			varying vec3 vOutputDirection;
3910
3911			uniform samplerCube envMap;
3912
3913			void main() {
3914
3915				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3916
3917			}
3918		`,blending:cs,depthTest:!1,depthWrite:!1})}function Zu(){return`
3919
3920		precision mediump float;
3921		precision mediump int;
3922
3923		attribute float faceIndex;
3924
3925		varying vec3 vOutputDirection;
3926
3927		// RH coordinate system; PMREM face-indexing convention
3928		vec3 getDirection( vec2 uv, float face ) {
3929
3930			uv = 2.0 * uv - 1.0;
3931
3932			vec3 direction = vec3( uv, 1.0 );
3933
3934			if ( face == 0.0 ) {
3935
3936				direction = direction.zyx; // ( 1, v, u ) pos x
3937
3938			} else if ( face == 1.0 ) {
3939
3940				direction = direction.xzy;
3941				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3942
3943			} else if ( face == 2.0 ) {
3944
3945				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3946
3947			} else if ( face == 3.0 ) {
3948
3949				direction = direction.zyx;
3950				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3951
3952			} else if ( face == 4.0 ) {
3953
3954				direction = direction.xzy;
3955				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3956
3957			} else if ( face == 5.0 ) {
3958
3959				direction.z *= -1.0; // ( u, v, -1 ) neg z
3960
3961			}
3962
3963			return direction;
3964
3965		}
3966
3967		void main() {
3968
3969			vOutputDirection = getDirection( uv, faceIndex );
3970			gl_Position = vec4( position, 1.0 );
3971
3972		}
3973	`}class O_ extends Vi{constructor(e=1,t={}
vendor: 26,905 bytes, lines 3973-4089
3973){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new P_(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}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:`
3974
3975				varying vec3 vWorldDirection;
3976
3977				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
3978
3979					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
3980
3981				}
3982
3983				void main() {
3984
3985					vWorldDirection = transformDirection( position, modelMatrix );
3986
3987					#include <begin_vertex>
3988					#include <project_vertex>
3989
3990				}
3991			`,fragmentShader:`
3992
3993				uniform sampler2D tEquirect;
3994
3995				varying vec3 vWorldDirection;
3996
3997				#include <common>
3998
3999				void main() {
4000
4001					vec3 direction = normalize( vWorldDirection );
4002
4003					vec2 sampleUV = equirectUv( direction );
4004
4005					gl_FragColor = texture2D( tEquirect, sampleUV );
4006
4007				}
4008			`},r=new Va(5,5,5),a=new Ai({name:"CubemapFromEquirect",uniforms:Po(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:qn,blending:cs});a.uniforms.tEquirect.value=t;const u=new ti(r,a),c=t.minFilter;return t.minFilter===os&&(t.minFilter=mn),new kM(1,10,this).update(e,u),t.minFilter=c,u.geometry.dispose(),u.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){const a=e.getRenderTarget();for(let u=0;u<6;u++)e.setRenderTarget(this,u),e.clear(t,n,r);e.setRenderTarget(a)}}function D1(s){let e=new WeakMap,t=new WeakMap,n=null;function r(v,x=!1){return v==null?null:x?u(v):a(v)}function a(v){if(v&&v.isTexture){const x=v.mapping;if(x===Hh||x===Gh)if(e.has(v)){const M=e.get(v).texture;return c(M,v.mapping)}else{const M=v.image;if(M&&M.height>0){const b=new O_(M.height);return b.fromEquirectangularTexture(s,v),e.set(v,b),v.addEventListener("dispose",d),c(b.texture,v.mapping)}else return null}}return v}function u(v){if(v&&v.isTexture){const x=v.mapping,M=x===Hh||x===Gh,b=x===yr||x===Ao;if(M||b){let y=t.get(v);const S=y!==void 0?y.texture.pmremVersion:0;if(v.isRenderTargetTexture&&v.pmremVersion!==S)return n===null&&(n=new bv(s)),y=M?n.fromEquirectangular(v,y):n.fromCubemap(v,y),y.texture.pmremVersion=v.pmremVersion,t.set(v,y),y.texture;if(y!==void 0)return y.texture;{const P=v.image;return M&&P&&P.height>0||b&&P&&h(P)?(n===null&&(n=new bv(s)),y=M?n.fromEquirectangular(v):n.fromCubemap(v),y.texture.pmremVersion=v.pmremVersion,t.set(v,y),v.addEventListener("dispose",p),y.texture):null}}}return v}function c(v,x){return x===Hh?v.mapping=yr:x===Gh&&(v.mapping=Ao),v}function h(v){let x=0;const M=6;for(let b=0;b<M;b++)v[b]!==void 0&&x++;return x===M}function d(v){const x=v.target;x.removeEventListener("dispose",d);const M=e.get(x);M!==void 0&&(e.delete(x),M.dispose())}function p(v){const x=v.target;x.removeEventListener("dispose",p);const M=t.get(x);M!==void 0&&(t.delete(x),M.dispose())}function m(){e=new WeakMap,t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:m}}function I1(s){const e={};function t(n){if(e[n]!==void 0)return e[n];const r=s.getExtension(n);return e[n]=r,r}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 r=t(n);return r===null&&Eo("WebGLRenderer: "+n+" extension not supported."),r}}}function U1(s,e,t,n){const r={},a=new WeakMap;function u(m){const v=m.target;v.index!==null&&e.remove(v.index);for(const M in v.attributes)e.remove(v.attributes[M]);v.removeEventListener("dispose",u),delete r[v.id];const x=a.get(v);x&&(e.remove(x),a.delete(v)),n.releaseStatesOfGeometry(v),v.isInstancedBufferGeometry===!0&&delete v._maxInstanceCount,t.memory.geometries--}function c(m,v){return r[v.id]===!0||(v.addEventListener("dispose",u),r[v.id]=!0,t.memory.geometries++),v}function h(m){const v=m.attributes;for(const x in v)e.update(v[x],s.ARRAY_BUFFER)}function d(m){const v=[],x=m.index,M=m.attributes.position;let b=0;if(M===void 0)return;if(x!==null){const P=x.array;b=x.version;for(let U=0,T=P.length;U<T;U+=3){const N=P[U+0],R=P[U+1],F=P[U+2];v.push(N,R,R,F,F,N)}}else{const P=M.array;b=M.version;for(let U=0,T=P.length/3-1;U<T;U+=3){const N=U+0,R=U+1,F=U+2;v.push(N,R,R,F,F,N)}}const y=new(M.count>=65535?A_:C_)(v,1);y.version=b;const S=a.get(m);S&&e.remove(S),a.set(m,y)}function p(m){const v=a.get(m);if(v){const x=m.index;x!==null&&v.version<x.version&&d(m)}else d(m);return a.get(m)}return{get:c,update:h,getWireframeAttribute:p}}function F1(s,e,t){let n;function r(m){n=m}let a,u;function c(m){a=m.type,u=m.bytesPerElement}function h(m,v){s.drawElements(n,v,a,m*u),t.update(v,n,1)}function d(m,v,x){x!==0&&(s.drawElementsInstanced(n,v,a,m*u,x),t.update(v,n,x))}function p(m,v,x){if(x===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,v,0,a,m,0,x);let b=0;for(let y=0;y<x;y++)b+=v[y];t.update(b,n,1)}this.setMode=r,this.setIndex=c,this.render=h,this.renderInstances=d,this.renderMultiDraw=p}function O1(s){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(a,u,c){switch(t.calls++,u){case s.TRIANGLES:t.triangles+=c*(a/3);break;case s.LINES:t.lines+=c*(a/2);break;case s.LINE_STRIP:t.lines+=c*(a-1);break;case s.LINE_LOOP:t.lines+=c*a;break;case s.POINTS:t.points+=c*a;break;default:wt("WebGLInfo: Unknown draw mode:",u);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}function k1(s,e,t){const n=new WeakMap,r=new Jt;function a(u,c,h){const d=u.morphTargetInfluences,p=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,m=p!==void 0?p.length:0;let v=n.get(c);if(v===void 0||v.count!==m){let L=function(){F.dispose(),n.delete(c),c.removeEventListener("dispose",L)};v!==void 0&&v.texture.dispose();const x=c.morphAttributes.position!==void 0,M=c.morphAttributes.normal!==void 0,b=c.morphAttributes.color!==void 0,y=c.morphAttributes.position||[],S=c.morphAttributes.normal||[],P=c.morphAttributes.color||[];let U=0;x===!0&&(U=1),M===!0&&(U=2),b===!0&&(U=3);let T=c.attributes.position.count*U,N=1;T>e.maxTextureSize&&(N=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);const R=new Float32Array(T*N*4*m),F=new w_(R,T,N,m);F.type=Bi,F.needsUpdate=!0;const w=U*4;for(let z=0;z<m;z++){const B=y[z],G=S[z],J=P[z],oe=T*N*4*z;for(let Y=0;Y<B.count;Y++){const ie=Y*w;x===!0&&(r.fromBufferAttribute(B,Y),R[oe+ie+0]=r.x,R[oe+ie+1]=r.y,R[oe+ie+2]=r.z,R[oe+ie+3]=0),M===!0&&(r.fromBufferAttribute(G,Y),R[oe+ie+4]=r.x,R[oe+ie+5]=r.y,R[oe+ie+6]=r.z,R[oe+ie+7]=0),b===!0&&(r.fromBufferAttribute(J,Y),R[oe+ie+8]=r.x,R[oe+ie+9]=r.y,R[oe+ie+10]=r.z,R[oe+ie+11]=J.itemSize===4?r.w:1)}}v={count:m,texture:F,size:new Tt(T,N)},n.set(c,v),c.addEventListener("dispose",L)}if(u.isInstancedMesh===!0&&u.morphTexture!==null)h.getUniforms().setValue(s,"morphTexture",u.morphTexture,t);else{let x=0;for(let b=0;b<d.length;b++)x+=d[b];const M=c.morphTargetsRelative?1:1-x;h.getUniforms().setValue(s,"morphTargetBaseInfluence",M),h.getUniforms().setValue(s,"morphTargetInfluences",d)}h.getUniforms().setValue(s,"morphTargetsTexture",v.texture,t),h.getUniforms().setValue(s,"morphTargetsTextureSize",v.size)}return{update:a}}function B1(s,e,t,n,r){let a=new WeakMap;function u(d){const p=r.render.frame,m=d.geometry,v=e.get(d,m);if(a.get(v)!==p&&(e.update(v),a.set(v,p)),d.isInstancedMesh&&(d.hasEventListener("dispose",h)===!1&&d.addEventListener("dispose",h),a.get(d)!==p&&(t.update(d.instanceMatrix,s.ARRAY_BUFFER),d.instanceColor!==null&&t.update(d.instanceColor,s.ARRAY_BUFFER),a.set(d,p))),d.isSkinnedMesh){const x=d.skeleton;a.get(x)!==p&&(x.update(),a.set(x,p))}return v}function c(){a=new WeakMap}function h(d){const p=d.target;p.removeEventListener("dispose",h),n.releaseStatesOfObject(p),t.remove(p.instanceMatrix),p.instanceColor!==null&&t.remove(p.instanceColor)}return{update:u,dispose:c}}const z1={[l_]:"LINEAR_TONE_MAPPING",[u_]:"REINHARD_TONE_MAPPING",[c_]:"CINEON_TONE_MAPPING",[h_]:"ACES_FILMIC_TONE_MAPPING",[d_]:"AGX_TONE_MAPPING",[p_]:"NEUTRAL_TONE_MAPPING",[f_]:"CUSTOM_TONE_MAPPING"};function V1(s,e,t,n,r,a){const u=new Vi(e,t,{type:s,depthBuffer:r,stencilBuffer:a,samples:n?4:0,depthTexture:r?new Ro(e,t):void 0}),c=new Vi(e,t,{type:fs,depthBuffer:!1,stencilBuffer:!1}),h=new Ri;h.setAttribute("position",new Fn([-1,3,0,-1,-1,0,3,-1,0],3)),h.setAttribute("uv",new Fn([0,2,0,0,2,0],2));const d=new NM({uniforms:{tDiffuse:{value:null}},vertexShader:`
4009			precision highp float;
4010
4011			uniform mat4 modelViewMatrix;
4012			uniform mat4 projectionMatrix;
4013
4014			attribute vec3 position;
4015			attribute vec2 uv;
4016
4017			varying vec2 vUv;
4018
4019			void main() {
4020				vUv = uv;
4021				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4022			}`,fragmentShader:`
4023			precision highp float;
4024
4025			uniform sampler2D tDiffuse;
4026
4027			varying vec2 vUv;
4028
4029			#include <tonemapping_pars_fragment>
4030			#include <colorspace_pars_fragment>
4031
4032			void main() {
4033				gl_FragColor = texture2D( tDiffuse, vUv );
4034
4035				#ifdef LINEAR_TONE_MAPPING
4036					gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
4037				#elif defined( REINHARD_TONE_MAPPING )
4038					gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
4039				#elif defined( CINEON_TONE_MAPPING )
4040					gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
4041				#elif defined( ACES_FILMIC_TONE_MAPPING )
4042					gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
4043				#elif defined( AGX_TONE_MAPPING )
4044					gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
4045				#elif defined( NEUTRAL_TONE_MAPPING )
4046					gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
4047				#elif defined( CUSTOM_TONE_MAPPING )
4048					gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
4049				#endif
4050
4051				#ifdef SRGB_TRANSFER
4052					gl_FragColor = sRGBTransferOETF( gl_FragColor );
4053				#endif
4054			}`,depthTest:!1,depthWrite:!1}),p=new ti(h,d),m=new I_(-1,1,1,-1,0,1);let v=null,x=null,M=!1,b,y=null,S=[],P=!1;this.setSize=function(U,T){u.setSize(U,T),c.setSize(U,T);for(let N=0;N<S.length;N++){const R=S[N];R.setSize&&R.setSize(U,T)}},this.setEffects=function(U){S=U,P=S.length>0&&S[0].isRenderPass===!0;const T=u.width,N=u.height;for(let R=0;R<S.length;R++){const F=S[R];F.setSize&&F.setSize(T,N)}},this.begin=function(U,T){if(M||U.toneMapping===Ci&&S.length===0)return!1;if(y=T,T!==null){const N=T.width,R=T.height;(u.width!==N||u.height!==R)&&this.setSize(N,R)}return P===!1&&U.setRenderTarget(u),b=U.toneMapping,U.toneMapping=Ci,!0},this.hasRenderPass=function(){return P},this.end=function(U,T){U.toneMapping=b,M=!0;let N=u,R=c;for(let F=0;F<S.length;F++){const w=S[F];if(w.enabled!==!1&&(w.render(U,R,N,T),w.needsSwap!==!1)){const L=N;N=R,R=L}}if(v!==U.outputColorSpace||x!==U.toneMapping){v=U.outputColorSpace,x=U.toneMapping,d.defines={},xt.getTransfer(v)===It&&(d.defines.SRGB_TRANSFER="");const F=z1[x];F&&(d.defines[F]=""),d.needsUpdate=!0}d.uniforms.tDiffuse.value=N.texture,U.setRenderTarget(y),U.render(p,m),y=null,M=!1},this.isCompositing=function(){return M},this.dispose=function(){u.depthTexture&&u.depthTexture.dispose(),u.dispose(),c.dispose(),h.dispose(),d.dispose()}}const k_=new Pn,Nd=new Ro(1,1),B_=new w_,z_=new aM,V_=new P_,Rv=[],Pv=[],Nv=new Float32Array(16),Lv=new Float32Array(9),Dv=new Float32Array(4);function Io(s,e,t){const n=s[0];if(n<=0||n>0)return s;const r=e*t;let a=Rv[r];if(a===void 0&&(a=new Float32Array(r),Rv[r]=a),e!==0){n.toArray(a,0);for(let u=1,c=0;u!==e;++u)c+=t,s[u].toArray(a,c)}return a}function un(s,e){if(s.length!==e.length)return!1;for(let t=0,n=s.length;t<n;t++)if(s[t]!==e[t])return!1;return!0}function cn(s,e){for(let t=0,n=e.length;t<n;t++)s[t]=e[t]}function Ju(s,e){let t=Pv[e];t===void 0&&(t=new Int32Array(e),Pv[e]=t);for(let n=0;n!==e;++n)t[n]=s.allocateTextureUnit();return t}function H1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1f(this.addr,e),t[0]=e)}function G1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(un(t,e))return;s.uniform2fv(this.addr,e),cn(t,e)}}function W1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.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)&&(s.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(un(t,e))return;s.uniform3fv(this.addr,e),cn(t,e)}}function X1(s,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)&&(s.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(un(t,e))return;s.uniform4fv(this.addr,e),cn(t,e)}}function $1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(un(t,e))return;s.uniformMatrix2fv(this.addr,!1,e),cn(t,e)}else{if(un(t,n))return;Dv.set(n),s.uniformMatrix2fv(this.addr,!1,Dv),cn(t,n)}}function q1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(un(t,e))return;s.uniformMatrix3fv(this.addr,!1,e),cn(t,e)}else{if(un(t,n))return;Lv.set(n),s.uniformMatrix3fv(this.addr,!1,Lv),cn(t,n)}}function Y1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(un(t,e))return;s.uniformMatrix4fv(this.addr,!1,e),cn(t,e)}else{if(un(t,n))return;Nv.set(n),s.uniformMatrix4fv(this.addr,!1,Nv),cn(t,n)}}function K1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1i(this.addr,e),t[0]=e)}function j1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(un(t,e))return;s.uniform2iv(this.addr,e),cn(t,e)}}function Q1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(un(t,e))return;s.uniform3iv(this.addr,e),cn(t,e)}}function Z1(s,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)&&(s.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(un(t,e))return;s.uniform4iv(this.addr,e),cn(t,e)}}function J1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1ui(this.addr,e),t[0]=e)}function eb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(un(t,e))return;s.uniform2uiv(this.addr,e),cn(t,e)}}function tb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(un(t,e))return;s.uniform3uiv(this.addr,e),cn(t,e)}}function nb(s,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)&&(s.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(un(t,e))return;s.uniform4uiv(this.addr,e),cn(t,e)}}function ib(s,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(s.uniform1i(this.addr,r),n[0]=r);let a;this.type===s.SAMPLER_2D_SHADOW?(Nd.compareFunction=t.isReversedDepthBuffer()?ep:Jd,a=Nd):a=k_,t.setTexture2D(e||a,r)}function sb(s,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(s.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||z_,r)}function rb(s,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(s.uniform1i(this.addr,r),n[0]=r),t.setTextureCube(e||V_,r)}function ob(s,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(s.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||B_,r)}function ab(s){switch(s){case 5126:return H1;case 35664:return G1;case 35665:return W1;case 35666:return X1;case 35674:return $1;case 35675:return q1;case 35676:return Y1;case 5124:case 35670:return K1;case 35667:case 35671:return j1;case 35668:case 35672:return Q1;case 35669:case 35673:return Z1;case 5125:return J1;case 36294:return eb;case 36295:return tb;case 36296:return nb;case 35678:case 36198:case 36298:case 36306:case 35682:return ib;case 35679:case 36299:case 36307:return sb;case 35680:case 36300:case 36308:case 36293:return rb;case 36289:case 36303:case 36311:case 36292:return ob}}function lb(s,e){s.uniform1fv(this.addr,e)}function ub(s,e){const t=Io(e,this.size,2);s.uniform2fv(this.addr,t)}function cb(s,e){const t=Io(e,this.size,3);s.uniform3fv(this.addr,t)}function hb(s,e){const t=Io(e,this.size,4);s.uniform4fv(this.addr,t)}function fb(s,e){const t=Io(e,this.size,4);s.uniformMatrix2fv(this.addr,!1,t)}function db(s,e){const t=Io(e,this.size,9);s.uniformMatrix3fv(this.addr,!1,t)}function pb(s,e){const t=Io(e,this.size,16);s.uniformMatrix4fv(this.addr,!1,t)}function mb(s,e){s.uniform1iv(this.addr,e)}function gb(s,e){s.uniform2iv(this.addr,e)}function vb(s,e){s.uniform3iv(this.addr,e)}function _b(s,e){s.uniform4iv(this.addr,e)}function xb(s,e){s.uniform1uiv(this.addr,e)}function Sb(s,e){s.uniform2uiv(this.addr,e)}function yb(s,e){s.uniform3uiv(this.addr,e)}function Mb(s,e){s.uniform4uiv(this.addr,e)}function Eb(s,e,t){const n=this.cache,r=e.length,a=Ju(t,r);un(n,a)||(s.uniform1iv(this.addr,a),cn(n,a));let u;this.type===s.SAMPLER_2D_SHADOW?u=Nd:u=k_;for(let c=0;c!==r;++c)t.setTexture2D(e[c]||u,a[c])}function wb(s,e,t){const n=this.cache,r=e.length,a=Ju(t,r);un(n,a)||(s.uniform1iv(this.addr,a),cn(n,a));for(let u=0;u!==r;++u)t.setTexture3D(e[u]||z_,a[u])}function bb(s,e,t){const n=this.cache,r=e.length,a=Ju(t,r);un(n,a)||(s.uniform1iv(this.addr,a),cn(n,a));for(let u=0;u!==r;++u)t.setTextureCube(e[u]||V_,a[u])}function Tb(s,e,t){const n=this.cache,r=e.length,a=Ju(t,r);un(n,a)||(s.uniform1iv(this.addr,a),cn(n,a));for(let u=0;u!==r;++u)t.setTexture2DArray(e[u]||B_,a[u])}function Cb(s){switch(s){case 5126:return lb;case 35664:return ub;case 35665:return cb;case 35666:return hb;case 35674:return fb;case 35675:return db;case 35676:return pb;case 5124:case 35670:return mb;case 35667:case 35671:return gb;case 35668:case 35672:return vb;case 35669:case 35673:return _b;case 5125:return xb;case 36294:return Sb;case 36295:return yb;case 36296:return Mb;case 35678:case 36198:case 36298:case 36306:case 35682:return Eb;case 35679:case 36299:case 36307:return wb;case 35680:case 36300:case 36308:case 36293:return bb;case 36289:case 36303:case 36311:case 36292:return Tb}}class Ab{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=ab(t.type)}}class Rb{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=Cb(t.type)}}class Pb{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let a=0,u=r.length;a!==u;++a){const c=r[a];c.setValue(e,t[c.id],n)}}}const yf=/(\w+)(\])?(\[|\.)?/g;function Iv(s,e){s.seq.push(e),s.map[e.id]=e}function Nb(s,e,t){const n=s.name,r=n.length;for(yf.lastIndex=0;;){const a=yf.exec(n),u=yf.lastIndex;let c=a[1];const h=a[2]==="]",d=a[3];if(h&&(c=c|0),d===void 0||d==="["&&u+2===r){Iv(t,d===void 0?new Ab(c,s,e):new Rb(c,s,e));break}else{let m=t.map[c];m===void 0&&(m=new Pb(c),Iv(t,m)),t=m}}}class Pu{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let u=0;u<n;++u){const c=e.getActiveUniform(t,u),h=e.getUniformLocation(t,c.name);Nb(c,h,this)}const r=[],a=[];for(const u of this.seq)u.type===e.SAMPLER_2D_SHADOW||u.type===e.SAMPLER_CUBE_SHADOW||u.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(u):a.push(u);r.length>0&&(this.seq=r.concat(a))}setValue(e,t,n,r){const a=this.map[t];a!==void 0&&a.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let a=0,u=t.length;a!==u;++a){const c=t[a],h=n[c.id];h.needsUpdate!==!1&&c.setValue(e,h.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,a=e.length;r!==a;++r){const u=e[r];u.id in t&&n.push(u)}return n}}function Uv(s,e,t){const n=s.createShader(e);return s.shaderSource(n,t),s.compileShader(n),n}const Lb=37297;let Db=0;function Ib(s,e){const t=s.split(`
4055`),n=[],r=Math.max(e-6,0),a=Math.min(e+6,t.length);for(let u=r;u<a;u++){const c=u+1;n.push(`${c===e?">":" "} ${c}: ${t[u]}`)}return n.join(`
4056`)}const Fv=new ct;function Ub(s){xt._getMatrix(Fv,xt.workingColorSpace,s);const e=`mat3( ${Fv.elements.map(t=>t.toFixed(4))} )`;switch(xt.getTransfer(s)){case ku:return[e,"LinearTransferOETF"];case It:return[e,"sRGBTransferOETF"];default:return at("WebGLProgram: Unsupported color space: ",s),[e,"LinearTransferOETF"]}}function Ov(s,e,t){const n=s.getShaderParameter(e,s.COMPILE_STATUS),a=(s.getShaderInfoLog(e)||"").trim();if(n&&a==="")return"";const u=/ERROR: 0:(\d+)/.exec(a);if(u){const c=parseInt(u[1]);return t.toUpperCase()+`
4057
4058`+a+`
4059
4060`+Ib(s.getShaderSource(e),c)}else return a}function Fb(s,e){const t=Ub(e);return[`vec4 ${s}( vec4 value ) {`,`	return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
4061`)}const Ob={[l_]:"Linear",[u_]:"Reinhard",[c_]:"Cineon",[h_]:"ACESFilmic",[d_]:"AgX",[p_]:"Neutral",[f_]:"Custom"};function kb(s,e){const t=Ob[e];return t===void 0?(at("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+s+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+s+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const mu=new se;function Bb(){xt.getLuminanceCoefficients(mu);const s=mu.x.toFixed(4),e=mu.y.toFixed(4),t=mu.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${s}, ${e}, ${t} );`,"	return dot( weights, rgb );","}"].join(`
4062`)}function zb(s){return[s.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",s.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ra).join(`
4063`)}function Vb(s){const e=[];for(const t in s){const n=s[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
4064`)}function Hb(s,e){const t={},n=s.getProgramParameter(e,s.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){const a=s.getActiveAttrib(e,r),u=a.name;let c=1;a.type===s.FLOAT_MAT2&&(c=2),a.type===s.FLOAT_MAT3&&(c=3),a.type===s.FLOAT_MAT4&&(c=4),t[u]={type:a.type,location:s.getAttribLocation(e,u),locationSize:c}}return t}function Ra(s){return s!==""}function kv(s,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return s.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_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Bv(s,e){return s.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Gb=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ld(s){return s.replace(Gb,Xb)}const Wb=new Map;function Xb(s,e){let t=dt[e];if(t===void 0){const n=Wb.get(e);if(n!==void 0)t=dt[n],at('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("THREE.WebGLProgram: Can not resolve #include <"+e+">")}return Ld(t)}const $b=/#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 zv(s){return s.replace($b,qb)}function qb(s,e,t,n){let r="";for(let a=parseInt(e);a<parseInt(t);a++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function Vv(s){let e=`precision ${s.precision} float;
4065	precision ${s.precision} int;
4066	precision ${s.precision} sampler2D;
4067	precision ${s.precision} samplerCube;
4068	precision ${s.precision} sampler3D;
4069	precision ${s.precision} sampler2DArray;
4070	precision ${s.precision} sampler2DShadow;
4071	precision ${s.precision} samplerCubeShadow;
4072	precision ${s.precision} sampler2DArrayShadow;
4073	precision ${s.precision} isampler2D;
4074	precision ${s.precision} isampler3D;
4075	precision ${s.precision} isamplerCube;
4076	precision ${s.precision} isampler2DArray;
4077	precision ${s.precision} usampler2D;
4078	precision ${s.precision} usampler3D;
4079	precision ${s.precision} usamplerCube;
4080	precision ${s.precision} usampler2DArray;
4081	`;return s.precision==="highp"?e+=`
4082#define HIGH_PRECISION`:s.precision==="mediump"?e+=`
4083#define MEDIUM_PRECISION`:s.precision==="lowp"&&(e+=`
4084#define LOW_PRECISION`),e}const Yb={[bu]:"SHADOWMAP_TYPE_PCF",[Aa]:"SHADOWMAP_TYPE_VSM"};function Kb(s){return Yb[s.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const jb={[yr]:"ENVMAP_TYPE_CUBE",[Ao]:"ENVMAP_TYPE_CUBE",[ju]:"ENVMAP_TYPE_CUBE_UV"};function Qb(s){return s.envMap===!1?"ENVMAP_TYPE_CUBE":jb[s.envMapMode]||"ENVMAP_TYPE_CUBE"}const Zb={[Ao]:"ENVMAP_MODE_REFRACTION"};function Jb(s){return s.envMap===!1?"ENVMAP_MODE_REFLECTION":Zb[s.envMapMode]||"ENVMAP_MODE_REFLECTION"}const eT={[a_]:"ENVMAP_BLENDING_MULTIPLY",[zy]:"ENVMAP_BLENDING_MIX",[Vy]:"ENVMAP_BLENDING_ADD"};function tT(s){return s.envMap===!1?"ENVMAP_BLENDING_NONE":eT[s.combine]||"ENVMAP_BLENDING_NONE"}function nT(s){const e=s.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 iT(s,e,t,n){const r=s.getContext(),a=t.defines;let u=t.vertexShader,c=t.fragmentShader;const h=Kb(t),d=Qb(t),p=Jb(t),m=tT(t),v=nT(t),x=zb(t),M=Vb(a),b=r.createProgram();let y,S,P=t.glslVersion?"#version "+t.glslVersion+`
4085`:"";t.isRawShaderMaterial?(y=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M].filter(Ra).join(`
4086`),y.length>0&&(y+=`
4087`),S=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M].filter(Ra).join(`
4088`),S.length>0&&(S+=`
4089`)):(y=[Vv(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M,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
4089IDESCENCEMAP":"",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.vertexNormals?"#define HAS_NORMAL":"",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 "+h:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","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",`
4090`].filter(Ra).join(`
4091`),S=[Vv(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M,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.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",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
4091IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#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 "+h:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ci?"#define TONE_MAPPING":"",t.toneMapping!==Ci?dt.tonemapping_pars_fragment:"",t.toneMapping!==Ci?kb("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",dt.colorspace_pars_fragment,Fb("linearToOutputTexel",t.outputColorSpace),Bb(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
4092`].filter(Ra).join(`
4093`)),u=Ld(u),u=kv(u,t),u=Bv(u,t),c=Ld(c),c=kv(c,t),c=Bv(c,t),u=zv(u),c=zv(c),t.isRawShaderMaterial!==!0&&(P=`#version 300 es
4094`,y=[x,"#define attribute in","#define varying out","#define texture2D texture"].join(`
4095`)+`
4096`+y,S=["#define varying in",t.glslVersion===ev?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===ev?"":"#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(`
4097`)+`
4098`+S);const U=P+y+u,T=P+S+c,N=Uv(r,r.VERTEX_SHADER,U),R=Uv(r,r.FRAGMENT_SHADER,T);r.attachShader(b,N),r.attachShader(b,R),t.index0AttributeName!==void 0?r.bindAttribLocation(b,0,t.index0AttributeName):t.hasPositionAttribute===!0&&r.bindAttribLocation(b,0,"position"),r.linkProgram(b);function F(B){if(s.debug.checkShaderErrors){const G=r.getProgramInfoLog(b)||"",J=r.getShaderInfoLog(N)||"",oe=r.getShaderInfoLog(R)||"",Y=G.trim(),ie=J.trim(),K=oe.trim();let $=!0,le=!0;if(r.getProgramParameter(b,r.LINK_STATUS)===!1)if($=!1,typeof s.debug.onShaderError=="function")s.debug.onShaderError(r,b,N,R);else{const ue=Ov(r,N,"vertex"),k=Ov(r,R,"fragment");wt("WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(b,r.VALIDATE_STATUS)+`
4099
4100Material Name: `+B.name+`
4101Material Type: `+B.type+`
4102
4103Program Info Log: `+Y+`
4104`+ue+`
4105`+k)}else Y!==""?at("WebGLProgram: Program Info Log:",Y):(ie===""||K==="")&&(le=!1);le&&(B.diagnostics={runnable:$,programLog:Y,vertexShader:{log:ie,prefix:y},fragmentShader:{log:K,prefix:S}})}r.deleteShader(N),r.deleteShader(R),w=new Pu(r,b),L=Hb(r,b)}let w;this.getUniforms=function(){return w===void 0&&F(this),w};let L;this.getAttributes=function(){return L===void 0&&F(this),L};let z=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return z===!1&&(z=r.getProgramParameter(b,Lb)),z},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(b),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Db++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=N,this.fragmentShader=R,this}let sT=0;class rT{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){const r=this._getShaderCacheForMaterial(e);return r.has(t)===!1&&(r.add(t),t.usedTimes++),r.has(n)===!1&&(r.add(n),n.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}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}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 oT(e),t.set(e,n)),n}}class oT{constructor(e){this.id=sT++,this.code=e,this.usedTimes=0}}function aT(s){return s===Mr||s===Uu||s===Fu}function lT(s,e,t,n,r,a){const u=new b_,c=new rT,h=new Set,d=[],p=new Map,m=n.logarithmicDepthBuffer;let v=n.precision;const x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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(w){return h.add(w),w===0?"uv":`uv${w}`}function b(w,L,z,B,G,J){const oe=B.fog,Y=G.geometry,ie=w.isMeshStandardMaterial||w.isMeshLambertMaterial||w.isMeshPhongMaterial?B.environment:null,K=w.isMeshStandardMaterial||w.isMeshLambertMaterial&&!w.envMap||w.isMeshPhongMaterial&&!w.envMap,$=e.get(w.envMap||ie,K),le=$&&$.mapping===ju?$.image.height:null,ue=x[w.type];w.precision!==null&&(v=n.getMaxPrecision(w.precision),v!==w.precision&&at("WebGLProgram.getParameters:",w.precision,"not supported, using",v,"instead."));const k=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,Q=k!==void 0?k.length:0;let De=0;Y.morphAttributes.position!==void 0&&(De=1),Y.morphAttributes.normal!==void 0&&(De=2),Y.morphAttributes.color!==void 0&&(De=3);let He,Be,ae,ve;if(ue){const Ge=ki[ue];He=Ge.vertexShader,Be=Ge.fragmentShader}else{He=w.vertexShader,Be=w.fragmentShader;const Ge=c.getVertexShaderStage(w),Ut=c.getFragmentShaderStage(w);c.update(w,Ge,Ut),ae=Ge.id,ve=Ut.id}const pe=s.getRenderTarget(),Fe=s.state.buffers.depth.getReversed(),Qe=G.isInstancedMesh===!0,Je=G.isBatchedMesh===!0,Ft=!!w.map,ht=!!w.matcap,Mt=!!$,_t=!!w.aoMap,ft=!!w.lightMap,kt=!!w.bumpMap&&w.wireframe===!1,Ht=!!w.normalMap,Gt=!!w.displacementMap,Bt=!!w.emissiveMap,tt=!!w.metalnessMap,mt=!!w.roughnessMap,H=w.anisotropy>0,gn=w.clearcoat>0,Ct=w.dispersion>0,I=w.iridescence>0,E=w.sheen>0,j=w.transmission>0,re=H&&!!w.anisotropyMap,fe=gn&&!!w.clearcoatMap,Me=gn&&!!w.clearcoatNormalMap,Re=gn&&!!w.clearcoatRoughnessMap,de=I&&!!w.iridescenceMap,ge=I&&!!w.iridescenceThicknessMap,Ne=E&&!!w.sheenColorMap,Ye=E&&!!w.sheenRoughnessMap,Le=!!w.specularMap,Ae=!!w.specularColorMap,et=!!w.specularIntensityMap,nt=j&&!!w.transmissionMap,rt=j&&!!w.thicknessMap,W=!!w.gradientMap,Ce=!!w.alphaMap,me=w.alphaTest>0,Pe=!!w.alphaHash,Ie=!!w.extensions;let _e=Ci;w.toneMapped&&(pe===null||pe.isXRRenderTarget===!0)&&(_e=s.toneMapping);const Xe={shaderID:ue,shaderType:w.type,shaderName:w.name,vertexShader:He,fragmentShader:Be,defines:w.defines,customVertexShaderID:ae,customFragmentShaderID:ve,isRawShaderMaterial:w.isRawShaderMaterial===!0,glslVersion:w.glslVersion,precision:v,batching:Je,batchingColor:Je&&G._colorsTexture!==null,instancing:Qe,instancingColor:Qe&&G.instanceColor!==null,instancingMorph:Qe&&G.morphTexture!==null,outputColorSpace:pe===null?s.outputColorSpace:pe.isXRRenderTarget===!0?pe.texture.colorSpace:xt.workingColorSpace,alphaToCoverage:!!w.alphaToCoverage,map:Ft,matcap:ht,envMap:Mt,envMapMode:Mt&&$.mapping,envMapCubeUVHeight:le,aoMap:_t,lightMap:ft,bumpMap:kt,normalMap:Ht,displacementMap:Gt,emissiveMap:Bt,normalMapObjectSpace:Ht&&w.normalMapType===Wy,normalMapTangentSpace:Ht&&w.normalMapType===Qg,packedNormalMap:Ht&&w.normalMapType===Qg&&aT(w.normalMap.format),metalnessMap:tt,roughnessMap:mt,anisotropy:H,anisotropyMap:re,clearcoat:gn,clearcoatMap:fe,clearcoatNormalMap:Me,clearcoatRoughnessMap:Re,dispersion:Ct,iridescence:I,iridescenceMap:de,iridescenceThicknessMap:ge,sheen:E,sheenColorMap:Ne,sheenRoughnessMap:Ye,specularMap:Le,specularColorMap:Ae,specularIntensityMap:et,transmission:j,transmissionMap:nt,thicknessMap:rt,gradientMap:W,opaque:w.transparent===!1&&w.blending===Mo&&w.alphaToCoverage===!1,alphaMap:Ce,alphaTest:me,alphaHash:Pe,combine:w.combine,mapUv:Ft&&M(w.map.channel),aoMapUv:_t&&M(w.aoMap.channel),lightMapUv:ft&&M(w.lightMap.channel),bumpMapUv:kt&&M(w.bumpMap.channel),normalMapUv:Ht&&M(w.normalMap.channel),displacementMapUv:Gt&&M(w.displacementMap.channel),emissiveMapUv:Bt&&M(w.emissiveMap.channel),metalnessMapUv:tt&&M(w.metalnessMap.channel),roughnessMapUv:mt&&M(w.roughnessMap.channel),anisotropyMapUv:re&&M(w.anisotropyMap.channel),clearcoatMapUv:fe&&M(w.clearcoatMap.channel),clearcoatNormalMapUv:Me&&M(w.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&M(w.clearcoatRoughnessMap.channel),iridescenceMapUv:de&&M(w.iridescenceMap.channel),iridescenceThicknessMapUv:ge&&M(w.iridescenceThicknessMap.channel),sheenColorMapUv:Ne&&M(w.sheenColorMap.channel),sheenRoughnessMapUv:Ye&&M(w.sheenRoughnessMap.channel),specularMapUv:Le&&M(w.specularMap.channel),specularColorMapUv:Ae&&M(w.specularColorMap.channel),specularIntensityMapUv:et&&M(w.specularIntensityMap.channel),transmissionMapUv:nt&&M(w.transmissionMap.channel),thicknessMapUv:rt&&M(w.thicknessMap.channel),alphaMapUv:Ce&&M(w.alphaMap.channel),vertexTangents:!!Y.attributes.tangent&&(Ht||H),vertexNormals:!!Y.attributes.normal,vertexColors:w.vertexColors,vertexAlphas:w.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,pointsUvs:G.isPoints===!0&&!!Y.attributes.uv&&(Ft||Ce),fog:!!oe,useFog:w.fog===!0,fogExp2:!!oe&&oe.isFogExp2,flatShading:w.wireframe===!1&&(w.flatShading===!0||Y.attributes.normal===void 0&&Ht===!1&&(w.isMeshLambertMaterial||w.isMeshPhongMaterial||w.isMeshStandardMaterial||w.isMeshPhysicalMaterial)),sizeAttenuation:w.sizeAttenuation===!0,logarithmicDepthBuffer:m,reversedDepthBuffer:Fe,skinning:G.isSkinnedMesh===!0,hasPositionAttribute:Y.attributes.position!==void 0,morphTargets:Y.morphAttributes.position!==void 0,morphNormals:Y.morphAttributes.normal!==void 0,morphColors:Y.morphAttributes.color!==void 0,morphTargetsCount:Q,morphTextureStride:De,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numLightProbes:L.numLightProbes,numLightProbeGrids:J.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:w.dithering,shadowMapEnabled:s.shadowMap.enabled&&z.length>0,shadowMapType:s.shadowMap.type,toneMapping:_e,decodeVideoTexture:Ft&&w.map.isVideoTexture===!0&&xt.getTransfer(w.map.colorSpace)===It,decodeVideoTextureEmissive:Bt&&w.emissiveMap.isVideoTexture===!0&&xt.getTransfer(w.emissiveMap.colorSpace)===It,premultipliedAlpha:w.premultipliedAlpha,doubleSided:w.side===ss,flipSided:w.side===qn,useDepthPacking:w.depthPacking>=0,depthPacking:w.depthPacking||0,index0AttributeName:w.index0AttributeName,extensionCl
vendor: 14,468 bytes, lines 4105-4132
4105ipCullDistance:Ie&&w.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ie&&w.extensions.multiDraw===!0||Je)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:w.customProgramCacheKey()};return Xe.vertexUv1s=h.has(1),Xe.vertexUv2s=h.has(2),Xe.vertexUv3s=h.has(3),h.clear(),Xe}function y(w){const L=[];if(w.shaderID?L.push(w.shaderID):(L.push(w.customVertexShaderID),L.push(w.customFragmentShaderID)),w.defines!==void 0)for(const z in w.defines)L.push(z),L.push(w.defines[z]);return w.isRawShaderMaterial===!1&&(S(L,w),P(L,w),L.push(s.outputColorSpace)),L.push(w.customProgramCacheKey),L.join()}function S(w,L){w.push(L.precision),w.push(L.outputColorSpace),w.push(L.envMapMode),w.push(L.envMapCubeUVHeight),w.push(L.mapUv),w.push(L.alphaMapUv),w.push(L.lightMapUv),w.push(L.aoMapUv),w.push(L.bumpMapUv),w.push(L.normalMapUv),w.push(L.displacementMapUv),w.push(L.emissiveMapUv),w.push(L.metalnessMapUv),w.push(L.roughnessMapUv),w.push(L.anisotropyMapUv),w.push(L.clearcoatMapUv),w.push(L.clearcoatNormalMapUv),w.push(L.clearcoatRoughnessMapUv),w.push(L.iridescenceMapUv),w.push(L.iridescenceThicknessMapUv),w.push(L.sheenColorMapUv),w.push(L.sheenRoughnessMapUv),w.push(L.specularMapUv),w.push(L.specularColorMapUv),w.push(L.specularIntensityMapUv),w.push(L.transmissionMapUv),w.push(L.thicknessMapUv),w.push(L.combine),w.push(L.fogExp2),w.push(L.sizeAttenuation),w.push(L.morphTargetsCount),w.push(L.morphAttributeCount),w.push(L.numDirLights),w.push(L.numPointLights),w.push(L.numSpotLights),w.push(L.numSpotLightMaps),w.push(L.numHemiLights),w.push(L.numRectAreaLights),w.push(L.numDirLightShadows),w.push(L.numPointLightShadows),w.push(L.numSpotLightShadows),w.push(L.numSpotLightShadowsWithMaps),w.push(L.numLightProbes),w.push(L.shadowMapType),w.push(L.toneMapping),w.push(L.numClippingPlanes),w.push(L.numClipIntersection),w.push(L.depthPacking)}function P(w,L){u.disableAll(),L.instancing&&u.enable(0),L.instancingColor&&u.enable(1),L.instancingMorph&&u.enable(2),L.matcap&&u.enable(3),L.envMap&&u.enable(4),L.normalMapObjectSpace&&u.enable(5),L.normalMapTangentSpace&&u.enable(6),L.clearcoat&&u.enable(7),L.iridescence&&u.enable(8),L.alphaTest&&u.enable(9),L.vertexColors&&u.enable(10),L.vertexAlphas&&u.enable(11),L.vertexUv1s&&u.enable(12),L.vertexUv2s&&u.enable(13),L.vertexUv3s&&u.enable(14),L.vertexTangents&&u.enable(15),L.anisotropy&&u.enable(16),L.alphaHash&&u.enable(17),L.batching&&u.enable(18),L.dispersion&&u.enable(19),L.batchingColor&&u.enable(20),L.gradientMap&&u.enable(21),L.packedNormalMap&&u.enable(22),L.vertexNormals&&u.enable(23),w.push(u.mask),u.disableAll(),L.fog&&u.enable(0),L.useFog&&u.enable(1),L.flatShading&&u.enable(2),L.logarithmicDepthBuffer&&u.enable(3),L.reversedDepthBuffer&&u.enable(4),L.skinning&&u.enable(5),L.morphTargets&&u.enable(6),L.morphNormals&&u.enable(7),L.morphColors&&u.enable(8),L.premultipliedAlpha&&u.enable(9),L.shadowMapEnabled&&u.enable(10),L.doubleSided&&u.enable(11),L.flipSided&&u.enable(12),L.useDepthPacking&&u.enable(13),L.dithering&&u.enable(14),L.transmission&&u.enable(15),L.sheen&&u.enable(16),L.opaque&&u.enable(17),L.pointsUvs&&u.enable(18),L.decodeVideoTexture&&u.enable(19),L.decodeVideoTextureEmissive&&u.enable(20),L.alphaToCoverage&&u.enable(21),L.numLightProbeGrids>0&&u.enable(22),L.hasPositionAttribute&&u.enable(23),w.push(u.mask)}function U(w){const L=x[w.type];let z;if(L){const B=ki[L];z=AM.clone(B.uniforms)}else z=w.uniforms;return z}function T(w,L){let z=p.get(L);return z!==void 0?++z.usedTimes:(z=new iT(s,L,w,r),d.push(z),p.set(L,z)),z}function N(w){if(--w.usedTimes===0){const L=d.indexOf(w);d[L]=d[d.length-1],d.pop(),p.delete(w.cacheKey),w.destroy()}}function R(w){c.remove(w)}function F(){c.dispose()}return{getParameters:b,getProgramCacheKey:y,getUniforms:U,acquireProgram:T,releaseProgram:N,releaseShaderCache:R,programs:d,dispose:F}}function uT(){let s=new WeakMap;function e(u){return s.has(u)}function t(u){let c=s.get(u);return c===void 0&&(c={},s.set(u,c)),c}function n(u){s.delete(u)}function r(u,c,h){s.get(u)[c]=h}function a(){s=new WeakMap}return{has:e,get:t,remove:n,update:r,dispose:a}}function cT(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.materialVariant!==e.materialVariant?s.materialVariant-e.materialVariant:s.z!==e.z?s.z-e.z:s.id-e.id}function Hv(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function Gv(){const s=[];let e=0;const t=[],n=[],r=[];function a(){e=0,t.length=0,n.length=0,r.length=0}function u(v){let x=0;return v.isInstancedMesh&&(x+=2),v.isSkinnedMesh&&(x+=1),x}function c(v,x,M,b,y,S){let P=s[e];return P===void 0?(P={id:v.id,object:v,geometry:x,material:M,materialVariant:u(v),groupOrder:b,renderOrder:v.renderOrder,z:y,group:S},s[e]=P):(P.id=v.id,P.object=v,P.geometry=x,P.material=M,P.materialVariant=u(v),P.groupOrder=b,P.renderOrder=v.renderOrder,P.z=y,P.group=S),e++,P}function h(v,x,M,b,y,S){const P=c(v,x,M,b,y,S);M.transmission>0?n.push(P):M.transparent===!0?r.push(P):t.push(P)}function d(v,x,M,b,y,S){const P=c(v,x,M,b,y,S);M.transmission>0?n.unshift(P):M.transparent===!0?r.unshift(P):t.unshift(P)}function p(v,x,M){t.length>1&&t.sort(v||cT),n.length>1&&n.sort(x||Hv),r.length>1&&r.sort(x||Hv),M&&(t.reverse(),n.reverse(),r.reverse())}function m(){for(let v=e,x=s.length;v<x;v++){const M=s[v];if(M.id===null)break;M.id=null,M.object=null,M.geometry=null,M.material=null,M.group=null}}return{opaque:t,transmissive:n,transparent:r,init:a,push:h,unshift:d,finish:m,sort:p}}function hT(){let s=new WeakMap;function e(n,r){const a=s.get(n);let u;return a===void 0?(u=new Gv,s.set(n,[u])):r>=a.length?(u=new Gv,a.push(u)):u=a[r],u}function t(){s=new WeakMap}return{get:e,dispose:t}}function fT(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new se,color:new Rt};break;case"SpotLight":t={position:new se,direction:new se,color:new Rt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new se,color:new Rt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new se,skyColor:new Rt,groundColor:new Rt};break;case"RectAreaLight":t={color:new Rt,position:new se,halfWidth:new se,halfHeight:new se};break}return s[e.id]=t,t}}}function dT(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Tt};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Tt};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Tt,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let pT=0;function mT(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function gT(s){const e=new fT,t=dT(),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 se);const r=new se,a=new on,u=new on;function c(d){let p=0,m=0,v=0;for(let L=0;L<9;L++)n.probe[L].set(0,0,0);let x=0,M=0,b=0,y=0,S=0,P=0,U=0,T=0,N=0,R=0,F=0;d.sort(mT);for(let L=0,z=d.length;L<z;L++){const B=d[L],G=B.color,J=B.intensity,oe=B.distance;let Y=null;if(B.shadow&&B.shadow.map&&(B.shadow.map.texture.format===Mr?Y=B.shadow.map.texture:Y=B.shadow.map.depthTexture||B.shadow.map.texture),B.isAmbientLight)p+=G.r*J,m+=G.g*J,v+=G.b*J;else if(B.isLightProbe){for(let ie=0;ie<9;ie++)n.probe[ie].addScaledVector(B.sh.coefficients[ie],J);F++}else if(B.isDirectionalLight){const ie=e.get(B);if(ie.color.copy(B.color).multiplyScalar(B.intensity),B.castShadow){const K=B.shadow,$=t.get(B);$.shadowIntensity=K.intensity,$.shadowBias=K.bias,$.shadowNormalBias=K.normalBias,$.shadowRadius=K.radius,$.shadowMapSize=K.mapSize,n.directionalShadow[x]=$,n.directionalShadowMap[x]=Y,n.directionalShadowMatrix[x]=B.shadow.matrix,P++}n.directional[x]=ie,x++}else if(B.isSpotLight){const ie=e.get(B);ie.position.setFromMatrixPosition(B.matrixWorld),ie.color.copy(G).multiplyScalar(J),ie.distance=oe,ie.coneCos=Math.cos(B.angle),ie.penumbraCos=Math.cos(B.angle*(1-B.penumbra)),ie.decay=B.decay,n.spot[b]=ie;const K=B.shadow;if(B.map&&(n.spotLightMap[N]=B.map,N++,K.updateMatrices(B),B.castShadow&&R++),n.spotLightMatrix[b]=K.matrix,B.castShadow){const $=t.get(B);$.shadowIntensity=K.intensity,$.shadowBias=K.bias,$.shadowNormalBias=K.normalBias,$.shadowRadius=K.radius,$.shadowMapSize=K.mapSize,n.spotShadow[b]=$,n.spotShadowMap[b]=Y,T++}b++}else if(B.isRectAreaLight){const ie=e.get(B);ie.color.copy(G).multiplyScalar(J),ie.halfWidth.set(B.width*.5,0,0),ie.halfHeight.set(0,B.height*.5,0),n.rectArea[y]=ie,y++}else if(B.isPointLight){const ie=e.get(B);if(ie.color.copy(B.color).multiplyScalar(B.intensity),ie.distance=B.distance,ie.decay=B.decay,B.castShadow){const K=B.shadow,$=t.get(B);$.shadowIntensity=K.intensity,$.shadowBias=K.bias,$.shadowNormalBias=K.normalBias,$.shadowRadius=K.radius,$.shadowMapSize=K.mapSize,$.shadowCameraNear=K.camera.near,$.shadowCameraFar=K.camera.far,n.pointShadow[M]=$,n.pointShadowMap[M]=Y,n.pointShadowMatrix[M]=B.shadow.matrix,U++}n.point[M]=ie,M++}else if(B.isHemisphereLight){const ie=e.get(B);ie.skyColor.copy(B.color).multiplyScalar(J),ie.groundColor.copy(B.groundColor).multiplyScalar(J),n.hemi[S]=ie,S++}}y>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ue.LTC_FLOAT_1,n.rectAreaLTC2=Ue.LTC_FLOAT_2):(n.rectAreaLTC1=Ue.LTC_HALF_1,n.rectAreaLTC2=Ue.LTC_HALF_2)),n.ambient[0]=p,n.ambient[1]=m,n.ambient[2]=v;const w=n.hash;(w.directionalLength!==x||w.pointLength!==M||w.spotLength!==b||w.rectAreaLength!==y||w.hemiLength!==S||w.numDirectionalShadows!==P||w.numPointShadows!==U||w.numSpotShadows!==T||w.numSpotMaps!==N||w.numLightProbes!==F)&&(n.directional.length=x,n.spot.length=b,n.rectArea.length=y,n.point.length=M,n.hemi.length=S,n.directionalShadow.length=P,n.directionalShadowMap.length=P,n.pointShadow.length=U,n.pointShadowMap.length=U,n.spotShadow.length=T,n.spotShadowMap.length=T,n.directionalShadowMatrix.length=P,n.pointShadowMatrix.length=U,n.spotLightMatrix.length=T+N-R,n.spotLightMap.length=N,n.numSpotLightShadowsWithMaps=R,n.numLightProbes=F,w.directionalLength=x,w.pointLength=M,w.spotLength=b,w.rectAreaLength=y,w.hemiLength=S,w.numDirectionalShadows=P,w.numPointShadows=U,w.numSpotShadows=T,w.numSpotMaps=N,w.numLightProbes=F,n.version=pT++)}function h(d,p){let m=0,v=0,x=0,M=0,b=0;const y=p.matrixWorldInverse;for(let S=0,P=d.length;S<P;S++){const U=d[S];if(U.isDirectionalLight){const T=n.directional[m];T.direction.setFromMatrixPosition(U.matrixWorld),r.setFromMatrixPosition(U.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(y),m++}else if(U.isSpotLight){const T=n.spot[x];T.position.setFromMatrixPosition(U.matrixWorld),T.position.applyMatrix4(y),T.direction.setFromMatrixPosition(U.matrixWorld),r.setFromMatrixPosition(U.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(y),x++}else if(U.isRectAreaLight){const T=n.rectArea[M];T.position.setFromMatrixPosition(U.matrixWorld),T.position.applyMatrix4(y),u.identity(),a.copy(U.matrixWorld),a.premultiply(y),u.extractRotation(a),T.halfWidth.set(U.width*.5,0,0),T.halfHeight.set(0,U.height*.5,0),T.halfWidth.applyMatrix4(u),T.halfHeight.applyMatrix4(u),M++}else if(U.isPointLight){const T=n.point[v];T.position.setFromMatrixPosition(U.matrixWorld),T.position.applyMatrix4(y),v++}else if(U.isHemisphereLight){const T=n.hemi[b];T.direction.setFromMatrixPosition(U.matrixWorld),T.direction.transformDirection(y),b++}}}return{setup:c,setupView:h,state:n}}function Wv(s){const e=new gT(s),t=[],n=[],r=[];function a(v){m.camera=v,t.length=0,n.length=0,r.length=0}function u(v){t.push(v)}function c(v){n.push(v)}function h(v){r.push(v)}function d(){e.setup(t)}function p(v){e.setupView(t,v)}const m={lightsArray:t,shadowsArray:n,lightProbeGridArray:r,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:a,state:m,setupLights:d,setupLightsView:p,pushLight:u,pushShadow:c,pushLightProbeGrid:h}}function vT(s){let e=new WeakMap;function t(r,a=0){const u=e.get(r);let c;return u===void 0?(c=new Wv(s),e.set(r,[c])):a>=u.length?(c=new Wv(s),u.push(c)):c=u[a],c}function n(){e=new WeakMap}return{get:t,dispose:n}}const _T=`void main() {
4106	gl_Position = vec4( position, 1.0 );
4107}`,xT=`uniform sampler2D shadow_pass;
4108uniform vec2 resolution;
4109uniform float radius;
4110void main() {
4111	const float samples = float( VSM_SAMPLES );
4112	float mean = 0.0;
4113	float squared_mean = 0.0;
4114	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
4115	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
4116	for ( float i = 0.0; i < samples; i ++ ) {
4117		float uvOffset = uvStart + i * uvStride;
4118		#ifdef HORIZONTAL_PASS
4119			vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
4120			mean += distribution.x;
4121			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
4122		#else
4123			float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
4124			mean += depth;
4125			squared_mean += depth * depth;
4126		#endif
4127	}
4128	mean = mean / samples;
4129	squared_mean = squared_mean / samples;
4130	float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
4131	gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
4132}`,ST=[new se(1,0,0),new se(-1,0,0),new se(0,1,0),new se(0,-1,0),new se(0,0,1),new se(0,0,-1)],yT=[new se(0,-1,0),new se(0,-1,0),new se(0,0,1),new se(0,0,-1),new se(0,-1,0),new se(0,-1,0)],Xv=new on,ba=new se,Mf=new se;function MT(s,e,t){let n=new R_;const r=new Tt,a=new Tt,u=new Jt,c=new LM,h=new DM,d={},p=t.maxTextureSize,m={[Ws]:qn,[qn]:Ws,[ss]:ss}
vendor: 4,908 bytes, line 4132
4132,v=new Ai({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Tt},radius:{value:4}},vertexShader:_T,fragmentShader:xT}),x=v.clone();x.defines.HORIZONTAL_PASS=1;const M=new Ri;M.setAttribute("position",new Hi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new ti(M,v),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=bu;let S=this.type;this.render=function(R,F,w){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||R.length===0)return;this.type===yy&&(at("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=bu);const L=s.getRenderTarget(),z=s.getActiveCubeFace(),B=s.getActiveMipmapLevel(),G=s.state;G.setBlending(cs),G.buffers.depth.getReversed()===!0?G.buffers.color.setClear(0,0,0,0):G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const J=S!==this.type;J&&F.traverse(function(oe){oe.material&&(Array.isArray(oe.material)?oe.material.forEach(Y=>Y.needsUpdate=!0):oe.material.needsUpdate=!0)});for(let oe=0,Y=R.length;oe<Y;oe++){const ie=R[oe],K=ie.shadow;if(K===void 0){at("WebGLShadowMap:",ie,"has no shadow.");continue}if(K.autoUpdate===!1&&K.needsUpdate===!1)continue;r.copy(K.mapSize);const $=K.getFrameExtents();r.multiply($),a.copy(K.mapSize),(r.x>p||r.y>p)&&(r.x>p&&(a.x=Math.floor(p/$.x),r.x=a.x*$.x,K.mapSize.x=a.x),r.y>p&&(a.y=Math.floor(p/$.y),r.y=a.y*$.y,K.mapSize.y=a.y));const le=s.state.buffers.depth.getReversed();if(K.camera._reversedDepth=le,K.map===null||J===!0){if(K.map!==null&&(K.map.depthTexture!==null&&(K.map.depthTexture.dispose(),K.map.depthTexture=null),K.map.dispose()),this.type===Aa){if(ie.isPointLight){at("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}K.map=new Vi(r.x,r.y,{format:Mr,type:fs,minFilter:mn,magFilter:mn,generateMipmaps:!1}),K.map.texture.name=ie.name+".shadowMap",K.map.depthTexture=new Ro(r.x,r.y,Bi),K.map.depthTexture.name=ie.name+".shadowMapDepth",K.map.depthTexture.format=ds,K.map.depthTexture.compareFunction=null,K.map.depthTexture.minFilter=Mn,K.map.depthTexture.magFilter=Mn}else ie.isPointLight?(K.map=new O_(r.x),K.map.depthTexture=new TM(r.x,Gi)):(K.map=new Vi(r.x,r.y),K.map.depthTexture=new Ro(r.x,r.y,Gi)),K.map.depthTexture.name=ie.name+".shadowMap",K.map.depthTexture.format=ds,this.type===bu?(K.map.depthTexture.compareFunction=le?ep:Jd,K.map.depthTexture.minFilter=mn,K.map.depthTexture.magFilter=mn):(K.map.depthTexture.compareFunction=null,K.map.depthTexture.minFilter=Mn,K.map.depthTexture.magFilter=Mn);K.camera.updateProjectionMatrix()}const ue=K.map.isWebGLCubeRenderTarget?6:1;for(let k=0;k<ue;k++){if(K.map.isWebGLCubeRenderTarget)s.setRenderTarget(K.map,k),s.clear();else{k===0&&(s.setRenderTarget(K.map),s.clear());const Q=K.getViewport(k);u.set(a.x*Q.x,a.y*Q.y,a.x*Q.z,a.y*Q.w),G.viewport(u)}if(ie.isPointLight){const Q=K.camera,De=K.matrix,He=ie.distance||Q.far;He!==Q.far&&(Q.far=He,Q.updateProjectionMatrix()),ba.setFromMatrixPosition(ie.matrixWorld),Q.position.copy(ba),Mf.copy(Q.position),Mf.add(ST[k]),Q.up.copy(yT[k]),Q.lookAt(Mf),Q.updateMatrixWorld(),De.makeTranslation(-ba.x,-ba.y,-ba.z),Xv.multiplyMatrices(Q.projectionMatrix,Q.matrixWorldInverse),K._frustum.setFromProjectionMatrix(Xv,Q.coordinateSystem,Q.reversedDepth)}else K.updateMatrices(ie);n=K.getFrustum(),T(F,w,K.camera,ie,this.type)}K.isPointLightShadow!==!0&&this.type===Aa&&P(K,w),K.needsUpdate=!1}S=this.type,y.needsUpdate=!1,s.setRenderTarget(L,z,B)};function P(R,F){const w=e.update(b);v.defines.VSM_SAMPLES!==R.blurSamples&&(v.defines.VSM_SAMPLES=R.blurSamples,x.defines.VSM_SAMPLES=R.blurSamples,v.needsUpdate=!0,x.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new Vi(r.x,r.y,{format:Mr,type:fs})),v.uniforms.shadow_pass.value=R.map.depthTexture,v.uniforms.resolution.value=R.mapSize,v.uniforms.radius.value=R.radius,s.setRenderTarget(R.mapPass),s.clear(),s.renderBufferDirect(F,null,w,v,b,null),x.uniforms.shadow_pass.value=R.mapPass.texture,x.uniforms.resolution.value=R.mapSize,x.uniforms.radius.value=R.radius,s.setRenderTarget(R.map),s.clear(),s.renderBufferDirect(F,null,w,x,b,null)}function U(R,F,w,L){let z=null;const B=w.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(B!==void 0)z=B;else if(z=w.isPointLight===!0?h:c,s.localClippingEnabled&&F.clipShadows===!0&&Array.isArray(F.clippingPlanes)&&F.clippingPlanes.length!==0||F.displacementMap&&F.displacementScale!==0||F.alphaMap&&F.alphaTest>0||F.map&&F.alphaTest>0||F.alphaToCoverage===!0){const G=z.uuid,J=F.uuid;let oe=d[G];oe===void 0&&(oe={},d[G]=oe);let Y=oe[J];Y===void 0&&(Y=z.clone(),oe[J]=Y,F.addEventListener("dispose",N)),z=Y}if(z.visible=F.visible,z.wireframe=F.wireframe,L===Aa?z.side=F.shadowSide!==null?F.shadowSide:F.side:z.side=F.shadowSide!==null?F.shadowSide:m[F.side],z.alphaMap=F.alphaMap,z.alphaTest=F.alphaToCoverage===!0?.5:F.alph
vendor: 6,897 bytes, line 4132
4132aTest,z.map=F.map,z.clipShadows=F.clipShadows,z.clippingPlanes=F.clippingPlanes,z.clipIntersection=F.clipIntersection,z.displacementMap=F.displacementMap,z.displacementScale=F.displacementScale,z.displacementBias=F.displacementBias,z.wireframeLinewidth=F.wireframeLinewidth,z.linewidth=F.linewidth,w.isPointLight===!0&&z.isMeshDistanceMaterial===!0){const G=s.properties.get(z);G.light=w}return z}function T(R,F,w,L,z){if(R.visible===!1)return;if(R.layers.test(F.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&z===Aa)&&(!R.frustumCulled||n.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,R.matrixWorld);const J=e.update(R),oe=R.material;if(Array.isArray(oe)){const Y=J.groups;for(let ie=0,K=Y.length;ie<K;ie++){const $=Y[ie],le=oe[$.materialIndex];if(le&&le.visible){const ue=U(R,le,L,z);R.onBeforeShadow(s,R,F,w,J,ue,$),s.renderBufferDirect(w,null,J,ue,R,$),R.onAfterShadow(s,R,F,w,J,ue,$)}}}else if(oe.visible){const Y=U(R,oe,L,z);R.onBeforeShadow(s,R,F,w,J,Y,null),s.renderBufferDirect(w,null,J,Y,R,null),R.onAfterShadow(s,R,F,w,J,Y,null)}}const G=R.children;for(let J=0,oe=G.length;J<oe;J++)T(G[J],F,w,L,z)}function N(R){R.target.removeEventListener("dispose",N);for(const w in d){const L=d[w],z=R.target.uuid;z in L&&(L[z].dispose(),delete L[z])}}}function ET(s,e){function t(){let W=!1;const Ce=new Jt;let me=null;const Pe=new Jt(0,0,0,0);return{setMask:function(Ie){me!==Ie&&!W&&(s.colorMask(Ie,Ie,Ie,Ie),me=Ie)},setLocked:function(Ie){W=Ie},setClear:function(Ie,_e,Xe,Ge,Ut){Ut===!0&&(Ie*=Ge,_e*=Ge,Xe*=Ge),Ce.set(Ie,_e,Xe,Ge),Pe.equals(Ce)===!1&&(s.clearColor(Ie,_e,Xe,Ge),Pe.copy(Ce))},reset:function(){W=!1,me=null,Pe.set(-1,0,0,0)}}}function n(){let W=!1,Ce=!1,me=null,Pe=null,Ie=null;return{setReversed:function(_e){if(Ce!==_e){const Xe=e.get("EXT_clip_control");_e?Xe.clipControlEXT(Xe.LOWER_LEFT_EXT,Xe.ZERO_TO_ONE_EXT):Xe.clipControlEXT(Xe.LOWER_LEFT_EXT,Xe.NEGATIVE_ONE_TO_ONE_EXT),Ce=_e;const Ge=Ie;Ie=null,this.setClear(Ge)}},getReversed:function(){return Ce},setTest:function(_e){_e?pe(s.DEPTH_TEST):Fe(s.DEPTH_TEST)},setMask:function(_e){me!==_e&&!W&&(s.depthMask(_e),me=_e)},setFunc:function(_e){if(Ce&&(_e=eM[_e]),Pe!==_e){switch(_e){case $f:s.depthFunc(s.NEVER);break;case qf:s.depthFunc(s.ALWAYS);break;case Yf:s.depthFunc(s.LESS);break;case Co:s.depthFunc(s.LEQUAL);break;case Kf:s.depthFunc(s.EQUAL);break;case jf:s.depthFunc(s.GEQUAL);break;case Qf:s.depthFunc(s.GREATER);break;case Zf:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}Pe=_e}},setLocked:function(_e){W=_e},setClear:function(_e){Ie!==_e&&(Ie=_e,Ce&&(_e=1-_e),s.clearDepth(_e))},reset:function(){W=!1,me=null,Pe=null,Ie=null,Ce=!1}}}function r(){let W=!1,Ce=null,me=null,Pe=null,Ie=null,_e=null,Xe=null,Ge=null,Ut=null;return{setTest:function(Pt){W||(Pt?pe(s.STENCIL_TEST):Fe(s.STENCIL_TEST))},setMask:function(Pt){Ce!==Pt&&!W&&(s.stencilMask(Pt),Ce=Pt)},setFunc:function(Pt,En,si){(me!==Pt||Pe!==En||Ie!==si)&&(s.stencilFunc(Pt,En,si),me=Pt,Pe=En,Ie=si)},setOp:function(Pt,En,si){(_e!==Pt||Xe!==En||Ge!==si)&&(s.stencilOp(Pt,En,si),_e=Pt,Xe=En,Ge=si)},setLocked:function(Pt){W=Pt},setClear:function(Pt){Ut!==Pt&&(s.clearStencil(Pt),Ut=Pt)},reset:function(){W=!1,Ce=null,me=null,Pe=null,Ie=null,_e=null,Xe=null,Ge=null,Ut=null}}}const a=new t,u=new n,c=new r,h=new WeakMap,d=new WeakMap;let p={},m={},v={},x=new WeakMap,M=[],b=null,y=!1,S=null,P=null,U=null,T=null,N=null,R=null,F=null,w=new Rt(0,0,0),L=0,z=!1,B=null,G=null,J=null,oe=null,Y=null;const ie=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let K=!1,$=0;const le=s.getParameter(s.VERSION);le.indexOf("WebGL")!==-1?($=parseFloat(/^WebGL (\d)/.exec(le)[1]),K=$>=1):le.indexOf("OpenGL ES")!==-1&&($=parseFloat(/^OpenGL ES (\d)/.exec(le)[1]),K=$>=2);let ue=null,k={};const Q=s.getParameter(s.SCISSOR_BOX),De=s.getParameter(s.VIEWPORT),He=new Jt().fromArray(Q),Be=new Jt().fromArray(De);function ae(W,Ce,me,Pe){const Ie=new Uint8Array(4),_e=s.createTexture();s.bindTexture(W,_e),s.texParameteri(W,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(W,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let Xe=0;Xe<me;Xe++)W===s.TEXTURE_3D||W===s.TEXTURE_2D_ARRAY?s.texImage3D(Ce,0,s.RGBA,1,1,Pe,0,s.RGBA,s.UNSIGNED_BYTE,Ie):s.texImage2D(Ce+Xe,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,Ie);return _e}const ve={};ve[s.TEXTURE_2D]=ae(s.TEXTURE_2D,s.TEXTURE_2D,1),ve[s.TEXTURE_CUBE_MAP]=ae(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),ve[s.TEXTURE_2D_ARRAY]=ae(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),ve[s.TEXTURE_3D]=ae(s.TEXTURE_3D,s.TEXTURE_3D,1,1),a.setClear(0,0,0,1),u.setClear(1),c.setClear(0),pe(s.DEPTH_TEST),u.setFunc(Co),kt(!1),Ht(qg),pe(s.CULL_FACE),_t(cs);function pe(W){p[W]!==!0&&(s.enable(W),p[W]=!0)}function Fe(W){p[W]!==!1&&(s.disable(W),p[W]=!1)}function Qe(W,Ce){return v[W]!==Ce?(s.bindFramebuffer(W,Ce),v[W]=Ce,W===s.DRAW_FRAMEBUFFER&&(v[s.FRAMEBUFFER]=Ce),W===s.FRAMEBUFFER&&(v[s.DRAW_FRAMEBUFFER]=Ce),!0):!1}function Je(W,Ce){let me=M,Pe=!1;if(W){me=x.get(Ce),me===void 0&&(me=[],x.set(Ce,me));const Ie=W.textures;if(me.length!==Ie.length||me[0]!==s.COLOR_ATTACHMENT0){for(let _e=0,Xe=Ie.length;_e<Xe;_e++)me[_e]=s.COLOR_ATTACHMENT0+_e;me.length=Ie.length,Pe=!0}}else me[0]!==s.BACK&&(me[0]=s.BACK,Pe=!0);Pe&&s.drawBuffers(me)}function Ft(W){return b!==W?(s.useProgram(W),b=W,!0):!1}const ht={[vr]:s.FUNC_ADD,[Ey]:s.FUNC_SUBTRACT,[wy]:s.FUNC_REVERSE_SUBTRACT};ht[by]=s.MIN,ht[Ty]=s.MAX;const Mt={[Cy]:s.ZERO,[Ay]:s.ONE,[Ry]:s.SRC_COLOR,[Wf]:s.SRC_ALPHA,[Uy]:s.SRC_ALPHA_SATURATE,[Dy]:s.DST_COLOR,[Ny]:s.DST_ALPHA,[Py]:s.ONE_MINUS_SRC_COLOR,[Xf]:s.ONE_MINUS_SRC_ALPHA,[Iy]:s.ONE_MINUS_DST_COLOR,[Ly]:s.ONE_MINUS_DST_ALPHA,[Fy]:s.CONSTANT_COLOR,[Oy]:s.ONE_MINUS_CONSTANT_COLOR,[ky]:s.CONSTANT_ALPHA,[By]:s.ONE_MINUS_CONSTANT_ALPHA};function _t(W,Ce,me,Pe,Ie,_e,Xe,Ge,Ut,Pt){if(W===cs){y===!0&&(Fe(s.BLEND),y=!1);return}if(y===!1&&(pe(s.BLEND),y=!0),W!==My){if(W!==S||Pt!==z){if((P!==vr||N!==vr)&&(s.blendEquation(s.FUNC_ADD),P=vr,N=vr),Pt)switch(W){case Mo:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yg:s.blendFunc(s.ONE,s.ONE);break;case Kg:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case jg:s.blendFuncSeparate(s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ZERO,s.ONE);break;default:wt("WebGLState: Invalid blending: ",W);break}else switch(W){case Mo:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yg:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE,s.ONE,s.ONE);break;case Kg:wt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case jg:wt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:wt("WebGLState: Invalid blending: ",W);break}U=null,T=null,R=null,F=null,w.set(0,0,0),L=0,S=W,z=Pt}return}Ie=Ie||Ce,_e=_e||me,Xe=Xe||Pe,(Ce!==P||Ie!==N)&&(s.blendEquationSeparate(ht[Ce],ht[Ie]),P=Ce,N=Ie),
vendor: 8,522 bytes, line 4132
4132(me!==U||Pe!==T||_e!==R||Xe!==F)&&(s.blendFuncSeparate(Mt[me],Mt[Pe],Mt[_e],Mt[Xe]),U=me,T=Pe,R=_e,F=Xe),(Ge.equals(w)===!1||Ut!==L)&&(s.blendColor(Ge.r,Ge.g,Ge.b,Ut),w.copy(Ge),L=Ut),S=W,z=!1}function ft(W,Ce){W.side===ss?Fe(s.CULL_FACE):pe(s.CULL_FACE);let me=W.side===qn;Ce&&(me=!me),kt(me),W.blending===Mo&&W.transparent===!1?_t(cs):_t(W.blending,W.blendEquation,W.blendSrc,W.blendDst,W.blendEquationAlpha,W.blendSrcAlpha,W.blendDstAlpha,W.blendColor,W.blendAlpha,W.premultipliedAlpha),u.setFunc(W.depthFunc),u.setTest(W.depthTest),u.setMask(W.depthWrite),a.setMask(W.colorWrite);const Pe=W.stencilWrite;c.setTest(Pe),Pe&&(c.setMask(W.stencilWriteMask),c.setFunc(W.stencilFunc,W.stencilRef,W.stencilFuncMask),c.setOp(W.stencilFail,W.stencilZFail,W.stencilZPass)),Bt(W.polygonOffset,W.polygonOffsetFactor,W.polygonOffsetUnits),W.alphaToCoverage===!0?pe(s.SAMPLE_ALPHA_TO_COVERAGE):Fe(s.SAMPLE_ALPHA_TO_COVERAGE)}function kt(W){B!==W&&(W?s.frontFace(s.CW):s.frontFace(s.CCW),B=W)}function Ht(W){W!==xy?(pe(s.CULL_FACE),W!==G&&(W===qg?s.cullFace(s.BACK):W===Sy?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):Fe(s.CULL_FACE),G=W}function Gt(W){W!==J&&(K&&s.lineWidth(W),J=W)}function Bt(W,Ce,me){W?(pe(s.POLYGON_OFFSET_FILL),(oe!==Ce||Y!==me)&&(oe=Ce,Y=me,u.getReversed()&&(Ce=-Ce),s.polygonOffset(Ce,me))):Fe(s.POLYGON_OFFSET_FILL)}function tt(W){W?pe(s.SCISSOR_TEST):Fe(s.SCISSOR_TEST)}function mt(W){W===void 0&&(W=s.TEXTURE0+ie-1),ue!==W&&(s.activeTexture(W),ue=W)}function H(W,Ce,me){me===void 0&&(ue===null?me=s.TEXTURE0+ie-1:me=ue);let Pe=k[me];Pe===void 0&&(Pe={type:void 0,texture:void 0},k[me]=Pe),(Pe.type!==W||Pe.texture!==Ce)&&(ue!==me&&(s.activeTexture(me),ue=me),s.bindTexture(W,Ce||ve[W]),Pe.type=W,Pe.texture=Ce)}function gn(){const W=k[ue];W!==void 0&&W.type!==void 0&&(s.bindTexture(W.type,null),W.type=void 0,W.texture=void 0)}function Ct(){try{s.compressedTexImage2D(...arguments)}catch(W){wt("WebGLState:",W)}}function I(){try{s.compressedTexImage3D(...arguments)}catch(W){wt("WebGLState:",W)}}function E(){try{s.texSubImage2D(...arguments)}catch(W){wt("WebGLState:",W)}}function j(){try{s.texSubImage3D(...arguments)}catch(W){wt("WebGLState:",W)}}function re(){try{s.compressedTexSubImage2D(...arguments)}catch(W){wt("WebGLState:",W)}}function fe(){try{s.compressedTexSubImage3D(...arguments)}catch(W){wt("WebGLState:",W)}}function Me(){try{s.texStorage2D(...arguments)}catch(W){wt("WebGLState:",W)}}function Re(){try{s.texStorage3D(...arguments)}catch(W){wt("WebGLState:",W)}}function de(){try{s.texImage2D(...arguments)}catch(W){wt("WebGLState:",W)}}function ge(){try{s.texImage3D(...arguments)}catch(W){wt("WebGLState:",W)}}function Ne(W){return m[W]!==void 0?m[W]:s.getParameter(W)}function Ye(W,Ce){m[W]!==Ce&&(s.pixelStorei(W,Ce),m[W]=Ce)}function Le(W){He.equals(W)===!1&&(s.scissor(W.x,W.y,W.z,W.w),He.copy(W))}function Ae(W){Be.equals(W)===!1&&(s.viewport(W.x,W.y,W.z,W.w),Be.copy(W))}function et(W,Ce){let me=d.get(Ce);me===void 0&&(me=new WeakMap,d.set(Ce,me));let Pe=me.get(W);Pe===void 0&&(Pe=s.getUniformBlockIndex(Ce,W.name),me.set(W,Pe))}function nt(W,Ce){const Pe=d.get(Ce).get(W);h.get(Ce)!==Pe&&(s.uniformBlockBinding(Ce,Pe,W.__bindingPointIndex),h.set(Ce,Pe))}function rt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),u.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),s.pixelStorei(s.PACK_ALIGNMENT,4),s.pixelStorei(s.UNPACK_ALIGNMENT,4),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL),s.pixelStorei(s.PACK_ROW_LENGTH,0),s.pixelStorei(s.PACK_SKIP_PIXELS,0),s.pixelStorei(s.PACK_SKIP_ROWS,0),s.pixelStorei(s.UNPACK_ROW_LENGTH,0),s.pixelStorei(s.UNPACK_IMAGE_HEIGHT,0),s.pixelStorei(s.UNPACK_SKIP_PIXELS,0),s.pixelStorei(s.UNPACK_SKIP_ROWS,0),s.pixelStorei(s.UNPACK_SKIP_IMAGES,0),p={},m={},ue=null,k={},v={},x=new WeakMap,M=[],b=null,y=!1,S=null,P=null,U=null,T=null,N=null,R=null,F=null,w=new Rt(0,0,0),L=0,z=!1,B=null,G=null,J=null,oe=null,Y=null,He.set(0,0,s.canvas.width,s.canvas.height),Be.set(0,0,s.canvas.width,s.canvas.height),a.reset(),u.reset(),c.reset()}return{buffers:{color:a,depth:u,stencil:c},enable:pe,disable:Fe,bindFramebuffer:Qe,drawBuffers:Je,useProgram:Ft,setBlending:_t,setMaterial:ft,setFlipSided:kt,setCullFace:Ht,setLineWidth:Gt,setPolygonOffset:Bt,setScissorTest:tt,activeTexture:mt,bindTexture:H,unbindTexture:gn,compressedTexImage2D:Ct,compressedTexImage3D:I,texImage2D:de,texImage3D:ge,pixelStorei:Ye,getParameter:Ne,updateUBOMapping:et,uniformBlockBinding:nt,texStorage2D:Me,texStorage3D:Re,texSubImage2D:E,texSubImage3D:j,compressedTexSubImage2D:re,compressedTexSubImage3D:fe,scissor:Le,viewport:Ae,reset:rt}}function wT(s,e,t,n,r,a,u){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),d=new Tt,p=new WeakMap,m=new Set;let v;const x=new WeakMap;let M=!1;try{M=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(I,E){return M?new OffscreenCanvas(I,E):Oa("canvas")}function y(I,E,j){let re=1;const fe=Ct(I);if((fe.width>j||fe.height>j)&&(re=j/Math.max(fe.width,fe.height)),re<1)if(typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&I instanceof ImageBitmap||typeof VideoFrame<"u"&&I instanceof VideoFrame){const Me=Math.floor(re*fe.width),Re=Math.floor(re*fe.height);v===void 0&&(v=b(Me,Re));const de=E?b(Me,Re):v;return de.width=Me,de.height=Re,de.getContext("2d").drawImage(I,0,0,Me,Re),at("WebGLRenderer: Texture has been resized from ("+fe.width+"x"+fe.height+") to ("+Me+"x"+Re+")."),de}else return"data"in I&&at("WebGLRenderer: Image in DataTexture is too big ("+fe.width+"x"+fe.height+")."),I;return I}function S(I){return I.generateMipmaps}function P(I){s.generateMipmap(I)}function U(I){return I.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:I.isWebGL3DRenderTarget?s.TEXTURE_3D:I.isWebGLArrayRenderTarget||I.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function T(I,E,j,re,fe,Me=!1){if(I!==null){if(s[I]!==void 0)return s[I];at("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+I+"'")}let Re;re&&(Re=e.get("EXT_texture_norm16"),Re||at("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let de=E;if(E===s.RED&&(j===s.FLOAT&&(de=s.R32F),j===s.HALF_FLOAT&&(de=s.R16F),j===s.UNSIGNED_BYTE&&(de=s.R8),j===s.UNSIGNED_SHORT&&Re&&(de=Re.R16_EXT),j===s.SHORT&&Re&&(de=Re.R16_SNORM_EXT)),E===s.RED_INTEGER&&(j===s.UNSIGNED_BYTE&&(de=s.R8UI),j===s.UNSIGNED_SHORT&&(de=s.R16UI),j===s.UNSIGNED_INT&&(de=s.R32UI),j===s.BYTE&&(de=s.R8I),j===s.SHORT&&(de=s.R16I),j===s.INT&&(de=s.R32I)),E===s.RG&&(j===s.FLOAT&&(de=s.RG32F),j===s.HALF_FLOAT&&(de=s.RG16F),j===s.UNSIGNED_BYTE&&(de=s.RG8),j===s.UNSIGNED_SHORT&&Re&&(de=Re.RG16_EXT),j===s.SHORT&&Re&&(de=Re.RG16_SNORM_EXT)),E===s.RG_INTEGER&&(j===s.UNSIGNED_BYTE&&(de=s.RG8UI),j===s.UNSIGNED_SHORT&&(de=s.RG16UI),j===s.UNSIGNED_INT&&(de=s.RG32UI),j===s.BYTE&&(de=s.RG8I),j===s.SHORT&&(de=s.RG16I),j===s.INT&&(de=s.RG32I)),E===s.RGB_INTEGER&&(j===s.UNSIGNED_BYTE&&(de=s.RGB8UI),j===s.UNSIGNED_SHORT&&(de=s.RGB16UI),j===s.UNSIGNED_INT&&(de=s.RGB32UI),j===s.BYTE&&(de=s.RGB8I),j===s.SHORT&&(de=s.RGB16I),j===s.INT&&(de=s.RGB32I)),E===s.RGBA_INTEGER&&(j===s.UNSIGNED_BYTE&&(de=s.RGBA8UI),j===s.UNSIGNED_SHORT&&(de=s.RGBA16UI),j===s.UNSIGNED_INT&&(de=s.RGBA32UI),j===s.BYTE&&(de=s.RGBA8I),j===s.SHORT&&(de=s.RGBA16I),j===s.INT&&(de=s.RGBA32I)),E===s.RGB&&(j===s.UNSIGNED_SHORT&&Re&&(de=Re.RGB16_EXT),j===s.SHORT&&Re&&(de=Re.RGB16_SNORM_EXT),j===s.UNSIGNED_INT_5_9_9_9_REV&&(
vendor: 4,792 bytes, line 4132
4132de=s.RGB9_E5),j===s.UNSIGNED_INT_10F_11F_11F_REV&&(de=s.R11F_G11F_B10F)),E===s.RGBA){const ge=Me?ku:xt.getTransfer(fe);j===s.FLOAT&&(de=s.RGBA32F),j===s.HALF_FLOAT&&(de=s.RGBA16F),j===s.UNSIGNED_BYTE&&(de=ge===It?s.SRGB8_ALPHA8:s.RGBA8),j===s.UNSIGNED_SHORT&&Re&&(de=Re.RGBA16_EXT),j===s.SHORT&&Re&&(de=Re.RGBA16_SNORM_EXT),j===s.UNSIGNED_SHORT_4_4_4_4&&(de=s.RGBA4),j===s.UNSIGNED_SHORT_5_5_5_1&&(de=s.RGB5_A1)}return(de===s.R16F||de===s.R32F||de===s.RG16F||de===s.RG32F||de===s.RGBA16F||de===s.RGBA32F)&&e.get("EXT_color_buffer_float"),de}function N(I,E){let j;return I?E===null||E===Gi||E===Fa?j=s.DEPTH24_STENCIL8:E===Bi?j=s.DEPTH32F_STENCIL8:E===Ua&&(j=s.DEPTH24_STENCIL8,at("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):E===null||E===Gi||E===Fa?j=s.DEPTH_COMPONENT24:E===Bi?j=s.DEPTH_COMPONENT32F:E===Ua&&(j=s.DEPTH_COMPONENT16),j}function R(I,E){return S(I)===!0||I.isFramebufferTexture&&I.minFilter!==Mn&&I.minFilter!==mn?Math.log2(Math.max(E.width,E.height))+1:I.mipmaps!==void 0&&I.mipmaps.length>0?I.mipmaps.length:I.isCompressedTexture&&Array.isArray(I.image)?E.mipmaps.length:1}function F(I){const E=I.target;E.removeEventListener("dispose",F),L(E),E.isVideoTexture&&p.delete(E),E.isHTMLTexture&&m.delete(E)}function w(I){const E=I.target;E.removeEventListener("dispose",w),B(E)}function L(I){const E=n.get(I);if(E.__webglInit===void 0)return;const j=I.source,re=x.get(j);if(re){const fe=re[E.__cacheKey];fe.usedTimes--,fe.usedTimes===0&&z(I),Object.keys(re).length===0&&x.delete(j)}n.remove(I)}function z(I){const E=n.get(I);s.deleteTexture(E.__webglTexture);const j=I.source,re=x.get(j);delete re[E.__cacheKey],u.memory.textures--}function B(I){const E=n.get(I);if(I.depthTexture&&(I.depthTexture.dispose(),n.remove(I.depthTexture)),I.isWebGLCubeRenderTarget)for(let re=0;re<6;re++){if(Array.isArray(E.__webglFramebuffer[re]))for(let fe=0;fe<E.__webglFramebuffer[re].length;fe++)s.deleteFramebuffer(E.__webglFramebuffer[re][fe]);else s.deleteFramebuffer(E.__webglFramebuffer[re]);E.__webglDepthbuffer&&s.deleteRenderbuffer(E.__webglDepthbuffer[re])}else{if(Array.isArray(E.__webglFramebuffer))for(let re=0;re<E.__webglFramebuffer.length;re++)s.deleteFramebuffer(E.__webglFramebuffer[re]);else s.deleteFramebuffer(E.__webglFramebuffer);if(E.__webglDepthbuffer&&s.deleteRenderbuffer(E.__webglDepthbuffer),E.__webglMultisampledFramebuffer&&s.deleteFramebuffer(E.__webglMultisampledFramebuffer),E.__webglColorRenderbuffer)for(let re=0;re<E.__webglColorRenderbuffer.length;re++)E.__webglColorRenderbuffer[re]&&s.deleteRenderbuffer(E.__webglColorRenderbuffer[re]);E.__webglDepthRenderbuffer&&s.deleteRenderbuffer(E.__webglDepthRenderbuffer)}const j=I.textures;for(let re=0,fe=j.length;re<fe;re++){const Me=n.get(j[re]);Me.__webglTexture&&(s.deleteTexture(Me.__webglTexture),u.memory.textures--),n.remove(j[re])}n.remove(I)}let G=0;function J(){G=0}function oe(){return G}function Y(I){G=I}function ie(){const I=G;return I>=r.maxTextures&&at("WebGLTextures: Trying to use "+I+" texture units while this GPU supports only "+r.maxTextures),G+=1,I}function K(I){const E=[];return E.push(I.wrapS),E.push(I.wrapT),E.push(I.wrapR||0),E.push(I.magFilter),E.push(I.minFilter),E.push(I.anisotropy),E.push(I.internalFormat),E.push(I.format),E.push(I.type),E.push(I.generateMipmaps),E.push(I.premultiplyAlpha),E.push(I.flipY),E.push(I.unpackAlignment),E.push(I.colorSpace),E.join()}function $(I,E){const j=n.get(I);if(I.isVideoTexture&&H(I),I.isRenderTargetTexture===!1&&I.isExternalTexture!==!0&&I.version>0&&j.__version!==I.version){const re=I.image;if(re===null)at("WebGLRenderer: Texture marked for update but no image data found.");else if(re.complete===!1)at("WebGLRenderer: Texture marked for update but image is incomplete");else{Fe(j,I,E);return}}else I.isExternalTexture&&(j.__webglTexture=I.sourceTexture?I.sourceTexture:null);t.bindTexture(s.TEXTURE_2D,j.__webglTexture,s.TEXTURE0+E)}function le(I,E){const j=n.get(I);if(I.isRenderTargetTexture===!1&&I.version>0&&j.__version!==I.version){Fe(j,I,E);return}else I.isExternalTexture&&(j.__webglTexture=I.sourceTexture?I.sourceTexture:null);t.bindTexture(s.TEXTURE_2D_ARRAY,j.__webglTexture,s.TEXTURE0+E)}function ue(I,E){const j=n.get(I);if(I.isRenderTargetTexture===!1&&I.version>0&&j.__version!==I.version){Fe(j,I,E);return}t.bindTexture(s.TEXTURE_3D,j.__webglTexture,s.TEXTURE0+E)}function k(I,E){const j=n.get(I);if(I.isCubeDepthTexture!==!0&&I.version>0&&j.__version!==I.version){Qe(j,I,E);return}t.bindTexture(s.TEXTURE_CUBE_MAP,j.__webglTexture,s.TEXTURE0+E)}const Q={[Ia]:s.REPEAT,[rs]:s.CLAMP_TO_EDGE,[Jf]:s.MIRRORED_REPEAT},De={[Mn]:s.NEAREST,[Hy]:s.NEAREST_MIPMAP_NEAREST,[Yl]:s.NEAREST_MIPMAP_LINEAR,[mn]:s.LINEAR,[Wh]:s.LINEAR_MIPMAP_NEAREST,[os]:s.LINEAR_MIPMAP_LINEAR}
vendor: 8,372 bytes, line 4132
4132,He={[Xy]:s.NEVER,[jy]:s.ALWAYS,[$y]:s.LESS,[Jd]:s.LEQUAL,[qy]:s.EQUAL,[ep]:s.GEQUAL,[Yy]:s.GREATER,[Ky]:s.NOTEQUAL};function Be(I,E){if(E.type===Bi&&e.has("OES_texture_float_linear")===!1&&(E.magFilter===mn||E.magFilter===Wh||E.magFilter===Yl||E.magFilter===os||E.minFilter===mn||E.minFilter===Wh||E.minFilter===Yl||E.minFilter===os)&&at("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(I,s.TEXTURE_WRAP_S,Q[E.wrapS]),s.texParameteri(I,s.TEXTURE_WRAP_T,Q[E.wrapT]),(I===s.TEXTURE_3D||I===s.TEXTURE_2D_ARRAY)&&s.texParameteri(I,s.TEXTURE_WRAP_R,Q[E.wrapR]),s.texParameteri(I,s.TEXTURE_MAG_FILTER,De[E.magFilter]),s.texParameteri(I,s.TEXTURE_MIN_FILTER,De[E.minFilter]),E.compareFunction&&(s.texParameteri(I,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(I,s.TEXTURE_COMPARE_FUNC,He[E.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(E.magFilter===Mn||E.minFilter!==Yl&&E.minFilter!==os||E.type===Bi&&e.has("OES_texture_float_linear")===!1)return;if(E.anisotropy>1||n.get(E).__currentAnisotropy){const j=e.get("EXT_texture_filter_anisotropic");s.texParameterf(I,j.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,r.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy}}}function ae(I,E){let j=!1;I.__webglInit===void 0&&(I.__webglInit=!0,E.addEventListener("dispose",F));const re=E.source;let fe=x.get(re);fe===void 0&&(fe={},x.set(re,fe));const Me=K(E);if(Me!==I.__cacheKey){fe[Me]===void 0&&(fe[Me]={texture:s.createTexture(),usedTimes:0},u.memory.textures++,j=!0),fe[Me].usedTimes++;const Re=fe[I.__cacheKey];Re!==void 0&&(fe[I.__cacheKey].usedTimes--,Re.usedTimes===0&&z(E)),I.__cacheKey=Me,I.__webglTexture=fe[Me].texture}return j}function ve(I,E,j){return Math.floor(Math.floor(I/j)/E)}function pe(I,E,j,re){const Me=I.updateRanges;if(Me.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,E.width,E.height,j,re,E.data);else{Me.sort((Ye,Le)=>Ye.start-Le.start);let Re=0;for(let Ye=1;Ye<Me.length;Ye++){const Le=Me[Re],Ae=Me[Ye],et=Le.start+Le.count,nt=ve(Ae.start,E.width,4),rt=ve(Le.start,E.width,4);Ae.start<=et+1&&nt===rt&&ve(Ae.start+Ae.count-1,E.width,4)===nt?Le.count=Math.max(Le.count,Ae.start+Ae.count-Le.start):(++Re,Me[Re]=Ae)}Me.length=Re+1;const de=t.getParameter(s.UNPACK_ROW_LENGTH),ge=t.getParameter(s.UNPACK_SKIP_PIXELS),Ne=t.getParameter(s.UNPACK_SKIP_ROWS);t.pixelStorei(s.UNPACK_ROW_LENGTH,E.width);for(let Ye=0,Le=Me.length;Ye<Le;Ye++){const Ae=Me[Ye],et=Math.floor(Ae.start/4),nt=Math.ceil(Ae.count/4),rt=et%E.width,W=Math.floor(et/E.width),Ce=nt,me=1;t.pixelStorei(s.UNPACK_SKIP_PIXELS,rt),t.pixelStorei(s.UNPACK_SKIP_ROWS,W),t.texSubImage2D(s.TEXTURE_2D,0,rt,W,Ce,me,j,re,E.data)}I.clearUpdateRanges(),t.pixelStorei(s.UNPACK_ROW_LENGTH,de),t.pixelStorei(s.UNPACK_SKIP_PIXELS,ge),t.pixelStorei(s.UNPACK_SKIP_ROWS,Ne)}}function Fe(I,E,j){let re=s.TEXTURE_2D;(E.isDataArrayTexture||E.isCompressedArrayTexture)&&(re=s.TEXTURE_2D_ARRAY),E.isData3DTexture&&(re=s.TEXTURE_3D);const fe=ae(I,E),Me=E.source;t.bindTexture(re,I.__webglTexture,s.TEXTURE0+j);const Re=n.get(Me);if(Me.version!==Re.__version||fe===!0){if(t.activeTexture(s.TEXTURE0+j),(typeof ImageBitmap<"u"&&E.image instanceof ImageBitmap)===!1){const me=xt.getPrimaries(xt.workingColorSpace),Pe=E.colorSpace===Vs?null:xt.getPrimaries(E.colorSpace),Ie=E.colorSpace===Vs||me===Pe?s.NONE:s.BROWSER_DEFAULT_WEBGL;t.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,E.flipY),t.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),t.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ie)}t.pixelStorei(s.UNPACK_ALIGNMENT,E.unpackAlignment);let ge=y(E.image,!1,r.maxTextureSize);ge=gn(E,ge);const Ne=a.convert(E.format,E.colorSpace),Ye=a.convert(E.type);let Le=T(E.internalFormat,Ne,Ye,E.normalized,E.colorSpace,E.isVideoTexture);Be(re,E);let Ae;const et=E.mipmaps,nt=E.isVideoTexture!==!0,rt=Re.__version===void 0||fe===!0,W=Me.dataReady,Ce=R(E,ge);if(E.isDepthTexture)Le=N(E.format===xr,E.type),rt&&(nt?t.texStorage2D(s.TEXTURE_2D,1,Le,ge.width,ge.height):t.texImage2D(s.TEXTURE_2D,0,Le,ge.width,ge.height,0,Ne,Ye,null));else if(E.isDataTexture)if(et.length>0){nt&&rt&&t.texStorage2D(s.TEXTURE_2D,Ce,Le,et[0].width,et[0].height);for(let me=0,Pe=et.length;me<Pe;me++)Ae=et[me],nt?W&&t.texSubImage2D(s.TEXTURE_2D,me,0,0,Ae.width,Ae.height,Ne,Ye,Ae.data):t.texImage2D(s.TEXTURE_2D,me,Le,Ae.width,Ae.height,0,Ne,Ye,Ae.data);E.generateMipmaps=!1}else nt?(rt&&t.texStorage2D(s.TEXTURE_2D,Ce,Le,ge.width,ge.height),W&&pe(E,ge,Ne,Ye)):t.texImage2D(s.TEXTURE_2D,0,Le,ge.width,ge.height,0,Ne,Ye,ge.data);else if(E.isCompressedTexture)if(E.isCompressedArrayTexture){nt&&rt&&t.texStorage3D(s.TEXTURE_2D_ARRAY,Ce,Le,et[0].width,et[0].height,ge.depth);for(let me=0,Pe=et.length;me<Pe;me++)if(Ae=et[me],E.format!==Ti)if(Ne!==null)if(nt){if(W)if(E.layerUpdates.size>0){const Ie=Mv(Ae.width,Ae.height,E.format,E.type);for(const _e of E.layerUpdates){const Xe=Ae.data.subarray(_e*Ie/Ae.data.BYTES_PER_ELEMENT,(_e+1)*Ie/Ae.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,me,0,0,_e,Ae.width,Ae.height,1,Ne,Xe)}E.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,me,0,0,0,Ae.width,Ae.height,ge.depth,Ne,Ae.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,me,Le,Ae.width,Ae.height,ge.depth,0,Ae.data,0,0);else at("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else nt?W&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,me,0,0,0,Ae.width,Ae.height,ge.depth,Ne,Ye,Ae.data):t.texImage3D(s.TEXTURE_2D_ARRAY,me,Le,Ae.width,Ae.height,ge.depth,0,Ne,Ye,Ae.data)}else{nt&&rt&&t.texStorage2D(s.TEXTURE_2D,Ce,Le,et[0].width,et[0].height);for(let me=0,Pe=et.length;me<Pe;me++)Ae=et[me],E.format!==Ti?Ne!==null?nt?W&&t.compressedTexSubImage2D(s.TEXTURE_2D,me,0,0,Ae.width,Ae.height,Ne,Ae.data):t.compressedTexImage2D(s.TEXTURE_2D,me,Le,Ae.width,Ae.height,0,Ae.data):at("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):nt?W&&t.texSubImage2D(s.TEXTURE_2D,me,0,0,Ae.width,Ae.height,Ne,Ye,Ae.data):t.texImage2D(s.TEXTURE_2D,me,Le,Ae.width,Ae.height,0,Ne,Ye,Ae.data)}else if(E.isDataArrayTexture)if(nt){if(rt&&t.texStorage3D(s.TEXTURE_2D_ARRAY,Ce,Le,ge.width,ge.height,ge.depth),W)if(E.layerUpdates.size>0){const me=Mv(ge.width,ge.height,E.format,E.type);for(const Pe of E.layerUpdates){const Ie=ge.data.subarray(Pe*me/ge.data.BYTES_PER_ELEMENT,(Pe+1)*me/ge.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,Pe,ge.width,ge.height,1,Ne,Ye,Ie)}E.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,ge.width,ge.height,ge.depth,Ne,Ye,ge.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,Le,ge.width,ge.height,ge.depth,0,Ne,Ye,ge.data);else if(E.isData3DTexture)nt?(rt&&t.texStorage3D(s.TEXTURE_3D,Ce,Le,ge.width,ge.height,ge.depth),W&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,ge.width,ge.height,ge.depth,Ne,Ye,ge.data)):t.texImage3D(s.TEXTURE_3D,0,Le,ge.width,ge.height,ge.depth,0,Ne,Ye,ge.data);else if(E.isFramebufferTexture){if(rt)if(nt)t.texStorage2D(s.TEXTURE_2D,Ce,Le,ge.width,ge.height);else{let me=ge.width,Pe=ge.height;for(let Ie=0;Ie<Ce;Ie++)t.texImage2D(s.TEXTURE_2D,Ie,Le,me,Pe,0,Ne,Ye,null),me>>=1,Pe>>=1}}else if(E.isHTMLTexture){if("texElementImage2D"in s){const me=s.canvas;if(me.hasAttribute("layoutsubtree")||me.setAttribute("layoutsubtree","true"),ge.parentNode!==me){me.appendChild(ge),m.add(E),me.onpaint=Pe=>{const Ie=Pe.changedElements;for(const _e of m)Ie.includes(_e.image)&&(_e.needsUpdate=!0)},me.requestPaint();return}if(s.texElementImage2D.length===3)s.texElementImage2D(s.TEXTURE_2D,s.RGBA8,ge);else{const Ie=s.RGBA,_e=s.RGBA,Xe=s.UNSIGNED_BYTE;s.texElementImage2D(s.TEXTURE_2D,0,Ie,_e,Xe,ge)}s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE)}}else if(et.length>0){if(nt&&rt){const me=Ct(et[0]);t.texStorage2D(s.TEXTURE_2D,Ce,Le,me.width,me.height)}for(let me=0,Pe=et.length;me<Pe;me++)Ae=et[me],nt?W&&t.texSubImage2D(s.TEXTURE_2D,me,0,0,Ne,Ye,Ae):t.texImage2D(s.TEXTURE_2D,me,Le,Ne,Ye,Ae);E.generateMipmaps=!1}else if(nt){if(rt){const me=Ct(ge);t.texStorage2D(s.TEXTURE_2D,Ce,Le,me.width,me.height)}W&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,Ne,Ye,ge)}else t.texImage2D(s.TEXTURE_2D,0,Le,Ne,Ye,ge);
vendor: 36,107 bytes, lines 4132-4156
4132S(E)&&P(re),Re.__version=Me.version,E.onUpdate&&E.onUpdate(E)}I.__version=E.version}function Qe(I,E,j){if(E.image.length!==6)return;const re=ae(I,E),fe=E.source;t.bindTexture(s.TEXTURE_CUBE_MAP,I.__webglTexture,s.TEXTURE0+j);const Me=n.get(fe);if(fe.version!==Me.__version||re===!0){t.activeTexture(s.TEXTURE0+j);const Re=xt.getPrimaries(xt.workingColorSpace),de=E.colorSpace===Vs?null:xt.getPrimaries(E.colorSpace),ge=E.colorSpace===Vs||Re===de?s.NONE:s.BROWSER_DEFAULT_WEBGL;t.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,E.flipY),t.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),t.pixelStorei(s.UNPACK_ALIGNMENT,E.unpackAlignment),t.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,ge);const Ne=E.isCompressedTexture||E.image[0].isCompressedTexture,Ye=E.image[0]&&E.image[0].isDataTexture,Le=[];for(let _e=0;_e<6;_e++)!Ne&&!Ye?Le[_e]=y(E.image[_e],!0,r.maxCubemapSize):Le[_e]=Ye?E.image[_e].image:E.image[_e],Le[_e]=gn(E,Le[_e]);const Ae=Le[0],et=a.convert(E.format,E.colorSpace),nt=a.convert(E.type),rt=T(E.internalFormat,et,nt,E.normalized,E.colorSpace),W=E.isVideoTexture!==!0,Ce=Me.__version===void 0||re===!0,me=fe.dataReady;let Pe=R(E,Ae);Be(s.TEXTURE_CUBE_MAP,E);let Ie;if(Ne){W&&Ce&&t.texStorage2D(s.TEXTURE_CUBE_MAP,Pe,rt,Ae.width,Ae.height);for(let _e=0;_e<6;_e++){Ie=Le[_e].mipmaps;for(let Xe=0;Xe<Ie.length;Xe++){const Ge=Ie[Xe];E.format!==Ti?et!==null?W?me&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,Xe,0,0,Ge.width,Ge.height,et,Ge.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,Xe,rt,Ge.width,Ge.height,0,Ge.data):at("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):W?me&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,Xe,0,0,Ge.width,Ge.height,et,nt,Ge.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,Xe,rt,Ge.width,Ge.height,0,et,nt,Ge.data)}}}else{if(Ie=E.mipmaps,W&&Ce){Ie.length>0&&Pe++;const _e=Ct(Le[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,Pe,rt,_e.width,_e.height)}for(let _e=0;_e<6;_e++)if(Ye){W?me&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,Le[_e].width,Le[_e].height,et,nt,Le[_e].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,rt,Le[_e].width,Le[_e].height,0,et,nt,Le[_e].data);for(let Xe=0;Xe<Ie.length;Xe++){const Ut=Ie[Xe].image[_e].image;W?me&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,Xe+1,0,0,Ut.width,Ut.height,et,nt,Ut.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,Xe+1,rt,Ut.width,Ut.height,0,et,nt,Ut.data)}}else{W?me&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,et,nt,Le[_e]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,rt,et,nt,Le[_e]);for(let Xe=0;Xe<Ie.length;Xe++){const Ge=Ie[Xe];W?me&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,Xe+1,0,0,et,nt,Ge.image[_e]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+_e,Xe+1,rt,et,nt,Ge.image[_e])}}}S(E)&&P(s.TEXTURE_CUBE_MAP),Me.__version=fe.version,E.onUpdate&&E.onUpdate(E)}I.__version=E.version}function Je(I,E,j,re,fe,Me){const Re=a.convert(j.format,j.colorSpace),de=a.convert(j.type),ge=T(j.internalFormat,Re,de,j.normalized,j.colorSpace),Ne=n.get(E),Ye=n.get(j);if(Ye.__renderTarget=E,!Ne.__hasExternalTextures){const Le=Math.max(1,E.width>>Me),Ae=Math.max(1,E.height>>Me);fe===s.TEXTURE_3D||fe===s.TEXTURE_2D_ARRAY?t.texImage3D(fe,Me,ge,Le,Ae,E.depth,0,Re,de,null):t.texImage2D(fe,Me,ge,Le,Ae,0,Re,de,null)}t.bindFramebuffer(s.FRAMEBUFFER,I),mt(E)?c.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,re,fe,Ye.__webglTexture,0,tt(E)):(fe===s.TEXTURE_2D||fe>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&fe<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,re,fe,Ye.__webglTexture,Me),t.bindFramebuffer(s.FRAMEBUFFER,null)}function Ft(I,E,j){if(s.bindRenderbuffer(s.RENDERBUFFER,I),E.depthBuffer){const re=E.depthTexture,fe=re&&re.isDepthTexture?re.type:null,Me=N(E.stencilBuffer,fe),Re=E.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;mt(E)?c.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,tt(E),Me,E.width,E.height):j?s.renderbufferStorageMultisample(s.RENDERBUFFER,tt(E),Me,E.width,E.height):s.renderbufferStorage(s.RENDERBUFFER,Me,E.width,E.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,Re,s.RENDERBUFFER,I)}else{const re=E.textures;for(let fe=0;fe<re.length;fe++){const Me=re[fe],Re=a.convert(Me.format,Me.colorSpace),de=a.convert(Me.type),ge=T(Me.internalFormat,Re,de,Me.normalized,Me.colorSpace);mt(E)?c.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,tt(E),ge,E.width,E.height):j?s.renderbufferStorageMultisample(s.RENDERBUFFER,tt(E),ge,E.width,E.height):s.renderbufferStorage(s.RENDERBUFFER,ge,E.width,E.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function ht(I,E,j){const re=E.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(s.FRAMEBUFFER,I),!(E.depthTexture&&E.depthTexture.isDepthTexture))throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");const fe=n.get(E.depthTexture);if(fe.__renderTarget=E,(!fe.__webglTexture||E.depthTexture.image.width!==E.width||E.depthTexture.image.height!==E.height)&&(E.depthTexture.image.width=E.width,E.depthTexture.image.height=E.height,E.depthTexture.needsUpdate=!0),re){if(fe.__webglInit===void 0&&(fe.__webglInit=!0,E.depthTexture.addEventListener("dispose",F)),fe.__webglTexture===void 0){fe.__webglTexture=s.createTexture(),t.bindTexture(s.TEXTURE_CUBE_MAP,fe.__webglTexture),Be(s.TEXTURE_CUBE_MAP,E.depthTexture);const Ne=a.convert(E.depthTexture.format),Ye=a.convert(E.depthTexture.type);let Le;E.depthTexture.format===ds?Le=s.DEPTH_COMPONENT24:E.depthTexture.format===xr&&(Le=s.DEPTH24_STENCIL8);for(let Ae=0;Ae<6;Ae++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0,Le,E.width,E.height,0,Ne,Ye,null)}}else $(E.depthTexture,0);const Me=fe.__webglTexture,Re=tt(E),de=re?s.TEXTURE_CUBE_MAP_POSITIVE_X+j:s.TEXTURE_2D,ge=E.depthTexture.format===xr?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;if(E.depthTexture.format===ds)mt(E)?c.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,ge,de,Me,0,Re):s.framebufferTexture2D(s.FRAMEBUFFER,ge,de,Me,0);else if(E.depthTexture.format===xr)mt(E)?c.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,ge,de,Me,0,Re):s.framebufferTexture2D(s.FRAMEBUFFER,ge,de,Me,0);else throw new Error("THREE.WebGLTextures: Unknown depthTexture format.")}function Mt(I){const E=n.get(I),j=I.isWebGLCubeRenderTarget===!0;if(E.__boundDepthTexture!==I.depthTexture){const re=I.depthTexture;if(E.__depthDisposeCallback&&E.__depthDisposeCallback(),re){const fe=()=>{delete E.__boundDepthTexture,delete E.__depthDisposeCallback,re.removeEventListener("dispose",fe)};re.addEventListener("dispose",fe),E.__depthDisposeCallback=fe}E.__boundDepthTexture=re}if(I.depthTexture&&!E.__autoAllocateDepthBuffer)if(j)for(let re=0;re<6;re++)ht(E.__webglFramebuffer[re],I,re);else{const re=I.texture.mipmaps;re&&re.length>0?ht(E.__webglFramebuffer[0],I,0):ht(E.__webglFramebuffer,I,0)}else if(j){E.__webglDepthbuffer=[];for(let re=0;re<6;re++)if(t.bindFramebuffer(s.FRAMEBUFFER,E.__webglFramebuffer[re]),E.__webglDepthbuffer[re]===void 0)E.__webglDepthbuffer[re]=s.createRenderbuffer(),Ft(E.__webglDepthbuffer[re],I,!1);else{const fe=I.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Me=E.__webglDepthbuffer[re];s.bindRenderbuffer(s.RENDERBUFFER,Me),s.framebufferRenderbuffer(s.FRAMEBUFFER,fe,s.RENDERBUFFER,Me)}}else{const re=I.texture.mipmaps;if(re&&re.length>0?t.bindFramebuffer(s.FRAMEBUFFER,E.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,E.__webglFramebuffer),E.__webglDepthbuffer===void 0)E.__webglDepthbuffer=s.createRenderbuffer(),Ft(E.__webglDepthbuffer,I,!1);else{const fe=I.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Me=E.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,Me),s.framebufferRenderbuffer(s.FRAMEBUFFER,fe,s.RENDERBUFFER,Me)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function _t(I,E,j){const re=n.get(I);E!==void 0&&Je(re.__webglFramebuffer,I,I.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),j!==void 0&&Mt(I)}function ft(I){const E=I.texture,j=n.get(I),re=n.get(E);I.addEventListener("dispose",w);const fe=I.textures,Me=I.isWebGLCubeRenderTarget===!0,Re=fe.length>1;if(Re||(re.__webglTexture===void 0&&(re.__webglTexture=s.createTexture()),re.__version=E.version,u.memory.textures++),Me){j.__webglFramebuffer=[];for(let de=0;de<6;de++)if(E.mipmaps&&E.mipmaps.length>0){j.__webglFramebuffer[de]=[];for(let ge=0;ge<E.mipmaps.length;ge++)j.__webglFramebuffer[de][ge]=s.createFramebuffer()}else j.__webglFramebuffer[de]=s.createFramebuffer()}else{if(E.mipmaps&&E.mipmaps.length>0){j.__webglFramebuffer=[];for(let de=0;de<E.mipmaps.length;de++)j.__webglFramebuffer[de]=s.createFramebuffer()}else j.__webglFramebuffer=s.createFramebuffer();if(Re)for(let de=0,ge=fe.length;de<ge;de++){const Ne=n.get(fe[de]);Ne.__webglTexture===void 0&&(Ne.__webglTexture=s.createTexture(),u.memory.textures++)}if(I.samples>0&&mt(I)===!1){j.__webglMultisampledFramebuffer=s.createFramebuffer(),j.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,j.__webglMultisampledFramebuffer);for(let de=0;de<fe.length;de++){const ge=fe[de];j.__webglColorRenderbuffer[de]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,j.__webglColorRenderbuffer[de]);const Ne=a.convert(ge.format,ge.colorSpace),Ye=a.convert(ge.type),Le=T(ge.internalFormat,Ne,Ye,ge.normalized,ge.colorSpace,I.isXRRenderTarget===!0),Ae=tt(I);s.renderbufferStorageMultisample(s.RENDERBUFFER,Ae,Le,I.width,I.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+de,s.RENDERBUFFER,j.__webglColorRenderbuffer[de])}s.bindRenderbuffer(s.RENDERBUFFER,null),I.depthBuffer&&(j.__webglDepthRenderbuffer=s.createRenderbuffer(),Ft(j.__webglDepthRenderbuffer,I,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(Me){t.bindTexture(s.TEXTURE_CUBE_MAP,re.__webglTexture),Be(s.TEXTURE_CUBE_MAP,E);for(let de=0;de<6;de++)if(E.mipmaps&&E.mipmaps.length>0)for(let ge=0;ge<E.mipmaps.length;ge++)Je(j.__webglFramebuffer[de][ge],I,E,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+de,ge);else Je(j.__webglFramebuffer[de],I,E,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+de,0);S(E)&&P(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Re){for(let de=0,ge=fe.length;de<ge;de++){const Ne=fe[de],Ye=n.get(Ne);let Le=s.TEXTURE_2D;(I.isWebGL3DRenderTarget||I.isWebGLArrayRenderTarget)&&(Le=I.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(Le,Ye.__webglTexture),Be(Le,Ne),Je(j.__webglFramebuffer,I,Ne,s.COLOR_ATTACHMENT0+de,Le,0),S(Ne)&&P(Le)}t.unbindTexture()}else{let de=s.TEXTURE_2D;if((I.isWebGL3DRenderTarget||I.isWebGLArrayRenderTarget)&&(de=I.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(de,re.__webglTexture),Be(de,E),E.mipmaps&&E.mipmaps.length>0)for(let ge=0;ge<E.mipmaps.length;ge++)Je(j.__webglFramebuffer[ge],I,E,s.COLOR_ATTACHMENT0,de,ge);else Je(j.__webglFramebuffer,I,E,s.COLOR_ATTACHMENT0,de,0);S(E)&&P(de),t.unbindTexture()}I.depthBuffer&&Mt(I)}function kt(I){const E=I.textures;for(let j=0,re=E.length;j<re;j++){const fe=E[j];if(S(fe)){const Me=U(I),Re=n.get(fe).__webglTexture;t.bindTexture(Me,Re),P(Me),t.unbindTexture()}}}const Ht=[],Gt=[];function Bt(I){if(I.samples>0){if(mt(I)===!1){const E=I.textures,j=I.width,re=I.height;let fe=s.COLOR_BUFFER_BIT;const Me=I.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Re=n.get(I),de=E.length>1;if(de)for(let Ne=0;Ne<E.length;Ne++)t.bindFramebuffer(s.FRAMEBUFFER,Re.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ne,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,Re.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ne,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,Re.__webglMultisampledFramebuffer);const ge=I.texture.mipmaps;ge&&ge.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Re.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Re.__webglFramebuffer);for(let Ne=0;Ne<E.length;Ne++){if(I.resolveDepthBuffer&&(I.depthBuffer&&(fe|=s.DEPTH_BUFFER_BIT),I.stencilBuffer&&I.resolveStencilBuffer&&(fe|=s.STENCIL_BUFFER_BIT)),de){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,Re.__webglColorRenderbuffer[Ne]);const Ye=n.get(E[Ne]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,Ye,0)}s.blitFramebuffer(0,0,j,re,0,0,j,re,fe,s.NEAREST),h===!0&&(Ht.length=0,Gt.length=0,Ht.push(s.COLOR_ATTACHMENT0+Ne),I.depthBuffer&&I.resolveDepthBuffer===!1&&(Ht.push(Me),Gt.push(Me),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,Gt)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,Ht))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),de)for(let Ne=0;Ne<E.length;Ne++){t.bindFramebuffer(s.FRAMEBUFFER,Re.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ne,s.RENDERBUFFER,Re.__webglColorRenderbuffer[Ne]);const Ye=n.get(E[Ne]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,Re.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ne,s.TEXTURE_2D,Ye,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Re.__webglMultisampledFramebuffer)}else if(I.depthBuffer&&I.resolveDepthBuffer===!1&&h){const E=I.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[E])}}}function tt(I){return Math.min(r.maxSamples,I.samples)}function mt(I){const E=n.get(I);return I.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&E.__useRenderToTexture!==!1}function H(I){const E=u.render.frame;p.get(I)!==E&&(p.set(I,E),I.update())}function gn(I,E){const j=I.colorSpace,re=I.format,fe=I.type;return I.isCompressedTexture===!0||I.isVideoTexture===!0||j!==Ou&&j!==Vs&&(xt.getTransfer(j)===It?(re!==Ti||fe!==di)&&at("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):wt("WebGLTextures: Unsupported texture color space:",j)),E}function Ct(I){return typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement?(d.width=I.naturalWidth||I.width,d.height=I.naturalHeight||I.height):typeof VideoFrame<"u"&&I instanceof VideoFrame?(d.width=I.displayWidth,d.height=I.displayHeight):(d.width=I.width,d.height=I.height),d}this.allocateTextureUnit=ie,this.resetTextureUnits=J,this.getTextureUnits=oe,this.setTextureUnits=Y,this.setTexture2D=$,this.setTexture2DArray=le,this.setTexture3D=ue,this.setTextureCube=k,this.rebindTextures=_t,this.setupRenderTarget=ft,this.updateRenderTargetMipmap=kt,this.updateMultisampleRenderTarget=Bt,this.setupDepthRenderbuffer=Mt,this.setupFrameBufferTexture=Je,this.useMultisampledRTT=mt,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function bT(s,e){function t(n,r=Vs){let a;const u=xt.getTransfer(r);if(n===di)return s.UNSIGNED_BYTE;if(n===Yd)return s.UNSIGNED_SHORT_4_4_4_4;if(n===Kd)return s.UNSIGNED_SHORT_5_5_5_1;if(n===__)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===x_)return s.UNSIGNED_INT_10F_11F_11F_REV;if(n===g_)return s.BYTE;if(n===v_)return s.SHORT;if(n===Ua)return s.UNSIGNED_SHORT;if(n===qd)return s.INT;if(n===Gi)return s.UNSIGNED_INT;if(n===Bi)return s.FLOAT;if(n===fs)return s.HALF_FLOAT;if(n===S_)return s.ALPHA;if(n===y_)return s.RGB;if(n===Ti)return s.RGBA;if(n===ds)return s.DEPTH_COMPONENT;if(n===xr)return s.DEPTH_STENCIL;if(n===M_)return s.RED;if(n===jd)return s.RED_INTEGER;if(n===Mr)return s.RG;if(n===Qd)return s.RG_INTEGER;if(n===Zd)return s.RGBA_INTEGER;if(n===Tu||n===Cu||n===Au||n===Ru)if(u===It)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(n===Tu)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Cu)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Au)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ru)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(n===Tu)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Cu)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Au)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ru)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===ed||n===td||n===nd||n===id)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(n===ed)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===td)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===nd)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===id)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===sd||n===rd||n===od||n===ad||n===ld||n===Uu||n===ud)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(n===sd||n===rd)return u===It?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(n===od)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC;if(n===ad)return a.COMPRESSED_R11_EAC;if(n===ld)return a.COMPRESSED_SIGNED_R11_EAC;if(n===Uu)return a.COMPRESSED_RG11_EAC;if(n===ud)return a.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===cd||n===hd||n===fd||n===dd||n===pd||n===md||n===gd||n===vd||n===_d||n===xd||n===Sd||n===yd||n===Md||n===Ed)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(n===cd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===hd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===fd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===dd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===pd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===md)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===gd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===vd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===_d)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===xd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Sd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===yd)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Md)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ed)return u===It?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===wd||n===bd||n===Td)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(n===wd)return u===It?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===bd)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Td)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Cd||n===Ad||n===Fu||n===Rd)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(n===Cd)return a.COMPRESSED_RED_RGTC1_EXT;if(n===Ad)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Fu)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Rd)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Fa?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const TT=`
4133void main() {
4134
4135	gl_Position = vec4( position, 1.0 );
4136
4137}`,CT=`
4138uniform sampler2DArray depthColor;
4139uniform float depthWidth;
4140uniform float depthHeight;
4141
4142void main() {
4143
4144	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
4145
4146	if ( coord.x >= 1.0 ) {
4147
4148		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
4149
4150	} else {
4151
4152		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
4153
4154	}
4155
4156}`;class AT{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new N_(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Ai({vertexShader:TT,fragmentShader:CT,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ti(new Ha(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class RT extends Ar{constructor(e,t){super();const n=this;let r=null,a=1,u=null,c="local-floor",h=1,d=null,p=null,m=null,v=null,x=null,M=null;const b=typeof XRWebGLBinding<"u",y=new AT,S={},P=t.getContextAttributes();let U=null,T=null;const N=[],R=[],F=new Tt;let w=null;const L=new fi;L.viewport=new Jt;const z=new fi;z.viewport=new Jt;const B=[L,z],G=new BM;let J=null,oe=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ae){let ve=N[ae];return ve===void 0&&(ve=new Zh,N[ae]=ve),ve.getTargetRaySpace()},this.getControllerGrip=function(ae){let ve=N[ae];return ve===void 0&&(ve=new Zh,N[ae]=ve),ve.getGripSpace()},this.getHand=function(ae){let ve=N[ae];return ve===void 0&&(ve=new Zh,N[ae]=ve),ve.getHandSpace()};function Y(ae){const ve=R.indexOf(ae.inputSource);if(ve===-1)return;const pe=N[ve];pe!==void 0&&(pe.update(ae.inputSource,ae.frame,d||u),pe.dispatchEvent({type:ae.type,data:ae.inputSource}))}function ie(){r.removeEventListener("select",Y),r.removeEventListener("selectstart",Y),r.removeEventListener("selectend",Y),r.removeEventListener("squeeze",Y),r.removeEventListener("squeezestart",Y),r.removeEventListener("squeezeend",Y),r.removeEventListener("end",ie),r.removeEventListener("inputsourceschange",K);for(let ae=0;ae<N.length;ae++){const ve=R[ae];ve!==null&&(R[ae]=null,N[ae].disconnect(ve))}J=null,oe=null,y.reset();for(const ae in S)delete S[ae];e.setRenderTarget(U),x=null,v=null,m=null,r=null,T=null,Be.stop(),n.isPresenting=!1,e.setPixelRatio(w),e.setSize(F.width,F.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ae){a=ae,n.isPresenting===!0&&at("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ae){c=ae,n.isPresenting===!0&&at("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||u},this.setReferenceSpace=function(ae){d=ae},this.getBaseLayer=function(){return v!==null?v:x},this.getBinding=function(){return m===null&&b&&(m=new XRWebGLBinding(r,t)),m},this.getFrame=function(){return M},this.getSession=function(){return r},this.setSession=async function(ae){if(r=ae,r!==null){if(U=e.getRenderTarget(),r.addEventListener("select",Y),r.addEventListener("selectstart",Y),r.addEventListener("selectend",Y),r.addEventListener("squeeze",Y),r.addEventListener("squeezestart",Y),r.addEventListener("squeezeend",Y),r.addEventListener("end",ie),r.addEventListener("inputsourceschange",K),P.xrCompatible!==!0&&await t.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(F),b&&"createProjectionLayer"in XRWebGLBinding.prototype){let pe=null,Fe=null,Qe=null;P.depth&&(Qe=P.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,pe=P.stencil?xr:ds,Fe=P.stencil?Fa:Gi);const Je={colorFormat:t.RGBA8,depthFormat:Qe,scaleFactor:a};m=this.getBinding(),v=m.createProjectionLayer(Je),r.updateRenderState({layers:[v]}),e.setPixelRatio(1),e.setSize(v.textureWidth,v.textureHeight,!1),T=new Vi(v.textureWidth,v.textureHeight,{format:Ti,type:di,depthTexture:new Ro(v.textureWidth,v.textureHeight,Fe,void 0,void 0,void 0,void 0,void 0,void 0,pe),stencilBuffer:P.stencil,colorSpace:e.outputColorSpace,samples:P.antialias?4:0,resolveDepthBuffer:v.ignoreDepthValues===!1,resolveStencilBuffer:v.ignoreDepthValues===!1})}else{const pe={antialias:P.antialias,alpha:!0,depth:P.depth,stencil:P.stencil,framebufferScaleFactor:a};x=new XRWebGLLayer(r,t,pe),r.updateRenderState({baseLayer:x}),e.setPixelRatio(1),e.setSize(x.framebufferWidth,x.framebufferHeight,!1),T=new Vi(x.framebufferWidth,x.framebufferHeight,{format:Ti,type:di,colorSpace:e.outputColorSpace,stencilBuffer:P.stencil,resolveDepthBuffer:x.ignoreDepthValues===!1,resolveStencilBuffer:x.ignoreDepthValues===!1})}T.isXRRenderTarget=!0,this.setFoveation(h),d=null,u=await r.requestReferenceSpace(c),Be.setContext(r),Be.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return y.getDepthTexture()};function K(ae){for(let ve=0;ve<ae.removed.length;ve++){const pe=ae.removed[ve],Fe=R.indexOf(pe);Fe>=0&&(R[Fe]=null,N[Fe].disconnect(pe))}for(let ve=0;ve<ae.added.length;ve++){const pe=ae.added[ve];let Fe=R.indexOf(pe);if(Fe===-1){for(let Je=0;Je<N.length;Je++)if(Je>=R.length){R.push(pe),Fe=Je;break}else if(R[Je]===null){R[Je]=pe,Fe=Je;break}if(Fe===-1)break}const Qe=N[Fe];Qe&&Qe.connect(pe)}}const $=new se,le=new se;function ue(ae,ve,pe){$.setFromMatrixPosition(ve.matrixWorld),le.setFromMatrixPosition(pe.matrixWorld);const Fe=$.distanceTo(le),Qe=ve.projectionMatrix.elements,Je=pe.projectionMatrix.elements,Ft=Qe[14]/(Qe[10]-1),ht=Qe[14]/(Qe[10]+1),Mt=(Qe[9]+1)/Qe[5],_t=(Qe[9]-1)/Qe[5],ft=(Qe[8]-1)/Qe[0],kt=(Je[8]+1)/Je[0],Ht=Ft*ft,Gt=Ft*kt,Bt=Fe/(-ft+kt),tt=Bt*-ft;if(ve.matrixWorld.decompose(ae.position,ae.quaternion,ae.scale),ae.translateX(tt),ae.translateZ(Bt),ae.matrixWorld.compose(ae.position,ae.quaternion,ae.scale),ae.matrixWorldInverse.copy(ae.matrixWorld).invert(),Qe[10]===-1)ae.projectionMatrix.copy(ve.projectionMatrix),ae.projectionMatrixInverse.copy(ve.projectionMatrixInverse);else{const mt=Ft+Bt,H=ht+Bt,gn=Ht-tt,Ct=Gt+(Fe-tt),I=Mt*ht/H*mt,E=_t*ht/H*mt;ae.projectionMatrix.makePerspective(gn,Ct,I,E,mt,H),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert()}}function k(ae,ve){ve===null?ae.matrixWorld.copy(ae.matrix):ae.matrixWorld.multiplyMatrices(ve.matrixWorld,ae.matrix),ae.matrixWorldInverse.copy(ae.matrixWorld).invert()}this.updateCamera=function(ae){if(r===null)return;let ve=ae.near,pe=ae.far;y.texture!==null&&(y.depthNear>0&&(ve=y.depthNear),y.depthFar>0&&(pe=y.depthFar)),G.near=z.near=L.near=ve,G.far=z.far=L.far=pe,(J!==G.near||oe!==G.far)&&(r.updateRenderState({depthNear:G.near,depthFar:G.far}),J=G.near,oe=G.far),G.layers.mask=ae.layers.mask|6,L.layers.mask=G.layers.mask&-5,z.layers.mask=G.layers.mask&-3;const Fe=ae.parent,Qe=G.cameras;k(G,Fe);for(let Je=0;Je<Qe.length;Je++)k(Qe[Je],Fe);Qe.length===2?ue(G,L,z):G.projectionMatrix.copy(L.projectionMatrix),Q(ae,G,Fe)};function Q(ae,ve,pe){pe===null?ae.matrix.copy(ve.matrixWorld):(ae.matrix.copy(pe.matrixWorld),ae.matrix.invert(),ae.matrix.multiply(ve.matrixWorld)),ae.matrix.decompose(ae.position,ae.quaternion,ae.scale),ae.updateMatrixWorld(!0),ae.projectionMatrix.copy(ve.projectionMatrix),ae.projectionMatrixInverse.copy(ve.projectionMatrixInverse),ae.isPerspectiveCamera&&(ae.fov=Pd*2*Math.atan(1/ae.projectionMatrix.elements[5]),ae.zoom=1)}this.getCamera=function(){return G},this.getFoveation=function(){if(!(v===null&&x===null))return h},this.setFoveation=function(ae){h=ae,v!==null&&(v.fixedFoveation=ae),x!==null&&x.fixedFoveation!==void 0&&(x.fixedFoveation=ae)},this.hasDepthSensing=function(){return y.texture!==null},this.getDepthSensingMesh=function(){return y.getMesh(G)},this.getCameraTexture=function(ae){return S[ae]};let De=null;function He(ae,ve){if(p=ve.getViewerPose(d||u),M=ve,p!==null){const pe=p.views;x!==null&&(e.setRenderTargetFramebuffer(T,x.framebuffer),e.setRenderTarget(T));let Fe=!1;pe.length!==G.cameras.length&&(G.cameras.length=0,Fe=!0);for(let ht=0;ht<pe.length;ht++){const Mt=pe[ht];let _t=null;if(x!==null)_t=x.getViewport(Mt);else{const kt=m.getViewSubImage(v,Mt);_t=kt.viewport,ht===0&&(e.setRenderTargetTextures(T,kt.colorTexture,kt.depthStencilTexture),e.setRenderTarget(T))}let ft=B[ht];ft===void 0&&(ft=new fi,ft.layers.enable(ht),ft.viewport=new Jt,B[ht]=ft),ft.matrix.fromArray(Mt.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(Mt.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(_t.x,_t.y,_t.width,_t.height),ht===0&&(G.matrix.copy(ft.matrix),G.matrix.decompose(G.position,G.quaternion,G.scale)),Fe===!0&&G.cameras.push(ft)}const Qe=r.enabledFeatures;if(Qe&&Qe.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&b){m=n.getBinding();const ht=m.getDepthInformation(pe[0]);ht&&ht.isValid&&ht.texture&&y.init(ht,r.renderState)}if(Qe&&Qe.includes("camera-access")&&b){e.state.unbindTexture(),m=n.getBinding();for(let ht=0;ht<pe.length;ht++){const Mt=pe[ht].camera;if(Mt){let _t=S[Mt];_t||(_t=new N_,S[Mt]=_t);const ft=m.getCameraImage(Mt);_t.sourceTexture=ft}}}}for(let pe=0;pe<N.length;pe++){const Fe=R[pe],Qe=N[pe];Fe!==null&&Qe!==void 0&&Qe.update(Fe,ve,d||u)}De&&De(ae,ve),ve.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ve}),M=null}const Be=new U_;Be.setAnimationLoop(He),this.setAnimationLoop=function(ae){De=ae},this.dispose=function(){}}}const PT=new on,H_=new ct;H_.set(-1,0,0,0,1,0,0,0,1);function NT(s,e){function t(y,S){y.matrixAutoUpdate===!0&&y.updateMatrix(),S.value.copy(y.matrix)}function n(y,S){S.color.getRGB(y.fogColor.value,L_(s)),S.isFog?(y.fogNear.value=S.near,y.fogFar.value=S.far):S.isFogExp2&&(y.fogDensity.value=S.density)}function r(y,S,P,U,T){S.isNodeMaterial?S.uniformsNeedUpdate=!1:S.isMeshBasicMaterial?a(y,S):S.isMeshLambertMaterial?(a(y,S),S.envMap&&(y.envMapIntensity.value=S.envMapIntensity)):S.isMeshToonMaterial?(a(y,S),m(y,S)):S.isMeshPhongMaterial?(a(y,S),p(y,S),S.envMap&&(y.envMapIntensity.value=S.envMapIntensity)):S.isMeshStandardMaterial?(a(y,S),v(y,S),S.isMeshPhysicalMaterial&&x(y,S,T)):S.isMeshMatcapMaterial?(a(y,S),M(y,S)):S.isMeshDepthMaterial?a(y,S):S.isMeshDistanceMaterial?(a(y,S),b(y,S)):S.isMeshNormalMaterial?a(y,S):S.isLineBasicMaterial?(u(y,S),S.isLineDashedMaterial&&c(y,S)):S.isPointsMaterial?h(y,S,P,U):S.isSpriteMaterial?d(y,S):S.isShadowMaterial?(y.color.value.copy(S.color),y.opacity.value=S.opacity):S.isShaderMaterial&&(S.uniformsNeedUpdate=!1)}function a(y,S){y.opacity.value=S.opacity,S.color&&y.diffuse.value.copy(S.color),S.emissive&&y.emissive.value.copy(S.emissive).multiplyScalar(S.emissiveIntensity),S.map&&(y.map.value=S.map,t(S.map,y.mapTransform)),S.alphaMap&&(y.alphaMap.value=S.alphaMap,t(S.alphaMap,y.alphaMapTransform)),S.bumpMap&&(y.bumpMap.value=S.bumpMap,t(S.bumpMap,y.bumpMapTransform),y.bumpScale.value=S.bumpScale,S.side===qn&&(y.bumpScale.value*=-1)),S.normalMap&&(y.normalMap.value=S.normalMap,t(S.normalMap,y.normalMapTransform),y.normalScale.value.copy(S.normalScale),S.side===qn&&y.normalScale.value.negate()),S.displacementMap&&(y.displacementMap.value=S.displacementMap,t(S.displacementMap,y.displacementMapTransform),y.displacementScale.value=S.displacementScale,y.displacementBias.value=S.displacementBias),S.emissiveMap&&(y.emissiveMap.value=S.emissiveMap,t(S.emissiveMap,y.emissiveMapTransform)),S.specularMap&&(y.specularMap.value=S.specularMap,t(S.specularMap,y.specularMapTransform)),S.alphaTest>0&&(y.alphaTest.value=S.alphaTest);const P=e.get(S),U=P.envMap,T=P.envMapRotation;U&&(y.envMap.value=U,y.envMapRotation.value.setFromMatrix4(PT.makeRotationFromEuler(T)).transpose(),U.isCubeTexture&&U.isRenderTargetTexture===!1&&y.envMapRotation.value.premultiply(H_),y.reflectivity.value=S.reflectivity,y.ior.value=S.ior,y.refractionRatio.value=S.refractionRatio),S.lightMap&&(y.lightMap.value=S.lightMap,y.lightMapIntensity.value=S.lightMapIntensity,t(S.lightMap,y.lightMapTransform)),S.aoMap&&(y.aoMap.value=S.aoMap,y.aoMapIntensity.value=S.aoMapIntensity,t(S.aoMap,y.aoMapTransform))}function u(y,S){y.diffuse.value.copy(S.color),y.opacity.value=S.opacity,S.map&&(y.map.value=S.map,t(S.map,y.mapTransform))}function c(y,S){y.dashSize.value=S.dashSize,y.totalSize.value=S.dashSize+S.gapSize,y.scale.value=S.scale}function h(y,S,P,U){y.diffuse.value.copy(S.color),y.opacity.value=S.opacity,y.size.value=S.size*P,y.scale.value=U*.5,S.map&&(y.map.value=S.map,t(S.map,y.uvTransform)),S.alphaMap&&(y.alphaMap.value=S.alphaMap,t(S.alphaMap,y.alphaMapTransform)),S.alphaTest>0&&(y.alphaTest.value=S.alphaTest)}function d(y,S){y.diffuse.value.copy(S.color),y.opacity.value=S.opacity,y.rotation.value=S.rotation,S.map&&(y.map.value=S.map,t(S.map,y.mapTransform)),S.alphaMap&&(y.alphaMap.value=S.alphaMap,t(S.alphaMap,y.alphaMapTransform)),S.alphaTest>0&&(y.alphaTest.value=S.alphaTest)}function p(y,S){y.specular.value.copy(S.specular),y.shininess.value=Math.max(S.shininess,1e-4)}function m(y,S){S.gradientMap&&(y.gradientMap.value=S.gradientMap)}function v(y,S){y.metalness.value=S.metalness,S.metalnessMap&&(y.metalnessMap.value=S.metalnessMap,t(S.metalnessMap,y.metalnessMapTransform)),y.roughness.value=S.roughness,S.roughnessMap&&(y.roughnessMap.value=S.roughnessMap,t(S.roughnessMap,y.roughnessMapTransform)),S.envMap&&(y.envMapIntensity.value=S.envMapIntensity)}function x(y,S,P){y.ior.value=S.ior,S.sheen>0&&(y.sheenColor.value.copy(S.sheenColor).multiplyScalar(S.sheen),y.sheenRoughness.value=S.sheenRoughness,S.sheenColorMap&&(y.sheenColorMap.value=S.sheenColorMap,t(S.sheenColorMap,y.sheenColorMapTransform)),S.sheenRoughnessMap&&(y.sheenRoughnessMap.value=S.sheenRoughnessMap,t(S.sheenRoughnessMap,y.sheenRoughnessMapTransform))),S.clearcoat>0&&(y.clearcoat.value=S.clearcoat,y.clearcoatRoughness.value=S.clearcoatRoughness,S.clearcoatMap&&(y.clearcoatMap.value=S.clearcoatMap,t(S.clearcoatMap,y.clearcoatMapTransform)),S.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=S.clearcoatRoughnessMap,t(S.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),S.clearcoatNormalMap&&(y.clearcoatNormalMap.value=S.clearcoatNormalMap,t(S.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(S.clearcoatNormalScale),S.side===qn&&y.clearcoatNormalScale.value.negate())),S.dispersion>0&&(y.dispersion.value=S.dispersion),S.iridescence>0&&(y.iridescence.value=S.iridescence,y.iridescenceIOR.value=S.iridescenceIOR,y.iridescenceThicknessMinimum.value=S.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=S.iridescenceThicknessRange[1],S.iridescenceMap&&(y.iridescenceMap.value=S.iridescenceMap,t(S.iridescenceMap,y.iridescenceMapTransform)),S.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=S.iridescenceThicknessMap,t(S.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),S.transmission>0&&(y.transmission.value=S.transmission,y.transmissionSamplerMap.value=P.texture,y.transmissionSamplerSize.value.set(P.width,P.height),S.transmissionMap&&(y.transmissionMap.value=S.transmissionMap,t(S.transmissionMap,y.transmissionMapTransform)),y.thickness.value=S.thickness,S.thicknessMap&&(y.thicknessMap.value=S.thicknessMap,t(S.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=S.attenuationDistance,y.attenuationColor.value.copy(S.attenuationColor)),S.anisotropy>0&&(y.anisotropyVector.value.set(S.anisotropy*Math.cos(S.anisotropyRotation),S.anisotropy*Math.sin(S.anisotropyRotation)),S.anisotropyMap&&(y.anisotropyMap.value=S.anisotropyMap,t(S.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=S.specularIntensity,y.specularColor.value.copy(S.specularColor),S.specularColorMap&&(y.specularColorMap.value=S.specularColorMap,t(S.specularColorMap,y.specularColorMapTransform)),S.specularIntensityMap&&(y.specularIntensityMap.value=S.specularIntensityMap,t(S.specularIntensityMap,y.specularIntensityMapTransform))}function M(y,S){S.matcap&&(y.matcap.value=S.matcap)}function b(y,S){const P=e.get(S).light;y.referencePosition.value.setFromMatrixPosition(P.matrixWorld),y.nearDistance.value=P.shadow.camera.near,y.farDistance.value=P.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function LT(s,e,t,n){let r={},a={},u=[];const c=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function h(T,N){const R=N.program;n.uniformBlockBinding(T,R)}function d(T,N){let R=r[T.id];R===void 0&&(y(T),R=p(T),r[T.id]=R,T.addEventListener("dispose",P));const F=N.program;n.updateUBOMapping(T,F);const w=e.render.frame;a[T.id]!==w&&(v(T),a[T.id]=w)}function p(T){const N=m();T.__bindingPointIndex=N;const R=s.createBuffer(),F=T.__size,w=T.usage;return s.bindBuffer(s.UNIFORM_BUFFER,R),s.bufferData(s.UNIFORM_BUFFER,F,w),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,N,R),R}function m(){for(let T=0;T<c;T++)if(u.indexOf(T)===-1)return u.push(T),T;return wt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}
4156function v(T){const N=r[T.id],R=T.uniforms,F=T.__cache;s.bindBuffer(s.UNIFORM_BUFFER,N);for(let w=0,L=R.length;w<L;w++){const z=R[w];if(Array.isArray(z))for(let B=0,G=z.length;B<G;B++)x(z[B],w,B,F);else x(z,w,0,F)}s.bindBuffer(s.UNIFORM_BUFFER,null)}function x(T,N,R,F){if(b(T,N,R,F)===!0){const w=T.__offset,L=T.value;if(Array.isArray(L)){let z=0;for(let B=0;B<L.length;B++){const G=L[B],J=S(G);M(G,T.__data,z),typeof G!="number"&&typeof G!="boolean"&&!G.isMatrix3&&!ArrayBuffer.isView(G)&&(z+=J.storage/Float32Array.BYTES_PER_ELEMENT)}}else M(L,T.__data,0);s.bufferSubData(s.UNIFORM_BUFFER,w,T.__data)}}function M(T,N,R){typeof T=="number"||typeof T=="boolean"?N[0]=T:T.isMatrix3?(N[0]=T.elements[0],N[1]=T.elements[1],N[2]=T.elements[2],N[3]=0,N[4]=T.elements[3],N[5]=T.elements[4],N[6]=T.elements[5],N[7]=0,N[8]=T.elements[6],N[9]=T.elements[7],N[10]=T.elements[8],N[11]=0):ArrayBuffer.isView(T)?N.set(new T.constructor(T.buffer,T.byteOffset,N.length)):T.toArray(N,R)}function b(T,N,R,F){const w=T.value,L=N+"_"+R;if(F[L]===void 0)return typeof w=="number"||typeof w=="boolean"?F[L]=w:ArrayBuffer.isView(w)?F[L]=w.slice():F[L]=w.clone(),!0;{const z=F[L];if(typeof w=="number"||typeof w=="boolean"){if(z!==w)return F[L]=w,!0}else{if(ArrayBuffer.isView(w))return!0;if(z.equals(w)===!1)return z.copy(w),!0}}return!1}function y(T){const N=T.uniforms;let R=0;const F=16;for(let L=0,z=N.length;L<z;L++){const B=Array.isArray(N[L])?N[L]:[N[L]];for(let G=0,J=B.length;G<J;G++){const oe=B[G],Y=Array.isArray(oe.value)?oe.value:[oe.value];for(let ie=0,K=Y.length;ie<K;ie++){const $=Y[ie],le=S($),ue=R%F,k=ue%le.boundary,Q=ue+k;R+=k,Q!==0&&F-Q<le.storage&&(R+=F-Q),oe.__data=new Float32Array(le.storage/Float32Array.BYTES_PER_ELEMENT),oe.__offset=R,R+=le.storage}}}const w=R%F;return w>0&&(R+=F-w),T.__size=R,T.__cache={},this}function S(T){const N={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(N.boundary=4,N.storage=4):T.isVector2?(N.boundary=8,N.storage=8):T.isVector3||T.isColor?(N.boundary=16,N.storage=12):T.isVector4?(N.boundary=16,N.storage=16):T.isMatrix3?(N.boundary=48,N.storage=48):T.isMatrix4?(N.boundary=64,N.storage=64):T.isTexture?at("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(T)?(N.boundary=16,N.storage=T.byteLength):at("WebGLRenderer: Unsupported uniform value type.",T),N}function P(T){const N=T.target;N.removeEventListener("dispose",P);const R=u.indexOf(N.__bindingPointIndex);u.splice(R,1),s.deleteBuffer(r[N.id]),delete r[N.id],delete a[N.id]}function U(){for(const T in r)s.deleteBuffer(r[T]);u=[],r={},a={}}return{bind:h,update:d,dispose:U}}const DT=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,
vendor: 4,258 bytes, line 4156
415614942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Fi=null;function IT(){return Fi===null&&(Fi=new MM(DT,16,16,Mr,fs),Fi.name="DFG_LUT",Fi.minFilter=mn,Fi.magFilter=mn,Fi.wrapS=rs,Fi.wrapT=rs,Fi.generateMipmaps=!1,Fi.needsUpdate=!0),Fi}class UT{constructor(e={}){const{canvas:t=Zy(),context:n=null,depth:r=!0,stencil:a=!1,alpha:u=!1,antialias:c=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:d=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:m=!1,reversedDepthBuffer:v=!1,outputBufferType:x=di}=e;this.isWebGLRenderer=!0;let M;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");M=n.getContextAttributes().alpha}else M=u;const b=x,y=new Set([Zd,Qd,jd]),S=new Set([di,Gi,Ua,Fa,Yd,Kd]),P=new Uint32Array(4),U=new Int32Array(4),T=new se;let N=null,R=null;const F=[],w=[];let L=null;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.toneMapping=Ci,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const z=this;let B=!1,G=null,J=null,oe=null,Y=null;this._outputColorSpace=Un;let ie=0,K=0,$=null,le=-1,ue=null;const k=new Jt,Q=new Jt;let De=null;const He=new Rt(0);let Be=0,ae=t.width,ve=t.height,pe=1,Fe=null,Qe=null;const Je=new Jt(0,0,ae,ve),Ft=new Jt(0,0,ae,ve);let ht=!1;const Mt=new R_;let _t=!1,ft=!1;const kt=new on,Ht=new se,Gt=new Jt,Bt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let tt=!1;function mt(){return $===null?pe:1}let H=n;function gn(A,q){return t.getContext(A,q)}try{const A={alpha:!0,depth:r,stencil:a,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:d,powerPreference:p,failIfMajorPerformanceCaveat:m};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${$d}`),t.addEventListener("webglcontextlost",Ut,!1),t.addEventListener("webglcontextrestored",Pt,!1),t.addEventListener("webglcontextcreationerror",En,!1),H===null){const q="webgl2";if(H=gn(q,A),H===null)throw gn(q)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(A){throw wt("WebGLRenderer: "+A.message),A}let Ct,I,E,j,re,fe,Me,Re,de,ge,Ne,Ye,Le,Ae,et,nt,rt,W,Ce,me,Pe,Ie,_e;
vendor: 5,298 bytes, line 4156
4156function Xe(){Ct=new I1(H),Ct.init(),Pe=new bT(H,Ct),I=new T1(H,Ct,e,Pe),E=new ET(H,Ct),I.reversedDepthBuffer&&v&&E.buffers.depth.setReversed(!0),J=H.createFramebuffer(),oe=H.createFramebuffer(),Y=H.createFramebuffer(),j=new O1(H),re=new uT,fe=new wT(H,Ct,E,re,I,Pe,j),Me=new D1(z),Re=new VM(H),Ie=new w1(H,Re),de=new U1(H,Re,j,Ie),ge=new B1(H,de,Re,Ie,j),W=new k1(H,I,fe),et=new C1(re),Ne=new lT(z,Me,Ct,I,Ie,et),Ye=new NT(z,re),Le=new hT,Ae=new vT(Ct),rt=new E1(z,Me,E,ge,M,h),nt=new MT(z,ge,I),_e=new LT(H,j,I,E),Ce=new b1(H,Ct,j),me=new F1(H,Ct,j),j.programs=Ne.programs,z.capabilities=I,z.extensions=Ct,z.properties=re,z.renderLists=Le,z.shadowMap=nt,z.state=E,z.info=j}Xe(),b!==di&&(L=new V1(b,t.width,t.height,c,r,a));const Ge=new RT(z,H);this.xr=Ge,this.getContext=function(){return H},this.getContextAttributes=function(){return H.getContextAttributes()},this.forceContextLoss=function(){const A=Ct.get("WEBGL_lose_context");A&&A.loseContext()},this.forceContextRestore=function(){const A=Ct.get("WEBGL_lose_context");A&&A.restoreContext()},this.getPixelRatio=function(){return pe},this.setPixelRatio=function(A){A!==void 0&&(pe=A,this.setSize(ae,ve,!1))},this.getSize=function(A){return A.set(ae,ve)},this.setSize=function(A,q,ce=!0){if(Ge.isPresenting){at("WebGLRenderer: Can't change size while VR device is presenting.");return}ae=A,ve=q,t.width=Math.floor(A*pe),t.height=Math.floor(q*pe),ce===!0&&(t.style.width=A+"px",t.style.height=q+"px"),L!==null&&L.setSize(t.width,t.height),this.setViewport(0,0,A,q)},this.getDrawingBufferSize=function(A){return A.set(ae*pe,ve*pe).floor()},this.setDrawingBufferSize=function(A,q,ce){ae=A,ve=q,pe=ce,t.width=Math.floor(A*ce),t.height=Math.floor(q*ce),this.setViewport(0,0,A,q)},this.setEffects=function(A){if(b===di){wt("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(A){for(let q=0;q<A.length;q++)if(A[q].isOutputPass===!0){at("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}L.setEffects(A||[])},this.getCurrentViewport=function(A){return A.copy(k)},this.getViewport=function(A){return A.copy(Je)},this.setViewport=function(A,q,ce,te){A.isVector4?Je.set(A.x,A.y,A.z,A.w):Je.set(A,q,ce,te),E.viewport(k.copy(Je).multiplyScalar(pe).round())},this.getScissor=function(A){return A.copy(Ft)},this.setScissor=function(A,q,ce,te){A.isVector4?Ft.set(A.x,A.y,A.z,A.w):Ft.set(A,q,ce,te),E.scissor(Q.copy(Ft).multiplyScalar(pe).round())},this.getScissorTest=function(){return ht},this.setScissorTest=function(A){E.setScissorTest(ht=A)},this.setOpaqueSort=function(A){Fe=A},this.setTransparentSort=function(A){Qe=A},this.getClearColor=function(A){return A.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor(...arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha(...arguments)},this.clear=function(A=!0,q=!0,ce=!0){let te=0;if(A){let ee=!1;if($!==null){const Te=$.texture.format;ee=y.has(Te)}if(ee){const Te=$.texture.type,ze=S.has(Te),be=rt.getClearColor(),$e=rt.getClearAlpha(),Ze=be.r,lt=be.g,ut=be.b;ze?(P[0]=Ze,P[1]=lt,P[2]=ut,P[3]=$e,H.clearBufferuiv(H.COLOR,0,P)):(U[0]=Ze,U[1]=lt,U[2]=ut,U[3]=$e,H.clearBufferiv(H.COLOR,0,U))}else te|=H.COLOR_BUFFER_BIT}q&&(te|=H.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),ce&&(te|=H.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),te!==0&&H.clear(te)},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.setNodesHandler=function(A){A.setRenderer(this),G=A},this.dispose=function(){t.removeEventListener("webglcontextlost",Ut,!1),t.removeEventListener("webglcontextrestored",Pt,!1),t.removeEventListener("webglcontextcreationerror",En,!1),rt.dispose(),Le.dispose(),Ae.dispose(),re.dispose(),Me.dispose(),ge.dispose(),Ie.dispose(),_e.dispose(),Ne.dispose(),Ge.dispose(),Ge.removeEventListener("sessionstart",Wa),Ge.removeEventListener("sessionend",Xa),Nn.stop()};function Ut(A){A.preventDefault(),nv("WebGLRenderer: Context Lost."),B=!0}function Pt(){nv("WebGLRenderer: Context Restored."),B=!1;const A=j.autoReset,q=nt.enabled,ce=nt.autoUpdate,te=nt.needsUpdate,ee=nt.type;Xe(),j.autoReset=A,nt.enabled=q,nt.autoUpdate=ce,nt.needsUpdate=te,nt.type=ee}function En(A){wt("WebGLRenderer: A WebGL context could not be created. Reason: ",A.statusMessage)}function si(A){const q=A.target;q.removeEventListener("dispose",si),$s(q)}function $s(A){Pr(A),re.remove(A)}function Pr(A){const q=re.get(A).programs;q!==void 0&&(q.forEach(function(ce){Ne.releaseProgram(ce)}),A.isShaderMaterial&&Ne.releaseShaderCache(A))}this.renderBufferDirect=function(A,q,ce,te,ee,Te){q===null&&(q=Bt);const ze=ee.isMesh&&ee.matrixWorld.determinantAffine()<0,be=Kt(A,q,ce,te,ee);E.setMaterial(te,ze);let $e=ce.index,Ze=1;if(te.wireframe===!0){if($e=de.getWireframeAttribute(ce),$e===void 0)return;Ze=2}const lt=ce.drawRange,ut=ce.attributes.position;let Ke=lt.start*Ze,yt=(lt.start+lt.count)*Ze;Te!==null&&(Ke=Math.max(Ke,Te.start*Ze),yt=Math.min(yt,(Te.start+Te.count)*Ze)),$e!==null?(Ke=Math.max(Ke,0),yt=Math.min(yt,$e.count)):ut!=null&&(Ke=Math.max(Ke,0),yt=Math.min(yt,ut.count));
vendor: 10,600 bytes, line 4156
4156const zt=yt-Ke;if(zt<0||zt===1/0)return;Ie.setup(ee,te,be,ce,$e);let qt,Lt=Ce;if($e!==null&&(qt=Re.get($e),Lt=me,Lt.setIndex(qt)),ee.isMesh)te.wireframe===!0?(E.setLineWidth(te.wireframeLinewidth*mt()),Lt.setMode(H.LINES)):Lt.setMode(H.TRIANGLES);else if(ee.isLine){let nn=te.linewidth;nn===void 0&&(nn=1),E.setLineWidth(nn*mt()),ee.isLineSegments?Lt.setMode(H.LINES):ee.isLineLoop?Lt.setMode(H.LINE_LOOP):Lt.setMode(H.LINE_STRIP)}else ee.isPoints?Lt.setMode(H.POINTS):ee.isSprite&&Lt.setMode(H.TRIANGLES);if(ee.isBatchedMesh)if(Ct.get("WEBGL_multi_draw"))Lt.renderMultiDraw(ee._multiDrawStarts,ee._multiDrawCounts,ee._multiDrawCount);else{const nn=ee._multiDrawStarts,Oe=ee._multiDrawCounts,vn=ee._multiDrawCount,pt=$e?Re.get($e).bytesPerElement:1,kn=re.get(te).currentProgram.getUniforms();for(let Bn=0;Bn<vn;Bn++)kn.setValue(H,"_gl_DrawID",Bn),Lt.render(nn[Bn]/pt,Oe[Bn])}else if(ee.isInstancedMesh)Lt.renderInstances(Ke,zt,ee.count);else if(ce.isInstancedBufferGeometry){const nn=ce._maxInstanceCount!==void 0?ce._maxInstanceCount:1/0,Oe=Math.min(ce.instanceCount,nn);Lt.renderInstances(Ke,zt,Oe)}else Lt.render(Ke,zt)};function qs(A,q,ce){A.transparent===!0&&A.side===ss&&A.forceSinglePass===!1?(A.side=qn,A.needsUpdate=!0,js(A,q,ce),A.side=Ws,A.needsUpdate=!0,js(A,q,ce),A.side=ss):js(A,q,ce)}this.compile=function(A,q,ce=null){ce===null&&(ce=A),R=Ae.get(ce),R.init(q),w.push(R),ce.traverseVisible(function(ee){ee.isLight&&ee.layers.test(q.layers)&&(R.pushLight(ee),ee.castShadow&&R.pushShadow(ee))}),A!==ce&&A.traverseVisible(function(ee){ee.isLight&&ee.layers.test(q.layers)&&(R.pushLight(ee),ee.castShadow&&R.pushShadow(ee))}),R.setupLights();const te=new Set;return A.traverse(function(ee){if(!(ee.isMesh||ee.isPoints||ee.isLine||ee.isSprite))return;const Te=ee.material;if(Te)if(Array.isArray(Te))for(let ze=0;ze<Te.length;ze++){const be=Te[ze];qs(be,ce,ee),te.add(be)}else qs(Te,ce,ee),te.add(Te)}),R=w.pop(),te},this.compileAsync=function(A,q,ce=null){const te=this.compile(A,q,ce);return new Promise(ee=>{function Te(){if(te.forEach(function(ze){re.get(ze).currentProgram.isReady()&&te.delete(ze)}),te.size===0){ee(A);return}setTimeout(Te,10)}Ct.get("KHR_parallel_shader_compile")!==null?Te():setTimeout(Te,10)})};let Ys=null;function oc(A){Ys&&Ys(A)}function Wa(){Nn.stop()}function Xa(){Nn.start()}const Nn=new U_;Nn.setAnimationLoop(oc),typeof self<"u"&&Nn.setContext(self),this.setAnimationLoop=function(A){Ys=A,Ge.setAnimationLoop(A),A===null?Nn.stop():Nn.start()},Ge.addEventListener("sessionstart",Wa),Ge.addEventListener("sessionend",Xa),this.render=function(A,q){if(q!==void 0&&q.isCamera!==!0){wt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(B===!0)return;G!==null&&G.renderStart(A,q);const ce=Ge.enabled===!0&&Ge.isPresenting===!0,te=L!==null&&($===null||ce)&&L.begin(z,$);if(A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),q.parent===null&&q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),Ge.enabled===!0&&Ge.isPresenting===!0&&(L===null||L.isCompositing()===!1)&&(Ge.cameraAutoUpdate===!0&&Ge.updateCamera(q),q=Ge.getCamera()),A.isScene===!0&&A.onBeforeRender(z,A,q,$),R=Ae.get(A,w.length),R.init(q),R.state.textureUnits=fe.getTextureUnits(),w.push(R),kt.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Mt.setFromProjectionMatrix(kt,zi,q.reversedDepth),ft=this.localClippingEnabled,_t=et.init(this.clippingPlanes,ft),N=Le.get(A,F.length),N.init(),F.push(N),Ge.enabled===!0&&Ge.isPresenting===!0){const ze=z.xr.getDepthSensingMesh();ze!==null&&Nr(ze,q,-1/0,z.sortObjects)}Nr(A,q,0,z.sortObjects),N.finish(),z.sortObjects===!0&&N.sort(Fe,Qe,q.reversedDepth),tt=Ge.enabled===!1||Ge.isPresenting===!1||Ge.hasDepthSensing()===!1,tt&&rt.addToRenderList(N,A),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),_t===!0&&et.beginShadows();const ee=R.state.shadowsArray;if(nt.render(ee,A,q),_t===!0&&et.endShadows(),(te&&L.hasRenderPass())===!1){const ze=N.opaque,be=N.transmissive;if(R.setupLights(),q.isArrayCamera){const $e=q.cameras;if(be.length>0)for(let Ze=0,lt=$e.length;Ze<lt;Ze++){const ut=$e[Ze];$a(ze,be,A,ut)}tt&&rt.render(A);for(let Ze=0,lt=$e.length;Ze<lt;Ze++){const ut=$e[Ze];Oo(N,A,ut,ut.viewport)}}else be.length>0&&$a(ze,be,A,q),tt&&rt.render(A),Oo(N,A,q)}$!==null&&K===0&&(fe.updateMultisampleRenderTarget($),fe.updateRenderTargetMipmap($)),te&&L.end(z),A.isScene===!0&&A.onAfterRender(z,A,q),Ie.resetDefaultState(),le=-1,ue=null,w.pop(),w.length>0?(R=w[w.length-1],fe.setTextureUnits(R.state.textureUnits),_t===!0&&et.setGlobalState(z.clippingPlanes,R.state.camera)):R=null,F.pop(),F.length>0?N=F[F.length-1]:N=null,G!==null&&G.renderEnd()};function Nr(A,q,ce,te){if(A.visible===!1)return;if(A.layers.test(q.layers)){if(A.isGroup)ce=A.renderOrder;else if(A.isLOD)A.autoUpdate===!0&&A.update(q);else if(A.isLightProbeGrid)R.pushLightProbeGrid(A);else if(A.isLight)R.pushLight(A),A.castShadow&&R.pushShadow(A);else if(A.isSprite){if(!A.frustumCulled||Mt.intersectsSprite(A)){te&&Gt.setFromMatrixPosition(A.matrixWorld).applyMatrix4(kt);const ze=ge.update(A),be=A.material;be.visible&&N.push(A,ze,be,ce,Gt.z,null)}}else if((A.isMesh||A.isLine||A.isPoints)&&(!A.frustumCulled||Mt.intersectsObject(A))){const ze=ge.update(A),be=A.material;if(te&&(A.boundingSphere!==void 0?(A.boundingSphere===null&&A.computeBoundingSphere(),Gt.copy(A.boundingSphere.center)):(ze.boundingSphere===null&&ze.computeBoundingSphere(),Gt.copy(ze.boundingSphere.center)),Gt.applyMatrix4(A.matrixWorld).applyMatrix4(kt)),Array.isArray(be)){const $e=ze.groups;for(let Ze=0,lt=$e.length;Ze<lt;Ze++){const ut=$e[Ze],Ke=be[ut.materialIndex];Ke&&Ke.visible&&N.push(A,ze,Ke,ce,Gt.z,ut)}}else be.visible&&N.push(A,ze,be,ce,Gt.z,null)}}const Te=A.children;for(let ze=0,be=Te.length;ze<be;ze++)Nr(Te[ze],q,ce,te)}function Oo(A,q,ce,te){const{opaque:ee,transmissive:Te,transparent:ze}=A;R.setupLightsView(ce),_t===!0&&et.setGlobalState(z.clippingPlanes,ce),te&&E.viewport(k.copy(te)),ee.length>0&&Ks(ee,q,ce),Te.length>0&&Ks(Te,q,ce),ze.length>0&&Ks(ze,q,ce),E.buffers.depth.setTest(!0),E.buffers.depth.setMask(!0),E.buffers.color.setMask(!0),E.setPolygonOffset(!1)}function $a(A,q,ce,te){if((ce.isScene===!0?ce.overrideMaterial:null)!==null)return;if(R.state.transmissionRenderTarget[te.id]===void 0){const Ke=Ct.has("EXT_color_buffer_half_float")||Ct.has("EXT_color_buffer_float");R.state.transmissionRenderTarget[te.id]=new Vi(1,1,{generateMipmaps:!0,type:Ke?fs:di,minFilter:os,samples:Math.max(4,I.samples),stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:xt.workingColorSpace})}const Te=R.state.transmissionRenderTarget[te.id],ze=te.viewport||k;Te.setSize(ze.z*z.transmissionResolutionScale,ze.w*z.transmissionResolutionScale);const be=z.getRenderTarget(),$e=z.getActiveCubeFace(),Ze=z.getActiveMipmapLevel();z.setRenderTarget(Te),z.getClearColor(He),Be=z.getClearAlpha(),Be<1&&z.setClearColor(16777215,.5),z.clear(),tt&&rt.render(ce);const lt=z.toneMapping;z.toneMapping=Ci;const ut=te.viewport;if(te.viewport!==void 0&&(te.viewport=void 0),R.setupLightsView(te),_t===!0&&et.setGlobalState(z.clippingPlanes,te),Ks(A,ce,te),fe.updateMultisampleRenderTarget(Te),fe.updateRenderTargetMipmap(Te),Ct.has("WEBGL_multisampled_render_to_texture")===!1){let Ke=!1;for(let yt=0,zt=q.length;yt<zt;yt++){const qt=q[yt],{object:Lt,geometry:nn,material:Oe,group:vn}=qt;if(Oe.side===ss&&Lt.layers.test(te.layers)){const pt=Oe.side;Oe.side=qn,Oe.needsUpdate=!0,ko(Lt,ce,te,nn,Oe,vn),Oe.side=pt,Oe.needsUpdate=!0,Ke=!0}}Ke===!0&&(fe.updateMultisampleRenderTarget(Te),fe.updateRenderTargetMipmap(Te))}z.setRenderTarget(be,$e,Ze),z.setClearColor(He,Be),ut!==void 0&&(te.viewport=ut),z.toneMapping=lt}function Ks(A,q,ce){const te=q.isScene===!0?q.overrideMaterial:null;for(let ee=0,Te=A.length;ee<Te;ee++){const ze=A[ee],{object:be,geometry:$e,group:Ze}=ze;let lt=ze.material;lt.allowOverride===!0&&te!==null&&(lt=te),be.layers.test(ce.layers)&&ko(be,q,ce,$e,lt,Ze)}}function ko(A,q,ce,te,ee,Te){A.onBeforeRender(z,q,ce,te,ee,Te),A.modelViewMatrix.multiplyMatrices(ce.matrixWorldInverse,A.matrixWorld),A.normalMatrix.getNormalMatrix(A.modelViewMatrix),ee.onBeforeRender(z,q,ce,te,A,Te),ee.transparent===!0&&ee.side===ss&&ee.forceSinglePass===!1?(ee.side=qn,ee.needsUpdate=!0,z.renderBufferDirect(ce,q,te,ee,A,Te),ee.side=Ws,ee.needsUpdate=!0,z.renderBufferDirect(ce,q,te,ee,A,Te),ee.side=ss):z.renderBufferDirect(ce,q,te,ee,A,Te),A.onAfterRender(z,q,ce,te,ee,Te)}function js(A,q,ce){q.isScene!==!0&&(q=Bt);const te=re.get(A),ee=R.state.lights,Te=R.state.shadowsArray,ze=ee.state.version,be=Ne.getParameters(A,ee.state,Te,q,ce,R.state.lightProbeGridArray),$e=Ne.getProgramCacheKey(be);let Ze=te.programs;te.environment=A.isMeshStandardMaterial||A.isMeshLambertMaterial||A.isMeshPhongMaterial?q.environment:null,te.fog=q.fog;const lt=A.isMeshStandardMaterial||A.isMeshLambertMaterial&&!A.envMap||A.isMeshPhongMaterial&&!A.envMap;te.envMap=Me.get(A.envMap||te.environment,lt),te.envMapRotation=te.environment!==null&&A.envMap===null?q.environmentRotation:A.envMapRotation,Ze===void 0&&(A.addEventListener("dispose",si),Ze=new Map,te.programs=Ze);let ut=Ze.get($e);if(ut!==void 0){if(te.currentProgram===ut&&te.lightsStateVersion===ze)return qa(A,be),ut}else be.uniforms=Ne.getUniforms(A),G!==null&&A.isNodeMaterial&&G.build(A,ce,be),A.onBeforeCompile(be,z),ut=Ne.acquireProgram(be,$e),Ze.set($e,ut),te.uniforms=be.uniforms;const Ke=te.uniforms;return(!A.isShaderMaterial&&!A.isRawShaderMaterial||A.clipping===!0)&&(Ke.clippingPlanes=et.uniform),qa(A,be),te.needsLights=zo(A),te.lightsStateVersion=ze,te.needsLights&&(Ke.ambientLightColor.value=ee.state.ambient,Ke.lightProbe.value=ee.state.probe,Ke.directionalLights.value=ee.state.directional,Ke.directionalLightShadows.value=ee.state.directionalShadow,Ke.spotLights.value=ee.state.spot,Ke.spotLightShadows.value=ee.state.spotShadow,Ke.rectAreaLights.value=ee.state.rectArea,Ke.ltc_1.value=ee.state.rectAreaLTC1,Ke.ltc_2.value=ee.state.rectAreaLTC2,Ke.pointLights.value=ee.state.point,Ke.pointLightShadows.value=ee.state.pointShadow,Ke.hemisphereLights.value=ee.state.hemi,Ke.directionalShadowMatrix.value=ee.state.directionalShadowMatrix,Ke.spotLightMatrix.value=ee.state.spotLightMatrix,Ke.spotLightMap.value=ee.state.spotLightMap,Ke.pointShadowMatrix.value=ee.state.pointShadowMatrix),te.lightProbeGrid=R.state.lightProbeGridArray.length>0,te.currentProgram=ut,te.uniformsList=null,ut}function Bo(A){if(A.uniformsList===null){const q=A.currentProgram.getUniforms();A.uniformsList=Pu.seqWithValue(q.seq,A.uniforms)}return A.uniformsList}function qa(A,q){const ce=re.get(A);
vendor: 10,312 bytes, line 4156
4156ce.outputColorSpace=q.outputColorSpace,ce.batching=q.batching,ce.batchingColor=q.batchingColor,ce.instancing=q.instancing,ce.instancingColor=q.instancingColor,ce.instancingMorph=q.instancingMorph,ce.skinning=q.skinning,ce.morphTargets=q.morphTargets,ce.morphNormals=q.morphNormals,ce.morphColors=q.morphColors,ce.morphTargetsCount=q.morphTargetsCount,ce.numClippingPlanes=q.numClippingPlanes,ce.numIntersection=q.numClipIntersection,ce.vertexAlphas=q.vertexAlphas,ce.vertexTangents=q.vertexTangents,ce.toneMapping=q.toneMapping}function ac(A,q){if(A.length===0)return null;if(A.length===1)return A[0].texture!==null?A[0]:null;T.setFromMatrixPosition(q.matrixWorld);for(let ce=0,te=A.length;ce<te;ce++){const ee=A[ce];if(ee.texture!==null&&ee.boundingBox.containsPoint(T))return ee}return null}function Kt(A,q,ce,te,ee){q.isScene!==!0&&(q=Bt),fe.resetTextureUnits();const Te=q.fog,ze=te.isMeshStandardMaterial||te.isMeshLambertMaterial||te.isMeshPhongMaterial?q.environment:null,be=$===null?z.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:xt.workingColorSpace,$e=te.isMeshStandardMaterial||te.isMeshLambertMaterial&&!te.envMap||te.isMeshPhongMaterial&&!te.envMap,Ze=Me.get(te.envMap||ze,$e),lt=te.vertexColors===!0&&!!ce.attributes.color&&ce.attributes.color.itemSize===4,ut=!!ce.attributes.tangent&&(!!te.normalMap||te.anisotropy>0),Ke=!!ce.morphAttributes.position,yt=!!ce.morphAttributes.normal,zt=!!ce.morphAttributes.color;let qt=Ci;te.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(qt=z.toneMapping);const Lt=ce.morphAttributes.position||ce.morphAttributes.normal||ce.morphAttributes.color,nn=Lt!==void 0?Lt.length:0,Oe=re.get(te),vn=R.state.lights;if(_t===!0&&(ft===!0||A!==ue)){const Dt=A===ue&&te.id===le;et.setState(te,A,Dt)}let pt=!1;te.version===Oe.__version?(Oe.needsLights&&Oe.lightsStateVersion!==vn.state.version||Oe.outputColorSpace!==be||ee.isBatchedMesh&&Oe.batching===!1||!ee.isBatchedMesh&&Oe.batching===!0||ee.isBatchedMesh&&Oe.batchingColor===!0&&ee.colorTexture===null||ee.isBatchedMesh&&Oe.batchingColor===!1&&ee.colorTexture!==null||ee.isInstancedMesh&&Oe.instancing===!1||!ee.isInstancedMesh&&Oe.instancing===!0||ee.isSkinnedMesh&&Oe.skinning===!1||!ee.isSkinnedMesh&&Oe.skinning===!0||ee.isInstancedMesh&&Oe.instancingColor===!0&&ee.instanceColor===null||ee.isInstancedMesh&&Oe.instancingColor===!1&&ee.instanceColor!==null||ee.isInstancedMesh&&Oe.instancingMorph===!0&&ee.morphTexture===null||ee.isInstancedMesh&&Oe.instancingMorph===!1&&ee.morphTexture!==null||Oe.envMap!==Ze||te.fog===!0&&Oe.fog!==Te||Oe.numClippingPlanes!==void 0&&(Oe.numClippingPlanes!==et.numPlanes||Oe.numIntersection!==et.numIntersection)||Oe.vertexAlphas!==lt||Oe.vertexTangents!==ut||Oe.morphTargets!==Ke||Oe.morphNormals!==yt||Oe.morphColors!==zt||Oe.toneMapping!==qt||Oe.morphTargetsCount!==nn||!!Oe.lightProbeGrid!=R.state.lightProbeGridArray.length>0)&&(pt=!0):(pt=!0,Oe.__version=te.version);let kn=Oe.currentProgram;pt===!0&&(kn=js(te,q,ee),G&&te.isNodeMaterial&&G.onUpdateProgram(te,kn,Oe));let Bn=!1,gt=!1,Wi=!1;const Nt=kn.getUniforms(),Wt=Oe.uniforms;if(E.useProgram(kn.program)&&(Bn=!0,gt=!0,Wi=!0),te.id!==le&&(le=te.id,gt=!0),Oe.needsLights){const Dt=ac(R.state.lightProbeGridArray,ee);Oe.lightProbeGrid!==Dt&&(Oe.lightProbeGrid=Dt,gt=!0)}if(Bn||ue!==A){E.buffers.depth.getReversed()&&A.reversedDepth!==!0&&(A._reversedDepth=!0,A.updateProjectionMatrix()),Nt.setValue(H,"projectionMatrix",A.projectionMatrix),Nt.setValue(H,"viewMatrix",A.matrixWorldInverse);const mi=Nt.map.cameraPosition;mi!==void 0&&mi.setValue(H,Ht.setFromMatrixPosition(A.matrixWorld)),I.logarithmicDepthBuffer&&Nt.setValue(H,"logDepthBufFC",2/(Math.log(A.far+1)/Math.LN2)),(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial)&&Nt.setValue(H,"isOrthographic",A.isOrthographicCamera===!0),ue!==A&&(ue=A,gt=!0,Wi=!0)}if(Oe.needsLights&&(vn.state.directionalShadowMap.length>0&&Nt.setValue(H,"directionalShadowMap",vn.state.directionalShadowMap,fe),vn.state.spotShadowMap.length>0&&Nt.setValue(H,"spotShadowMap",vn.state.spotShadowMap,fe),vn.state.pointShadowMap.length>0&&Nt.setValue(H,"pointShadowMap",vn.state.pointShadowMap,fe)),ee.isSkinnedMesh){Nt.setOptional(H,ee,"bindMatrix"),Nt.setOptional(H,ee,"bindMatrixInverse");const Dt=ee.skeleton;Dt&&(Dt.boneTexture===null&&Dt.computeBoneTexture(),Nt.setValue(H,"boneTexture",Dt.boneTexture,fe))}ee.isBatchedMesh&&(Nt.setOptional(H,ee,"batchingTexture"),Nt.setValue(H,"batchingTexture",ee._matricesTexture,fe),Nt.setOptional(H,ee,"batchingIdTexture"),Nt.setValue(H,"batchingIdTexture",ee._indirectTexture,fe),Nt.setOptional(H,ee,"batchingColorTexture"),ee._colorsTexture!==null&&Nt.setValue(H,"batchingColorTexture",ee._colorsTexture,fe));const pi=ce.morphAttributes;if((pi.position!==void 0||pi.normal!==void 0||pi.color!==void 0)&&W.update(ee,ce,kn),(gt||Oe.receiveShadow!==ee.receiveShadow)&&(Oe.receiveShadow=ee.receiveShadow,Nt.setValue(H,"receiveShadow",ee.receiveShadow)),(te.isMeshStandardMaterial||te.isMeshLambertMaterial||te.isMeshPhongMaterial)&&te.envMap===null&&q.environment!==null&&(Wt.envMapIntensity.value=q.environmentIntensity),Wt.dfgLUT!==void 0&&(Wt.dfgLUT.value=IT()),gt){if(Nt.setValue(H,"toneMappingExposure",z.toneMappingExposure),Oe.needsLights&&lc(Wt,Wi),Te&&te.fog===!0&&Ye.refreshFogUniforms(Wt,Te),Ye.refreshMaterialUniforms(Wt,te,pe,ve,R.state.transmissionRenderTarget[A.id]),Oe.needsLights&&Oe.lightProbeGrid){const Dt=Oe.lightProbeGrid;Wt.probesSH.value=Dt.texture,Wt.probesMin.value.copy(Dt.boundingBox.min),Wt.probesMax.value.copy(Dt.boundingBox.max),Wt.probesResolution.value.copy(Dt.resolution)}Pu.upload(H,Bo(Oe),Wt,fe)}if(te.isShaderMaterial&&te.uniformsNeedUpdate===!0&&(Pu.upload(H,Bo(Oe),Wt,fe),te.uniformsNeedUpdate=!1),te.isSpriteMaterial&&Nt.setValue(H,"center",ee.center),Nt.setValue(H,"modelViewMatrix",ee.modelViewMatrix),Nt.setValue(H,"normalMatrix",ee.normalMatrix),Nt.setValue(H,"modelMatrix",ee.matrixWorld),te.uniformsGroups!==void 0){const Dt=te.uniformsGroups;for(let mi=0,Pi=Dt.length;mi<Pi;mi++){const Qs=Dt[mi];_e.update(Qs,kn),_e.bind(Qs,kn)}}return kn}function lc(A,q){A.ambientLightColor.needsUpdate=q,A.lightProbe.needsUpdate=q,A.directionalLights.needsUpdate=q,A.directionalLightShadows.needsUpdate=q,A.pointLights.needsUpdate=q,A.pointLightShadows.needsUpdate=q,A.spotLights.needsUpdate=q,A.spotLightShadows.needsUpdate=q,A.rectAreaLights.needsUpdate=q,A.hemisphereLights.needsUpdate=q}function zo(A){return A.isMeshLambertMaterial||A.isMeshToonMaterial||A.isMeshPhongMaterial||A.isMeshStandardMaterial||A.isShadowMaterial||A.isShaderMaterial&&A.lights===!0}this.getActiveCubeFace=function(){return ie},this.getActiveMipmapLevel=function(){return K},this.getRenderTarget=function(){return $},this.setRenderTargetTextures=function(A,q,ce){const te=re.get(A);te.__autoAllocateDepthBuffer=A.resolveDepthBuffer===!1,te.__autoAllocateDepthBuffer===!1&&(te.__useRenderToTexture=!1),re.get(A.texture).__webglTexture=q,re.get(A.depthTexture).__webglTexture=te.__autoAllocateDepthBuffer?void 0:ce,te.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(A,q){const ce=re.get(A);ce.__webglFramebuffer=q,ce.__useDefaultFramebuffer=q===void 0},this.setRenderTarget=function(A,q=0,ce=0){$=A,ie=q,K=ce;let te=null,ee=!1,Te=!1;if(A){const be=re.get(A);if(be.__useDefaultFramebuffer!==void 0){E.bindFramebuffer(H.FRAMEBUFFER,be.__webglFramebuffer),k.copy(A.viewport),Q.copy(A.scissor),De=A.scissorTest,E.viewport(k),E.scissor(Q),E.setScissorTest(De),le=-1;return}else if(be.__webglFramebuffer===void 0)fe.setupRenderTarget(A);else if(be.__hasExternalTextures)fe.rebindTextures(A,re.get(A.texture).__webglTexture,re.get(A.depthTexture).__webglTexture);else if(A.depthBuffer){const lt=A.depthTexture;if(be.__boundDepthTexture!==lt){if(lt!==null&&re.has(lt)&&(A.width!==lt.image.width||A.height!==lt.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");fe.setupDepthRenderbuffer(A)}}const $e=A.texture;($e.isData3DTexture||$e.isDataArrayTexture||$e.isCompressedArrayTexture)&&(Te=!0);const Ze=re.get(A).__webglFramebuffer;A.isWebGLCubeRenderTarget?(Array.isArray(Ze[q])?te=Ze[q][ce]:te=Ze[q],ee=!0):A.samples>0&&fe.useMultisampledRTT(A)===!1?te=re.get(A).__webglMultisampledFramebuffer:Array.isArray(Ze)?te=Ze[ce]:te=Ze,k.copy(A.viewport),Q.copy(A.scissor),De=A.scissorTest}else k.copy(Je).multiplyScalar(pe).floor(),Q.copy(Ft).multiplyScalar(pe).floor(),De=ht;if(ce!==0&&(te=J),E.bindFramebuffer(H.FRAMEBUFFER,te)&&E.drawBuffers(A,te),E.viewport(k),E.scissor(Q),E.setScissorTest(De),ee){const be=re.get(A.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+q,be.__webglTexture,ce)}else if(Te){const be=q;for(let $e=0;$e<A.textures.length;$e++){const Ze=re.get(A.textures[$e]);H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0+$e,Ze.__webglTexture,ce,be)}}else if(A!==null&&ce!==0){const be=re.get(A.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,be.__webglTexture,ce)}le=-1},this.readRenderTargetPixels=function(A,q,ce,te,ee,Te,ze,be=0){if(!(A&&A.isWebGLRenderTarget)){wt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let $e=re.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&ze!==void 0&&($e=$e[ze]),$e){E.bindFramebuffer(H.FRAMEBUFFER,$e);try{const Ze=A.textures[be],lt=Ze.format,ut=Ze.type;if(A.textures.length>1&&H.readBuffer(H.COLOR_ATTACHMENT0+be),!I.textureFormatReadable(lt)){wt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!I.textureTypeReadable(ut)){wt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q>=0&&q<=A.width-te&&ce>=0&&ce<=A.height-ee&&H.readPixels(q,ce,te,ee,Pe.convert(lt),Pe.convert(ut),Te)}finally{const Ze=$!==null?re.get($).__webglFramebuffer:null;E.bindFramebuffer(H.FRAMEBUFFER,Ze)}}},this.readRenderTargetPixelsAsync=async function(A,q,ce,te,ee,Te,ze,be=0){if(!(A&&A.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let $e=re.get(A).__webglFramebuffer;
vendor: 5,677 bytes, line 4156
4156if(A.isWebGLCubeRenderTarget&&ze!==void 0&&($e=$e[ze]),$e)if(q>=0&&q<=A.width-te&&ce>=0&&ce<=A.height-ee){E.bindFramebuffer(H.FRAMEBUFFER,$e);const Ze=A.textures[be],lt=Ze.format,ut=Ze.type;if(A.textures.length>1&&H.readBuffer(H.COLOR_ATTACHMENT0+be),!I.textureFormatReadable(lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!I.textureTypeReadable(ut))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ke=H.createBuffer();H.bindBuffer(H.PIXEL_PACK_BUFFER,Ke),H.bufferData(H.PIXEL_PACK_BUFFER,Te.byteLength,H.STREAM_READ),H.readPixels(q,ce,te,ee,Pe.convert(lt),Pe.convert(ut),0);const yt=$!==null?re.get($).__webglFramebuffer:null;E.bindFramebuffer(H.FRAMEBUFFER,yt);const zt=H.fenceSync(H.SYNC_GPU_COMMANDS_COMPLETE,0);return H.flush(),await Jy(H,zt,4),H.bindBuffer(H.PIXEL_PACK_BUFFER,Ke),H.getBufferSubData(H.PIXEL_PACK_BUFFER,0,Te),H.deleteBuffer(Ke),H.deleteSync(zt),Te}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(A,q=null,ce=0){const te=Math.pow(2,-ce),ee=Math.floor(A.image.width*te),Te=Math.floor(A.image.height*te),ze=q!==null?q.x:0,be=q!==null?q.y:0;fe.setTexture2D(A,0),H.copyTexSubImage2D(H.TEXTURE_2D,ce,0,0,ze,be,ee,Te),E.unbindTexture()},this.copyTextureToTexture=function(A,q,ce=null,te=null,ee=0,Te=0){let ze,be,$e,Ze,lt,ut,Ke,yt,zt;const qt=A.isCompressedTexture?A.mipmaps[Te]:A.image;if(ce!==null)ze=ce.max.x-ce.min.x,be=ce.max.y-ce.min.y,$e=ce.isBox3?ce.max.z-ce.min.z:1,Ze=ce.min.x,lt=ce.min.y,ut=ce.isBox3?ce.min.z:0;else{const Wt=Math.pow(2,-ee);ze=Math.floor(qt.width*Wt),be=Math.floor(qt.height*Wt),A.isDataArrayTexture?$e=qt.depth:A.isData3DTexture?$e=Math.floor(qt.depth*Wt):$e=1,Ze=0,lt=0,ut=0}te!==null?(Ke=te.x,yt=te.y,zt=te.z):(Ke=0,yt=0,zt=0);const Lt=Pe.convert(q.format),nn=Pe.convert(q.type);let Oe;q.isData3DTexture?(fe.setTexture3D(q,0),Oe=H.TEXTURE_3D):q.isDataArrayTexture||q.isCompressedArrayTexture?(fe.setTexture2DArray(q,0),Oe=H.TEXTURE_2D_ARRAY):(fe.setTexture2D(q,0),Oe=H.TEXTURE_2D),E.activeTexture(H.TEXTURE0),E.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,q.flipY),E.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),E.pixelStorei(H.UNPACK_ALIGNMENT,q.unpackAlignment);const vn=E.getParameter(H.UNPACK_ROW_LENGTH),pt=E.getParameter(H.UNPACK_IMAGE_HEIGHT),kn=E.getParameter(H.UNPACK_SKIP_PIXELS),Bn=E.getParameter(H.UNPACK_SKIP_ROWS),gt=E.getParameter(H.UNPACK_SKIP_IMAGES);E.pixelStorei(H.UNPACK_ROW_LENGTH,qt.width),E.pixelStorei(H.UNPACK_IMAGE_HEIGHT,qt.height),E.pixelStorei(H.UNPACK_SKIP_PIXELS,Ze),E.pixelStorei(H.UNPACK_SKIP_ROWS,lt),E.pixelStorei(H.UNPACK_SKIP_IMAGES,ut);const Wi=A.isDataArrayTexture||A.isData3DTexture,Nt=q.isDataArrayTexture||q.isData3DTexture;if(A.isDepthTexture){const Wt=re.get(A),pi=re.get(q),Dt=re.get(Wt.__renderTarget),mi=re.get(pi.__renderTarget);E.bindFramebuffer(H.READ_FRAMEBUFFER,Dt.__webglFramebuffer),E.bindFramebuffer(H.DRAW_FRAMEBUFFER,mi.__webglFramebuffer);for(let Pi=0;Pi<$e;Pi++)Wi&&(H.framebufferTextureLayer(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,re.get(A).__webglTexture,ee,ut+Pi),H.framebufferTextureLayer(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,re.get(q).__webglTexture,Te,zt+Pi)),H.blitFramebuffer(Ze,lt,ze,be,Ke,yt,ze,be,H.DEPTH_BUFFER_BIT,H.NEAREST);E.bindFramebuffer(H.READ_FRAMEBUFFER,null),E.bindFramebuffer(H.DRAW_FRAMEBUFFER,null)}else if(ee!==0||A.isRenderTargetTexture||re.has(A)){const Wt=re.get(A),pi=re.get(q);E.bindFramebuffer(H.READ_FRAMEBUFFER,oe),E.bindFramebuffer(H.DRAW_FRAMEBUFFER,Y);for(let Dt=0;Dt<$e;Dt++)Wi?H.framebufferTextureLayer(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,Wt.__webglTexture,ee,ut+Dt):H.framebufferTexture2D(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,Wt.__webglTexture,ee),Nt?H.framebufferTextureLayer(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,pi.__webglTexture,Te,zt+Dt):H.framebufferTexture2D(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,pi.__webglTexture,Te),ee!==0?H.blitFramebuffer(Ze,lt,ze,be,Ke,yt,ze,be,H.COLOR_BUFFER_BIT,H.NEAREST):Nt?H.copyTexSubImage3D(Oe,Te,Ke,yt,zt+Dt,Ze,lt,ze,be):H.copyTexSubImage2D(Oe,Te,Ke,yt,Ze,lt,ze,be);E.bindFramebuffer(H.READ_FRAMEBUFFER,null),E.bindFramebuffer(H.DRAW_FRAMEBUFFER,null)}else Nt?A.isDataTexture||A.isData3DTexture?H.texSubImage3D(Oe,Te,Ke,yt,zt,ze,be,$e,Lt,nn,qt.data):q.isCompressedArrayTexture?H.compressedTexSubImage3D(Oe,Te,Ke,yt,zt,ze,be,$e,Lt,qt.data):H.texSubImage3D(Oe,Te,Ke,yt,zt,ze,be,$e,Lt,nn,qt):A.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,Te,Ke,yt,ze,be,Lt,nn,qt.data):A.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,Te,Ke,yt,qt.width,qt.height,Lt,qt.data):H.texSubImage2D(H.TEXTURE_2D,Te,Ke,yt,ze,be,Lt,nn,qt);E.pixelStorei(H.UNPACK_ROW_LENGTH,vn),E.pixelStorei(H.UNPACK_IMAGE_HEIGHT,pt),E.pixelStorei(H.UNPACK_SKIP_PIXELS,kn),E.pixelStorei(H.UNPACK_SKIP_ROWS,Bn),E.pixelStorei(H.UNPACK_SKIP_IMAGES,gt),Te===0&&q.generateMipmaps&&H.generateMipmap(Oe),E.unbindTexture()},this.initRenderTarget=function(A){re.get(A).__webglFramebuffer===void 0&&fe.setupRenderTarget(A)},this.initTexture=function(A){A.isCubeTexture?fe.setTextureCube(A,0):A.isData3DTexture?fe.setTexture3D(A,0):A.isDataArrayTexture||A.isCompressedArrayTexture?fe.setTexture2DArray(A,0):fe.setTexture2D(A,0),E.unbindTexture()},this.resetState=function(){ie=0,K=0,$=null,E.reset(),Ie.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return zi}get outputColorSpace(){return this._outputColorSpace}
4156set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=xt._getDrawingBufferColorSpace(e),t.unpackColorSpace=xt._getUnpackColorSpace()}}function FT({faceTextureUrl:s="/coin/face.png",edgeTextureUrl:e="/coin/edge.png"}){const t=bt.useRef(null),[n,r]=bt.useState(!1);return bt.useEffect(()=>{const a=t.current;if(!a)return;const u=()=>{const tt=a.getBoundingClientRect();return{w:Math.max(1,Math.floor(tt.width||window.innerWidth)),h:Math.max(1,Math.floor(tt.height||window.innerHeight))}},{w:c,h}=u(),d=new mM,p=new fi(42,c/h,.1,1e3);p.position.set(0,.9,11.2),p.lookAt(0,0,0);let m;try{m=new UT({antialias:!0,powerPreference:"high-performance",alpha:!0})}catch(tt){console.warn("[InteractiveCoin] WebGL unavailable — showing static coin",tt),r(!0);return}m.setClearColor(0,0);const v=tt=>Math.min(Math.max(tt,2),3),x=tt=>1.15*(tt/(window.devicePixelRatio||1)),M=v(window.devicePixelRatio||1);m.setPixelRatio(M),m.setSize(c,h,!1),m.outputColorSpace=Un,m.toneMapping=Ci,m.domElement.style.width="100%",m.domElement.style.height="100%",m.domElement.style.display="block",a.appendChild(m.domElement);const b=new Ha(80,80),y=new Ai({transparent:!0,depthWrite:!1,extensions:{derivatives:!0},uniforms:{uScroll:{value:0},uCell:{value:2.6},uLinePx:{value:x(M)},uLineColor:{value:new Rt("#CBD5E1")},uOpacity:{value:.55},uFadeStart:{value:10},uFadeEnd:{value:90}},vertexShader:`
4157        varying vec3 vWorld;
4158        void main() {
4159          vec4 wp = modelMatrix * vec4(position, 1.0);
4160          vWorld = wp.xyz;
4161          gl_Position = projectionMatrix * viewMatrix * wp;
4162        }
4163      `,fragmentShader:`
4164        uniform float uScroll;
4165        uniform float uCell;
4166        uniform float uLine;
4167        uniform vec3 uLineColor;
4168        uniform float uOpacity;
4169        uniform float uFadeStart;
4170        uniform float uFadeEnd;
4171        varying vec3 vWorld;
4172
4173        uniform float uLinePx;
4174
4175        float gridLine(float coord) {
4176          float d = min(fract(coord), 1.0 - fract(coord));
4177          float px = fwidth(coord);
4178          return 1.0 - smoothstep(0.0, uLinePx * px, d);
4179        }
4180
4181        void main() {
4182          vec2 p = vWorld.xz;
4183          p.y += uScroll;
4184          vec2 g = p / uCell;
4185          float lx = gridLine(g.x);
4186          float lz = gridLine(g.y);
4187          float grid = max(lx, lz);
4188          float d = distance(vWorld, cameraPosition);
4189          float fade = 1.0 - smoothstep(uFadeStart, uFadeEnd, d);
4190          float alpha = grid * uOpacity * fade;
4191          gl_FragColor = vec4(uLineColor, alpha);
4192        }
4193      `}),S=new ti(b,y);S.rotation.x=-Math.PI/2,S.position.y=-2.8,S.position.z=0,d.add(S);const P=new OM,U=m.capabilities.getMaxAnisotropy(),T=P.load(s);T.colorSpace=Un,T.anisotropy=U,T.generateMipmaps=!0,T.minFilter=os,T.magFilter=mn,T.center.set(.5,.5),T.rotation=Math.PI;const N=P.load(e);
4193N.colorSpace=Un,N.anisotropy=U,N.wrapS=Ia,N.wrapT=Ia,N.generateMipmaps=!0,N.minFilter=os,N.magFilter=mn;const R=new zu({map:T,transparent:!0}),F=new zu({map:N,transparent:!0}),w=2.6,L=.4,z=256,B=new ip(w,z),G=new ti(B,R),J=new ti(B,R);G.position.y=L/2,G.rotation.x=-Math.PI/2,G.rotation.z=Math.PI,J.position.y=-L/2,J.rotation.x=Math.PI/2;const oe=new sp(w,w,L,z,1,!0),Y=new ti(oe,F),ie=new _o;ie.add(G,J,Y),ie.rotation.x=Math.PI/2;const K=new _o;K.add(ie),K.position.set(0,0,0),d.add(K);let $=!1,le=0,ue=0,k=K.rotation.y,Q=K.rotation.x,De=0,He=0;const Be=.0065,ae=.92,ve=.18,pe=.55,Fe=(tt,mt,H)=>Math.max(mt,Math.min(H,tt)),Qe=tt=>{var mt,H;$=!0,le=tt.clientX,ue=tt.clientY,(H=(mt=tt.target).setPointerCapture)==null||H.call(mt,tt.pointerId)},Je=tt=>{if(!$)return;const mt=tt.clientX-le,H=tt.clientY-ue;le=tt.clientX,ue=tt.clientY,k+=mt*Be,Q+=H*Be,Q=Fe(Q,-pe,pe),De=mt*Be,He=H*Be},Ft=tt=>{var mt,H;$=!1,(H=(mt=tt.target).releasePointerCapture)==null||H.call(mt,tt.pointerId)},ht=K.rotation.y,Mt=K.rotation.x,_t=()=>{k=ht,Q=Mt,De=0,He=0},ft=m.domElement;ft.addEventListener("pointerdown",Qe),ft.addEventListener("pointermove",Je),window.addEventListener("pointerup",Ft),ft.addEventListener("dblclick",_t);const kt=-.0035;let Ht=0;const Gt=()=>{$||(k+=kt),$||(k+=De,Q=Fe(Q+He,-pe,pe),De*=ae,He*=ae),K.rotation.y+=(k-K.rotation.y)*ve,K.rotation.x+=(Q-K.rotation.x)*ve,y.uniforms.uScroll.value+=.01,m.render(d,p),Ht=requestAnimationFrame(Gt)};Gt();const Bt=new ResizeObserver(()=>{const{w:tt,h:mt}=u();p.aspect=tt/mt,p.updateProjectionMatrix();const H=v(window.devicePixelRatio||1);m.setPixelRatio(H),y.uniforms.uLinePx.value=x(H),m.setSize(tt,mt,!1)});return Bt.observe(a),()=>{cancelAnimationFrame(Ht),Bt.disconnect(),ft.removeEventListener("pointerdown",Qe),ft.removeEventListener("pointermove",Je),window.removeEventListener("pointerup",Ft),ft.removeEventListener("dblclick",_t),b.dispose(),y.dispose(),B.dispose(),oe.dispose(),R.dispose(),F.dispose(),T.dispose(),N.dispose(),m.dispose(),m.domElement.remove()}},[s,e]),n?D.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:D.jsx("img",{src:s,alt:"GOATCOIN coin",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})}):D.jsx("div",{style:{position:"relative",width:"100%",height:"100%",background:"transparent",overflow:"hidden"},children:D.jsx("div",{ref:t,style:{position:"absolute",inset:0}})})}function OT({value:s,label:e,children:t,copiedMessage:n="Copied to clipboard",className:r=""}){const[a,u]=bt.useState(!1),c=bt.useRef(void 0);bt.useEffect(()=>()=>window.clearTimeout(c.current),[]);async function h(){try{await navigator.clipboard.writeText(s)}catch{return}u(!0),window.clearTimeout(c.current),c.current=window.setTimeout(()=>u(!1),1600)}return D.jsxs(D.Fragment,{children:[D.jsxs("button",{type:"button",className:`copy-btn ${a?"is-copied":""} ${r}`.trim(),onClick:h,children:[D.jsx("span",{className:"sr-only",children:e}),t?D.jsx("span",{className:"copy-btn__label",children:t}):null,D.jsxs("span",{className:"copy-btn__icons","aria-hidden":"true",children:[D.jsxs("svg",{className:"copy-btn__icon copy-btn__icon--copy",viewBox:"0 0 256 256",focusable:"false",children:[D.jsx("rect",{width:"256",height:"256",fill:"none"}),D.jsx("polyline",{points:"168 168 216 168 216 40 88 40 88 88",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),D.jsx("rect",{x:"40",y:"88",width:"128",height:"128",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"})]}),D.jsxs("svg",{className:"copy-btn__icon copy-btn__icon--check",viewBox:"0 0 256 256",focusable:"false",children:[D.jsx("rect",{width:"256",height:"256",fill:"none"}),D.jsx("polyline",{points:"40 144 96 200 224 72",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"})]})]})]}),D.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:a?n:""})]})}function kT(s,e=6,t=4){const n=s;return n.length<=e+t+2?n:`${n.slice(0,e)}…${n.slice(-t)}`}function Uo(s,e={}){return new Intl.NumberFormat("en-US",{maximumFractionDigits:2,...e}).format(s)}function $v(s){return new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:2}).format(s)}function as(s){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:2}).format(s)}function Nu(s,e=6){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:e}).format(s)}function Dd(s,e=2){return`${s<0?"−":"+"}${Math.abs(s).toFixed(e)}%`}function BT(s){return`${s<0?"−":"+"}${Uo(Math.abs(s),{maximumFractionDigits:0})}`}function qv(s,e=2){return`${(s*100).toFixed(e)}%`}function op(s){const e=s instanceof Date?s:new Date(s);if(Number.isNaN(e.getTime()))return"";const t=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function zT(s){const[e,t,n]=s.split("-").map(Number);return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(new Date(e,t-1,n))}function Fo(s){const e=new Date(s);return Number.isNaN(e.getTime())?s:new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(e)}function VT(){return D.jsxs("div",{className:"card span-4 feature glass",children:[D.jsx("div",{className:"feature__coin3d",children:D.jsx(FT,{})}),D.jsxs("div",{className:"feature__hero",children:[D.jsx("h1",{className:"feature__wordmark",children:"₲OAT"}),D.jsxs(OT,{className:"feature__contract",value:zs,label:"Copy contract address",copiedMessage:"Contract address copied to clipboard",children:["CA:",kT(zs,6,8)]})]})]})}const HT=[{heading:"DEX",links:[{label:"HYPERION",href:`https://hyperion.xyz/swap?from=0x1::aptos_coin::AptosCoin&to=${zs}`},{label:"OKX",href:`https://web3.okx.com/token/aptos/${zs}`},{label:"GOATSWAP",href:"https://goatswap.io/"}]},{heading:"WALLETS",links:[{label:"PETRA",href:"https://petra.app/"},{label:"BACKPACK",href:"https://backpack.app/"},{label:"OKX",href:"https://web3.okx.com/"}]},{heading:"DATA",links:[{label:"COIN GECKO",href:"https://www.coingecko.com/en/coins/goatcoin-2"},{label:"GECKO TERMINAL",href:"https://www.geckoterminal.com/aptos/pools/0x524be870a6669ca01a4de882bb140208fb9c560769dcc551dc4beacb1821ce48"},{label:"BIRDEYE",href:`https://birdeye.so/aptos/token/${zs}?tab=trades&trades_layout=table`},{label:"APTOSCAN",href:`https://aptoscan.com/fungible-asset/${zs}`},{label:"APTOS EXPLORER",href:`https://explorer.aptoslabs.com/fungible_asset/${zs}/info?network=mainnet`}]}];function GT(){return D.jsxs("div",{className:"card span-8 platform",children:[D.jsx("h2",{className:"platform__title",children:"AVAILABLE WORLDWIDE:"}),D.jsxs("div",{className:"platform__body",children:[D.jsx("div",{className:"platform__groups",children:HT.map(s=>D.jsxs("section",{className:"platform__group",children:[D.jsx("h3",{className:"platform__heading",children:s.heading}),D.jsx("p",{className:"platform__links",children:s.links.map((e,t)=>D.jsxs(bt.Fragment,{children:[t>0&&D.jsx("span",{className:"platform__sep","aria-hidden":"true",children:" | "}),D.jsx("a",{className:"platform__link",href:e.href,target:"_blank",rel:"noreferrer noopener",children:e.label})]},e.label))})]},s.heading))}),D.jsx("span",{className:"platform__mark","aria-hidden":"true",children:"₲"})]})]})}const WT="https://discord.gg/75zDpzzvTN";function XT(){return D.jsxs("div",{className:"card span-12 promo community",children:[D.jsxs("div",{className:"promo__row",children:[D.jsxs("h2",{className:"promo__stack",children:[D.jsx("span",{className:"promo__line promo__line--discord",children:"DISCORD"}),D.jsx("span",{className:"promo__line promo__line--community",children:"COMMUNITY"}),D.jsx("span",{className:"promo__line promo__line--for",children:"FOR GOATCOIN"}),D.jsx("span",{className:"promo__line promo__line--holders",children:"HOLDERS"})]}),D.jsxs("a",{className:"promo__icon",href:WT,target:"_blank",rel:"noreferrer noopener",children:[D.jsx("span",{className:"sr-only",children:"Join the GOATCOIN Discord server"}),D.jsx("svg",{className:"promo__mark-svg",viewBox:"0 0 126.644 96","aria-hidden":"true",focusable:"false",children:D.jsx("path",{d:"M81.15,0c-1.2376,2.1973-2.3489,4.4704-3.3591,6.794-9.5975-1.4396-19.3718-1.4396-28.9945,0-.985-2.3236-2.1216-4.5967-3.3591-6.794-9.0166,1.5407-17.8059,4.2431-26.1405,8.0568C2.779,32.5304-1.6914,56.3725.5312,79.8863c9.6732,7.1476,20.5083,12.603,32.0505,16.0884,2.6014-3.4854,4.8998-7.1981,6.8698-11.0623-3.738-1.3891-7.3497-3.1318-10.8098-5.1523.9092-.6567,1.7932-1.3386,2.6519-1.9953,20.281,9.547,43.7696,9.547,64.0758,0,.8587.7072,1.7427,1.3891,2.6519,1.9953-3.4601,2.0457-7.0718,3.7632-10.835,5.1776,1.97,3.8642,4.2683,7.5769,6.8698,11.0623,11.5419-3.4854,22.3769-8.9156,32.0509-16.0631,2.626-27.2771-4.496-50.9172-18.817-71.8548C98.9811,4.2684,90.1918,1.5659,81.1752.0505l-.0252-.0505ZM42.2802,65.4144c-6.2383,0-11.4159-5.6575-11.4159-12.6535s4.9755-12.6788,11.3907-12.6788,11.5169,5.708,11.4159,12.6788c-.101,6.9708-5.026,12.6535-11.3907,12.6535ZM84.3576,65.4144c-6.2637,0-11.3907-5.6575-11.3907-12.6535s4.9755-12.6788,11.3907-12.6788,11.4917,5.708,11.3906,12.6788c-.101,6.9708-5.026,12.6535-11.3906,12.6535Z"})})]})]}),D.jsx("p",{className:"promo__soon",children:"JOIN SERVER"})]})}function Ot(s){var e=s.width,t=s.height;if(e<0)throw new Error("Negative width is not allowed for Size");if(t<0)throw new Error("Negative height is not allowed for Size");return{width:e,height:t}}function Sr(s,e){return s.width===e.width&&s.height===e.height}var $T=(function(){function s(e){var t=this;this._resolutionListener=function(){return t._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=e,this._installResolutionListener()}return s.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(s.prototype,"value",{get:function(){return this._window.devicePixelRatio}
4193,enumerable:!1,configurable:!0}),s.prototype.subscribe=function(e){var t=this,n={next:e};return this._observers.push(n),{unsubscribe:function(){t._observers=t._observers.filter(function(r){return r!==n})}}},s.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var e=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(e,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},s.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},s.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},s.prototype._onResolutionChanged=function(){var e=this;this._observers.forEach(function(t){return t.next(e._window.devicePixelRatio)}),this._reinstallResolutionListener()},s})();function qT(s){return new $T(s)}var YT=(function(){function s(e,t,n){var r;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=e,this._canvasElementClientSize=Ot({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=t??(function(a){return a}),this._allowResizeObserver=(r=n==null?void 0:n.allowResizeObserver)!==null&&r!==void 0?r:!0,this._chooseAndInitObserver()}return s.prototype.dispose=function(){var e,t;if(this._canvasElement===null)throw new Error("Object is disposed");(e=this._canvasElementResizeObserver)===null||e===void 0||e.disconnect(),this._canvasElementResizeObserver=null,(t=this._devicePixelRatioObservable)===null||t===void 0||t.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(s.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"bitmapSize",{get:function(){return Ot({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),s.prototype.resizeCanvasElement=function(e){this._canvasElementClientSize=Ot(e),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},s.prototype.subscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners.push(e)},s.prototype.unsubscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(t){return t!==e})},Object.defineProperty(s.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),s.prototype.subscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners.push(e)},s.prototype.unsubscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(t){return t!==e})},s.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var e=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(e),this._emitSuggestedBitmapSizeChanged(e,this._suggestedBitmapSize)}},s.prototype._resizeBitmap=function(e){var t=this.bitmapSize;Sr(t,e)||(this.canvasElement.width=e.width,this.canvasElement.height=e.height,this._emitBitmapSizeChanged(t,e))},s.prototype._emitBitmapSizeChanged=function(e,t){var n=this;this._bitmapSizeChangedListeners.forEach(function(r){return r.call(n,e,t)})},s.prototype._suggestNewBitmapSize=function(e){var t=this._suggestedBitmapSize,n=Ot(this._transformBitmapSize(e,this._canvasElementClientSize)),r=Sr(this.bitmapSize,n)?null:n;t===null&&r===null||t!==null&&r!==null&&Sr(t,r)||(this._suggestedBitmapSize=r,this._emitSuggestedBitmapSizeChanged(t,r))},s.prototype._emitSuggestedBitmapSizeChanged=function(e,t){var n=this;
4193this._suggestedBitmapSizeChangedListeners.forEach(function(r){return r.call(n,e,t)})},s.prototype._chooseAndInitObserver=function(){var e=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}jT().then(function(t){return t?e._initResizeObserver():e._initDevicePixelRatioObservable()})},s.prototype._initDevicePixelRatioObservable=function(){var e=this;if(this._canvasElement!==null){var t=Yv(this._canvasElement);if(t===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=qT(t),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},s.prototype._invalidateBitmapSize=function(){var e,t;if(this._canvasElement!==null){var n=Yv(this._canvasElement);if(n!==null){var r=(t=(e=this._devicePixelRatioObservable)===null||e===void 0?void 0:e.value)!==null&&t!==void 0?t:n.devicePixelRatio,a=this._canvasElement.getClientRects(),u=a[0]!==void 0?QT(a[0],r):Ot({width:this._canvasElementClientSize.width*r,height:this._canvasElementClientSize.height*r});this._suggestNewBitmapSize(u)}}},s.prototype._initResizeObserver=function(){var e=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(t){var n=t.find(function(u){return u.target===e._canvasElement});if(!(!n||!n.devicePixelContentBoxSize||!n.devicePixelContentBoxSize[0])){var r=n.devicePixelContentBoxSize[0],a=Ot({width:r.inlineSize,height:r.blockSize});e._suggestNewBitmapSize(a)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},s})();function KT(s,e){return new YT(s,e.transform,e.options)}function Yv(s){return s.ownerDocument.defaultView}function jT(){return new Promise(function(s){var e=new ResizeObserver(function(t){s(t.every(function(n){return"devicePixelContentBoxSize"in n})),e.disconnect()});e.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function QT(s,e){return Ot({width:Math.round(s.left*e+s.width*e)-Math.round(s.left*e),height:Math.round(s.top*e+s.height*e)-Math.round(s.top*e)})}var ZT=(function(){function s(e,t,n){if(t.width===0||t.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=t,n.width===0||n.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=n,this._context=e}return s.prototype.useMediaCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),e({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},s.prototype.useBitmapCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),e({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(s.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),s})();function wr(s,e){var t=s.canvasElementClientSize;if(t.width===0||t.height===0)return null;var n=s.bitmapSize;if(n.width===0||n.height===0)return null;var r=s.canvasElement.getContext("2d",e);return r===null?null:new ZT(r,t,n)}/*!
4194 * @license
4195 * TradingView Lightweight Charts™ v5.2.0
4196 * Copyright (c) 2026 TradingView, Inc.
4197 * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
4198 */const G_={title:"",visible:!0,hitTestTolerance:3,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};var Kv,jv;function Xs(s,e){const t=(function(n,r){switch(n){case 0:default:return[];case 1:return[r,r];case 2:return[2*r,2*r];case 3:return[6*r,6*r];case 4:return[r,4*r]}})(e,s.lineWidth);return s.setLineDash(t),t}function W_(s,e,t,n){s.beginPath();const r=s.lineWidth%2?.5:0;s.moveTo(t,e+r),s.lineTo(n,e+r),s.stroke()}function yn(s,e){if(!s)throw new Error("Assertion failed"+(e?": "+e:""))}function Yn(s){if(s===void 0)throw new Error("Value is undefined");return s}function we(s){if(s===null)throw new Error("Value is null");return s}function Gs(s){return we(Yn(s))}(function(s){s[s.Simple=0]="Simple",s[s.WithSteps=1]="WithSteps",s[s.Curved=2]="Curved"})(Kv||(Kv={})),(function(s){s[s.Solid=0]="Solid",s[s.Dotted=1]="Dotted",s[s.Dashed=2]="Dashed",s[s.LargeDashed=3]="LargeDashed",s[s.SparseDotted=4]="SparseDotted"})(jv||(jv={}));class tn{constructor(){this.t=[]}i(e,t,n){const r={h:e,l:t,o:n===!0};this.t.push(r)}_(e){const t=this.t.findIndex((n=>e===n.h));t>-1&&this.t.splice(t,1)}u(e){this.t=this.t.filter((t=>t.l!==e))}
vendor: 10,350 bytes, line 4198
4198p(e,t,n){const r=[...this.t];this.t=this.t.filter((a=>!a.o)),r.forEach((a=>a.h(e,t,n)))}v(){return this.t.length>0}m(){this.t=[]}}function ii(s,...e){for(const t of e)for(const n in t)t[n]!==void 0&&Object.prototype.hasOwnProperty.call(t,n)&&!["__proto__","constructor","prototype"].includes(n)&&(typeof t[n]!="object"||s[n]===void 0||Array.isArray(t[n])?s[n]=t[n]:ii(s[n],t[n]));return s}function No(s){return typeof s=="number"&&isFinite(s)}function ka(s){return typeof s=="number"&&s%1==0}function Ga(s){return typeof s=="string"}function gu(s){return typeof s=="boolean"}function ls(s){const e=s;if(!e||typeof e!="object")return e;let t,n,r;for(n in t=Array.isArray(e)?[]:{},e)e.hasOwnProperty(n)&&(r=e[n],t[n]=r&&typeof r=="object"?ls(r):r);return t}function Qv(s){return s!==null}function Id(s){return s===null?void 0:s}const X_="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function Vu(s,e,t){return e===void 0&&(e=X_),`${t=t!==void 0?`${t} `:""}${s}px ${e}`}class JT{constructor(e){this.M={S:1,C:5,k:NaN,P:"",T:"",R:"",D:"",I:0,V:0,B:0,A:0,L:0},this.O=e}N(){const e=this.M,t=this.F(),n=this.W();return e.k===t&&e.T===n||(e.k=t,e.T=n,e.P=Vu(t,n),e.A=2.5/12*t,e.I=e.A,e.V=t/12*e.C,e.B=t/12*e.C,e.L=0),e.R=this.H(),e.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}}function Ef(s){return s<0?0:s>255?255:Math.round(s)||0}function Zv(s){return .199*s[0]+.687*s[1]+.114*s[2]}class eC{constructor(e,t){this.j=new Map,this.q=e,t&&(this.j=t)}Y(e,t){if(e==="transparent")return e;const n=this.K(e),r=n[3];return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t*r})`}Z(e){const t=this.K(e);return{G:`rgb(${t[0]}, ${t[1]}, ${t[2]})`,X:Zv(t)>160?"black":"white"}}J(e){return Zv(this.K(e))}tt(e,t,n){const[r,a,u,c]=this.K(e),[h,d,p,m]=this.K(t),v=[Ef(r+n*(h-r)),Ef(a+n*(d-a)),Ef(u+n*(p-u)),(x=c+n*(m-c),x<=0||x>1?Math.min(Math.max(x,0),1):Math.round(1e4*x)/1e4)];var x;return`rgba(${v[0]}, ${v[1]}, ${v[2]}, ${v[3]})`}K(e){const t=this.j.get(e);if(t)return t;const n=(function(u){const c=document.createElement("div");c.style.display="none",document.body.appendChild(c),c.style.color=u;const h=window.getComputedStyle(c).color;return document.body.removeChild(c),h})(e),r=n.match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!r){if(this.q.length)for(const u of this.q){const c=u(e);if(c)return this.j.set(e,c),c}throw new Error(`Failed to parse color: ${e}`)}const a=[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),r[4]?parseFloat(r[4]):1];return this.j.set(e,a),a}}class $_{constructor(){this.it=[]}nt(e){this.it=e}st(e,t,n){this.it.forEach((r=>{r.st(e,t,n)}))}}class Rr{st(e,t,n){e.useBitmapCoordinateSpace((r=>this.et(r,t,n)))}}class tC extends Rr{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){if(this.rt===null||this.rt.lt===null)return;const r=this.rt.lt,a=this.rt,u=Math.max(1,Math.floor(t))%2/2,c=h=>{e.beginPath();for(let d=r.to-1;d>=r.from;--d){const p=a.ot[d],m=Math.round(p._t*t)+u,v=p.ut*n,x=h*n+u;e.moveTo(m,v),e.arc(m,v,x,0,2*Math.PI)}e.fill()};a.ct>0&&(e.fillStyle=a.dt,c(a.ft+a.ct)),e.fillStyle=a.vt,c(a.ft)}}function nC(){return{ot:[{_t:0,ut:0,wt:0,Mt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}const iC={from:0,to:1};class sC{constructor(e,t,n){this.gt=new $_,this.bt=[],this.St=[],this.xt=!0,this.O=e,this.Ct=t,this.yt=n,this.gt.nt(this.bt)}kt(e){this.Pt(),this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.gt}Pt(){const e=this.yt.Dt();e.length!==this.bt.length&&(this.St=e.map(nC),this.bt=this.St.map((t=>{const n=new tC;return n.ht(t),n})),this.gt.nt(this.bt))}Rt(){const e=this.Ct.N().mode===2||!this.Ct.It(),t=this.yt.Vt(),n=this.Ct.Bt(),r=this.O.Et();this.Pt(),t.forEach(((a,u)=>{const c=this.St[u],h=a.At(n),d=a.Lt();!e&&h!==null&&a.It()&&d!==null?(c.vt=h.zt,c.ft=h.ft,c.ct=h.Ot,c.ot[0].Mt=h.Mt,c.ot[0].ut=a.Ft().Nt(h.Mt,d.Wt),c.dt=h.Ht??this.O.Ut(c.ot[0].ut/a.Ft().$t()),c.ot[0].wt=n,c.ot[0]._t=r.jt(n),c.lt=iC):c.lt=null}))}}class rC extends Rr{constructor(e){super(),this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null)return;const a=this.qt.Yt.It,u=this.qt.Kt.It;if(!a&&!u)return;const c=Math.round(this.qt._t*n),h=Math.round(this.qt.ut*r);e.lineCap="butt",a&&c>=0&&(e.lineWidth=Math.floor(this.qt.Yt.ct*n),e.strokeStyle=this.qt.Yt.R,e.fillStyle=this.qt.Yt.R,Xs(e,this.qt.Yt.Zt),(function(d,p,m,v){d.beginPath();const x=d.lineWidth%2?.5:0;d.moveTo(p+x,m),d.lineTo(p+x,v),d.stroke()})(e,c,0,t.height)),u&&h>=0&&(e.lineWidth=Math.floor(this.qt.Kt.ct*r),e.strokeStyle=this.qt.Kt.R,e.fillStyle=this.qt.Kt.R,Xs(e,this.qt.Kt.Zt),W_(e,h,0,t.width))}}class oC{constructor(e,t){this.xt=!0,this.Gt={Yt:{ct:1,Zt:0,R:"",It:!1},Kt:{ct:1,Zt:0,R:"",It:!1},_t:0,ut:0},this.Xt=new rC(this.Gt),this.Jt=e,this.yt=t}kt(){this.xt=!0}Tt(e){return this.xt&&(this.Rt(),this.xt=!1),this.Xt}Rt(){const e=this.Jt.It(),t=this.yt.Qt().N().crosshair,n=this.Gt;if(t.mode===2)return n.Kt.It=!1,void(n.Yt.It=!1);n.Kt.It=e&&this.Jt.ti(this.yt),n.Yt.It=e&&this.Jt.ii(),n.Kt.ct=t.horzLine.width,n.Kt.Zt=t.horzLine.style,n.Kt.R=t.horzLine.color,n.Yt.ct=t.vertLine.width,n.Yt.Zt=t.vertLine.style,n.Yt.R=t.vertLine.color,n._t=this.Jt.ni(),n.ut=this.Jt.si()}}function ec(s,e,t,n,r,a){s.save(),s.globalCompositeOperation="copy",s.fillStyle=a,s.fillRect(e,t,n,r),s.restore()}function Jv(s,e,t,n,r,a){s.beginPath(),s.roundRect?s.roundRect(e,t,n,r,a):(s.lineTo(e+n-a[1],t),a[1]!==0&&s.arcTo(e+n,t,e+n,t+a[1],a[1]),s.lineTo(e+n,t+r-a[2]),a[2]!==0&&s.arcTo(e+n,t+r,e+n-a[2],t+r,a[2]),s.lineTo(e+a[3],t+r),a[3]!==0&&s.arcTo(e,t+r,e,t+r-a[3],a[3]),s.lineTo(e,t+a[0]),a[0]!==0&&s.arcTo(e,t,e+a[0],t,a[0]))}function e0(s,e,t,n,r,a,u=0,c=[0,0,0,0],h=""){if(s.save(),!u||!h||h===a)return Jv(s,e,t,n,r,c),s.fillStyle=a,s.fill(),void s.restore();const d=u/2;var p;Jv(s,e+d,t+d,n-u,r-u,(p=-d,c.map((m=>m===0?m:m+p)))),a!=="transparent"&&(s.fillStyle=a,s.fill()),h!=="transparent"&&(s.lineWidth=u,s.strokeStyle=h,s.closePath(),s.stroke()),s.restore()}function q_(s,e,t,n,r,a,u){s.save(),s.globalCompositeOperation="copy";const c=s.createLinearGradient(0,0,0,r);c.addColorStop(0,a),c.addColorStop(1,u),s.fillStyle=c,s.fillRect(e,t,n,r),s.restore()}class t0{constructor(e,t){this.ht(e,t)}ht(e,t){this.qt=e,this.ei=t}$t(e,t){return this.qt.It?e.k+e.A+e.I:0}st(e,t,n,r){if(!this.qt.It||this.qt.ri.length===0)return;const a=this.qt.R,u=this.ei.G,c=e.useBitmapCoordinateSpace((h=>{const d=h.context;d.font=t.P;const p=this.hi(h,t,n,r),m=p.ai;return p.li?e0(d,m.oi,m._i,m.ui,m.ci,u,m.di,[m.ft,0,0,m.ft],u):e0(d,m.fi,m._i,m.ui,m.ci,u,m.di,[0,m.ft,m.ft,0],u),this.qt.pi&&(d.fillStyle=a,d.fillRect(m.fi,m.mi,m.wi-m.fi,m.Mi)),this.qt.gi&&(d.fillStyle=t.D,d.fillRect(p.li?m.bi-m.di:0,m._i,m.di,m.Si-m._i)),p}));e.useMediaCoordinateSpace((({context:h})=>{const d=c.xi;h.font=t.P,h.textAlign=c.li?"right":"left",h.textBaseline="middle",h.fillStyle=a,h.fillText(this.qt.ri,d.Ci,(d._i+d.Si)/2+d.yi)}))}hi(e,t,n,r){const{context:a,bitmapSize:u,mediaSize:c,horizontalPixelRatio:h,verticalPixelRatio:d}=e,p=this.qt.pi||!this.qt.ki?t.C:0,m=this.qt.Pi?t.S:0,v=t.A+this.ei.Ti,x=t.I+this.ei.Ri,M=t.V,b=t.B,y=this.qt.ri,S=t.k,P=n.Di(a,y),U=Math.ceil(n.Ii(a,y)),T=S+v+x,N=t.S+M+b+U+p,R=Math.max(1,Math.floor(d));let F=Math.round(T*d);F%2!=R%2&&(F+=1);const w=m>0?Math.max(1,Math.floor(m*h)):0,L=Math.round(N*h),z=Math.round(p*h),B=this.ei.Vi??this.ei.Bi??this.ei.Ei,G=Math.round(B*d)-Math.floor(.5*d),J=Math.floor(G+R/2-F/2),oe=J+F,Y=r==="right",ie=Y?c.width-m:m,K=Y?u.width-w:w;let $,le,ue;return Y?($=K-L,le=K-z,ue=ie-p-M-m):($=K+L,le=K+z,ue=ie+p+M),{li:Y,ai:{_i:J,mi:G,Si:oe,ui:L,ci:F,ft:2*h,di:w,oi:$,fi:K,wi:le,Mi:R,bi:u.width},xi:{_i:J/d,Si:oe/d,Ci:ue,yi:P}}}}class tc{constructor(e){this.Ai={Ei:0,G:"#000",Ri:0,Ti:0},this.Li={ri:"",It:!1,pi:!0,ki:!1,Ht:"",R:"#FFF",gi:!1,Pi:!1},this.zi={ri:"",It:!1,pi:!1,ki:!0,Ht:"",R:"#FFF",gi:!0,Pi:!0},this.xt=!0,this.Oi=new(e||t0)(this.Li,this.Ai),this.Ni=new(e||t0)(this.zi,this.Ai)}ri(){return this.Fi(),this.Li.ri}Ei(){return this.Fi(),this.Ai.Ei}kt(){this.xt=!0}$t(e,t=!1){return Math.max(this.Oi.$t(e,t),this.Ni.$t(e,t))}Wi(){return this.Ai.Vi??null}Hi(){return this.Ai.Vi??this.Ai.Bi??this.Ei()}Ui(e){this.Ai.Bi=e??void 0}$i(){return this.Fi(),this.Li.It||this.zi.It}ji(){return this.Fi(),this.Li.It}Tt(e){return this.Fi(),this.Li.pi=this.Li.pi&&e.N().ticksVisible,this.zi.pi=this.zi.pi&&e.N().ticksVisible,this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Oi}qi(){return this.Fi(),this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Ni}Fi(){this.xt&&(this.Li.pi=!0,this.zi.pi=!1,this.Yi(this.Li,this.zi,this.Ai))}}class aC extends tc{constructor(e,t,n){super(),this.Jt=e,this.Ki=t,this.Zi=n}Yi(e,t,n){if(e.It=!1,this.Jt.N().mode===2)return;const r=this.Jt.N().horzLine;if(!r.labelVisible)return;const a=this.Ki.Lt();if(!this.Jt.It()||this.Ki.Gi()||a===null)return;const u=this.Ki.Xi().Z(r.labelBackgroundColor);n.G=u.G,e.R=u.X;const c=2/12*this.Ki.k();n.Ti=c,n.Ri=c;const h=this.Zi(this.Ki);n.Ei=h.Ei,e.ri=this.Ki.Ji(h.Mt,a),e.It=!0}}const lC=/[1-9]/g;class Y_{constructor(){this.qt=null}ht(e){this.qt=e}st(e,t){if(this.qt===null||this.qt.It===!1||this.qt.ri.length===0)return;const n=e.useMediaCoordinateSpace((({context:v})=>(v.font=t.P,Math.round(t.Qi.Ii(v,we(this.qt).ri,lC)))));if(n<=0)return;const r=t.tn,a=n+2*r,u=a/2,c=this.qt.nn;let h=this.qt.Ei,d=Math.floor(h-u)+.5;d<0?(h+=Math.abs(0-d),d=Math.floor(h-u)+.5):d+a>c&&(h-=Math.abs(c-(d+a)),d=Math.floor(h-u)+.5);const p=d+a,m=Math.ceil(0+t.S+t.C+t.A+t.k+t.I);e.useBitmapCoordinateSpace((({context:v,horizontalPixelRatio:x,verticalPixelRatio:M})=>{const b=we(this.qt);v.fillStyle=b.G;const y=Math.round(d*x),S=Math.round(0*M),P=Math.round(p*x),U=Math.round(m*M),T=Math.round(2*x);if(v.beginPath(),v.moveTo(y,S),v.lineTo(y,U-T),v.arcTo(y,U,y+T,U,T),v.lineTo(P-T,U),v.arcTo(P,U,P,U-T,T),v.lineTo(P,S),v.fill(),b.pi){const N=Math.round(b.Ei*x),R=S,F=Math.round((R+t.C)*M);v.fillStyle=b.R;const w=Math.max(1,Math.floor(x)),L=Math.floor(.5*x);v.fillRect(N-L,R,w,F-R)}})),e.useMediaCoordinateSpace((({context:v})=>{const x=we(this.qt),M=0+t.S+t.C+t.A+t.k/2;v.font=t.P,v.textAlign="left",v.textBaseline="middle",v.fillStyle=x.R;const b=t.Qi.Di(v,"Apr0");v.translate(d+r,M+b),v.fillText(x.ri,0,0)}))}}
4198class uC{constructor(e,t,n){this.xt=!0,this.Xt=new Y_,this.Gt={It:!1,G:"#4c525e",R:"white",ri:"",nn:0,Ei:NaN,pi:!0},this.Ct=e,this.sn=t,this.Zi=n}kt(){this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.Xt.ht(this.Gt),this.Xt}Rt(){const e=this.Gt;if(e.It=!1,this.Ct.N().mode===2)return;const t=this.Ct.N().vertLine;if(!t.labelVisible)return;const n=this.sn.Et();if(n.Gi())return;e.nn=n.nn();const r=this.Zi();if(r===null)return;e.Ei=r.Ei;const a=n.en(this.Ct.Bt());e.ri=n.rn(we(a)),e.It=!0;const u=this.sn.Xi().Z(t.labelBackgroundColor);e.G=u.G,e.R=u.X,e.pi=n.N().ticksVisible}}class K_{constructor(){this.hn=null,this.an=0}ln(){return this.an}_n(e){this.an=e}Ft(){return this.hn}un(e){this.hn=e}cn(e){return[]}dn(){return[]}It(){return!0}}var n0;(function(s){s[s.Normal=0]="Normal",s[s.Magnet=1]="Magnet",s[s.Hidden=2]="Hidden",s[s.MagnetOHLC=3]="MagnetOHLC"})(n0||(n0={}));class cC extends K_{constructor(e,t){super(),this.yt=null,this.fn=NaN,this.pn=0,this.vn=!1,this.mn=new Map,this.wn=!1,this.Mn=new WeakMap,this.gn=new WeakMap,this.bn=NaN,this.Sn=NaN,this.xn=NaN,this.Cn=NaN,this.sn=e,this.yn=t,this.kn=((r,a)=>u=>{const c=a(),h=r();if(u===we(this.yt).Pn())return{Mt:h,Ei:c};{const d=we(u.Lt());return{Mt:u.Tn(c,d),Ei:c}}})((()=>this.fn),(()=>this.Sn));const n=((r,a)=>()=>{const u=this.sn.Et().Rn(r()),c=a();return u&&Number.isFinite(c)?{wt:u,Ei:c}:null})((()=>this.pn),(()=>this.ni()));this.Dn=new uC(this,e,n)}N(){return this.yn}In(e,t){this.xn=e,this.Cn=t}Vn(){this.xn=NaN,this.Cn=NaN}Bn(){return this.xn}En(){return this.Cn}An(e,t,n){this.wn||(this.wn=!0),this.vn=!0,this.Ln(e,t,n)}Bt(){return this.pn}ni(){return this.bn}si(){return this.Sn}It(){return this.vn}zn(){this.vn=!1,this.On(),this.fn=NaN,this.bn=NaN,this.Sn=NaN,this.yt=null,this.Vn(),this.Nn()}Fn(e){if(!this.yn.doNotSnapToHiddenSeriesIndices)return e;const t=this.sn,n=t.Et();let r=null,a=null;for(const d of t.Wn()){const p=d.Un().Hn(e,-1);if(p){if(p.$n===e)return e;(r===null||p.$n>r)&&(r=p.$n)}const m=d.Un().Hn(e,1);if(m){if(m.$n===e)return e;(a===null||m.$n<a)&&(a=m.$n)}}const u=[r,a].filter(Qv);if(u.length===0)return e;const c=n.jt(e),h=u.map((d=>Math.abs(c-n.jt(d))));return u[h.indexOf(Math.min(...h))]}jn(e){let t=this.Mn.get(e);t||(t=new oC(this,e),this.Mn.set(e,t));let n=this.gn.get(e);return n||(n=new sC(this.sn,this,e),this.gn.set(e,n)),[t,n]}ti(e){return e===this.yt&&this.yn.horzLine.visible}ii(){return this.yn.vertLine.visible}qn(e,t){this.vn&&this.yt===e||this.mn.clear();const n=[];return this.yt===e&&n.push(this.Yn(this.mn,t,this.kn)),n}dn(){return this.vn?[this.Dn]:[]}Kn(){return this.yt}Nn(){this.sn.Zn().forEach((e=>{var t,n;(t=this.Mn.get(e))==null||t.kt(),(n=this.gn.get(e))==null||n.kt()}
vendor: 5,441 bytes, line 4198
4198)),this.mn.forEach((e=>e.kt())),this.Dn.kt()}Gn(e){return e&&!e.Pn().Gi()?e.Pn():null}Ln(e,t,n){this.Xn(e,t,n)&&this.Nn()}Xn(e,t,n){const r=this.bn,a=this.Sn,u=this.fn,c=this.pn,h=this.yt,d=this.Gn(n);this.pn=e,this.bn=isNaN(e)?NaN:this.sn.Et().jt(e),this.yt=n;const p=d!==null?d.Lt():null;return d!==null&&p!==null?(this.fn=t,this.Sn=d.Nt(t,p)):(this.fn=NaN,this.Sn=NaN),r!==this.bn||a!==this.Sn||c!==this.pn||u!==this.fn||h!==this.yt}On(){const e=this.sn.Jn().map((n=>n.Un().Qn())).filter(Qv),t=e.length===0?null:Math.max(...e);this.pn=t!==null?t:NaN}Yn(e,t,n){let r=e.get(t);return r===void 0&&(r=new aC(this,t,n),e.set(t,r)),r}}function nc(s){return s==="left"||s==="right"}class Sn{constructor(e){this.ts=new Map,this.ns=[],this.ss=e}es(e,t){const n=(function(r,a){return r===void 0?a:{rs:Math.max(r.rs,a.rs),hs:r.hs||a.hs}})(this.ts.get(e),t);this.ts.set(e,n)}ls(){return this.ss}_s(e){const t=this.ts.get(e);return t===void 0?{rs:this.ss}:{rs:Math.max(this.ss,t.rs),hs:t.hs}}us(){this.cs(),this.ns=[{ds:0}]}fs(e){this.cs(),this.ns=[{ds:1,Wt:e}]}ps(e){this.vs(),this.ns.push({ds:5,Wt:e})}cs(){this.vs(),this.ns.push({ds:6})}ws(){this.cs(),this.ns=[{ds:4}]}Ms(e){this.cs(),this.ns.push({ds:2,Wt:e})}gs(e){this.cs(),this.ns.push({ds:3,Wt:e})}bs(){return this.ns}Ss(e){for(const t of e.ns)this.xs(t);this.ss=Math.max(this.ss,e.ss),e.ts.forEach(((t,n)=>{this.es(n,t)}))}static Cs(){return new Sn(2)}static ys(){return new Sn(3)}xs(e){switch(e.ds){case 0:this.us();break;case 1:this.fs(e.Wt);break;case 2:this.Ms(e.Wt);break;case 3:this.gs(e.Wt);break;case 4:this.ws();break;case 5:this.ps(e.Wt);break;case 6:this.vs()}}vs(){const e=this.ns.findIndex((t=>t.ds===5));e!==-1&&this.ns.splice(e,1)}}class j_{formatTickmarks(e){return e.map((t=>this.format(t)))}}const i0=".";function us(s,e){if(!No(s))return"n/a";if(!ka(e))throw new TypeError("invalid length");if(e<0||e>16)throw new TypeError("invalid length");return e===0?s.toString():("0000000000000000"+s.toString()).slice(-e)}class ic extends j_{constructor(e,t){if(super(),t||(t=1),No(e)&&ka(e)||(e=100),e<0)throw new TypeError("invalid base");this.Ki=e,this.ks=t,this.Ps()}format(e){const t=e<0?"−":"";return e=Math.abs(e),t+this.Ts(e)}Ps(){if(this.Rs=0,this.Ki>0&&this.ks>0){let e=this.Ki;for(;e>1;)e/=10,this.Rs++}}Ts(e){const t=this.Ki/this.ks;let n=Math.floor(e),r="";const a=this.Rs!==void 0?this.Rs:NaN;if(t>1){let u=+(Math.round(e*t)-n*t).toFixed(this.Rs);u>=t&&(u-=t,n+=1),r=i0+us(+u.toFixed(this.Rs)*this.ks,a)}else n=Math.round(n*t)/t,a>0&&(r=i0+us(0,a));return n.toFixed(0)+r}}class Q_ extends ic{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}}class hC extends j_{constructor(e){super(),this.Ds=e}format(e){let t="";return e<0&&(t="-",e=-e),e<995?t+this.Is(e):e<999995?t+this.Is(e/1e3)+"K":e<999999995?(e=1e3*Math.round(e/1e3),t+this.Is(e/1e6)+"M"):(e=1e6*Math.round(e/1e6),t+this.Is(e/1e9)+"B")}Is(e){let t;const n=Math.pow(10,this.Ds);return t=(e=Math.round(e*n)/n)>=1e-15&&e<1?e.toFixed(this.Ds).replace(/\.?0+$/,""):String(e),t.replace(/(\.[1-9]*)0+$/,((r,a)=>a))}}const fC=/[2-9]/g;class Hu{constructor(e=50){this.Vs=0,this.Bs=1,this.Es=1,this.As={},this.Ls=new Map,this.zs=e}Os(){this.Vs=0,this.Ls.clear(),this.Bs=1,this.Es=1,this.As={}}Ii(e,t,n){return this.Ns(e,t,n).width}Di(e,t,n){const r=this.Ns(e,t,n);return((r.actualBoundingBoxAscent||0)-(r.actualBoundingBoxDescent||0))/2}Ns(e,t,n){const r=n||fC,a=String(t).replace(r,"0");if(this.Ls.has(a))return Yn(this.Ls.get(a)).Fs;if(this.Vs===this.zs){const c=this.As[this.Es];delete this.As[this.Es],this.Ls.delete(c),this.Es++,this.Vs--}e.save(),e.textBaseline="middle";const u=e.measureText(a);return e.restore(),u.width===0&&t.length||(this.Ls.set(a,{Fs:u,Ws:this.Bs}),this.As[this.Bs]=a,this.Vs++,this.Bs++),u}}class dC{constructor(e){this.Hs=null,this.M=null,this.Us="right",this.$s=e}js(e,t,n){this.Hs=e,this.M=t,this.Us=n}st(e){this.M!==null&&this.Hs!==null&&this.Hs.st(e,this.M,this.$s,this.Us)}}class Z_{constructor(e,t,n){this.qs=e,this.$s=new Hu(50),this.Ys=t,this.O=n,this.F=-1,this.Xt=new dC(this.$s)}Tt(){const e=this.O.Ks(this.Ys);if(e===null)return null;const t=e.Zs(this.Ys)?e.Gs():this.Ys.Ft();if(t===null)return null;const n=e.Xs(t);if(n==="overlay")return null;const r=this.O.Js();return r.k!==this.F&&(this.F=r.k,this.$s.Os()),this.Xt.js(this.qs.qi(),r,n),this.Xt}}class pC extends Rr{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}Qs(e,t){var u;if(!((u=this.qt)!=null&&u.It))return null;const{ut:n,ct:r,te:a}=this.qt;return t>=n-r-7&&t<=n+r+7?{ie:this.qt,ne:Math.abs(t-n),se:2,ee:"price-line",te:a}:null}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null||this.qt.It===!1)return;const a=Math.round(this.qt.ut*r);a<0||a>t.height||(e.lineCap="butt",e.strokeStyle=this.qt.R,e.lineWidth=Math.floor(this.qt.ct*n),Xs(e,this.qt.Zt),W_(e,a,0,t.width))}}class ap{constructor(e){this.re={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Zt:0,It:!1},this.he=new pC,this.xt=!0,this.ae=e,this.le=e.Qt(),this.he.ht(this.re)}kt(){this.xt=!0}Tt(){return this.ae.It()?(this.xt&&(this.oe(),this.xt=!1),this.he):null}}class mC extends ap{constructor(e){super(e)}oe(){this.re.It=!1;const e=this.ae.Ft(),t=e._e()._e;if(t!==2&&t!==3)return;const n=this.ae.N();if(!n.baseLineVisible||!this.ae.It())return;const r=this.ae.Lt();r!==null&&(this.re.It=!0,this.re.ut=e.Nt(r.Wt,r.Wt),this.re.R=n.baseLineColor,this.re.ct=n.baseLineWidth,this.re.Zt=n.baseLineStyle)}
4198}class gC extends Rr{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}ue(){return this.qt}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){const r=this.qt;if(r===null)return;const a=Math.max(1,Math.floor(t)),u=a%2/2,c=Math.round(r.ce.x*t)+u,h=r.ce.y*n;e.fillStyle=r.de,e.beginPath();const d=Math.max(2,1.5*r.fe)*t;e.arc(c,h,d,0,2*Math.PI,!1),e.fill(),e.fillStyle=r.pe,e.beginPath(),e.arc(c,h,r.ft*t,0,2*Math.PI,!1),e.fill(),e.lineWidth=a,e.strokeStyle=r.ve,e.beginPath(),e.arc(c,h,r.ft*t+a/2,0,2*Math.PI,!1),e.stroke()}}const vC=[{me:0,we:.25,Me:4,ge:10,be:.25,Se:0,xe:.4,Ce:.8},{me:.25,we:.525,Me:10,ge:14,be:0,Se:0,xe:.8,Ce:0},{me:.525,we:1,Me:14,ge:14,be:0,Se:0,xe:0,Ce:0}];class _C{constructor(e){this.Xt=new gC,this.xt=!0,this.ye=!0,this.ke=performance.now(),this.Pe=this.ke-1,this.Te=e}Re(){this.Pe=this.ke-1,this.kt()}De(){if(this.kt(),this.Te.N().lastPriceAnimation===2){const e=performance.now(),t=this.Pe-e;if(t>0)return void(t<650&&(this.Pe+=2600));this.ke=e,this.Pe=e+2600}}kt(){this.xt=!0}Ie(){this.ye=!0}It(){return this.Te.N().lastPriceAnimation!==0}Ve(){switch(this.Te.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.Pe}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.ye=!1):this.ye&&(this.Be(),this.ye=!1),this.Xt}Rt(){this.Xt.ht(null);const e=this.Te.Qt().Et(),t=e.Ee(),n=this.Te.Lt();if(t===null||n===null)return;const r=this.Te.Ae(!0);if(r.Le||!t.ze(r.$n))return;const a={x:e.jt(r.$n),y:this.Te.Ft().Nt(r.Mt,n.Wt)},u=r.R,c=this.Te.N().lineWidth,h=this.Oe(this.Ne(),u);this.Xt.ht({de:u,fe:c,pe:h.pe,ve:h.ve,ft:h.ft,ce:a})}Be(){const e=this.Xt.ue();if(e!==null){const t=this.Oe(this.Ne(),e.de);e.pe=t.pe,e.ve=t.ve,e.ft=t.ft}}Ne(){return this.Ve()?performance.now()-this.ke:2599}Fe(e,t,n,r){const a=n+(r-n)*t;return this.Te.Qt().Xi().Y(e,a)}Oe(e,t){const n=e%2600/2600;let r;for(const d of vC)if(n>=d.me&&n<=d.we){r=d;break}yn(r!==void 0,"Last price animation internal logic error");const a=(n-r.me)/(r.we-r.me);return{pe:this.Fe(t,a,r.be,r.Se),ve:this.Fe(t,a,r.xe,r.Ce),ft:(u=a,c=r.Me,h=r.ge,c+(h-c)*u)};var u,c,h}}class xC extends ap{constructor(e){super(e)}oe(){const e=this.re;e.It=!1;const t=this.ae.N();if(!t.priceLineVisible||!this.ae.It())return;const n=this.ae.Ae(t.priceLineSource===0);n.Le||(e.It=!0,e.ut=n.Ei,e.R=this.ae.We(n.R),e.ct=t.priceLineWidth,e.Zt=t.priceLineStyle)}}class SC extends tc{constructor(e){super(),this.Jt=e}Yi(e,t,n){e.It=!1,t.It=!1;const r=this.Jt;if(!r.It())return;
vendor: 6,518 bytes, line 4198
4198const a=r.N(),u=a.lastValueVisible,c=r.He()!=="",h=a.seriesLastValueMode===0,d=r.Ae(!1);if(d.Le)return;u&&(e.ri=this.Ue(d,u,h),e.It=e.ri.length!==0),(c||h)&&(t.ri=this.$e(d,u,c,h),t.It=t.ri.length>0);const p=r.We(d.R),m=this.Jt.Qt().Xi().Z(p);n.G=m.G,n.Ei=d.Ei,t.Ht=r.Qt().Ut(d.Ei/r.Ft().$t()),e.Ht=p,e.R=m.X,t.R=m.X}$e(e,t,n,r){let a="";const u=this.Jt.He();return n&&u.length!==0&&(a+=`${u} `),t&&r&&(a+=this.Jt.Ft().je()?e.qe:e.Ye),a.trim()}Ue(e,t,n){return t?n?this.Jt.Ft().je()?e.Ye:e.qe:e.ri:""}}function s0(s,e,t,n){const r=Number.isFinite(e),a=Number.isFinite(t);return r&&a?s(e,t):r||a?r?e:t:n}class On{constructor(e,t){this.Ke=e,this.Ze=t}Ge(e){return e!==null&&this.Ke===e.Ke&&this.Ze===e.Ze}Xe(){return new On(this.Ke,this.Ze)}Je(){return this.Ke}Qe(){return this.Ze}tr(){return this.Ze-this.Ke}Gi(){return this.Ze===this.Ke||Number.isNaN(this.Ze)||Number.isNaN(this.Ke)}Ss(e){return e===null?this:new On(s0(Math.min,this.Je(),e.Je(),-1/0),s0(Math.max,this.Qe(),e.Qe(),1/0))}ir(e){if(!No(e)||this.Ze-this.Ke===0)return;const t=.5*(this.Ze+this.Ke);let n=this.Ze-t,r=this.Ke-t;n*=e,r*=e,this.Ze=t+n,this.Ke=t+r}nr(e){No(e)&&(this.Ze+=e,this.Ke+=e)}sr(){return{minValue:this.Ke,maxValue:this.Ze}}static er(e){return e===null?null:new On(e.minValue,e.maxValue)}}class Gu{constructor(e,t){this.rr=e,this.hr=t||null}ar(){return this.rr}lr(){return this.hr}sr(){return{priceRange:this.rr===null?null:this.rr.sr(),margins:this.hr||void 0}}static er(e){return e===null?null:new Gu(On.er(e.priceRange),e.margins)}}const yC=[2,4,8,16,32,64,128,256,512],MC="Custom series with conflation reducer must have a priceValueBuilder method";class EC extends ap{constructor(e,t){super(e),this._r=t}oe(){const e=this.re;e.It=!1;const t=this._r.N();if(!this.ae.It()||!t.lineVisible)return;const n=this._r.ur();n!==null&&(e.It=!0,e.ut=n,e.R=t.color,e.ct=t.lineWidth,e.Zt=t.lineStyle,e.te=this._r.N().id)}}class wC extends tc{constructor(e,t){super(),this.Te=e,this._r=t}Yi(e,t,n){e.It=!1,t.It=!1;const r=this._r.N(),a=r.axisLabelVisible,u=r.title!=="",c=this.Te;if(!a||!c.It())return;const h=this._r.ur();if(h===null)return;u&&(t.ri=r.title,t.It=!0),t.Ht=c.Qt().Ut(h/c.Ft().$t()),e.ri=this.cr(r.price),e.It=!0;const d=this.Te.Qt().Xi().Z(r.axisLabelColor||r.color);n.G=d.G;const p=r.axisLabelTextColor||d.X;e.R=p,t.R=p,n.Ei=h}cr(e){const t=this.Te.Lt();return t===null?"":this.Te.Ft().Ji(e,t.Wt)}}class bC{constructor(e,t){this.Te=e,this.yn=t,this.dr=new EC(e,this),this.qs=new wC(e,this),this.pr=new Z_(this.qs,e,e.Qt())}vr(e){ii(this.yn,e),this.kt(),this.Te.Qt().mr()}N(){return this.yn}wr(){return this.dr}Mr(){return this.pr}gr(){return this.qs}kt(){this.dr.kt(),this.qs.kt()}ur(){const e=this.Te,t=e.Ft();if(e.Qt().Et().Gi()||t.Gi())return null;const n=e.Lt();return n===null?null:t.Nt(this.yn.price,n.Wt)}}class TC{constructor(){this.br=new WeakMap}Sr(e,t,n){const r=1/t*n;if(e>=r)return 1;const a=r/e,u=Math.pow(2,Math.floor(Math.log2(a)));return Math.min(u,512)}Cr(e,t,n,r=!1,a){if(e.length===0||t<=1)return e;const u=this.yr(t);if(u<=1)return e;const c=this.kr(e);let h=c.Pr.get(u);return h!==void 0||(h=this.Tr(e,u,n,r,a,c.Pr),c.Pr.set(u,h)),h}Rr(e,t,n,r,a=!1,u){if(n<1||e.length===0)return e;const c=this.kr(e),h=c.Pr.get(n);if(!h)return this.Cr(e,n,r,a,u);const d=this.Dr(e,t,n,h,a,r,u);return c.Pr.set(n,d),d}yr(e){if(e<=2)return 2;for(const t of yC)if(e<=t)return t;return 512}Ir(e){if(e.length===0)return 0;const t=e[0],n=e[e.length-1];return 31*e.length+17*t.$n+13*n.$n}Tr(e,t,n,r=!1,a,u=new Map){if(t===2)return this.Vr(e,2,n,r,a);const c=t/2;let h=u.get(c);return h||(h=this.Tr(e,c,n,r,a,u),u.set(c,h)),this.Br(h,n,r,a)}Vr(e,t,n,r=!1,a){const u=this.Er(e,t,n,r,a);return this.Ar(u,r)}Br(e,t,n=!1,r){const a=this.Er(e,2,t,n,r);return this.Ar(a,n)}Er(e,t,n,r=!1,a){const u=[];for(let c=0;c<e.length;c+=t)if(e.length-c>=t){const h=this.Lr(e[c],e[c+1],n,r,a);h.zr=!1,u.push(h)}else if(u.length===0)u.push(this.Or(e[c],!0));else{const h=u[u.length-1];u[u.length-1]=this.Nr(h,e[c],n,r,a)}return u}Fr(e,t){return(e??1)+(t??1)}Lr(e,t,n,r=!1,a){if(!r||!n||!a){const d=e.Wt[1]>t.Wt[1]?e.Wt[1]:t.Wt[1],p=e.Wt[2]<t.Wt[2]?e.Wt[2]:t.Wt[2];return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:d,Yr:p,Kr:t.Wt[3],Zr:this.Fr(e.Zr,t.Zr),Gr:void 0,zr:!1}}const u=n(this.Xr(e,a),this.Xr(t,a)),c=a(u),h=c.length?c[c.length-1]:0;return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:Math.max(e.Wt[1],h),Yr:Math.min(e.Wt[2],h),Kr:h,Zr:this.Fr(e.Zr,t.Zr),Gr:u,zr:!1}}Nr(e,t,n,r=!1,a){if(!r||!n||!a)return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:e.qr>t.Wt[1]?e.qr:t.Wt[1],Yr:e.Yr<t.Wt[2]?e.Yr:t.Wt[2],Kr:t.Wt[3],Zr:e.Zr+(t.Zr??1),Gr:e.Gr,zr:!1};const u=e.Gr,c=this.Xr(t,a),h=u?{data:u,index:e.Wr,originalTime:e.Ur,time:e.Ur,priceValues:a(u)}:null,d=h?n(h,c):c.data,p=h?a(d):c.priceValues,m=p.length?p[p.length-1]:0;return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:Math.max(e.qr,m),Yr:Math.min(e.Yr,m),Kr:m,Zr:e.Zr+(t.Zr??1),Gr:d,zr:!1}}Jr(e,t,n,r,a,u,c=!1,h){const d=t===r?a:e[t];if(n-t==1)return this.Or(d,!0);const p=t+1===r?a:e[t+1];let m=this.Lr(d,p,u,c,h);for(let v=t+2;v<n;v++){const x=v===r?a:e[v];m=this.Nr(m,x,u,c,h)}return m}Xr(e,t){const n=e.ue??{};return{data:e.ue,index:e.$n,originalTime:e.Qr,time:e.wt,priceValues:t(n)}}th(e,t=!1){const n=t===!0,r=!!e.Gr;return{$n:e.Wr,wt:e.Ur,Qr:e.Ur,Wt:[n?e.Kr:e.jr,e.qr,e.Yr,e.Kr],Zr:e.Zr,ue:n?r?e.Gr:{wt:e.Ur}:void 0}}Ar(e,t=!1){return e.map((n=>this.th(n,t)))}Dr(e,t,n,r,a=!1,u,c){if(r.length===0)return r;const h=e.length-1,d=Math.floor(h/n)*n;if(Math.min(d+n,e.length)-d<n&&e.length>n){const p=e.slice();return p[p.length-1]=t,this.Cr(p,n,u,a,c)}if(Math.floor((h-1)/n)===Math.floor(h/n)||r.length===1){const p=Math.min(d+n,e.length),m=p-d;if(m<=0)return r;const v=m===1?this.Or(d===h?t:e[d],!0):this.Jr(e,d,p,h,t,u,a,c);return r[r.length-1]=this.th(v,a),r}{const p=e.slice();return p[p.length-1]=t,this.Cr(p,n,u,a,c)}}Or(e,t=!1){return{Wr:e.$n,Hr:e.$n,Ur:e.wt,$r:e.wt,jr:e.Wt[0],qr:e.Wt[1],Yr:e.Wt[2],Kr:e.Wt[3],Zr:e.Zr??1,Gr:e.ue,zr:t}}kr(e){const t=this.ih(e),n=this.Ir(e);return t.nh!==n&&(t.Pr.clear(),t.nh=n),t}ih(e){let t=this.br.get(e);return t===void 0&&(t={nh:this.Ir(e),Pr:new Map},this.br.set(e,t)),t}}class CC extends K_{constructor(e){super(),this.sn=e}Qt(){return this.sn}}const AC={Bar:(s,e,t,n)=>{const r=e.upColor,a=e.downColor,u=we(s(t,n)),c=Gs(u.Wt[0])<=Gs(u.Wt[3]);return{sh:u.R??(c?r:a)}},Candlestick:(s,e,t,n)=>{const r=e.upColor,a=e.downColor,u=e.borderUpColor,c=e.borderDownColor,h=e.wickUpColor,d=e.wickDownColor,p=we(s(t,n)),m=Gs(p.Wt[0])<=Gs(p.Wt[3]);
4198return{sh:p.R??(m?r:a),eh:p.Ht??(m?u:c),rh:p.hh??(m?h:d)}},Custom:(s,e,t,n)=>({sh:we(s(t,n)).R??e.color}),Area:(s,e,t,n)=>{const r=we(s(t,n));return{sh:r.vt??e.lineColor,vt:r.vt??e.lineColor,ah:r.ah??e.topColor,oh:r.oh??e.bottomColor}},Baseline:(s,e,t,n)=>{const r=we(s(t,n));return{sh:r.Wt[3]>=e.baseValue.price?e.topLineColor:e.bottomLineColor,_h:r._h??e.topLineColor,uh:r.uh??e.bottomLineColor,dh:r.dh??e.topFillColor1,fh:r.fh??e.topFillColor2,ph:r.ph??e.bottomFillColor1,mh:r.mh??e.bottomFillColor2}},Line:(s,e,t,n)=>{const r=we(s(t,n));return{sh:r.R??e.color,vt:r.R??e.color}},Histogram:(s,e,t,n)=>({sh:we(s(t,n)).R??e.color})};class RC{constructor(e){this.wh=(t,n)=>n!==void 0?n.Wt:this.Te.Un().Mh(t),this.Te=e,this.gh=AC[e.bh()]}Sh(e,t){return this.gh(this.wh,this.Te.N(),e,t)}}function J_(s,e,t,n,r=0,a=e.length){let u=a-r;for(;0<u;){const c=u>>1,h=r+c;n(e[h],t)===s?(r=h+1,u-=c+1):u=c}return r}const br=J_.bind(null,!0),lp=J_.bind(null,!1);var r0;(function(s){s[s.NearestLeft=-1]="NearestLeft",s[s.None=0]="None",s[s.NearestRight=1]="NearestRight"})(r0||(r0={}));const Bs=30;class PC{constructor(){this.xh=[],this.Ch=new Map,this.yh=new Map,this.kh=[]}Ph(){return this.Th()>0?this.xh[this.xh.length-1]:null}Rh(){return this.Th()>0?this.Dh(0):null}Qn(){return this.Th()>0?this.Dh(this.xh.length-1):null}Th(){return this.xh.length}Gi(){return this.Th()===0}ze(e){return this.Ih(e,0)!==null}Mh(e){return this.Hn(e)}Hn(e,t=0){const n=this.Ih(e,t);return n===null?null:{...this.Vh(n),$n:this.Dh(n)}}Bh(){return this.xh}Eh(e,t,n){if(this.Gi())return null;let r=null;for(const a of n)r=vu(r,this.Ah(e,t,a));return r}ht(e){this.yh.clear(),this.Ch.clear(),this.xh=e,this.kh=e.map((t=>t.$n))}Lh(){return this.kh}Dh(e){return this.xh[e].$n}Vh(e){return this.xh[e]}Ih(e,t){const n=this.zh(e);if(n===null&&t!==0)switch(t){case-1:return this.Oh(e);case 1:return this.Nh(e);default:throw new TypeError("Unknown search mode")}return n}Oh(e){let t=this.Fh(e);return t>0&&(t-=1),t!==this.xh.length&&this.Dh(t)<e?t:null}Nh(e){const t=this.Wh(e);return t!==this.xh.length&&e<this.Dh(t)?t:null}zh(e){const t=this.Fh(e);return t===this.xh.length||e<this.xh[t].$n?null:t}Fh(e){return br(this.xh,e,((t,n)=>t.$n<n))}Wh(e){return lp(this.xh,e,((t,n)=>t.$n>n))}Hh(e,t,n){let r=null;for(let a=e;a<t;a++){const u=this.xh[a].Wt[n];Number.isNaN(u)||(r===null?r={Uh:u,$h:u}:(u<r.Uh&&(r.Uh=u),u>r.$h&&(r.$h=u)))}return r}Ah(e,t,n){if(this.Gi())return null;let r=null;const a=we(this.Rh()),u=we(this.Qn()),c=Math.max(e,a),h=Math.min(t,u),d=Math.ceil(c/Bs)*Bs,p=Math.max(d,Math.floor(h/Bs)*Bs);{const v=this.Fh(c),x=this.Wh(Math.min(h,d,t));r=vu(r,this.Hh(v,x,n))}let m=this.Ch.get(n);m===void 0&&(m=new Map,this.Ch.set(n,m));for(let v=Math.max(d+1,c);v<p;v+=Bs){const x=Math.floor(v/Bs);let M=m.get(x);if(M===void 0){const b=this.Fh(x*Bs),y=this.Wh((x+1)*Bs-1);M=this.Hh(b,y,n),m.set(x,M)}r=vu(r,M)}{const v=this.Fh(p),x=this.Wh(h);r=vu(r,this.Hh(v,x,n))}return r}}function vu(s,e){return s===null?e:e===null?s:{Uh:Math.min(s.Uh,e.Uh),$h:Math.max(s.$h,e.$h)}}function wf(){return new PC}const Wu={setLineStyle:Xs};class NC{constructor(e){this.jh=e}st(e,t,n){this.jh.draw(e,Wu)}qh(e,t,n){var r,a;(a=(r=this.jh).drawBackground)==null||a.call(r,e,Wu)}}class LC{constructor(e){this.Ls=null,this.Yh=e}Tt(){var n;const e=this.Yh.renderer();if(e===null)return null;if(((n=this.Ls)==null?void 0:n.Kh)===e)return this.Ls.Zh;const t=new NC(e);return this.Ls={Kh:e,Zh:t},t}Gh(){var e,t;return((t=(e=this.Yh).zOrder)==null?void 0:t.call(e))??"normal"}}class ex{constructor(e){this.Xh=null,this.Jh=e}Qh(){return this.Jh}Nn(){var e,t;(t=(e=this.Jh).updateAllViews)==null||t.call(e)}jn(){var n,r,a;const e=((r=(n=this.Jh).paneViews)==null?void 0:r.call(n))??[];if(((a=this.Xh)==null?void 0:a.Kh)===e)return this.Xh.Zh;const t=e.map((u=>new LC(u)));return this.Xh={Kh:e,Zh:t},t}
4198Qs(e,t){var n,r;return((r=(n=this.Jh).hitTest)==null?void 0:r.call(n,e,t))??null}}let DC=class extends ex{cn(){return[]}};class IC{constructor(e){this.jh=e}st(e,t,n){this.jh.draw(e,Wu)}qh(e,t,n){var r,a;(a=(r=this.jh).drawBackground)==null||a.call(r,e,Wu)}}class o0{constructor(e){this.Ls=null,this.Yh=e}Tt(){var n;const e=this.Yh.renderer();if(e===null)return null;if(((n=this.Ls)==null?void 0:n.Kh)===e)return this.Ls.Zh;const t=new IC(e);return this.Ls={Kh:e,Zh:t},t}Gh(){var e,t;return((t=(e=this.Yh).zOrder)==null?void 0:t.call(e))??"normal"}}function tx(s){var e,t,n;return{ri:s.text(),Ei:s.coordinate(),Vi:(e=s.fixedCoordinate)==null?void 0:e.call(s),R:s.textColor(),G:s.backColor(),It:((t=s.visible)==null?void 0:t.call(s))??!0,pi:((n=s.tickVisible)==null?void 0:n.call(s))??!0}}class UC{constructor(e,t){this.Xt=new Y_,this.ta=e,this.ia=t}Tt(){return this.Xt.ht({nn:this.ia.nn(),...tx(this.ta)}),this.Xt}}class FC extends tc{constructor(e,t){super(),this.ta=e,this.Ki=t}Yi(e,t,n){const r=tx(this.ta);n.G=r.G,e.R=r.R;const a=2/12*this.Ki.k();n.Ti=a,n.Ri=a,n.Ei=r.Ei,n.Vi=r.Vi,e.ri=r.ri,e.It=r.It,e.pi=r.pi}}class OC extends ex{constructor(e,t){super(e),this.na=null,this.sa=null,this.ea=null,this.ra=null,this.Te=t}dn(){var r,a,u;const e=((a=(r=this.Jh).timeAxisViews)==null?void 0:a.call(r))??[];if(((u=this.na)==null?void 0:u.Kh)===e)return this.na.Zh;const t=this.Te.Qt().Et(),n=e.map((c=>new UC(c,t)));return this.na={Kh:e,Zh:n},n}qn(){var r,a,u;const e=((a=(r=this.Jh).priceAxisViews)==null?void 0:a.call(r))??[];if(((u=this.sa)==null?void 0:u.Kh)===e)return this.sa.Zh;const t=this.Te.Ft(),n=e.map((c=>new FC(c,t)));return this.sa={Kh:e,Zh:n},n}ha(){var n,r,a;const e=((r=(n=this.Jh).priceAxisPaneViews)==null?void 0:r.call(n))??[];if(((a=this.ea)==null?void 0:a.Kh)===e)return this.ea.Zh;const t=e.map((u=>new o0(u)));return this.ea={Kh:e,Zh:t},t}aa(){var n,r,a;const e=((r=(n=this.Jh).timeAxisPaneViews)==null?void 0:r.call(n))??[];if(((a=this.ra)==null?void 0:a.Kh)===e)return this.ra.Zh;const t=e.map((u=>new o0(u)));return this.ra={Kh:e,Zh:t},t}la(e,t){var n,r;return((r=(n=this.Jh).autoscaleInfo)==null?void 0:r.call(n,e,t))??null}}function bf(s,e,t,n){s.forEach((r=>{e(r).forEach((a=>{a.Gh()===t&&n.push(a)}))}))}function Tf(s){return s.jn()}function kC(s){return s.ha()}function BC(s){return s.aa()}const zC=["Area","Line","Baseline"];class sc extends CC{constructor(e,t,n,r,a){super(e),this.qt=wf(),this.dr=new xC(this),this.oa=[],this._a=new mC(this),this.ua=null,this.ca=null,this.da=null,this.fa=[],this.pa=new TC,this.va=new Map,this.ma=null,this.yn=n,this.wa=t;const u=new SC(this);if(this.mn=[u],this.pr=new Z_(u,this,e),zC.includes(this.wa)&&(this.ua=new _C(this)),this.Ma(),this.Yh=r(this,this.Qt(),a),this.wa==="Custom"){const c=this.Yh;c.ga&&this.ba(c.ga)}}m(){this.da!==null&&clearTimeout(this.da)}We(e){return this.yn.priceLineColor||e}Ae(e){const t={Le:!0},n=this.Ft();if(this.Qt().Et().Gi()||n.Gi()||this.qt.Gi())return t;const r=this.Qt().Et().Ee(),a=this.Lt();if(r===null||a===null)return t;let u,c;if(e){const m=this.qt.Ph();if(m===null)return t;u=m,c=m.$n}else{const m=this.qt.Hn(r.bi(),-1);if(m===null||(u=this.qt.Mh(m.$n),u===null))return t;c=m.$n}const h=u.Wt[3],d=this.Sa().Sh(c,{Wt:u}),p=n.Nt(h,a.Wt);return{Le:!1,Mt:h,ri:n.Ji(h,a.Wt),qe:n.xa(h),Ye:n.Ca(h,a.Wt),R:d.sh,Ei:p,$n:c}}Sa(){return this.ca!==null||(this.ca=new RC(this)),this.ca}N(){return this.yn}vr(e){const t=this.Qt(),{priceScaleId:n,visible:r,priceFormat:a}=e;n!==void 0&&n!==this.yn.priceScaleId&&t.ya(this,n),r!==void 0&&r!==this.yn.visible&&t.ka();const u=e.conflationThresholdFactor!==void 0;ii(this.yn,e),u&&(this.va.clear(),this.Qt().mr()),a!==void 0&&(this.Ma(),t.Pa()),t.Ta(this),t.Ra(),this.Yh.kt("options")}ht(e,t){this.qt.ht(e),this.va.clear();const n=this.Qt().Et().N();n.enableConflation&&n.precomputeConflationOnInit&&this.Da(n.precomputeConflationPriority),this.Yh.kt("data"),this.ua!==null&&(t&&t.Ia?this.ua.De():e.length===0&&this.ua.Re());const r=this.Qt().Ks(this);this.Qt().Va(r),this.Qt().Ta(this),this.Qt().Ra(),this.Qt().mr()}Ba(e){const t=new bC(this,e);return this.oa.push(t),this.Qt().Ta(this),t}Ea(e){const t=this.oa.indexOf(e);t!==-1&&this.oa.splice(t,1),this.Qt().Ta(this)}Aa(){return this.oa}bh(){return this.wa}Lt(){const e=this.La();return e===null?null:{Wt:e.Wt[3],za:e.wt}}La(){const e=this.Qt().Et().Ee();if(e===null)return null;const t=e.Oa();return this.qt.Hn(t,1)}Un(){return this.qt}ba(e){this.ma=e,this.va.clear()}Na(){return!!this.Qt().Et().N().enableConflation&&this.Fa()>1}Rr(e){if(!this.Na())return;const t=this.Fa();if(!this.va.has(t))return;const n=this.wa==="Custom",r=n&&this.ma||void 0,a=n&&this.Yh.Wa?h=>{const d=h,p=this.Yh.Wa(d);return Array.isArray(p)?p:[typeof p=="number"?p:0]}:void 0,u=this.pa.Rr(this.qt.Bh(),e,t,r,n,a),c=wf();c.ht(u),this.va.set(t,c)}Ha(){const e=this.Qt().Et().N().enableConflation;if(this.wa==="Custom"&&this.ma===null)return this.qt;if(!e)return this.qt;const t=this.Fa(),n=this.va.get(t);return n||(this.Ua(t),this.va.get(t)??this.qt)}$a(e){const t=this.qt.Mh(e);return t===null?null:this.wa==="Bar"||this.wa==="Candlestick"||this.wa==="Custom"?{jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3]}:t.Wt[3]}ja(e){const t=[];bf(this.fa,Tf,"top",t);const n=this.ua;return n!==null&&n.It()&&(this.da===null&&n.Ve()&&(this.da=setTimeout((()=>{this.da=null,this.Qt().qa()}),0)),n.Ie(),t.unshift(n)),t}jn(){const e=[];this.Ya()||e.push(this._a),e.push(this.Yh,this.dr);const t=this.oa.map((n=>n.wr()));return e.push(...t),bf(this.fa,Tf,"normal",e),e}Ka(){return this.Za(Tf,"bottom")}Ga(e){return this.Za(kC,e)}Xa(e){return this.Za(BC,e)}Ja(e,t){return this.fa.map((n=>n.Qs(e,t))).filter((n=>n!==null))}cn(){return[this.pr,...this.oa.map((e=>e.Mr()))]}qn(e,t){if(t!==this.hn&&!this.Ya())return[];const n=[...this.mn];for(const r of this.oa)n.push(r.gr());return this.fa.forEach((r=>{n.push(...r.qn())})),n}dn(){const e=[];return this.fa.forEach((t=>{e.push(...t.dn())})),e}la(e,t){if(this.yn.autoscaleInfoProvider!==void 0){const n=this.yn.autoscaleInfoProvider((()=>{const r=this.Qa(e,t);return r===null?null:r.sr()}));return Gu.er(n)}return this.Qa(e,t)}Kh(){const e=this.yn.priceFormat;return e.base??1/e.minMove}tl(){return this.il}Nn(){var e;this.Yh.kt();for(const t of this.mn)t.kt();for(const t of this.oa)t.kt();this.dr.kt(),this._a.kt(),(e=this.ua)==null||e.kt(),this.fa.forEach((t=>t.Nn()))}Ft(){return we(super.Ft())}At(e){if(!((this.wa==="Line"||this.wa==="Area"||this.wa==="Baseline")&&this.yn.crosshairMarkerVisible))return null;const t=this.qt.Mh(e);return t===null?null:{Mt:t.Wt[3],ft:this.nl(),Ht:this.sl(),Ot:this.el(),zt:this.rl(e)}}He(){return this.yn.title}It(){return this.yn.visible}hl(e){this.fa.push(new OC(e,this))}al(e){this.fa=this.fa.filter((t=>t.Qh()!==e))}ll(){if(this.wa==="Custom")return e=>this.Yh.Wa(e)}ol(){if(this.wa==="Custom")return e=>this.Yh._l(e)}ul(){return this.qt.Lh()}Ya(){return!nc(this.Ft().cl())}Qa(e,t){if(!ka(e)||!ka(t)||this.qt.Gi())return null;const n=this.wa==="Line"||this.wa==="Area"||this.wa==="Baseline"||this.wa==="Histogram"?[3]:[2,1],r=this.qt.Eh(e,t,n
4198);let a=r!==null?new On(r.Uh,r.$h):null,u=null;if(this.bh()==="Histogram"){const c=this.yn.base,h=new On(c,c);a=a!==null?a.Ss(h):h}return this.fa.forEach((c=>{const h=c.la(e,t);if(h!=null&&h.priceRange){const d=new On(h.priceRange.minValue,h.priceRange.maxValue);a=a!==null?a.Ss(d):d}h!=null&&h.margins&&(u=h.margins)})),new Gu(a,u)}nl(){switch(this.wa){case"Line":case"Area":case"Baseline":return this.yn.crosshairMarkerRadius}return 0}sl(){switch(this.wa){case"Line":case"Area":case"Baseline":{const e=this.yn.crosshairMarkerBorderColor;if(e.length!==0)return e}}return null}el(){switch(this.wa){case"Line":case"Area":case"Baseline":return this.yn.crosshairMarkerBorderWidth}return 0}rl(e){switch(this.wa){case"Line":case"Area":case"Baseline":{const t=this.yn.crosshairMarkerBackgroundColor;if(t.length!==0)return t}}return this.Sa().Sh(e).sh}Ma(){switch(this.yn.priceFormat.type){case"custom":{const e=this.yn.priceFormat.formatter;this.il={format:e,formatTickmarks:this.yn.priceFormat.tickmarksFormatter??(t=>t.map(e))};break}case"volume":this.il=new hC(this.yn.priceFormat.precision);break;case"percent":this.il=new Q_(this.yn.priceFormat.precision);break;default:{const e=Math.pow(10,this.yn.priceFormat.precision);this.il=new ic(e,this.yn.priceFormat.minMove*e)}}this.hn!==null&&this.hn.dl()}Za(e,t){const n=[];return bf(this.fa,e,t,n),n}Fa(){const{fl:e,pl:t,vl:n}=this.ml();return this.pa.Sr(e,t,n)}ml(){const e=this.Qt().Et(),t=e.fl(),n=window.devicePixelRatio||1,r=e.N().conflationThresholdFactor;return{fl:t,pl:n,vl:this.yn.conflationThresholdFactor??r??1}}wl(e){const t=this.qt.Bh();let n;if(this.wa==="Custom"&&this.ma!==null){const a=this.ll();if(!a)throw new Error(MC);n=this.pa.Cr(t,e,this.ma,!0,(u=>a(u)))}else n=this.pa.Cr(t,e);const r=wf();return r.ht(n),r}Ua(e){const t=this.wl(e);this.va.set(e,t)}Da(e){var n;if(this.wa==="Custom"&&(this.ma===null||!this.ll()))return;this.va.clear();const t=this.Qt().Et().Ml();for(const r of t){const a=()=>{this.gl(r)},u=typeof window=="object"&&window||typeof self=="object"&&self;(n=u==null?void 0:u.Sl)!=null&&n.bl?u.Sl.bl((()=>{a()}),{se:e}):Promise.resolve().then((()=>a()))}}gl(e){if(this.va.has(e)||this.qt.Bh().length===0)return;const t=this.wl(e);this.va.set(e,t)}}const VC=[3],HC=[0,1,2,3];class GC{constructor(e){this.yn=e}xl(e,t,n){let r=e;if(this.yn.mode===0)return r;const a=n.Pn(),u=a.Lt();if(u===null)return r;const c=a.Nt(e,u),h=n.Cl().filter((p=>p instanceof sc)).reduce(((p,m)=>{if(n.Zs(m)||!m.It())return p;const v=m.Ft(),x=m.Un();if(v.Gi()||!x.ze(t))return p;const M=x.Mh(t);if(M===null)return p;const b=Gs(m.Lt()),y=this.yn.mode===3?HC:VC;return p.concat(y.map((S=>v.Nt(M.Wt[S],b.Wt))))}),[]);if(h.length===0)return r;h.sort(((p,m)=>Math.abs(p-c)-Math.abs(m-c)));const d=h[0];return r=a.Tn(d,u),r}}function bo(s,e,t){return Math.min(Math.max(s,e),t)}function _u(s,e,t){return e-s<=t}class WC extends Rr{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null)return;const a=Math.max(1,Math.floor(n));e.lineWidth=a,(function(u,c){u.save(),u.lineWidth%2&&u.translate(.5,.5),c(),u.restore()})(e,(()=>{const u=we(this.qt);if(u.yl){e.strokeStyle=u.kl,Xs(e,u.Pl),e.beginPath();for(const c of u.Tl){const h=Math.round(c.Rl*n);e.moveTo(h,-a),e.lineTo(h,t.height+a)}e.stroke()}if(u.Dl){e.strokeStyle=u.Il,Xs(e,u.Vl),e.beginPath();for(const c of u.Bl){const h=Math.round(c.Rl*r);e.moveTo(-a,h),e.lineTo(t.width+a,h)}e.stroke()}}))}}class XC{constructor(e){this.Xt=new WC,this.xt=!0,this.yt=e}kt(){this.xt=!0}Tt(){if(this.xt){const e=this.yt.Qt().N().grid,t={Dl:e.horzLines.visible,yl:e.vertLines.visible,Il:e.horzLines.color,kl:e.vertLines.color,Vl:e.horzLines.style,Pl:e.vertLines.style,Bl:this.yt.Pn().El(),Tl:(this.yt.Qt().Et().El()||[]).map((n=>({Rl:n.coord})))};this.Xt.ht(t),this.xt=!1}return this.Xt}}class $C{constructor(e){this.Yh=new XC(e)}wr(){return this.Yh}}const Cf={Al:4,Ll:1e-4};function xo(s,e){const t=100*(s-e)/e;return e<0?-t:t}function qC(s,e){const t=xo(s.Je(),e),n=xo(s.Qe(),e);return new On(t,n)}function Na(s,e){const t=100*(s-e)/e+100;return e<0?-t:t}function YC(s,e){const t=Na(s.Je(),e),n=Na(s.Qe(),e);return new On(t,n)}function Xu(s,e){const t=Math.abs(s);if(t<1e-15)return 0;const n=Math.log10(t+e.Ll)+e.Al;return s<0?-n:n}function La(s,e){const t=Math.abs(s);if(t<1e-15)return 0;const n=Math.pow(10,t-e.Al)-e.Ll;return s<0?-n:n}function Ta(s,e){if(s===null)return null;const t=Xu(s.Je(),e),n=Xu(s.Qe(),e);return new On(t,n)}function So(s,e){if(s===null)return null;const t=La(s.Je(),e),n=La(s.Qe(),e);return new On(t,n)}function Af(s){if(s===null)return Cf;const e=Math.abs(s.Qe()-s.Je());if(e>=1||e<1e-15)return Cf;const t=Math.ceil(Math.abs(Math.log10(e))),n=Cf.Al+t;return{Al:n,Ll:1/Math.pow(10,n)}}class Rf{constructor(e,t){if(this.zl=e,this.Ol=t,(function(n){if(n<0)return!1;if(n>1e18)return!0;for(let r=n;r>1;r/=10)if(r%10!=0)return!1;return!0})(this.zl))this.Nl=[2,2.5,2];else{this.Nl=[];for(let n=this.zl;n!==1;){if(n%2==0)this.Nl.push(2),n/=2;else{if(n%5!=0)throw new Error("unexpected base");this.Nl.push(2,2.5),n/=5}if(this.Nl.length>100)throw new Error("something wrong with base")}}}Fl(e,t,n){const r=this.zl===0?0:1/this.zl;let a=Math.pow(10,Math.max(0,Math.ceil(Math.log10(e-t)))),u=0,c=this.Ol[0];for(;;){const m=_u(a,r,1e-14)&&a>
4198r+1e-14,v=_u(a,n*c,1e-14),x=_u(a,1,1e-14);if(!(m&&v&&x))break;a/=c,c=this.Ol[++u%this.Ol.length]}if(a<=r+1e-14&&(a=r),a=Math.max(1,a),this.Nl.length>0&&(h=a,d=1,p=1e-14,Math.abs(h-d)<p))for(u=0,c=this.Nl[0];_u(a,n*c,1e-14)&&a>r+1e-14;)a/=c,c=this.Nl[++u%this.Nl.length];var h,d,p;return a}}class a0{constructor(e,t,n,r){this.Wl=[],this.Ki=e,this.zl=t,this.Hl=n,this.Ul=r}Fl(e,t){if(e<t)throw new Error("high < low");const n=this.Ki.$t(),r=(e-t)*this.$l()/n,a=new Rf(this.zl,[2,2.5,2]),u=new Rf(this.zl,[2,2,2.5]),c=new Rf(this.zl,[2.5,2,2]),h=[];return h.push(a.Fl(e,t,r),u.Fl(e,t,r),c.Fl(e,t,r)),(function(d){if(d.length<1)throw Error("array is empty");let p=d[0];for(let m=1;m<d.length;++m)d[m]<p&&(p=d[m]);return p})(h)}jl(){const e=this.Ki,t=e.Lt();if(t===null)return void(this.Wl=[]);const n=e.$t(),r=this.Hl(n-1,t),a=this.Hl(0,t),u=this.Ki.N().entireTextOnly?this.ql()/2:0,c=u,h=n-1-u,d=Math.max(r,a),p=Math.min(r,a);if(d===p)return void(this.Wl=[]);const m=this.Fl(d,p);if(this.Yl(t,m,d,p,c,h),e.Kl()&&this.Zl(m,p,d)){const M=this.Ki.Gl();this.Xl(t,m,c,h,M,2*M)}const v=this.Wl.map((M=>M.Jl)),x=this.Ki.Ql(v);for(let M=0;M<this.Wl.length;M++)this.Wl[M].io=x[M]}El(){return this.Wl}ql(){return this.Ki.k()}$l(){return Math.ceil(this.ql()*this.Ki.N().tickMarkDensity)}Yl(e,t,n,r,a,u){const c=this.Wl,h=this.Ki;let d=n%t;d+=d<0?t:0;const p=n>=r?1:-1;let m=null,v=0;for(let x=n-d;x>r;x-=t){const M=this.Ul(x,e,!0);m!==null&&Math.abs(M-m)<this.$l()||M<a||M>u||(v<c.length?(c[v].Rl=M,c[v].io=h.no(x),c[v].Jl=x):c.push({Rl:M,io:h.no(x),Jl:x}),v++,m=M,h.so()&&(t=this.Fl(x*p,r)))}c.length=v}Xl(e,t,n,r,a,u){const c=this.Wl,h=this.eo(e,n,a,u),d=this.eo(e,r,-u,-a),p=this.Ul(0,e,!0)-this.Ul(t,e,!0);c.length>0&&c[0].Rl-h.Rl<p/2&&c.shift(),c.length>0&&d.Rl-c[c.length-1].Rl<p/2&&c.pop(),c.unshift(h),c.push(d)}eo(e,t,n,r){const a=(n+r)/2,u=this.Hl(t+n,e),c=this.Hl(t+r,e),h=Math.min(u,c),d=Math.max(u,c),p=Math.max(.1,this.Fl(d,h)),m=this.Hl(t+a,e),v=m-m%p,x=this.Ul(v,e,!0);return{io:this.Ki.no(v),Rl:x,Jl:v}}Zl(e,t,n){let r=Gs(this.Ki.ar());return this.Ki.so()&&(r=So(r,this.Ki.ro())),r.Je()-t<e&&n-r.Qe()<e}}function nx(s){return s.slice().sort(((e,t)=>we(e.ln())-we(t.ln())))}var $u;(function(s){s[s.Normal=0]="Normal",s[s.Logarithmic=1]="Logarithmic",s[s.Percentage=2]="Percentage",s[s.IndexedTo100=3]="IndexedTo100"})($u||($u={}));const l0=new Q_,u0=new ic(100,1);class KC{constructor(e,t,n,r,a){this.ho=0,this.ao=null,this.rr=null,this.lo=null,this.oo={_o:!1,uo:null},this.co=!1,this.do=0,this.fo=0,this.po=new tn,this.vo=new tn,this.mo=[],this.wo=null,this.Mo=null,this.bo=null,this.So=null,this.xo=null,this.il=u0,this.Co=Af(null),this.yo=e,this.yn=t,this.ko=n,this.Po=r,this.To=a,this.Ro=new a0(this,100,this.Do.bind(this),this.Io.bind(this))}cl(){return this.yo}N(){return this.yn}vr(e){if(ii(this.yn,e),this.dl(),e.mode!==void 0&&this.Vo({_e:e.mode}),e.scaleMargins!==void 0){const t=Yn(e.scaleMargins.top),n=Yn(e.scaleMargins.bottom);if(t<0||t>1)throw new Error(`Invalid top margin - expect value between 0 and 1, given=${t}`);if(n<0||n>1)throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${n}`);if(t+n>1)throw new Error(`Invalid margins - sum of margins must be less than 1, given=${t+n}`);this.Bo(),this.bo=null}}Eo(){return this.yn.autoScale}Ao(){return this.co}so(){return this.yn.mode===1}je(){return this.yn.mode===2}Lo(){return this.yn.mode===3}ro(){return this.Co}_e(){return{hs:this.yn.autoScale,zo:this.yn.invertScale,_e:this.yn.mode}}Vo(e){const t=this._e();let n=null;e.hs!==void 0&&(this.yn.autoScale=e.hs),e._e!==void 0&&(this.yn.mode=e._e,e._e!==2&&e._e!==3||(this.yn.autoScale=!0),this.oo._o=!1),t._e===1&&e._e!==t._e&&((function(a,u){if(a===null)return!1;const c=La(a.Je(),u),h=La(a.Qe(),u);return isFinite(c)&&isFinite(h)})(this.rr,this.Co)?(n=So(this.rr,this.Co),n!==null&&this.Oo(n)):this.yn.autoScale=!0),e._e===1&&e._e!==t._e&&(n=Ta(this.rr,this.Co),n!==null&&this.Oo(n));const r=t._e!==this.yn.mode;r&&(t._e===2||this.je())&&this.dl(),r&&(t._e===3||this.Lo())&&this.dl(),e.zo!==void 0&&t.zo!==e.zo&&(this.yn.invertScale=e.zo,this.No()),this.vo.p(t,this._e())}Fo(){return this.vo}k(){return this.ko.fontSize}$t(){return this.ho}Wo(e){this.ho!==e&&(this.ho=e,this.Bo(),this.bo=null)}Ho(){if(this.ao)return this.ao;const e=this.$t()-this.Uo()-this.$o();return this.ao=e,e}ar(){return this.jo(),this.rr}Oo(e,t){const n=this.rr;(t||n===null&&e!==null||n!==null&&!n.Ge(e))&&(this.bo=null,this.rr=e)}qo(e){this.Oo(e),this.Yo(e!==null)}Gi(){return this.jo(),this.ho===0||!this.rr||this.rr.Gi()}Ko(e){return this.zo()?e:this.$t()-1-e}Nt(e,t){return this.je()?e=xo(e,t):this.Lo()&&(e=Na(e,t)),this.Io(e,t)}Zo(e,t,n){this.jo();const r=this.$o(),a=we(this.ar()),u=a.Je(),c=a.Qe(),h=this.Ho()-1,d=this.zo(),p=h/(c-u),m=n===void 0?0:n.from,v=n===void 0?e.length:n.to,x=this.Go();for(let M=m;M<v;M++){const b=e[M],y=b.Mt;if(isNaN(y))continue;let S=y;x!==null&&(S=x(b.Mt,t));const P=r+p*(S-u),U=d?P:this.ho-1-P;b.ut=U}}
4198Xo(e,t,n){this.jo();const r=this.$o(),a=we(this.ar()),u=a.Je(),c=a.Qe(),h=this.Ho()-1,d=this.zo(),p=h/(c-u),m=n===void 0?0:n.from,v=n===void 0?e.length:n.to,x=this.Go();for(let M=m;M<v;M++){const b=e[M];let y=b.jr,S=b.qr,P=b.Yr,U=b.Kr;x!==null&&(y=x(b.jr,t),S=x(b.qr,t),P=x(b.Yr,t),U=x(b.Kr,t));let T=r+p*(y-u),N=d?T:this.ho-1-T;b.Jo=N,T=r+p*(S-u),N=d?T:this.ho-1-T,b.Qo=N,T=r+p*(P-u),N=d?T:this.ho-1-T,b.t_=N,T=r+p*(U-u),N=d?T:this.ho-1-T,b.i_=N}}Tn(e,t){const n=this.Do(e,t);return this.n_(n,t)}n_(e,t){let n=e;return this.je()?n=(function(r,a){return a<0&&(r=-r),r/100*a+a})(n,t):this.Lo()&&(n=(function(r,a){return r-=100,a<0&&(r=-r),r/100*a+a})(n,t)),n}Cl(){return this.mo}Dt(){return this.Mo||(this.Mo=nx(this.mo)),this.Mo}s_(e){this.mo.indexOf(e)===-1&&(this.mo.push(e),this.dl(),this.e_())}r_(e){const t=this.mo.indexOf(e);if(t===-1)throw new Error("source is not attached to scale");this.mo.splice(t,1),this.mo.length===0&&(this.Vo({hs:!0}),this.Oo(null)),this.dl(),this.e_()}Lt(){let e=null;for(const t of this.mo){const n=t.Lt();n!==null&&(e===null||n.za<e.za)&&(e=n)}return e===null?null:e.Wt}zo(){return this.yn.invertScale}El(){const e=this.Lt()===null;if(this.bo!==null&&(e||this.bo.h_===e))return this.bo.El;this.Ro.jl();const t=this.Ro.El();return this.bo={El:t,h_:e},this.po.p(),t}a_(){return this.po}l_(e){this.je()||this.Lo()||this.So===null&&this.lo===null&&(this.Gi()||(this.So=this.ho-e,this.lo=we(this.ar()).Xe()))}o_(e){if(this.je()||this.Lo()||this.So===null)return;this.Vo({hs:!1}),(e=this.ho-e)<0&&(e=0);let t=(this.So+.2*(this.ho-1))/(e+.2*(this.ho-1));const n=we(this.lo).Xe();t=Math.max(t,.1),n.ir(t),this.Oo(n)}__(){this.je()||this.Lo()||(this.So=null,this.lo=null)}u_(e){this.Eo()||this.xo===null&&this.lo===null&&(this.Gi()||(this.xo=e,this.lo=we(this.ar()).Xe()))}c_(e){if(this.Eo()||this.xo===null)return;const t=we(this.ar()).tr()/(this.Ho()-1);let n=e-this.xo;this.zo()&&(n*=-1);const r=n*t,a=we(this.lo).Xe();a.nr(r),this.Oo(a,!0),this.bo=null}d_(){this.Eo()||this.xo!==null&&(this.xo=null,this.lo=null)}tl(){return this.il||this.dl(),this.il}Ji(e,t){switch(this.yn.mode){case 2:return this.f_(xo(e,t));case 3:return this.tl().format(Na(e,t));default:return this.cr(e)}}no(e){switch(this.yn.mode){case 2:return this.f_(e);case 3:return this.tl().format(e);default:return this.cr(e)}}Ql(e){switch(this.yn.mode){case 2:return this.p_(e);case 3:return this.tl().formatTickmarks(e);default:return this.v_(e)}}xa(e){return this.cr(e,we(this.wo).tl())}Ca(e,t){return e=xo(e,t),this.f_(e,l0)}m_(){return this.mo}w_(e){this.oo={uo:e,_o:!1}}Nn(){this.mo.forEach((e=>e.Nn()))}Kl(){return this.yn.ensureEdgeTickMarksVisible&&this.Eo()}Gl(){return this.k()/2}dl(){this.bo=null;let e=1/0;this.wo=null;for(const n of this.mo)n.ln()<e&&(e=n.ln(),this.wo=n);let t=100;this.wo!==null&&(t=Math.round(this.wo.Kh())),this.il=u0,this.je()?(this.il=l0,t=100):this.Lo()?(this.il=new ic(100,1),t=100):this.wo!==null&&(this.il=this.wo.tl()),this.Ro=new a0(this,t,this.Do.bind(this),this.Io.bind(this)),this.Ro.jl()}e_(){this.Mo=null}M_(){return this.wo===null||this.je()||this.Lo()?1:1/this.wo.Kh()}Xi(){return this.To}Yo(e){this.co=e}Uo(){return this.zo()?this.yn.scaleMargins.bottom*this.$t()+this.fo:this.yn.scaleMargins.top*this.$t()+this.do}$o(){return this.zo()?this.yn.scaleMargins.top*this.$t()+this.do:this.yn.scaleMargins.bottom*this.$t()+this.fo}jo(){this.oo._o||(this.oo._o=!0,this.g_())}Bo(){this.ao=null}Io(e,t){if(this.jo(),this.Gi())return 0;e=this.so()&&e?Xu(e,this.Co):e;const n=we(this.ar()),r=this.$o()+(this.Ho()-1)*(e-n.Je())/n.tr();return this.Ko(r)}Do(e,t){if(this.jo(),this.Gi())return 0;const n=this.Ko(e),r=we(this.ar()),a=r.Je()+r.tr()*((n-this.$o())/(this.Ho()-1));return this.so()?La(a,this.Co):a}No(){this.bo=null,this.Ro.jl()}g_(){if(this.Ao()&&!this.Eo())return;const e=this.oo.uo;if(e===null)return;let t=null;const n=this.m_();let r=0,a=0;for(const h of n){if(!h.It())continue;const d=h.Lt();if(d===null)continue;const p=h.la(e.Oa(),e.bi());let m=p&&p.ar();if(m!==null){switch(this.yn.mode){case 1:m=Ta(m,this.Co);break;case 2:m=qC(m,d.Wt);break;case 3:m=YC(m,d.Wt)}if(t=t===null?m:t.Ss(we(m)),p!==null){const v=p.lr();v!==null&&(r=Math.max(r,v.above),a=Math.max(a,v.below))}}}if(this.Kl()&&(r=Math.max(r,this.Gl()),a=Math.max(a,this.Gl())),r===this.do&&a===this.fo||(this.do=r,this.fo=a,this.bo=null,this.Bo()),t!==null){if(t.Je()===t.Qe()){const h=5*this.M_();this.so()&&(t=So(t,this.Co)),t=new On(t.Je()-h,t.Qe()+h),this.so()&&(t=Ta(t,this.Co))}if(this.so()){const h=So(t,this.Co),d=Af(h);if(u=d,c=this.Co,u.Al!==c.Al||u.Ll!==c.Ll){const p=this.lo!==null?So(this.lo,this.Co):null;this.Co=d,t=Ta(h,d),p!==null&&(this.lo=Ta(p,d))}}this.Oo(t)}else this.rr===null&&(this.Oo(new On(-.5,.5)),this.Co=Af(null));var u,c}Go(){return this.je()?xo:this.Lo()?Na:this.so()?e=>Xu(e,this.Co):null}b_(e,t,n){return t===void 0?(n===void 0&&(n=this.tl()),n.format(e)):t(e)}S_(e,t,n){return t===void 0?(n===void 0&&(n=this.tl()),n.formatTickmarks(e)):t(e)}cr(e,t){return this.b_(e,this.Po.priceFormatter,t)}v_(e,t){const n=this.Po.priceFormatter;return this.S_(e,this.Po.tickmarksPriceFormatter??(n?r=>r.map(n):void 0),t)}f_(e,t){return this.b_(e,this.Po.percentageFormatter,t)}p_(e,t){const n=this.Po.percentageFormatter;return this.S_(e,this.Po.tickmarksPercentageFormatter??(n?r=>r.map(n):void 0),t)}}function c0(s){return s instanceof sc}class Ud{constructor(e,t){this.mo=[],this.x_=new Map,this.ho=0,this.C_=0,this.y_=1,this.Mo=null,this.k_=null,this.P_=!1,this.T_=new tn,this.fa=[],this.ia=e,this.sn=t,this.R_=new $C(this);const n=t.N();this.D_=this.I_("left",n.leftPriceScale),this.V_=this.I_("right",n.rightPriceScale),this.D_.Fo().i(this.B_.bind(this,this.D_),this),this.V_.Fo().i(this.B_.bind(this,this.V_),this),this.E_(n)}E_(e){if(e.leftPriceScale&&this.D_.vr(e.leftPriceScale),e.rightPriceScale&&this.V_.vr(e.rightPriceScale),e.localization&&(this.D_.dl(),this.V_.dl()),e.overlayPriceScales){const t=Array.from(this.x_.values());for(const n of t){const r=we(n[0].Ft());r.vr(e.overlayPriceScales),e.localization&&r.dl()}}}A_(e){switch(e){case"left":return this.D_;case"right":return this.V_}return this.x_.has(e)?Yn(this.x_.get(e))[0].Ft():null}m(){this.Qt().L_().u(this),this.D_.Fo().u(this),this.V_.Fo().u(this),this.mo.forEach((e=>{e.m&&e.m()})),this.fa=this.fa.filter((e=>{const t=e.Qh();return t.detached&&t.detached(),!1})),this.T_.p()}z_(){return this.y_}O_(e){this.y_=e}Qt(){return this.sn}nn(){return this.C_}$t(){return this.ho}N_(e){this.C_=e,this.F_()}Wo(e){this.ho=e,this.D_.Wo(e),this.V_.Wo(e),this.mo.forEach((t=>{if(this.Zs(t)){const n=t.Ft();n!==null&&n.Wo(e)}})),this.F_()}W_(e){this.P_=e}H_(){return this.P_}U_(){return this.mo.filter(c0)}Cl(){return this.mo}Zs(e){const t=e.Ft();return t===null||this.D_!==t&&this.V_!==t}s_(e,t,n){this.j_(e,t,n?e.ln():this.mo.length)}r_(e,t){const n=this.mo.indexOf(e);yn(n!==-1,"removeDataSource: invalid data source"),this.mo.splice(n,1),t||this.mo.forEach(((u,c)=>u._n(c)));const r=we(e.Ft()).cl();if(this.x_.has(r)){const u=Yn(this.x_.get(r)),c=u.indexOf(e);c!==-1&&(u.splice(c,1),u.length===0&&this.x_.delete(r))}const a=e.Ft();a&&a.Cl().indexOf(e)>=0&&(a.r_(e),this.q_(a)),this.Y_()}
4198Xs(e){return e===this.D_?"left":e===this.V_?"right":"overlay"}K_(){return this.D_}Z_(){return this.V_}G_(e,t){e.l_(t)}X_(e,t){e.o_(t),this.F_()}J_(e){e.__()}Q_(e,t){e.u_(t)}tu(e,t){e.c_(t),this.F_()}iu(e){e.d_()}F_(){this.mo.forEach((e=>{e.Nn()}))}Pn(){const[e,t]=this.nu();let n=null;return e.N().visible&&e.Cl().length!==0?n=e:t.N().visible&&t.Cl().length!==0?n=t:this.mo.length!==0&&(n=this.mo[0].Ft()),n===null&&(n=this.Gs()??e),n}Gs(){const[e,t]=this.nu();return e.N().visible?e:t.N().visible?t:null}q_(e){e!==null&&e.Eo()&&this.su(e)}eu(e){const t=this.ia.Ee();e.Vo({hs:!0}),t!==null&&e.w_(t),this.F_()}ru(){this.su(this.D_),this.su(this.V_)}hu(){this.q_(this.D_),this.q_(this.V_),this.mo.forEach((e=>{this.Zs(e)&&this.q_(e.Ft())})),this.F_(),this.sn.mr()}Dt(){return this.Mo===null&&(this.Mo=nx(this.mo)),this.Mo}au(){var u;const e=this.Dt(),t=(u=this.sn.ou())==null?void 0:u.lu,n=this.sn.N().hoveredSeriesOnTop,r=this.k_;if(r!==null&&r.Kh===e&&r._u===t&&r.uu===n)return r.cu;const a=(function(c,h,d){if(!d)return c;const p=c.indexOf(h);if(p===-1||p===c.length-1)return c;const m=[];for(let v=0;v<c.length;v++)v!==p&&m.push(c[v]);return m.push(c[p]),m})(e,t,n);return this.k_={Kh:e,_u:t,uu:n,cu:a},a}du(e,t){t=bo(t,0,this.mo.length-1);const n=this.mo.indexOf(e);yn(n!==-1,"setSeriesOrder: invalid data source"),this.mo.splice(n,1),this.mo.splice(t,0,e),this.mo.forEach(((r,a)=>r._n(a))),this.Y_();for(const r of[this.D_,this.V_])r.e_(),r.dl();this.sn.mr()}Vt(){return this.Dt().filter(c0)}fu(){return this.T_}pu(){return this.R_}hl(e){this.fa.push(new DC(e))}al(e){this.fa=this.fa.filter((t=>t.Qh()!==e)),e.detached&&e.detached(),this.sn.mr()}vu(){return this.fa}Ja(e,t){return this.fa.map((n=>n.Qs(e,t))).filter((n=>n!==null))}su(e){const t=e.m_();if(t&&t.length>0&&!this.ia.Gi()){const n=this.ia.Ee();n!==null&&e.w_(n)}e.Nn()}j_(e,t,n){let r=this.A_(t);if(r===null&&(r=this.I_(t,this.sn.N().overlayPriceScales)),this.mo.splice(n,0,e),!nc(t)){const a=this.x_.get(t)||[];a.push(e),this.x_.set(t,a)}e._n(n),r.s_(e),e.un(r),this.q_(r),this.Y_()}Y_(){this.Mo=null,this.k_=null}nu(){return this.sn.N().defaultVisiblePriceScaleId==="left"?[this.D_,this.V_]:[this.V_,this.D_]}B_(e,t,n){t._e!==n._e&&this.su(e)}I_(e,t){const n={visible:!0,autoScale:!0,...ls(t)},r=new KC(e,n,this.sn.N().layout,this.sn.N().localization,this.sn.Xi());return r.Wo(this.$t()),r}}function Fd(s,e){return e===null||s.se===2&&e.se!==2||(e.se!==2||s.se===2)&&s.ne!==e.ne&&s.ne<e.ne}function ix(s){return{te:s.te,ie:s.ie}}function jC(s){return{ne:s.distance??0,se:s.hitTestPriority??(s.itemType==="marker"?2:0),ee:s.itemType??"primitive",mu:s.cursorStyle,te:s.externalId}}function xu(s){return{lu:s.lu,wu:ix(s.Mu),mu:s.Mu.mu,ee:s.Mu.ee??"primitive"}}function QC(s,e,t,n){var a;let r=null;for(const u of s){let c=((a=u.Qs)==null?void 0:a.call(u,e,t,n))??null;if(c===null){const h=u.Tt(n);c=h!==null&&h.Qs?h.Qs(e,t):null}if(c!==null){const h={gu:u,Mu:c};(r===null||Fd(h.Mu,r.Mu))&&(r=h)}}return r}function ZC(s){return s.jn!==void 0}function sx(s,e,t){const n=[s,...s.Dt()].reverse(),r=(function(c,h,d){var b;let p,m,v;for(const y of c){const S=((b=y.Ja)==null?void 0:b.call(y,h,d))??[];for(const P of S){const U=jC(P);x=P.zOrder,M=p==null?void 0:p.zOrder,(!M||x==="top"&&M!=="top"||x==="normal"&&M==="bottom"||P.zOrder===(p==null?void 0:p.zOrder)&&m!==void 0&&Fd(U,m)||P.zOrder===(p==null?void 0:p.zOrder)&&m===void 0)&&(p=P,m=U,v=y)}}var x,M;return p&&v&&m?{Mu:m,bu:p,lu:v}:null})(n,e,t);if((r==null?void 0:r.bu.zOrder)==="top")return xu(r);let a=null,u=null;for(const c of n){if(r&&r.lu===c&&r.bu.zOrder!=="bottom"&&!r.bu.isBackground)return a??xu(r);if(ZC(c)){const h=QC(c.jn(s),e,t,s);if(h!==null){const d={lu:c,gu:h.gu,wu:ix(h.Mu),mu:h.Mu.mu,ee:h.Mu.ee??"primitive"};(a===null||Fd(h.Mu,u))&&(a=d,u=h.Mu)}}if(r&&r.lu===c&&r.bu.zOrder!=="bottom"&&r.bu.isBackground)return a??xu(r)}return a!==null?a:r!=null&&r.bu?xu(r):null}class JC{constructor(e,t,n=50){this.Vs=0,this.Bs=1,this.Es=1,this.Ls=new Map,this.As=new Map,this.Su=e,this.xu=t,this.zs=n}Cu(e){const t=e.time,n=this.xu.cacheKey(t),r=this.Ls.get(n);if(r!==void 0)return r.yu;if(this.Vs===this.zs){const u=this.As.get(this.Es);this.As.delete(this.Es),this.Ls.delete(Yn(u)),this.Es++,this.Vs--}const a=this.Su(e);return this.Ls.set(n,{yu:a,Ws:this.Bs}),this.As.set(this.Bs,n),this.Vs++,this.Bs++,a}}class Da{constructor(e,t){yn(e<=t,"right should be >= left"),this.ku=e,this.Pu=t}Oa(){return this.ku}bi(){return this.Pu}Tu(){return this.Pu-this.ku+1}ze(e){return this.ku<=e&&e<=this.Pu}Ge(e){return this.ku===e.Oa()&&this.Pu===e.bi()}}function h0(s,e){return s===null||e===null?s===e:s.Ge(e)}class eA{constructor(){this.Ru=new Map,this.Ls=null,this.Du=!1}Iu(e){this.Du=e,this.Ls=null}Vu(e,t){this.Bu(t),this.Ls=null;for(let n=t;n<e.length;++n){const r=e[n];let a=this.Ru.get(r.timeWeight);a===void 0&&(a=[],this.Ru.set(r.timeWeight,a)),a.push({index:n,time:r.t
vendor: 8,321 bytes, line 4198
4198ime,weight:r.timeWeight,originalTime:r.originalTime})}}Eu(e,t,n,r,a){const u=Math.ceil(t/e);return this.Ls!==null&&this.Ls.Au===u&&a===this.Ls.Lu&&n===this.Ls.zu||(this.Ls={Lu:a,zu:n,El:this.Ou(u,n,r),Au:u}),this.Ls.El}Bu(e){if(e===0)return void this.Ru.clear();const t=[];this.Ru.forEach(((n,r)=>{e<=n[0].index?t.push(r):n.splice(br(n,e,(a=>a.index<e)),1/0)}));for(const n of t)this.Ru.delete(n)}Ou(e,t,n){let r=[];const a=u=>!t||n.has(u.index);for(const u of Array.from(this.Ru.keys()).sort(((c,h)=>h-c))){if(!this.Ru.get(u))continue;const c=r;r=[];const h=c.length;let d=0;const p=Yn(this.Ru.get(u)),m=p.length;let v=1/0,x=-1/0;for(let M=0;M<m;M++){const b=p[M],y=b.index;for(;d<h;){const S=c[d],P=S.index;if(!(P<y&&a(S))){v=P;break}d++,r.push(S),x=P,v=1/0}if(v-y>=e&&y-x>=e&&a(b))r.push(b),x=y;else if(this.Du)return c}for(;d<h;d++)a(c[d])&&r.push(c[d])}return r}}class To{constructor(e){this.Nu=e}Fu(){return this.Nu===null?null:new Da(Math.floor(this.Nu.Oa()),Math.ceil(this.Nu.bi()))}Wu(){return this.Nu}static Hu(){return new To(null)}}function tA(s,e){return s.weight>e.weight?s:e}class nA{constructor(e,t,n,r){this.C_=0,this.Uu=null,this.$u=[],this.xo=null,this.So=null,this.ju=new eA,this.qu=new Map,this.Yu=To.Hu(),this.Ku=!0,this.Zu=new tn,this.Gu=new tn,this.Xu=new tn,this.Ju=null,this.Qu=null,this.tc=new Map,this.nc=-1,this.sc=[],this.ec=1,this.yn=t,this.Po=n,this.rc=t.rightOffset,this.hc=t.barSpacing,this.sn=e,this.ac(t),this.xu=r,this.lc(),this.ju.Iu(t.uniformDistribution),this.oc(),this._c()}N(){return this.yn}uc(e){ii(this.Po,e),this.cc(),this.lc()}vr(e,t){ii(this.yn,e),this.yn.fixLeftEdge&&this.dc(),this.yn.fixRightEdge&&this.fc(),e.barSpacing!==void 0&&this.sn.Ms(e.barSpacing),e.rightOffset!==void 0&&this.sn.gs(e.rightOffset),this.ac(e),e.minBarSpacing===void 0&&e.maxBarSpacing===void 0||this.sn.Ms(e.barSpacing??this.hc),e.ignoreWhitespaceIndices!==void 0&&e.ignoreWhitespaceIndices!==this.yn.ignoreWhitespaceIndices&&this._c(),this.cc(),this.lc(),e.enableConflation===void 0&&e.conflationThresholdFactor===void 0||this.oc(),this.Xu.p()}Rn(e){var t;return((t=this.$u[e])==null?void 0:t.time)??null}en(e){return this.$u[e]??null}vc(e,t){if(this.$u.length<1)return null;if(this.xu.key(e)>this.xu.key(this.$u[this.$u.length-1].time))return t?this.$u.length-1:null;const n=br(this.$u,this.xu.key(e),((r,a)=>this.xu.key(r.time)<a));return this.xu.key(e)<this.xu.key(this.$u[n].time)?t?n:null:n}Gi(){return this.C_===0||this.$u.length===0||this.Uu===null}mc(){return this.$u.length>0}Ee(){return this.wc(),this.Yu.Fu()}Mc(){return this.wc(),this.Yu.Wu()}gc(){const e=this.Ee();if(e===null)return null;const t={from:e.Oa(),to:e.bi()};return this.bc(t)}bc(e){const t=Math.round(e.from),n=Math.round(e.to),r=we(this.Sc()),a=we(this.xc());return{from:we(this.en(Math.max(r,t))),to:we(this.en(Math.min(a,n)))}}Cc(e){return{from:we(this.vc(e.from,!0)),to:we(this.vc(e.to,!0))}}nn(){return this.C_}N_(e){if(!isFinite(e)||e<=0||this.C_===e)return;const t=this.Mc(),n=this.C_;if(this.C_=e,this.Ku=!0,this.yn.lockVisibleTimeRangeOnResize&&n!==0){const r=this.hc*e/n;this.hc=r}if(this.yn.fixLeftEdge&&t!==null&&t.Oa()<=0){const r=n-e;this.rc-=Math.round(r/this.hc)+1,this.Ku=!0}this.yc(),this.kc()}jt(e){if(this.Gi()||!ka(e))return 0;const t=this.Pc()+this.rc-e;return this.C_-(t+.5)*this.hc-1}Tc(e,t){const n=this.Pc(),r=t===void 0?0:t.from,a=t===void 0?e.length:t.to;for(let u=r;u<a;u++){const c=e[u].wt,h=n+this.rc-c,d=this.C_-(h+.5)*this.hc-1;e[u]._t=d}}Rc(e,t){const n=Math.ceil(this.Dc(e));return t&&this.yn.ignoreWhitespaceIndices&&!this.Ic(n)?this.Vc(n):n}gs(e){this.Ku=!0,this.rc=e,this.kc(),this.sn.Bc(),this.sn.mr()}fl(){return this.hc}Ms(e){const t=this.hc;if(this.Ec(e),this.yn.rightOffsetPixels!==void 0&&t!==0){const n=this.rc*t/this.hc;this.rc=n}this.kc(),this.sn.Bc(),this.sn.mr()}Ac(){return this.rc}El(){if(this.Gi())return null;if(this.Qu!==null)return this.Qu;const e=this.hc,t=5*(this.sn.N().layout.fontSize+4)/8*(this.yn.tickMarkMaxCharacterLength||8),n=Math.round(t/e),r=we(this.Ee()),a=Math.max(r.Oa(),r.Oa()-n),u=Math.max(r.bi(),r.bi()-n),c=this.ju.Eu(e,t,this.yn.ignoreWhitespaceIndices,this.tc,this.nc),h=this.Sc()+n,d=this.xc()-n,p=this.Lc(),m=this.yn.fixLeftEdge||p,v=this.yn.fixRightEdge||p;let x=0;for(const M of c){if(!(a<=M.index&&M.index<=u))continue;let b;x<this.sc.length?(b=this.sc[x],b.coord=this.jt(M.index),b.label=this.zc(M),b.weight=M.weight):(b={needAlignCoordinate:!1,coord:this.jt(M.index),label:this.zc(M),weight:M.weight},this.sc.push(b)),this.hc>t/2&&!p?b.needAlignCoordinate=!1:b.needAlignCoordinate=m&&M.index<=h||v&&M.index>=d,x++}return this.sc.length=x,this.Qu=this.sc,this.sc}Oc(){let e;this.Ku=!0,this.Ms(this.yn.barSpacing),e=this.yn.rightOffsetPixels!==void 0?this.yn.rightOffsetPixels/this.fl():this.yn.rightOffset,this.gs(e)}Nc(e){this.Ku=!0,this.Uu=e,this.kc(),this.dc()}Fc(e,t){const n=this.Dc(e),r=this.fl(),a=r+t*(r/10);this.Ms(a),this.yn.rightBarStaysOnScroll||this.gs(this.Ac()+(n-this.Dc(e)))}l_(e){this.xo&&this.d_(),this.So===null&&this.Ju===null&&(this.Gi()||(this.So=e,this.Wc()))}o_(e){if(this.Ju===null)return;const t=bo(this.C_-e,0,this.C_),n=bo(this.C_-we(this.So),0,this.C_);t!==0&&n!==0&&this.Ms(this.Ju.fl*t/n)}__(){this.So!==null&&(this.So=null,this.Hc())}u_(e){this.xo===null&&this.Ju===null&&(this.Gi()||(this.xo=e,this.Wc()))}c_(e){if(this.xo===null)return;const t=(this.xo-e)/this.fl();this.rc=we(this.Ju).Ac+t,this.Ku=!0,this.kc()}d_(){this.xo!==null&&(this.xo=null,this.Hc())}Uc(){this.$c(this.yn.rightOffset)}$c(e,t=400){if(!isFinite(e))throw new RangeError("offset is required and must be finite number");if(!isFinite(t)||t<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const n=this.rc,r=performance.now();this.sn.ps({jc:a=>(a-r)/t>=1,qc:a=>{const u=(a-r)/t;return u>=1?e:n+(e-n)*u}})}kt(e,t){this.Ku=!0,this.$u=e,this.ju.Vu(e,t),this.kc()}Yc(){return this.Zu}Kc(){return this.Gu}Zc(){return this.Xu}Pc(){return this.Uu||0}Gc(e,t){const n=e.Tu(),r=t&&this.yn.rightOffsetPixels||0;this.Ec((this.C_-r)/n),this.rc=e.bi()-this.Pc(),t&&(this.rc=r?r/this.fl():this.yn.rightOffset),this.kc(),this.Ku=!0,this.sn.Bc(),this.sn.mr()}Xc(){const e=this.Sc(),t=this.xc();if(e===null||t===null)return;const n=!this.yn.rightOffsetPixels&&this.yn.rightOffset||0;this.Gc(new Da(e,t+n),!0)}Jc(e){const t=new Da(e.from,e.to);this.Gc(t)}rn(e){return this.Po.timeFormatter!==void 0?this.Po.timeFormatter(e.originalTime):this.xu.formatHorzItem(e.time)}_c(){if(!this.yn.ignoreWhitespaceIndices)return;this.tc.clear();const e=this.sn.Jn();for(const t of e)for(const n of t.ul())this.tc.set(n,!0);this.nc++}Qc(){return this.ec}Ml(){const e=1/(window.devicePixelRatio||1),t=this.yn.minBarSpacing;if(t>=e)return[1];const n=[1];let r=2;for(;r<=512;)t<e/r&&n.push(r),r*=2;return n}Lc(){const e=this.sn.N().handleScroll,t=this.sn.N().handleScale;return!(e.horzTouchDrag||e.mouseWheel||e.pressedMouseMove||e.vertTouchDrag||t.axisDoubleClickReset.time||t.axisPressedMouseMove.time||t.mouseWheel||t.pinch)}Sc(){return this.$u.length===0?null:0}xc(){return this.$u.length===0?null:this.$u.length-1}td(e){return(this.C_-1-e)/this.hc}Dc(e){const t=this.td(e),n=this.Pc()+this.rc-t;return Math.round(1e6*n)/1e6}Ec(e){const t=this.hc;this.hc=e,this.yc(),t!==this.hc&&(this.Ku=!0,this.nd(),this.oc())}wc(){if(!this.Ku)return;if(this.Ku=!1,this.Gi())return void this.sd(To.Hu());const e=this.Pc(),t=this.C_/this.hc,n=this.rc+e,r=new Da(n-t+1,n);this.sd(new To(r))}yc(){const e=bo(this.hc,this.ed(),this.rd());this.hc!==e&&(this.hc=e,this.Ku=!0)}rd(){return this.yn.maxBarSpacing>0?this.yn.maxBarSpacing:.5*this.C_}ed(){return this.yn.fixLeftEdge&&this.yn.fixRightEdge&&this.$u.length!==0?this.C_/this.$u.length:this.yn.minBarSpacing}oc(){if(!this.yn.enableConflation)return void(this.ec=1);const e=1/(window.devicePixelRatio||1)*(this.yn.conflationThresholdFactor??1);if(this.hc>=e)return void(this.ec=1);const t=e/this.hc,n=Math.pow(2,Math.floor(Math.log2(t)));this.ec=Math.min(n,512)}kc(){const e=this.hd();e!==null&&this.rc<e&&(this.rc=e,this.Ku=!0);const t=this.ad();this.rc>t&&(this.rc=t,this.Ku=!0)}hd(){const e=this.Sc(),t=this.Uu;return e===null||t===null?null:e-t-1+(this.yn.fixLeftEdge?this.C_/this.hc:Math.min(2,this.$u.length))}ad(){return this.yn.fixRightEdge?0:this.C_/this.hc-Math.min(2,this.$u.length)}
4198Wc(){this.Ju={fl:this.fl(),Ac:this.Ac()}}Hc(){this.Ju=null}zc(e){let t=this.qu.get(e.weight);return t===void 0&&(t=new JC((n=>this.ld(n)),this.xu),this.qu.set(e.weight,t)),t.Cu(e)}ld(e){return this.xu.formatTickmark(e,this.Po)}sd(e){const t=this.Yu;this.Yu=e,h0(t.Fu(),this.Yu.Fu())||this.Zu.p(),h0(t.Wu(),this.Yu.Wu())||this.Gu.p(),this.nd()}nd(){this.Qu=null}cc(){this.nd(),this.qu.clear()}lc(){this.xu.updateFormatter(this.Po)}dc(){if(!this.yn.fixLeftEdge)return;const e=this.Sc();if(e===null)return;const t=this.Ee();if(t===null)return;const n=t.Oa()-e;if(n<0){const r=this.rc-n-1;this.gs(r)}this.yc()}fc(){this.kc(),this.yc()}Ic(e){return!this.yn.ignoreWhitespaceIndices||this.tc.get(e)||!1}Vc(e){const t=(function*(r){const a=Math.round(r),u=a<r;let c=1;for(;;)u?(yield a+c,yield a-c):(yield a-c,yield a+c),c++})(e),n=this.xc();for(;n;){const r=t.next().value;if(this.tc.get(r))return r;if(r<0||r>n)break}return e}ac(e){if(e.rightOffsetPixels!==void 0){const t=e.rightOffsetPixels/(e.barSpacing||this.hc);this.sn.gs(t)}}}var f0,d0,p0,Od,m0;(function(s){s[s.OnTouchEnd=0]="OnTouchEnd",s[s.OnNextTap=1]="OnNextTap"})(f0||(f0={}));class iA{constructor(e,t,n){this.od=[],this._d=[],this.ud=null,this.C_=0,this.dd=null,this.fd=new tn,this.pd=new tn,this.vd=null,this.md=e,this.yn=t,this.xu=n,this.To=new eC(this.yn.layout.colorParsers),this.wd=new JT(this),this.ia=new nA(this,t.timeScale,this.yn.localization,n),this.Ct=new cC(this,t.crosshair),this.Md=new GC(t.crosshair),t.addDefaultPane&&(this.gd(0),this.od[0].O_(2)),this.bd=this.Sd(0),this.xd=this.Sd(1)}Pa(){this.Cd(Sn.ys())}mr(){this.Cd(Sn.Cs())}qa(){this.Cd(new Sn(1))}Ta(e){const t=this.yd(e);this.Cd(t)}ou(){return this.dd}kd(e){var n,r,a,u,c,h,d,p,m;if(((n=this.dd)==null?void 0:n.lu)===(e==null?void 0:e.lu)&&((a=(r=this.dd)==null?void 0:r.wu)==null?void 0:a.te)===((u=e==null?void 0:e.wu)==null?void 0:u.te)&&((h=(c=this.dd)==null?void 0:c.wu)==null?void 0:h.ie)===((d=e==null?void 0:e.wu)==null?void 0:d.ie)&&((p=this.dd)==null?void 0:p.mu)===(e==null?void 0:e.mu)&&((m=this.dd)==null?void 0:m.ee)===(e==null?void 0:e.ee))return;const t=this.dd;this.dd=e,t!==null&&this.Ta(t.lu),e!==null&&e.lu!==(t==null?void 0:t.lu)&&this.Ta(e.lu)}N(){return this.yn}vr(e){ii(this.yn,e),this.od.forEach((t=>t.E_(e))),e.timeScale!==void 0&&this.ia.vr(e.timeScale),e.localization!==void 0&&this.ia.uc(e.localization),(e.leftPriceScale||e.rightPriceScale)&&this.fd.p(),this.bd=this.Sd(0),this.xd=this.Sd(1),this.Pa()}Pd(e,t,n=0){const r=this.od[n];if(r===void 0)return;if(e==="left")return ii(this.yn,{leftPriceScale:t}),r.E_({leftPriceScale:t}),this.fd.p(),void this.Pa();if(e==="right")return ii(this.yn,{rightPriceScale:t}),r.E_({rightPriceScale:t}),this.fd.p(),void this.Pa();const a=this.Td(e,n);a!==null&&(a.Ft.vr(t),this.fd.p())}Td(e,t){const n=this.od[t];if(n===void 0)return null;const r=n.A_(e);return r!==null?{Kn:n,Ft:r}:null}Et(){return this.ia}Zn(){return this.od}Rd(){return this.Ct}Dd(){return this.pd}Id(e,t){e.Wo(t),this.Bc()}N_(e){this.C_=e,this.ia.N_(this.C_),this.od.forEach((t=>t.N_(e))),this.Bc()}Vd(e){this.od.length!==1&&(yn(e>=0&&e<this.od.length,"Invalid pane index"),this.od.splice(e,1),this.Pa())}Bd(e,t){if(this.od.length<2)return;yn(e>=0&&e<this.od.length,"Invalid pane index");const n=this.od[e],r=this.od.reduce(((m,v)=>m+v.z_()),0),a=this.od.reduce(((m,v)=>m+v.$t()),0),u=a-30*(this.od.length-1);t=Math.min(u,Math.max(30,t));const c=r/a,h=n.$t();n.O_(t*c);let d=t-h,p=this.od.length-1;for(const m of this.od)if(m!==n){const v=Math.min(u,Math.max(30,m.$t()-d/p));d-=m.$t()-v,p-=1;const x=v*c;m.O_(x)}this.Pa()}Ed(e,t){yn(e>=0&&e<this.od.length&&t>=0&&t<this.od.length,"Invalid pane index");const n=this.od[e],r=this.od[t];this.od[e]=r,this.od[t]=n,this.Pa()}Ad(e,t){if(yn(e>=0&&e<this.od.length&&t>=0&&t<this.od.length,"Invalid pane index"),e===t)return;const[n]=this.od.splice(e,1);this.od.splice(t,0,n),this.Pa()}G_(e,t,n){e.G_(t,n)}X_(e,t,n){e.X_(t,n),this.Ra(),this.Cd(this.Ld(e,2))}J_(e,t){e.J_(t),this.Cd(this.Ld(e,2))}Q_(e,t,n){t.Eo()||e.Q_(t,n)}tu(e,t,n){t.Eo()||(e.tu(t,n),this.Ra(),this.Cd(this.Ld(e,2)))}iu(e,t){t.Eo()||(e.iu(t),this.Cd(this.Ld(e,2)))}eu(e,t){e.eu(t),this.Cd(this.Ld(e,2))}zd(e){this.ia.l_(e)}Od(e,t){const n=this.Et();if(n.Gi()||t===0)return;const r=n.nn();e=Math.max(1,Math.min(e,r)),n.Fc(e,t),this.Bc()}Nd(e){this.Fd(0),this.Wd(e),this.Hd()}Ud(e){this.ia.o_(e),this.Bc()}$d(){this.ia.__(),this.mr()}Fd(e){this.ia.u_(e)}Wd(e){this.ia.c_(e),this.Bc()}Hd(){this.ia.d_(),this.mr()}Jn(){return this._d}Wn(){return this.ud===null&&(this.ud=this._d.filter((e=>e.It()))),this.ud}ka(){this.ud=null}jd(e,t,n,r,a){this.Ct.In(e,t);let u=NaN,c=this.ia.Rc(e,!0);const h=this.ia.Ee();h!==null&&(c=Math.min(Math.max(h.Oa(),c),h.bi())),c=this.Ct.Fn(c);const d=r.Pn(),p=d.Lt();if(p!==null&&(u=d.Tn(t,p)),u=this.Md.xl(u,c,r),this.Ct.An(c,u,r),this.qa(),!a){const m=sx(r,e,t);this.kd(m&&{lu:m.lu,wu:m.wu,mu:m.mu||null,ee:m.ee}),this.pd.p(this.Ct.Bt(),{x:e,y:t},n)}}qd(e,t,n){const r=n.Pn(),a=r.Lt(),u=r.Nt(e,we(a)),c=this.ia.vc(t,!0),h=this.ia.jt(we(c));this.jd(h,u,null,n,!0)}Yd(e){this.Rd().zn(),this.qa(),e||this.pd.p(null,null,null)}Ra(){const e=this.Ct.Kn();if(e!==null){const t=this.Ct.Bn(),n=this.Ct.En();this.jd(t,n,null,e)}this.Ct.Nn()}
4198Kd(e,t,n){const r=this.ia.Rn(0);t!==void 0&&n!==void 0&&this.ia.kt(t,n);const a=this.ia.Rn(0),u=this.ia.Pc(),c=this.ia.Ee();if(c!==null&&r!==null&&a!==null){const h=c.ze(u),d=this.xu.key(r)>this.xu.key(a),p=e!==null&&e>u&&!d,m=this.ia.N().allowShiftVisibleRangeOnWhitespaceReplacement,v=h&&(n!==void 0||m)&&this.ia.N().shiftVisibleRangeOnNewBar;if(p&&!v){const x=e-u;this.ia.gs(this.ia.Ac()-x)}}this.ia.Nc(e)}Va(e){e!==null&&e.hu()}Ks(e){if((function(n){return n instanceof Ud})(e))return e;const t=this.od.find((n=>n.Dt().includes(e)));return t===void 0?null:t}Bc(){this.od.forEach((e=>e.hu())),this.Ra()}m(){this.od.forEach((e=>e.m())),this.od.length=0,this.yn.localization.priceFormatter=void 0,this.yn.localization.percentageFormatter=void 0,this.yn.localization.timeFormatter=void 0}Zd(){return this.wd}Js(){return this.wd.N()}L_(){return this.fd}Gd(e,t){const n=this.gd(t);this.Xd(e,n),this._d.push(e),this.ka(),this._d.length===1?this.Pa():this.mr()}Jd(e){const t=this.Ks(e),n=this._d.indexOf(e);yn(n!==-1,"Series not found");const r=we(t);this._d.splice(n,1),r.r_(e),e.m&&e.m(),this.ka(),this.ia._c(),this.Qd(r)}ya(e,t){const n=we(this.Ks(e));n.r_(e,!0),n.s_(e,t,!0)}Xc(){const e=Sn.Cs();e.us(),this.Cd(e)}tf(e){const t=Sn.Cs();t.fs(e),this.Cd(t)}ws(){const e=Sn.Cs();e.ws(),this.Cd(e)}Ms(e){const t=Sn.Cs();t.Ms(e),this.Cd(t)}gs(e){const t=Sn.Cs();t.gs(e),this.Cd(t)}ps(e){const t=Sn.Cs();t.ps(e),this.Cd(t)}cs(){const e=Sn.Cs();e.cs(),this.Cd(e)}if(){const e=this.yn.defaultVisiblePriceScaleId,t=this.yn.leftPriceScale.visible;return t!==this.yn.rightPriceScale.visible?t?"left":"right":e}nf(e,t){if(yn(t>=0,"Index should be greater or equal to 0"),t===this.sf(e))return;const n=we(this.Ks(e));n.r_(e);const r=this.gd(t);this.Xd(e,r);let a=!1;n.Cl().length===0&&(a=this.Qd(n)),a||this.Pa()}ef(){return this.xd}$(){return this.bd}Ut(e){const t=this.xd,n=this.bd;if(t===n)return t;if(e=Math.max(0,Math.min(100,Math.round(100*e))),this.vd===null||this.vd.ah!==n||this.vd.oh!==t)this.vd={ah:n,oh:t,rf:new Map};else{const a=this.vd.rf.get(e);if(a!==void 0)return a}const r=this.To.tt(n,t,e/100);return this.vd.rf.set(e,r),r}hf(e){return this.od.indexOf(e)}Xi(){return this.To}af(){return this.lf()}lf(e){const t=new Ud(this.ia,this);this.od.push(t);const n=e??this.od.length-1,r=Sn.ys();return r.es(n,{rs:0,hs:!0}),this.Cd(r),t}gd(e){return yn(e>=0,"Index should be greater or equal to 0"),(e=Math.min(this.od.length,e))<this.od.length?this.od[e]:this.lf(e)}sf(e){return this.od.findIndex((t=>t.U_().includes(e)))}Ld(e,t){const n=new Sn(t);if(e!==null){const r=this.od.indexOf(e);n.es(r,{rs:t})}return n}yd(e,t){return t===void 0&&(t=2),this.Ld(this.Ks(e),t)}Cd(e){this.md&&this.md(e),this.od.forEach((t=>t.pu().wr().kt()))}Xd(e,t){const n=e.N().priceScaleId,r=n!==void 0?n:this.if();t.s_(e,r),nc(r)||e.vr(e.N())}Sd(e){const t=this.yn.layout;return t.background.type==="gradient"?e===0?t.background.topColor:t.background.bottomColor:t.background.color}Qd(e){return!e.H_()&&e.Cl().length===0&&this.od.length>1&&(this.od.splice(this.hf(e),1),this.Pa(),!0)}}function rx(s){if(s>=1)return 0;let e=0;for(;e<8;e++){const t=Math.round(s);if(Math.abs(t-s)<1e-8)return e;s*=10}return e}function kd(s){return!No(s)&&!Ga(s)}function ox(s){return No(s)}(function(s){s[s.Disabled=0]="Disabled",s[s.Continuous=1]="Continuous",s[s.OnDataUpdate=2]="OnDataUpdate"})(d0||(d0={})),(function(s){s[s.LastBar=0]="LastBar",s[s.LastVisible=1]="LastVisible"})(p0||(p0={})),(function(s){s.Solid="solid",s.VerticalGradient="gradient"})(Od||(Od={})),(function(s){s[s.Year=0]="Year",s[s.Month=1]="Month",s[s.DayOfMonth=2]="DayOfMonth",s[s.Time=3]="Time",s[s.TimeWithSeconds=4]="TimeWithSeconds"})(m0||(m0={}));const g0=s=>s.getUTCFullYear();function sA(s,e,t){return e.replace(/yyyy/g,(n=>us(g0(n),4))(s)).replace(/yy/g,(n=>us(g0(n)%100,2))(s)).replace(/MMMM/g,((n,r)=>new Date(n.getUTCFullYear(),n.getUTCMonth(),1).toLocaleString(r,{month:"long"}))(s,t)).replace(/MMM/g,((n,r)=>new Date(n.getUTCFullYear(),n.getUTCMonth(),1).toLocaleString(r,{month:"short"}))(s,t)).replace(/MM/g,(n=>us((r=>r.getUTCMonth()+1)(n),2))(s)).replace(/dd/g,(n=>us((r=>r.getUTCDate())(n),2))(s))}class ax{constructor(e="yyyy-MM-dd",t="default"){this._f=e,this.uf=t}Cu(e){return sA(e,this._f,this.uf)}}class rA{constructor(e){this.cf=e||"%h:%m:%s"}Cu(e){return this.cf.replace("%h",us(e.getUTCHours(),2)).replace("%m",us(e.getUTCMinutes(),2)).replace("%s",us(e.getUTCSeconds(),2))}}const oA={df:"yyyy-MM-dd",ff:"%h:%m:%s",pf:" ",vf:"default"};class aA{constructor(e={}){const t={...oA,...e};this.mf=new ax(t.df,t.vf),this.wf=new rA(t.ff),this.Mf=t.pf}Cu(e){return`${this.mf.Cu(e)}${this.Mf}${this.wf.Cu(e)}`}}function Su(s){return 60*s*60*1e3}function Pf(s){return 60*s*1e3}const yu=[{gf:(v0=1,1e3*v0),bf:10},{gf:Pf(1),bf:20},{gf:Pf(5),bf:21},{gf:Pf(30),bf:22},{gf:Su(1),bf:30},{gf:Su(3),bf:31},{gf:Su(6),bf:32},{gf:Su(12),bf:33}];var v0;function _0(s,e){if(s.getUTCFullYear()!==e.getUTCFullYear())return 70;if(s.getUTCMonth()!==e.getUTCMonth())return 60;if(s.getUTCDate()!==e.getUTCDate())return 50;for(let t=yu.length-1;t>=0;--t)if(Math.floor(e.getTime()/yu[t].gf)!==Math.floor(s.getTime()/yu[t].gf))return yu[t].bf;return 0}function Nf(s){let e=s;if(Ga(s)&&(e=up(s)),!kd(e))throw new Error("time must be of type BusinessDay");const t=new Date(Date.UTC(e.year,e.month-1,e.day,0,0,0,0));return{Sf:Math.round(t.getTime()/1e3),xf:e}}function x0(s){if(!ox(s))throw new Error("time must be of type isUTCTimestamp");return{Sf:s}}function up(s){const e=new Date(s);if(isNaN(e.getTime()))throw new Error(`Invalid date string=${s}, expected format=yyyy-mm-dd`);return{day:e.getUTCDate(),month:e.getUTCMonth()+1,year:e.getUTCFullYear()}}function S0(s){Ga(s.time)&&(s.time=up(s.time))}class y0{options(){return this.yn}setOptions(e){this.yn=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?(function(t){t.forEach(S0)})(e):S0(e)}createConverterToInternalObj(e){return we((function(t){return t.length===0?null:kd(t[0].time)||Ga(t[0].time)?Nf:x0})(e))}key(e){return typeof e=="object"&&"Sf"in e?e.Sf:this.key(this.convertHorzItemToInternal(e))}cacheKey(e){const t=e;return t.xf===void 0?new Date(1e3*t.Sf).getTime():new Date(Date.UTC(t.xf.year,t.xf.month-1,t.xf.day)).getTime()}convertHorzItemToInternal(e){return ox(t=e)?x0(t):kd(t)?Nf(t):Nf(up(t));var t}updateFormatter(e){if(!this.yn)return;const t=e.dateFormat;
4198this.yn.timeScale.timeVisible?this.Cf=new aA({df:t,ff:this.yn.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",pf:"   ",vf:e.locale}):this.Cf=new ax(t,e.locale)}formatHorzItem(e){const t=e;return this.Cf.Cu(new Date(1e3*t.Sf))}formatTickmark(e,t){const n=(function(a,u,c){switch(a){case 0:case 10:return u?c?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return u?3:2;case 50:return 2;case 60:return 1;case 70:return 0}})(e.weight,this.yn.timeScale.timeVisible,this.yn.timeScale.secondsVisible),r=this.yn.timeScale;if(r.tickMarkFormatter!==void 0){const a=r.tickMarkFormatter(e.originalTime,n,t.locale);if(a!==null)return a}return(function(a,u,c){const h={};switch(u){case 0:h.year="numeric";break;case 1:h.month="short";break;case 2:h.day="numeric";break;case 3:h.hour12=!1,h.hour="2-digit",h.minute="2-digit";break;case 4:h.hour12=!1,h.hour="2-digit",h.minute="2-digit",h.second="2-digit"}const d=a.xf===void 0?new Date(1e3*a.Sf):new Date(Date.UTC(a.xf.year,a.xf.month-1,a.xf.day));return new Date(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()).toLocaleString(c,h)})(e.time,n,t.locale)}maxTickMarkWeight(e){let t=e.reduce(tA,e[0]).weight;return t>30&&t<50&&(t=30),t}fillWeightsForPoints(e,t){(function(n,r=0){if(n.length===0)return;let a=r===0?null:n[r-1].time.Sf,u=a!==null?new Date(1e3*a):null,c=0;for(let h=r;h<n.length;++h){const d=n[h],p=new Date(1e3*d.time.Sf);u!==null&&(d.timeWeight=_0(p,u)),c+=d.time.Sf-(a||d.time.Sf),a=d.time.Sf,u=p}if(r===0&&n.length>1){const h=Math.ceil(c/(n.length-1)),d=new Date(1e3*(n[0].time.Sf-h));n[0].timeWeight=_0(new Date(1e3*n[0].time.Sf),d)}})(e,t)}static yf(e){return ii({localization:{dateFormat:"dd MMM 'yy"}},e??{})}}const Lo=typeof window<"u";function M0(){return!!Lo&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function Lf(){return!!Lo&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function lA(s,e){switch(s){case"custom":return e!==void 0?"custom-object":"series";case"price-line":return"custom-price-line";case"marker":return"series-marker";case"primitive":return"primitive";default:return"series"}}function Bd(s){return s+s%2}function uA(s){Lo&&window.chrome!==void 0&&s.addEventListener("mousedown",(e=>{if(e.button===1)return e.preventDefault(),!1}))}class rc{constructor(e,t,n){this.kf=0,this.Pf=null,this.Tf={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.Rf=0,this.Df=null,this.If={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.Vf=null,this.Bf=!1,this.Ef=null,this.Af=null,this.Lf=!1,this.zf=!1,this.Of=!1,this.Nf=null,this.Ff=null,this.Wf=null,this.Hf=null,this.Uf=null,this.$f=null,this.jf=null,this.qf=0,this.Yf=!1,this.Kf=!1,this.Zf=!1,this.Gf=0,this.Xf=null,this.Jf=!Lf(),this.Qf=r=>{this.tp(r)},this.ip=r=>{if(this.np(r)){const a=this.sp(r);if(++this.Rf,this.Df&&this.Rf>1){const{ep:u}=this.rp(Oi(r),this.If);u<30&&!this.Of&&this.hp(a,this.lp.ap),this.op()}}else{const a=this.sp(r);if(++this.kf,this.Pf&&this.kf>1){const{ep:u}=this.rp(Oi(r),this.Tf);u<5&&!this.zf&&this._p(a,this.lp.up),this.cp()}}},this.dp=e,this.lp=t,this.yn=n,this.fp()}m(){this.Nf!==null&&(this.Nf(),this.Nf=null),this.Ff!==null&&(this.Ff(),this.Ff=null),this.Hf!==null&&(this.Hf(),this.Hf=null),this.Uf!==null&&(this.Uf(),this.Uf=null),this.$f!==null&&(this.$f(),this.$f=null),this.Wf!==null&&(this.Wf(),this.Wf=null),this.pp(),this.cp()}vp(e){this.Hf&&this.Hf();const t=this.mp.bind(this);if(this.Hf=()=>{this.dp.removeEventListener("mousemove",t)},this.dp.addEventListener("mousemove",t),this.np(e))return;const n=this.sp(e);this._p(n,this.lp.wp),this.Jf=!0}cp(){this.Pf!==null&&clearTimeout(this.Pf),this.kf=0,this.Pf=null,this.Tf={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}op(){this.Df!==null&&clearTimeout(this.Df),this.Rf=0,this.Df=null,this.If={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}mp(e){if(this.Zf||this.Af!==null||this.np(e))return;const t=this.sp(e);this._p(t,this.lp.Mp),this.Jf=!0}gp(e){const t=Df(e.changedTouches,we(this.Xf));if(t===null||(this.Gf=Mu(e),this.jf!==null)||this.Kf)return;this.Yf=!0;const n=this.rp(Oi(t),we(this.Af)),{bp:r,Sp:a,ep:u}=n;if(this.Lf||!(u<5)){if(!this.Lf){const c=.5*r,h=a>=c&&!this.yn.xp(),d=c>a&&!this.yn.Cp();h||d||(this.Kf=!0),this.Lf=!0,this.Of=!0,this.pp(),this.op()}if(!this.Kf){const c=this.sp(e,t);this.hp(c,this.lp.yp),go(e)}}}kp(e){if(e.button!==0)return;const t=this.rp(Oi(e),we(this.Ef)),{ep:n}=t;if(n>
4198=5&&(this.zf=!0,this.cp()),this.zf){const r=this.sp(e);this._p(r,this.lp.Pp)}}rp(e,t){const n=Math.abs(t._t-e._t),r=Math.abs(t.ut-e.ut);return{bp:n,Sp:r,ep:n+r}}Tp(e){let t=Df(e.changedTouches,we(this.Xf));if(t===null&&e.touches.length===0&&(t=e.changedTouches[0]),t===null)return;this.Xf=null,this.Gf=Mu(e),this.pp(),this.Af=null,this.$f&&(this.$f(),this.$f=null);const n=this.sp(e,t);if(this.hp(n,this.lp.Rp),++this.Rf,this.Df&&this.Rf>1){const{ep:r}=this.rp(Oi(t),this.If);r<30&&!this.Of&&this.hp(n,this.lp.ap),this.op()}else this.Of||(this.hp(n,this.lp.Dp),this.lp.Dp&&go(e));this.Rf===0&&go(e),e.touches.length===0&&this.Bf&&(this.Bf=!1,go(e))}tp(e){if(e.button!==0)return;const t=this.sp(e);if(this.Ef=null,this.Zf=!1,this.Uf&&(this.Uf(),this.Uf=null),M0()&&this.dp.ownerDocument.documentElement.removeEventListener("mouseleave",this.Qf),!this.np(e))if(this._p(t,this.lp.Ip),++this.kf,this.Pf&&this.kf>1){const{ep:n}=this.rp(Oi(e),this.Tf);n<5&&!this.zf&&this._p(t,this.lp.up),this.cp()}else this.zf||this._p(t,this.lp.Vp)}pp(){this.Vf!==null&&(clearTimeout(this.Vf),this.Vf=null)}Bp(e){if(this.Xf!==null)return;const t=e.changedTouches[0];this.Xf=t.identifier,this.Gf=Mu(e);const n=this.dp.ownerDocument.documentElement;this.Of=!1,this.Lf=!1,this.Kf=!1,this.Af=Oi(t),this.$f&&(this.$f(),this.$f=null);{const a=this.gp.bind(this),u=this.Tp.bind(this);this.$f=()=>{n.removeEventListener("touchmove",a),n.removeEventListener("touchend",u)},n.addEventListener("touchmove",a,{passive:!1}),n.addEventListener("touchend",u,{passive:!1}),this.pp(),this.Vf=setTimeout(this.Ep.bind(this,e),240)}const r=this.sp(e,t);this.hp(r,this.lp.Ap),this.Df||(this.Rf=0,this.Df=setTimeout(this.op.bind(this),500),this.If=Oi(t))}Lp(e){if(e.button!==0)return;const t=this.dp.ownerDocument.documentElement;M0()&&t.addEventListener("mouseleave",this.Qf),this.zf=!1,this.Ef=Oi(e),this.Uf&&(this.Uf(),this.Uf=null);{const r=this.kp.bind(this),a=this.tp.bind(this);this.Uf=()=>{t.removeEventListener("mousemove",r),t.removeEventListener("mouseup",a)},t.addEventListener("mousemove",r),t.addEventListener("mouseup",a)}if(this.Zf=!0,this.np(e))return;const n=this.sp(e);this._p(n,this.lp.zp),this.Pf||(this.kf=0,this.Pf=setTimeout(this.cp.bind(this),500),this.Tf=Oi(e))}fp(){this.dp.addEventListener("mouseenter",this.vp.bind(this)),this.dp.addEventListener("touchcancel",this.pp.bind(this));{const e=this.dp.ownerDocument,t=n=>{this.lp.Op&&(n.composed&&this.dp.contains(n.composedPath()[0])||n.target&&this.dp.contains(n.target)||this.lp.Op())};this.Ff=()=>{e.removeEventListener("touchstart",t)},this.Nf=()=>{e.removeEventListener("mousedown",t)},e.addEventListener("mousedown",t),e.addEventListener("touchstart",t,{passive:!0})}Lf()&&(this.Wf=()=>{this.dp.removeEventListener("dblclick",this.ip)},this.dp.addEventListener("dblclick",this.ip)),this.dp.addEventListener("mouseleave",this.Np.bind(this)),this.dp.addEventListener("touchstart",this.Bp.bind(this),{passive:!0}),uA(this.dp),this.dp.addEventListener("mousedown",this.Lp.bind(this)),this.Fp(),this.dp.addEventListener("touchmove",(()=>{}),{passive:!1})}Fp(){this.lp.Wp===void 0&&this.lp.Hp===void 0&&this.lp.Up===void 0||(this.dp.addEventListener("touchstart",(e=>this.$p(e.touches)),{passive:!0}),this.dp.addEventListener("touchmove",(e=>{if(e.touches.length===2&&this.jf!==null&&this.lp.Hp!==void 0){const t=E0(e.touches[0],e.touches[1])/this.qf;this.lp.Hp(this.jf,t),go(e)}}),{passive:!1}),this.dp.addEventListener("touchend",(e=>{this.$p(e.touches)})))}$p(e){e.length===1&&(this.Yf=!1),e.length!==2||this.Yf||this.Bf?this.jp():this.qp(e)}qp(e){const t=this.dp.getBoundingClientRect()||{left:0,top:0};this.jf={_t:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,ut:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this.qf=E0(e[0],e[1]),this.lp.Wp!==void 0&&this.lp.Wp(),this.pp()}jp(){this.jf!==null&&(this.jf=null,this.lp.Up!==void 0&&this.lp.Up())}Np(e){if(this.Hf&&this.Hf(),this.np(e)||!this.Jf)return;const t=this.sp(e);this._p(t,this.lp.Yp),this.Jf=!Lf()}Ep(e){const t=Df(e.touches,we(this.Xf));if(t===null)return;const n=this.sp(e,t);this.hp(n,this.lp.Kp),this.Of=!0,this.Bf=!0}np(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents!==void 0?e.sourceCapabilities.firesTouchEvents:Mu(e)<this.Gf+500}hp(e,t){t&&t.call(this.lp,e)}_p(e,t){t&&t.call(this.lp,e)}sp(e,t){const n=t||e,r=this.dp.getBoundingClientRect()||{left:0,top:0};return{clientX:n.clientX,clientY:n.clientY,pageX:n.pageX,pageY:n.pageY,screenX:n.screenX,screenY:n.screenY,localX:n.clientX-r.left,localY:n.clientY-r.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,Zp:!e.type.startsWith("mouse")&&e.type!=="contextmenu"&&e.type!=="click",Gp:e.type,Xp:n.target,gu:e.view,Jp:()=>{e.type!=="touchstart"&&go(e)}}}}function E0(s,e){const t=s.clientX-e.clientX,n=s.clientY-e.clientY;return Math.sqrt(t*t+n*n)}function go(s){s.cancelable&&s.preventDefault()}function Oi(s){return{_t:s.pageX,ut:s.pageY}}function Mu(s){return s.timeStamp||performance.now()}function Df(s,e){for(let t=0;t<s.length;++t)if(s[t].identifier===e)return s[t];return null}class cA{constructor(e,t,n){this.Qp=null,this.tv=null,this.iv=!0,this.nv=null,this.sv=e,this.ev=e.rv()[t],this.hv=e.rv()[n],this.av=document.createElement("tr"),this.av.style.height="1px",this.lv=document.createElement("td"),this.lv.style.position="relative",this.lv.style.padding="0",this.lv.style.margin="0",this.lv.setAttribute("colspan","3"),this.ov(),this.av.appendChild(this.lv),this.iv=this.sv.N().layout.panes.enableResize,this.iv?this._v():(this.Qp=null,this.tv=null)}m(){this.tv!==null&&this.tv.m()}uv(){return this.av}cv(){return Ot({width:this.ev.cv().width,height:1})}dv(){return Ot({width:this.ev.dv().width,height:1*window.devicePixelRatio})}fv(e,t,n){const r=this.dv();e.fillStyle=this.sv.N().layout.panes.separatorColor,e.fillRect(t,n,r.width,r.height)}kt(){this.ov(),this.sv.N().layout.panes.enableResize!==this.iv&&(this.iv=this.sv.N().layout.panes.enableResize,this.iv?this._v():(this.Qp!==null&&(this.lv.removeChild(this.Qp.pv),this.lv.removeChild(this.Qp.vv),this.Qp=null),this.tv!==null&&(this.tv.m(),this.tv=null)))}_v(){const e=document.createElement("div"),t=e.style;t.position="fixed",t.display="none",t.zIndex="49",t.top="0",t.left="0",t.width="100%",t.height="100%",t.cursor="row-resize",this.lv.appendChild(e);const n=document.createElement("div"),r=n.style;r.position="absolute",r.zIndex="50",r.top="-4px",r.height="9px",r.width="100%",r.backgroundColor="",r.cursor="row-resize",this.lv.appendChild(n);const a={wp:this.mv.bind(this),Yp:this.wv.bind(this),zp:this.Mv.bind(this),Ap:this.Mv.bind(this),Pp:this.gv.bind(this),yp:this.gv.bind(this),Ip:this.bv.bind(this),Rp:this.bv.bind(this)};this.tv=new rc(n,a,{xp:()=>!1,Cp:()=>!0}),this.Qp={vv:n,pv:e}}ov(){this.lv.style.background=this.sv.N().layout.panes.separatorColor}mv(e){this.Qp!==null&&(this.Qp.vv.style.backgroundColor=this.sv.N().layout.panes.separatorHoverColor)}wv(e){this.Qp!==null&&this.nv===null&&(this.Qp.vv.style.backgroundColor="")}Mv(e){if(this.Qp===null)return;const t=this.ev.Sv().z_()+this.hv.Sv().z_(),n=t/(this.ev.cv().height+this.hv.cv().height),r=30*n;t<=2*r||(this.nv={xv:e.pageY,Cv:this.ev.Sv().z_(),yv:t-r,kv:t,Pv:n,Tv:r},this.Qp.pv.style.display="block")}gv(e){const t=this.nv;if(t===null)return;const n=(e.pageY-t.xv)*t.Pv,r=bo(t.Cv+n,t.Tv,t.yv);this.ev.Sv().O_(r),this.hv.Sv().O_(t.kv-r),this.sv.Qt().Pa()}bv(e){this.nv!==null&&this.Qp!==null&&(this.nv=null,this.Qp.pv.style.display="none")}}function If(s,e){return s.Rv-e.Rv}function Uf(s,e,t){const n=(s.Rv-e.Rv)/(s.wt-e.wt);return Math.sign(n)*Math.min(Math.abs(n),t)}class hA{constructor(e,t,n,r){this.Dv=null,this.Iv=null,this.Vv=null,this.Bv=null,this.Ev=null,this.Av=0,this.Lv=0,this.zv=e,this.Ov=t,this.Nv=n,this.ks=r}Fv(e,t){if(this.Dv!==null){if(this.Dv.wt===t)return void(this.Dv.Rv=e);
4198if(Math.abs(this.Dv.Rv-e)<this.ks)return}this.Bv=this.Vv,this.Vv=this.Iv,this.Iv=this.Dv,this.Dv={wt:t,Rv:e}}me(e,t){if(this.Dv===null||this.Iv===null||t-this.Dv.wt>50)return;let n=0;const r=Uf(this.Dv,this.Iv,this.Ov),a=If(this.Dv,this.Iv),u=[r],c=[a];if(n+=a,this.Vv!==null){const d=Uf(this.Iv,this.Vv,this.Ov);if(Math.sign(d)===Math.sign(r)){const p=If(this.Iv,this.Vv);if(u.push(d),c.push(p),n+=p,this.Bv!==null){const m=Uf(this.Vv,this.Bv,this.Ov);if(Math.sign(m)===Math.sign(r)){const v=If(this.Vv,this.Bv);u.push(m),c.push(v),n+=v}}}}let h=0;for(let d=0;d<u.length;++d)h+=c[d]/n*u[d];Math.abs(h)<this.zv||(this.Ev={Rv:e,wt:t},this.Lv=h,this.Av=(function(d,p){const m=Math.log(p);return Math.log(1*m/-d)/m})(Math.abs(h),this.Nv))}qc(e){const t=we(this.Ev),n=e-t.wt;return t.Rv+this.Lv*(Math.pow(this.Nv,n)-1)/Math.log(this.Nv)}jc(e){return this.Ev===null||this.Wv(e)===this.Av}Wv(e){const t=e-we(this.Ev).wt;return Math.min(t,this.Av)}}class fA{constructor(e,t){this.Hv=void 0,this.Uv=void 0,this.$v=void 0,this.vn=!1,this.jv=e,this.qv=t,this.Yv()}kt(){this.Yv()}Kv(){this.Hv&&this.jv.removeChild(this.Hv),this.Uv&&this.jv.removeChild(this.Uv),this.Hv=void 0,this.Uv=void 0}Zv(){return this.vn!==this.Gv()||this.$v!==this.Xv()}Xv(){return this.qv.Qt().Xi().J(this.qv.N().layout.textColor)>160?"dark":"light"}Gv(){return this.qv.N().layout.attributionLogo}Jv(){const e=new URL(location.href);return e.hostname?"&utm_source="+e.hostname+e.pathname:""}Yv(){this.Zv()&&(this.Kv(),this.vn=this.Gv(),this.vn&&(this.$v=this.Xv(),this.Uv=document.createElement("style"),this.Uv.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.Hv=document.createElement("a"),this.Hv.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.Jv()}`,this.Hv.title="Charting by TradingView",this.Hv.id="tv-attr-logo",this.Hv.target="_blank",this.Hv.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.Hv.toggleAttribute("data-dark",this.$v==="dark"),this.jv.appendChild(this.Uv),this.jv.appendChild(this.Hv)))}}function Tr(s,e){const t=we(s.ownerDocument).createElement("canvas");s.appendChild(t);const n=KT(t,{options:{allowResizeObserver:!0},transform:(r,a)=>({width:Math.max(r.width,a.width),height:Math.max(r.height,a.height)})});return n.resizeCanvasElement(e),n}function Cr(s){var e;s.width=1,s.height=1,(e=s.getContext("2d"))==null||e.clearRect(0,0,1,1)}function zd(s,e,t,n){s.qh&&s.qh(e,t,n)}function Lu(s,e,t,n){s.st(e,t,n)}function Vd(s,e,t,n){const r=s(t,n);for(const a of r){const u=a.Tt(n);u!==null&&e(u)}}function Ff(s,e){return t=>{var n,r;return(function(a){return a.Ft!==void 0})(t)?(((n=t.Ft())==null?void 0:n.cl())??"")!==e?[]:((r=t.Ga)==null?void 0:r.call(t,s))??[]:[]}}function w0(s,e,t,n){if(!s.length)return;let r=0;const a=s[0].$t(n,!0);let u=e===1?t/2-(s[0].Hi()-a/2):s[0].Hi()-a/2-t/2;u=Math.max(0,u);for(let c=1;c<s.length;c++){const h=s[c],d=s[c-1],p=d.$t(n,!1),m=h.Hi(),v=d.Hi();if(e===1?m>v-p:m<v+p){const x=v-p*e;h.Ui(x);const M=x-e*p/2;if((e===1?M<0:M>t)&&u>0){const b=e===1?-1-M:M-t,y=Math.min(b,u);for(let S=r;S<s.length;S++)s[S].Ui(s[S].Hi()+e*y);u-=y}}else r=c,u=e===1?v-p-m:m-(v+p)}}class b0{constructor(e,t,n,r){this.Ki=null,this.Qv=null,this.tm=!1,this.im=new Hu(200),this.nm=null,this.sm=0,this.rm=!1,this.hm=()=>{this.rm||this.yt.am().Qt().mr()},this.lm=()=>{this.rm||this.yt.am().Qt().mr()},this.yt=e,this.yn=t,this.ko=t.layout,this.wd=n,this.om=r==="left",this._m=Ff("normal",r),this.um=Ff("top",r),this.dm=Ff("bottom",r),this.lv=document.createElement("div"),this.lv.style.height="100%",this.lv.style.overflow="hidden",this.lv.style.width="25px",this.lv.style.left="0",this.lv.style.position="relative",this.fm=Tr(this.lv,Ot({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);const a=this.fm.canvasElement;a.style.position="absolute",a.style.zIndex="1",a.style.left="0",a.style.top="0",this.pm=Tr(this.lv,Ot({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);const u=this.pm.canvasElement;
4198u.style.position="absolute",u.style.zIndex="2",u.style.left="0",u.style.top="0";const c={zp:this.Mv.bind(this),Ap:this.Mv.bind(this),Pp:this.gv.bind(this),yp:this.gv.bind(this),Op:this.vm.bind(this),Ip:this.bv.bind(this),Rp:this.bv.bind(this),up:this.wm.bind(this),ap:this.wm.bind(this),wp:this.Mm.bind(this),Yp:this.wv.bind(this)};this.tv=new rc(this.pm.canvasElement,c,{xp:()=>!this.yn.handleScroll.vertTouchDrag,Cp:()=>!0})}m(){this.tv.m(),this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),Cr(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),Cr(this.fm.canvasElement),this.fm.dispose(),this.Ki!==null&&this.Ki.a_().u(this),this.Ki=null}uv(){return this.lv}k(){return this.ko.fontSize}gm(){const e=this.wd.N();return this.nm!==e.P&&(this.im.Os(),this.nm=e.P),e}bm(){if(this.Ki===null)return 0;let e=0;const t=this.gm(),n=we(this.fm.canvasElement.getContext("2d",{colorSpace:this.yt.am().N().layout.colorSpace}));n.save();const r=this.Ki.El();n.font=this.Sm(),r.length>0&&(e=Math.max(this.im.Ii(n,r[0].io),this.im.Ii(n,r[r.length-1].io)));const a=this.xm();for(let d=a.length;d--;){const p=this.im.Ii(n,a[d].ri());p>e&&(e=p)}const u=this.Ki.Lt();if(u!==null&&this.Qv!==null&&(c=this.yn.crosshair).mode!==2&&c.horzLine.visible&&c.horzLine.labelVisible){const d=this.Ki.Tn(1,u),p=this.Ki.Tn(this.Qv.height-2,u);e=Math.max(e,this.im.Ii(n,this.Ki.Ji(Math.floor(Math.min(d,p))+.11111111111111,u)),this.im.Ii(n,this.Ki.Ji(Math.ceil(Math.max(d,p))-.11111111111111,u)))}var c;n.restore();const h=e||34;return Bd(Math.ceil(t.S+t.C+t.V+t.B+5+h))}Cm(e){this.Qv!==null&&Sr(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`)}ym(){return we(this.Qv).width}un(e){this.Ki!==e&&(this.Ki!==null&&this.Ki.a_().u(this),this.Ki=e,e.a_().i(this.po.bind(this),this))}Ft(){return this.Ki}Os(){const e=this.yt.Sv();this.yt.am().Qt().eu(e,we(this.Ft()))}km(e){if(this.Qv===null)return;const t={colorSpace:this.yt.am().N().layout.colorSpace};if(e!==1){this.Pm(),this.fm.applySuggestedBitmapSize();const r=wr(this.fm,t);r!==null&&(r.useBitmapCoordinateSpace((a=>{this.Tm(a),this.Rm(a)})),this.yt.Dm(r,this.dm),this.Im(r),this.yt.Dm(r,this._m),this.Vm(r))}this.pm.applySuggestedBitmapSize();const n=wr(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:r,bitmapSize:a})=>{r.clearRect(0,0,a.width,a.height)})),this.Bm(n),this.yt.Dm(n,this.um))}dv(){return this.fm.bitmapSize}fv(e,t,n,r){const a=this.dv();if(a.width>0&&a.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){const u=this.pm.canvasElement;e.drawImage(u,t,n)}}kt(){var e;(e=this.Ki)==null||e.El()}Mv(e){if(this.Ki===null||this.Ki.Gi()||!this.yn.handleScale.axisPressedMouseMove.price)return;const t=this.yt.am().Qt(),n=this.yt.Sv();this.tm=!0,t.G_(n,this.Ki,e.localY)}gv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;const t=this.yt.am().Qt(),n=this.yt.Sv(),r=this.Ki;t.X_(n,r,e.localY)}vm(){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;const e=this.yt.am().Qt(),t=this.yt.Sv(),n=this.Ki;this.tm&&(this.tm=!1,e.J_(t,n))}bv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;const t=this.yt.am().Qt(),n=this.yt.Sv();this.tm=!1,t.J_(n,this.Ki)}wm(e){this.yn.handleScale.axisDoubleClickReset.price&&this.Os()}Mm(e){this.Ki!==null&&(!this.yt.am().Qt().N().handleScale.axisPressedMouseMove.price||this.Ki.je()||this.Ki.Lo()||this.Em(1))}wv(e){this.Em(0)}xm(){const e=[],t=this.Ki===null?void 0:this.Ki;return(n=>{for(let r=0;r<n.length;++r){const a=n[r].qn(this.yt.Sv(),t);for(let u=0;u<a.length;u++)e.push(a[u])}})(this.yt.Sv().Dt()),e}Tm({context:e,bitmapSize:t}){const{width:n,height:r}=t,a=this.yt.Sv().Qt(),u=a.$(),c=a.ef();u===c?ec(e,0,0,n,r,u):q_(e,0,0,n,r,u,c)}Rm({context:e,bitmapSize:t,horizontalPixelRatio:n}){if(this.Qv===null||this.Ki===null||!this.Ki.N().borderVisible)return;e.fillStyle=this.Ki.N().borderColor;const r=Math.max(1,Math.floor(this.gm().S*n));let a;a=this.om?t.width-r:0,e.fillRect(a,0,r,t.height)}Im(e){if(this.Qv===null||this.Ki===null)return;const t=this.Ki.El(),n=this.Ki.N(),r=this.gm(),a=this.om?this.Qv.width-r.C:0;n.borderVisible&&n.ticksVisible&&e.useBitmapCoordinateSpace((({context:u,horizontalPixelRatio:c,verticalPixelRatio:h})=>{u.fillStyle=n.borderColor;
4198const d=Math.max(1,Math.floor(h)),p=Math.floor(.5*h),m=Math.round(r.C*c);u.beginPath();for(const v of t)u.rect(Math.floor(a*c),Math.round(v.Rl*h)-p,m,d);u.fill()})),e.useMediaCoordinateSpace((({context:u})=>{u.font=this.Sm(),u.fillStyle=n.textColor??this.ko.textColor,u.textAlign=this.om?"right":"left",u.textBaseline="middle";const c=this.om?Math.round(a-r.V):Math.round(a+r.C+r.V),h=t.map((d=>this.im.Di(u,d.io)));for(let d=t.length;d--;){const p=t[d];u.fillText(p.io,c,p.Rl+h[d])}}))}Pm(){if(this.Qv===null||this.Ki===null)return;let e=this.Qv.height/2;const t=[],n=this.Ki.Dt().slice(),r=this.yt.Sv(),a=this.gm();this.Ki===r.Gs()&&this.yt.Sv().Dt().forEach((h=>{r.Zs(h)&&n.push(h)}));const u=this.Ki.Cl()[0],c=this.Ki;n.forEach((h=>{const d=h.qn(r,c);d.forEach((p=>{p.$i()&&p.Wi()===null&&(p.Ui(null),t.push(p))})),u===h&&d.length>0&&(e=d[0].Ei())})),this.Ki.N().alignLabels&&this.Am(t,a,e)}Am(e,t,n){if(this.Qv===null)return;const r=e.filter((u=>u.Ei()<=n)),a=e.filter((u=>u.Ei()>n));r.sort(((u,c)=>c.Ei()-u.Ei())),r.length&&a.length&&a.push(r[0]),a.sort(((u,c)=>u.Ei()-c.Ei()));for(const u of e){const c=Math.floor(u.$t(t)/2),h=u.Ei();h>-c&&h<c&&u.Ui(c),h>this.Qv.height-c&&h<this.Qv.height+c&&u.Ui(this.Qv.height-c)}w0(r,1,this.Qv.height,t),w0(a,-1,this.Qv.height,t)}Vm(e){if(this.Qv===null)return;const t=this.xm(),n=this.gm(),r=this.om?"right":"left";t.forEach((a=>{a.ji()&&a.Tt(we(this.Ki)).st(e,n,this.im,r)}))}Bm(e){if(this.Qv===null||this.Ki===null)return;const t=this.yt.am().Qt(),n=[],r=this.yt.Sv(),a=t.Rd().qn(r,this.Ki);a.length&&n.push(a);const u=this.gm(),c=this.om?"right":"left";n.forEach((h=>{h.forEach((d=>{d.Tt(we(this.Ki)).st(e,u,this.im,c)}))}))}Em(e){this.lv.style.cursor=e===1?"ns-resize":"default"}po(){const e=this.bm();this.sm<e&&this.yt.am().Qt().Pa(),this.sm=e}Sm(){return Vu(this.ko.fontSize,this.ko.fontFamily)}}function dA(s,e){var t;return((t=s.Ka)==null?void 0:t.call(s,e))??[]}function T0(s,e){var t;return((t=s.jn)==null?void 0:t.call(s,e))??[]}function C0(s,e){var t;return((t=s.cn)==null?void 0:t.call(s,e))??[]}function pA(s,e){var t;return((t=s.ja)==null?void 0:t.call(s,e))??[]}class cp{constructor(e,t){this.Qv=Ot({width:0,height:0}),this.Lm=null,this.zm=null,this.Om=null,this.Nm=null,this.Fm=!1,this.Wm=new tn,this.Hm=new tn,this.Um=0,this.$m=!1,this.jm=null,this.qm=!1,this.Ym=null,this.Km=null,this.rm=!1,this.hm=()=>{this.rm||this.Zm===null||this.sn().mr()},this.lm=()=>{this.rm||this.Zm===null||this.sn().mr()},this.qv=e,this.Zm=t,this.Zm.fu().i(this.Gm.bind(this),this,!0),this.Xm=document.createElement("td"),this.Xm.style.padding="0",this.Xm.style.position="relative";const n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.position="relative",n.style.overflow="hidden",this.Jm=document.createElement("td"),this.Jm.style.padding="0",this.Qm=document.createElement("td"),this.Qm.style.padding="0",this.Xm.appendChild(n),this.fm=Tr(n,Ot({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);const r=this.fm.canvasElement;r.style.position="absolute",r.style.zIndex="1",r.style.left="0",r.style.top="0",this.pm=Tr(n,Ot({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);const a=this.pm.canvasElement;a.style.position="absolute",a.style.zIndex="2",a.style.left="0",a.style.top="0",this.av=document.createElement("tr"),this.av.appendChild(this.Jm),this.av.appendChild(this.Xm),this.av.appendChild(this.Qm),this.tw(),this.tv=new rc(this.pm.canvasElement,this,{xp:()=>this.jm===null&&!this.qv.N().handleScroll.vertTouchDrag,Cp:()=>this.jm===null&&!this.qv.N().handleScroll.horzTouchDrag})}m(){this.Lm!==null&&this.Lm.m(),this.zm!==null&&this.zm.m(),this.Om=null,this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),Cr(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),Cr(this.fm.canvasElement),this.fm.dispose(),this.Zm!==null&&(this.Zm.fu().u(this),this.Zm.m()),this.tv.m()}Sv(){return we(this.Zm)}iw(e){var t;this.Zm!==null&&this.Zm.fu().u(this),this.Zm=e,this.Zm!==null&&this.Zm.fu().i(cp.prototype.Gm.bind(this),this,!0),this.tw(),this.qv.rv().indexOf(this)===this.qv.rv().length-1?(this.Om=this.Om??new fA(this.Xm,this.qv),this.Om.kt()):((t=this.Om)==null||t.Kv(),this.Om=null)}am(){return this.qv}uv(){return this.av}tw(){if(this.Zm!==null&&(this.nw(),this.sn().Jn().length!==0)){if(this.Lm!==null){const e=this.Zm.K_();this.Lm.un(we(e))}if(this.zm!==null){const e=this.Zm.Z_();this.zm.un(we(e))}}}sw(){this.Lm!==null&&this.Lm.kt(),this.zm!==null&&this.zm.kt()}z_(){return this.Zm!==null?this.Zm.z_():0}O_(e){this.Zm&&this.Zm.O_(e)}wp(e){if(!this.Zm)return;this.ew();const t=e.localX,n=e.localY;this.rw(t,n,e)}zp(e){this.ew(),this.hw(),this.rw(e.localX,e.localY,e)}Mp(e){if(!this.Zm)return;this.ew();const t=e.localX,n=e.localY;this.rw(t,n,e)}Vp(e){this.Zm!==null&&(this.ew(),this.rw(e.localX,e.localY,e),this.aw(e))}up(e){this.Zm!==null&&this.lw(this.Hm,e)}ap(e){this.up(e)}Pp(e){this.ew(),this.ow(e),this.rw(e.localX,e.localY,e)}Ip(e){this.Zm!==null&&(this.ew(),this.$m=!1,this._w(e))}Dp(e){this.Zm!==null&&this.aw(e)}Kp(e){if(this.$m=!0,this.jm===null){const t={x:e.localX,y:e.localY};this.uw(t,t,e)}}Yp(e){this.Zm!==null&&(this.ew(),this.Zm.Qt().kd(null),this.cw())}dw(){return this.Wm}fw(){return this.Hm}Wp(){this.Um=1,this.sn().cs()}Hp(e,t){if(!this.qv.N().handleScale.pinch)return;const n=5*(t-this.Um);this.Um=t,this.sn().Od(e._t,n)}Ap(e){this.$m=!1,this.qm=this.jm!==null,this.hw();const t=this.sn().Rd();this.jm!==null&&t.It()&&(this.Ym={x:t.ni(),y:t.si()},this.jm={x:e.localX,y:e.localY})}yp(e){if(this.Zm===null)return;const t=e.localX,n=e.localY;if(this.jm===null)this.ow(e);else{this.qm=!1;const r=we(this.Ym),a=r.x+(t-this.jm.x),u=r.y+(n-this.jm.y);this.rw(a,u,e)}}Rp(e){this.am().N().trackingMode.exitMode===0&&(this.qm=!0),this.pw(),this._w(e)}Qs(e,t){const n=this.Zm;return n===null?null:sx(n,e,t)}mw(e,t){we(t==="left"?this.Lm:this.zm).Cm(Ot({width:e,height:this.Qv.height}))}cv(){return this.Qv}Cm(e){Sr(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.Xm.style.width=e.width+"px",this.Xm.style.height=e.height+"px")}ww(){const e=we(this.Zm);e.q_(e.K_()),e.q_(e.Z_());for(const t of e.Cl())if(e.Zs(t)){const n=t.Ft();n!==null&&e.q_(n),t.Nn()}for(const t of e.vu())t.Nn()}dv(){return this.fm.bitmapSize}fv(e,t,n,r){const a=this.dv();if(a.width>0&&a.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){const u=this.pm.canvasElement;e!==null&&e.drawImage(u,t,n)}}km(e){if(e===0||this.Zm===null)return;e>1&&this.ww(),this.Lm!==null&&this.Lm.km(e),this.zm!==null&&this.zm.km(e);const t={colorSpace:this.qv.N().layout.colorSpace};if(e!==1){this.fm.applySuggestedBitmapSize();const r=wr(this.fm,t);r!==null&&(r.useBitmapCoordinateSpace((a=>{this.Tm(a)})),this.Zm&&(this.Mw(r,dA),this.gw(r),this.Mw(r,T0),this.Mw(r,C0)))}this.pm.applySuggestedBitmapSize();
4198const n=wr(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:r,bitmapSize:a})=>{r.clearRect(0,0,a.width,a.height)})),this.bw(n),this.Mw(n,pA),this.Mw(n,C0))}Sw(){return this.Lm}xw(){return this.zm}Dm(e,t){this.Mw(e,t)}Gm(){this.Zm!==null&&this.Zm.fu().u(this),this.Zm=null}aw(e){this.lw(this.Wm,e)}lw(e,t){const n=t.localX,r=t.localY;e.v()&&e.p(this.sn().Et().Rc(n),{x:n,y:r},t)}Tm({context:e,bitmapSize:t}){const{width:n,height:r}=t,a=this.sn(),u=a.$(),c=a.ef();u===c?ec(e,0,0,n,r,c):q_(e,0,0,n,r,u,c)}gw(e){const t=we(this.Zm),n=t.pu().wr().Tt(t);n!==null&&n.st(e,!1)}bw(e){this.Cw(e,T0,Lu,this.sn().Rd())}Mw(e,t){const n=we(this.Zm),r=n.au(),a=n.vu();for(const u of a)this.Cw(e,t,zd,u);for(const u of r)this.Cw(e,t,zd,u);for(const u of a)this.Cw(e,t,Lu,u);for(const u of r)this.Cw(e,t,Lu,u)}Cw(e,t,n,r){const a=we(this.Zm),u=a.Qt().ou(),c=u!==null&&u.lu===r,h=u!==null&&c&&u.wu!==void 0?u.wu.ie:void 0;Vd(t,(d=>n(d,e,c,h)),r,a)}nw(){if(this.Zm===null)return;const e=this.qv,t=this.Zm.K_().N().visible,n=this.Zm.Z_().N().visible;t||this.Lm===null||(this.Jm.removeChild(this.Lm.uv()),this.Lm.m(),this.Lm=null),n||this.zm===null||(this.Qm.removeChild(this.zm.uv()),this.zm.m(),this.zm=null);const r=e.Qt().Zd();t&&this.Lm===null&&(this.Lm=new b0(this,e.N(),r,"left"),this.Jm.appendChild(this.Lm.uv())),n&&this.zm===null&&(this.zm=new b0(this,e.N(),r,"right"),this.Qm.appendChild(this.zm.uv()))}yw(e){return e.Zp&&this.$m||this.jm!==null}rw(e,t,n){e=Math.max(0,Math.min(e,this.Qv.width-1)),t=Math.max(0,Math.min(t,this.Qv.height-1)),this.sn().jd(e,t,n,we(this.Zm))}cw(){this.sn().Yd()}pw(){this.qm&&(this.jm=null,this.cw())}uw(e,t,n){this.jm=e,this.qm=!1,this.rw(t.x,t.y,n);const r=this.sn().Rd();this.Ym={x:r.ni(),y:r.si()}}sn(){return this.qv.Qt()}_w(e){if(!this.Fm)return;const t=this.sn(),n=this.Sv();if(t.iu(n,n.Pn()),this.Nm=null,this.Fm=!1,t.Hd(),this.Km!==null){const r=performance.now(),a=t.Et();this.Km.me(a.Ac(),r),this.Km.jc(r)||t.ps(this.Km)}}ew(){this.jm=null}hw(){if(this.Zm){if(this.sn().cs(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)we(document.activeElement).blur();else{const e=document.getSelection();e!==null&&e.removeAllRanges()}!this.Zm.Pn().Gi()&&this.sn().Et().Gi()}}ow(e){if(this.Zm===null)return;const t=this.sn(),n=t.Et();if(n.Gi())return;const r=this.qv.N(),a=r.handleScroll,u=r.kineticScroll;if((!a.pressedMouseMove||e.Zp)&&(!a.horzTouchDrag&&!a.vertTouchDrag||!e.Zp))return;const c=this.Zm.Pn(),h=performance.now();if(this.Nm!==null||this.yw(e)||(this.Nm={x:e.clientX,y:e.clientY,Sf:h,kw:e.localX,Pw:e.localY}),this.Nm!==null&&!this.Fm&&(this.Nm.x!==e.clientX||this.Nm.y!==e.clientY)){if(e.Zp&&u.touch||!e.Zp&&u.mouse){const d=n.fl();this.Km=new hA(.2/d,7/d,.997,15/d),this.Km.Fv(n.Ac(),this.Nm.Sf)}else this.Km=null;c.Gi()||t.Q_(this.Zm,c,e.localY),t.Fd(e.localX),this.Fm=!0}this.Fm&&(c.Gi()||t.tu(this.Zm,c,e.localY),t.Wd(e.localX),this.Km!==null&&this.Km.Fv(n.Ac(),h))}}class A0{constructor(e,t,n,r,a){this.xt=!0,this.Qv=Ot({width:0,height:0}),this.hm=()=>this.km(3),this.om=e==="left",this.wd=n.Zd,this.yn=t,this.Tw=r,this.Rw=a,this.lv=document.createElement("div"),this.lv.style.width="25px",this.lv.style.height="100%",this.lv.style.overflow="hidden",this.fm=Tr(this.lv,Ot({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm)}m(){this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),Cr(this.fm.canvasElement),this.fm.dispose()}uv(){return this.lv}cv(){return this.Qv}Cm(e){Sr(this.Qv,e)||(this.Qv=e,this.fm.resizeCanvasElement(e),this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`,this.xt=!0)}km(e){if(e<3&&!this.xt||this.Qv.width===0||this.Qv.height===0)return;this.xt=!1,this.fm.applySuggestedBitmapSize();const t=wr(this.fm,{colorSpace:this.yn.layout.colorSpace});t!==null&&t.useBitmapCoordinateSpace((n=>{this.Tm(n),this.Rm(n)}))}dv(){return this.fm.bitmapSize}fv(e,t,n){const r=this.dv();r.width>0&&r.height>0&&e.drawImage(this.fm.canvasElement,t,n)}Rm({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(!this.Tw())return;e.fillStyle=this.yn.timeScale.borderColor;const a=Math.floor(this.wd.N().S*n),u=Math.floor(this.wd.N().S*r),
vendor: 12,697 bytes, line 4198
4198c=this.om?t.width-a:0;e.fillRect(c,0,a,u)}Tm({context:e,bitmapSize:t}){ec(e,0,0,t.width,t.height,this.Rw())}}function hp(s){return e=>{var t;return((t=e.Xa)==null?void 0:t.call(e,s))??[]}}const mA=hp("normal"),gA=hp("top"),vA=hp("bottom");class _A{constructor(e,t){this.Dw=null,this.Iw=null,this.M=null,this.Vw=!1,this.Qv=Ot({width:0,height:0}),this.Bw=new tn,this.im=new Hu(5),this.rm=!1,this.hm=()=>{this.rm||this.qv.Qt().mr()},this.lm=()=>{this.rm||this.qv.Qt().mr()},this.qv=e,this.xu=t,this.yn=e.N().layout,this.Hv=document.createElement("tr"),this.Ew=document.createElement("td"),this.Ew.style.padding="0",this.Aw=document.createElement("td"),this.Aw.style.padding="0",this.lv=document.createElement("td"),this.lv.style.height="25px",this.lv.style.padding="0",this.Lw=document.createElement("div"),this.Lw.style.width="100%",this.Lw.style.height="100%",this.Lw.style.position="relative",this.Lw.style.overflow="hidden",this.lv.appendChild(this.Lw),this.fm=Tr(this.Lw,Ot({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);const n=this.fm.canvasElement;n.style.position="absolute",n.style.zIndex="1",n.style.left="0",n.style.top="0",this.pm=Tr(this.Lw,Ot({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);const r=this.pm.canvasElement;r.style.position="absolute",r.style.zIndex="2",r.style.left="0",r.style.top="0",this.Hv.appendChild(this.Ew),this.Hv.appendChild(this.lv),this.Hv.appendChild(this.Aw),this.zw(),this.qv.Qt().L_().i(this.zw.bind(this),this),this.tv=new rc(this.pm.canvasElement,this,{xp:()=>!0,Cp:()=>!this.qv.N().handleScroll.horzTouchDrag})}m(){this.tv.m(),this.Dw!==null&&this.Dw.m(),this.Iw!==null&&this.Iw.m(),this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),Cr(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),Cr(this.fm.canvasElement),this.fm.dispose()}uv(){return this.Hv}Ow(){return this.Dw}Nw(){return this.Iw}zp(e){if(this.Vw)return;this.Vw=!0;const t=this.qv.Qt();!t.Et().Gi()&&this.qv.N().handleScale.axisPressedMouseMove.time&&t.zd(e.localX)}Ap(e){this.zp(e)}Op(){const e=this.qv.Qt();!e.Et().Gi()&&this.Vw&&(this.Vw=!1,this.qv.N().handleScale.axisPressedMouseMove.time&&e.$d())}Pp(e){const t=this.qv.Qt();!t.Et().Gi()&&this.qv.N().handleScale.axisPressedMouseMove.time&&t.Ud(e.localX)}yp(e){this.Pp(e)}Ip(){this.Vw=!1;const e=this.qv.Qt();e.Et().Gi()&&!this.qv.N().handleScale.axisPressedMouseMove.time||e.$d()}Rp(){this.Ip()}up(){this.qv.N().handleScale.axisDoubleClickReset.time&&this.qv.Qt().ws()}ap(){this.up()}wp(){this.qv.Qt().N().handleScale.axisPressedMouseMove.time&&this.Em(1)}Yp(){this.Em(0)}cv(){return this.Qv}Fw(){return this.Bw}Ww(e,t,n){Sr(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`,this.Bw.p(e)),this.Dw!==null&&this.Dw.Cm(Ot({width:t,height:e.height})),this.Iw!==null&&this.Iw.Cm(Ot({width:n,height:e.height}))}Hw(){const e=this.Uw();return Math.ceil(e.S+e.C+e.k+e.A+e.I+e.$w)}kt(){this.qv.Qt().Et().El()}dv(){return this.fm.bitmapSize}fv(e,t,n,r){const a=this.dv();if(a.width>0&&a.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){const u=this.pm.canvasElement;e.drawImage(u,t,n)}}km(e){if(e===0)return;const t={colorSpace:this.yn.colorSpace};if(e!==1){this.fm.applySuggestedBitmapSize();const r=wr(this.fm,t);r!==null&&(r.useBitmapCoordinateSpace((a=>{this.Tm(a),this.Rm(a),this.jw(r,vA)})),this.Im(r),this.jw(r,mA)),this.Dw!==null&&this.Dw.km(e),this.Iw!==null&&this.Iw.km(e)}this.pm.applySuggestedBitmapSize();const n=wr(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:r,bitmapSize:a})=>{r.clearRect(0,0,a.width,a.height)})),this.qw([...this.qv.Qt().Jn(),this.qv.Qt().Rd()],n),this.jw(n,gA))}jw(e,t){const n=this.qv.Qt().Jn();for(const r of n)Vd(t,(a=>zd(a,e,!1,void 0)),r,void 0);for(const r of n)Vd(t,(a=>Lu(a,e,!1,void 0)),r,void 0)}Tm({context:e,bitmapSize:t}){ec(e,0,0,t.width,t.height,this.qv.Qt().ef())}Rm({context:e,bitmapSize:t,verticalPixelRatio:n}){if(this.qv.N().timeScale.borderVisible){e.fillStyle=this.Yw();const r=Math.max(1,Math.floor(this.Uw().S*n));e.fillRect(0,0,t.width,r)}}Im(e){const t=this.qv.Qt().Et(),n=t.El();if(!n||n.length===0)return;const r=this.xu.maxTickMarkWeight(n),a=this.Uw(),u=t.N();u.borderVisible&&u.ticksVisible&&e.useBitmapCoordinateSpace((({context:c,horizontalPixelRatio:h,verticalPixelRatio:d})=>{c.strokeStyle=this.Yw(),c.fillStyle=this.Yw();const p=Math.max(1,Math.floor(h)),m=Math.floor(.5*h);c.beginPath();const v=Math.round(a.C*d);for(let x=n.length;x--;){const M=Math.round(n[x].coord*h);c.rect(M-m,0,p,v)}c.fill()})),e.useMediaCoordinateSpace((({context:c})=>{const h=a.S+a.C+a.A+a.k/2;c.textAlign="center",c.textBaseline="middle",c.fillStyle=this.H(),c.font=this.Sm();for(const d of n)if(d.weight<r){const p=d.needAlignCoordinate?this.Kw(c,d.coord,d.label):d.coord;c.fillText(d.label,p,h)}this.qv.N().timeScale.allowBoldLabels&&(c.font=this.Zw());for(const d of n)if(d.weight>=r){const p=d.needAlignCoordinate?this.Kw(c,d.coord,d.label):d.coord;c.fillText(d.label,p,h)}}))}Kw(e,t,n){const r=this.im.Ii(e,n),a=r/2,u=Math.floor(t-a)+.5;return u<0?t+=Math.abs(0-u):u+r>this.Qv.width&&(t-=Math.abs(this.Qv.width-(u+r))),t}qw(e,t){const n=this.Uw();for(const r of e)for(const a of r.dn())a.Tt().st(t,n)}Yw(){return this.qv.N().timeScale.borderColor}H(){return this.yn.textColor}F(){return this.yn.fontSize}Sm(){return Vu(this.F(),this.yn.fontFamily)}Zw(){return Vu(this.F(),this.yn.fontFamily,"bold")}Uw(){this.M===null&&(this.M={S:1,L:NaN,A:NaN,I:NaN,tn:NaN,C:5,k:NaN,P:"",Qi:new Hu,$w:0});const e=this.M,t=this.Sm();if(e.P!==t){const n=this.F();e.k=n,e.P=t,e.A=3*n/12,e.I=3*n/12,e.tn=9*n/12,e.L=0,e.$w=4*n/12,e.Qi.Os()}return this.M}Em(e){this.lv.style.cursor=e===1?"ew-resize":"default"}zw(){const e=this.qv.Qt(),t=e.N();t.leftPriceScale.visible||this.Dw===null||(this.Ew.removeChild(this.Dw.uv()),this.Dw.m(),this.Dw=null),t.rightPriceScale.visible||this.Iw===null||(this.Aw.removeChild(this.Iw.uv()),this.Iw.m(),this.Iw=null);const n={Zd:this.qv.Qt().Zd()},r=()=>t.leftPriceScale.borderVisible&&e.Et().N().borderVisible,a=()=>e.ef();t.leftPriceScale.visible&&this.Dw===null&&(this.Dw=new A0("left",t,n,r,a),this.Ew.appendChild(this.Dw.uv())),t.rightPriceScale.visible&&this.Iw===null&&(this.Iw=new A0("right",t,n,r,a),this.Aw.appendChild(this.Iw.uv()))}}var s_;const xA=!!Lo&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((s=>s.brand.includes("Chromium")))&&!!Lo&&((s_=navigator==null?void 0:navigator.userAgentData)!=null&&s_.platform?navigator.userAgentData.platform==="Windows":navigator.userAgent.toLowerCase().indexOf("win")>=0);class SA{constructor(e,t,n){var r;this.Gw=[],this.Xw=[],this.Jw=0,this.ho=0,this.C_=0,this.Qw=0,this.tM=0,this.iM=null,this.nM=!1,this.Wm=new tn,this.Hm=new tn,this.pd=new tn,this.sM=null,this.eM=null,this.jv=e,this.yn=t,this.xu=n,this.Hv=document.createElement("div"),this.Hv.classList.add("tv-lightweight-charts"),this.Hv.style.overflow="hidden",this.Hv.style.direction="ltr",this.Hv.style.width="100%",this.Hv.style.height="100%",(r=this.Hv).style.userSelect="none",r.style.webkitUserSelect="none",r.style.msUserSelect="none",r.style.MozUserSelect="none",r.style.webkitTapHighlightColor="transparent",this.rM=document.createElement("table"),this.rM.setAttribute("cellspacing","0"),this.Hv.appendChild(this.rM),this.hM=this.aM.bind(this),Of(this.yn)&&this.lM(!0),this.sn=new iA(this.md.bind(this),this.yn,n),this.Qt().Dd().i(this.oM.bind(this),this),this._M=new _A(this,this.xu),this.rM.appendChild(this._M.uv());const a=t.autoSize&&this.uM();let u=this.yn.width,c=this.yn.height;if(a||u===0||c===0){const h=e.getBoundingClientRect();u=u||h.width,c=c||h.height}this.cM(u,c),this.dM(),e.appendChild(this.Hv),this.fM(),this.sn.Et().Zc().i(this.sn.Pa.bind(this.sn),this),this.sn.L_().i(this.sn.Pa.bind(this.sn),this)}Qt(){return this.sn}N(){return this.yn}rv(){return this.Gw}pM(){return this._M}m(){this.lM(!1),this.Jw!==0&&window.cancelAnimationFrame(this.Jw),this.sn.Dd().u(this),this.sn.Et().Zc().u(this),this.sn.L_().u(this),this.sn.m();for(const e of this.Gw)this.rM.removeChild(e.uv()),e.dw().u(this),e.fw().u(this),e.m();this.Gw=[];for(const e of this.Xw)this.vM(e);this.Xw=[],we(this._M).m(),this.Hv.parentElement!==null&&this.Hv.parentElement.removeChild(this.Hv),this.pd.m(),this.Wm.m(),this.Hm.m(),this.mM()}cM(e,t,n=!1){if(this.ho===t&&this.C_===e)return;const r=(function(c){const h=Math.floor(c.width),d=Math.floor(c.height);return Ot({width:h-h%2,height:d-d%2})})(Ot({width:e,height:t}));this.ho=r.height,this.C_=r.width;const a=this.ho+"px",u=this.C_+"px";if(this.wM()||(we(this.Hv).style.height=a,we(this.Hv).style.width=u),this.rM.style.height=a,this.rM.style.width=u,n){this.Jw!==0&&(window.cancelAnimationFrame(this.Jw),this.Jw=0),this.nM=!1;const c=Sn.ys();this.iM!==null&&(c.Ss(this.iM),this.iM=null),this.MM(c,performance.now())}else this.sn.Pa()}km(e){e===void 0&&(e=Sn.ys());for(let t=0;t<this.Gw.length;t++)this.Gw[t].km(e._s(t).rs);this.yn.timeScale.visible&&this._M.km(e.ls())}vr(e){var r;const t=Of(this.yn);this.sn.vr(e);const n=Of(this.yn);n!==t&&this.lM(n),(r=e.layout)!=null&&r.panes&&this.gM(),this.fM(),this.bM(e)}dw(){return this.Wm}fw(){return this.Hm}Dd(){return this.pd}SM(e=!1){this.iM!==null&&(this.MM(this.iM,performance.now()),this.iM=null);const t=this.xM(null),n=document.createElement("canvas");n.width=t.width,n.height=t.height;const r=we(n.getContext("2d"));return this.xM(r,e),n}CM(e){return e==="left"&&!this.yM()||e==="right"&&!this.kM()||this.Gw.length===0?0:we(e==="left"?this.Gw[0].Sw():this.Gw[0].xw()).ym()}wM(){return this.yn.autoSize&&this.sM!==null}vv(){return this.Hv}PM(e){this.eM=e,this.eM?this.vv().style.setProperty("cursor",e):this.vv().style.removeProperty("cursor")}TM(){return this.eM}RM(e){return Yn(this.Gw[e]).cv()}gM(){this.Xw.forEach((e=>{e.kt()}))}bM(e){(e.autoSize!==void 0||!this.sM||e.width===void 0&&e.height===void 0)&&(e.autoSize&&!this.sM&&this.uM(),e.autoSize===!1&&this.sM!==null&&this.mM(),e.autoSize||e.width===void 0&&e.height===void 0||this.cM(e.width||this.C_,e.height||this.ho))}xM(e,t){let n=0,r=0;const a=this.Gw[0],u=(h,d)=>{let p=0;for(let m=0;m<this.Gw.length;m++){const v=this.Gw[m],x=we(h==="left"?v.Sw():v.xw()),M=x.dv();if(e!==null&&x.fv(e,d,p,t),p+=M.height,m<this.Gw.length-1){const b=this.Xw[m],y=b.dv();e!==null&&b.fv(e,d,p),p+=y.height}}};this.yM()&&(u("left",0),n+=we(a.Sw()).dv().width);for(let h=0;h<this.Gw.length;h++){const d=this.Gw[h],p=d.dv();if(e!==null&&d.fv(e,n,r,t),r+=p.height,h<this.Gw.length-1){const m=this.Xw[h],v=m.dv();e!==null&&m.fv(e,n,r),r+=v.height}}n+=a.dv().width,this.kM()&&(u("right",n),n+=we(a.xw()).dv().width);const c=(h,d,p)=>{we(h==="left"?this._M.Ow():this._M.Nw()).fv(we(e),d,p)};if(this.yn.timeScale.visible){const h=this._M.dv();if(e!==null){let d=0;this.yM()&&(c("left",d,r),d=we(a.Sw()).dv().width),this._M.fv(e,d,r,t),d+=h.width,this.kM()&&c("right",d,r)}r+=h.height}return Ot({width:n,height:r})}DM(){let e=0,t=0,n=0;for(const y of this.Gw)this.yM()&&(t=Math.max(t,we(y.Sw()).bm(),this.yn.leftPriceScale.minimumWidth)),this.kM()&&(n=Math.max(n,we(y.xw()).bm(),this.yn.rightPriceScale.minimumWidth)),e+=y.z_();t=Bd(t),n=Bd(n);const r=this.C_,a=this.ho,u=Math.max(r-t-n,0),c=1*this.Xw.length,h=this.yn.timeScale.visible;let d=h?Math.max(this._M.Hw(),this.yn.timeScale.minimumHeight):0;var p;d=(p=d)+p%2;const m=c+d,v=a<m?0:a-m,x=v/e;let M=0;const b=window.devicePixelRatio||1;for(let y=0;y<this.Gw.length;++y){const S=this.Gw[y];S.iw(this.sn.Zn()[y]);let P=0,U=0;U=y===this.Gw.length-1?Math.ceil((v-M)*b)/b:Math.round(S.z_()*x*b)/b,P=Math.max(U,2),M+=P,S.Cm(Ot({width:u,height:P})),this.yM()&&S.mw(t,"left"),this.kM()&&S.mw(n,"right"),S.Sv()&&this.sn.Id(S.Sv(),P)}this._M.Ww(Ot({width:h?u:0,height:d}),h?t:0,h?n:0),this.sn.N_(u),this.Qw!==t&&(this.Qw=t),this.tM!==n&&(this.tM=n)}lM(e){e?this.Hv.addEventListener("wheel",this.hM,{passive:!1}):this.Hv.removeEventListener("wheel",this.hM)}IM(e){switch(e.deltaMode){case e.DOM_DELTA_PAGE:return 120;case e.DOM_DELTA_LINE:return 32}return xA?1/window.devicePixelRatio:1}aM(e){if(!(e.deltaX!==0&&this.yn.handleScroll.mouseWheel||e.deltaY!==0&&this.yn.handleScale.mouseWheel))return;const t=this.IM(e),n=t*e.deltaX/100,r=-t*e.deltaY/100;if(e.cancelable&&e.preventDefault(),r!==0&&this.yn.handleScale.mouseWheel){const a=Math.sign(r)*Math.min(1,Math.abs(r)),u=e.clientX-this.Hv.getBoundingClientRect().left;this.Qt().Od(u,a)}n!==0&&this.yn.handleScroll.mouseWheel&&this.Qt().Nd(-80*n)}MM(e,t){var r;const n=e.ls();n===3&&this.VM(),n!==3&&n!==2||(this.BM(e),this.EM(e,t),this._M.kt(),this.Gw.forEac
4198h((a=>{a.sw()})),((r=this.iM)==null?void 0:r.ls())===3&&(this.iM.Ss(e),this.VM(),this.BM(this.iM),this.EM(this.iM,t),e=this.iM,this.iM=null)),this.km(e)}EM(e,t){for(const n of e.bs())this.xs(n,t)}BM(e){const t=this.sn.Zn();for(let n=0;n<t.length;n++)e._s(n).hs&&t[n].ru()}xs(e,t){const n=this.sn.Et();switch(e.ds){case 0:n.Xc();break;case 1:n.Jc(e.Wt);break;case 2:n.Ms(e.Wt);break;case 3:n.gs(e.Wt);break;case 4:n.Oc();break;case 5:e.Wt.jc(t)||n.gs(e.Wt.qc(t))}}md(e){this.iM!==null?this.iM.Ss(e):this.iM=e,this.nM||(this.nM=!0,this.Jw=window.requestAnimationFrame((t=>{if(this.nM=!1,this.Jw=0,this.iM!==null){const n=this.iM;this.iM=null,this.MM(n,t);for(const r of n.bs())if(r.ds===5&&!r.Wt.jc(t)){this.Qt().ps(r.Wt);break}}})))}VM(){this.dM()}vM(e){this.rM.removeChild(e.uv()),e.m()}dM(){const e=this.sn.Zn(),t=e.length,n=this.Gw.length;for(let r=t;r<n;r++){const a=Yn(this.Gw.pop());this.rM.removeChild(a.uv()),a.dw().u(this),a.fw().u(this),a.m();const u=this.Xw.pop();u!==void 0&&this.vM(u)}for(let r=n;r<t;r++){const a=new cp(this,e[r]);if(a.dw().i(this.AM.bind(this,a),this),a.fw().i(this.LM.bind(this,a),this),this.Gw.push(a),r>0){const u=new cA(this,r-1,r);this.Xw.push(u),this.rM.insertBefore(u.uv(),this._M.uv())}this.rM.insertBefore(a.uv(),this._M.uv())}for(let r=0;r<t;r++){const a=e[r],u=this.Gw[r];u.Sv()!==a?u.iw(a):u.tw()}this.fM(),this.DM()}zM(e,t,n,r){var p;const a=new Map;
4198e!==null&&this.sn.Jn().forEach((m=>{const v=m.Un().Hn(e);v!==null&&a.set(m,v)}));let u;if(e!==null){const m=(p=this.sn.Et().en(e))==null?void 0:p.originalTime;m!==void 0&&(u=m)}const c=this.Qt().ou(),h=this.OM(r),d=(function(m,v){var P;const x=m!==null&&m.lu instanceof sc?m.lu:void 0,M=(P=m==null?void 0:m.wu)==null?void 0:P.te,b=v!==void 0&&v!==-1?v:void 0;return m===null||m.ee===void 0?{NM:x,FM:M}:{NM:x,FM:M,WM:{ds:m.ee,HM:(y=m.lu,S=m.ee,y instanceof Ud?"pane-primitive":S==="marker"||S==="primitive"?"series-primitive":"series"),UM:lA(m.ee,M),U_:x,$M:M,jM:b}};var y,S})(c,h);return{Qr:u,$n:e??void 0,qM:t??void 0,jM:h!==-1?h:void 0,NM:d.NM,YM:a,FM:d.FM,WM:d.WM,KM:n??void 0}}OM(e){let t=-1;if(e)t=this.Gw.indexOf(e);else{const n=this.Qt().Rd().Kn();n!==null&&(t=this.Qt().Zn().indexOf(n))}return t}AM(e,t,n,r){this.Wm.p((()=>this.zM(t,n,r,e)))}LM(e,t,n,r){this.Hm.p((()=>this.zM(t,n,r,e)))}oM(e,t,n){var r;this.PM(((r=this.Qt().ou())==null?void 0:r.mu)??null),this.pd.p((()=>this.zM(e,t,n)))}fM(){const e=this.yn.timeScale.visible?"":"none";this._M.uv().style.display=e}yM(){return this.Gw[0].Sv().K_().N().visible}kM(){return this.Gw[0].Sv().Z_().N().visible}uM(){return"ResizeObserver"in window&&(this.sM=new ResizeObserver((e=>{const t=e[e.length-1];if(!t)return;const n=t.contentRect.width,r=t.contentRect.height;this.cM(n,r,!0)})),this.sM.observe(this.jv,{box:"border-box"}),!0)}mM(){this.sM!==null&&this.sM.disconnect(),this.sM=null}}function Of(s){return!!(s.handleScroll.mouseWheel||s.handleScale.mouseWheel)}function yA(s){return s.open===void 0&&s.value===void 0}function MA(s){return(function(e){return e.open!==void 0})(s)||(function(e){return e.value!==void 0})(s)}function R0(s,e,t,n){const r=t.value,a={$n:e,wt:s,Wt:[r,r,r,r],Qr:n};return t.color!==void 0&&(a.R=t.color),a}function EA(s,e,t,n){const r=t.value,a={$n:e,wt:s,Wt:[r,r,r,r],Qr:n};return t.lineColor!==void 0&&(a.vt=t.lineColor),t.topColor!==void 0&&(a.ah=t.topColor),t.bottomColor!==void 0&&(a.oh=t.bottomColor),a}function wA(s,e,t,n){const r=t.value,a={$n:e,wt:s,Wt:[r,r,r,r],Qr:n};return t.topLineColor!==void 0&&(a._h=t.topLineColor),t.bottomLineColor!==void 0&&(a.uh=t.bottomLineColor),t.topFillColor1!==void 0&&(a.dh=t.topFillColor1),t.topFillColor2!==void 0&&(a.fh=t.topFillColor2),t.bottomFillColor1!==void 0&&(a.ph=t.bottomFillColor1),t.bottomFillColor2!==void 0&&(a.mh=t.bottomFillColor2),a}function bA(s,e,t,n){const r={$n:e,wt:s,Wt:[t.open,t.high,t.low,t.close],Qr:n};return t.color!==void 0&&(r.R=t.color),r}function TA(s,e,t,n){const r={$n:e,wt:s,Wt:[t.open,t.high,t.low,t.close],Qr:n};return t.color!==void 0&&(r.R=t.color),t.borderColor!==void 0&&(r.Ht=t.borderColor),t.wickColor!==void 0&&(r.hh=t.wickColor),r}function CA(s,e,t,n,r){const a=Yn(r)(t),u=Math.max(...a),c=Math.min(...a),h=a[a.length-1],d=[h,u,c,h],{time:p,color:m,...v}=t;return{$n:e,wt:s,Wt:d,Qr:n,ue:v,R:m}}function vo(s){return s.Wt!==void 0}function P0(s,e){return e.customValues!==void 0&&(s.ZM=e.customValues),s}function pr(s){return(e,t,n,r,a,u)=>(function(c,h){return h?h(c):yA(c)})(n,u)?P0({wt:e,$n:t,Qr:r},n):P0(s(e,t,n,r,a),n)}function N0(s){return{Candlestick:pr(TA),Bar:pr(bA),Area:pr(EA),Baseline:pr(wA),Histogram:pr(R0),Line:pr(R0),Custom:pr(CA)}[s]}function L0(s){return{$n:0,GM:new Map,za:s}}function D0(s,e){if(s!==void 0&&s.length!==0)return{XM:e.key(s[0].wt),JM:e.key(s[s.length-1].wt)}}function I0(s){let e;return s.forEach((t=>{e===void 0&&(e=t.Qr)})),Yn(e)}class AA{constructor(e){this.QM=new Map,this.tg=new Map,this.ig=new Map,this.ng=[],this.xu=e}m(){this.QM.clear(),this.tg.clear(),this.ig.clear(),this.ng=[]}sg(e,t){let n=this.QM.size!==0,r=!1;const a=this.tg.get(e);if(a!==void 0)if(this.tg.size===1)n=!1,r=!0,this.QM.clear();else for(const h of this.ng)h.pointData.GM.delete(e)&&(r=!0);let u=[];if(t.length!==0){const h=t.map((x=>x.time)),d=this.xu.createConverterToInternalObj(t),p=N0(e.bh()),m=e.ll(),v=e.ol();u=t.map(((x,M)=>{const b=d(x.time),y=this.xu.key(b);let S=this.QM.get(y);S===void 0&&(S=L0(b),this.QM.set(y,S),r=!0);const P=p(b,S.$n,x,h[M],m,v);return S.GM.set(e,P),P}))}n&&this.eg(),this.rg(e,u);let c=-1;if(r){const h=[];
4198this.QM.forEach((d=>{h.push({timeWeight:0,time:d.za,pointData:d,originalTime:I0(d.GM)})})),h.sort(((d,p)=>this.xu.key(d.time)-this.xu.key(p.time))),c=this.hg(h)}return this.ag(e,c,(function(h,d,p){const m=D0(h,p),v=D0(d,p);if(m!==void 0&&v!==void 0)return{lg:!1,Ia:m.JM>=v.JM&&m.XM>=v.XM}})(this.tg.get(e),a,this.xu))}Jd(e){return this.sg(e,[])}og(e,t,n){if(n&&e.Na())throw new Error("Historical updates are not supported when conflation is enabled. Conflation requires data to be processed in order.");const r=t;(function(S){S.Qr===void 0&&(S.Qr=S.time)})(r),this.xu.preprocessData(t);const a=this.xu.createConverterToInternalObj([t])(t.time),u=this.ig.get(e);if(!n&&u!==void 0&&this.xu.key(a)<this.xu.key(u))throw new Error(`Cannot update oldest data, last time=${u}, new time=${a}`);let c=this.QM.get(this.xu.key(a));if(n&&c===void 0)throw new Error("Cannot update non-existing data point when historicalUpdate is true");const h=c===void 0;c===void 0&&(c=L0(a),this.QM.set(this.xu.key(a),c));const d=N0(e.bh()),p=e.ll(),m=e.ol(),v=d(a,c.$n,t,r.Qr,p,m),x=!n&&!h&&u!==void 0&&this.xu.key(a)===this.xu.key(u);c.GM.set(e,v),n?this._g(e,v,c.$n):x&&e.Na()&&vo(v)?(e.Rr(v),this.ug(e,v)):this.ug(e,v);const M={Ia:vo(v),lg:n};if(!h)return this.ag(e,-1,M);const b={timeWeight:0,time:c.za,pointData:c,originalTime:I0(c.GM)},y=br(this.ng,this.xu.key(b.time),((S,P)=>this.xu.key(S.time)<P));this.ng.splice(y,0,b);for(let S=y;S<this.ng.length;++S)Eu(this.ng[S].pointData,S);return this.xu.fillWeightsForPoints(this.ng,y),this.ag(e,y,M)}cg(e,t){const n=this.tg.get(e);if(n===void 0||t<=0)return[[],this.dg()];t=Math.min(t,n.length);const r=n.splice(-t).reverse();n.length===0?this.ig.delete(e):this.ig.set(e,n[n.length-1].wt);for(const a of r){const u=this.QM.get(this.xu.key(a.wt));if(u&&(u.GM.delete(e),u.GM.size===0)){this.QM.delete(this.xu.key(u.za)),this.ng.splice(u.$n,1);for(let c=u.$n;c<this.ng.length;++c)Eu(this.ng[c].pointData,c)}}return[r,this.ag(e,this.ng.length-1,{lg:!1,Ia:!1})]}ug(e,t){let n=this.tg.get(e);n===void 0&&(n=[],this.tg.set(e,n));const r=n.length!==0?n[n.length-1]:null;r===null||this.xu.key(t.wt)>this.xu.key(r.wt)?vo(t)&&n.push(t):vo(t)?n[n.length-1]=t:n.splice(-1,1),this.ig.set(e,t.wt)}_g(e,t,n){const r=this.tg.get(e);if(r===void 0)return;const a=br(r,n,((u,c)=>u.$n<c));vo(t)?r[a]=t:r.splice(a,1)}rg(e,t){t.length!==0?(this.tg.set(e,t.filter(vo)),this.ig.set(e,t[t.length-1].wt)):(this.tg.delete(e),this.ig.delete(e))}eg(){for(const e of this.ng)e.pointData.GM.size===0&&this.QM.delete(this.xu.key(e.time))}hg(e){let t=-1;for(let n=0;n<this.ng.length&&n<e.length;++n){const r=this.ng[n],a=e[n];if(this.xu.key(r.time)!==this.xu.key(a.time)){t=n;break}a.timeWeight=r.timeWeight,Eu(a.pointData,n)}if(t===-1&&this.ng.length!==e.length&&(t=Math.min(this.ng.length,e.length)),t===-1)return-1;for(let n=t;n<e.length;++n)Eu(e[n].pointData,n);return this.xu.fillWeightsForPoints(e,t),this.ng=e,t}fg(){if(this.tg.size===0)return null;let e=0;return this.tg.forEach((t=>{t.length!==0&&(e=Math.max(e,t[t.length-1].$n))})),e}ag(e,t,n){const r=this.dg();if(t!==-1)this.tg.forEach(((a,u)=>{r.U_.set(u,{ue:a,pg:u===e?n:void 0})})),this.tg.has(e)||r.U_.set(e,{ue:[],pg:n}),r.Et.vg=this.ng,r.Et.mg=t;else{const a=this.tg.get(e);r.U_.set(e,{ue:a||[],pg:n})}return r}dg(){return{U_:new Map,Et:{Pc:this.fg()}}}}function Eu(s,e){s.$n=e,s.GM.forEach((t=>{t.$n=e}))}function RA(s,e){return s._t<e}function PA(s,e){return e<s._t}function Hd(s,e,t,n){return br(s,e,RA,t,n)}function Gd(s,e,t,n){return lp(s,e,PA,t,n)}function Du(s,e,t){return{ne:s,se:e,ee:t}}function U0(s,e,t,n){return s>=e-n&&s<=t+n}function Pa(s,e,t,n,r,a){const u=r-t,c=a-n;if(u===0&&c===0)return Math.hypot(s-t,e-n);const h=((s-t)*u+(e-n)*c)/(u*u+c*c),d=Math.max(0,Math.min(1,h)),p=t+u*d,m=n+c*d;return Math.hypot(s-p,e-m)}const kf=[0,0];function NA(s,e,t){return e===void 0||e.wt!==s.wt-1?s._t-t/2:(e._t+s._t)/2}function LA(s,e,t){return e===void 0||e.wt!==s.wt+1?s._t+t/2:(s._t+e._t)/2}function DA(s,e,t,n,r,a,u){if(e===null||e.from>=e.to||s.length===0)return null;const c=r/2+a,h=Hd(s,t-c,e.from,e.to),d=Gd(s,t+c,h,e.to);if(h>=d)return null;let p=Number.POSITIVE_INFINITY;for(let m=h;
4198m<d;m++){const v=s[m],x=m>e.from?s[m-1]:void 0,M=m<e.to-1?s[m+1]:void 0,b=NA(v,x,r)-a,y=LA(v,M,r)+a;if(t<b||t>y)continue;u(v,kf);const S=kf[0],P=kf[1],U=Math.min(S,P),T=Math.max(S,P),N=U-a,R=T+a;if(n>=U&&n<=T)p=Math.min(p,0);else if(n>=N&&n<=R){const F=Math.min(Math.abs(n-U),Math.abs(T-n));p=Math.min(p,F)}}return Number.isFinite(p)?Du(p,0,"series-range"):null}function IA(s,e){return s.wt<e}function UA(s,e){return e<s.wt}function FA(s,e,t){const n=e.Oa(),r=e.bi(),a=br(s,n,IA),u=lp(s,r,UA);if(!t)return{from:a,to:u};let c=a,h=u;return a>0&&a<s.length&&s[a].wt>=n&&(c=a-1),u>0&&u<s.length&&s[u-1].wt<=r&&(h=u+1),{from:c,to:h}}class lx{constructor(e,t,n){this.wg=!0,this.Mg=!0,this.gg=!0,this.bg=[],this.Sg=null,this.xg=-1,this.ae=e,this.le=t,this.Cg=n}kt(e){this.wg=!0,e==="data"&&(this.Mg=!0),e==="options"&&(this.gg=!0)}Tt(){return this.ae.It()?(this.yg(),this.Sg===null?null:this.kg):null}Qs(e,t){return this.ae.It()?(this.yg(),this.Sg===null?null:this.Pg(e,t)):null}Pg(e,t){return null}Tg(){this.bg=this.bg.map((e=>({...e,...this.ae.Sa().Sh(e.wt)})))}Rg(){this.Sg=null}yg(){const e=this.le.Et(),t=e.N().enableConflation?e.Qc():0;t!==this.xg&&(this.Mg=!0,this.xg=t),this.Mg&&(this.Dg(),this.Mg=!1),this.gg&&(this.Tg(),this.gg=!1),this.wg&&(this.Ig(),this.wg=!1)}Ig(){const e=this.ae.Ft(),t=this.le.Et();if(this.Rg(),t.Gi()||e.Gi())return;const n=t.Ee();if(n===null||this.ae.Un().Th()===0)return;const r=this.ae.Lt();r!==null&&(this.Sg=FA(this.bg,n,this.Cg),this.Vg(e,t,r.Wt),this.Bg())}}class OA{constructor(e,t){this.Eg=e,this.Ki=t}st(e,t,n){this.Eg.draw(e,this.Ki,t,n)}}function kA(s){switch(s){case"point":return 2;case"range":return 0;default:return 1}}class BA extends lx{constructor(e,t,n){super(e,t,!1),this.Yh=n,this.Eg=this.Yh.renderer(),this.kg=new OA(this.Eg,(r=>this.Ag(r)))}get ga(){return this.Yh.conflationReducer}Wa(e){return this.Yh.priceValueBuilder(e)}_l(e){return this.Yh.isWhitespace(e)}Pg(e,t){var u,c;const n=(c=(u=this.Eg).hitTest)==null?void 0:c.call(u,e,t,(h=>this.Ag(h)));if(n!=null)return{ne:(r=n).distance,se:kA(r.type),ee:"custom",mu:r.cursorStyle,te:r.objectId,ie:r.hitTestData};var r;const a=DA(this.bg,this.Sg,e,t,this.le.Et().fl(),this.ae.N().hitTestTolerance,((h,d)=>{const p=h.Lg;let m=NaN,v=NaN;if(p!==void 0&&!this.Yh.isWhitespace(p))for(const x of this.Yh.priceValueBuilder(p)){const M=this.Ag(x);M!==null&&(m=Number.isNaN(m)?M:Math.min(m,M),v=Number.isNaN(v)?M:Math.max(v,M))}d[0]=m,d[1]=v}));return a===null?null:{...a,ee:"custom"}}Dg(){const e=this.ae.Sa();this.bg=this.ae.Ha().Bh().map((t=>({wt:t.$n,_t:NaN,...e.Sh(t.$n),Lg:t.ue})))}Vg(e,t){t.Tc(this.bg,Id(this.Sg))}Bg(){this.Yh.update({bars:this.bg.map(zA),barSpacing:this.le.Et().fl(),visibleRange:this.Sg,conflationFactor:this.le.Et().Qc()},this.ae.N())}Ag(e){const t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}}function zA(s){return{x:s._t,time:s.wt,originalData:s.Lg,barColor:s.sh}}const VA={color:"#2196f3"},HA=(s,e,t)=>{const n=Gs(t);return new BA(s,e,n)};function fp(s){const e={value:s.Wt[3],time:s.Qr};return s.ZM!==void 0&&(e.customValues=s.ZM),e}function F0(s){const e=fp(s);return s.R!==void 0&&(e.color=s.R),e}function GA(s){const e=fp(s);return s.vt!==void 0&&(e.lineColor=s.vt),s.ah!==void 0&&(e.topColor=s.ah),s.oh!==void 0&&(e.bottomColor=s.oh),e}function WA(s){const e=fp(s);return s._h!==void 0&&(e.topLineColor=s._h),s.uh!==void 0&&(e.bottomLineColor=s.uh),s.dh!==void 0&&(e.topFillColor1=s.dh),s.fh!==void 0&&(e.topFillColor2=s.fh),s.ph!==void 0&&(e.bottomFillColor1=s.ph),s.mh!==void 0&&(e.bottomFillColor2=s.mh),e}function ux(s){const e={open:s.Wt[0],high:s.Wt[1],low:s.Wt[2],close:s.Wt[3],time:s.Qr};return s.ZM!==void 0&&(e.customValues=s.ZM),e}function XA(s){const e=ux(s);return s.R!==void 0&&(e.color=s.R),e}function $A(s){const e=ux(s),{R:t,Ht:n,hh:r}=s;return t!==void 0&&(e.color=t),n!==void 0&&(e.borderColor=n),r!==void 0&&(e.wickColor=r),e}function Iu(s){return{Area:GA,Line:F0,Baseline:WA,Histogram:F0,Bar:XA,Candlestick:$A,Custom:qA}[s]}function qA(s){const e=s.Qr;return{...s.ue,time:e}}const YA={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroun
vendor: 4,304 bytes, line 4198
4198dColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1,doNotSnapToHiddenSeriesIndices:!1},KA={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},jA={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:X_,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},Bf={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0,ensureEdgeTickMarksVisible:!1,tickMarkDensity:2.5},QA={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1,enableConflation:!1,conflationThresholdFactor:1,precomputeConflationOnInit:!1,precomputeConflationPriority:"background"};function O0(){return{addDefaultPane:!0,hoveredSeriesOnTop:!0,width:0,height:0,autoSize:!1,layout:jA,crosshair:YA,grid:KA,overlayPriceScales:{...Bf},leftPriceScale:{...Bf,visible:!1},rightPriceScale:{...Bf,visible:!0},defaultVisiblePriceScaleId:"right",timeScale:QA,localization:{locale:Lo?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class cx{constructor(e,t,n){this.sv=e,this.zg=t,this.Og=n??0}applyOptions(e){this.sv.Qt().Pd(this.zg,e,this.Og)}options(){return this.Ki().N()}width(){return nc(this.zg)?this.sv.CM(this.zg):0}setVisibleRange(e){this.setAutoScale(!1),this.Ki().qo(new On(e.from,e.to))}getVisibleRange(){let e,t,n=this.Ki().ar();if(n===null)return null;if(this.Ki().so()){const r=this.Ki().M_(),a=rx(r);n=So(n,this.Ki().ro()),e=Number((Math.round(n.Je()/r)*r).toFixed(a)),t=Number((Math.round(n.Qe()/r)*r).toFixed(a))}else e=n.Je(),t=n.Qe();return{from:e,to:t}}setAutoScale(e){this.applyOptions({autoScale:e})}Ki(){return we(this.sv.Qt().Td(this.zg,this.Og)).Ft}}class ZA{constructor(e,t,n,r){this.sv=e,this.yt=n,this.Ng=t,this.Fg=r}getHeight(){return this.yt.$t()}setHeight(e){const t=this.sv.Qt(),n=t.hf(this.yt);t.Bd(n,e)}getStretchFactor(){return this.yt.z_()}setStretchFactor(e){this.yt.O_(e),this.sv.Qt().Pa()}paneIndex(){return this.sv.Qt().hf(this.yt)}moveTo(e){const t=this.paneIndex();t!==e&&(yn(e>=0&&e<this.sv.rv().length,"Invalid pane index"),this.sv.Qt().Ad(t,e))}getSeries(){return this.yt.U_().map((e=>this.Ng(e)))??[]}getHTMLElement(){const e=this.sv.rv();return e&&e.length!==0&&e[this.paneIndex()]?e[this.paneIndex()].uv():null}attachPrimitive(e){this.yt.hl(e),e.attached&&e.attached({chart:this.Fg,requestUpdate:()=>this.yt.Qt().Pa()})}detachPrimitive(e){this.yt.al(e)}priceScale(e){if(this.yt.A_(e)===null)throw new Error(`Cannot find price scale with id: ${e}`);return new cx(this.sv,e,this.paneIndex())}setPreserveEmptyPane(e){this.yt.W_(e)}preserveEmptyPane(){return this.yt.H_()}addCustomSeries(e,t={},n=0){return this.Fg.addCustomSeries(e,t,n)}addSeries(e,t={}){return this.Fg.addSeries(e,t,this.paneIndex())}}const JA={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class k0{constructor(e){this._r=e}applyOptions(e){this._r.vr(e)}options(){return this._r.N()}Wg(){return this._r}}class eR{constructor(e,t,n,r,a,u){this.Hg=new tn,this.ae=e,this.Ug=t,this.$g=n,this.xu=a,this.Fg=r,this.jg=u}m(){this.Hg.m()}priceFormatter(){return this.ae.tl()}priceToCoordinate(e){const t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}coordinateToPrice(e){const t=this.ae.Lt();return t===null?null:this.ae.Ft().Tn(e,t.Wt)}barsInLogicalRange(e){if(e===null)return null;const t=new To(new Da(e.from,e.to)).Fu(),n=this.ae.Un();if(n.Gi())return null;
4198const r=n.Hn(t.Oa(),1),a=n.Hn(t.bi(),-1),u=we(n.Rh()),c=we(n.Qn());if(r!==null&&a!==null&&r.$n>a.$n)return{barsBefore:e.from-u,barsAfter:c-e.to};const h={barsBefore:r===null||r.$n===u?e.from-u:r.$n-u,barsAfter:a===null||a.$n===c?c-e.to:c-a.$n};return r!==null&&a!==null&&(h.from=r.Qr,h.to=a.Qr),h}setData(e){this.xu,this.ae.bh(),this.Ug.qg(this.ae,e),this.Yg("full")}update(e,t=!1){this.ae.bh(),this.Ug.Kg(this.ae,e,t),this.Yg("update")}pop(e=1){const t=this.Ug.Zg(this.ae,e);t.length!==0&&this.Yg("update");const n=Iu(this.seriesType());return t.map((r=>n(r)))}dataByIndex(e,t){const n=this.ae.Un().Hn(e,t);return n===null?null:Iu(this.seriesType())(n)}data(){const e=Iu(this.seriesType());return this.ae.Un().Bh().map((t=>e(t)))}subscribeDataChanged(e){this.Hg.i(e)}unsubscribeDataChanged(e){this.Hg._(e)}applyOptions(e){this.ae.vr(e)}options(){return ls(this.ae.N())}priceScale(){return this.$g.priceScale(this.ae.Ft().cl(),this.getPane().paneIndex())}createPriceLine(e){const t=ii(ls(JA),e),n=this.ae.Ba(t);return new k0(n)}removePriceLine(e){this.ae.Ea(e.Wg())}priceLines(){return this.ae.Aa().map((e=>new k0(e)))}seriesType(){return this.ae.bh()}lastValueData(e){const t=this.ae.Ae(e);return t.Le?{noData:!0}:{noData:!1,price:t.Mt,color:t.R}}attachPrimitive(e){this.ae.hl(e),e.attached&&e.attached({chart:this.Fg,series:this,requestUpdate:()=>this.ae.Qt().Pa(),horzScaleBehavior:this.xu})}detachPrimitive(e){this.ae.al(e),e.detached&&e.detached(),this.ae.Qt().Pa()}getPane(){const e=this.ae,t=we(this.ae.Qt().Ks(e));return this.jg(t)}moveToPane(e){this.ae.Qt().nf(this.ae,e)}seriesOrder(){const e=this.ae.Qt().Ks(this.ae);return e===null?-1:e.U_().indexOf(this.ae)}setSeriesOrder(e){const t=this.ae.Qt().Ks(this.ae);t!==null&&t.du(this.ae,e)}Yg(e){this.Hg.v()&&this.Hg.p(e)}}class tR{constructor(e,t,n){this.Gg=new tn,this.Gu=new tn,this.Bw=new tn,this.sn=e,this.ia=e.Et(),this._M=t,this.ia.Yc().i(this.Xg.bind(this)),this.ia.Kc().i(this.Jg.bind(this)),this._M.Fw().i(this.Qg.bind(this)),this.xu=n}m(){this.ia.Yc().u(this),this.ia.Kc().u(this),this._M.Fw().u(this),this.Gg.m(),this.Gu.m(),this.Bw.m()}scrollPosition(){return this.ia.Ac()}scrollToPosition(e,t){t?this.ia.$c(e,1e3):this.sn.gs(e)}scrollToRealTime(){this.ia.Uc()}getVisibleRange(){const e=this.ia.gc();return e===null?null:{from:e.from.originalTime,to:e.to.originalTime}}setVisibleRange(e){const t={from:this.xu.convertHorzItemToInternal(e.from),to:this.xu.convertHorzItemToInternal(e.to)},n=this.ia.Cc(t);this.sn.tf(n)}getVisibleLogicalRange(){const e=this.ia.Mc();return e===null?null:{from:e.Oa(),to:e.bi()}}setVisibleLogicalRange(e){yn(e.from<=e.to,"The from index cannot be after the to index."),this.sn.tf(e)}resetTimeScale(){this.sn.ws()}fitContent(){this.sn.Xc()}logicalToCoordinate(e){const t=this.sn.Et();return t.Gi()?null:t.jt(e)}coordinateToLogical(e){return this.ia.Gi()?null:this.ia.Rc(e)}timeToIndex(e,t){const n=this.xu.convertHorzItemToInternal(e);return this.ia.vc(n,t)}timeToCoordinate(e){const t=this.timeToIndex(e,!1);return t===null?null:this.ia.jt(t)}coordinateToTime(e){const t=this.sn.Et(),n=t.Rc(e),r=t.en(n);return r===null?null:r.originalTime}width(){return this._M.cv().width}height(){return this._M.cv().height}subscribeVisibleTimeRangeChange(e){this.Gg.i(e)}unsubscribeVisibleTimeRangeChange(e){this.Gg._(e)}subscribeVisibleLogicalRangeChange(e){this.Gu.i(e)}unsubscribeVisibleLogicalRangeChange(e){this.Gu._(e)}subscribeSizeChange(e){this.Bw.i(e)}unsubscribeSizeChange(e){this.Bw._(e)}applyOptions(e){this.ia.vr(e)}options(){return{...ls(this.ia.N()),barSpacing:this.ia.fl()}}Xg(){this.Gg.v()&&this.Gg.p(this.getVisibleRange())}Jg(){this.Gu.v()&&this.Gu.p(this.getVisibleLogicalRange())}Qg(e){this.Bw.p(e.width,e.height)}}function B0(s){return(function(e){if(gu(e.handleScale)){const n=e.handleScale;e.handleScale={axisDoubleClickReset:{time:n,price:n},axisPressedMouseMove:{time:n,price:n},mouseWheel:n,pinch:n}}else if(e.handleScale!==void 0){const{axisPressedMouseMove:n,axisDoubleClickReset:r}=e.handleScale;gu(n)&&(e.handleScale.axisPressedMouseMove={time:n,price:n}),gu(r)&&(e.handleScale.axisDoubleClickReset={time:r,price:r})}const t=e.handleScroll;gu(t)&&(e.handleScroll={horzTouchDrag:t,vertTouchDrag:t,mouseWheel:t,pressedMouseMove:t})})(s),s}class nR{constructor(e,t,n){this.tb=new Map,this.ib=new Map,this.nb=new tn,this.sb=new tn,this.eb=new tn,this.od=new WeakMap,this.rb=new AA(t);const r=n===void 0?ls(O0()):ii(ls(O0()),B0(n));this.hb=t,this.sv=new SA(e,r,t),this.sv.dw().i((u=>{this.nb.v()&&this.nb.p(this.ab(u()))}
vendor: 9,562 bytes, line 4198
4198),this),this.sv.fw().i((u=>{this.sb.v()&&this.sb.p(this.ab(u()))}),this),this.sv.Dd().i((u=>{this.eb.v()&&this.eb.p(this.ab(u()))}),this);const a=this.sv.Qt();this.lb=new tR(a,this.sv.pM(),this.hb)}remove(){this.sv.dw().u(this),this.sv.fw().u(this),this.sv.Dd().u(this),this.lb.m(),this.sv.m(),this.tb.clear(),this.ib.clear(),this.nb.m(),this.sb.m(),this.eb.m(),this.rb.m()}resize(e,t,n){this.autoSizeActive()||this.sv.cM(e,t,n)}addCustomSeries(e,t={},n=0){const r=(a=>({type:"Custom",isBuiltIn:!1,defaultOptions:{...VA,...a.defaultOptions()},ob:HA,_b:a}))(Gs(e));return this.ub(r,t,n)}addSeries(e,t={},n=0){return this.ub(e,t,n)}removeSeries(e){const t=Yn(this.tb.get(e)),n=this.rb.Jd(t);this.sv.Qt().Jd(t),this.cb(n),this.tb.delete(e),this.ib.delete(t)}qg(e,t){this.cb(this.rb.sg(e,t))}Kg(e,t,n){this.cb(this.rb.og(e,t,n))}Zg(e,t){const[n,r]=this.rb.cg(e,t);return n.length!==0&&this.cb(r),n}subscribeClick(e){this.nb.i(e)}unsubscribeClick(e){this.nb._(e)}subscribeCrosshairMove(e){this.eb.i(e)}unsubscribeCrosshairMove(e){this.eb._(e)}subscribeDblClick(e){this.sb.i(e)}unsubscribeDblClick(e){this.sb._(e)}priceScale(e,t=0){return new cx(this.sv,e,t)}timeScale(){return this.lb}applyOptions(e){this.sv.vr(B0(e))}options(){return this.sv.N()}takeScreenshot(e=!1,t=!1){let n,r;try{t||(n=this.sv.Qt().N().crosshair.mode,this.sv.vr({crosshair:{mode:2}})),r=this.sv.SM(e)}finally{t||n===void 0||this.sv.Qt().vr({crosshair:{mode:n}})}return r}addPane(e=!1){const t=this.sv.Qt().af();return t.W_(e),this.fb(t)}removePane(e){this.sv.Qt().Vd(e)}swapPanes(e,t){this.sv.Qt().Ed(e,t)}autoSizeActive(){return this.sv.wM()}chartElement(){return this.sv.vv()}panes(){return this.sv.Qt().Zn().map((e=>this.fb(e)))}paneSize(e=0){const t=this.sv.RM(e);return{height:t.height,width:t.width}}setCrosshairPosition(e,t,n){const r=this.tb.get(n);if(r===void 0)return;const a=this.sv.Qt().Ks(r);a!==null&&this.sv.Qt().qd(e,t,a)}clearCrosshairPosition(){this.sv.Qt().Yd(!0)}horzBehaviour(){return this.hb}ub(e,t={},n=0){yn(e.ob!==void 0),(function(h){if(h===void 0||h.type==="custom")return;const d=h;d.minMove!==void 0&&d.precision===void 0&&(d.precision=rx(d.minMove))})(t.priceFormat),e.type==="Candlestick"&&(function(h){h.borderColor!==void 0&&(h.borderUpColor=h.borderColor,h.borderDownColor=h.borderColor),h.wickColor!==void 0&&(h.wickUpColor=h.wickColor,h.wickDownColor=h.wickColor)})(t);const r=ii(ls(G_),ls(e.defaultOptions),t),a=e.ob,u=new sc(this.sv.Qt(),e.type,r,a,e._b);this.sv.Qt().Gd(u,n);const c=new eR(u,this,this,this,this.hb,(h=>this.fb(h)));return this.tb.set(c,u),this.ib.set(u,c),c}cb(e){const t=this.sv.Qt();t.Kd(e.Et.Pc,e.Et.vg,e.Et.mg),e.U_.forEach(((n,r)=>r.ht(n.ue,n.pg))),t.Et()._c(),t.Bc()}pb(e){return Yn(this.ib.get(e))}mb(e){return e!==void 0&&this.ib.has(e)?this.pb(e):void 0}ab(e){const t=new Map;e.YM.forEach(((a,u)=>{const c=u.bh(),h=Iu(c)(a);if(c!=="Custom")yn(MA(h));else{const d=u.ol();yn(!d||d(h)===!1)}t.set(this.pb(u),h)}));const n=this.mb(e.NM),r=e.WM===void 0?void 0:{type:e.WM.ds,sourceKind:e.WM.HM,objectKind:e.WM.UM,series:this.mb(e.WM.U_),objectId:e.WM.$M,paneIndex:e.WM.jM};return{time:e.Qr,logical:e.$n,point:e.qM,paneIndex:e.jM,hoveredInfo:r,hoveredSeries:n,hoveredObjectId:e.FM,seriesData:t,sourceEvent:e.KM}}fb(e){let t=this.od.get(e);return t||(t=new ZA(this.sv,(n=>this.pb(n)),e,this),this.od.set(e,t)),t}}function iR(s){if(Ga(s)){const e=document.getElementById(s);return yn(e!==null,`Cannot find element in DOM with id=${s}`),e}return s}function sR(s,e,t){const n=iR(s),r=new nR(n,e,t);return e.setOptions(r.options()),r}function rR(s,e){return sR(s,new y0,y0.yf(e))}function Ca(s,e,t,n){return Math.hypot(t-s,n-e)}function hx(s,e,t,n,r,a,u,c=0){if(e.length===0||n.from>=e.length||n.to<=0)return;const{context:h,horizontalPixelRatio:d,verticalPixelRatio:p}=s,m=e[n.from];let v=a(s,m),x=m;if(n.to-n.from<2){const M=r/2;h.beginPath();const b={_t:m._t-M,ut:m.ut},y={_t:m._t+M,ut:m.ut};h.moveTo(b._t*d,b.ut*p),h.lineTo(y._t*d,y.ut*p),u(s,v,b,y)}else{const M=c>0;let b=0;const y=(P,U)=>{if(u(s,v,x,U),h.beginPath(),v=P,x=U,M){const T=b%c;h.lineDashOffset=T,b=T}};let S=x;h.beginPath(),h.moveTo(m._t*d,m.ut*p);for(let P=n.from+1;P<n.to;++P){S=e[P];const U=S._t*d,T=S.ut*p,N=a(s,S);switch(t){case 0:if(h.lineTo(U,T),M){const R=e[P-1],F=R._t*d,w=R.ut*p;b+=Ca(F,w,U,T)}break;case 1:{const R=e[P-1],F=R.ut*p;h.lineTo(U,F),M&&(b+=Math.abs(S._t-R._t)*d),N!==v&&(y(N,S),h.lineTo(U,F)),h.lineTo(U,T),M&&(b+=Math.abs(S.ut-R.ut)*p);break}case 2:{const[R,F]=dp(e,P-1,P),w=R._t*d,L=R.ut*p,z=F._t*d,B=F.ut*p;if(h.bezierCurveTo(w,L,z,B,U,T),M){const G=e[P-1],J=G._t*d,oe=G.ut*p,Y=Ca(J,oe,U,T),ie=Ca(J,oe,w,L)+Ca(w,L,z,B)+Ca(z,B,U,T);b+=(Y+ie)/2}break}}t!==1&&N!==v&&(y(N,S),h.moveTo(U,T))}(x!==S||x===S&&t===1)&&u(s,v,x,S),M&&(h.lineDashOffset=0)}}const z0=6;function zf(s,e){return{_t:s._t-e._t,ut:s.ut-e.ut}}function V0(s,e){return{_t:s._t/e,ut:s.ut/e}}function dp(s,e,t){const n=Math.max(0,e-1),r=Math.min(s.length-1,t+1);var a,u;return[(a=s[e],u=V0(zf(s[t],s[n]),z0),{_t:a._t+u._t,ut:a.ut+u.ut}),zf(s[t],V0(zf(s[r],s[e]),z0))]}function oR(s,e){const t=s.context;t.strokeStyle=e,t.stroke()}class aR extends Rr{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et(e){if(this.rt===null)return;const{ot:t,lt:n,wb:r,Mb:a,ct:u,Zt:c,gb:h}=this.rt;if(n===null)return;const d=e.context;d.lineCap="butt",d.lineWidth=u*e.verticalPixelRatio;const p=Xs(d,c);d.lineJoin="round";const m=this.bb.bind(this),v=(function(x){return x.reduce(((M,b)=>M+b),0)})(p);a!==void 0&&hx(e,t,a,n,r,m,oR,v),h&&(function(x,M,b,y,S){if(y.to-y.from<=0)return;const{horizontalPixelRatio:P,verticalPixelRatio:U,context:T}=x;let N=null;const R=Math.max(1,Math.floor(P))%2/2,F=b*U+R;for(let w=y.to-1;w>=y.from;--w){const L=M[w];if(L){const z=S(x,L);z!==N&&(N!==null&&T.fill(),T.beginPath(),T.fillStyle=z,N=z);const B=Math.round(L._t*P)+R,G=L.ut*U;T.moveTo(B,G),T.arc(B,G,F,0,2*Math.PI)}}T.fill()})(e,t,h,n,m)}}class fx extends aR{bb(e,t){return t.vt}}function H0(s,e,t,n,r){const a=1-r;return a*a*a*s+3*a*a*r*e+3*a*r*r*t+r*r*r*n}function lR(s,e,t,n,r){if(t===2){const[a,u]=dp(n,r-1,r);return[Math.min(s._t,e._t,a._t,u._t),Math.max(s._t,e._t,a._t,u._t)]}return[Math.min(s._t,e._t),Math.max(s._t,e._t)]}function uR(s,e,t,n,r,a,u,c){switch(r){case 1:{const h=Pa(s,e,t._t,t.ut,n._t,t.ut),d=Pa(s,e,n._t,t.ut,n._t,n.ut),p=Math.min(h,d);return p<=c?p:null}case 2:{const[h,d]=dp(a,u-1,u),p=(function(m,v,x){let M=Number.POSITIVE_INFINITY,b=x[0];for(let y=1;y<=12;y++){const S=y/12,P={_t:H0(x[0]._t,x[1]._t,x[2]._t,x[3]._t,S),ut:H0(x[0].ut,x[1].ut,x[2].ut,x[3].ut,S)};M=Math.min(M,Pa(m,v,b._t,b.ut,P._t,P.ut)),b=P}return M})(s,e,[t,h,d,n]);return p<=c?p:null}default:{const h=Pa(s,e,t._t,t.ut,n._t,n.ut);return h<=c?h:null}}}class cR extends lx{constructor(e,t){super(e,t,!0)}Vg(e,t,n){t.Tc(this.bg,Id(this.Sg)),e.Zo(this.bg,n,Id(this.Sg))}Sb(e,t){return{wt:e,Mt:t,_t:NaN,ut:NaN}}Dg(){const e=this.ae.Sa();this.bg=this.ae.Ha().Bh().map((t=>{let n;if((t.Zr??1)>1){const r=t.Wt[1],a=t.Wt[2],u=t.Wt[3];n=Math.abs(r-u)>Math.abs(a-u)?r:a}else n=t.Wt[3];return this.xb(t.$n,n,e)}))}}class dx extends cR{Pg(e,t){const n=this.ae.N();return(function(r,a,u,c,h,d,p,m=0,v=0){if(a===null||a.from>=a.to||r.length===0)return null;const x=Math.max(d/2,p??0)+v;let M=Number.POSITIVE_INFINITY;if(p!==void 0){const T=p+v,N=Hd(r,u-T,a.from,a.to),R=Gd(r,u+T,N,a.to);for(let F=N;F<R;F++){const w=r[F];if(!U0(u,w._t,w._t,p+v))continue;const L=Math.hypot(u-w._t,c-w.ut);L<=p+v&&(M=Math.min(M,L))}}if(a.to-a.from<2){const T=r[a.from],N=Math.max(m/2,x),R=Pa(u,c,T._t-N,T.ut,T._t+N,T.ut);return R<=x&&(M=Math.min(M,R)),Number.isFinite(M)?Du(M,2,"series-point"):null}let b=Number.POSITIVE_INFINITY;const y=Hd(r,u-x,a.from,a.to),S=Gd(r,u+x,y,a.to),P=Math.max(a.from+1,y),U=Math.min(a.to,S+1);for(let T=P;T<U;T++){const N=r[T-1],R=r[T],[F,w]=lR(N,R,h,r,T);if(!U0(u,F,w,x))continue;const L=uR(u,c,N,R,h,r,T,x);L!==null&&(b=Math.min(b,L))}return Number.isFinite(M)?Du(M,2,"series-point"):Number.isFinite(b)?Du(b,1,"series-line"):null})(this.bg,this.Sg,e,t,n.lineType,n.lineVisible?n.lineWidth:1,n.pointMarkersVisible?n.pointMarkersRadius||n.lineWidth/2+2:void 0,this.le.Et().fl(),n.hitTestTolerance)}}class hR extends dx{constructor(){super(...arguments),this.kg=new fx}xb(e,t,n){return{...this.Sb(e,t),...n.Sh(e)}}Bg(){const e=this.ae.N(),t={ot:this.bg,Zt:e.lineStyle,Mb:e.lineVisible?e.lineType:void 0,ct:e.lineWidth,gb:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0,lt:this.Sg,wb:this.le.Et().fl()};this.kg.ht(t)}}const fR={type:"Line",isBuiltIn:!0,defaultOptions:{color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},ob:(s,e)=>new hR(s,e)};function dR(s,e,t,n,r){const{context:a,horizontalPixelRatio:u,verticalPixelRatio:c}=e;a.lineTo(r._t*u,s*c),a.lineTo(n._t*u,s*c),a.closePath(),a.fillStyle=t,a.fill()}class pR extends Rr{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et(e){if(this.rt===null)return;const{ot:t,lt:n,wb:r,ct:a,Zt:u,Mb:c}=this.rt,h=this.rt.Db??(this.rt.Ib?0:e.mediaSize.height);if(n===null)return;const d=e.context;d.lineCap="butt",d.lineJoin="round",d.lineWidth=a,Xs(d,u),d.lineWidth=1,hx(e,t,c,n,r,this.Vb.bind(this),dR.bind(null,h))}}class mR{Bb(e,t){const n=this.Eb,{Ab:r,Lb:a,zb:u,Ob:c,Db:h,Nb:d,Fb:p}=t;if(this.Wb===void 0||n===void 0||n.Ab!==r||n.Lb!==a||n.zb!==u||n.Ob!==c||n.Db!==h||n.Nb!==d||n.Fb!==p){const{verticalPixelRatio:m}=e,v=h||d>
41980?m:1,x=d*v,M=p===e.bitmapSize.height?p:p*v,b=(h??0)*v,y=e.context.createLinearGradient(0,x,0,M);if(y.addColorStop(0,r),h!=null){const S=bo((b-x)/(M-x),0,1);y.addColorStop(S,a),y.addColorStop(S,u)}y.addColorStop(1,c),this.Wb=y,this.Eb=t}return this.Wb}}class gR extends pR{constructor(){super(...arguments),this.Hb=new mR}Vb(e,t){var n;return this.Hb.Bb(e,{Ab:t.ah,Lb:"",zb:"",Ob:t.oh,Nb:((n=this.rt)==null?void 0:n.Nb)??0,Fb:e.bitmapSize.height})}}class vR extends dx{constructor(e,t){super(e,t),this.kg=new $_,this.qb=new gR,this.Yb=new fx,this.kg.nt([this.qb,this.Yb])}xb(e,t,n){return{...this.Sb(e,t),...n.Sh(e)}}Bg(){const e=this.ae.N();if(this.Sg===null||this.bg.length===0)return;let t;if(e.relativeGradient){t=this.bg[this.Sg.from].ut;for(let n=this.Sg.from;n<this.Sg.to;n++){const r=this.bg[n];r.ut<t&&(t=r.ut)}}this.qb.ht({Mb:e.lineType,ot:this.bg,Zt:e.lineStyle,ct:e.lineWidth,Db:null,Nb:t,Ib:e.invertFilledArea,lt:this.Sg,wb:this.le.Et().fl()}),this.Yb.ht({Mb:e.lineVisible?e.lineType:void 0,ot:this.bg,Zt:e.lineStyle,ct:e.lineWidth,lt:this.Sg,wb:this.le.Et().fl(),gb:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0})}}const G0={type:"Area",isBuiltIn:!0,defaultOptions:{topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,relativeGradient:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},ob:(s,e)=>new vR(s,e)};class _R{constructor(e,t){this.yt=e,this.lS=t,this.oS()}detach(){this.yt.detachPrimitive(this.lS)}getPane(){return this.yt}applyOptions(e){var t,n;(n=(t=this.lS).vr)==null||n.call(t,e)}oS(){this.yt.attachPrimitive(this.lS)}}const xR={alpha:1,padding:0};class SR{constructor(e){this.qt=e}draw(e){e.useMediaCoordinateSpace((t=>{const n=t.context,r=this.vS(this.qt,t.mediaSize);r&&this.qt.mS&&(n.globalAlpha=this.qt.alpha??1,n.drawImage(this.qt.mS,r._t,r.ut,r.nn,r.$t))}))}vS(e,t){const{maxHeight:n,maxWidth:r,wS:a,MS:u,padding:c}=e,h=Math.round(t.width/2),d=Math.round(t.height/2),p=c??0;let m=t.width-2*p,v=t.height-2*p;n&&(v=Math.min(v,n)),r&&(m=Math.min(m,r));const x=m/u,M=v/a,b=Math.min(x,M),y=u*b,S=a*b;return{_t:h-.5*y,ut:d-.5*S,$t:S,nn:y}}}class yR{constructor(e){this.gS=null,this.bS=0,this.SS=0,this.yn=e,this.M=W0(this.yn,this.gS,this.bS,this.SS)}xS(e){e.CS!==void 0&&(this.bS=e.CS),e.yS!==void 0&&(this.SS=e.yS),e.kS!==void 0&&(this.gS=e.kS),this.kt()}PS(e){this.yn=e,this.kt()}zOrder(){return"bottom"}kt(){this.M=W0(this.yn,this.gS,this.bS,this.SS)}renderer(){return new SR(this.M)}}function W0(s,e,t,n){return{...s,mS:e,MS:t,wS:n}}function X0(s){return{...xR,...s}}class MR{constructor(e,t){this.TS=null,this.RS=e,this.yn=X0(t),this.fS=[new yR(this.yn)]}updateAllViews(){this.fS.forEach((e=>e.kt()))}paneViews(){return this.fS}attached(e){const{requestUpdate:t}=e;this.DS=t,this.TS=new Image,this.TS.onload=()=>{var a,u;const n=((a=this.TS)==null?void 0:a.naturalHeight)??1,r=((u=this.TS)==null?void 0:u.naturalWidth)??1;this.fS.forEach((c=>c.xS({yS:n,CS:r,kS:this.TS}))),this.DS&&this.DS()},this.TS.src=this.RS}detached(){this.DS=void 0,this.TS=null}vr(e){this.yn=X0({...this.yn,...e}),this.IS(),this.pS&&this.pS()}pS(){this.DS&&this.DS()}IS(){this.fS.forEach((e=>e.PS(this.yn)))}}function ER(s,e,t){return new _R(s,new MR(e,t))}({...G_});function wR(s){return s>=1?2:s>=.01?4:8}const px=s=>Nu(s,wR(s)),Wd=s=>Uo(s,{maximumFractionDigits:0}),bR=s=>`${Math.round(s*10)/10}%`,Vf={price:{legend:"GOAT/USD",format:px,log:!0},holders:{legend:void 0,format:Wd,log:!1}},TR=5,CR="#161616";let $0=null;function AR(){return $0??($0=fetch("/g-symbol.svg").then(s=>s.text()).then(s=>`data:image/svg+xml;utf8,${encodeURIComponent(s.replace("<svg ",`<svg fill="${CR}" `))}`)),$0}function RR(s){if(typeof s=="string")return s;if(s&&typeof s=="object"&&"year"in s){const e=s,t=n=>String(n).padStart(2,"0");return`${e.year}-${t(e.month)}-${t(e.day)}`}}function q0(s,e){const t=s.shown;if(t===e)return!1;if(s.shown=e,t.length>0&&e.length>=t.length&&e[0].time===t[0].time&&e[t.length-1].time===t[t.length-1].time)for(let r=t.length-1;r<e.length;r++)s.api.update(e[r]);else s.api.setData(e);return e.length!==t.length}function Y0(s){s.chart.timeScale().setVisibleLogicalRange({from:-.5,to:s.primary.shown.length-.5+TR})}function mx({kind:s,series:e,overlays:t}){const n=bt.useRef(null),r=bt.useRef(null),a=bt.useRef(null),u=bt.useRef(null),c=bt.useRef({series:e,overlays:t});c.current={series:e,overlays:t};const h=Vf[s].legend,d=m=>{r.current&&h&&m!==void 0&&(r.current.textContent=`${h}  ${Vf[s].format(m)}`)},p=bt.useRef(d);return p.current=d,bt.useEffect(()=>{var U;const m=n.current;if(!m)return;const v=getComputedStyle(document.documentElement),x=T=>v.getPropertyValue(T).trim(),M=c.current.overlays??[],b=M.length>0,y=rR(m,{autoSize:!0,layout:{background:{type:Od.Solid,color:x("--bg-sunken")},textColor:x("--fg-subtle"),fontFamily:x("--font-mono"),fontSize:10},grid:{vertLines:{visible:!1},horzLines:{visible:!1}},leftPriceScale:{visible:b,borderVisible:!1,scaleMargins:{top:.25,bottom:.12}}
4198,rightPriceScale:{borderVisible:!1,mode:Vf[s].log?$u.Logarithmic:$u.Normal,scaleMargins:{top:.25,bottom:.12}},timeScale:{borderVisible:!1},...b&&{crosshair:{vertLine:{visible:!1,labelVisible:!1},horzLine:{visible:!1,labelVisible:!1}}}}),S=s==="price"?y.addSeries(G0,{lineColor:x("--signal"),lineWidth:2,topColor:x("--signal-ghost"),bottomColor:"transparent",priceFormat:{type:"custom",formatter:px,minMove:1e-8}}):y.addSeries(G0,{lineColor:x("--signal"),lineWidth:2,topColor:x("--signal-ghost"),bottomColor:"transparent",priceScaleId:b?"left":"right",priceFormat:{type:"custom",formatter:Wd,minMove:1},priceLineVisible:!1}),P={chart:y,primary:{api:S,shown:c.current.series},overlays:new Map};S.setData(P.primary.shown);for(const T of M){const N=y.addSeries(fR,{color:T.color,lineWidth:1,priceScaleId:"right",priceFormat:{type:"custom",formatter:bR,minMove:.1},priceLineVisible:!1,lastValueVisible:!1,crosshairMarkerRadius:3});N.setData(T.data),P.overlays.set(T.id,{api:N,shown:T.data})}return Y0(P),u.current=P,AR().then(T=>{var N;((N=u.current)==null?void 0:N.chart)===y&&ER(y.panes()[0],T,{maxHeight:136,alpha:.5})}),p.current((U=P.primary.shown[P.primary.shown.length-1])==null?void 0:U.value),y.subscribeCrosshairMove(T=>{var G;const N=u.current;if(!N)return;const R=T.seriesData.get(N.primary.api);p.current((R==null?void 0:R.value)??((G=N.primary.shown[N.primary.shown.length-1])==null?void 0:G.value));const F=a.current;if(!F)return;const w=RR(T.time);if(!T.point||!w){F.style.display="none";return}const L=(J,oe,Y)=>`<div class="chart__tip-row"><span>${J?`<i style="background:${J}"></i>`:""}${oe}</span><span>${Y}</span></div>`;let z=`<div class="chart__tip-title">${zT(w)}</div>`;(R==null?void 0:R.value)!==void 0&&(z+=L(void 0,"Holders",Wd(R.value)));for(const J of c.current.overlays??[]){const oe=N.overlays.get(J.id),Y=oe&&T.seriesData.get(oe.api);if((Y==null?void 0:Y.value)!==void 0){const ie=J.tipValue?J.tipValue(w,Y.value):`${Y.value.toFixed(1)}%`;z+=L(J.color,J.label,ie)}}F.innerHTML=z,F.style.display="block";const B=T.point.x>m.clientWidth/2;F.style.left=`${B?T.point.x-F.offsetWidth-14:T.point.x+14}px`}),()=>{u.current=null,y.remove()}},[s]),bt.useEffect(()=>{var x;const m=u.current;if(!m)return;let v=q0(m.primary,e);for(const M of t??[]){const b=m.overlays.get(M.id);b&&(v=q0(b,M.data)||v)}v&&Y0(m),p.current((x=e[e.length-1])==null?void 0:x.value)},[e,t]),D.jsxs("div",{className:"modal__chart",children:[D.jsx("div",{ref:n,className:"modal__chart-host"}),h&&D.jsx("div",{ref:r,className:"modal__legend"}),((t==null?void 0:t.length)??0)>0&&D.jsx("div",{ref:a,className:"chart__tip"})]})}function qu(){return D.jsxs("svg",{className:"k__icon",viewBox:"0 0 256 256","aria-hidden":"true",focusable:"false",children:[D.jsx("rect",{width:"256",height:"256",fill:"none"}),D.jsx("circle",{cx:"128",cy:"128",r:"96",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),D.jsx("path",{d:"M120,120a8,8,0,0,1,8,8v40a8,8,0,0,0,8,8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),D.jsx("circle",{cx:"124",cy:"84",r:"12"})]})}const PR="1RDUvl0zdAVLN6ous1NfPlrYjCn9nWYOARXM3qcO56SA",gx="AIzaSyBDP7_WhHOIhw6jmAxt6g4YQ533-UHE2hU",K0=!!gx,yo=["balanceUnder100","balance100To1k","balance1kTo10k","balance10kTo100k","balance100kTo1m","balance1mTo10m","balance10mTo100m","balanceOver100m"];function wu(s,e){var t;return(t=s.liveRows[e-1])==null?void 0:t[1]}async function NR(s){const e=new URL(`https://sheets.googleapis.com/v4/spreadsheets/${PR}/values:batchGet`);e.searchParams.set("valueRenderOption","UNFORMATTED_VALUE"),e.searchParams.set("dateTimeRenderOption","FORMATTED_STRING"),e.searchParams.append("ranges","live!A:B"),e.searchParams.append("ranges","historicalPrice!A:D"),e.searchParams.append("ranges","historicalLiquidity!A:B"),e.searchParams.append("ranges","historicalSupply!A:D"),e.searchParams.append("ranges","historicalHolders!A:J"),e.searchParams.append("ranges","historicalTransactions!A:C"),e.searchParams.set("key",gx);const t=await fetch(e,{signal:s});if(!t.ok)throw new Error(`Sheets API ${t.status} ${t.statusText}`);const n=await t.json(),[r,a,u,c,h,d]=n.valueRanges??[],p=(r==null?void 0:r.values)??[],m={};for(const[S,P]of p)typeof S=="string"&&S&&(m[S]=P);const v=((a==null?void 0:a.values)??[]).slice(1).map(S=>({date:String(S[0]??""),price:Number(S[1]),marketCap:Number(S[2]),volume:Number(S[3])})).filter(S=>Number.isFinite(S.price)),x=((u==null?void 0:u.values)??[]).slice(1).map(S=>({date:String(S[0]??""),tvl:Number(S[1])})).filter(S=>Number.isFinite(S.tvl)),M=((c==null?void 0:c.values)??[]).slice(1).map(S=>({date:String(S[0]??""),supply:Number(S[1]),burned:Number(S[2]),burnedPct:Number(S[3])})).filter(S=>Number.isFinite(S.supply)),b=((h==null?void 0:h.values)??[]).slice(1).map(S=>({date:String(S[0]??""),holders:Number(S[1]),buckets:Object.fromEntries(yo.map((P,U)=>[P,Number(S[U+2])]))})).filter(S=>Number.isFinite(S.holders)),y=((d==null?void 0:d.values)??[]).slice(1).map(S=>({date:String(S[0]??""),daily:Number(S[1]),cumulative:Number(S[2])})).filter(S=>Number.isFinite(S.cumulative));return{values:m,liveRows:p,priceHistory:v,liquidityHistory:x,supplyHistory:M,holdersHistory:b,txHistory:y}}const j0=[{key:"balanceOver100m",label:">100M",color:"#FF5BAE",info:"Includes GOAT liquidity pool reserves."},{key:"balance10mTo100m",label:"10M–100M",color:"#E8A93C"},{key:"balance1mTo10m",label:"1M–10M",color:"#D94BFF"},{key:"balance100kTo1m",label:"100K–1M",color:"#B8FF3C"},{key:"balance10kTo100k",label:"10K–100K",color:"#A585FF"},{key:"balance1kTo10k",label:"1K–10K",color:"#FF7A3C"},{key:"balance100To1k",label:"100–1K",color:"#3EFFA8"},{key:"balanceUnder100",label:"<100",color:"#FF2B5B"}];function vx(s){const e=new Map;for(const h of s){const d=op(h.date);d&&e.set(d,h)}const t=[...e.entries()].sort(([h],[d])=>h<d?-1:1);if(t.length<2)return;const n=[],r=Object.fromEntries(yo.map(h=>[h,[]])),a=Object.fromEntries(yo.map(h=>[h,new Map]));for(const[h,d]of t)if(!(!Number.isFinite(d.holders)||d.holders<=0)){n.push({time:h,value:d.holders});for(const p of yo){const m=d.buckets[p];Number.isFinite(m)&&(r[p].push({time:h,value:m/d.holders*100}),a[p].set(h,m))}}const u=t[t.length-1][1],c=Object.fromEntries(yo.map(h=>{const d=Number.isFinite(u.buckets[h])?u.buckets[h]:0;return[h,{count:d,share:u.holders>0?d/u.holders*100:0}]}));return{holders:n,pct:r,counts:a,latest:c}}function LR({data:s}){var r;const e=j0.map(a=>({id:a.key,label:a.label,color:a.color,data:s.pct[a.key],tipValue:(u,c)=>`${s.counts[a.key].get(u)??"—"} | ${c.toFixed(1)}%`})),t=a=>Uo(a,{maximumFractionDigits:0}),n=(r=s.holders[s.holders.length-1])==null?void 0:r.value;return D.jsxs("div",{className:"market",children:[D.jsx(mx,{kind:"holders",series:s.holders,overlays:e}),D.jsxs("div",{className:"dist__table",children:[D.jsxs("div",{className:"dist__head",children:[D.jsx("span",{children:"Balance"}),D.jsx("span",{children:"Holders · % Split"})]}),D.jsxs("div",{className:"dist__row",children:[D.jsxs("span",{className:"dist__label",children:[D.jsx("i",{className:"dist__swatch",style:{background:"var(--signal)"}}),"All"]}),D.jsxs("span",{className:"dist__value",children:[D.jsx("span",{className:"dist__count",children:n!==void 0?t(n):"—"}),D.jsx("span",{})]})]}),j0.map(a=>{const{count:u,share:c}=s.latest[a.key];return D.jsxs("div",{className:"dist__row",children:[D.jsxs("span",{className:"dist__label",children:[D.jsx("i",{className:"dist__swatch",style:{background:a.color}}),a.label,a.info&&D.jsxs("span",{className:"k__info",children:[D.jsxs("button",{type:"button",className:"k__info-btn","aria-describedby":`dist-tip-${a.key}`,children:[D.jsxs("span",{className:"sr-only",children:["About ",a.label]}),D.jsx(qu,{})]}),D.jsx("span",{role:"tooltip",id:`dist-tip-${a.key}`,className:"k__tip k__tip--left",children:a.info})]})]}),D.jsxs("span",{className:"dist__value",children:[D.jsx("span",{className:"dist__count",children:t(u)}),D.jsxs("span",{children:[c.toFixed(1),"%"]})]})]},a.key)})]})]})}const DR="https://www.coingecko.com/en/coins/goatcoin-2",Q0="—";function IR({series:s,ranking:e,stats:t={},updated:n}){const r=[{label:"GOAT/USD Price",value:t.price},{label:"Change 24h",value:t.change24h,tone:t.change24hTone},{label:"24h High",value:t.high24h},{label:"24h Low",value:t.low24h},{label:"All-Time High",value:t.ath},{label:"All-Time Low",value:t.atl},{label:"Market Cap",value:t.marketCap,info:"MARKET CAP = PRICE × TOTAL SUPPLY"},{label:"Volume 24h",value:t.volume24h},{label:"Volume All-Time",value:t.allTimeVolume}];return D.jsxs("div",{className:"market",children:[D.jsx(mx,{kind:"price",series:s}),D.jsxs("div",{className:"market__meta",children:[D.jsx("span",{children:"Tracked by Coin Gecko"}),D.jsxs("a",{className:"market__rank",href:DR,target:"_blank",rel:"noopener noreferrer",children:[D.jsx("img",{src:"/coin/CG-Symbol-1.svg",alt:"",width:"14",height:"14"}),"Ranking #",e??Q0]})]}),D.jsx("div",{className:"market__table",children:r.map(({label:a,value:u,tone:c,info:h})=>D.jsxs("div",{className:"market__row",children:[D.jsxs("span",{className:"market__label",children:[a,h&&D.jsxs("span",{className:"k__info",children:[D.jsxs("button",{type:"button",className:"k__info-btn","aria-describedby":`market-tip-${a.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,children:[D.jsxs("span",{className:"sr-only",children:["About ",a]}),D.jsx(qu,{})]}),D.jsx("span",{role:"tooltip",id:`market-tip-${a.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,className:"k__tip k__tip--left",children:h})]})]}),D.jsx("span",{className:`market__row-value${c?` ${c}`:""}`,children:u??Q0})]},a))}),n&&D.jsxs("div",{className:"market__updated",children:["Last updated ",n]})]})}const Hf=200,Z0=4;function UR({points:s,color:e="var(--signal)",fill:t,height:n=48,meta:r}){const a=bt.useRef(null),[u,c]=bt.useState(null);if(s.length<2)return D.jsx("div",{className:"spark",style:{height:n}});const h=Math.min(...s),p=Math.max(...s)-h||1,m=Hf/(s.length-1),v=s.map((T,N)=>({x:N*m,y:n-Z0-(T-h)/p*(n-Z0*2)})),x=v.map((T,N)=>`${N===0?"M":"L"}${T.x.toFixed(1)},${T.y.toFixed(1)}`).join(" "),M=`${x} L${Hf},${n} L0,${n} Z`,b=!!r&&r.length===s.length,y=b&&u!=null?u:null;function S(T){const N=a.current;if(!N)return;const R=N.getBoundingClientRect(),F=(T.clientX-R.left)/R.width,w=Math.round(F*(s.length-1));c(Math.max(0,Math.min(s.length-1,w)))}const P=y!=null?y/(s.length-1)*100:0,U=P<25?" spark__tip--start":P>75?" spark__tip--end":"";return D.jsxs("div",{ref:a,className:"spark",style:{height:n},onPointerMove:b?S:void 0,onPointerLeave:b?()=>c(null):void 0,children:[D.jsxs("svg",{viewBox:`0 0 ${Hf} ${n}`,preserveAspectRatio:"none",children:[t&&D.jsx("path",{d:M,fill:t}),D.jsx("path",{d:x,fill:"none",stroke:e,strokeWidth:1.5})]}),y!=null&&r&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"spark__cursor",style:{left:`${P}%`}}),D.jsx("div",{className:"spark__dot",style:{left:`${P}%`,top:v[y].y,background:e,boxShadow:`0 0 6px ${e}`}}),D.jsxs("div",{className:`spark__tip${U}`,style:{left:`${P}%`},children:[D.jsx("div",{className:"spark__tip-title",children:r[y].label}),r[y].rows.map(T=>D.jsxs("div",{className:"spark__tip-row",children:[D.jsx("span",{children:T.name}),D.jsx("span",{children:T.value})]},T.name))]})]})]})}function FR(){const s={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"};return D.jsxs("svg",{viewBox:"0 0 256 256","aria-hidden":"true",focusable:"false",children:[D.jsx("rect",{width:"256",height:"256",fill:"none"}),D.jsx("polyline",{points:"160 48 208 48 208 96",...s}),D.jsx("line",{x1:"152",y1:"104",x2:"208",y2:"48",...s}),D.jsx("polyline",{points:"96 208 48 208 48 160",...s}),D.jsx("line",{x1:"104",y1:"152",x2:"48",y2:"208",...s}),D.jsx("polyline",{points:"208 160 208 208 160 208",...s}),D.jsx("line",{x1:"152",y1:"152",x2:"208",y2:"208",...s}),D.jsx("polyline",{points:"48 96 48 48 96 48",...s}),D.jsx("line",{x1:"104",y1:"104",x2:"48",y2:"48",...s})]})}function OR({data:s}){const{span:e,label:t,tag:n,labelTag:r,tagIcon:a,info:u,value:c,valuePrefix:h,valueSuffix:d,unit:p,valueColor:m,spark:v,subLeft:x,subRight:M,subRightValue:b,delta:y,expandable:S,modalTitle:P,modalContent:U,modalSeries:T,modalRanking:N,modalStats:R,modalUpdated:F,modalHolders:w}=s,[L,z]=bt.useState(!1),B=D.jsxs("div",{className:"v",style:m?{color:m}:void 0,children:[h&&D.jsx("span",{className:"v__prefix",children:h}),c,d&&D.jsx("span",{className:"v__suffix",children:d}),p&&D.jsx("span",{className:"u",children:p})]}),G=`metric-tip-${t.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return D.jsxs("div",{className:`card metric span-${e}`,children:[D.jsxs("div",{className:"k",children:[D.jsxs("span",{children:[t,r&&` | ${r}`]}),S?D.jsxs("button",{type:"button",className:"metric__expand",onClick:()=>z(!0),children:[D.jsx("span",{className:"sr-only",children:"Expand chart"}),D.jsx(FR,{})]}):a==="info"&&u?D.jsxs("span",{className:"k__info",children:[D.jsxs("button",{type:"button",className:"k__info-btn","aria-describedby":G,children:[D.jsxs("span",{className:"sr-only",children:["About ",t]}),D.jsx(qu,{})]}),D.jsx("span",{role:"tooltip",id:G,className:"k__tip",children:u})]}):D.jsx("span",{children:a==="info"?D.jsx(qu,{}):n})]}),B,D.jsx(UR,{points:v.points,color:v.followDelta?y==="down"?"var(--down)":y==="up"?"var(--up)":"var(--signal)":v.color,fill:v.fill,height:v.height,meta:v.meta}),D.jsxs("div",{className:"sub",children:[D.jsx("span",{children:x}),D.jsxs("span",{className:"sub__right",children:[b&&D.jsx("span",{children:b}),M&&D.jsx("span",{className:`delta${y?` ${y}`:""}`,children:M})]})]}),L&&D.jsxs(Gf,{title:P??t,onClose:()=>z(!1),children:[U==="price"&&T&&D.jsx(IR,{series:T,ranking:N,stats:R,updated:F}),U==="holders"&&w&&D.jsx(LR,{data:w})]})]})}const kR="https://goatswap.io";function BR(){return D.jsxs("div",{className:"card span-12 promo bridge",children:[D.jsxs("div",{className:"promo__row",children:[D.jsxs("h2",{className:"promo__stack",children:[D.jsx("span",{className:"promo__line promo__line--goatswap",children:"GOATSWAP"}),D.jsx("span",{className:"promo__line promo__line--evm",children:"EVM > APTOS"}),D.jsx("span",{className:"promo__line promo__line--app",children:"BRIDGE APP"})]}),D.jsxs("a",{className:"promo__icon",href:kR,target:"_blank",rel:"noreferrer noopener",children:[D.jsx("span",{className:"sr-only",children:"Buy GOAT on GOATSWAP — goatswap.io"}),D.jsx("span",{className:"promo__mark","aria-hidden":"true",children:"₲"})]})]}),D.jsx("p",{className:"promo__soon",children:"GOATSWAP.IO"})]})}function zR(){return D.jsxs("div",{className:"card span-12 promo follow",children:[D.jsxs("div",{className:"promo__row",children:[D.jsxs("h2",{className:"promo__stack",children:[D.jsx("span",{className:"promo__line promo__line--follow",children:"FOLLOW"}),D.jsx("span",{className:"promo__line promo__line--goatcoin",children:"GOATCOIN"})]}),D.jsxs("a",{className:"promo__icon promo__icon--link",href:"https://x.com/goatcoin4",target:"_blank",rel:"noreferrer noopener",children:[D.jsx("span",{className:"sr-only",children:"Follow GOATCOIN on X — @goatcoin4"}),D.jsx("svg",{className:"promo__mark-svg",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:D.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})]})]}),D.jsx("p",{className:"promo__soon",children:"@GOATCOIN4"})]})}function J0(s){return s<=640?1:s<=1024?2:3}function e_({children:s,gap:e=14,className:t}){const[n,r]=bt.useState(()=>typeof window>"u"?3:J0(window.innerWidth));bt.useEffect(()=>{const c=()=>r(J0(window.innerWidth));return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]);const a=bt.Children.toArray(s),u=Array.from({length:n},()=>[]);return a.forEach((c,h)=>{u[h%n].push(c)}),D.jsx("div",{className:`masonry${t?` ${t}`:""}`,style:{gap:e},children:u.map((c,h)=>D.jsx("div",{className:"masonry__col",style:{gap:e},children:c},h))})}function VR(s){const t=Date.now();return s.map((n,r)=>({time:op(new Date(t-(s.length-1-r)*864e5)),value:n}))}function mr(s,e,t){return{date:s,holders:e,buckets:Object.fromEntries(yo.map((n,r)=>[n,t[r]]))}}const HR=[mr("04/02/2026",2,[1,0,0,0,0,0,0,1]),mr("04/30/2026",17,[0,0,0,1,2,6,5,3]),mr("05/30/2026",24,[1,4,1,1,1,7,6,3]),mr("06/15/2026",34,[6,3
4198,3,4,0,8,6,4]),mr("06/30/2026",42,[12,5,3,4,1,8,6,3]),mr("07/15/2026",44,[12,7,3,4,1,7,7,3]),mr("07/30/2026",48,[12,10,3,4,1,7,7,4])],_x=[{span:4,label:"GOAT/USD",tag:"",labelTag:"MCap $408.4M",value:"$0.000015",spark:{points:[60,56,58,50,46,48,40,36,38,28,22],color:"var(--signal)",fill:"var(--signal-ghost)"},subLeft:"Last 24h change",subRight:"−2.31%",delta:"down",expandable:!0,modalTitle:"₲OAT Market Data",modalContent:"price",modalSeries:VR([60,56,58,50,46,48,40,36,38,28,22]),modalRanking:"1024"},{span:4,label:"All-time volume",tag:"",tagIcon:"info",info:"CUMULATIVE DAILY TRADING VOLUME – TRACKED BY COIN GECKO",value:"$2.41M",spark:{points:[8,14,10,18,16,24,20,28,26,34,30],color:"var(--signal)",fill:"var(--signal-ghost)"},subLeft:"Last 24h",subRightValue:"$182K",subRight:""},{span:4,label:"DeFi TVL",tag:"",tagIcon:"info",info:"TOTAL VALUE OF LIQUIDITY ACROSS DEX PLATFORMS",value:"$8.94M",spark:{points:[20,22,24,23,28,30,29,34,33,38,40],color:"var(--signal)",fill:"var(--signal-ghost)"},subLeft:"Last 24h change",subRight:"+3.8%",delta:"up"},{span:4,label:"Supply",tag:"(Buyback & Burn starts Q4)",value:"3,333,333,333",valueSuffix:"₲OAT",spark:{points:[36,32,28,24,20,18,14,13,10,9,8],color:"var(--signal)",fill:"var(--signal-ghost)"},subLeft:"Burned since launch",subRight:"15.27%"},{span:4,label:"Holders",tag:"",value:"14,921",spark:{points:[6,10,14,18,20,24,28,30,34,38,40],color:"var(--signal)",fill:"var(--signal-ghost)"},subLeft:"Today (since 00:00 UTC)",subRight:"+217",delta:"up",expandable:!0,modalTitle:"Holder Distribution",modalContent:"holders",modalHolders:vx(HR)},{span:4,label:"All-time transactions",tag:"",tagIcon:"info",info:"CUMULATIVE DAILY TRANSACTIONS",value:"38,204",spark:{points:[14,18,16,22,20,26,24,30,28,34,32],color:"var(--signal)",fill:"var(--signal-ghost)"},subLeft:"Last 24h",subRightValue:"1,204",subRight:"+6.02%",delta:"up"}];function xx(s){const e=s===void 0?"":String(s).trim();return e||void 0}function t_(s){return(xx(s)??"").split("/").map(e=>e.trim()).filter(Boolean).map(e=>`$${e}`)}function GR(s){const e=xx(s);if(!e)return;const t=new Date(e.replace(" UTC","Z").replace(" ","T")).getTime();if(!Number.isFinite(t))return;const n=Math.max(0,Math.round((Date.now()-t)/6e4));return n===1?"1 min ago":`${n} mins ago`}function WR(s,e,t){const n=new Map;for(const r of s){const a=op(e(r)),u=t(r);a!==""&&Number.isFinite(u)&&n.set(a,u)}return[...n.entries()].sort(([r],[a])=>r<a?-1:1).map(([r,a])=>({time:r,value:a}))}function XR(s,e){return Number.isFinite(e)&&e!==0?(s-e)/e*100:NaN}function Yu(s,e){return Number.isFinite(s)?s<0?"down":s>0?"up":void 0:e}function $R(s,e){const t=Number(e.values.price),n=Number(e.values.marketCap),r=Number(e.values.geckoPriceChangePercentage24h),a=Number.isFinite(r),u=Number(e.values.geckoRanking),c=e.priceHistory,h=c.length>=2,d=Number(wu(e,19)),p=c.reduce((b,y)=>b+(Number.isFinite(y.volume)?y.volume:0),0),[m,v]=t_(wu(e,21)),[x,M]=t_(wu(e,22));return{...s,value:Number.isFinite(t)?Nu(t,8):s.value,labelTag:Number.isFinite(n)?`MCap $${$v(n)}`:s.labelTag,subRight:a?Dd(r):s.subRight,delta:Yu(r,s.delta),modalSeries:h?WR(c,b=>b.date,b=>b.price):s.modalSeries,modalRanking:Number.isFinite(u)?String(u):s.modalRanking,modalStats:{price:Number.isFinite(t)?Nu(t,8):void 0,change24h:a?Dd(r):void 0,change24hTone:Yu(r,void 0),high24h:m,low24h:v,marketCap:Number.isFinite(n)?as(n):void 0,volume24h:Number.isFinite(d)?as(d):void 0,allTimeVolume:p>0?as(p):void 0,ath:x,atl:M},modalUpdated:GR(wu(e,23)),spark:{...s.spark,points:h?c.map(b=>b.price):s.spark.points,meta:h?c.map(b=>({label:Fo(b.date),rows:[{name:"Price",value:Nu(b.price,8)},{name:"MCap",value:`$${$v(b.marketCap)}`}]})):s.spark.meta}}}function qR(s,e){const t=e.priceHistory;if(t.length<1)return s;const n=t.map(d=>Number.isFinite(d.volume)?d.volume:0);let r=0;const a=n.map(d=>r+=d),u=a[a.length-1],c=n[n.length-1],h=n.length>=2;return{...s,value:as(u),subRightValue:as(c),subRight:"",delta:void 0,spark:{...s.spark,points:h?a:s.spark.points,meta:h?t.map((d,p)=>({label:Fo(d.date),rows:[{name:"Cumulative",value:as(a[p])},{name:"24h vol",value:as(n[p])}]})):s.spark.meta}}}function YR(s,e){const t=e.liquidityHistory;if(t.length<1)return s;const n=t.map(h=>Number.isFinite(h.tvl)?h.tvl:0),r=n[n.length-1],a=n.length>=2?n[n.length-2]:NaN,u=XR(r,a),c=Number.isFinite(u);return{...s,value:as(r),subRight:c?Dd(u):s.subRight,delta:Yu(u,s.delta),spark:{...s.spark,points:n.length>=2?n:s.spark.points,meta:n.length>=2?t.map(h=>({label:Fo(h.date),rows:[{name:"TVL",value:as(Number.isFinite(h.tvl)?h.tvl:0)}]})):s.spark.meta}}}function KR(s,e){const t=e.supplyHistory;if(t.length<1)return s;const n=t[t.length-1],r=t.length>=2,a=u=>Uo(u,{maximumFractionDigits:0});return{...s,value:Number.isFinite(n.supply)?a(n.supply):s.value,subRight:Number.isFinite(n.burnedPct)?qv(n.burnedPct):s.subRight,spark:{...s.spark,points:r?t.map(u=>u.supply):s.spark.points,meta:r?t.map(u=>({label:Fo(u.date),rows:[{name:"Supply",value:a(u.supply)},{name:"% Burned",value:qv(u.burnedPct)}]})):s.spark.meta}}}function jR(s,e){const t=e.holdersHistory;if(t.length<1)return s;const n=t.map(d=>Number.isFinite(d.holders)?d.holders:0),r=n[n.length-1],a=n.length>=2?n[n.length-2]:NaN,u=Number.isFinite(a)?r-a:NaN,c=Number.isFinite(u),h=d=>Uo(d,{maximumFractionDigits:0});return{...s,value:h(r),subRight:c?BT(u):s.subRight,delta:Yu(u,s.delta),modalHolders:vx(t)??s.modalHolders,spark:{...s.spark,points:n.length>=2?n:s.spark.points,meta:n.length>=2?t.map(d=>({label:Fo(d.date),rows:[{name:"Holders",value:h(d.holders)}]})):s.spark.meta}}}function QR(s,e){const t=e.txHistory;if(t.length<1)return s;const n=t[t.length-1],r=t.map(c=>c.cumulative),a=t.length>=2,u=c=>Uo(c,{maximumFractionDigits:0});return{...s,value:Number.isFinite(n.cumulative)?u(n.cumulative):s.value,subLeft:"Today (since 00:00 UTC)",subRightValue:Number.isFinite(n.daily)?u(n.daily):s.subRightValue,subRight:"",delta:void 0,spark:{...s.spark,points:a?r:s.spark.points,meta:a?t.map(c=>({label:Fo(c.date),rows:[{name:"Cumulative",value:u(c.cumulative)},{name:"24h txs",value:u(Number.isFinite(c.daily)?c.daily:0)}]})):s.spark.meta}}}const n_={"GOAT/USD":$R,"All-time volume":qR,"DeFi TVL":YR,Supply:KR,Holders:jR,"All-time transactions":QR},i_=6e4,ZR=_x.map(s=>({...s,value:"—",labelTag:void 0,subRight:"",subRightValue:void 0,delta:void 0,spark:{...s.spark,points:[],meta:void 0},modalSeries:void 0,modalRanking:void 0,modalStats:void 0,modalUpdated:void 0,modalHolders:void 0}));function JR(){const[s,e]=bt.useState(K0?ZR:_x);return bt.useEffect(()=>{if(!K0){console.warn("[goatcoin] VITE_GOOGLE_SHEETS_API_KEY is not set — showing sample data.");return}const t=new AbortController;let n=!1,r=0,a=!1;const u=async()=>
4198{if(!n){n=!0;try{const d=await NR(t.signal);r=Date.now(),a=!1,e(p=>p.map(m=>n_[m.label]?n_[m.label](m,d):m))}catch(d){!t.signal.aborted&&!a&&(a=!0,console.warn("[goatcoin] live metrics fetch failed — keeping last figures.",d))}finally{n=!1}}},c=window.setInterval(()=>{document.hidden||u()},i_),h=()=>{!document.hidden&&Date.now()-r>=i_&&u()};return document.addEventListener("visibilitychange",h),u(),()=>{t.abort(),window.clearInterval(c),document.removeEventListener("visibilitychange",h)}},[]),s}function e2(){const s=JR();return D.jsxs("div",{className:"app",children:[D.jsx(cy,{}),D.jsx("main",{className:"app-main",children:D.jsxs("section",{"aria-label":"GOATCOIN dashboard",className:"masonry-stack",children:[D.jsxs("div",{className:"hero-grid",children:[D.jsx(VT,{}),D.jsx(_y,{}),D.jsx(GT,{})]}),D.jsx(e_,{className:"masonry--metrics",children:s.map(e=>D.jsx(OR,{data:e},e.label))}),D.jsxs(e_,{className:"masonry--community",children:[D.jsx(XT,{}),D.jsx(BR,{}),D.jsx(zR,{})]})]})}),D.jsx(vy,{})]})}const t2=bt.lazy(()=>ty(()=>import("./BlueprintPage-DFSr4Z7z.js"),__vite__mapDeps([0,1]))),Sx=document.getElementById("root");if(!Sx)throw new Error("Root element #root not found");const n2=window.location.pathname.replace(/\/+$/,"");uy.createRoot(Sx).render(D.jsx(bt.StrictMode,{children:n2==="/blueprint"?D.jsx(bt.Suspense,{fallback:null,children:D.jsx(t2,{})}):D.jsx(e2,{})}));export{Od as $,G0 as U,rR as a,D as j,bt as r};

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.